Add ratings to Store page products.
- 0.3.1
- 7.1
- Not Applicable
-
Squarespace plan that supports JavaScript.
-
Install twcsl. After you install twcsl be sure to continue on with the rest of the steps.
-
Options
-
Store Page Specific
-
This option will be the one most will want to use if you have only a single store page you want to have this effect.
-
Add code from file store page tag rating.html to Store Settings > Advanced > Page Header Code Injection for the store page. Please see Per-page code injection. Read the code for any insptructions within.
-
-
Site-wide
-
This option is the one you want to use if you have multiple store pages where you want to have this effect.
-
Add code from file store page tag rating.html to Website > Pages > Website Tools > Code Injection > FOOTER. Please see Add code to code injection. Read the code for any instructions within.
-
-
Lets say you have a site that sells bottles of wine. The bottles of wine have been rated by entities like Wine Spectator. A bottle of wine you sell received a rating of 4 out of 5 stars and you want to display that rating to your site visitors to encourage sales.
Edit the product and add a tag of twc-sptr Wine Spectator s 4/5. The twc-sptr indicates to the code that this is a rating. The entity text is the rating entity. The s tells the code you want to use the symbols set in the code. The numbers at the end are the rating and the scale.
-
twc-sptr
-
rating entity name
-
rating type : points, symbols, or words
- use p, s, or w
-
rating : the rating/scale numbers or words
- for r/s, note the forward slash separating the rating and scale
twc-sptr [ rating entity name here replacing square brackets ] [ rating type here replacing square brackets ] [ rating here replacing square brackets ]
twc-sptr Decanter p 9.5/10
twc-sptr Wine Spectator s 4/5
twc-sptr Wine Press Northwest w Platinum
Extra spaces or not following the format described will cause a rating to not be added to a product.
Some classes are provided for styling.
-
twc-sptr
-
rating
-
label
-
points, symbols, and words
-
point
-
scale
-
symbol, true ( filled symbols ), and false ( unfilled symbols )
- overlay
-
-
-
This is not a site visitor rating system.
The rating type words can not represent symbols such as ★. Use the symbols rating type for symbols. For best result use number and letter characters.
You can see a demo of this effect here.
Please consider making a donation.
-
2023-12-01
- fix for ratings jumble when product detail page when related products is enabled
- removed user configurable rating destinations
- bumped version to 0.3.1
-
2023-08-20
- add support for point ratings and words
- bumped version to 0.3.0
-
2023-07-28
- sort tags, simple alpha
- bumped version to 0.2.0
-
2023-06-17
- initial version