• Resolved sacredsamf

    (@sacredsamf)


    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/HUwc10N

    Is 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)
  • vi-support

    (@vicrisostomo)

    Hello there,

    We are sorry to hear that you are facing issues.
    Please kindly note that according to the WP Guidelines questions regarding the Pro Plugin cannot be discussed publicly.
    Please contact us directly.
    Here’s the link https://help.popup-builder.com/en/ , you will see an option to chat with us or send us an email.

Viewing 1 replies (of 1 total)

The topic ‘REST API problem’ is closed to new replies.