2

I am trying to create a solution for different shipping options in cart based on store view and would really 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 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 very basic skill 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 really appreciate some help on getting the desired solution. Thanks for your time.

  • you can make condition in available.phtml based on store view and shipping method code ($_rate->getCode() in loop) – Minesh Patel Feb 23 '16 at 12:30
  • Thanks for your replies Zhartaunik, Please could you confirm if I will need to "change the code pool in app/etc/module/Mage_all.xml" based on what I've understood about saving files into a local core folder? Minesh, I am not an advanced php coder, so please expand on specific code for achieving your approach. Thanks – zinggyz Feb 23 '16 at 18:04
  • Hi @zinggyz, welcome to Magento SE! StackExchange is a Q&A, not a forum. If you have comments on the answers, then please post this as a comment. You could also update your question by editing it and add the information to it. – 7ochem Feb 23 '16 at 19:30
0

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.

  • I couldn't get this to work, I even copied the entire shipping folder just in case. It doesn't want to overwrite the core Magento copy. – Chris May 31 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.