This topic has 10 replies, 2 voices, and was last updated 9 years by Abe.

  • Author
  • #38930
     ellos
    Participant

    Hi, the moment I add the discount price to variation in WC I get the error:

    Warning: Division by zero in /home/gansello/public_html/wp-content/themes/kleo/lib/plugin-woocommerce/config.php on line 459

    Please also see the screenshots.
    Thanks.Elijah.

    Attachments:
    You must be logged in to view attached files.
    #38939
     ellos
    Participant

    Looks like it is something with the child theme… the moment I deactivate it the error disappears.

    #38940
     ellos
    Participant

    Yep, seems like a bug – I’ve removed all lines of code I had in functions.php in child theme and the error is still there.

    #38960
     ellos
    Participant

    Nope, after a while it started showing even in the main theme…. not sure what is it.

    #38961
     ellos
    Participant

    OK, narrowed it down, it’s a combination of 2 factors, but still looks like a bug. If yo do the following:

    1. In the Theme Options > Woo Commerce specify Show percentage badge on products list
    and
    2. Use Sale price in Variation of the product, then you get

    “Warning: Division by zero in /home/gansello/public_html/wp-content/themes/kleo/lib/plugin-woocommerce/config.php on line 459”

    So it has nothing to do with child theme. (The reason I was not seeing in the main theme is becasue when I switched to it it cleaned all the setting in Theme Options back to defaults).

    So I guess we can officially call it a bug.

    Thanks.
    Elijah.

    #39187
     Abe
    Keymaster

    Hi, until next update please see this fix https://archived.seventhqueen.com/forums/topic/woocommerce-error-when-variation-on-sale

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #39249
     ellos
    Participant

    The error is gone, but for some reason discount percentage is not calculated.
    Please see attached (still shows 0%)

    Also – just to make sure that I did the right thing:
    1. I saved wp-content/themes/kleo/lib/plugin-woocommerce/config.php as config.php.orig
    2. Created new config.php in the same dorectory and copied all the content to this files from the one in your link.

    Thanks
    Elijah

    Attachments:
    You must be logged in to view attached files.
    #39489
     Abe
    Keymaster

    yes the procedure is fine. let me do some checks since I think from the screenshot I need to make some more variations to test

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #39519
     Abe
    Keymaster

    indeed there were some extra checks needed and now the percentage is correct. I changed the attached file from the post above so re-download it and do the change again.

    Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #40273
     ellos
    Participant

    Sorry, Abe, was away, holiday season. Just to make sure, cause I’m a bit lost… when you say : I changed the attached file from the post above so re-download it and do the change again”… Do you mean I should go to that post
    https://archived.seventhqueen.com/forums/topic/woocommerce-error-when-variation-on-sale
    then download woo-config.txt and replace the content of wp-content/themes/kleo/lib/plugin-woocommerce/config.php with the file you mentioned?

    Thank you.
    Elijah.

    #40413
     Abe
    Keymaster

    Hi @ellos
    you can just get 2.3.1 KLEO version which contains that fix. If you wanted to fix it with the file then just replace the content from theme file with the content from the file attached.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?