Jump to content

Changing the displayed price

Recommended Posts

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
  • Replies 6
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 by paul2009

About me: I'm Paul. A SQSP User for 18 yrs, I've been a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing 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 free. You can thank me by clicking one of the feedback emojis below. Coffee fuels my work.

Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance

Link to comment

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 by Vic2278
Link to comment
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?

About me: I'm Paul. A SQSP User for 18 yrs, I've been a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing 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 free. You can thank me by clicking one of the feedback emojis below. Coffee fuels my work.

Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance

Link to comment

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  ⬇️

About me: I'm Paul. A SQSP User for 18 yrs, I've been a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing 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 free. You can thank me by clicking one of the feedback emojis below. Coffee fuels my work.

Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance

Link to comment

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.