Support » Plugins and Hacks » WordPress Simple Paypal Shopping Cart » WP Simple Paypal Shopping cart error: Warning: number_format()

  • Resolved PaulaJ

    (@paulaj)


    I watched the video and read a tutorial, and after some trial and error I created a page with three products on it. It looks okay, but the minute you add anything to the cart, the top of the page displays this text:

    Warning: number_format() expects parameter 1 to be double, string given in /home/ (blah blah blah) wp-content/plugins/wordpress-simple-paypal-shopping-cart/wp_shopping_cart_misc_functions.php on line 40

    Also, price does not appear in the shopping cart and changing the quantity is not possible.

    http://www.sbc.paulaljohnson.com/dvdscds/

    I’m getting punchy, so I’ll look at this tomorrow. I’m not a coder, so it might be something simple that I just don’t see.

    This site needs to go live in a few weeks, so if I cannot figure out a solution, I’ll remove the plugin. It would be great to make it work.

    https://wordpress.org/plugins/wordpress-simple-paypal-shopping-cart/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)


    Hi PaulaJ, I just carried two in two different browsers and I don’t see that error at top as you described. Can you confirm that when you tested the add to cart option you weren’t also logged in the back end of your website?

    Kind regards

    Last night I tried it both ways. On the browser on which I was logged in, then again on a different browser.

    This morning, when I fired up the computer, I tried again, and got the same result. If I add anything, the price shows up as 0 and the warning text appears. If I trash the item in the shopping cart, the warning text goes away.

    Strange, huh?

    Plugin Contributor mbrsolution

    (@mbrsolution)


    Hi Paula, can you delete your browser cache?

    Also what browsers are you testing on?

    Thank you

    Yes, I cleared my cache in Firefox and also tested on Safari.

    I just tried the cart on in Safari on a different computer, and got the same result.

    Plugin Contributor mbrsolution

    (@mbrsolution)


    Hi Paula, I did another test and even though I don’t get any errors the shopping cart is empty “No value added”. So when I click on pay now with paypal I get the error saying that your cart is empty. Can you share with me what shortcode you are using?

    Kind regards

    I am using the shortcode provided by the plugin:

    [show_wp_shopping_cart]

    Also, the error text appears at the top of the page, before the first paragraph:

    Warning: number_format() expects parameter 1 to be double, string given in /home/pauladream/sbc.paulaljohnson.com/wp-content/plugins/wordpress-simple-paypal-shopping-cart/wp_shopping_cart_misc_functions.php on line 40

    It’s odd that you don’t see it, because I have seen it on four browswers on two computers so far.

    At this point, I’m going to look for another plugin and see if I have better luck with something else.

    Plugin Contributor mbrsolution

    (@mbrsolution)


    Hi Paula please read the following URL. Make sure that you have two shortcodes added to your page or post.

    Kind regards

    Plugin Author mra13

    (@mra13)


    Hi Paula, The shortcode your entered has some incorrect value in it. You have some extra double quotes or they are formatted incorrectly in the price amount field. Please edit it and correct the value.

    Here is an example shortcode. You can copy and paste this shortcode on that page to test it:

    [wp_cart_button name=”Test Product” price=”19.95″]

    Let me know if that helps.

    Hey, I see the problem. I had copied the short code and inserted my own info into the sample, but it looks like the straight quotes got turned to curly quotes along the way. I had to zoom the screen to see that they were not straight. I never would have noticed this.

    I just now made all the quotes straight, and the cart is working.

    Thank you mra13! And thanks to mbrsolution for trying to figure out the problem.

    I’m going to do a happy dance now!

    Plugin Contributor mbrsolution

    (@mbrsolution)


    Hi @paula 🙂 well done…..enjoy your dance 🙂

    If your issue is resolved could you mark this support thread as resolved.

    Thank you kindly

    While the URL for this issue will shortly cease to work, I hope others will find this thread helpful. I had no idea that curly quotes were toxic to code.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘WP Simple Paypal Shopping cart error: Warning: number_format()’ is closed to new replies.