hook-woocommerce

WooCommerce order status hook not triggering

守給你的承諾、 提交于 2019-12-24 10:01:54
问题 I'm using this little function here to detect if an order is set into pending. This happens between the payment page and the payment provider notification: add_action( 'woocommerce_order_status_pending', 'status_pending' ); function status_pending( $related_job ) { error_log('Triggered'); } The problem is that I don't get any error log which shows me that the function work. But it becomes crazier. When I update the status via the dashboard from completed to pending, the log appears. So I've

Problem with woocommerce_add_order_item_meta

假如想象 提交于 2019-12-24 09:04:11
问题 i have spent the last 3 hours trying to fix a problem with a woocommerce deprecated hook and i'm going crazy because i have tried hundred different options to make it work, and it's not happening. This is the actual code, it suppose to save the value of custom fields. Any idea about how to make it work with a non obsolete hook? add_action('woocommerce_add_order_item_meta','save_in_order_item_meta', 10, 3 ); function save_in_order_item_meta( $item_id, $values, $cart_item_key ) { if( isset(

Taxes applied based on cart item quantity in Woocommerce

两盒软妹~` 提交于 2019-12-24 08:57:57
问题 Is there a way to create a tax class that applies to a product based on the quantity of this product in the cart. Example: If there is less then 6 items of the same product the taxes applies otherwise the taxes doesn't applies. Any help is appreciated. 回答1: It is is possible. First create in WooCommerce Tax settings a tax class named for example "Zero Rate" like: 1) in Tax options sections add "Zero Rate" and save: 2) A tab "Zero rate" appear. Under this tab section set the tax to zero: The

Reorder the position of title,thumbnail and price in woocommerce shop page

落花浮王杯 提交于 2019-12-24 08:37:31
问题 I am working with wordpress woocommerce. I have to customize the shop page of the website. In which I have to place the featured image below the title and price. I try few things for that but that not work for me. I try to change the priority of thumbnail in function.php file like below remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product

Replace star ratings in Woocommerce using hooks

只愿长相守 提交于 2019-12-24 08:07:26
问题 when enabled, every woocommerce product has a star rating. I have some custom code that I would like to replace the current star rating in its entirety (Including the "# customer reviews" part. Currently, the code I am using only appends to the star rating, rather than replace it fully. Below is the current result I am seeing, and the code I have added to functions.php. Thank you in advance. Code: add_filter( 'woocommerce_get_star_rating_html', 'replace_star_ratings' ); function replace_star

WooCommerce: Show notice on new order email if specific payment method is used

痞子三分冷 提交于 2019-12-24 08:00:31
问题 I want to add a notice to "new order" email sent to admins before the table so if customer paid with "Purchase Order", processing team will know the payment is pending. Research & Work Done: I spent some time researching various tuts and docs and came up with the Version 1 code but it's not showing anything on the order email (I changed the code Version 2 and tried again but to no avail). Are the codes wrong? I just want to confirm before I look into other options. Thank you Version 1 /*

Add price beside Woocommerce Force Sells

☆樱花仙子☆ 提交于 2019-12-24 02:14:33
问题 Woocommerce Force Sells by default only lists the product titles. I need them to also show the product price in brackets beside each title. You can see it here like in this screenshot: But it should be: Birth Pool Hire Bond ($50.00) Birth Pool Liner ($33.00) Is there a filter I can use so that Force Sells puts the prices beside items? Barring that, how can I alter the Force Sells code so that it also outputs price as well? This is the part of the Force Sells code that outputs the items under

How to show “regular price” instead of a “discounted price” on mini-cart (Woo)

十年热恋 提交于 2019-12-24 01:15:34
问题 I have read like every single topic about woocommerce but cannot find out how to show regular price instead of a discounted price on mini-cart. (Yes, i want to show regular price in mini-cart.php) I think i should modify mini-cart.php: 41 but i dont know how i can show regular price. $product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); Can someone help me with this one? 回答1: Try this: $product_price = apply

Which Hook is running after Woocommerce update cart button action

青春壹個敷衍的年華 提交于 2019-12-23 21:05:12
问题 i need to know which hook is running after clicking the update cart button in the cart page . That is in cart page we have 4 button , update cart , continue shopping , proceed to checkout , apply coupon . So i want to know which hook is run after update cart button is clicked . When customer click the update cart button after changing the quantity then i have to run a special function that can change total price in the cart , If some condition met , i will change the total price in the cart ,

Hiding main category title on a unique category archive page

依然范特西╮ 提交于 2019-12-23 15:54:23
问题 I'm building a site with many different categories and need to simply remove the category titles on just one archive page: http://redyearclients.co.uk/PandF/product-category/exterior-paving/paving-brands/ I've discovered methods of removing the title from all pages, but I need all other category pages to require the title, this page for example should stay as it looks now: http://redyearclients.co.uk/PandF/product-category/exterior-paving/ Any help massively appreciated. 回答1: For that purpose