Get Prices of Attributes
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Get Prices of Attributes
In my template I call $attr->getRefItems('price', null, 'default') in the foreach loop and get no prices.
The attribute $attr generally has no ref items.
The attribute $attr generally has no ref items.
Code: Select all
$productItem = $this->get('productItem', null);
if (isset($productItem)) {
$attrPrices = [];
$attributes = $productItem->getRefItems('attribute', null, 'hidden');
foreach ($attributes as $attr) {
$attrPrices = array_merge($attrPrices, $attr->getRefItems('price', null, 'default')->toArray());
}
}
PHP 8.2.24
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Re: Get Prices of Attributes added by Supplier
Check if the hidden attributes assigned to the product have prices and if they are loaded by passing the correct referenced domains (at least ['attribute', 'price'] in your case).
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: Get Prices of Attributes added by Supplier
Yes the hidden attributes have prices and are assigned to the product.
In my code example you see how I try to load the prices of the attributes but I get nothing.
I use your ai-customergroups v24.10.2 extension and found out, that it works when I disable the extension.
In my code example you see how I try to load the prices of the attributes but I get nothing.
I use your ai-customergroups v24.10.2 extension and found out, that it works when I disable the extension.
PHP 8.2.24
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Re: Get Prices of Attributes added by Supplier
Can you please execute and run the setup tasks again? The "key" column wasn't migrated correctly.
Code: Select all
composer req aimeoscom/ai-customergroups:2024.10.x-dev
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: Get Prices of Attributes added by Supplier
We have already written a lot on Github about the migration of ai-customergroups.
That works now.
But when the ai-customergroups extension is active, I don't get any prices from the attribute in this line from my code example above.
When I disable ai-customergroups it works and I get prices.
That works now.
But when the ai-customergroups extension is active, I don't get any prices from the attribute in this line from my code example above.
Code: Select all
$attrPrices = array_merge($attrPrices, $attr->getRefItems('price', null, 'default')->toArray());
PHP 8.2.24
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Re: Get Prices of Attributes added by Supplier
Tested locally with ai-customergroups:2024.10.x-dev installed by adding a hidden attribute with a price to a product and fetching/displaying it in the catalog detail view worked without problems. The pure existence of the ai-customergroups extension can't be the reason for that. Did you assign a customer or group to that price of the hidden attribute?
Make sure, you've installed the latest aimeos/aimeos-typo3:2024.10.x-dev release because the Aimeos TYPO3 extension has an unreleased fix for group handling.
Make sure, you've installed the latest aimeos/aimeos-typo3:2024.10.x-dev release because the Aimeos TYPO3 extension has an unreleased fix for group handling.
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: Get Prices of Attributes
I have tested with 2024.10.x-dev version of Aimeos and ai-customergroups aswell.
In the checkItem() function of CustomerGroup you can see, that the item has no listItems.
But in the backend this attribute has a price item assigned.
When I comment out this lines (disable ai-customergroups) I get the price of the attribute correctly.
In the checkItem() function of CustomerGroup you can see, that the item has no listItems.
But in the backend this attribute has a price item assigned.
When I comment out this lines (disable ai-customergroups) I get the price of the attribute correctly.
Code: Select all
plugin.tx_aimeos.settings.mshop.attribute.manager.decorators.global.CustomerGroup = CustomerGroup
plugin.tx_aimeos.settings.mshop.catalog.manager.decorators.local.CatalogCustomerGroup = CatalogCustomerGroup
plugin.tx_aimeos.settings.mshop.index.manager.decorators.local.IndexCustomerGroup = IndexCustomerGroup
plugin.tx_aimeos.settings.mshop.media.manager.decorators.global.CustomerGroup = CustomerGroup
plugin.tx_aimeos.settings.mshop.price.manager.decorators.global.CustomerGroup = CustomerGroup
PHP 8.2.24
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Re: Get Prices of Attributes
The problem is that this TypoScript configuration overwrites the default decorators:
When using these line, it works as expected:
Code: Select all
plugin.tx_aimeos.settings.mshop.attribute.manager.decorators.global.CustomerGroup = CustomerGroup
plugin.tx_aimeos.settings.mshop.catalog.manager.decorators.local.CatalogCustomerGroup = CatalogCustomerGroup
plugin.tx_aimeos.settings.mshop.index.manager.decorators.local.IndexCustomerGroup = IndexCustomerGroup
plugin.tx_aimeos.settings.mshop.media.manager.decorators.global.CustomerGroup = CustomerGroup
plugin.tx_aimeos.settings.mshop.price.manager.decorators.global.CustomerGroup = CustomerGroup
Code: Select all
plugin.tx_aimeos.settings.mshop.attribute.manager.decorators.global {
CustomerGroup = CustomerGroup
Lists = Lists
Property = Property
Type = Type
}
plugin.tx_aimeos.settings.mshop.catalog.manager.decorators.local {
CatalogCustomerGroup = CatalogCustomerGroup
}
plugin.tx_aimeos.settings.mshop.index.manager.decorators.local {
IndexCustomerGroup = IndexCustomerGroup
}
plugin.tx_aimeos.settings.mshop.media.manager.decorators.global {
CustomerGroup = CustomerGroup
Lists = Lists
Property = Property
Type = Type
}
plugin.tx_aimeos.settings.mshop.price.manager.decorators.global {
CustomerGroup = CustomerGroup
Lists = Lists
Property = Property
Type = Type
}
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: Get Prices of Attributes
With that TypoScript it works.
Maybe you can change the instruction in README.md of ai-customergroups.
Maybe you can change the instruction in README.md of ai-customergroups.
PHP 8.2.24
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Typo3 v12.4.23 LTS
Aimeos web shop 24.10.2
Re: Get Prices of Attributes
That have already been updated in the latest version of the extension
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