0

I am using this shipping "Table rates" and "webshopapp matrix rates" shipping methods.

what i need is that , if we use table rates shipping method, i want to hide "cash on delivery" payment method.

i am following this link : Magento - OnePage Checkout - Hide Payment method depending on Shipping Method

please help me to find what is the code for

1)table rates shipping method

2)cash on delivery" payment method.

Community
  • 1
  • 1

1 Answers1

0

You can do this by using a simple if statement in your available.phtml file. in

app/design/frontend/your_theme/template/checkout/onepage/shipping_method/available.phtml

In this file you can see some codes like

 <?php foreach ($_rates as $_rate): ?>
    <?php $codes=$_rate->getCode();?>
<?php endforeach;?>

Below these lines there is code to display the shipping method and the radio button to check the shipping method.You just need to check the condition here.

<?php if($codes=='shipping_method_code' ): ?>

If the codes matches to your table rate code then you can do what you want.You can check like this as your need.

Hope this will help.

Navin Bista
  • 1,988
  • 2
  • 21
  • 37
  • hi, this is available.phtml = > http://pastebin.com/tRhfGqUr can you tell me in ehich line i have to place this code : –  Mar 27 '15 at 09:14
  • Hey, after line 34 you can perform the if condition check. Inspect the shipping method in your checkout page to get more insight and you can visualize the code flow. – Navin Bista Mar 27 '15 at 09:21
  • If this helps than don't forget to accept and vote up this will help others too to get the answer to similar problem. – Navin Bista Mar 27 '15 at 09:22
  • is i have to use this code ? = > –  Mar 27 '15 at 09:27
  • i pasted above line after line number 35 , but after " Shipping information" , it redirecting to "my cart" page. –  Mar 27 '15 at 09:28
  • hi, i got solution here : http://magento.stackexchange.com/questions/62124/what-is-the-code-for-table-rates-shipping-method-cash-on-delivery-payment-met/62125?noredirect=1#comment83284_62125 –  Mar 27 '15 at 10:25