• theprinze

    (@theprinze)


    This plugin is clean and works great. One thing I would suggest in the code. there should be a check for whether the product is external otherwise it tries to add it to cart but nothing ever happens. In the add_product_js function add this code to accomplish:

    global $post;
    if (function_exists(‘wc_get_product’)):
    $product = wc_get_product($post->ID);
    if (function_exists(‘is_product’) && is_product() && !$product->is_type(‘external’)) {
    wp_enqueue_script(‘woo-ajax-add-to-cart’);
    }
    endif;

    good luck and thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Exclude external products’ is closed to new replies.