My understanding of how to extend Magento with modules is slowly progressing. I’m now at the point where I’d like to add another step to the “onepage” checkout.
By default, my demo setup has:
1. Checkout Method
2. Payment Information
3. Shipping Information
4. Shipping Method
5. Payment Information
6. Order Review
I’d like to stick a new step in between steps 5 & 6, say “Choose your Free Gift”.
Can this be done without ugly hacking? Any pointers on how to start would be much appreciated.
there is the logic involved on the checkout steps. You’ll see a .php file for every step of the onepage menu . You’ll need to make a class for your step, probably extending Mage_Core_Model_Session_Abstract
that’s the onepage class, used in order to display the steps of the onepage menu items. You should modify the getSteps() function, adding the step you want to make (you see that there’s a listing of the steps there)
Also, you’ll need to check out the templates for all this, and you need to make your own step template…
the templates for this are located on design/frontend/your_template/default/template/checkout/onepage
And...the most tricky part (at least for me ) is all the .js work involved ( magento9/skin/frontend/your_template/default/js/opcheckout.js )
I suggest that you start by doing a copy of a step (say ....billing for example) so you can be sure you added the step correctly (as javascript errors are really hard to track down)
I believe this can get you started.... hope it helps
cheers
PD : I haven’t figure out yet how to actually SAVE something on the order (say, the option of free gift in this case) so if anyone knows how...please let me know!!
hi, this maybe something useful and easier to add a ‘choose your free gift’ message.
In the admin/system/sales/sales, if yo turn on the Gift Messages for ‘Allow Gift Messages on Order Level’, then in the Step 3 (or 4), the customer can decide whether she wants to add gift message. I think you can combine your ‘choose your free gift’ message in the ‘gift messages’ area.
As to which file to edit, look for ‘template/giftmessage
Extending the onpage payment with an extra ‘choose your free gift’ step is exactly what I need!
I was going to start coding on it, but did any of you guys make any progress?
If so could you please share with me what you have so far, so that we can tackle down the last problems together and make it a nice package for the community?
I’m not looking for a choose your free gift, but the same code that will let you choose a free gift and save it with the order, would allow me to add my choose a delivery date option to checkout. I’m pretty sure I can figure out all the stuff to get the page inserted. Has anyone figured out how to get the data pushed back into the order?
So more people are interested in adding features to the checkout step! Good!
All I get with this so far is that an extra step shows up (step 4 for me), with no label (just a number) and it is skipped in the progress. And when it finaly ‘opens’ when I press back in step 5, there is nothing in it, so no template is loaded…
So not much result yet, but just to get the conversation going I will share what I have done so far anyway.
I created Gift.php in Mage/Checkout/Block/Onepage, by copying and simplifying Billing.php,
class Mage_Checkout_Block_Onepage_Gift extends Mage_Checkout_Block_Onepage_Abstract { protected function _construct() { //Mage::helper('checkout')->__('Pick a free gift') $this->getCheckout()->setStepData('gift', array('label'=>"please pick a free gift")); parent::_construct(); }
public function getMethod() { return $this->getQuote()->getCheckoutMethod(); } }
and I created gift.phtml in template/checkout/onepage, again by copying and simplifying billing.phtml.
Then I added a gift class in opcheckout.js with the same functions as the javascript billing class, but without any code inside them.
But, as said above, no content of the template to be seen anywhere…
Did anyone get any further? Or could someone of the staf please give us some hints on the steps that need to be done to do this?
I also am interested in this if anyone wants to partner up to try and get it resolved I am more than willing. I am on a tight dead line and need this functionality as soon as possible. if you are interested pm me and we can exchange contact info and see where each other stands.. and go from there..
i just want to place a check box with javascript validation with terms and conditions but i cant make in page onepage/available.phtml so how can i do that do any magento expert have any idea please give hand to solve this problem
My understanding of how to extend Magento with modules is slowly progressing. I’m now at the point where I’d like to add another step to the “onepage” checkout.
By default, my demo setup has:
1. Checkout Method
2. Payment Information
3. Shipping Information
4. Shipping Method
5. Payment Information
6. Order Review
I’d like to stick a new step in between steps 5 & 6, say “Choose your Free Gift”.
Can this be done without ugly hacking? Any pointers on how to start would be much appreciated.
Thanks
Ryan
....in the same way, adding a step to onepage checkout seems to was very useful, personally I try to add a step allowing customer to choose options like special packing for gift for example...any ideas
thanks
just a little idea , see
$this.reloadProgressBlock();
in javascript file, this refreshes the checkout progress column,
could you post what you’ve made to opcheckout.js, because you say that you have succeeded but don’t bring anything to help us.
A forum is an exchange, not in one way
So if you could take a few minutes to explain what you did ...