SamDouglas Posted February 10, 2017 Share Posted February 10, 2017 Hello, I am trying to add a new checkout step to my PrestaShop v1.7 where the user just has to enter a date. We are trying to implement a platform where users can rent party equipment so we need the event date. Has somebody an idea what files I have to change? I found the Checkout[..]Step.php files in /classes/checkout but I'm sure there are more files which have to be changed. Greetings Sam Douglas Link to comment Share on other sites More sharing options...
tmzwinkels Posted February 13, 2017 Share Posted February 13, 2017 did you check controllers/front/OrderController.php I have not tested it, but maybe this will help : $this->checkoutProcess ->addStep(new CheckoutPaymentStep( $this->context, $translator, new PaymentOptionsFinder(), new ConditionsToApproveFinder( $this->context, $translator ) )) ; Link to comment Share on other sites More sharing options...
TonyInuma Posted May 14, 2019 Share Posted May 14, 2019 (edited) Hi, I want to relive this. I am developing a new step. I used the code above, but that's just the beginning. I was guided by the management processes and personal information. - CheckoutAddressStep - CheckoutPersonalInformationStep. ☻ My step is: CheckoutComprobanteStep: controllers/front/OrderController.php $this->checkoutProcess ->addStep(new CheckoutComprobanteStep( $this->context, $translator, $this->makeComprobanteForm() )); classes/checkout/CheckoutComprobanteStep.php class CheckoutComprobanteStep extends AbstractCheckoutStep { protected $template = 'checkout/_partials/steps/comprobante.tpl'; private $comproForm; public function __construct( Context $context, TranslatorInterface $translator, ComprobanteForm $comproForm ) { parent::__construct($context, $translator); $this->comproForm = $comproForm; } public function handleRequest(array $requestParameters = array()) { $this->step_is_reachable = true; if (isset($requestParameters['submitComprobante'])) { $this->comproForm->fillWith($requestParameters); if ($this->comproForm->submit()) { $this->step_is_complete = true; } else { $this->step_is_complete = false; $this->setCurrent(true); $this->getCheckoutProcess()->setHasErrors(true)->setNextStepReachable(); } } $this->setTitle( $this->getTranslator()->trans( 'Tipo Comprobante', array(), 'Shop.Theme.Checkout' ) ); } You have to create many more classes. As far as it goes, I insert my form of my voucher process into a table in the database. I still need to link the Voucher with the orders, with the cart or with the client, I still do not know. Answer to share code if someone already did it. mi correo es: [email protected] Edited May 14, 2019 by TonyInuma (see edit history) Link to comment Share on other sites More sharing options...
ikamij Posted November 7, 2020 Share Posted November 7, 2020 how to do a new step in Checkout. and put a module there? does anyone know? 1 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