custom-atomic-add-to-cart
v0.0.4
Published
Adds an item to shopping cart
Downloads
4
Maintainers
Keywords
Readme
Add to cart
Props
| Name | Type | Description | | :---: | :---: | :---: | | callback-function | string | Name of callback function to be called when add to cart button is clicked |
This component provides a button with a callback function that needs to be edited to contain logic as to how to add the item to a cart. This component can be placed in one of the tags inside of the <atomic-result-template>
tag. The logic for the add to cart component can be placed inside of a script tag in the html document.
<script >
window.addToCartCallback = function () {
console.log('add your add to cart logic here');
}
</script>
<atomic-result-section-title>
<add-to-cart callback-function="addToCartCallback"></add-to-cart>
</atomic-result-section-title>