Change store page prices.
- 0.6.0
-
7.1
- Not Applicable
-
Install twcsl. After you install the code be sure to continue on with the rest of the steps.
-
Options
-
Page Specific
- Add, in order, code from files store page price change script.html and store page price change.html to Store Settings > Advanced > Page Header Code Injection for the store page. Please see per-page code injection. Read the code files for any instructions within.
-
Site-wide
-
Add code from file store page price change script.html to Website > Pages > Website Tools > Code Injection > HEADER.
-
Add code from file store page price change.html to Website > Pages > Website Tools > Code Injection > FOOTER.
Please see Add code to code injection. Read the codes for any instructions within.
-
-
// remove word from
"from" : "",
// change language of word from, from english to swedish
"from" : "fra",
// remove zero decimal from price
".00" : "",
/*
remove decimal from price, using regular expression, backslash must
be escaped with \, the replacement text uses special replacement
patterns
*/
"/(\\d+(?:,\\d{3})*)(?:\\.\\d{2})?/" : "$1",
// add thousands separator
"/\\d(?=(?:\\d{3})+(?!\\d))/g" : "$&,",
// replacement text callback name
"/.*?\\d+(?:,\\d{3})*(?:\\.\\d{2})?/" : "twcSppcl",
For an example of how to write a callback please see Store Page Price Change Log.
Changing prices on a Store page does not effect the cart, checkout, or other SS pages/backend storage. This is purely a cosmetic change. No code can change the checkout page or SS backend. It is a SS security feature.
Please consider making a donation.
-
2024-10-04
- rework code to use JSON for settings via a script tag
- rework code to use JavaScript Module Patterns for twc, twc.sppc, and twc.sppc.callbacks. makes the initialization code a bit more dense but removes the need for the user to dive into this code to set callbacks. they just need to add a callback per that codes instructions
- bumped version to 0.6.0
-
2022-09-02
- add option to change afterpay price
- bumped version to 0.5.0
-
2022-08-13
- remove an errant line of code, no functional change
- bumped version to 0.4.1
-
2022-04-20
- add support for store detail layouts
- fix for 0.3d8 regression on being able to change store list prices
- bumped version to 0.4.0
-
2022-02-03
- wrap some code in a Immediately-Invoked Function Expression to isolate initialize function
- bumped version to 0.3d9
-
2022-01-31
- rework how code responds to function results, it is now possible to stop further processing of remaining search/replace pairs
- bumped version to 0.3d8
-
2022-01-29
- fix for initialization code break for v7.1
- bumped version to 0.3d7
-
2022-01-21
- make ajax compatible for v7.0
- bumped version to 0.3d6
-
2022-01-20
- fix variable without const keyword
- bumped version to 0.3d5
-
2021-09-30
- pass more parameters to functions so they can do more
- bumped version to 0.3d4
-
2021-09-28
- change where searchReplaceText is stored to reduce varible already defined error
- functions now always run instead of just for variant changes
- use class to show price instead of setting style on elements
- bumped version to 0.3d3
-
2021-08-29
- changed name from Change Store Product Detail Price Text to Store Price Change, previous name was a misnomer
- bumped version to 0.3d2
-
2021-08-20
- disconnect observer before text changes and "reconnect" after changes, more efficient
- bumped version to 0.3d1
-
2021-08-19
- changed name from Change Text of Prices on Store Pages to Change Store Product Detail Price Text
- added ability to call replacment text function
- use twcsl
- bumped version to 0.3d0
-
2021-07-31
- added missing quick install text
- bumped version to 0.2d1
-
2021-05-15
- changed name from Remove Word From, from Prices on Store Pages to Change Text of Prices on Store Pages
- changed code to be a text changer instead of simply removing the word from
- bumped version to 0.2d0
-
2021-05-14
- add support for Five template and Montauk template family
- bumped version to 0.1d4
-
2021-05-13
- fix MutationObserver guard
- bumped version to 0.1d3
-
2021-05-08
- verified code works on v7.0 using Brine template family
- bumped version to 0.1d2
-
2021-04-05
- initial version