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

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Luis
Posts: 7
Joined: 05 Jul 2017, 03:07

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

Post by Luis » 17 Jul 2017, 20:37

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

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

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

Post by aimeos » 18 Jul 2017, 00:42

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Luis
Posts: 7
Joined: 05 Jul 2017, 03:07

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

Post by Luis » 18 Jul 2017, 16:44

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

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

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

Post by aimeos » 19 Jul 2017, 08:05

The "name" parameter must be the name of the class, not an array with its name.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Luis
Posts: 7
Joined: 05 Jul 2017, 03:07

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

Post by Luis » 19 Jul 2017, 18:21

Thanks for the quick response. that worked

aloniwe
Posts: 10
Joined: 21 Nov 2019, 12:45

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

Post by aloniwe » 12 Dec 2019, 18:06

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

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

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

Post by aimeos » 13 Dec 2019, 10:51

Did you forgot the ".php" extension in your file name?
-> myext/client/html/src/Client/Html/Catalog/Lists/Mystandard.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

aloniwe
Posts: 10
Joined: 21 Nov 2019, 12:45

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

Post by aloniwe » 13 Dec 2019, 16:42

No, my standard class has correct extension (Mystandard.php).

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

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

Post by aimeos » 14 Dec 2019, 15:17

Please post your source code so we can see if there's something wrong.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

aloniwe
Posts: 10
Joined: 21 Nov 2019, 12:45

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

Post by aloniwe » 18 Dec 2019, 16:00

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 3218 times
and exception after:
Aimeos\Client\Html\Exception
Class "\Aimeos\Client\Html\Catalog\Lists\Mystandard" not available

Post Reply