checkout

Update cart shipping data with AJAX in WooCommerce

耗尽温柔 提交于 2019-12-23 04:53:05
问题 I'm trying to update my checkout cart's shipping with AJAX... I've got the action in functions.php function jwd_update_shipping() { WC()->cart->calculate_shipping(); echo "hi"; die(); } add_action('jwd_update_shipping_callback', 'jwd_update_shipping'); Then in js I call it, like so jQuery.ajax({ type: "POST", url: 'MYSITE.com/wp-admin/admin-ajax.php', data: ({ action: "jwd_update_shipping" }), success: function(response) { console.log("got this: " + response); if (response.type == "success")

Magento onepage checkout steps not expanding

血红的双手。 提交于 2019-12-23 03:41:12
问题 I am having some sort of javascript or jquery conflict with my onepage checkout. None of the steps are expanding. Please have a look at my site here http://50.87.6.244/~storeupp/index.php/checkout/onepage/ . Any help to what is causing this issue would be great! I don't know where to start on how to debug the script issue. Thanks! 回答1: My hunch is this is indeed a jquery - prototype conflict, just try using jquery.noConflict() where possible. What i always do is i order the js files. First i

Magento onepage checkout steps not expanding

狂风中的少年 提交于 2019-12-23 03:41:10
问题 I am having some sort of javascript or jquery conflict with my onepage checkout. None of the steps are expanding. Please have a look at my site here http://50.87.6.244/~storeupp/index.php/checkout/onepage/ . Any help to what is causing this issue would be great! I don't know where to start on how to debug the script issue. Thanks! 回答1: My hunch is this is indeed a jquery - prototype conflict, just try using jquery.noConflict() where possible. What i always do is i order the js files. First i

WooCommerce: Account Password Field in Checkout page

杀马特。学长 韩版系。学妹 提交于 2019-12-22 13:01:55
问题 My main goal is to change the "create an account" checkout to register the email as a username. The easy way I thought of was changing "Account Password" from password to email to override user_login . However, I can't seem to find where the "Password" text box is coming from. I know that this the code I needed under form-billing.php , but I am unsure how only password is showing considering there's a for-loop . <?php foreach ( $checkout->checkout_fields['account'] as $key => $field ) : ?> <

How to customize magento onepage checkout form

人走茶凉 提交于 2019-12-22 04:16:17
问题 i am using Magento 1.5.1.0 and i want to customize the address block in the onepage checkout form. I want to remove the "fax" input field and put the "region" dropdown below the country "dropdown". Where is this form defined? Kind Regards, Bertie 回答1: Navigate to your theme folder. The default file is at location: app\design\frontend\base\default\template\checkout\onepage\shipping.phtml 回答2: You might need to change multiple files: As above: app\design\frontend\base\default\template\checkout

Dynamic synched custom checkout select fields in WooCommerce

折月煮酒 提交于 2019-12-21 23:43:48
问题 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'

Change payment methods location before order details table in Woocommerce

耗尽温柔 提交于 2019-12-21 20:48:46
问题 I need to alter the default Woocommerce checkout a little bit. I need to move the payment options ABOVE the order review table, while keeping the "Place Order" button at the bottom below the order review table. I currently have remove_action('woocommerce_checkout_order_review','woocommerce_checkout_payment', 20 ); add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 5 ); This moves the payment box above the table, but it also moves the button. How can I keep the

Add an image on Woocommerce payment method title

这一生的挚爱 提交于 2019-12-21 20:46:50
问题 In Woocommerce, I plan on adding images before bank name plugin BACS. at now I'm already input bank name and other setting and already try inputting HTML before bank name but it does not work. 回答1: You can easily add an icon (an image) to the payment gateways in checkout page. But in Woocommerce this icon is located after the title. To change it before the title you should need to edit the related template checkout/payment-method.php at line 27 from this: <?php echo $gateway->get_title(); ?>

Magento: Show the Review Step in One Page Checkout

末鹿安然 提交于 2019-12-21 02:46:09
问题 I have not been able to figure this out for the life of me. I wanted to show the order review step(final step before processing the order) right away on the one page checkout in Magento. Any suggestions? Thanks all. 回答1: If you look at the bottom of onepage.phtml, you will see <?php if($this->getActiveStep()): ?> accordion.openSection('opc-<?php echo $this->getActiveStep() ?>'); <?php endif; ?> which calls Mage_Checkout_Block_Onepage::getActiveStep() to determine which step to show first. You

Only allow to purchase one Item In Woocommerce 3

烂漫一生 提交于 2019-12-20 05:15:52
问题 Is there anyway to prevent more than one item for purchase in WooCommerce, or prevent more than one item added to the cart? I have different products but I want to allow only one item per checkout. I tried to search for solution but those existing solutions are not working properly, let's say when user is not signed in and adds an item into cart and then goes to checkout and logins there an item that has been added previously when customer was logged in also adds up to the one customer just