Jump to content

PS 1.7 module - additional consent in checkout


Recommended Posts

I would like to add extra consent in checkout on last step.

PS17-consent-module.png.2903d09fabd98019e8e6b1da8560b666.png

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 by Rynraf
typo in title (see edit history)
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 11 months later...

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

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