WooCommerce MSRP Pricing 3.0.0

0
122
WooCommerce MSRP Pricing

WooCommerce MSRP Pricing

The WooCommerce MSRP plugin allows you to record Manufacturer Suggested Retail Prices / Recommended Retail Prices against your products, and have them displayed on the sales pages. This allows your customers to see why it’s a good idea to buy from you.

On your product edit screens you’ll now see an extra field in with the normal pricing information, labelled MSRP. You can enter the MSRP here and it will be shown on the front end to your customers. If you’re bulk importing products, then the MSRP can be imported by using meta: _msrp. By default the MSRP will be shown struck-out – much like a sale price. You can style these however you want, the whole content is within a div with a class of woocommerce_msrp, and the price itself is within a span with a class of woocommerce_msrp_price.

WooCommerce MSRP Pricing

MSRP Pricing

The WooCommerce MSRP plugin allows you to record Manufacturer Suggested Retail Prices / Recommended Retail Prices against your products, and have them displayed on the sales pages. This allows your customers to see why it’s a good idea to buy from you. You can also show them how much they’re saving – either as a monetary value, or as a percentage.WooCommerce MSRP Pricing

WooCommerce MSRP Pricing

Installation

  • Unzip and upload the plugin’s folder to your /wp-content/plugins/ directory
  • Activate the extension through the ‘Plugins’ menu in WordPress
  • Review the extension’s settings by going to WooCommerce » Settings » General and scrolling down to the “MSRP pricing options” section

For more information on installing and managing plugins see here

Usage

On your product edit screens you’ll now see an extra field in with the normal pricing information, labelled MSRP. You can enter the MSRP here and it will be shown on the front end to your customers.WooCommerce MSRP Pricing

If you’re bulk importing products, then the MSRP can be imported using the built in import features in WooCommerce 3.1 or above. If you’re using al alternative solution, then the prices can be imported by using meta:_msrp (for variations) and meta:_msrp_price (for products).WooCommerce MSRP Pricing

By default the MSRP will be shown struck-out – much like a sale price. You can style these however you want, the whole content is within a div with a class of woocommerce_msrp, and the price itself is within a span with a class of woocommerce_msrp_price.

It is possible to have MSRP pricing both product wide and with each individual variation.

Options

Show MSRP Pricing?

You can choose to display MSRP pricing:

Always – All the time

Only if different – Only if the MSRP is different from your standard price for the product

Never – Never

MSRP Labelling

Choose what you want to label the prices as – defaults to “MSRP”, but can be set to what you want

Show savings

Choose whether to automatically show how much a customer is saving. You can either disable this entirely, or choose to have the saving shown as a monetary amount (You save $5.00), or as a percentage (You save 25%).WooCommerce MSRP Pricing

Controlling output

Hook re-ordering

The MSRP price output on product pages is carried out on WooCommerce’s woocommerce_single_product_summary hook with a priority of 7. This normally places it after the title, but before the rating, and price.

If you want, you can un-hook this, and output it on a different hook, or even just at a different priority to change the location on the page. As an example, this snippet moves it after the product price:WooCommerce MSRP Pricing

 <?php
  
 add_action( ‘init’, function () {
 global $woocommerce_msrp_frontend;
 remove_action(
 ‘woocommerce_single_product_summary’,
 [ $woocommerce_msrp_frontend, ‘show_msrp’ ],
 7
 );
 add_action(
 ‘woocommerce_single_product_summary’,
 [ $woocommerce_msrp_frontend, ‘show_msrp’ ],
 12
 );
 } );
view raw
functions.php
hosted with ❤ by GitHub

Shortcodes

You can output the MSRP information for a product using a shortcode in your content:

[product_msrp_info]

The MSRP will be shown automatically for the global $product.

If the global product is not set, you can specify the product ID by adding it as a shortcode argument:

[product_msrp_info product_id="{put the desired product ID here}"]

Template functions

You can trigger output from a particular template file by using the function woocommerce_msrp_show_msrp_info() which will output the MSRP for the global $product if one is defined. If the global $product variable is not defined, then you should pass in the WC_Product object to the function, e.g.

woocommerce_msrp_show_msrp_info( $wc_product );

LEAVE A REPLY

Please enter your comment!
Please enter your name here