Page 2 of 2

Re: How to add additional charges in PayPal?

Posted: 10 Jun 2019, 11:34
by Harpal Singh
aimeos wrote:The field is unknown to the rest of the Aimeos code so this won't work if you don't adapt all code that should use the value from this field.

An easier solution would be to write a service provider decorator that adds the setup costs to the basket during checkout in either the delivery or payment selection step (if it's the only delivery option, the costs will be added immediately when adding a product by the Autofill basket plugin). You can add the costs not only as shipping or payment costs but also as delivery/payment related "product" line if you add the setup costs as delivery/payment price value instead of price costs.
Can you please give some idea about How to write a service provider decorator and how to use it with payment gateway?
Thanks
Harpal Singh

Re: How to add additional charges in PayPal?

Posted: 10 Jun 2019, 16:10
by aimeos

Re: How to add additional charges in PayPal?

Posted: 12 Jun 2019, 10:06
by Harpal Singh
Can I use Costs decorator outside from vendors in my extension folder of project.
I want to override the /vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Service/Provider/Decorator.Costs.php class.
or Can I override the PaypalExpress Class?
If possible then how and where I can find/create clone of these classes.

Thanks
Harpal Singh

Re: How to add additional charges in PayPal?

Posted: 12 Jun 2019, 11:45
by Harpal Singh
Harpal Singh wrote:Can I use Costs decorator outside from vendors in my extension folder of project.
I want to override the /vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Service/Provider/Decorator.Costs.php class.
or Can I override the PaypalExpress Class?
If possible then how and where I can find/create clone of these classes.

Thanks
Harpal Singh
I have created PayPalExpress Provider in my ext but it shows both the providers while in admin.
What I want is to override some functions of PayPalExpress(in my extension) class.

Thanks
Harpal Singh

Re: How to add additional charges in PayPal?

Posted: 12 Jun 2019, 17:44
by aimeos
You have to name your overwritten class differently and use that in the "provider" field of the service panel in the admin interface