Magento Zahlungs- und Versandarten

At the latest, if you offer both the shipping method "Pickup" and the payment method "Cash on Delivery" within a Magento online shop, you should take a closer look at the dependency between shipping and payment methods.

After all, payment by cash on delivery should of course not be displayed if, in the previous step, the customer decided to pick up the goods in person. This can be achieved by modifying the file

\app\design\frontend\PACKAGENAME\THEMENAME\template\checkout\onepage\payment\methods.phtml

where we link the display of the payment methods in our Magento installation to the following condition
(around line 43, before "<dt>"):

if ($_code != 'payone_cash_on_delivery' ||
$this->getQuote()->getShippingAddress()->getShippingMethod()!='freeshipping_freeshipping'):

The code for the payment method naturally needs to be replaced accordingly. The "Cash on Delivery" payment method will then only be displayed if we have not previously selected pickup ("freeshipping_freeshipping"). Online shop version: Magento 1.7.0.2.

... back to the blog