add_filter( 'woocommerce_can_reduce_order_stock', 'can_reduce_order_stock_exceptions', 9000, 2 );
function can_reduce_order_stock_exceptions( $can_reduce, $order ) {
// Define your product ID(s) or variation ID(s) that will avoid stock reduction
$targeted_ids = array( 796 );
// Loop through order items
foreach ( $order->get_items() as $item_id => $item ) {
if ( in_array($item->get_product_id(), $targeted_ids)
|| in_array($item->get_variation_id(), $targeted_ids) ) {
$can_reduce = false;
break;
}
}
return $can_reduce;
}
If I create an order with any products + the product with id 796 and change the order status to completed it still reduces my product stock. I tried adding debug statements and it seems the function only gets called after creating the order and then changing the status to ‘Processing’.
But when I change the order status to ‘Completed’ it still reduces my stock. (No appearance in debug.log)
Is there a different filter I have to use for that?
]]>Best regards.
]]>I am trying to reduce de margins top and bottom for my content (it has a gallery on it) in lp-text-one .lp-text-content and the code I have is not doing the trick. I need it to work on desktop and mobile. Can somebody help me?
#lp-text-one .lp-text-content { margin-top: 20px!important
}
Bes regards,
Iri
]]>Thanks in advance,
Marios
On site we have 5000+ users. When Admin published new POST it will create queue and start sending emails but I noticed that after 25-30 minutes it’s paused for 10-20 minutes after that it will again start sending email for 25-30 minutes and again paused for 10-20 minutes.
WordPress version – 5.7.2
PHP version – 7.1.8
Better Notifications for WP Version – 1.8.11
Email Log Version – 2.4.8
SMTP Mailing Queue Version – 1.4.7
Note – We will be Update PHP and WordPress version to it’s latest after 3-6 months.
Advanced Settings
Queue Limit – 100
wp_cron interval – 30
Min. recipients to enqueue – 1
Max. retry for mail sending – 0
Sent mail storage size – 0
Also today I noticed that there is error on admin page (wp-admin/options-general.php?page=smtp-mailing-queue&tab=supervisors)
Error encountered while processing queue : ‘cURL error 28: Operation timed out after 30001 milliseconds with 0 out of -1 bytes received’
I need to also know that we have php setting MAX_EXECUTION_TIME is set to 30. is it neccessory to use same or below in wp_cron interval or should I use 60+.
Thank you
Akash Darji
.widget-area .widget h3 {
color: #003a6b;
font-family: Open Sans;
font-size: 12px;
line-height: 1em;
}
]]>Can’t find a way to reduce (or even hide) the consent button while on portrait mode on mobile devices (probably on tablet too, but less invasive).
Visible on all pages of the site and way too invasive for a selling photography website.
Thanks a lot for your help.
Regards,
Stephane