Attribute search
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!
-
- Posts: 24
- Joined: 15 Mar 2018, 10:04
Attribute search
Hi Team, Here i wan to filter the product according to the attributes using JSON API. Can i list the attribute using attribute type? in
Re: Attribute search
Yes, sure. Use a filter for "attribute.type.code":
It's documented there:
Filtering: https://aimeos.org/docs/Developers/Clie ... the_result
Parameter nesting: https://aimeos.org/docs/Developers/Clie ... parameters
Code: Select all
var params = {];
if( servicedesc.meta.prefix ) {
params[servicedesc.meta.prefix] = {filter: {'==': {'attribute.type.code': 'mytype'}}};
} else {
params = {filter: {'==': {'attribute.type.code': 'mytype'}}};
}
$.ajax({
method: "GET",
dataType: "json",
url: servicedesc.meta.resources['attribute'], // returned from OPTIONS call
data: params
}).done( function( result ) {
console.log( result.data );
});
Filtering: https://aimeos.org/docs/Developers/Clie ... the_result
Parameter nesting: https://aimeos.org/docs/Developers/Clie ... parameters
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
-
- Posts: 24
- Joined: 15 Mar 2018, 10:04
Re: Attribute search
I am using the JSONAPI. Where can i add this code?
Re: Attribute search
In your client application that calls the JSON REST API server endpoints
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
-
- Posts: 24
- Joined: 15 Mar 2018, 10:04
Re: Attribute search
My issues are resolved. One more thing
Can i get the attribute list according to the attribute type. Because this will easier to filter the data and compare the attribute lable with my value.?
Currently I am using this API to list the attributes
http://localhost/jsonapi/attribute
Can i get the attribute list according to the attribute type. Because this will easier to filter the data and compare the attribute lable with my value.?
Currently I am using this API to list the attributes
http://localhost/jsonapi/attribute