We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47630
    • 56 Posts
    In SimpleCartJS does anyone know how to change the currency to a currency not in the default list?
    I'm looking to integrate with PayPal & want to change the currnecy to Malaysian Ringgit MYR.

    In simplecartjs I have changed the currency field to MYR and then each product is listed with the MYR currency symbol but, the checkout just takes the figure as USD.

    If I try to change the currency in the simplecartjs Properties then the cart ceases to function.

    If anyone has already successfully changed currency I would appreciate any advise they could give.

    site is still wip...........http://bit.ly/1rSZ1Cz

    This question has been answered by sottwell. See the first response.

    • discuss.answer
      You need to move that menu up a little, there's too much space between the parent and the menu and it's vanishing as the mouse moves across the gap between them.

      This works for me http://simplecartjs.org/documentation/currency
      <script src="assets/js/simpleCart.js"></script>
      <script>
          simpleCart.currency({
              code: "MYR",
              name: "Malaysian Ringgit",
              symbol: "***",
              after: true
          })
      </script>
      <script>
        simpleCart({
          currency: "MYR",
          checkout: {
            type: "MyGateway",
            email: "[email protected]",
          }
        });
      </script>
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 47630
        • 56 Posts


        I try to change in the js supplied with the package.

        Are you saying I just replace this file stored in:

        assets/components/simplecartjs/js/simpleCart.js

        to the code you show here???
          • 47630
          • 56 Posts
          The menu? Yes, that does need adjustment, thanks for taking the time to comment smiley
          • No. That is at the bottom of my page. It's straight from the documentation I linked to.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 47630
              • 56 Posts
              Aaaahhhh ok I got it.

              in this file
              assets/components/simplecartjs/js/simpleCart.js

              I added this line:

              "MYR": { code: "MYR", symbol: "RM;", name: "Malaysian Ringgit" },

              Now when change to MYR in the modx back end (Snippet: simplecartjs) the correct currency is shown in the cart.

              Thank you for the pointer, it kinda got me there in a roundabout way smiley
              • I suppose I learned the habit of not hacking core code from working with MODX. Since the SimpleCart docs recommend using the function externally that's what I did.

                At the least, you'll have to remember to repeat your hack if you ever want to upgrade the .js script to a new version.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org