Kichu
Kichu

Reputation: 3267

Hide Payment method Information when product price is zero in Magento

in my magento there products with zero price.

When checkout that products i want to hide the Payment method Information.

that is this is the screen shot of check out steps:

enter image description here

the 4th step need to be hide when the product price is 0.

How can i do this?

In normal case that means if the product have price value greater than zero ,then it displays all 1 to 5 steps.

But i need here is that if the product price is zero doesnot display the 4th step.

Upvotes: 4

Views: 7464

Answers (3)

Shathish
Shathish

Reputation: 296

In admin panel,

System -> Configuration -> SALES -> Payment Methods

enable the Zero Subtotal Checkout method.

It'll take care of it automatically.

But if you wanna skip that step completely

additionally check for the subtotal in onepage controller and if it is zero just change the next step flag.

Upvotes: 3

Sonhja
Sonhja

Reputation: 8458

Try what they say in this link.

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

I haven't tried to do exactly what you need, but I guess maybe what you need is to modify opcheckout.js and check there if your price is 0. If it's 0, then you auto assign a payment method that you will ignore and jump to the next step.

I think I would try something like that...

Upvotes: 0

Josua M C
Josua M C

Reputation: 3158

i've done it once but already forgot,

step 1: First get configured Flat Rate and Payment MEthod Paypal from Admin Panel.

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

change $stepCodes with

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

step3: app/code/core/mage/checkout/controller/Onepagecontrollers.php

change the saveShippingMethod function

step 4: opcheckout.js

this is useful links from this and this

Upvotes: 1

Related Questions