• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Checkout
  • Cart
  • Videos

Add Dual Pricing Per Product in WooCommerce

$75.00

Demo Video
Category: WooCommerce Tags: woocommerce_product_get_price, woocommerce_product_variation_get_price, woocommerce_variation_options_pricing, woocommerce_variation_prices_price, woocommerce_variation_prices_regular_price
  • Description

This code enables you to add a 2nd price for each simple product and product variation. The 2nd price is displayed for logged in users with the custom role named wholesaler. Everyone else is displayed the regular price.

Add different price for simple products in woocommerce :

Add 2nd wholesale price for simple products in woocommerce

Add different prices for variable products in woocommerce :

Add 2nd wholesale price for variable products in woocommerce

Different Price Per Product Based on Role

In this example we use the code to create a custom role for wholesale customers and add a price field to all simple product and product variations which is displayed when users with the wholesaler role login and browse products. When logged out, the regular price is shown.

Installation

Install the zip folder as a new plugin or copy & paste the PHP code from the functions file to the end of your child themes functions.php file or custom functionality plugin.

Primary Sidebar

Cart

Code written by Brad Dalton specialist for WooCommerce with more than 10 years of experience.

Advertise · WPEngine · Genesis · Log in

  • Code Snippets
  • Tutorials
  • Videos
  • Account
  • Checkout
  • Cart
 

Loading Comments...
 

You must be logged in to post a comment.