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]