Set Service Attribute Name
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Set Service Attribute Name
Hello,
I'm using some service attributes and it's a really nice feature.
I've two small questions about it :
- I wonder if it's possible to set the name field of the service attribute at the same time I set the code + value ?
- I wonder if the value is one more time checked regarding the default values after the last page (summary) is confirmed (just before the order is stored) !
Thank you very much,
sbn
I'm using some service attributes and it's a really nice feature.
I've two small questions about it :
- I wonder if it's possible to set the name field of the service attribute at the same time I set the code + value ?
- I wonder if the value is one more time checked regarding the default values after the last page (summary) is confirmed (just before the order is stored) !
Thank you very much,
sbn
Re: Set Service Attribute Name
Only if you implement an alternative service attribute item or if you do it in the service provider yourself.sixbynine wrote: - I wonder if it's possible to set the name field of the service attribute at the same time I set the code + value ?
No, there are no checks any more after the service provider added the data.sixbynine wrote: - I wonder if the value is one more time checked regarding the default values after the last page (summary) is confirmed (just before the order is stored) !
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Set Service Attribute Name
Ok ! Thank you very much (one more time).
I also wonder if it is possible to set a FECONFIG / service attribute using JSONAPI ?
I tried to set it here :
But I got a message saying my attribute is wrong... I probably did not use the right syntax... but i did not find the correct one in the documentation.
Thank you very much,
sbn
I also wonder if it is possible to set a FECONFIG / service attribute using JSONAPI ?
I tried to set it here :
Code: Select all
var params = {data: [{
type: "basket/service",
id: "delivery",
attributes: {
"service.id": "...",
// key/value pairs of data entered by the customer, e.g. bank account data
}
}]};
Thank you very much,
sbn
Re: Set Service Attribute Name
Should be something like this:
If you want to add custom key/value pairs, you have to add a decorator that defines the codes (and maybe the possible values if it's not arbitrary text) because it's checked if those codes are defined. Only after storing the key/value pairs, there are not checks any more.
Code: Select all
var params = {data: [{
type: "basket/service",
id: "delivery",
attributes: {
"service.id": "...",
"accountno": "...",
"bankname": "..."
}
}]};
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Set Service Attribute Name
Hello !
Thank you very much (one more time) for your help.
It finally worked, so here I share what I did if someone else needs it :
In myprovider.php
In my request :
The problem was I was using "mykey" instead of "myprovider.mykey" in a sub "attributes:{}" array.
Thank you very much
Thank you very much (one more time) for your help.
It finally worked, so here I share what I did if someone else needs it :
In myprovider.php
Code: Select all
private $feConfig = array(
'myprovider.mykey' => array(
'code' => 'myprovider.mykey',
'internalcode'=> 'mykey',
'label'=> 'mykey',
'type'=> 'string',
'internaltype'=> 'string',
'default'=> '',
'required'=> false
)
);
Code: Select all
var params = {data: [{
type: "basket/service",
id: "delivery",
attributes: {
"service.id": "...",
"myprovider.mykey": "myvalue"
}
}]};
Thank you very much