checkout

Dynamic synched custom checkout select fields in WooCommerce

假装没事ソ 提交于 2019-12-04 20:06:36
In Woocommerce I have been able to add 2 custom dropdowns list in checkout page: add_action('woocommerce_before_order_notes', 'wps_add_select_checkout_field'); function wps_add_select_checkout_field( $checkout) { echo '<h2>'.__('Next Day Delivery').'</h2>'; woocommerce_form_field( 'City', array( 'type' => 'select', 'class' => array( 'wps-drop' ), 'label' => __( 'Delivery options' ), 'options' => array( 'blank' => __( 'Select a day part', 'wps' ), 'A' => __( 'A', 'wps' ), 'B' => __( 'B', 'wps' ), 'C' => __( 'C', 'wps' ) ) ), $checkout->get_value( 'City' )); } add_action('woocommerce_before

On country change ajax update checkout for shipping in Woocommerce

…衆ロ難τιáo~ 提交于 2019-12-04 19:04:08
I'm looking for a way to update order review (shipping price) when client change country on checkout page. I want to use jQuery. but wc_checkout_params wc_checkout_params is deprecated. function custom_checkbox_checker() { if (is_checkout()) { wp_enqueue_script('jquery'); ?> <script type="text/javascript"> jQuery(document).ready(function (e) { var $ = jQuery; // wc_checkout_params is required to continue, ensure the object exists if (typeof wc_checkout_params === 'undefined') return false; var updateTimer, dirtyInput = false, xhr; function update_shipping(billingstate, billingcountry) { if

Send a custom email when WooCommerce checkout button is pressed

烈酒焚心 提交于 2019-12-04 19:03:18
I am trying to send a custom email whenever the checkout button is pressed for Woocommerce using PHP. This email will be sent alongside with the email notifications of wooCommerce. I have used this answer , and edited the code like: //execute some php on successfull checkout add_action( 'woocommerce_payment_complete', 'so_32512552_payment_complete' ); function so_32512552_payment_complete( $order_id ){ $order = wc_get_order( $order_id ); foreach ( $order->get_items() as $item ) { if ( $item['product_id'] > 0 ) { $_product = $order->get_product_from_item( $item ); // the message $msg = "First

Spree Checkout - Remove Step

走远了吗. 提交于 2019-12-04 13:47:27
I am trying to remove 2 checkout steps. I have tried to follow the documentation in the site http://guides.spreecommerce.com/checkout.html but still nothing happens. I am using Spree 1.1.2 ruby 1.9.2p318 Rails 3.2.6 Ubuntu 12.04 (precise) 32-bit I'll tell you what I have done and you will tell me what to fix. Should I change the name or location of the file? Or should I change other files too? How can I debug it? I have created a new file "app/models/spree/order_decorator.rb" (also tried it under "app/models/order_decorator.rb") module SpreeCustomExtension class Engine < Rails::Engine def self

Display Custom Field's Value in Woocommerce Cart & Checkout items

浪子不回头ぞ 提交于 2019-12-04 13:37:44
I have been looking for a solution for a while all over internet but couldn't find any proper solution. I am using several custom fields in my product page like, 'Minimum-Cooking-Time', 'Food-Availability' etc. So, I like to show this custom field's value in my cart and checkout page. I tried snippets in function file and editing woocommerce cart file too. I have tried several codes but they are not pulling any data from my custom fields. As you can see in the screenshot below, I want to show 'Minimum-Cooking-Time' in that black rectangular area for every product: I have used the following

How can i add a driver tip in magento onepage checkout process?

与世无争的帅哥 提交于 2019-12-04 13:26:33
问题 Currently i have an requirement of adding a custom Driver tip step in magento onepage checkout process, right after the shipping method(step-3), in which i want user to select tip from some given options(i will make radio buttons), that will contain certain amounts, suppose user selected $150 then this amount will be added into total payment ? i tried all other tutorials over google, none of them is working for me, any help is appreciated, 回答1: I recently work on similar type of requirement.

Extending Magento Shopping Cart

依然范特西╮ 提交于 2019-12-04 12:25:11
问题 I need to extend the Magento shopping cart to include an extra step for a store locator. I understand that I need to overwrite the core OnePage controller ( Mage_Checkout_OnepageController ) and blocks ( Mage_Checkout_Block_Onepage ) but what needs to be done with regards to keeping track of the extra information (e.g. user's selected options from my custom step). 回答1: There are a number of steps required here to get the whole solution. Firstly, create a new module. Use the ModuleCreator if

Adding a hidden fields to checkout and process it through order

戏子无情 提交于 2019-12-04 12:20:37
I would like to add an verification code to the checkout process that is read-only ( or invisible) and pre-filled, pinned on an order. The Customer Need this Code to verifiy the Order. I add a custom Array to the Billing Field at the woocommerce_checkout_fields filter: //VID $fields['billing']['billing_vid'] = array( 'label' => __('', 'woocommerce'), 'placeholder' => _x('', 'placeholder', 'woocommerce'), 'required' => false, 'type' => 'text', 'class' => array('form-row-wide'), 'clear' => false, 'default' => wp_rand(10000,99999) ); This works, but the Customer still can write Content in the

WooCommerce Custom Field in Checkout

▼魔方 西西 提交于 2019-12-04 09:29:07
I want add Custom field in WooCommerce checkout page but for selected products. For e.g if Client have Product A in cart only than this custom field should appear in WooCommerce Checkout Page I am using following code in functions.php to add custom field: add_action('woocommerce_before_order_notes', 'my_delivery_checkout_field'); function my_delivery_checkout_field( $checkout ) { echo '<div id="my_local_club"><h3>'.__('Delivery Options').'</h3>'; woocommerce_form_field( 'delivery_options', array( 'type' => 'select', 'class' => array('my-club-class form-row-wide'), 'label' => _('<br><br>Please

Woocommerce: Set checkout field values

こ雲淡風輕ζ 提交于 2019-12-04 07:29:09
For a special group of customers that aren't yet WP user in my system, I am directing them to a special page, where they'll choose from a limited set of products. I already have all of their information and I it's going to pre-populate on this landing page. When they've verified their information, it will add their product to the cart and skip straight to the checkout. I've got all that down so far. What I want to do is pre-populate the checkout data with the customer name and billing information that I have and I'm not entirely certain how to do that. But here's what I've got so far: function