Jump to content

!nsert a code block showing the SKU (above the price).

Go to solution Solved by karen.sale,

Recommended Posts

22 hours ago, karen.sale said:

How/where can I insert a code block showing a product's SKU (above the price) on hover.

Do you have any screenshots or sample so we can refer to check?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace (+100 Spark plugin customisations)
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment

I have some existing code that I spruced up a bit and made available. It is similar to the effect you are requesting.

Please see Store Page Detail Sku Add.

This code adds the sku in the product description based on some trigger text you add to the description. If you can live with the difference in how this code works give it a go.

Let us know how it goes, if you do give it a go.

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
Quote

requires me (or my clients) to add something to each-and-every-one of the thousands of products in the database.

I realize my effect wasn't exactly what you were looking for.

One thing that makes the product list page more difficult to create an effect like this is Squarespace doesn't expose the SKUs to the grid structure. If they did, they probably would have added a feature to show that SKU in some manner.

Given that the SKUs are not exposed, one is left with how to get the data. This would involve some amount of custom code, hitting the JSON version of the store page, manipulating the data, and finally get the SKUs onto the page. I've not actually done this and I know of no code that does, so this is an educated guess that it is technically possible to achieve.

Here is a possible manual alternative.

Export products as CSV (docs on support site). In Google Sheets restructure the Description field to insert the SKU as part of the description. Import the CSV which replaces the descriptions.

This would leave you with the SKUs as part of the description as you've done.

Screenshot2024-05-22at11_54_14AM.thumb.png.9f369b37cb5262cf2d45af74c60a4245.png 

I'd try a few products at first to get the hang of the process, then go whole hog.

The SKU's being added in this way would only make sense for products with no variants.

Again this is not exactly what you want but is closer without a lot of JavaScript coding.

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
  • Solution

Thanks for your help!

Just as I suspected...  a lot of JavaScript coding.

Instead, I have already done just as you suggested (Great minds think alike?) and have altered a CSV. Just waiting to test on a copy of the website, when (and if) it ever finishes copying 1600+ item details!

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.