Decorator for Checkout Confirm

Questions around the TYPO3 integration and plugins
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!
cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Decorator for Checkout Confirm

Post by cnoelker » 09 Feb 2022, 09:44

Hi,

I would like to add a Decorator on the confirmation page of the checkout. I wrote a rather simple Decorator class named ConfirmDecorator which just has an addData method and sets a variable for the view, e.g.
$view->mytest = array('test' => 'test');

Then, I configured it according to https://aimeos.org/docs/latest/config/c ... t-confirm/

plugin.tx_aimeos.settings.client.html.checkout.confirm.standard.decorators.global {
0 = ConfirmDecorator
}

However, when I access $this->mytest on the confirm page, it's empty.

What's missing to make this work?

Claudia

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Decorator for Checkout Confirm

Post by boettner » 09 Feb 2022, 09:57

Hi,

it´s

plugin.tx_aimeos.settings.client.html.checkout.confirm.decorators.global {
0 = ConfirmDecorator
}

Best
Robert

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Decorator for Checkout Confirm

Post by cnoelker » 09 Feb 2022, 10:16

Hi Robert,

thanks for your response, but it doesn't work with your suggestion for the configuration, either.
I cleared the cache of TYPO3, so this shouldn't be the cause.

Claudia

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Decorator for Checkout Confirm

Post by boettner » 09 Feb 2022, 10:43

Hm,

did you do a composer dumpautoload before clearing caches? Or the similar from the Install Tool if you are on TER.
You could provoke a syntax error like removing a semicolon from a line to check if the class actually gets loaded.

If that dosen´t help a look into your class and directory structure could help to find the cause of the error.

Robert.

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Decorator for Checkout Confirm

Post by cnoelker » 09 Feb 2022, 11:14

Hi Robert,
the Decorator classes are not in the autoload files. I created other Decorators before and they aren't either.
The other Decorator classes work fine. I put the new one into the same directory.

There is already an intended typo in the class. This doesn't break anything, though, so the class is not used.

Claudia

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Decorator for Checkout Confirm

Post by boettner » 09 Feb 2022, 11:47

Try accesing the variable with $this->get('mytest');

And check if you are in a partial and have to pass the variable from the parent template.

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Decorator for Checkout Confirm

Post by cnoelker » 09 Feb 2022, 14:08

The Decorator class is not loaded at all, otherwise I would get a syntax error response, because I added the syntax error in there.
The variable which I set is actually the same one as I set in the checkout Decorator.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Decorator for Checkout Confirm

Post by aimeos » 10 Feb 2022, 07:54

@Claudia: Which Aimeos version do you use and where did you store the class file?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Decorator for Checkout Confirm

Post by cnoelker » 10 Feb 2022, 16:21

Hi,

I had a fresh look today and finally found the solution:

plugin.tx_aimeos.settings.client.html.checkout.standard.decorators.global {
0 = ConfirmDecorator
}

Claudia

Post Reply