This snippet increases the Fear Of Missing Out (FOMO) and urgency factor by showing a countdown timer on the product loop.
Specifically, the timer counts down to the sale end price. If there is no sale end price, the countdown timer will not show.
The “sale to price” is set in the product settings under the “General” tab and saved in the database in the “wp_postmeta” table with the meta key “_sale_price_dates_to”.
By showing a countdown, the customer knows that the sale will end, an encourages them to purchase now rather than wait and potentially miss out on the sales price.