My first approach for this post was to explain my first impressions from Magento Commerce, but I decided to explain how I managed to create a Retail/Wholesale solution required for a current project.
The requirement (so far, because it’s an ongoing project):
The client want to have a shop where regular customers to be able to see products with their retail price, while Wholesale partners to see the prices with ? discount. The extra condition: retail and wholesale prices hasn’t mathematical dependency. So, a product could be $100 for retail and $50 for whole sale and another one could be $60 retail and $50 wholesale. And of course retail users should not be able to see wholesale prices at all.
Basically, I will explain what I did step-by-step, but in order to understand what I mean, you should be familiar with the basics of Magento.
1. Creating two magento websites, stores and views
(Magento meaning of website of course) It’s done from from System->Manage Stores. The result is:
Website | Store | View
————————————————
Retail->Retail->Default
Wholesale->Wholesale->Default
Both sites using the same category/product tree
2. Setting the price scope
in System->Configuration->Catalog->Catalog->Price set drop-down to Website. Now you could enter prices per store/website and they could be totally different.
3. Get some plugins
Get following plugins from Magento Connect and install them from admin: System->Magento Connect->Magento Connect Manager:
Netzarbeiter_LoginCatalog – User need to login in order to see the store (it will be used for Wholesale site)
Netzarbeiter_CustomerActivation – User need to be approved from site admins in order to be able to login to the site. (again it will be used for wholesale site)
Both plugins need to be activated for wholesale only. Because they are activated when they are installed, you need to disable them for Default/Retail website and to leave enabled to Wholesale. You should know that distinction between sites in System->Configuration is done from top left corner of the config window.
First plugin is enabled/disabled from: System > Configuration > Catalog > Login only catalog
Second one: System > Configuration > Customer > Customer Activation.
4. Setting separate url for Wholesale
Now wholesales need to have separate urls, so regular users will access http://domain.com/, while wholesale will access http://domain.com/wholesale/. I found this solution in the Magento Forum: Thread.
So, following the instructions I created directory wholesale/ and copied .htaccess and index.php files from the root directory. Modifications in the index.php are the same as in the Forum:
Mage::run(); become Mage::run(‘wholesale’);
and
$mageFilename = ‘app/Mage.php’; become $mageFilename = ‘../app/Mage.php’;
5. Change the wholesale paths from the admin
From System->Configuration (select Wholesale website)->General->Web and change the paths by adding wholesale/ (it’s also mentioned in the forum thread).
6. Adding products to both websites
When adding products, you should mark them visible for both sites. This is done from Product page->Websites tab.
That’s it! Now on http://domain.com/ users will see full catalog, they can login without Admin approval and prices will be retail, while on http://domain.com/wholesale only users registered as wholesale and activated from admin will be able to see catalog with wholesale prices.
What’s left…
And this was the easiest part … the rest is to import about 2000 products from the current osCommerce store, and to add another 4000 from the client’s ERP system. After this on regular basis to update prices and quantities from ERP system.
Hopefully this will help someone.


Hey there Nik,
Got a solution for this one?
I have a problem, but I’m not sure if it is a big one or SIMPLE.
Originally I created two stores (retail & wholesale) that use the same product inventory (but have different prices) – per this thread.
The default domain.com goes to the retail store and domain.com/wholesale/ goes to the wholesale store. Everything works perfectly.
Now my bosses want the retail store to get “turned off” and only the wholesale store to be “open”. This would be easy if I had made the wholesale store the domain.com and made the retail store domain.com/subdirectory/ but how do I do it so that the domain.com home page links go to /wholesale/ instead of domain.com ???
Thanks in advance!
CG
Hi,
I think this is very easy. I am not sure how it will be treated within admin, but if you go to Sytem->Store managemenr (it’s raw translation because I am using bulgarian version) you can see your 2 stores.
Click on the wholesale website link (first column) and you will see a check box “set as default”. In addition you could change the order to 0 and set the order of the end customer to 1.
This will solve your problem I think. I don’t know if this will set the wholesale store as default in the admin too.
Of course you should change the default paths for the wholesale within configuration.
Hope that helps
Great tutorial as a lot of people are unsure of how to do that in Magento. We have lots of free Magento video tutorials available at http://www.netsalestrainer.com for anyone looking for more help.
Excellent post. This really helps me define how to get more out of magento. Thanks
thank a lot.
Hi,
If a whole sale buyer login’s in he should see whole sale prices in the price list column
Hi everybody,
i have a fresh install 1.401 and the index.php seems to have changed
default last 4 lines look like this:
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ”;
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : ‘store’;
Mage::run($mageRunCode, $mageRunType);
how should i amend here now?
will have some tries
regards
marco-polo
Can you help me how to implement this for enterprise edition
@Prasoon you rulz! If you have an Enterprice Edition, the developers from Magento should do this for free in exchange for 11k per year.
I was so excited to read these instructions:
in System->Configuration->Catalog->Catalog->Price set drop-down to Website. Now you could enter prices per store/website and they could be totally different.
Problem is once I set price scope to website, I still can’t set diff prices for diff stores/websites. I’ve tried changing scope of price attribute, but the drop-down menu is grayed out.
Also tried changing store views per product, but my other store views don’t show in drop-down menu. Argh!
What am I missing?
i installed those two extensions using the magento connect but i can not see them in the configuration areas you are refering. do i need to do sth more?
i am using magento 1.4.0.1
clockman, sorry, but I was used Magento version 1.2 I cannot say what and where is changed in 1.4.0.1
sorry.
hm… i see…
not even the /wholesale i can do cause of the changes in index.php folder
any one that can help with that?
or any idea of a solution for that in magendo 1.4?
Thanks for the guide, it was really helpful. However the plugins don’t do exactly what I’d like them to. For the login plugin, it would be nice if you could specify which areas can be viewed publicly. Right now it seems anonymous users aren’t restricted until they view a category or product. Also the activation plugin isn’t very friendly to the users. After you register it just redirects you to the homepage, with no explanation that you need to wait for activation by an admin.
I finally wrote an extension for this… I still need to fix a few things and am going to add some features such as “Price Name” so that if you name it “Wholesale” or “Distributor Price” it will display this on the front end based on which rule it uses..
http://www.magentocommerce.com/magento-connect/Auriferous/extension/3757/wildcardbi_rulepriceattribute
Such an awesome article, thank you! However I am stuck.. can’t seem to get it to load, i followed above steps exactly but get the following error message on http://www.mywebsite.com/wholesale/
Parse error: syntax error, unexpected ‘.’ in /home/happycow/public_html/wholesale/index.php on line 45
Anyone know what i have done wrong?
Not to be a smart-ass or anything, but have you tried opening up your wholesale/index.php and taking a look at line 45 with a text editor?