Add to cart
Theme developers can use a JavaScript window function to support "add to cart" operations. The function requires the plan IDs of the product and add-on editions. It automatically manages the cart preview and user redirection.
Prerequisites
📝 Note: This documentation page may refer to Manage > Marketplace in navigation steps. If the Manage option is not available in your navigation, click the grid icon on the top-left corner of your header and click Marketplace.
The AppDirect checkout flow supports either Buy Now or Add to Cart buttons. The information in this section is only relevant if your marketplace uses the Add to Cart button.
To enable the Add to Cart button
- Go to Manage > Marketplace > Settings > Billing Settings | Billing Functionality.
- In the Product Configurator section, select Add to Cart.
- At the bottom of the page, click Save Settings.
Usage
Add the following function to your JavaScript code:
window.AD_addToCart(EditionPlanId, [AddonsPlanId, AddonsPlanId])
You can retrieve the pricing plan ID with the Data viewer. On a product page, navigate to the following data:
application > editions > items > 0 > plans > 0 > uuid
When activated, the callToActions list can include an Add To Cart action. You must catch the ADD_TO_CART actionType and trigger the AD_addToCart function on click.
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!