Have a look at the screenshot below, you’ll see these hardcoded big green buttons linking to the product on NewLook. Even if the product is no longer available on NewLook, they will remain visible on this website along with the other product information.
So how can we keep this hardcoded product data up to date?
Our plugin is watching a set of data attributes that can be very interesting.
If you add the following code to the button HTML code, you can control whatever happens when the product is no longer available. And you could even add this on the complete product div.
1) data-mnt-product="sku” tells us what product to open when they click on the button, IF it’s still available. This is the internal Monotote SKU that can be retrieved in our dashboard.
2) data-mnt-watch-product="sku” tells us what SKU to watch out for, combined with the data-mnt-watch-product-hide-class property.
3) data-mnt-watch-product-hide-class="css-class” tells us what CSS class needs to be applied, should the product no longer be available. For example, hide it. In addition, it will also fire a couple of JS events that you can catch and do even more fancy stuff with.
If you want to use the original product url / sku instead of the Monotote SKU, use the following attribute:
The reason we have 3 properties instead of two is so you can also do this (hide the complete div if you want):