Jump to content

New checkbox in Checkout


Recommended Posts

8 hours ago, Daresh said:

Do you want it to be stored somewhere? I mean the information about the customer checked it or not? Or do you only want another checkbox that is required to proceed the order?

I just want to put another checkbox to continue the process and, of course, that at the time of submitting the form, check in a php if the box was selected to execute a function.

Link to comment
Share on other sites

2 minutes ago, Daresh said:

¿Y qué quieres hacer en esa función, ejecutada en PHP al momento de enviar el formulario?

Yes, that a function is executed in the php at the time of submitting the form, for that reason I look for in which php could validate if the checkbox was selected, it is to add the box in the payment section.

Yes, that a function is executed in the php at the time of submitting the form, for that reason I look for in which php could validate if the checkbox was selected, it is to add the box in the payment section, something similar as is in the image

Captura-de-pantalla-2020-08-16-a-las-15-42-59.png

Link to comment
Share on other sites

But to make sure the checkbox is checked you don't need any additional PHP function to validate it, you just need to place a required checkbox in the form.

Prestashop 1.7 has a new hook called TermsAndConditions, to which you can add your own checkboxes with some simple module, and those checkboxes will be required to proceed.

I'm attaching you such a module to this post, but it has no configuration, you need to edit it's PHP code to add your own text for the terms.

gmterms.zip

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, Daresh said:

Pero para asegurarse de que la casilla de verificación esté marcada, no necesita ninguna función PHP adicional para validarla, solo necesita colocar una casilla de verificación requerida en el formulario.

Prestashop 1.7 tiene un nuevo enlace llamado TermsAndConditions, al que puede agregar sus propias casillas de verificación con un módulo simple, y esas casillas de verificación serán necesarias para continuar.

Le adjunto un módulo de este tipo a esta publicación, pero no tiene configuración, debe editar su código PHP para agregar su propio texto para los términos.

gmterms.zip 6.29 kB · 0 descargas

The reason I want to validate in PHP, is because from there I am looking to execute some functions

Link to comment
Share on other sites

  • 1 year later...
On 8/16/2020 at 6:32 PM, Daresh said:

I'm attaching you such a module to this post, but it has no configuration, you need to edit it's PHP code to add your own text for the terms.

Your simple module works perfectly fine.
I wanted to add a custom text block to carrier /templates/checkout/_partials/steps/shipping.tpl but I thought that using hookDisplayAfterCarrier or hookDisplayBeforeCarrier would be simpler, as I could grab a custom html widget to have multilanguage managed text and insert above/below carrier info in checkout process.


But after adding proper installation and trying to show custom text within function

public function hookDisplayAfterCarrier() {
   return "customtext";
}

I don't get any text in carrier information window
I'm not sure if I use proper hook, nor if I'm even able to simply insert a text using such hook? Or should I prepare a view template file in this module?
Could you give me a hand with this?

 

 

edit: dropped trying to hook text within this module, and stay with using only html widget
 

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

  • 4 weeks later...
  • 10 months later...
16 minutes ago, SliderFlash said:

I recommend removing toc, nobody does that unless they shippng hazaradous materials, make  sure to review best in class ecommerce systems,  none of toc.

 

newsletters the same....

 

at checkout only have what is needed to checkout, don't put 'additional'  clicks....this will improve your click  through rate..

 

your welcome

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...