Jump to content
prsut

Wholesale support (presta 1.3.0.1)

Recommended Posts

Hello all,
maybe you find this useful.
This is support for wholesale. Added 3 price levels (W/O VAT) for each product (editable in BO).
Next, you should add three customer groups and if customer is in one of these groups, after login he has his prices displayed.
Works in product detail, products list, cart and order.
Do not remember to check product categories for group acces. (Someone may have products only for end users, not for dealers.)

Further info is in readme.txt
Not recommended for beginners, as changes in db and php files are needed. Tested and works in presta 1.3.0.1

Hope this helps.

Improvements, comments, questions, etc. are welcomed

wholesale support.zip

Share this post


Link to post
Share on other sites

hey there,

thanks for your contribution. I'm going to check this out asap as I think it does what I'm looking for. Perhaps you could clarify for me while I play with it.

I'd like to do the following

Group A
Product 1 $10
Product 2 $20
Product 3 $30

Group B
Product 1 $15
Product 2 $23
Product 3 $50

Is it also possible to hide a specific product from a specific group?

Thanks for your work!

Share this post


Link to post
Share on other sites

So, here ara some more details how it works after my changes.

I'm selling tennis strings. MSV and WeissCannon I sell for dealers, but Luxilon not - Luxilon is only for end users (EU). I have three dealer categories : Dealer D1 .. to .. Dealer D3. Dealer D3 has best prices. But for sets there are smaller discounts as for reels, and, for one set I can provide better discount as for other set. All in all, each product has four independant prices (one default for EU + three dealer prices). Note, before my changes, you can set customer group discount, but it is fixed for all products to which customer has access. It was not good for me.

Another task for me , that I have resolved : i want to use (as one of ) the same carrier (Slovak Post for example) for EU and for dealers BUT : For end user I have "Slovak Post" with price range definition (0-100 = 2,5EUR; 100-200 = 1EUR; 200 - more = free of charge), but for dealers I have "Slovak Post (D)" with price range definition (0-200EUR = 2.5EUR; 200 - more = free). Looks simple, but : because each customer is by default also in default category, when ordering (for example 150EUR total products), for dealers Slovak post with 1EUR and Slovak Post (D) with 2.5EUR shows, and this not the way I want it. For this I made changes in code and I'm using shipToPay module which works fine for me.

So please note:
-Dealer D1 has smaller discounts, Dealer D3 has best discounts.
-Each product has independant dealer prices
-because each customer is in default group, dealer still can (but access can be disabled) see products for EU (without need to fill dealer prices, because program simply takes basic price)

to edbloom :
in presta at all,
-each product can be enabled or disabled (groups have no effect)
-product category (where products resides) can have access to customer groups
-if you need to show/hide specific products for specific customer group, move such products to category and set group access (this is way how I deal with dealer's price list for download in pdf, for example...)
-carriers can have access to various customer groups (also zones...)
-you need enough time to discover all posibilities and set them properly...

Hope this help

Share this post


Link to post
Share on other sites

Thanks for providing us with a very helpfull and much needed wholeseller feature in prestashop.

We are using prestashop prestashop_1.2.5.0 latest stable release.

We have integrated php pages and also mysql table, still we are having problem with displaying proper price in both frontend and backend. In backend, if we edit any product, the final retail price shows okay, but without edit the price is visible as $0 in both frontend and backend.

Is it due to version of prestashop we are using?

Share this post


Link to post
Share on other sites

I'm sure it should work in presta 1.2.5. Just be sure how you name new customer groups. If not using "Dealer D1", you must edit php code. I know, it can be implemented way better, but I have had little time to implement it.
And, for other versions like 1.3.0.1, please use diff program (I'm using winmerge), to see, what is needed and new in code for wholesale support. Comments are in code for this.
I have tested in zend studio and it works. Sorry no module, I have no time, but I welcome if someone can put it into module.
Another notes : Dealer D3 has best prices...
When you have lot of products and price levels based of percentage discount (ie. Dealer D1 has 10%, Dealer D2 has 15% ..etc), for startyou can update prices in ps_product by sql statement via phpadmin (I'm using mysql query editor) by running "update ps_product set price_D1 = price / 1.1 , price_D2 = price / 1.15, ... and so. Backup table before trying.

skdev : if customer has acces to product with wholesale prices, that prices should be defined, or you can modify code slightly by addind fragment of code (for example if cust is in Dealer D1):

if ($price_D1 == 0)
{
price_D1 = price;
}
this is hint, not working code. I know about this, but for prducts with dealer access I have all prices defined.
Or use sql statement to update zero prices to base price...

Share this post


Link to post
Share on other sites

I'm not using paypal, so I dont know what about bug is. For me, customer groups works fine. Using 1.3.0.1 and almost daily updated from SVN...

And, I must add this note : (although is mentioned in zip from 1. post).

CUSTOMER GROUP DISCOUNTS ARE IGNORED IN MY IMPLEMENTATION. Can be enabled, but instead of this, each product has one base and three wholesale prices. Once more : group discounts and quantity discounts are ignored, but can be enabled.
Quantity discounts are only for end users. Dealers have prices based on dealer category (ie. customer group)...

Share this post


Link to post
Share on other sites

hi,

Great Mod... just curious is it possible to implement your mods into the product import? im sure it would be as easy as copying wholesale_prices in the import files but wanted to check with the forum to see if it has been done before

Thanks for all your help

Share this post


Link to post
Share on other sites
I'm not using paypal, so I dont know what about bug is. For me, customer groups works fine. Using 1.3.0.1 and almost daily updated from SVN...

And, I must add this note : (although is mentioned in zip from 1. post).

CUSTOMER GROUP DISCOUNTS ARE IGNORED IN MY IMPLEMENTATION. Can be enabled, but instead of this, each product has one base and three wholesale prices. Once more : group discounts and quantity discounts are ignored, but can be enabled.
Quantity discounts are only for end users. Dealers have prices based on dealer category (ie. customer group)...



This is amazing module for wholesaler and retailer
But there is a problem while upload product.php in classes, my online store broken !
Please help me, Thank you.

Share this post


Link to post
Share on other sites
Hi Mabrur,

what version of PS are you using? also did you compare your files with WinMerge


Hi distinct
I use Prestashop Version 1.2.5.0
I've compare with WinMerge too...

Is there the problem, the differences of version?

Share this post


Link to post
Share on other sites
did you also configure your customer groups to Dealer D1, Dealer D2 , Dealer D3


Yes, I have made three categories of groups: Dealer D1, Dealer D2 , Dealer D3
But not add customers to group yet..

Thanks

Share this post


Link to post
Share on other sites

mabrur : product.php (note small letters) is not in classes folder, but in root folder of shop. Generally, in classes folder there are files like Product.php, Order.php...

Share this post


Link to post
Share on other sites
mabrur : product.php (note small letters) is not in classes folder, but in root folder of shop. Generally, in classes folder there are files like Product.php, Order.php...


Hi prsut,
can you help me how to install your module: wholesale support.zip after download?
It's helpful for anyone who need this mod.
Thanks

Share this post


Link to post
Share on other sites

Hi prsut,

thank you for this great module,
I've implement this as you said in readme.txt
I can add product,add groups successfully.
but I had error when adding customer or edit customer data.

the error : validation function not found isDni

if I use the original file classes/Customer.php, I can add customer without any error,
but the price doesn't change..
then if I use your Customer.php file, I got that error..

please help me to figure out this error.. really need your help.
thank youuu

nyett.

Share this post


Link to post
Share on other sites

Great module - thank you.

On top of this functionality I am looking for my site to not charge VAT to a group member (in my case, for example, I am in UK and I would like to create a group for other trade european customers who are VAT registered as they would not be charged VAT).

Could this module do that with some tweaking?

RJ

Share this post


Link to post
Share on other sites

I am looking into this module, however i can't find out, how to edit my PS_Product correct.
I have inserted this:
`price_D1` (decimal(13,6) NOT NULL default '0.000000',
`price_D2` (decimal(13,6) NOT NULL default '0.000000',
`price_D3` (decimal(13,6) NOT NULL default '0.000000',

However i get an error. How should it be set up ?

Share this post


Link to post
Share on other sites

i've heard rumors that someone comes with a ready to go wholesale prestashop soon, with different pricelevels, and groups. ;-)
Groups can be tax exempt.

Share this post


Link to post
Share on other sites
i've heard rumors that someone comes with a ready to go wholesale prestashop soon, with different pricelevels, and groups. ;-)
Groups can be tax exempt.


That would be absolutely fantastic!

Share this post


Link to post
Share on other sites

Hi prsut, thank you for your module, it's very useful and it suits almost perfectly for my needs.

I have a question: I tried it on PS 1.3.0.1 an it works fine, but then i moved to 1.3.1 and some parts didn't work anymore. For example, when performing admin tasks, the customer edit page doesn't show anything and the catalog tab doesn't show the products list for a category (Instead, it shows the message 'hack attempt'). I know this has to do with the PS version, so i read your code carefully, and i found that the function getPriceStatic at Product.php has some wrong with calculating taxes, specifically, when it calls Tax::getApplicableTax at line 1491. do you, or anyone else, know how the PS version affects this function, so i can fix this part for PS 1.3.1?

Thanks everyone in advance :)

Share this post


Link to post
Share on other sites

Hi prsut,

the addition sounds great!!! Some questions:

I need different product groups (A,B,C,D, etc.) and different customers (1,2,3,4 ...). The problem is that different customers should get different rebates and prices and after the login the customer should see his/her price ...

The problem is, that my customers are in product Group A maybe in the customer group A (10% cheaper), but in product group B in customer group B (20%) cheaper. Do you have an idea how I can realize this?

Example:

Customer 1: rebate on product group A=20%, rebate on B=10%, rebate on C=30%
Customer 2: rebate on product group A=10%, rebate on B=20%, rebate on C=20%
Customer 3: rebate on product group A=30%, rebate on B=30%, rebate on C=10%

I have the table with all the product group rebates for every customer, but I'm not sure how to realize this in presta.shop. Is it possible to customize presta shop in this way?

Any help is really appreciated.

thanks

anduj

So, here ara some more details how it works after my changes.

I'm selling tennis strings. MSV and WeissCannon I sell for dealers, but Luxilon not - Luxilon is only for end users (EU). I have three dealer categories : Dealer D1 .. to .. Dealer D3. Dealer D3 has best prices. But for sets there are smaller discounts as for reels, and, for one set I can provide better discount as for other set. All in all, each product has four independant prices (one default for EU + three dealer prices). Note, before my changes, you can set customer group discount, but it is fixed for all products to which customer has access. It was not good for me.

Another task for me , that I have resolved : i want to use (as one of ) the same carrier (Slovak Post for example) for EU and for dealers BUT : For end user I have "Slovak Post" with price range definition (0-100 = 2,5EUR; 100-200 = 1EUR; 200 - more = free of charge), but for dealers I have "Slovak Post (D)" with price range definition (0-200EUR = 2.5EUR; 200 - more = free). Looks simple, but : because each customer is by default also in default category, when ordering (for example 150EUR total products), for dealers Slovak post with 1EUR and Slovak Post (D) with 2.5EUR shows, and this not the way I want it. For this I made changes in code and I'm using shipToPay module which works fine for me.

So please note:
-Dealer D1 has smaller discounts, Dealer D3 has best discounts.
-Each product has independant dealer prices
-because each customer is in default group, dealer still can (but access can be disabled) see products for EU (without need to fill dealer prices, because program simply takes basic price)

to edbloom :
in presta at all,
-each product can be enabled or disabled (groups have no effect)
-product category (where products resides) can have access to customer groups
-if you need to show/hide specific products for specific customer group, move such products to category and set group access (this is way how I deal with dealer's price list for download in pdf, for example...)
-carriers can have access to various customer groups (also zones...)
-you need enough time to discover all posibilities and set them properly...

Hope this help

Share this post


Link to post
Share on other sites
SWD    0

Dear Readers

i will pay some one to set this up for me in working order.

what i need is simple, to have a retails price and wholesale price, there are normal customers and wholesalers, once the wholesaler is assigned to his wholesale group, he only needs to see wholesale prices.

that is it, you can PM me with costing offer,

thank you

Share this post


Link to post
Share on other sites

Hi
What have I done wrong?: I have uploaded the new files under root, classes, admin. I have updated sql in ps_product, 3 columns "price_D1" etc, (I hope correct, price is added when I update D1 price for product). I created new group, and assigned the customer this new group. But when logging in an wieving product, the D1 price is not showing. Anyone who knows this, and how to manage it?
Thanks

Share this post


Link to post
Share on other sites

Hey could MSK69 (or anyone else) tell me if you've heard any more about the release of a "wholesale module". We are considering changing to nothe rshop system if this issue doesn't get resolved properly soon.
ta
jon

Share this post


Link to post
Share on other sites

Thank you MSK69, but there is skant information there about what that module actually does. Can you use it to access the wholesale prices already included on all the product information?
And I'm assuming you haven't heard anymore about a genuine wholesale module........? How crap is this element of Presta shop!

cheers
jon

Share this post


Link to post
Share on other sites

i tried their demo, and actually i found it nice working. The only issue that you maight have is that if you are working with attribute prices, you will find out that that is not supported. (as i understood)

There is also a spanish project who has a rebuild prestashop, with different pricelevels which can be assigned to a customer group. The only thing there is that it's heavily modified, and seems that there is no movement ATM.

www.demartinacode.com

Share this post


Link to post
Share on other sites
i tried their demo, and actually i found it nice working. The only issue that you maight have is that if you are working with attribute prices, you will find out that that is not supported. (as i understood)

There is also a spanish project who has a rebuild prestashop, with different pricelevels which can be assigned to a customer group. The only thing there is that it's heavily modified, and seems that there is no movement ATM.

www.demartinacode.com


It uses the modification from this topic.

Share this post


Link to post
Share on other sites

IMO the best thing is to use the module from post #37, as it's a module, and does not affect any code.
At the time Prestashop releases a new version, which maight have wholesale in it, (or better said several pricelevels) then you should be fine.

Share this post


Link to post
Share on other sites
i already fixed it...here's the 1.3.1 version of the module

thank and credits for the original creator ;)


Thank you very much jveliz and prsut... It works very fine now... :)
thanks once again

Share this post


Link to post
Share on other sites

Hello,
I'm having this problem when adding add columns price_D1, price_D2, price_D3 (decimal(13,6), defaul '0.000000')

Error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add columns price_D1, price_D2, price_D3 (decimal(13,6))' at line 1"

Any one has any idea please help

Share this post


Link to post
Share on other sites

Really thank you prsut for this Wholesale support and thank you also jveliz for the update for the 1.3.1. Will use it. For those which would wish to preserve the use of quantities discount for all the groups, just remove the code lines 1573, 1574 and 1579 of the file classes/product.php

{
           if ($wholesaleCustCategory == 0)
}



However, I give out on this point: how to continue to display them and remove them in the admin without needing to pass by the base?

I answer myself. There is in fact no problem, it came from me. Everything works the hair! Thank you again for sharing this invaluable Wholesale support.

Share this post


Link to post
Share on other sites

Hi,

Your module does not take into account prices that vary according to product groups and attributes. For example, if a 4GB MacBook costs 100 euros more that the 2GB default model, your module does not allow to define a pricing for a client group for each attribute (in table ps_product_attribute). It allows only to define different pricing for the default model (table ps_product).

Do you plan to upgrade your code?
Thanks

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×