Add items to Shopping Cart

Digioh App Marketplace

If you want to add items directly to a shopping cart (Shopify, Magento, etc) then you can install Digioh App #80: Hidden URL Loads. Do this from the profile menu, top right, and select Custom JS (Apps).

Then, you can configure metadata on a button to change its behavior:

For this to work, the button must be configured with Action of “Do Nothing” so that the app can take control:

The metadata commands are:

  • hidden_redirect_url: the URL to load “under the hood” on first click, invisible to the user. See below for add to cart URL formats.
  • hidden_redirect_text: after the load is complete, change the existing button text. For example, “View Cart”.
  • hidden_redirect_url2: the new URL for redirect on click afterwards. For example, https://site.com/cart/

All three should be used together on the same button.

Common eCommerce Add-to-Cart URL Formats

This app is eCommerce platform agnostic, if your platform supports “add to cart via URL” then this can work. The add to cart via URL format for common eCommerce platforms are as follows:

  • Shopify: https://YOUR_STORE.com/cart/add?id=VARIANT_ID&quantity=1
  • VTEX: https://YOUR_STORE.com/checkout/cart/add?sc=1&sku=SKU&qty=1&seller=1
  • Magento*: https://YOUR_STORE.com/cart?product=SKU&qty=1

* – This is not natively supported by Magento, let us know at support@digioh.com and we’ll provide you with a simple Magento extension to make the URL work.