=== WP e-Commerce - Wholesale Pricing ===
Contributors: Visser Labs
Tags: e-commerce, shop, cart, ecommerce, wholesale pricing
Requires at least: 2.9.2
Tested up to: 4.7.5
Stable tag: 1.8
== Description ==
Add wholesale pricing controls to your WP e-Commerce store.
For more information visit: http://www.visser.com.au/wp-ecommerce/
== Installation ==
1. Upload the folder 'wp-e-commerce-wholesale-pricing' to the '/wp-content/plugins/' directory
2. Activate the plugin through the 'Plugins' menu in WordPress
== Usage ==
Wholesale Pricing for WP e-Commerce integrates with custom User Roles in WordPress, what this means is you can create custom User Roles with specific access outside the traditional WordPress User Roles (e.g. Subscriber, Author, Moderator, etc.).
I've had alot of success integrating custom User Role pricing within WP e-Commerce using the User Role Editor Plugin (http://wordpress.org/extend/plugins/user-role-editor/) from shinephp, available for download from WordPress.org. Hope this helps!
To configure default pricing rules:
==== In WP e-Commerce 3.7 ====
1. Open Store > Wholesale Pricing
==== In WP e-Commerce 3.8 ====
1. Open Settings > Wholesale Pricing
====
2. Set default pricing levels for Products which do not have their own per-Product pricing rules. If you do want to add default pricing levels leave this as default.
==== In WP e-Commerce 3.7 ====
3. Open Store > Products
==== In WP e-Commerce 3.7 ====
3. Open Products > Add/Edit Products
====
4. Open an individual Product and under the Wholesale Pricing widget select the individual Product's pricing levels. Do note that the fixed price rule will always override the %/$-based pricing rules so set one of the other, not both.
5. Click Update to save changes
6. Have fun!
== Sidenotes ==
==== Product visibility base on User Role ====
To add the show/hide Product visibility based on User Role you can use the built-in filtering we employ on the Products Page and Single Product screen, if you require further customisation of element visibility see the following.
1. Open your root web directory with your favourite file explorer or FTP manager (e.g. FileZilla)
====== In WP e-Commerce 3.7 ======
Depending on whether you are using the default WP e-Commerce template files (e.g. /wp-content/plugins/wp-e-commerce/themes/%current_theme%/...) or have copied them to the 'safe' WP e-Commerce directory within Uploads (e.g. /wp-content/uploads/themes/%current_theme%/...) do as follow.
2. Open 'products_page.php' and paste '<?php if( wpsc_wp_is_product_visible() ) : ?>' on line #82
3. Open 'single_product.php' and paste '<?php if( wpsc_wp_is_product_visible() ) : ?>' on line #26
====== In WP e-Commerce 3.8 ======
Depending on whether you are using the default WP e-Commerce template files (e.g. /wp-content/plugins/wp-e-commerce/wpsc-theme/...) or have copied them to your current WordPres Theme directory (e.g. /wp-content/themes/%current_theme%/...) do as follow.
2. Open 'wpsc-products_page.php'
2.1 Copy the following snippet and paste it below "<?php while (wpsc_have_products()) : wpsc_the_product(); ?>" on line #66
<?php if( wpsc_wp_is_product_visible() ) : ?>
2.2 Paste the following snippet and paste it above "<?php endwhile; ?>" on line #227
<?php endif; ?>
3. Open 'wpsc-single_product.php'
3.1 Copy the following snippet and paste it below "<?php while (wpsc_have_products()) : wpsc_the_product(); ?>" on line #30
<?php if( wpsc_wp_is_product_visible() ) : ?>
3.2 Copy the following snippet on paste it above "<?php endwhile; ?>" on line #214
<?php endif; ?>
======
4. Save changes and upload modified files
==== Original Price ====
Display the original Price before markup/markdown within your store with the following template tag (e.g. Original Price: $20.00).
Drop the following template tag into your Products Page and/or Single Product template, then save changes and upload modified files.
Original Price: <?php echo wpsc_wp_original_price(); ?>
==== You Save ====
Display the saving between standard Product price and the current User Role's markup/markdown (e.g. You Save: $5.00 (25.00%))
Drop the following template tag into your Products Page and/or Single Product template, then save changes and upload modified files.
You Save: <?php wpsc_wp_you_save( array( 'type' => 'amount' ) ); ?> (<?php wpsc_wp_you_save(); ?>)
=== User Role Price ===
Display the Price for a given User Role using the following template tag (e.g. Member's Price: $5.95).
Drop the following template tag into your Products Page and/or Single Product template, then save changes and upload modified files.
Member's Price: <?php wpsc_wp_role_price( 'subscriber' ); ?>
Replace 'subscriber' with the User Role 'slug', here's the default User Role slugs in WordPress.
- administrator
- editor
- author
- contributor
- subscriber
- guest
== Support ==
If you have any problems, questions or suggestions please join the members discussion on my WP e-Commerce dedicated forum.
http://www.visser.com.au/wp-ecommerce/forums/
== Disclaimer ==
This Plugin does not claim to be a PCI-compliant solution. It is not responsible for any harm or wrong doing this Plugin may cause. Users are fully responsible for their own use. This Plugin is to be used WITHOUT warranty.
Can the wholesale discount be calculated before coupons? I also use the plugin”WPEC bulk discount category” and I need to incorporate wholesale plugin after the “subtotal with no tax included” and before the coupon.
Thanks
Hey,
Just wondering when you may be adding the minimum quantity option.
Cheers,
D
Hi Andrew, I can’t commit to this feature happening in the next few Plugin updates but I’ve added it to my Ideas stack to keep track of development. I’m using this system more and more to gauge interest. ๐
http://www.visser.com.au/forums/topic/add-minimum-quantity-support-to-wholesale-pricing/
I have products with price as zero. I want to hide these products from Site Visitor / Guest.
I have set the “Product Visibility” to “Hide Product”, but still the product gets displayed for Site Visitor / Guest.
Is it a bug in the plugin or am i doing something wrong?
Hi George, you’ll need to check the readme.txt, it’s just a matter of adding a simple conditional template tag to your wpsc-products_page.php and wpsc-single_product.php. ๐
i want to be able to specify that the wholesale order should or a minimum order, can i do this with this plugin, rather then just price variation?
for example can we just set an automatic number in the quantity??
I am using wholesale pricing with a Flexishop theme. Upon checkout the wholesale price is correct, but when looking at the products before adding them to the cart, the retail price is shown. Is this the way it suppose to be, or is there anyway to have the products show the correct wholesale price once logged in?
Hi Anthony, please ensure you apply the Core changes in 3.8.6 as my patch for these changes has not yet been implimented into the Core WP e-Commerce Plugin. The instructions are easy and covered within readme.txt of the Plugin provided. ๐
I was unable to make the fix happen. I guess some of the lines of code were different so I was not exactly able to follow the readme. Think I may have messed something up because one of my plugins is not working correctly. Are you going to have the fix built in anytime soon? I had been out of town so a little delayed but thanks for you original quick response.
Hi Anthony, feel free to get in touch as I’ll make this change for you. Remember to include login details (WP Admin and FTP).
Hi Michael,
Before I update wpe can you confirm that they added the support for wholesale pricing as I can’t see it in their change log.
Cheers,
D
Hi Andrew, from what I can see my patch has not been included as yet, I’ll be visiting the Instinct office tomorrow so will provide it to them in person ๐
Will this wholesale plug-in work with WP Flexishop or Express Store Premium ecommerce sites?
IN general, Can I hide the prices from those who are not registered users?
Hi Daryl, I haven’t worked with either of those themes. Send me a copy of each and I’ll confirm whether they both use WP e-Commerce templates, if so there shouldn’t be any restriction. ๐
Here are the two themes.
Thanks,
Daryl
http://themeforest.net/item/express-store-premium-ecommerce-wordpress-theme/300348
http://themeforest.net/item/wp-flexishop-a-versatile-wp-ecommerce-theme/137144?WT.ac=category_thumb
Hi, I am using the same theme (Flexishop), does it work? Would be great to hear before buying it! Thank you!
Hi Marie, I have not tested Wholesale Pricing with Flexishop but assuming it’s a WP e-Commerce theme then you should be fine! ๐
Did you ever get an answer about whether or not we can “Hide” all pricing unless someone has been an approved/registered user? I may not need this plugin since we’re only going to sell wholesale – just need to be able to somehow hide all pricing and buy now buttons to users who haven’t been approved.
Thank you
Hi Shelly, I’ve just responded to Shayne’s bump above. This can be done via the Visibility dropdowns on the Add/Edit Products page within the WordPress Administration. There’s a template tag that is wrapped around the Product elements you wish shown/hidden. Hope this helps! ๐
Hi Michael
Thank you very much. I finally managed to make it work. It was my own mistake. The plugin works really well! THANK YOU!
Woop! Awesome to hear carolina. I’ve been working hard to ensure Plugin updates work as described. ๐
TAXES & wholesale pricing plugin
Hi Michael, I have seen in a few comments people asking about your wholesale pricing plugin as it relates to taxes. Typically, when selling wholesale to customers, no taxes are charged because taxes are only collected when the item is resold at retail. However, when I use your plugin, my wholesale customers still see a tax charge in the checkout page. Is there a way in the current plugin to tell wp-ecommerce not to charge tax for wholesale customers? Also, is there a way to also eliminate shipping charges for specific wholesale customers? If not, these two features would be great on a future wholesale pricing plugin update. Please respond. Thanks.
Hi jimario, Wholesale Pricing at this time has no affect on the behaviour of tax calculation it merely adjusts the Product Price as it is being fed to the customer’s cart and in the consequent Checkout process. I’m quite confident we could minipulate the Checkout to not charge tax either altogether or on a per-Product basis for wholesale customers. Let’s brainstorm on the Idea I’ve set up to track development for this feature. ๐
http://www.visser.com.au/forums/topic/exclude-taxshipping-for-wholesalers/
Hi Michael, I hope you can fix the sales tax issue soon. I am setting up a site with your wholesale plugin and I’m sure that sales tax will be a big issue for the client since they’re based in California. Therefore any wholesaler also based in California will be charged 9.5% tax when they shouldn’t be.
Hi Ed, sales tax isn’t an issue it’s an enhancement. I’ll have a play with it over the weekend and see what I can come up with. ๐
Hi Michael,
Have you had a chance to take a look at excluding taxes during checkout?
Hi Ed, unfortunately not I’m pushing a bit of a backlog of Plugin updates. I recommend getting in touch with a WPEC Pro via GetShopped.org > Resources > WP Consultants. ๐
For anyone looking for a fix to not charge taxes for wholesalers, go to wpsc-taxes/controllers/taxes_controller.class.php , and look for function wpec_taxes_calculate_excluded_tax( $cart_item, $tax_rate ) . This assumes you’ve set up a ‘wholesaler’ account with the User Role Editor plugin. After //do not calculate tax for this item if it is not taxable , add the following lines :
//Test User Roles for Wholesaler
global $current_user;
get_currentuserinfo();
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
Then change if(!isset($cart_item->meta[0][‘wpec_taxes_taxable’]) ) to
if(!isset($cart_item->meta[0][‘wpec_taxes_taxable’]) && ($user_role != ‘wholesaler’) )
Hopefully the formatting won’t be messed up when I post this. Since this modifies a core function, it will have to be manually changed everytime there is an update.
thanks for offering this Ed. I’ve been waiting for ideas on this very issue. I’ll implement it to see if it works out. Hopefully the formatting from your post was correct.
Ed,
Looks like I replied prematurely. The version of WPEC I’m running is 3.7.7. The file structure & file you referred to does not exist on that version. The only “tax” file I could find was tax_and_shipping.php located in the main WPEC directory and it doesn’t have code related to what you’ve posted. ๐ Back to the drawing board.
Hi jimario, that code snippet above is for 3.8.6. ๐
I figured that might be the case. Anyone know of which file in 3.7.7 I could apply this kind of fix to?
Do what I did – look in the template file for checkout that calls the function for taxes, and keep following subsequent function calls until you find what you need.
Hey Ed, that rocks! I’ll speak to Instinct and see how we can get that cooked into a Plugin update; through filters and hooks! ๐
Glad you like my code Michael! Here’s my code for a propsed filter. Same as above, after //do not calculate tax for this item if it is not taxable , add the following line :
$item_not_taxable = apply_filters (‘is_item_taxable’ , ”);
Then change Then change <imeta[0][‘wpec_taxes_taxable’]) ) to
if(!isset($cart_item->meta[0][‘wpec_taxes_taxable’]) && (!$item_not_taxable) )
Then my code in functions.php
add_filter ( ‘is_item_taxable’ , ‘is_user_wholesaler’);
function is_user_wholesaler () {
//Test User Roles for Wholesaler
global $current_user;
get_currentuserinfo();
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
if ($user_role == ‘wholesaler’) {
return true;
}
}
I just realized that while the above code does work, it is somewhat counter-intuitive in the choice of words used in the variables and functions. Instead, use
$item_not_taxable = apply_filters (‘is_item_tax_exempt’ , ”);
if(!isset($cart_item->meta[0][‘wpec_taxes_taxable’]) && (!$item_not_taxable) )
in the wpsc core file, then
add_filter ( ‘is_item_tax_exempt’ , ‘is_user_wholesaler’);
function is_user_wholesaler () {
//Test User Roles for Wholesaler
global $current_user;
get_currentuserinfo();
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
if ($user_role == ‘wholesaler’) {
return true;
}
}
in functions.php
Your plugin works very well, but my client is concerned because there is no way to prevent a wholesaler from simply ordering a very small quantity or dollar amount. And since there is no easy way to check if an order is from a wholesaler, this could be problematic. Please tell me minimum purchases (both currency and quantity) is being worked on!
Hi Ed, would minimum quantity restrictions be implemented at Add to Cart time or prior to successful Checkout? I can add an Idea to add support for this as needed ๐
Hi Michael, I think prior to successful checkout would be the better way, Thanks so much!
Hi Michael,
Were you able to implement a minimum wholesale order? Also, if the client want to sell wholesale only in a login-required area (no retail), will this plugin do the trick?
Thanks!
Hy,
I just bought this great plugin.
Is there a way to show discount according to user when logged in?
On cart widget or product page?
Thank you,
Ivana
Hi Ivana, I’ve added this to the Ideas page as a feature to implement for Wholesale Pricing.
http://www.visser.com.au/forums/topic/wholesale-pricing-discount-widgettemplate-tag/
Hi There
This looks like a great plugin. Can you tell me if it has the ability to set individual product pricing for all levels or is it just a standard ‘x’ ammount added to the price as per user level?
Look forward to somebody’s reply
Cheers
Ashley
Hi Ashley, Wholesale Pricing allows you to assign a default pricing level – either $ or % markup/markdown – against each User Role which is then reflected throughout the store, within each individual Product you can override the default by assigning each Product it’s own pricing levels; again by $ or % markup/markdown.
I’m now looking with a client at adding support for fixed Product prices as an alternative to Product pricing levels which could be toggled at a store-wide level or per-Product/where needed. This feature will be rolled out as part of a future Plugin update for Wholesale Pricing customers ๐
I know its early days, but I can’t wait for this update!! You wouldn’t happen to have a preliminary timeline or this?
Awesome plugins too!! ๐
Hi Michael, fixed priced overrides are available in the 1.6.4 Plugin update with support for WP e-Commerce 3.7 and 3.8. I’ve implemented this in such a way that on a per-Product level the fixed price will always take precedence over $/%-based pricing. ๐
So far everything i have purchased from this site does not work with 3.8 as described. merely for the fact that myself and im sure others are all using product variations. when or how do we get this resolved?
Hi Stevep, you should see a Plugin update available within your WordPress Administration if you’re using my Plugin Versions Monitor Plugin (http://www.visser.com.au/wp-ecommerce/plugins/plugin-version-monitor/).
Product variation support has been a long desired feature across my suite and I’ve been learning the in’s and out’s of how it works in WP e-Commerce 3.7 and 3.8. You’ll see support for variations across the suite shortly. ๐
Ok, great thanks for the quick response. it is working now but only on the shopping cart level. it doesn’t show wholesale pricing in grid-view or on the product pages. is this a supported feature?
Hi Stevep, can you please confirm that you’ve made the adjustments to the Core WP e-Commerce Plugin as detailed in the readme.txt. I’ve provided a patch to the Instinct team to remove the need for Core changes in 3.8.6 ๐
Is there an ETA on this yet.
Cheers,
D
1.6.2 has just been released, variation support for WP e-Commerce 3.8 is just one of the changes in this Plugin update! ๐
hi michael,
just did the update and made the changes to the changes to the core, though, still not having any luck.
ad
might just reinstall wpe and start again
ok, i think i know my problem, the global setting seem to over ride the product variation (i think). would you be able to have a look at my db and code by any change..?
Hi Andrew, I think I may have confused how to implement variation support. Right now Wholesale Pricing hides the per-Product properties and uses the pricing rules on the parent Product (e.g. Socks > Colour: Red, Socks would be the parent) in conjunction with the variation price (e.g. 10% discount on Red Sock that would usually be $4.95). Is this how you expected this behavior to work?
So you cant set the percent/price increase on a per product basis. Eg Set Product A to increase by 20% of set price and set Product B by 50%
Hi Andrew, for each Product sure – just as always – but you can’t set per-Variation pricing and that’s where the Wholesale Pricing widget is hidden; within the individual Variations. ๐
Hi Michael
Thank you for your quick updates on everything and for your awesome plugin. However, I’m really needing it to work with variations as every single product in this shopping cart has variations.
When would this be possible.
Thank you
Carolina
Hi Carolina, please download the latest 1.6.2 Plugin update, Product variation support has been cooked into this release. Just as you have been doing you set the pricing levels within the Product and those rules pass onto the Product variations. I’ll be working with the WP e-Commerce team to get the 3.8 changes included in the next Plugin update.
Please read the readme.txt as there are some minor file changes neccesary in WP e-Commerce versions up to 3.8.5, 3.8.6 will have these fixes baked in. ๐
Hi Michael
Thank you! It seems its working fine but I think I’m doing something wrong.
My client sells clothing. She has variations of colour, size and material on most products. The price is the same for the parent product (e.g. shirts). I will like to be able to set one level of discount for some users for the parent products. It seems that I have to do it for each variation and that will be a pain for me (e.g.shirt-blue-medium-cotton, shirt-blue-large-silk.etc).
The discount appears fine at first. But when I choose my variations (e.g. red-large) the price goes back to the original.
I’m not sure if this is clear. If you prefer I can send you screenshots to your email.
cheers
Carolina