Hide products on product list pages using tags with dates.
- 0.1.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 list tag date hide.html to Store Settings > Advanced > Page Header Code Injection for the store page. Please see Per-page code injection.
-
-
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 list tag date hide.html to Website > Pages > Website Tools > Code Injection > FOOTER. Please see Add code to code injection.
-
-
Edit a product and add a tag of twc-spltdh 2024-03-23 2024-03-25. The twc-spltdh indicates to the code that this is a product to be hidden based on the dates entered. The first date is the date to begin hiding the product, the second (optional) when the hiding ends.
-
twc-spltdh
-
start date ( YYYY-MM-DD )
-
stop date ( optional, YYYY-MM-DD )
twc-spltdh [ enter start date here replacing square brackets ] [ enter optional stop date here replacing square brackets ]
Hide a product beginning on date.
twc-spltdh 2024-03-24
Hide a product for a date range.
twc-spltdh 2024-03-23 2024-03-25
Hide a product annually for a date range.
twc-spltdh 1970-03-23 1970-03-25
Using the year 1970 tells the code to replace the year with the current one.
Extra spaces or not following the format described will cause a product not to be hidden.
This effect is not active in SS Preview to test it use private browsing.
Please consider making a donation.
-
2024-04-11
- fix for 1970 date check
- bumped version to 0.1.1
-
2024-03-24
- initial version