Campaign Product Error

Support Area Forums Forward Campaign Product Error

Viewing 3 posts - 1 through 3 (of 3 total)
URL to the page in question: http://swedishamericanmuseum.org/2.0/product/general-donation/
  • Author
    Posts
  • #38383
    Avatar photoAllison Deerr
    Participant

    Hi Bill,

    It’s me again. Sorry for all of the questions recently and thanks for your help!

    A donor brought to my attention that this error is coming up on our general donation product:

    Warning: number_format() expects parameter 1 to be double, string given in /home/content/s/w/e/swedishmuseum/html/2.0/wp-content/plugins/woocommerce-campaigns/campaign.php on line 177

    Warning: Division by zero in /home/content/s/w/e/swedishmuseum/html/2.0/wp-content/plugins/woocommerce-campaigns/campaign.php on line 229

    The general donation product was working fine last week, and I checked the campaign plugin today and it seems to be up to date. I haven’t had any issues with our other campaign product that is currently live. Any ideas what might be causing this?

    #38384
    Avatar photoBill Robbins
    Moderator

    Hi Allison,

    Questions are fine. That line in the plugin looks like this:

    
    $progress_full = $total_given / $campaign_goal * 100;
    

    In straight English it is a quick equation that takes the total given in the campaign and divides it by the campaign goal and then multiplies it by 100. That gives us the percentage towards the goal that has been collected.

    The error indicates that there is division by zero in that line which would seem to indicate that the campaign goal is either zero or empty. Try double checking the campaign goal. If you don’t have an amount you are raising towards, then you might want to make this a regular “product” and not a campaign. The only real benefit of a campaign is it tracks your total given towards a goal. If you don’t need a goal, then you don’t really need to make it a campaign to collect money.

    Let me know how it goes,
    Bill

    #38385
    Avatar photoAllison Deerr
    Participant

    Ah, that makes sense! Fixed it. Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Campaign Product Error’ is closed to new replies.