Vic2278 Posted November 18, 2023 Share Posted November 18, 2023 Hi, Sorry to bother you all. I am working on a website that sells luxurious wines. Our inventory is based on crates of wines (so boxes of 6 or 12 bottles). Our customers will also only be able to order per crate. When displaying the products, we want to show the price per bottle (so the price of the crate divided by the amount of bottles). Do you know if it is possible to solve this using code and not just hardcoding the bottle prices in the application? Thanks in advance! Link to comment
paul2009 Posted November 18, 2023 Share Posted November 18, 2023 (edited) 8 hours ago, Vic2278 said: I am working on a website that sells luxurious wines. Our inventory is based on crates of wines (so boxes of 6 or 12 bottles). Our customers will also only be able to order per crate. When displaying the products, we want to show the price per bottle Please provide a link to an example product on the site. If required, How to Post a Forum Question provides guidance on how to provide a link. Also, to confirm your requirements, I assume the price per bottle is the same regardless of whether they select a box of 6 or 12 bottles? Edited November 18, 2023 by paul2009 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
Vic2278 Posted November 19, 2023 Author Share Posted November 19, 2023 (edited) Hi @paul2009, Sorry for the missing information... Here you can find a product on our site https://www.chateau-exclusif.com/ourcollection/p/pavie (password: fourways) So at the moment our inventory is designed in a "per bottle" manner, meaning that we count each bottle separately and that the price in the inventory is equal to the price per bottle. Our goal is to create a "per crate" inventory, meaning that the price in the inventory will be per crate. But we want to display the price per bottle (without hard-coding). Is there a way to do this? Thanks! (and yes the price per bottle is the same) Edited November 19, 2023 by Vic2278 Link to comment
paul2009 Posted November 19, 2023 Share Posted November 19, 2023 59 minutes ago, Vic2278 said: at the moment our inventory is designed in a "per bottle" manner, meaning that we count each bottle separately and that the price in the inventory is equal to the price per bottle. Our goal is to create a "per crate" inventory, meaning that the price in the inventory will be per crate. Thanks for the additional information. If I understand you correctly, the two products on this page are priced at €301 and €312 per bottle, and you want to show the price like this but, when add to cart is clicked, you want to add €1806 (or €1872) to the cart. Did I understand correctly? Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
Vic2278 Posted November 19, 2023 Author Share Posted November 19, 2023 (edited) Yes exactly! @paul2009 Edited November 22, 2023 by Vic2278 Link to comment
paul2009 Posted November 22, 2023 Share Posted November 22, 2023 As you probably imagined, Squarespace wasn't designed to work this way so you'll need some custom code to show the prices like this. It isn't a common request, so there isn't likely to be a pre-built solution. That said, if all your 'products' are sold in crates of '6' (not other quantities) and if none of your products have variants, the code will be fairly straightforward. The first step will be to set the price of a product to the price of a 'crate'. Once you've done this, the product will be added to the cart at the higher price (for example, €1806). This will also be how prices are picked up by search/price engines. The code will need to change the way prices are shown on product pages - I'm assuming both on store pages (aka Product List Pages) and Product Detail Pages. The code will need to: wait for the page to load the content dynamically find all the prices on the page divide the cost of the product by 6 (the number of bottles in the crate) replace each price with the newly calculated price. If crate quantities vary by product, you'll need more complex code that checks the number of bottles in the crate before doing the division. If you have differently priced variants, the code will need to cope with "from" pricing and will need to update the price when a variant is selected. Did this help? Please give feedback by clicking an icon below ⬇️ Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
creedon Posted November 22, 2023 Share Posted November 22, 2023 Please see the following. This is not a solution for this specific issue but attempts to provide a framework to implement a solution. It covers many of the functional points @paul2009 mentions that the code would need. Text replacement function(s) would need to be written to handle your specific needs. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment