How to configure and adapt Aimeos based shops as developer
Forum rules: Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#2092 by afernandez
25 Nov 2015, 08:43
Hi,

I currently try to implement a feature that allows me to add products into the basket while browsing the product list. It works for products that don't have additional attributes required for selection (e.g. color). If I have such product I obviously can't add it, as the required attribute was not selected. The issue I have now is that such attributes are not loaded in the product list. I've put the following code into my own items-body-default.html, only getting an empty array:

Code: Select all<?php foreach( $this->get( 'attributeConfigItems', array() ) as $code => $attributes ) : ?>
    <!--  Layout stuff... -->
<?php endforeach; ?>


Which PHP file do I have to modify to get those attributes into the product list?
#2097 by aimeos
25 Nov 2015, 11:10
afernandez wrote:Which PHP file do I have to modify to get those attributes into the product list?


That's a matter of configuration :-)

You should add "attribute" to the list of domains that should be fetched:
https://aimeos.org/docs/Configuration/Core/client/html/catalog/list/domains

We would like to get that feature into the core too. Could you create a PR for this?
#2101 by aimeos
25 Nov 2015, 11:47
afernandez wrote:Sorry, I mixed up things. I want to show the variants of a product, not the attributes.


Add "product" to get the associated products as well. The downside is that if you need images, prices, texts, etc. of the variants as well, you need to fetch them in a second searchItems() call in the setViewParams() method of the subpart.