Hide Payment method Information when the price of goods is zero in Magento

there are zero price products in my magento.

When checking these products, I want to hide the Payment method Information .

i.e. this is a screenshot of the validation steps:

enter image description here

The 4th step must be hidden when the price of the product is 0.

How can i do this?

In the normal case, this means that if the product has a price value greater than zero, then it displays everything from 1 to 5 steps.

But I need to, if the price of the product is zero, the 4th step is not displayed.

+4
source share
3 answers

In admin panel

System → Configuration → SALES → Payment methods

enable the zero total payment method.

He will take care of this automatically.

But if you want to skip this step completely

additionally check the subtotal in one controller and if it is zero, just change the flag of the next step.

+3
source

I did it once, but already forgot

step 1: First, configure Flat Rate and Payment MEthod Paypal from the admin panel.

step 2: app / code / core / mage / checkout / block / onepage.php

change $ stepCodes with

 $stepCodes = array('billing', 'shipping', 'shipping_method', 'review'); 

step3: application / code / kernel /mag/check/controller/Onepagecontrollers.php

change saveShippingMethod function

step 4: opcheckout.js

these are useful links from this and this

+1
source

Try what they say in this link.

What they do is automatically switch steps. But, if you want to jump over a step, it must have a default value.

I did not try to do exactly what you need, but I think maybe you need to change opcheckout.js and check there if your price is 0. If it is 0, then you will automatically assign a payment method that you will ignore and go to the next step.

I think I would try something like that ...

0
source

All Articles