• Resolved hugov02

    (@hugov02)


    Hi. We use the WC API extensively to integrate with our XMS. Recently updating products via the WC API after the installation of the discount pro plugin stopped working and we got this error.

    stderr: #4 /var/www/clients/client1/web5/web/wp-content/plugins/woocommerce/includes/class-wc-data-store in /var/www/clients/client1/web5/web/wp-content/plugins/easy-woocommerce-discounts-pro/includes/class-wccs-product-price-replace.php on line 390

    Replacing line 390 with this code seemed to fix the issue.
    } elseif ( ! WCCS()->cart->is_empty() && WCCS()->WCCS_Rules_Helpers->has_conditions( $pricing_rules, $cart_conditions ) ) {

    Original line
    } elseif ( ! WC()->cart->is_empty() && WCCS()->WCCS_Rules_Helpers->has_conditions( $pricing_rules, $cart_conditions ) ) {

    We changed the WC()->cart->is_empty() to WCCS()->cart->is_empty()

Viewing 1 replies (of 1 total)
  • Plugin Author AsanaPlugins

    (@asanaplugins)

    Hi @hugov02

    Thank you for your message and thank you for reporting this issue.

    Please replace that code with below one.

    
     elseif ( WC()->cart && ! WC()->cart->is_empty() && WCCS()->WCCS_Rules_Helpers->has_conditions( $pricing_rules, $cart_conditions ) ) {
                $value = true;
            }
    

    Also we will add this fix in the next version.

    Thanks.

Viewing 1 replies (of 1 total)

The topic ‘WC API error due to discounts pro plugin’ is closed to new replies.