Integrate a shopping cart into your established site
Below you will find a step by step tutorial on how to add a shopping cart seamlessly into the design of your existing website.
1. Add script tag
The first thing you'll need to do is edit your template to include the marketplace.js script tag just before/above the closing </body> tag in footer.php of your template.
<script src="https://cdn.stam.pr/js/marketplace-v0.0.1/marketplace.js"></script>
Need help editing footer.php? See this page for more info about editing templates or watch this video to learn about a plugin method if you don't feel comfortable editing your template.
2. Add a specially formatted html tag
Wherever you'd like to place a product, you'll need to add a special HTML tag that looks like this:
<div
class="stampr-marketplace"
data-account="s_01KxtNPMMJLrgsRWV2kR4S"
data-tenant="tenant_2tWyq1sm63rTWiOBBPJxCl"
data-domain="momdevoted.stampr.io"
data-id="prod_6Pz83I1f6zUAyaxfHd9Zwj">
</div>
Troubleshooting: Product not showing? Be sure you include the class="stampr-marketplace"
, data-account
, data-tenant
, and data-domain
. Without it, the product will not be displayed.
3. Optional: Display one or more products
You can display single products, a set of specific products, or a list all products attached to your account.
Single product
This is the example used above. To display a single product, add data-id="prod_..."
to your tag.
<div
class="stampr-marketplace"
data-account="s_01KxtNPMMJLrgsRWV2kR4S"
data-tenant="tenant_2tWyq1sm63rTWiOBBPJxCl"
data-domain="momdevoted.stampr.io"
data-id="prod_6Pz83I1f6zUAyaxfHd9Zwj">
</div>
Set of products
If you wish to display more than one product, include data-products="prod_1, prod_2, prod_3"
and enter a comma-separated list of product ids that you wish to display.
<div
class="stampr-marketplace"
data-account="s_01KxtNPMMJLrgsRWV2kR4S"
data-tenant="tenant_2tWyq1sm63rTWiOBBPJxCl"
data-domain="momdevoted.stampr.io"
data-products="prod_6Pz83I1f6zUAyaxfHd9Zwj, prod_72cDFTZMjDqQXJpnmrPZue, prod_5KYHez7Ny2FZEhrq4z3Sx9">
</div>
All products
The third and last option you have with displaying products is to display all products attached to your account using with the data-collection="all"
attribute.
Note: Only "all" is supported at this time.
<div
class="stampr-marketplace"
data-account="s_01KxtNPMMJLrgsRWV2kR4S"
data-tenant="tenant_2tWyq1sm63rTWiOBBPJxCl"
data-domain="momdevoted.stampr.io"
data-collection="all">
</div>
Comments
0 comments
Please sign in to leave a comment.