Magento Forum

   
Page 1 of 3
“Onepage” checkout - adding a step
 
rcourtna
Jr. Member
 
Total Posts:  8
Joined:  2008-04-17
 

Hello,

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pablo Lopez
Member
 
Avatar
Total Posts:  51
Joined:  2008-01-17
 

Hi there.
I’m doing something similar to what you want to do…
Here’s what I’ve done so far.

First, let me tell you where you should be looking

magento/app/code/core/Mage/Checkout/Block/Onepage/ *

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

magento/app/code/core/Mage/Checkout/Block/Onepage.php

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!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
R.Verheij
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-04-08
Amsterdam, Netherlands
 

Hi,

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?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

I’m also interrested in this.
Can you share a little your work please ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MunchyMonster
Member
 
Avatar
Total Posts:  71
Joined:  2008-02-05
New Hampshire, USA
 

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?

MunchyMonster

 
Magento Community Magento Community
Magento Community
Magento Community
 
stereotomy
Jr. Member
 
Total Posts:  28
Joined:  2008-02-10
 

i am also trying to figure out how the “save” process works.

would be nice if everything was in a single form and place order button just posted that form.

 
Magento Community Magento Community
Magento Community
Magento Community
 
R.Verheij
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-04-08
Amsterdam, Netherlands
 

So more people are interested in adding features to the checkout step! Good!  LOL

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 added a step in Onepage.php:

$stepCodes = array('billing''shipping''shipping_method''[b]gift[/b]''payment''review');

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?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbh1
Jr. Member
 
Total Posts:  7
Joined:  2008-06-04
 

Bumping this because it seems that if the staff can figure this out/provide instructions, they’d have a ton of happy new users.

That said, my partner and I are trying to figure out the exact same thing and will keep you updated if/when we find a solution. Working on it now…

 
Magento Community Magento Community
Magento Community
Magento Community
 
masatoshi
Jr. Member
 
Total Posts:  3
Joined:  2008-04-30
 

Hi, i’m trying to add adding “Message” step.

following files are required to be customized.

/app/code/core/Mage/Checkout/Block/Onepage.php
-you should add element to $stepCodes

/app/code/core/Mage/Checkout/Block/Onepage/Progress.php
/app/code/core/Mage/Checkout/controllers/OnepageController.php
/app/code/core/Mage/Checkout/Model/Type/Onepage.php

/app/design/frontend/default/default/layout/checkout.xml
-you should add block.

/app/design/frontend/default/default/template/checkout/onepage.phtml
/app/design/frontend/default/default/template/checkout/onepage/progress.phtml

/skin/frontend/default/modern/js/opcheckout.js
-you should add element to this.steps

And adding template.
/app/design/frontend/default/default/template/checkout/onepage/message.phtml

It appear front end well.
But it requires many customization.

And then, i’m trying to figure out sql now.
When it work fine, i’ll comment here.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bbepristis
Jr. Member
 
Total Posts:  25
Joined:  2008-04-28
Muskegon, Michigan
 

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..

 
Magento Community Magento Community
Magento Community
Magento Community
 
roshangmail
Jr. Member
 
Avatar
Total Posts:  29
Joined:  2008-05-17
 

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
lorenzo01
Sr. Member
 
Avatar
Total Posts:  221
Joined:  2007-09-06
France
 
rcourtna - 22 April 2008 11:53 AM

Hello,

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
Georges@Bitbol
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2008-08-07
Paris, France
 

I added a new block before billing for informations depending on what quote contains.

All is working after hours looking at models, js and controllers.

One thing is strange.
After first “continute”, all blocks on right comuln disapear.

Does anyone know ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tony-fav
Jr. Member
 
Total Posts:  11
Joined:  2008-06-10
France
 

just a little idea smile , 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 wink
So if you could take a few minutes to explain what you did ...

thanks

( entre parigos en plus rasberry )

 
Magento Community Magento Community
Magento Community
Magento Community
 
nafnaf1000
Sr. Member
 
Total Posts:  209
Joined:  2008-02-21
 

Is there any way to romove a step.???

My shop dos NOT allow any bill to ship to address.

We will ONLY accept the one address.

Is there any way to remove the shipping address?
and.

we ship USPS and UPS. if they are shipping to a PO box. can we only show the usps shipping?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 3