Hi,
So I am trying to float my Cart Button, so that it is to the left of the html box it is in. I already made data-sticky=false which helped to float it to the top of the page ... somehow. As I am only using the buy button functionality, I do not have access to any CSS documents that might be affecting my code. I think most of the styling is coming from the below link, but I'm not sure ... please advise!
https://widgets.shopifyapps.com/assets/widgets/embed/client.js ;
Hey there!
Adam here from Shopify.
I can definitely do my best to help you out with this one!
And you are correct, styling with the Buy Buttons is a little more tricky than just a regular ole button or CSS edit.
Could you provide me a link to your page that you are working on with this?
If you were wanting to keep that information private, I can email you if that suits you better.
Thanks for creating this post, and talk to you soon :)
Adam
Hi! I've got the same problem. I want to move the "toggle" button to the top right and replace the icon with a text that just says "cart". How would I accomplish this?
Read this on GitHub: insert toggle in the dom #569
I needed to do this very same thing. Verified, it worked for me.
You can place a DIV anywhere and use your own CSS to style it.
Hey Adam,
is it possible to add Buy Button cart to the navigation?
Currently the cart icon is in the middle right of the product page
https://ledsolutionsnewyork.com/products/65-bet-h-series-crystal-uhd-4k-pro-tv
Hi I am also trying to move the embedded cart button. I'm working in Wix. My code looks like this:
<div id='collection-component-1607532936749'></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: 'shop-shouga.myshopify.com',
storefrontAccessToken: '573bf8e0c8a8962413586bc38c0bff76',
});
ShopifyBuy.UI.onReady(client).then(function (ui) {
ui.createComponent('collection', {
id: '238263697579',
node: document.getElementById('collection-component-1607532936749'),
moneyFormat: '%24%7B%7Bamount%7D%7D',
options: {
"product": {
"styles": {
"product": {
"@media (min-width: 601px)": {
"max-width": "calc(25% - 20px)",
"margin-left": "20px",
"margin-bottom": "50px",
"width": "calc(25% - 20px)"
},
"text-align": "left",
"img": {
"height": "calc(100% - 15px)",
"position": "absolute",
"left": "0",
"right": "0",
"top": "0"
},
"imgWrapper": {
"padding-top": "calc(75% + 15px)",
"position": "relative",
"height": "0"
}
},
"title": {
"font-family": "Raleway, sans-serif"
},
"button": {
"font-family": "Raleway, sans-serif",
"font-weight": "bold",
":hover": {
"background-color": "#d11a1a"
},
"background-color": "#7b0f0f",
":focus": {
"background-color": "#d11a1a"
},
"border-radius": "29px"
},
"price": {
"font-family": "Raleway, sans-serif"
},
"compareAt": {
"font-family": "Raleway, sans-serif"
},
"unitPrice": {
"font-family": "Raleway, sans-serif"
}
},
"buttonDestination": "modal",
"contents": {
"options": false
},
"text": {
"button": "Product Details"
},
"googleFonts": [
"Raleway"
]
},
"productSet": {
"styles": {
"products": {
"@media (min-width: 601px)": {
"margin-left": "-20px"
}
}
}
},
"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": "Raleway, sans-serif",
"font-weight": "bold",
":hover": {
"background-color": "#d11a1a"
},
"background-color": "#7b0f0f",
":focus": {
"background-color": "#d11a1a"
},
"border-radius": "29px"
}
},
"googleFonts": [
"Raleway"
],
"text": {
"button": "Add to cart"
}
},
"cart": {
"styles": {
"button": {
"font-family": "Raleway, sans-serif",
"font-weight": "bold",
":hover": {
"background-color": "#d11a1a"
},
"background-color": "#7b0f0f",
":focus": {
"background-color": "#d11a1a"
},
"border-radius": "29px"
},
"title": {
"color": "#303030"
},
"header": {
"color": "#303030"
},
"lineItems": {
"color": "#303030"
},
"subtotalText": {
"color": "#303030"
},
"subtotal": {
"color": "#303030"
},
"notice": {
"color": "#303030"
},
"currency": {
"color": "#303030"
},
"close": {
"color": "#303030",
":hover": {
"color": "#303030"
}
},
"empty": {
"color": "#303030"
},
"noteDescription": {
"color": "#303030"
},
"discountText": {
"color": "#303030"
},
"discountIcon": {
"fill": "#303030"
},
"discountAmount": {
"color": "#303030"
},
"cart": {
"background-color": "#f7f7f7"
},
"footer": {
"background-color": "#f7f7f7"
}
},
"text": {
"title": "Your Cart",
"total": "Subtotal",
"empty": "Your cart needs to be filled!",
"button": "Checkout"
},
"googleFonts": [
"Raleway"
]
},
"toggle": {
"sticky": false,
"styles": {
"toggle": {
"font-family": "Raleway, sans-serif",
"font-weight": "bold",
"background-color": "#7b0f0f",
":hover": {
"background-color": "#d11a1a"
},
":focus": {
"background-color": "#d11a1a"
}
}
},
"googleFonts": [
"Raleway"
]
},
"lineItem": {
"styles": {
"variantTitle": {
"color": "#303030"
},
"title": {
"color": "#303030"
},
"price": {
"color": "#303030"
},
"fullPrice": {
"color": "#303030"
},
"discount": {
"color": "#303030"
},
"discountIcon": {
"fill": "#303030"
},
"quantity": {
"color": "#303030"
},
"quantityIncrement": {
"color": "#303030",
"border-color": "#303030"
},
"quantityDecrement": {
"color": "#303030",
"border-color": "#303030"
},
"quantityInput": {
"color": "#303030",
"border-color": "#FFFFFF"
}
}
}
},
});
});
}
})();
/*]]>*/
</script>
User | Count |
---|---|
418 | |
206 | |
144 | |
53 | |
42 |