Comments (9)
You can add arbitrary information as order service attributes which you can display in the summary and e-mail later on: https://aimeos.org/api/latest/class-Aimeos.MShop.Order.Item.Base.Service.Iface.html#_setAttributeItem
from aimeos-core.
Thank you, tried that and it works well. However, the additional attribute is missing in the confirmation e-mail. The decorator does not even seem to get called at all here. What am I missing?
from aimeos-core.
The decorator is only called on the checkout delivery page and you have to add the information you want to store as order service attribute. At the summary page and in the e-mail you can only display the information that have been stored as order service attributes.
from aimeos-core.
I use this code in the getConfigFE()
function of my decorator:
$service->setAttributeItem( new \Aimeos\MShop\Order\Item\Base\Service\Attribute\Standard( array(
'order.base.service.attribute.code' => 'delivery-supplier.address',
'order.base.service.attribute.value' => $addressShort,
) ) );
It definitely gets executed, the information is displayed at the summary page automatically, but it's missing in the e-mail...
from aimeos-core.
Is it stored in the mshop_order_base_service_attr
table for the order?
If it is available it should be displayed:
- https://github.com/aimeos/ai-client-html/blob/master/client/html/templates/common/summary/service-standard.php
- https://github.com/aimeos/ai-client-html/blob/master/client/html/templates/email/common/text-summary-service-partial-standard.php
from aimeos-core.
No it isn't. So it looks like I did not fully understand the Controller system, and the $service
object I use is just a copy, not a reference. I'm still an Aimeos newbie, sorry.
Where should I use the setAttributeItem()
call? At which position in my decorator should I use which Service
item?
EDIT: I found this handy function: $this->saveOrderBase( $basket );
- now the value is stored in the DB. Nevertheless, when I change pages during the checkout process a few times (Delivery -> Payment -> Summary -> Payment -> Delivery -> etc), the attribute is stored multiple times - each time with a new ordservid
. Is this desired behaviour or can I optimize my code?
from aimeos-core.
saveOrderBase()
is not meant to be used during the checkout process.
You can use the setConfigFE()
in your decorator to add more data to the order:
https://aimeos.org/api/latest/class-Aimeos.MShop.Service.Provider.Iface.html#_setConfigFE
from aimeos-core.
Thanks, that was the missing bit. I created a PR with added functionality. There should be no breaking changes because the new functionality is controlled by the BE config parameters which default to the old behaviour.
Furthermore, the user manual should be updated here: https://aimeos.org/docs/User_Manual/Administration_Interface/Service_decorators
from aimeos-core.
Merged into the Aimeos Core
from aimeos-core.
Related Issues (20)
- Price quantity decimal HOT 1
- Wrong Price when set Pricing rules with category decorator HOT 2
- Error after setup HOT 1
- Postgresql index Error after setup HOT 1
- Forget Admin Password HOT 1
- Retrieving custom config values for sub-sites HOT 12
- authorize.net Integration aimeos HOT 1
- Stripe Integration HOT 1
- Problem with submanager name HOT 1
- IBAN gets masked with DirectDebit HOT 6
- jsonapi/customer returns 404 with filled "mshop/customer/manager/name" setting. HOT 5
- Manager name question HOT 1
- Remove fields from billing form HOT 1
- Duplicate key in config for media extensions HOT 2
- URL parameter sanitization HOT 7
- Can't add categories to site HOT 1
- To create a customer account HOT 1
- [Suggestion]manager find method return HOT 1
- default wrong locale for new sites HOT 1
- Image previews not being created correctly HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aimeos-core.