"Add to basket" in product list

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)
afernandez
Posts: 4
Joined: 10 Nov 2015, 12:54

"Add to basket" in product list

Post 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?

User avatar
aimeos
Administrator
Posts: 3097
Joined: 01 Jan 1970, 00:00

Re: "Add to basket" in product list

Post 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/C ... st/domains

We would like to get that feature into the core too. Could you create a PR for this?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

afernandez
Posts: 4
Joined: 10 Nov 2015, 12:54

Re: "Add to basket" in product list

Post by afernandez » 25 Nov 2015, 11:41

Sorry, I mixed up things. I want to show the variants of a product, not the attributes.

User avatar
aimeos
Administrator
Posts: 3097
Joined: 01 Jan 1970, 00:00

Re: "Add to basket" in product list

Post 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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply