REST API problem
-
Hello The problem is that plugin (popupbuilder-woocommerce) adds/echos script tag on woocommerce_add_to_cart action and when it is done via REST Api it breaks the response. File: popupbuilder-woocommerce\com\classes\Filters.php Function: add_action('woocommerce_add_to_cart', array($this, 'addToCartNotAjax')); public function addToCartNotAjax() { $cartArgs = array( 'total-price' => GetProductsHelper::getTotalPrice(), 'number-of-product' => GetProductsHelper::getNumberOfProducts(), 'products-ids' => GetProductsHelper::getProductsIds() ); $cartArgs = json_encode($cartArgs); $redirectAfterAddToCart = get_option('woocommerce_cart_redirect_after_add'); if (!defined('DOING_AJAX') && $redirectAfterAddToCart == 'no') { echo "SCRIPT HERE"; } } screenshot https://freeimage.host/i/HUwc10NIs it possible to add REST Api check or add a filter so that echoing can be disabled on demand?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘REST API problem’ is closed to new replies.