Sitewide Sales and WooCommerce Compatibility for RightPress Product Price Live Update

Using Sitewide Sales in your WooCommerce site? If you’re also using the RightPress plugins for live price updates, this recipe is for you.

This tutorial ensures seamless integration of Sitewide Sales discounts with RightPress’ Live Product Price Updates, enhancing the shopping experience by instantly reflecting sale prices.

WooCommerce Compatibility for RightPress Product Price Live Update

Table of contents

How It Works

The code hooks into the RightPress live price update flow. It detects an active Sitewide Sales campaign and applies the corresponding discount to the product’s live price, if applicable.

This dynamic pricing update occurs site-wide, ensuring that all eligible products display the discounted rate in real time.

Single Product page with strikethrough pricing and a live update price that reflects the sitewide discount

Code Recipe

This PHP function taps into the rightpress_product_price_live_update_price filter, adjusting the product price if a sale is active. It creates an instance of the current sale, validates the associated coupon, and applies the discount directly to the live price output.

There are two options in this recipe:

  • Use the version on line 30 if you want to base the live update price on the product’s original price in WooCommerce.
  • Use the version on line 34 if you want to base the discount on the updated live price.

Adding the Recipe to Your Website

You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. We have a post on how to create a customizations plugin on our partner website, Paid Memberships Pro.

Remember to test the functionality in a staging environment before pushing it live to avoid disrupting your sales process. With this recipe, your live product prices reflect active discounts instantly, elevating user engagement and driving sales.

SHARE YOUR LOVE
Kim Coleman
Kim Coleman

Hi! I'm Kim Coleman, an internet entrepreneur from Reading, PA. I've been working with WordPress for over 15 years. In 2011, I founded Paid Memberships Pro, a complete plugin for Recurring Subscriptions and Content Restriction with 100k active sites. I'm currently working on our new product, Sitewide Sales.

Articles: 35