Add Newsletter Checkbox to Checkout
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Add Newsletter Checkbox to Checkout
Hello,
another questions. I'd like to add a checkbox for a newsletter sign up to the checkout and pass the info along to checkout confirm.
Just like the terms checkbox, however, the decorator I have created is asigned to the checkout confirm, but print $view->param( 'cs_option_terms_value'); returns nothing. How do i access the param or do i need to fire my signup in checkout standard and just make sure everything is filled properly myself?
another questions. I'd like to add a checkbox for a newsletter sign up to the checkout and pass the info along to checkout confirm.
Just like the terms checkbox, however, the decorator I have created is asigned to the checkout confirm, but print $view->param( 'cs_option_terms_value'); returns nothing. How do i access the param or do i need to fire my signup in checkout standard and just make sure everything is filled properly myself?
Re: Add Newsletter Checkbox to Checkout
Recommendation would be to use the API of your mailing provider to signup using an AJAX or POST request when the customer checks the newsletter box.
To pass that value to the confirmation page is only slightly more difficult because you have to store the value in the user session in your decorator. In the view on the confirmation page, you can get the value with
To pass that value to the confirmation page is only slightly more difficult because you have to store the value in the user session in your decorator. In the view on the confirmation page, you can get the value with
Code: Select all
$this->session( 'my-newsletter-key' );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Add Newsletter Checkbox to Checkout
Thanks, I've just put the value into the process-body-standard.php and kinda passed it along. Easy and worked well.
Thanks though.
Thanks though.
Re: Add Newsletter Checkbox to Checkout
Hey, I am in the process of upgrading to the latest Aimeos and T3 Version.
Before I could recieve the value with $view->param('ai')['cs_option_newsletter_value'] in my decorator, however, thats empty now.
Any advice?
Before I could recieve the value with $view->param('ai')['cs_option_newsletter_value'] in my decorator, however, thats empty now.
Any advice?
Re: Add Newsletter Checkbox to Checkout
Seems like a change in newer TYPO3 versions because
was never supposed to work. Instead, use:
Code: Select all
$view->param('ai')['cs_option_newsletter_value']
Code: Select all
$view->param('cs_option_newsletter_value')
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Add Newsletter Checkbox to Checkout
Thanks, that was the first thing I tried though. Its empty. I have that line of code in process-body-standard to pass along, that used to work back in the 19.4 and Typo3 9.5. I checked in the Step and the value is accordingly set and passed to that step. After I pay using Mollie and return to the confirm page, it is empty.
Code: Select all
<input type="hidden" name="<?php echo $enc->attr( $this->formparam( ['cs_option_newsletter_value'], $prefix ) ); ?>" value="<?= $this->param( 'cs_option_newsletter_value', null ) ?>" />