jasonduvenage
Forum Replies Created
-
I haven’t encountered that problem so far, which is not to say it isn’t a bug. I can’t say for sure but I would look at trying to override the is_in_stock method of the bundled product class to check for child products which are in draft status.
This code could be improved and there are probably better hooks to use but I was having a hard time with them and in a hurry, this works for me though.
add_action('woocommerce_check_cart_items', 'remove_orphaned_bundled_products_from_cart', 20); add_action('woocommerce_before_checkout_process', 'remove_orphaned_bundled_products_from_cart', 20); function remove_orphaned_bundled_products_from_cart( $array ) { $cart_items = WC()->cart->get_cart(); $bundled_products = array_map(function($product) { if(isset($product['woosb_parent_id']) && !empty($product['woosb_parent_id'])) { return [ 'product_id' => $product['product_id'], 'woosb_parent_id' => $product['woosb_parent_id'], 'key' => $product['key'], ]; } }, $cart_items); $product_ids = array_map(function($product) { return $product['product_id']; }, $cart_items); foreach ($cart_items as $cart_item) { if( get_post_status( $cart_item['product_id'] ) === "draft" ) { foreach ($bundled_products as $bundled_product) { if($bundled_product['woosb_parent_id'] === $cart_item['product_id']) { WC()->cart->remove_cart_item( $bundled_product['key'] ); } } WC()->cart->remove_cart_item( $cart_item['key'] ); } if(isset($cart_item['woosb_parent_id']) && !empty($cart_item['woosb_parent_id']) && !in_array($cart_item['woosb_parent_id'], $product_ids)) { WC()->cart->remove_cart_item( $cart_item['key'] ); } } }
Yes, I’ve got it working now thanks.
I’ve updated the plugin but nothing has changed. The tabbed ui element is still hidden on load, once I unhide it(using the web inspector), there is no option under General Settings(or any other tab), to disable scroll zoom.
Hi, thanks the map can be seen at https://africanedition.co.za/wdd/
Hi thanks for your help so far, unfortunately that option doesn’t seem to exist under my general settings tab, although I suspect that there are some conflicts somewhere with another plugin because the entire tabbed menu is hidden when I first load the page.
If I can’t get that working is there any other way I can access the options for the map? Maybe via access to a JS Google map object I can manipulate at runtime?
Thanks for your response, I’ve managed to get the zoom controls displaying based on your advise.
Do you have any suggestions on how to mouswwheel the scroll zoom? Is this meant to be an option in the plugin settings or will I need to take another route?