Rynraf Posted July 17, 2019 Share Posted July 17, 2019 (edited) I would like to add extra consent in checkout on last step. I made this in PS 1.6 but I have problem in PS 1.7. I spent a lot of time searching any answer. All issues are about inputs in registration form. It's important for me to put it for each cart, no for client account. 1. How to add something in this place by module? I have not found find any appropriate hook. Maybe it's possibe by insert some new consent definition directly to database to some table? I have not found. It seems that is only on / off visibility for this agreement. How to add, maybe in different way, some extra condition to approve with possibility to save it after this step? 2. Which hook is right to save this value in PS 1.7 to cart and order? Hook ActionCartSave or / and ActionValidateOrder? Please give me any advice. Edited July 17, 2019 by Rynraf typo in title (see edit history) Link to comment Share on other sites More sharing options...
Rynraf Posted July 21, 2019 Author Share Posted July 21, 2019 1. All right. I have a solution. It's a short code to use it in own module to show in this place additional consent: public function hookTermsAndConditions($params){ $returned_terms_and_conditions = array(); $termsAndConditions = new TermsAndConditions(); $termsAndConditions ->setText($this->l('Text of additional consent...')) ->setIdentifier('myOwnName-agreement') ; $returned_terms_and_conditions[] = $termsAndConditions; return $returned_terms_and_conditions; } But this consent is always obligatory. It looks that's is impossible to set it as optional or I just don't know how to set this. 1 Link to comment Share on other sites More sharing options...
Nicolas MEUNIER Posted February 12, 2021 Share Posted February 12, 2021 Thanks for this answer, it's the solution to my problem! Does anyone have a solution to make this consent optional? Link to comment Share on other sites More sharing options...
KzDat Posted January 14, 2022 Share Posted January 14, 2022 A quick and dirty way would be to add something like this in your own payment.tpl {if array_key_exists('myOwnName-agreement',$conditions_to_approve)} {$conditions_to_approve=$conditions_to_approve|array_diff_key:(['terms-and-conditions']|array_flip)} {/if} 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