Shopify Storefront data and cart logic is bound to your Webflow elements through Shopyflow attributes. Connecting your Webflow site to Shopify is done by adding custom attributes to your Webflow elements.
Yet, you are not required to type or edit attributes manually. Shopyflow provides you with the pre-configured components needed to create your store, as copyable Webflow elements right in Webflow designer.
All the copyable Shopyflow Components are native editable Webflow elements. There is no layout or styling limitation on any element.
In the below image hover your mouse on the hotspots to see all the required Shopyflow attributes to build a product page like this in Webflow
Select your Add to Cart Button and give it sf-out-of-stock combo class.
Scroll down in the style panel and set the mouse events to none. Remove the sf-out-of-stock class and publish.
Add the following custom css to your page (head section) to give an element inside the product container custom style when the product is out of stock.
In this example we are selecting an element that has the stock-indicator class and setting its background color to red. Change the selector to fit to your use-case.
<style>
[sf-product][sf-out-of-stock] .stock-indicator {
background-color: red;
}
</style>
Follow these steps to create a sliding cart opening animation.
Add the following custom css to your page (head section) to hide an element when user is logged out.
In this example we are selecting an element that has the element-to-hide class and hiding it when user is logged out. Change the selector to fit to your use-case.
<style>
body[_sf-logged-out] .element-to-hide {
display: none;
}
</style>
Add the following custom css to your page (head section) to hide an element when a certain country is selected using the Currency Selector Component.
Imagine a scenario where you have a product description with two tables containing metric and imperial units. You probably want to show the imperial units only to US customers and the metric units to Australian and Canadian customers. To achieve that you can use the custom CSS below.
In the example,
Change the class selectors and the countries to fit to your use-case. You can find the complete country list here.
<style>
body[_sf-country="US"] .metric-table {
display: none;
}
body[_sf-country="AU"] .imperial-table,
body[_sf-country="CA"] .imperial-table {
display: none;
}
</style>
If you are using Finsweet's CMS load solution, you need to initialize the dynamically added product containers. Add the the code snippet below to your page settings before the </body> tag closes:
<script>
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmsload',
(listInstances) => {
const [listInstance] = listInstances;
listInstance.on('renderitems', (renderedItems) => {
window.Shopyflow.fetchNew();
});
},
]);
</script>