Buying Pull total cost from JavaScript to PHP

Discussion in 'Programming' started by KangBroke, Sep 9, 2015.

  1. #1
    Just like it says. The script used to work. Now it don't. When I echo $amount. I get $0.00 yet the cart shows the correct total. Should be fast work for anyone good with Javascript.
     
    KangBroke, Sep 9, 2015 IP
  2. cLogik

    cLogik Active Member

    Messages:
    159
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 0
    As Buyer:
    100% - 1
    #2
    You cant get information stored in Javascript using PHP. Your most likely pushing it into a HTML form during process at some point, or use cookies :)
     
    cLogik, Sep 9, 2015 IP
    StaSen likes this.
  3. cLogik

    cLogik Active Member

    Messages:
    159
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 0
    As Buyer:
    100% - 1
    #3
    Your absolutely right. You can send it trough GET or POST using Ajax. But considering how the OP stated that he cant use `echo $amount` then i assumed no Ajax was involved :)
     
    cLogik, Sep 10, 2015 IP
  4. KangBroke

    KangBroke Notable Member

    Messages:
    1,026
    Likes Received:
    59
    Best Answers:
    4
    Trophy Points:
    265
    As Seller:
    100% - 6
    As Buyer:
    100% - 7
    #4
    The issue has been resolved. The cart was built using simpleCart.js

    The price used to get stored as a PHP variable $amount at checkout before going to authorize.net.

    some reason it stopped working.

    The guy fixed it under 10 minutes.

    My issue was I hired someone a year ago to code it. I think he used jQuery. I don't know jQuery. Some of it makes sense to me but I couldn't figure out how it was being done.
     
    KangBroke, Sep 10, 2015 IP