shacker Posted April 11, 2020 Share Posted April 11, 2020 Many times our store has certain characteristics that do not require all the steps of the checkout. An example could be that we only have to have a store as a shipping method, and in that case we could eliminate that step of the checkout to save the user time when buying. Another example could be that we only have "store payment" as the payment method. In that case, we can skip this step too. To do this we must modify the file controllers / front / OrderController.php The addStep lines are the ones that add checkout steps, commenting on them as shown in the image we can make those steps not required For example, CheckoutPersonalInformationStep is to display the user info, CheckoutAddressesStep for the address, checkoutDeliveryStep for shipping, and CheckoutPaymentStep for the payment method. Just commenting on the step we want to remove is enough to make it disappear: / * -> addStep (new CheckoutPersonalInformationStep ( $ this-> context, $ translator, $ this-> makeLoginForm (), $ this-> makeCustomerForm () )) * / Ideally, create an Override of the OrderController to avoid losing your changes. You can see more info here: http://doc.prestashop.com/display/PS16/Overriding+default+behaviors#Overridingdefaultbehaviors-Overridingacontroller Source: https://catalogo-onlinersi.net/en/content/45-skip-steps-in-prestashop-checkout Link to comment Share on other sites More sharing options...
syrine23 Posted September 26, 2023 Share Posted September 26, 2023 When add in comment ->addStep(new CheckoutAddressesStep( $this->context, $translator, $this->makeAddressForm() )); display error 500 in page checkout 1 Link to comment Share on other sites More sharing options...
syrine23 Posted November 7, 2023 Share Posted November 7, 2023 Is it possible to migrate PrestaShop site to another site without loss of orders and product pages and products Link to comment Share on other sites More sharing options...
metacreo Posted June 21 Share Posted June 21 (edited) @shacker Hello dear, Can you a little explain me what conditions for CheckoutPersonalInformationStep.? I have payment module on PS 8.1.6 with trouble. Every time after transaction, module erase customer passwd. // walk through each step, and submit same data from previous cart private function skipCheckoutFormSteps() { $customer = new Customer($this->context->cookie->id_customer); foreach ($this->checkoutProcess->getSteps() as $step) { if ($step instanceof CheckoutPersonalInformationStepCore && !$step->isComplete()) { $request = array( 'id_gender' => $customer->id_gender, 'firstname' => $customer->firstname, 'lastname' => $customer->lastname, 'email' => $customer->email, 'password' => '', 'birthday' => ($customer->birthday !== '0000-00-00') ? $customer->birthday : '', 'customer_privacy' => 1, 'psgdpr' => 1, 'submitCreate' => 1, 'continue' => 1 ); //$step->handleRequest($request); //$this->saveDataToPersist($this->checkoutProcess); //$this->checkoutProcess // ->setNextStepReachable() // ->markCurrentStep(); } As you can see I commented part of output and no problem with passwords. But steps not skipped. This module problem from hardcoded 'submitCreate' => 1, conditions. Every time module works with customer as new customer. public function handleRequest(array $requestParameters = []) function have 'submitCreate', 'submitLogin' and array_key_exists('login', $requestParameters) conditions Please tel me how is different need work with guest, customer-loggedIn, customer-loggedOut ... ? [SOLVED] $request = array( 'id_gender' => $customer->id_gender, 'firstname' => $customer->firstname, 'lastname' => $customer->lastname, 'email' => $customer->email, 'birthday' => ($customer->birthday !== '0000-00-00') ? $customer->birthday : '', 'customer_privacy' => 1, 'psgdpr' => 1, 'continue' => 1 ); if ($customer->is_guest) { $request['submitCreate'] = 1; } else { $request['submitLogin'] = 1; } Edited June 21 by metacreo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now