Beaver Themer and WC Memberships - Discount and Restricted Messages

If you’re using WooCommerce and WooCommerce Memberships, you might have a discounted product or a restricted product that is available to active members.

Normally when viewing a Singular Product, you would see a notice under the Add to Cart button that notifies your customer about a purchasing discount or a product restriction. These notices are hooked in using the woocommerce_single_product_summary action.

However, if you’re using Beaver Themer to display your Singular Product, that action doesn’t exist, so those notices don’t get displayed.

In order to display those notices, you’ll want to create a custom module with the following code as your frontend.php

if (FLBuilderModel::is_builder_active()) : ?>
	<div class="fl-builder-module-placeholder-message">wc_memberships_discount_and_restricted_message(s)</div>
<?php endif;
if (function_exists('wc_memberships')) :
	echo WC_Memberships_Products_Restrictions::display_product_purchasing_discount_message();
	echo WC_Memberships_Products_Restrictions::display_product_purchasing_restricted_message();