Shopify button. how to change the product order. how to access products cla

Chrystel1
New Member
3 0 0

Hello,

I am adding a shopify buy button to my word press.

i have used the following automated generated code.  I don t understand how the order of the product is generated.

How can i modify the code to be able to control the position of the product 's appearance in WP ?

Thank you very much.

Chrystel.

 

 

<div id='collection-component-1613028765024'></div>
<script type="text/javascript">
/*<![CDATA[*/
(function () {
var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
if (window.ShopifyBuy) {
if (window.ShopifyBuy.UI) {
ShopifyBuyInit();
} else {
loadScript();
}
} else {
loadScript();
}
function loadScript() {
var script = document.createElement('script');
script.async = true;
script.src=scriptURL;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
script.onload = ShopifyBuyInit;
}
function ShopifyBuyInit() {
var client = ShopifyBuy.buildClient({
domain: 'greentouchmoss.myshopify.com',
storefrontAccessToken: '67c230efbee16bb929075d8f59464104',
});
ShopifyBuy.UI.onReady(client).then(function (ui) {
ui.createComponent('collection', {
id: '238601142424',
node: document.getElementById('collection-component-1613028765024'),
moneyFormat: '%24%7B%7Bamount%7D%7D',
options: {
"product": {
"styles": {
"product": {
"@media (min-width: 601px)": {
"max-width": "calc(33.33333% - 30px)",
"margin-left": "30px",
"margin-bottom": "50px",
"width": "calc(33.33333% - 30px)"
},
"img": {
"height": "calc(100% - 15px)",
"position": "absolute",
"left": "0",
"right": "0",
"top": "0"
},
"imgWrapper": {
"padding-top": "calc(75% + 15px)",
"position": "relative",
"height": "0"
}
},
"button": {
"font-family": "Lato, sans-serif",
"border-radius": "40px",
"padding-left": "39px",
"padding-right": "39px"
}
},
"buttonDestination": "modal",
"contents": {
"options": false
},
"text": {
"button": "View product"
},
"googleFonts": [
"Lato"
]
},
"productSet": {
"styles": {
"products": {
"@media (min-width: 601px)": {
"margin-left": "-30px"
}
}
}
},
"modalProduct": {
"contents": {
"img": false,
"imgWithCarousel": true,
"button": false,
"buttonWithQuantity": true
},
"styles": {
"product": {
"@media (min-width: 601px)": {
"max-width": "100%",
"margin-left": "0px",
"margin-bottom": "0px"
}
},
"button": {
"font-family": "Lato, sans-serif",
"border-radius": "40px",
"padding-left": "39px",
"padding-right": "39px"
}
},
"googleFonts": [
"Lato"
],
"text": {
"button": "Add to cart"
}
},
"option": {},
"cart": {
"styles": {
"button": {
"font-family": "Lato, sans-serif",
"border-radius": "40px"
}
},
"text": {
"total": "Subtotal",
"button": "Checkout"
},
"popup": false,
"googleFonts": [
"Lato"
]
},
"toggle": {
"styles": {
"toggle": {
"font-family": "Lato, sans-serif"
}
},
"googleFonts": [
"Lato"
]
}
},
});
});
}
})();
/*]]>*/
</script>

0 Likes