Magento – Hide shipping method for multiple store views

shippingstore-view

I am trying to create a solution for different shipping options in the cart based on store view and would appreciate any advice.

In Magento, I have 1 website (abc.com) with 2 store views (general) and (VIP)
I have the following shipping methods set up:
In bracket, I have the admin shipping method used

Economy FREE 4-6 day delivery (Matrix shipping rates table)
Standard 1.99 2-3 day delivery (Matrix shipping rates table)
Premium 3.49 1 day delivery (Matrix shipping rates table)
FREE Premium Delivery activated when order over 99 (Free shipping method enabled)

Attached is a screenshot of my shopping cart

enter image description here

I need the above 4 methods to be enabled on the (general) store view, but I want to disable the Economy on the (vip) store view. In Magento configurations, it is only possible to disable at the website scope level. When you select a store view scope there is no ability to disable based on store view.

To hide the FREE 4-6 working day delivery I understand there may be an option to code a conditional IF statement in php code, but I have very basic skills on php. I think the code may need to be placed in one of the files in checkout/cart maybe the available.phtml or shipping.phtml, something to do with sp-methods. But the php code uses a get method so I cannot access the hard code to wrap an IF statement around the specific shipping method.

I would appreciate some help in getting the desired solution. Thanks for your time.

Best Answer

By default shipping methods availability can be managed only in case of websites.

It achieved in system configuration file.

/app/code/core/Mage/Shipping/etc/system.xml

Let's find section for some shipping method. E.g. for flatrate

            <flatrate translate="label">
                <label>Flat Rate</label>
                <frontend_type>text</frontend_type>
                <sort_order>2</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <fields>
                    <active translate="label">
                        <label>Enabled</label>
                        <frontend_type>select</frontend_type>
                        <source_model>adminhtml/system_config_source_yesno</source_model>
                        <sort_order>1</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>0</show_in_store>
                    </active>

2nd row from the bottom set 1 (it would be better if you copy this file into local folder by the same path /app/code/local/Mage/Shipping/etc/system.xml and make your changes there)

<show_in_store>1</show_in_store>

And then you can make this shipping method available for specific storeviews.

enter image description here

I didn't totally tested how it works. Only checked visibility in two different store views. Looks like visual side is ok. Most likely there should not be any issues.

Related Topic