checkout

Set WooCommerce order status when order is created from processing to pending

青春壹個敷衍的年華 提交于 2019-12-18 06:51:40
问题 When a woocommerce order is created the status of the order is "processing". I need to change the default order-status to "pending". How can I achieve this? 回答1: The default order status is set by the payment method or the payment gateway. You could try to use this custom hooked function, but it will not work (as this hook is fired before payment methods and payment gateways) : add_action( 'woocommerce_checkout_order_processed', 'changing_order_status_before_payment', 10, 3 ); function

How To Prevent Woocommerce from selecting default payment method on Checkout page?

≯℡__Kan透↙ 提交于 2019-12-17 19:56:30
问题 On Checkout page payment methods are presented and the first one is selected by default and automatically. I need to prevent the selection so no payment method is initially selected by WC. I tried 2 things so far: jQuery from Chrome console: jQuery( '.payment_methods input.input-radio' ).prop('checked', false); result: [<input id=​"payment_method_paypal" type=​"radio" class=​"input-radio" name=​"payment_method" value=​"paypal" data-order_button_text=​"Proceed to PayPal" checked=​"checked">​,

Get Cart products id on checkout WooCommerce page, to display product images

元气小坏坏 提交于 2019-12-17 18:45:21
问题 I'm using woocommerce on a site I'm working on and I want to display the current product thumbnail at the top of the checkout page, so the user could take a look at what his going to buy. However I can't find any way to do so. The closest I got, is to use WC::cart->get_cart() , but this outputs a list of all products. How can I achieve this? Thanks 回答1: Yes it's possible writing a custom function. To display those images at the beginning of checkout page just after your header's theme, use

Reordering checkout fields in WooCommerce 3

女生的网名这么多〃 提交于 2019-12-17 07:51:55
问题 I'm trying to re-order 2 custom checkout fields added with the help of woocommerce_checkout_init filter, just that when I apply woocommerce_checkout_fields filter to re-order fields, it doesn't recognize them and they are null . I think it's because the filter woocommerce_checkout_init goes after woocommerce_checkout_fields . How Can I solve this? Here is my code: add_action( 'woocommerce_checkout_init', 'wc_add_confirm_email_checkout', 10, 2 ); function wc_add_confirm_email_checkout(

CheckOut (Sharepoint) Word Document from within Excel VBA

房东的猫 提交于 2019-12-14 02:28:27
问题 Good Morning All, I have fought with this for a few days now, and have not yet found a suitable solution, so I hope somebody can put me out of my misery! From within an excel document, I have 3 buttons to check out and open 3 documents from a Microsoft Sharepoint Server. 2 files are Excel workbooks, and one is a Word document. The excel files work absolutely fine, but the Word document always returns 'False' when the .CanCheckOut statement is reached, even though I can manually check it out

Woocommerce display custom field data on admin order details

我的梦境 提交于 2019-12-13 12:32:33
问题 I am using a custom checkout field to give my customers a 'Ship to a business address' option on the checkout page of my woocommerce store. Most of the code is working properly, but I am unable to display whether or not they checked the box in the admin order details in the back end. I have added a custom checkout field to my woocommerce shop, and saved the data to the order meta: //add custom checkout field add_filter( 'woocommerce_after_checkout_billing_form', 'gon_business_address_checkbox

Magento Checkout Small Error

半腔热情 提交于 2019-12-13 07:20:00
问题 I'm having some problems related to the design of the magento checkout process on Internet Explorer. When the first-step is correctly completed and the "Continue" button is clicked, some elements from the first-step form still remain visible even though the div that contains them has the styles set to display:none . I have no idea why this is happening, can any of you take a look ? You need to try and order something and go to the checkout process and try to get by the first step. The problem

Show hide Order notes field based on a checkbox in Woocommerce checkout

杀马特。学长 韩版系。学妹 提交于 2019-12-13 03:48:27
问题 In Woocommerce checkout page there is a "ship-to-different-address" checkbox and I would like when it is checked, to hide order_comments field (Order notes) . If the checkbox is unchecked back again, order_comments field should be visible (unhidden) . Is this possible in functions.php? 回答1: The following code will hide Order notes section field when "ship-to-different-address" checkbox is checked and vice versa: add_action( 'wp_footer', 'checkout_custom_script_js'); function checkout_custom

magento success page variables

限于喜欢 提交于 2019-12-12 21:22:46
问题 I am trying to capture some magento success page variables to pass to our advertising company. So far I have got this but the variables are not outputting anything: <?php $items = $order->getItemsCollection(); foreach ($items as $item) { $price="'".$item->getPrice()."', "; $qty="'".$item->getQty()."', "; $sku="'".$item->getSku()."', "; } ?> The data needs to be in the format: 'price1', 'price2', 'price3' 'qty1', 'qty2', 'qty3' 'sku1', 'sku2', 'sku3' 回答1: Try adding this to Success.phtml

How to get Post Data from Magento's Onepage Checkout?

白昼怎懂夜的黑 提交于 2019-12-12 12:17:31
问题 in order to add a customers comment field in the Magento Checkout, I added a text field in the appropriate template file and added the comment to the order using an observer like this: $comment = strip_tags(Mage::app()->getRequest()->getParam('cpOrderComment')); if(!empty($comment)){ $observer->getEvent()->getOrder()->setCustomerNote($_comments); } This worked perfectly using the OnestepCheckout extension, however it does not work with Magento's Onepage Checkout. The "getParam('cpOrderComment