Help finding syntax error
-
I was advised by theme developer to add this snippet to my theme’s function.php file to modify cart behavior. When I did I received a fatal error message due to a syntax error. Can someone please tell me what that error is:
add_filter( \'woocommerce_return_to_shop_redirect\', function($shop_url) { if(is_cart() && wc()->cart->cart_contents_count == 0) { $deleted_items = wc()->cart->get_removed_cart_contents(); $deleted_items = array_reverse($deleted_items); foreach($deleted_items as $deleted_item) { $deleted_id = (int) $deleted_item[\'product_id\']; $vendor_id = wcfm_get_vendor_id_by_post($deleted_id); if($vendor_id) { return wcfmmp_get_store_url($vendor_id); } } } return $shop_url; });
- This topic was modified 3 years, 1 month ago by . Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Help finding syntax error’ is closed to new replies.