For the past few days I was really fed up with a problem. One of my clients needs to show two price values for each of his products in magento based website. That is each product will have two price values one is for international market and the next is for local market.
I have searched a lot for an extension to solve this problem, but I couldn’t find any which can exactly solve my problem. But I got this extension which may help me to solve my problem in a different way. The extensions is called ‘Store price’. Store price allows the product prices to be set at the store level.

You can download this extension using your ‘magento connect’. Here is the link to the extension. Download your key after login in to magento website and install it.

Now I will explain how to solve this dual price issue. For this I have to use a great feature of Magento e-commerce, that is Multiple website management. Hope you know that you can run multiple websites under same magento installation. If not kindly go through this page and you will get an idea about it.

For creating a new website go to <admin> System >> Manage Stores. You will get a screen where you can see ‘Create Website’ button.  Fill Name, Code fields and create your website. But it is not enough, we also have to create a ‘Store’ and ‘Store view’, hope you have noticed those buttons on the ‘Manage stores’ page.

While creating Store specially notice ‘Root Category’ dropdown, u can use your existing root category or you may create an entirely new one. But here I will use my already created root category, because I don’t want to re-enter product details. All I have to do is to keep two price values.

After creating Store, now have to create a store view. The third button on Manage Stores page. Create store view and edit you Store and change ‘Default storeview’ to newly created store view.

So we are completed the preliminary steps. But we cannot see our newly created website now. To run newly created website we have to complete some steps which is to perform outside Magento admin.

First we have to create a folder on Magento installation root. In my case my new website name is ‘international’ so I created a folder with same name. Now copy your index.php file and .htaccess file to newly created folder. Now edit index.php file, change line number:45 to

$mageFilename = ‘../app/Mage.php’;

.

Then change Line number:75 to

/* Store or website code */

$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ‘<your newly created website code>’;

And Line line number:78

/* Run store or run website */

$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : ‘website’;

So the second phase completes here. to check whether website works properly point your browser to

http://yourdomain.com/<magento installation>/<newly created website>

In my case

http://localhost/works/magento/international/

See what is happening, the design looks crappy right? Only text is there. Ok let’s fix it. Go to your Magento admin again and navigate to System >> Configuration

Change your current configuration scope to newly created website.

Select ‘Web’ from General tab. And select the Unsecure option.

Remove ticks for ‘Base URL’ and ‘Base Link URL’ chage your Base URL to ur default magento website. In my case ‘http://localhost/works/magento/’ (By default u will see base URL tag here, have to change it to above mention style). Then for the ‘Base Link URL’ attach your new website name along with ‘{{unsecure_base_url}}’ tag. So it will look like ‘{{unsecure_base_url}}<newwebsite code>/ ‘. Save your configuration. Your are done. So new website is up. But as usual it will display nothing on homepage. To show your home page, go to cms>> pages and set new store view scope for your home page.

Now we have to set the price for products, that is Price-1 for a default website and price-2 for newly created one. For that we have to change our price attribute scope to website. By default it will Global. For that navigate to

<admin>System>>Configuration>>Catalog>>Price

Change Catalog Price Scope to Website(Please make sure that Current Configuration Scope is Default config). save your configuration.

Now navigate to Catalog >> Manage Products

Select any product, choose new store view and edit values. Here in my case store view is ‘international’. So Im switching my store view to international and will edit my price value. So Price-1 on my default website and Price-2 on my Newly created website.

Hope you have enjoyed the tutorial, comment your suggestions and subscribe my feeds.

Share on Facebook

2 Responses to “Multiple price for same products in Magento”

  1. Tien says:

    This is great article. Thank you alot.

  2. Gaurav says:

    How to make the score of inventory from global to website level, if i want to manage inventory for both the website seperately.

Leave a Reply