"Add to basket" in product list
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: 4
- Joined: 10 Nov 2015, 12:54
"Add to basket" in product list
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:
Which PHP file do I have to modify to get those attributes into the product list?
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; ?>
Re: "Add to basket" in product list
That's a matter of configurationafernandez wrote:Which PHP file do I have to modify to get those attributes into the product list?
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, give us a star
If you like Aimeos, give us a star
-
- Posts: 4
- Joined: 10 Nov 2015, 12:54
Re: "Add to basket" in product list
Sorry, I mixed up things. I want to show the variants of a product, not the attributes.
Re: "Add to basket" in product list
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.afernandez wrote:Sorry, I mixed up things. I want to show the variants of a product, not the attributes.
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