Price display on filtering
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: 18
- Joined: 13 May 2020, 13:07
Price display on filtering
Hi
We are using Aimeos for Laravel 2019.04
I hope you can help me out with the following challenge that we have:
Our selection product can have about 70 subproducts (based on a the combinations of length, width and softness)
some of the subproducts have different prices. (price added in the subproduct)
Selection product - no width, length or softness is set - Price is set to €200,-
Subproduct 1 - width = 40 / length = 80 / softness = extra soft - No price set (so uses section product price)
Subproduct 2 - width = 60 / length = 80 / softness = extra soft - Price € 240,-
Subproduct 3 - width = 60 / length = 90 / softness = extra soft - Price € 250,-
subproduct 4 - width = 70 / length = 80 / softness = hard - Price € 280,-
subproduct 5 - width = 70 / length = 90 / softness = extra soft- Price € 280,-
I try to achieve the following without any luck:
When I use the product filter on the frontend and I filter on product width=60 then the price of the selection product € 200,- is still shown. But in reality the price for a product with width=60 has is minimum € 240,-
We where hoping to get the following result:
1) when filtered on width=60 (width=60 has multiple product with different prices, so show lowest price)
then show price "from € 240,-"
2) when fitered on width=70 (width=60 has multiple product but the prices are the same, so show price)
then show "€ 280"
3) when filtered on softness=hard
then show "€ 280"
4) when filtered on softness is extra soft
then show "from € 200"
I hope you can help us to achieve this.
We are using Aimeos for Laravel 2019.04
I hope you can help me out with the following challenge that we have:
Our selection product can have about 70 subproducts (based on a the combinations of length, width and softness)
some of the subproducts have different prices. (price added in the subproduct)
Selection product - no width, length or softness is set - Price is set to €200,-
Subproduct 1 - width = 40 / length = 80 / softness = extra soft - No price set (so uses section product price)
Subproduct 2 - width = 60 / length = 80 / softness = extra soft - Price € 240,-
Subproduct 3 - width = 60 / length = 90 / softness = extra soft - Price € 250,-
subproduct 4 - width = 70 / length = 80 / softness = hard - Price € 280,-
subproduct 5 - width = 70 / length = 90 / softness = extra soft- Price € 280,-
I try to achieve the following without any luck:
When I use the product filter on the frontend and I filter on product width=60 then the price of the selection product € 200,- is still shown. But in reality the price for a product with width=60 has is minimum € 240,-
We where hoping to get the following result:
1) when filtered on width=60 (width=60 has multiple product with different prices, so show lowest price)
then show price "from € 240,-"
2) when fitered on width=70 (width=60 has multiple product but the prices are the same, so show price)
then show "€ 280"
3) when filtered on softness=hard
then show "€ 280"
4) when filtered on softness is extra soft
then show "from € 200"
I hope you can help us to achieve this.
Re: Price display on filtering
That's not possible out of the box because in the list view, only the selection price is shown with "from €200".
To achieve what you want, the list view needs to load the selection articles and their attributes too using https://aimeos.org/docs/Configuration/C ... ts/domains:
Then, you have to implement your own algorithm in the catalog/lists/item-body-* template to filter the articles with the passed attribute ID:
Something like that, I've not tested it but it should give you an impression what you have to do.
To achieve what you want, the list view needs to load the selection articles and their attributes too using https://aimeos.org/docs/Configuration/C ... ts/domains:
Code: Select all
'client' => [
'html' => [
'catalog' => [
'lists' => [
'domains' => ['media', 'price', 'text', 'attribute', 'product']
]
]
]
]
Code: Select all
foreach( $product->getRefItems( 'product', null, 'default' ) as $articles ) {
foreach( $articles as $article ) {
if( $article->getListItem( 'attribute', 'variant', $this->param( 'f_attrid', [] ) ) {
$list[] = current( $article->getRefItems( 'price', 'default', 'default' ) );
}
}
}
$price = null;
foreach( array_filter( $list ) as $priceItem ) {
if( $price === null || $priceItem->getValue() < $price ) {
$price = $priceItem->getValue();
}
}
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: 18
- Joined: 13 May 2020, 13:07
Re: Price display on filtering
Thanks a lot, we will give it a try.
-
- Posts: 18
- Joined: 13 May 2020, 13:07
Re: Price display on filtering
Thank you for the advice, this has helped a lot. We have got this working now.
Now we only have to apply this on the product detail page as well.
Now we only have to apply this on the product detail page as well.