price of pre selected variant not displayed on catalog
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
price of pre selected variant not displayed on catalog
Hi,
I'm using selection products and defined a pre-selection (client/html/catalog/selection/preselect) for my catalog page.
(as explained on https://aimeos.org/docs/Configuration/C ... /preselect)
The preselection works fine, but the price of the preselected variant is not displayed. I have first to select another variant and then back the preselected variant. Then the price is shown.
How can I fix it, that the price of the (pre)selected variant is displayed?
thank you
I'm using selection products and defined a pre-selection (client/html/catalog/selection/preselect) for my catalog page.
(as explained on https://aimeos.org/docs/Configuration/C ... /preselect)
The preselection works fine, but the price of the preselected variant is not displayed. I have first to select another variant and then back the preselected variant. Then the price is shown.
How can I fix it, that the price of the (pre)selected variant is displayed?
thank you
Re: price of pre selected variant not displayed on catalog
You should assign the price of the pre-selected variant to the selection product so it's displayed by default. If the customer changes the variant attribute pre-selection, the price should be updated by JS/CSS.
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: price of pre selected variant not displayed on catalog
Is it also possible to find in items-body-list.php which productitem is pre-selected and add the "price-actual" class to "articleitem price"? - so that this pre-selected price is displayed on the frontend?
Code: Select all
<?php foreach( $productItem->getRefItems( 'product', 'default', 'default' ) as $prodid => $product ) : ?>
<?php if( $productItems[$prodid] ) { $product = $productItems[$prodid]; } ?>
<?php if( ( $prices = $product->getRefItems( 'price', null, 'default' ) ) !== [] ) : ?>
<div class="articleitem price"
data-prodid="<?= $enc->attr( $prodid ); ?>"
data-prodcode="<?= $enc->attr( $product->getCode() ); ?>">
<?= $this->partial(
$this->config( 'client/html/common/partials/price', 'common/partials/price-standard' ),
array( 'prices' => $prices )
); ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
Re: price of pre selected variant not displayed on catalog
Yes, but that requires looping over all product and check if the variant attributes match with the pre-selected.
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