This page is to keep track of useful tools implemented to explain or debug Price Rules behaviour in the browser on an e-commerce store.
This function can be run in the browser console to provide more info about a money element.
window.BOLD.pre.elementReport($0); // $0 is any .money element
elementReport can accept any element with class money and shows the product/cart item the element belongs to and what discounts or adjustments have ocurred.
$0 in this call represents the currently selected element in the browser tools Elements panel.
Beside our standard browser build deployed as
pr.js a dev build is provided as
This build is identical in behaviour but includes logging to the browser console and sets debug objects to expose price rules behaviour on the page.
You can enable the dev build temporarily in your session by adding
?_env=dev to the end of your shop’s url.
Window debug object
Only available in the dev build (pr.dev.js)
This object is added to window by the dev build and provides access to several useful objects for debugging including:
- The Shop object
- Record of internal events
- Record of ruleset requests made and their results
- Current config