orders

Add the New order email notification attachment to the vendor email

大憨熊 提交于 2019-12-05 14:30:27
In WooCommerce, I use woocommerce-product-vendors as multi vendor plugin. After checkout I receive as admin an a new order email notification with the attachment (uploaded file). But the vendor receive the same email but without the attachment. I need that the vendor receive the attachment too. Thanks You could try this code with a custom function hooked in woocommerce_email_recipient_new_order filter hook: add_filter('woocommerce_email_recipient_new_order', 'adding_vendor_email', 10, 2); function adding_vendor_email( $recipient, $order ) { if ( ! is_a( $order, 'WC_Order' ) ) return $recipient

Automatically change WooCommerce order status after specific time has passed?

喜欢而已 提交于 2019-12-05 13:07:17
Is there any way to have WooCommerce Automatically change a custom order status to a different custom order status after so much time has passed? Basically, I want all orders that are changed to Order Status "Refund-Submitted" be automatically get changed to "Refund-Expired" after 30 days. I realize these are not normal WooCommerce Order Statuses, I created custom ones. So it might be easier to understand what I want if I'm less specific... I just want to be able to have orders that are changed to a specific status to automatically be changed to a different status after so many days. I looked

Get Product Name and Description in WooCommerce email templates

旧街凉风 提交于 2019-12-05 11:09:17
I am trying to get product descripton and the product name when email is sent in WooCommerce email templates. I am able to get product id $order_id = trim(str_replace('#', '', $order->get_items())); using this code But when I am trying to get its description and product name I am not able to do the same. My code: $order = new WC_Order($order_id); foreach($order->get_items() as $item){ $product_description = get_post($item['product_id'])->post_content; } How can I make it work? Thanks I added this in function.php what i ma trying to do is after the order is set completed i am trying to send sms

WooCommerce - Customize “Total” text on Thankyou order received page

◇◆丶佛笑我妖孽 提交于 2019-12-05 09:43:06
问题 In WooCommerce I have a problem on my thankyou page (once the customer has placed his order). I have tryed to change it manualy but the problem is that the code is generated in an unknown file which I can't find. <tfoot> <?php foreach ( $order->get_order_item_totals() as $key => $total ) { ?> <tr> <th scope="row"><?php echo $total['label']; ?></th> <td><?php echo $total['value']; ?></td> </tr> <?php } ?> </tfoot> This code give me all information in my order like a coupon the shipping etc. On

Add a custom order note programmatically in Woocommerce admin order edit pages

百般思念 提交于 2019-12-05 07:50:47
In woocommerce I am trying to add a custom order note in the admin order edit pages through php (so programmatically). I haven't find the way yet. Any help will be appreciated. From a dynamic Order Id you can use WC_Order add_order_note() method this way: // If you don't have the WC_Order object (from a dynamic $order_id) $order = wc_get_order( $order_id ); // The text for the note $note = __("This is my note's text…"); // Add the note $order->add_order_note( $note ); Tested and works. Thank you guys I was trying to find a way to add the notes to a new order. I was looking for the right hook

WooCommerce - Getting completed status orders by user in a period of time

允我心安 提交于 2019-12-05 02:27:55
问题 I need to get a user's done purchases in the last month by USER ID in Woocommerce. Users have levels (Gold, Silver): Gold members can purchase 4 items each month; Silver members can buy 1 item per month. I need to check this before adding an item to the cart. I don't want to use a plugin for just this feature (which could not found, BTW). Is that possible? How can I achieve this? Thanks 回答1: It's possible to get the total items count bought by the current customer in the past 30 days . Here

Change order status just after payment in WooCommerce [duplicate]

孤街浪徒 提交于 2019-12-05 02:06:04
This question already has an answer here: WooCommerce: Auto complete paid orders 3 answers I need to change automatically an order status for completed after receiving payment, but only if the order status is "processing". I found that snippet, what makes orders status completed in every case, but my payments plugins after successful payment changes returns data and changes the order status for "processing". I would like to change it into "completed" after success and don't change it if the status isn't "processing". The main problem I met is I don't know how to get the received status order.

Customizing My Account Orders list post per page in Woocommerce

浪尽此生 提交于 2019-12-05 00:39:12
问题 Woocommerce 2.6.x has a special page at the user account (My Account) area where it displays the user's previous Orders. This page is now paginated and it displays as default 15 items/page. Here the screenshot of the woocommerce storefront theme Orders area with 8 lines: I Can't find the way to change this. How can I show only 7 items instead of the default number? Thanks. 回答1: Using a custom hooked function in woocommerce_my_account_my_orders_query hook, you can alter the orders query

Hide a specific action button conditionally in Woocommerce admin Orders list

依然范特西╮ 提交于 2019-12-04 21:04:30
I Would like to add some CSS to the order admin page to hide a custom order action button, but only if the order contains only downloadable products. This is the function I need to load conditionally: add_action( 'admin_head', 'hide_custom_order_status_dispatch_icon' ); function hide_custom_order_status_dispatch_icon() { echo '<style>.widefat .column-order_actions a.dispatch { display: none; }</style>'; } Is that possible? With CSS it's not be possible . Instead you can hook in woocommerce_admin_order_actions filter hook, where you will be able to check if all order item are downloadable and

WooCommerce Thankyou tracking code installation placement

故事扮演 提交于 2019-12-04 19:51:35
I am new to Wordpress development and am trying to install a traffic junky tracking code on the thankyou.php page. My attempt has failed so far and I think it boils down to not understanding PHP well enough. The two tracking codes from trafficjunky that were available were HTML or PHP HTML: <img id="1000143661_tester" src="https://ads.trafficjunky.net/tj_ads_pt?a=1000143661&member_id=1000734841&cb=[RANDOM_NUMBER]&cti=[TRANSACTION_UNIQ_ID]&ctv=[VALUE_OF_THE_TRANSACTION]&ctd=[TRANSACTION_DESCRIPTION]" width="1" height="1" border="0" /> PHP: <?php $randomNumber = time() . mt_rand(1000, 9999999);