WordPress.org

Forums

WordPress Simple Paypal Shopping Cart
[resolved] WP Simple Paypal Shopping cart error: Warning: number_format() (13 posts)

  1. PaulaJ
    Member
    Posted 1 year ago #

    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/

  2. mbrsolution
    Member
    Plugin Contributor

    Posted 1 year ago #

    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

  3. PaulaJ
    Member
    Posted 1 year ago #

    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?

  4. mbrsolution
    Member
    Plugin Contributor

    Posted 1 year ago #

    Hi Paula, can you delete your browser cache?

    Also what browsers are you testing on?

    Thank you

  5. PaulaJ
    Member
    Posted 1 year ago #

    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.

  6. mbrsolution
    Member
    Plugin Contributor

    Posted 1 year ago #

    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

  7. PaulaJ
    Member
    Posted 1 year ago #

    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.

  8. PaulaJ
    Member
    Posted 1 year ago #

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

  9. mbrsolution
    Member
    Plugin Contributor

    Posted 1 year ago #

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

    Kind regards

  10. mra13
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  11. PaulaJ
    Member
    Posted 1 year ago #

    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!

  12. mbrsolution
    Member
    Plugin Contributor

    Posted 1 year ago #

    Hi @Paula :) well done.....enjoy your dance :)

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

    Thank you kindly

  13. PaulaJ
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic