We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14605
    • 40 Posts
    Hi

    Are there any examples (I couldn’t find any!) of the following scenario...

    1. User clicks button ’add to quote’
    2. browser sends product info to server (quanitity, product_id)
    3. product info is added to a session variable (array of products in quote object)
    4. UI updates the relevant div section dynamcially (with updated quote information)
    5. while the above is being processed, the user will see a loading image in the relevant div tag

    If someone could point me in the right direction I would be most appreciative.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use a snippet in a MODx resource (with a blank template) for the AJAX processing code, using the URL to the page as the url for the AJAX request. This way you’ll have the SESSION and the MODx API functions all available to the AJAX processing code.
        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