Support » Plugin: Jigoshop » Coupon Code Problem – Division by Zero

  • Resolved SimpleBeadPatterns

    (@simplebeadpatterns)


    Hi,

    A customer got this error when adding a coupon to their shopping cart. When I tried it myself, it worked. Any ideas what this error means?

    Warning: Division by zero in …/wp-content/plugins/jigoshop/classes/jigoshop_cart.class.php on line 592

    When researching this error, I found one post saying that someone needed to update their Jigoshop Premium Shipping, but I am not using Premium Shipping – I am using Table Rate Shipping that I purchased from Jigoshop.

    Any help would be greatly appreciated (we just put out a big ad!)

    Thanks!

    https://wordpress.org/plugins/jigoshop/

Viewing 13 replies - 1 through 13 (of 13 total)
  • This is what is on line 592 of my jigoshop_cart.class.php:

    $discounts += self::$tax->calc_tax($coupon[‘amount’] * self::$price_per_tax_class_ex_tax[$tax_class]/($total_tax_part*100), $rate, false);

    Thank you!

    I am now getting the error myself. The error is happening when it is an in-state purchase needing to charge tax. The error does not happen if tax does not need to be charged. If I turn tax off, then it works fine. So, this error is only happening when someone is making a purchase where tax is being charged. Please help asap!

    Thank you.

    Hi SimpleBeadPatterns,

    Try to disable other shipping methods and see if it works.

    Thank you for your response. Shipping is not enabled on one of my websites because it is downloadable products only. On a different website that I sell physical products on, I have the table rate shipping extension. The shipping is being calculated correctly for different countries on that website, but for some reason I cannot find the table rate shipping settings under shipping on the Jigoshop settings page. I edited these settings before, but I can’t locate them now. I thought those settings used to be displayed on the shipping page. Did something change so that the table rate shipping settings are displayed somewhere else?

    So, one website has no shipping enabled and another website is table rate shipping only. I am getting this error on both of these sites when someone who is being charged tax uses a coupon code.

    Thank you for your help.

    Hi SimpleBeadPatterns,

    Could you provide please your system info? Also i’ve tested the table rate shipping on my web site and it’s working fine (I Also upplied coupons)

    If you’r not seeing the table rate shipping in Jigoshop shipping settings try to deactivate and activate again the plugin.

    I tried disabling the table rate shipping plugin and then re-enabling it and I still can’t see the settings on the Jigoshop shipping page.

    Here is the system info for my downloadable products website. I also included the system info for my physical products website. I am having the tax problem on both websites.

    WordPress Environment
    Home URL: [?] http://simplebeadpatterns.com
    Site URL: [?] http://simplebeadpatterns.com
    Jigoshop Version: [?] 1.17.4
    Jigoshop Database Version: [?] 1503180
    Log Directory Writable: [?] ✕ To allow logging, make …wp-content/uploads/jigoshop-logs/ writable or define a custom JIGOSHOP_LOG_DIR.
    WP Version: [?] 4.2.2
    WP Multisite: [?] –
    WP Memory Limit: [?] 512 MB
    WP Debug Mode: [?] –
    Language: [?] en_US
    Server Environment
    Server Info: [?] Apache
    PHP Version: [?] 5.3.29
    PHP Post Max Size: [?] 999 MB
    PHP Time Limit: [?] 30
    PHP Max Input Vars: [?] 1000
    SUHOSIN Installed: [?] –
    MySQL Version: [?] 5.5.42
    eAccelerator: [?] ✕
    APC: [?] ✕
    OpCache: [?] ✕
    Short Open Tag: [?] ✔
    Allow URL fopen: [?] ✔
    Session: [?] ✔
    Cookie Path: [?] /
    Save Path: [?] /tmp
    Use Cookies: [?] ✔
    Use Only Cookies: [?] ✔
    Max Upload Size: [?] 999 MB
    Default Timezone is UTC: [?] ✔
    fsockopen/cURL: [?] ✔
    SoapClient: [?] ✔
    Remote Post: [?] ✔
    Remote Get: [?] ✔
    Server Locale
    decimal_point: [?] .
    thousands_sep: [?] N/A
    mon_decimal_point: [?] N/A
    mon_thousands_sep: [?] N/A
    Active Plugins (23)
    Anti-spam by webvitaly – 3.5
    Column Shortcodes by Codepress – 0.6.6
    Display Posts Shortcode by Bill Erickson – 2.4
    Enhanced Text Widget by Boston Dell-Vandenberg – 1.4.4
    Image Widget by Modern Tribe, Inc. – 4.1
    Intuitive Custom Post Order by hijiri – 3.0.4
    Jigoshop Admin Bar Addition by David Decker – DECKERWEB – 1.8
    Jigoshop – All in One SEO Pack by Visser Labs – 1.0
    Jigoshop Basic Bundle Shipping by polevaultweb – 1.0.2
    Jigoshop – Meta Tags by Jigowatt – 1.1
    Jigoshop by Jigoshop Limited – 1.17.4
    Log Out Shortcode by OM4 – 1.0.3
    MailChimp by MailChimp and Crowd Favorite – 1.4.2
    Menu Image by Alex Davyskiba aka Zviryatko – 2.4
    Pinterest “Pin It” Button Lite by Phil Derksen – 2.0.9
    Quick Page/Post Redirect Plugin by Don Fischer – 5.0.6
    Regenerate Thumbnails by Viper007Bond – 2.2.4
    Slideshow by StefanBoonstra – 2.2.22
    Table Rate Shipping for Jigoshop by Jigoshop – 2.0.7
    Theme My Login by Jeff Farthing – 6.3.11
    Ultimate Follow Me Plugin by Free Blog Factory by Free Blog Factory – 1.3.3
    WP Gallery Custom Links by Four Lights Web Development – 1.10.3
    WP-Mail-SMTP by Callum Macdonald – 0.9.5
    Settings
    Taxes Enabled [?] –
    Shipping Enabled [?] –
    Force SSL: [?] –
    Currency [?] USD ($)
    Currency Position [?] left
    Thousand Separator [?] ,
    Decimal Separator [?] .
    Number of Decimals [?] 2
    Jigoshop Pages
    Shop Base: [?] #14020 – /shop/
    Cart: [?] #220 – /cart-3/
    Checkout: [?] #226 – /checkout-3/
    Pay: [?] #227 – /checkout-3/pay/
    Thanks: [?] #228 – /checkout-3/thanks/
    My Account: [?] #222 – /my-account-3/
    Edit Address: [?] #223 – /my-account-3/edit-address/
    View Order: [?] #225 – /my-account-3/view-order/
    Change Password: [?] #224 – /my-account-3/change-password/
    Track Order: [?] #221 – /order-tracking-3/
    Terms: [?] #13838 – /terms-and-conditions/
    Taxonomies [?]
    Product Types: configurable (configurable),
    downloadable (downloadable),
    external (external),
    grouped (grouped),
    simple (simple),
    virtual (virtual)
    Theme
    Name: [?] Skeleton
    Version: [?] 1.6
    Author URL: [?] http://www.simplethemes.com
    Child Theme: [?] ✕ – If you’re modifying Jigoshop or a parent theme you didn’t build personally we recommend using a child theme. See: How to create a child theme
    Jigoshop Support: [?] Not Declared
    Templates [?]
    Overrides (jigoshop): skeleton/archive-product.php,
    skeleton/checkout/index.php,
    skeleton/checkout/pay_for_order.php,
    skeleton/index.php,
    skeleton/loop-shop.php,
    skeleton/jigoshop/product_taxonomy.php,
    skeleton/single-product-reviews.php,
    skeleton/jigoshop/single-product.php,
    skeleton/jigoshop/taxonomy-product_cat.php,
    skeleton/jigoshop/taxonomy-product_tag.php

    Physical product website:

    WordPress Environment
    Home URL: [?] http://simplebeadkits.com
    Site URL: [?] http://simplebeadkits.com
    Jigoshop Version: [?] 1.17.4
    Jigoshop Database Version: [?] 1503180
    Log Directory Writable: [?] ✕ To allow logging, make …wp-content/uploads/jigoshop-logs/ writable or define a custom JIGOSHOP_LOG_DIR.
    WP Version: [?] 4.2.2
    WP Multisite: [?] –
    WP Memory Limit: [?] 512 MB
    WP Debug Mode: [?] –
    Language: [?] en_US
    Server Environment
    Server Info: [?] Apache
    PHP Version: [?] 5.3.29
    PHP Post Max Size: [?] 128 MB
    PHP Time Limit: [?] 30
    PHP Max Input Vars: [?] 4000
    SUHOSIN Installed: [?] –
    MySQL Version: [?] 5.5.42
    eAccelerator: [?] ✕
    APC: [?] ✕
    OpCache: [?] ✕
    Short Open Tag: [?] ✔
    Allow URL fopen: [?] ✔
    Session: [?] ✔
    Cookie Path: [?] /
    Save Path: [?] /tmp
    Use Cookies: [?] ✔
    Use Only Cookies: [?] ✔
    Max Upload Size: [?] 128 MB
    Default Timezone is UTC: [?] ✔
    fsockopen/cURL: [?] ✔
    SoapClient: [?] ✔
    Remote Post: [?] ✔
    Remote Get: [?] ✔
    Server Locale
    decimal_point: [?] .
    thousands_sep: [?] N/A
    mon_decimal_point: [?] N/A
    mon_thousands_sep: [?] N/A
    Active Plugins (21)
    Anti-spam by webvitaly – 3.5
    Enhanced Text Widget by Boston Dell-Vandenberg – 1.4.4
    Image Widget by Modern Tribe, Inc. – 4.1
    Intuitive Custom Post Order by hijiri – 3.0.4
    Jigoshop Admin Bar Addition by David Decker – DECKERWEB – 1.8
    Jigoshop – All in One SEO Pack by Visser Labs – 1.0
    Jigoshop Basic Bundle Shipping by polevaultweb – 1.0.2
    Jigoshop – Meta Tags by Jigowatt – 1.1
    Jigoshop by Jigoshop Limited – 1.17.4
    jQuery Updater by Ramoonus – 2.1.3
    Log Out Shortcode by OM4 – 1.0.3
    MailChimp by MailChimp and Crowd Favorite – 1.4.2
    Pinterest “Pin It” Button Lite by Phil Derksen – 2.0.9
    Quick Page/Post Redirect Plugin by Don Fischer – 5.0.6
    Regenerate Thumbnails by Viper007Bond – 2.2.4
    Slideshow by StefanBoonstra – 2.2.22
    Table Rate Shipping for Jigoshop by Jigoshop – 2.0.7
    Theme My Login by Jeff Farthing – 6.3.11
    Ultimate Follow Me Plugin by Free Blog Factory by Free Blog Factory – 1.3.3
    WP Gallery Custom Links by Four Lights Web Development – 1.10.3
    WP-Mail-SMTP by Callum Macdonald – 0.9.5
    Settings
    Taxes Enabled [?] –
    Shipping Enabled [?] ✔
    Force SSL: [?] –
    Currency [?] USD ($)
    Currency Position [?] left
    Thousand Separator [?] ,
    Decimal Separator [?] .
    Number of Decimals [?] 2
    Jigoshop Pages
    Shop Base: [?] #219 – /shop-3/
    Cart: [?] #220 – /cart-3/
    Checkout: [?] #226 – /checkout-3/
    Pay: [?] #227 – /checkout-3/pay/
    Thanks: [?] #228 – /checkout-3/thanks/
    My Account: [?] #222 – /my-account-3/
    Edit Address: [?] #223 – /my-account-3/edit-address/
    View Order: [?] #225 – /my-account-3/view-order/
    Change Password: [?] #224 – /my-account-3/change-password/
    Track Order: [?] #221 – /order-tracking-3/
    Terms: [?] #7481 – /terms-and-conditions/
    Taxonomies [?]
    Product Types: configurable (configurable),
    downloadable (downloadable),
    external (external),
    grouped (grouped),
    simple (simple),
    virtual (virtual)
    Theme
    Name: [?] Skeleton
    Version: [?] 1.6
    Author URL: [?] http://www.simplethemes.com
    Child Theme: [?] ✕ – If you’re modifying Jigoshop or a parent theme you didn’t build personally we recommend using a child theme. See: How to create a child theme
    Jigoshop Support: [?] Not Declared
    Templates [?]
    Overrides (jigoshop): skeleton/archive-product.php,
    skeleton/checkout/index.php,
    skeleton/checkout/pay_for_order.php,
    skeleton/index.php,
    skeleton/loop-shop.php,
    skeleton/jigoshop/product_taxonomy.php,
    skeleton/single-product-reviews.php,
    skeleton/jigoshop/single-product.php,
    skeleton/jigoshop/taxonomy-product_cat.php,
    skeleton/jigoshop/taxonomy-product_tag.php

    Plugin Author Jigoshop Support – Eric

    (@jigoshop-support)

    Hi SimpleBeadPatterns,

    Please try to change this setting and see if the problem still occurs.

    It would be also good to update the Table Rate Shipping to the latest version 3.3.4 as you are still using version 2.0.7 which may not be fully compatible with jigoshop 1.17.4 (which can also be updated to 1.17.7)

    Hi,

    I downloaded the new Table Rate Shipping plugin from my Jigoshop.com account. In order to instal this new version of the plugin, I had to delete the plugin’s folder because it would not let me replace it with the new version of the Table Rate Shipping plugin (or I was not doing it right). When I uploaded the new version of the plugin, I had to activate it and it took away one of my available license activations (I have a 5 site license). How do I update my other websites with the new version of the plugin without using up my licenses? Also, are you able to restore the one license I just used on my SimpleBeadPatterns.com website when trying to upload the new version? (I had 4 licenses – now I have 3).

    I updated my Jigoshop plugin to 1.17.7. I am still getting the Division by Zero error. I also tried disabling the Table Rate Shipping plugin and I still got the same error.

    Thank you for your help!

    Plugin Author Jigoshop Support – Eric

    (@jigoshop-support)

    Hi SimpleBeadPatterns

    I have reset than one license for you.
    If the old version of the plugin is using licensing please try to deactivate the plugin first before deleting the plugin or it’s folder so save the number of activation. If you are replacing versions which don’t require a license key please let us know how many do you need to replace and we will increase the number of license activation.

    We will also look further into that error

    Thank you so much for your help. I really appreciate it.

    Hi,

    I was never able to figure out this problem, so I had turned off collecting taxes temporarily. I really need to collect taxes from customers in my state, so I need to figure this out. You had suggested that I try updating the Table Rate Shipping plugin to the 3.3.4 version, which I did, and that did not work. I have one website that is all downloadable products and one website that is physical products and I am getting the error on both websites.

    The problem is, when a customer in WA state, which is the state I am collecting taxes in, enters a coupon code, they get the error:

    Warning: Division by zero in …/wp-content/plugins/jigoshop/classes/jigoshop_cart.class.php on line 592

    Here is my current system info:

    ### WordPress Environment ###

    Home URL: http://simplebeadpatterns.com
    Site URL: http://simplebeadpatterns.com
    Jigoshop Version: 1.17.7
    Jigoshop Database Version: 1503180
    Log Directory Writable: ✕ To allow logging
    make …/wp-content/uploads/jigoshop-logs/ writable or define a custom JIGOSHOP_LOG_DIR.

    WP Version: 4.3.1
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    Language: en_US

    ### Server Environment ###

    Server Info: Apache
    PHP Version: 5.3.29
    PHP Post Max Size: 999 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    SUHOSIN Installed: –
    MySQL Version: 5.5.46
    eAccelerator: ✕
    APC: ✕
    OpCache: ✕
    Short Open Tag:
    Allow URL fopen:
    Session:
    Cookie Path: /
    Save Path: /tmp
    Use Cookies:
    Use Only Cookies:
    Max Upload Size: 999 MB
    Default Timezone is UTC:
    fsockopen/cURL:
    SoapClient:
    Remote Post:
    Remote Get:

    ### Server Locale ###

    decimal_point: .
    thousands_sep: N/A
    mon_decimal_point: N/A
    mon_thousands_sep: N/A

    ### Active Plugins (24) ###

    Anti-spam: by webvitaly – 3.5
    Column Shortcodes: by Codepress – 0.6.6
    Display Posts Shortcode: by Bill Erickson – 2.4
    Enhanced Text Widget: by Boston Dell-Vandenberg – 1.4.4
    Image Widget: by Modern Tribe
    Inc. – 4.1

    Intuitive Custom Post Order: by hijiri – 3.0.4
    Jigoshop Admin Bar Addition: by David Decker – DECKERWEB – 1.8
    Jigoshop – All in One SEO Pack: by Visser Labs – 1.0
    Jigoshop Basic Bundle Shipping: by polevaultweb – 1.0.2
    Jigoshop – Meta Tags: by Jigowatt – 1.1
    Jigoshop Table Rate Shipping: by Jigoshop – 3.3.4
    Jigoshop Wishlist: by Jigoshop – 1.3.1
    Jigoshop: by Jigoshop Limited – 1.17.8
    Log Out Shortcode: by OM4 – 1.0.3
    MailChimp: by MailChimp and Crowd Favorite – 1.4.2
    Menu Image: by Alex Davyskiba aka Zviryatko – 2.4
    Pinterest “Pin It” Button Lite: by Phil Derksen – 2.0.9
    Quick Page/Post Redirect Plugin: by Don Fischer – 5.0.6
    Regenerate Thumbnails: by Viper007Bond – 2.2.4
    Slideshow: by StefanBoonstra – 2.2.22
    Theme My Login: by Jeff Farthing – 6.3.11
    Ultimate Follow Me Plugin by Free Blog Factory: by Free Blog Factory – 1.3.3
    WP Gallery Custom Links: by Four Lights Web Development – 1.10.3
    WP-Mail-SMTP: by Callum Macdonald – 0.9.5

    ### Settings ###

    Taxes Enabled:
    Shipping Enabled: –
    Force SSL: –
    Currency: USD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2

    ### Jigoshop Pages ###

    Shop Base: #14020 – /shop/
    Cart: #220 – /cart-3/
    Checkout: #226 – /checkout-3/
    Pay: #227 – /checkout-3/pay/
    Thanks: #228 – /checkout-3/thanks/
    My Account: #222 – /my-account-3/
    Edit Address: #223 – /my-account-3/edit-address/
    View Order: #225 – /my-account-3/view-order/
    Change Password: #224 – /my-account-3/change-password/
    Track Order: #221 – /order-tracking-3/
    Terms: #13838 – /terms-and-conditions/

    ### Taxonomies ###

    Product Types: configurable (configurable)
    downloadable (downloadable)
    external (external)
    grouped (grouped)
    simple (simple)
    virtual (virtual)

    ### Theme ###

    Name: Skeleton
    Version: 1.6
    Author URL: http://www.simplethemes.com
    Child Theme: ✕ – If you’re modifying Jigoshop or a parent theme you didn’t build personally we recommend using a child theme. See: How to create a child theme
    Jigoshop Support: Not Declared

    ### Templates ###

    Overrides: skeleton/archive-product.php
    skeleton/checkout/index.php
    skeleton/checkout/pay_for_order.php
    skeleton/index.php
    skeleton/loop-shop.php
    skeleton/jigoshop/product_taxonomy.php
    skeleton/single-product-reviews.php
    skeleton/jigoshop/single-product.php
    skeleton/jigoshop/taxonomy-product_cat.php
    skeleton/jigoshop/taxonomy-product_tag.php

    Hi,

    I am still having this issue. Can someone help? I’ve been having to pay taxes out of my pocket.

    Thank you so much!

    Hi SimpleBeadPatterns,

    Could you contact us through the contact form on our website jigoshop.com?
    We will try to fix your issue, also please include in email subject the link to the topic.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Coupon Code Problem – Division by Zero’ is closed to new replies.