Support » Plugin: Price Based on Country for WooCommerce » Woocommerce Price based on countries

  • Resolved n9ecommerce

    (@n9ecommerce)


    Hi,
    since yesterday, I have a problem when the value in the shopping basket exceeds the value of EUR 100 or PLN 300 (PLN). Above these amounts, free shipping is provided. Below this amount in the basket, everything works as it should. I think there is some plugin conflict, or it happened after yesterday’s WooCommerce Price Based on Country plugin update.
    I’m sending a debug message:

    Here is debug message:

    Warning: Division by zero in /home/dagakuba/domains/kust.com/public_html/wp-content/plugins/woocommerce-product-price-based-on-countries/includes/class-wcpbc-frontend-pricing.php on line 469

    The page I need help with: [log in to see the link]

Viewing 13 replies - 16 through 28 (of 28 total)
  • Plugin Author Oscar Gare

    (@oscargare)

    Hi,

    I did several tests with the free version of “Flexible Shipping” using this scenario, and I can’t reproduce the same problem. Are you using a particular configuration?

    Thread Starter n9ecommerce

    (@n9ecommerce)

    Yes @oscargare, everything like this. Maybe my theme (ASTRA PRO) works bad with these plugins? But I have everythig updated.

    Plugin Author Oscar Gare

    (@oscargare)

    Hi,

    After reviewing the possible issue causes, I think a bit of change in the code could fix the bug. Are you comfortable with code edit? Go to line 436 of the file wp-content/plugins/woocommerce-product-price-based-on-countries/includes/class-wcpbc-frontend-pricing.php and replace
    if ( ! isset( $rate->cost ) ) {
    by
    if ( empty( $rate->cost ) ) {

    After editing the file, clear the cart items and the object cache (if you are using one). Then test again.

    Thread Starter n9ecommerce

    (@n9ecommerce)

    Unfortunately, it didn’t help @oscargare with total price in basket. Still after 120 euro total price changes to 0.00 euro.

    Only I see it helped with debug message. Now it doesn’t appear.

    Plugin Author Oscar Gare

    (@oscargare)

    Hi,

    If the debug message disappears after the code change, there is no bug on the Price Based on Country plugin.
    Did you check if deactivating PBoC solves the problem?

    Thread Starter n9ecommerce

    (@n9ecommerce)

    After clearing cache, error appears again.
    I am going to deactivate PBoC now.

    Thread Starter n9ecommerce

    (@n9ecommerce)

    @oscargare
    After deactivating is all right, there is no bug, no problem with basket subtotal value > 120 euro or > 300 PLN. I need two currencies in shop: PLN and EURO 🙂 Maybe I will try another plugin but until yesterday worked pretty good.

    Plugin Author Oscar Gare

    (@oscargare)

    We did not make changes related to the shipping cost in the last plugin update…
    Could you submit a “feature request” ticket at https://www.pricebasedcountry.com/support/
    and include the WooCommerce system report.

    Thread Starter n9ecommerce

    (@n9ecommerce)

    Thanks @oscargare I have sent now WooCommerce system report. Please help as soon as you can.

    @n9ecommerce try this change

    if ( ! isset( $rate->cost ) ) {

    to

    if ( ! isset( $rate->cost ) || 0.0 === (float) $rate->cost ) {

    • This reply was modified 2 months, 1 week ago by grola.
    • This reply was modified 2 months, 1 week ago by grola.
    Thread Starter n9ecommerce

    (@n9ecommerce)

    Thanks @grola it finally works! I am so grateful.
    WP DESK has really talented people on the team 😉
    Thank you @oscargare too for the quick replies.

    Plugin Author Oscar Gare

    (@oscargare)

    Hi @grola,
    What’s the value you set in $rate->cost? 0, null, ” are empty, and the empty function did not work.

    Hi @oscargare,

    Flexible Shipping sets value 0.0 (float).

    Best regards
    Grzegorz

    • This reply was modified 2 months, 1 week ago by grola.
Viewing 13 replies - 16 through 28 (of 28 total)
  • You must be logged in to reply to this topic.