checkout

Add a custom field below billing country in Woocommerce Checkout

喜你入骨 提交于 2019-12-11 04:37:11
问题 I'm using WordPress 5.0.2 with WooCommerce 3.5.3 and I have a custom select dropdown field with optgroup on the checkout page, the field work as expected but it appear after the order note and I would like that it appear below the billing_country field. add_action('woocommerce_before_order_notes', 'custom_checkout_select_field_with_optgroup', 10, 1 ); function custom_checkout_select_field_with_optgroup( $checkout ) { $domain = 'woocommerce'; $title = __("Region", $domain); $slug = sanitize

Save and display specific payment gateway additional field everywhere in Woocommerce

帅比萌擦擦* 提交于 2019-12-11 04:24:32
问题 I am using "Additional field on checkout for specific payment gateway in Woocommerce" answer code, that displays an additional dropdown field for specific payment gateway in checkout page. How to save and display the options on the orders and on email notifications? 回答1: Continuation of "Additional field on checkout for specific payment gateway in Woocommerce" Here is the complete way to: Add a dropdown with options to BACS payment Field validation (required option) Save chosen option as

Magento 1.5.1 checkout Method “” is not defined in “”

ぐ巨炮叔叔 提交于 2019-12-11 04:22:42
问题 I'm running Magento 1.5.1 (which I am using because it is the latest version that works with Lightspeed POS) with a custom theme that I created. I am running the Lightspeed POS Connector and I have manually installed the Virtual Merchant add-on. My server is share hosted by hostmonster. When I try to checkout I get an alert with the error Method "" is not defined in "" . Firebug gives me the following: POST https://odd-style.com/magento/index.php/checkout/onepage/saveOrder/ 200 OK {"success"

select option in payment method instead of radion button in magento

元气小坏坏 提交于 2019-12-11 03:11:58
问题 This is my methods.phtml file in onepagecheckout in magento,I want the dropdown(select option) button instead of radio button .........so that i could select the payment method to pay the payment. <?php if (!$methods = $this->getMethods()) : ?> <p><?php echo $this->helper('checkout')->__('Sorry, no quotes are available for this order at this time.') ?></p> <?php else : ?> <dl class="sp-methods"> <?php foreach ($this->getMethods() as $_method): $_code = $_method->getCode() ?> <dt> <?php if(

Woocommerce get custom select fields value at thank you page

拜拜、爱过 提交于 2019-12-11 03:08:14
问题 I am using woocommerce plugin and i want to add custom select field at the checkout page. I added a function and hook to function.php page. It's displaying at the checkout page. But how can i get the value of that field in the thankyou.php page. add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); function my_custom_checkout_field($checkout) { echo '<div id="my_custom_checkout_field"><h3>' . __('Select Where Your Points Go') . '</h3>'; woocommerce_form_field( 'points_go_to

Paypal : invalid token only in DoExpressCheckoutPayment method

£可爱£侵袭症+ 提交于 2019-12-11 02:57:36
问题 I'm starting to work with PayPal and my first work is to debug it on our website. Actually when we go to the end of an order, it works fine but we get a stack in the logs : "Invalid token (#10410: Invalid Token)" . This happens when the doExpressCheckoutPayment is called and it seems like there's no token and no payerid so an error is thrown. All other information seem to be correctly filled. Here's the debug result calling doExpressCheckoutPayment : [DoExpressCheckoutPayment] => Array (

Change Pay button on checkout based on Woocommerce chosen payment method

心已入冬 提交于 2019-12-11 02:46:36
问题 Hi Anyone knows how to change Pay button on checkout based on chosen payment method? I found something but I don't know if I could turn it into a snippet in function.php? Thank you. public function __construct() { $this->id = 'ry_ecpay_atm'; $this->has_fields = false; $this->order_button_text = __('Pay via ATM', RY_WT::$textdomain); $this->method_title = __('ECPay ATM', RY_WT::$textdomain); $this->method_description = ''; 回答1: This can be done with the following code (where you will set your

How to get Quote Item Id after adding a product to cart?

寵の児 提交于 2019-12-11 02:43:57
问题 I want quote item id every time a product added to cart. I have tried many event they return the quote item object but object doesn't contain quote item id as it exists only when cart save to the db. So is there any event which will return the quote item object with quote item id? I have used following events checkout_cart_product_add_after sales_quote_add_item but it will not return quote_item_id in public function addItemToSalesModelInfo(Varien_Event_Observer $observer){ $item = $observer-

Make Woocommerce checkout state field required

我们两清 提交于 2019-12-11 02:31:03
问题 So this problem may have a easy solution, but I'm stuck for the moment. After the last update (Woocommerce 3.3.5) I have a problem with the state field on the checkout page, because it is not mandatory and people just skip it. I really need this thing to be mandatory, because I have connected my website to the delivery company server through and API to send the order info directly to them. I tried adding this to my functions.php and the thing is that when I go to the checkout page, the field

Displaying product custom fields values in the order once processed

為{幸葍}努か 提交于 2019-12-11 02:29:33
问题 On woocommerce, I am using the code below to render some product custom fields, on cart and on checkout: add_filter( 'woocommerce_get_item_data', 'rendering_meta_field_on_cart_and_checkout', 10, 2 ); function rendering_meta_field_on_cart_and_checkout( $cart_data, $cart_item ) { $custom_items = array(); if( !empty( $cart_data ) ) { $custom_items = $cart_data; } if( isset( $cart_item['wccpf_enter_product_id'] ) ) { $diamond = $cart_item['wccpf_enter_product_id']; $pacolor = get_the_terms(