Hi @highfives.
Don’t want to highjack this thread, but I’ve been following it for a bit (along with other Shopify related posts) and it seems there are more and more issues coming up with their embeddable purchase buttons.
Just wanted to share this link with you: Webflow | Foxy.io Add purchase buttons just like you do with Shopify except that everything can be managed in Webflow (and no bug headaches).
From what I’ve seen, I’m not a huge fan of the checkout design with Foxy. Also, I only have 2 products to sell and $20/month is high for that. Do you offer smaller plans?
Hi @novell17.
Really appreciate your feedback. All Foxy related templates (cart, checkout, receipt, emails) can be completely customized with custom html, css, and js. Message me and I can send you some unique examples.
For pricing, we don’t have a lower priced tier but if you pay annually ($180/yr), the price averages to $15/mo. Not to mention our 10% discount for non-profits and 15% recurring commission for any clients you start a paid subscription for. Also, we’ve been discussing a transaction fee based plan with no monthly charge, but there is nothing concrete yet.
Shopify Lite’s pricing is definitely appealing, but if it’s not working as it should in your Webflow website, how much time and money is that costing you? Sometimes it’s worth paying a little more for something that works. Let us know if we can help with anything.
Hi @highfives!
Finally, came up with a simple solution for you - works on my end. Ok, here we go:
Inspect your BuyButton embed code: there are two parts. At the start a < div >…< /div >, then a < style >…< /style >-part. Copy&paste only the div at the start where you want your button to appear and add a small change to the number at the end to create a unique ID:
< div id=‘product-component-123456789’ >< /div > →
< div id=‘product-component-123456789_1’ >
< div id=‘product-component-123456789_2’ >
Place only the rest of the code from somewhere else (e.g. the -part) in seperate new divs each, and change the ‘node’-part, like:
In general, it would be best not to put as much default buy buttons on one page but use SDKs to minimize code to not slow down a page, but for just a bunch of buttons it might work as you specified.
Shopify’s buy button script is set to show the buy button inside of a div with a matching ID upon pageload. Problem is, if you paste the embed code multiple times you are effectively pasting the same div with the same ID multiple times. So, the script will run multiple times and repeatedly place the buy button into the first div it finds with the matching ID. This creates multiple buy buttons in one location on your website, hence this post.
To resolve this issue, you simple need to append some unique information to the div so the script can set the buy button in each unique div. @ellelle had a div named product-component-123456789 which they simply renamed to product-component-123456789-1 in the first embed code and product-component-123456789-2 in the second embed code.
It’s pertinent to know you have to make this ID naming change wherever the div ID appears. In this case, it appears in the very first line of the embed code as well as the line containing “node: document.getElementById(”. Once you change the div names in each location, your buy buttons will appear separately as desired.