• A PageLines customer contacted us today informing us that one of our old themes (dms2) was not compatible with your plugin as it has a filter for woocommerce_loop_add_to_cart_link. You told here is was a theme issue.

    The code from the theme is as follows.

    // switch up button class
    add_filter('woocommerce_loop_add_to_cart_link', 'pl_commerce_switch_buttons', 10, 2);
    function pl_commerce_switch_buttons( $button, $product ){
    	$button = str_replace('button', 'btn btn-overlay', $button);
    	$button = str_replace('Add to cart', '<i class="icon icon-shopping-cart"></i>', $button);
    	return $button;
    }

    As you can see, a filter that provides 2 args, and a function that accepts 2 args, nothing wrong with this code.

    Now in your plugin in the file addons/woocommerce/includes/class-woocommerce-category.php on line 77 you have an apply_filters for woocommerce_loop_add_to_cart_link but you are only passing ONE arg.

    Ive told the user that there will probably be an update soon to the plugin.

    Regards.

    https://wordpress.org/plugins/booking-system/

  • The topic ‘Warning: Missing argument 2 (woocommerce_loop_add_to_cart_link)’ is closed to new replies.