Post by pesha.cz » Sat Jun 16, 2012 3:07 am

Hey,

problem: if I'm on checkout, let's say step 4, and I decide to change language or currency, OC redirects me back to step 1.

Questions:
1) Any known way how to fix this, any extension or something? I've searched it hard, can't find anything though :(

2) If answer to 1) is negative, what would be the best way to write my own extension? I imagine I'd do it like this:

On checkout page, I'd add some extra param to the form that is being send by the flag icon, those param would carry info about step, on which the customer actually is, and also would signalize that the language was changed.

Then, after reloading the page in a new language, I'd check for this param, and if it'd be there, then I'd just write some javascript function to display the correct step, while also checking that all filled informations are still there correctly (like, I guess it might go wrong not saving the data in the first steps - it seems working fine, but I'm not sure how exactly and seems like browser-thing to me, so I don't really trust it).

Can you please all of you OC gurus here correct me if I'm wrong, or approve that it'd be the right way how to do it? Possibly give some more useful informations about this that might save me some troubles. In case I'd be really doing this (=the clients would insist on it), I'm definitely gonna share the extension here for return back to OC community.

Thanks.

PS: In case someone would just want to reply me that it's kinda stupid thing to solve, because no actual customer is gonna change language or currency at the point of step 4 on checkout, save the effort. I realize that, unfortunately, my clients are not so understandable about that.

Newbie

Posts

Joined
Fri Jan 27, 2012 5:20 am

Post by Avvici » Sun Jun 17, 2012 6:25 am

There isn't because the checkout is actually just ONE BIG CHECKOUT. This is the nature of using Ajax.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by pesha.cz » Sun Jun 17, 2012 6:03 pm

avvici wrote:There isn't because the checkout is actually just ONE BIG CHECKOUT. This is the nature of using Ajax.
Yeah I know how asynchronous http requesting works, I know how to checkout is programmed, that is not what I had in mind though.

You can still simulate "normal" hyper-link behaviour through something like I wrote above...basically you just have to recreate the requests that triggers on clicking the "next" buttons in each step of checkout. To do so, all you need to know is, on which step the user actually is, all filled information stays (should stay) filled in the forms.

Even better way would be to do some trick like do it through hashes in url, there are some jQuery plugins (for example jQuery History) to do that, so even back/forward buttons in browser would work then.

Newbie

Posts

Joined
Fri Jan 27, 2012 5:20 am

Post by Avvici » Sun Jun 17, 2012 9:44 pm

I didn't say it "couldn't be done lol. Absolutely.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by qahar » Mon Jun 18, 2012 12:31 am

I think what you do is right and to make it more bulletproof, I suggest you to check the data that should be available from the previous step; if not available, force to complete all required step.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia
Who is online

Users browsing this forum: No registered users and 19 guests