Question

I would like to activate a certain extra step I have prepared in the onepage checkout stage only when products that belong to certain categories are added to the basket.

How can I set this filter using php code?

Many thanks in advance.

Was it helpful?

Solution

you can easily do it to following this guide:

http://www.excellencemagentoblog.com/magento-onestep-checkout-add-step

in this method you need to extend/override Mage_Checkout_Block_Onepage::getSteps() to add your new step in the sequence.

Create your new step's block/template (loaded using an Ajax request when the previous step is completed) Your block class will need to extend: Mage_Checkout_Block_Onepage_Abstract

You also need to extend the onepagecheckout javascript as this does much of the heavy lifting. The Prototype library has a nice way of doing this.

At the end you will need to extend the controller class (Mage_Checkout_OnepageController) to override the responses of any existing steps, return the content of your new step (loaded using ajax), and handle the save action of any data (form fields etc) entered in your new step

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top