1f2ns
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] WooCommerce 0.00 subscription not reducing stockThank you Shameem ??
Yes, I am using the WooCommerce Subscriptions Plugin.For anyone else running into this, here is the snippet I wrote to address stock reduction for $0.00 items on an order. Good luck everyone.
add_action( 'woocommerce_order_status_completed', 'reduce_stock_for_free_items' ); function reduce_stock_for_free_items( $order_id ) { // Get the order object $order = wc_get_order( $order_id ); // Loop through each order item foreach ( $order->get_items() as $item_id => $item ) { // Get the product $product = $item->get_product(); // Check if the product exists and its price is $0.00 if ( is_a( $product, 'WC_Product' ) && floatval( $product->get_price() ) == 0.00 ) { // Get current stock quantity $current_stock = $product->get_stock_quantity(); // Only reduce stock if current stock is not null if ( !is_null( $current_stock ) ) { // Calculate old stock for accurate logging before the reduction $old_stock = $current_stock; // Reduce stock by the quantity ordered $new_stock = wc_update_product_stock( $product, $item->get_quantity(), 'decrease' ); // Add a note to the order about the stock reduction $order->add_order_note( sprintf( '0.00 Order - Stock levels reduced: %s (%s) %d→%d', $product->get_name(), $product->get_sku(), $old_stock, $new_stock ) ); } } } }
Also, here is a snippet for stopping stock reduction on reorders on WooCommerce subscription reorders. Perfect solution for rental subscriptions (like raised garden beds.)
https://github.com/woocommerce/woocommerce-subscriptions-do-not-reduce-stock-on-renewal
- This reply was modified 7 months, 1 week ago by 1f2ns.
Forum: Plugins
In reply to: [Facebook for WooCommerce] Messenger Breaks Entire SiteI found the same issue.
The 1st time the plugin loads it auto-opens (at the bottom of the mobile page).
You cannot scroll on the page.
The user needs to click on the pop-up and close it.
Only then can you scroll the website.
The UI is very bad and not intuitive enough.
I am also disabling this until it is patched.Forum: Plugins
In reply to: [Timed Content] Timed Content rule w/ exception = ignoredI’m glad you were able to replicate it and I’m not crazy ??. is there a way for me to toss you a few bucks for your time and effort ??
Forum: Plugins
In reply to: [Timed Content] Timed Content rule w/ exception = ignoredNote: If I add multiple dates to the exception list the following changes from/to;
This rule will be inactive on the following dates: 2025-03-18.
To
This rule will be inactive on the following dates: 2019-07-03, 2019-07-04.
Unfortunately, the content is still shown on the front end. I have checked in a clean testing browser as well.
Forum: Plugins
In reply to: [Timed Content] Timed Content rule w/ exception = ignoredThank you for the extremely fast reply!
I understand exactly what you are saying but I think I may not have explained myself as well as I could have.
2025-03-18 is the date I have set to end the rule on.
2025-03-18 is not added under the “exceptions list”.
The only date under the “exceptions list” is 2019-07-04 as today is the only day they are closed for.
With the above (hopefully) better defined, I am receiving the following output for the rule as originally mentioned:
Show the content on 2019-03-21 @ 10:00 until 2019-03-21 @ 21:15.
Repeat this action every week on Thursday.
This rule will be active until 2025-03-18.
This rule will be inactive on the following dates: 2025-03-18.
All times are in the America/Detroit timezone.I am not sure why it’s showing the 2025-03-18 and not the 2019-07-04 date as defined.
Again, I thank you.