Jump to content

Change checkout process to Login=>Summary=>Address=>Shipping=>Payment


prstshp_joe

Recommended Posts

By default the five steps of checkout are "Summary=>Login=>Address=>Shipping=>Payment".

 

I want it to be "Login=>Summary=>Address=>Shipping=>Payment".

 

I'm looking for a way inside \controllers\front\OrderController.php but can't find the way. Anyone went though this and can guide me?

 

Thanks!

Link to comment
Share on other sites

This is what I did so far:

 

In controllers\front\OrderController.php I changed just line 67 adding a "0":

if (!$this->context->customer->isLogged(true) && in_array($this->step, array(0, 1, 2, 3)))

This alone would be enough to force to log in any user before showing the summary screen.

 

 

In themes\<my-theme>\order-steps.tpl I changed lines 38 - 55:

    <li class="{if $current_step=='login'}step_current {elseif $current_step=='summary'}step_done_last step_done{else}{if $current_step=='payment' || $current_step=='shipping' || $current_step=='address' || $current_step=='summary'}step_done{else}step_todo{/if}{/if} first">
        {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address' || $current_step=='summary'}
        <a href="{$link->getPageLink('order', true)}">
            <em>01.</em> {l s='Sign in'}
        </a>
        {else}
            <span><em>01.</em> {l s='Sign in'}</span>
        {/if}
    </li>
    <li class="{if $current_step=='summary'}step_current{elseif $current_step=='address'}step_done step_done_last{else}{if $current_step=='payment' || $current_step=='shipping' || $current_step=='address'}step_done{else}step_todo{/if}{/if} second">
        {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address'}
        <a href="{$link->getPageLink('order', true, NULL, "{$smarty.capture.url_back}&step=1&multi-shipping={$multi_shipping}")|escape:'html':'UTF-8'}">
            <em>02.</em> {l s='Summary'}
        </a>
        {else}
            <span><em>02.</em> {l s='Summary'}</span>
        {/if}
    </li>

So far it works as expected. A minor flow is that on empty cart the "current step" defaults to "Summary" instead of "Log in" - any ideas?

 

Thanks!

Edited by prstshp_joe (see edit history)
Link to comment
Share on other sites

  • 3 years later...

Hi there. I don't know if should make new topic or post in this one. I'm trying to change the checkout steps also. I need the Delivery (step3) to be before Address(step2).

 

I have found in /controllers/front/OrderController.php the code

->addStep(new CheckoutAddressesStep(
            $this->context,
            $translator,
            $this->makeAddressForm()
        ));

and change the place it below the delivery step. So far so good. Step3 goes before Step2 as i wish. But there is some address check which is stopping me to proceed from Delivery to Address if i havent login with valid address at first place (no address entered). I can not find that address validation !=0 at Delivery step and make it always true. Can you help me out ? I can provide with a link of needed. Using Prestashop 1.7.3.

EDIT:

In Cart.php class tried this but still not working.

public function checkAndUpdateAddresses()
    {
return true;
}

 

More at this topic How to remove delivery shipping step on prestashop 1.7?


EDIT 2:

I found a way. In AddressValidator.php class set function validateCartAddresses to return false. This why i skip to address check in the chekout. 

Any smarter why to rearrange steps2-3 in the checkout ?

Edited by DanielaPetkova (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...