Page 1 of 2

overriding Client\Html\Checkout\Standard\Standard.php

Posted: 17 Jul 2017, 20:37
by Luis
I modified the getBody method inside to add new functionality. How and where should I put the new file which originally was in ai-client-html\Client\Html\Checkout\Standard\Standard.php. I have a custom ext/my-client-ext/ and a manifest.php file that includes 'client/html/src'.

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 18 Jul 2017, 00:42
by aimeos
Rename the file to e.g. Myproject.php and put it into the same directory structure in your own extension (./ext/myext/client/html/src/Client/Html/Checkout/Standard/Myproject.php). Then, configure the new class name (Myproject): https://aimeos.org/docs/Configuration/C ... ndard/name

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 18 Jul 2017, 16:44
by Luis
Hey, thanks for the quick response. I'm getting an error when i tried doing this.
(1/1) Exception
Invalid characters in class name "<not a string>"
in Factory.php (line 76)
at Factory::createClient(object(Standard), array('/Users/laravel/ext/ai-client-html' => array('client/html/templates'), '/Users/public/laravel/ext/myproject' => array('client/html/templates')), array('Mycheckout'))


conf/shop.php

'checkout' => array(
'confirm' => array(
'name'=> array('Mylaststep')
),
'standard' => array(
'name'=> array('Mycheckout'),

-----------------------

namespace Aimeos\Client\Html\Checkout\Standard;
class Mycheckout

--------------------

namespace Aimeos\Client\Html\Checkout\Confirm;
class Mylaststep

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 19 Jul 2017, 08:05
by aimeos
The "name" parameter must be the name of the class, not an array with its name.

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 19 Jul 2017, 18:21
by Luis
Thanks for the quick response. that worked

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 12 Dec 2019, 18:06
by aloniwe
Is it working right now? I'm trying to override Catalog\Lists\Standard class from ai-client-html.
I added new 'Mystandard' class into my extension (myext\client\html\src\Client\Html\Catalog\Lists\Mystandard) with same code from ai-client-html.
Also i added config:

Code: Select all

	'client' => [
		'html' => [
            'catalog' => [
                'lists' => [
                    'name' => 'Mystandard',
                ]
            ],
		],
	]
But it's not working.
I get an exception: Class "\Aimeos\Client\Html\Catalog\Lists\Mystandard" not available

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 13 Dec 2019, 10:51
by aimeos
Did you forgot the ".php" extension in your file name?
-> myext/client/html/src/Client/Html/Catalog/Lists/Mystandard.php

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 13 Dec 2019, 16:42
by aloniwe
No, my standard class has correct extension (Mystandard.php).

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 14 Dec 2019, 15:17
by aimeos
Please post your source code so we can see if there's something wrong.

Re: overriding Client\Html\Checkout\Standard\Standard.php

Posted: 18 Dec 2019, 16:00
by aloniwe
Here my config:

Code: Select all

	'client' => [
		'html' => [
            'catalog' => [
                'lists' => [
                    'name' => 'Mystandard',
                ]
            ],
		],
	]
Here i'm trying to paste my new Standard class:
Screenshot_1.png
Screenshot_1.png (8.1 KiB) Viewed 3142 times
and exception after:
Aimeos\Client\Html\Exception
Class "\Aimeos\Client\Html\Catalog\Lists\Mystandard" not available