Add a column in jqadm "product list" with a caracteristic of product
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!
Add a column in jqadm "product list" with a caracteristic of product
Hello,
Here is my environnement (edit):
Aimeos: latest aimeos/aimeos(2024.10.2
php 8.3
linux ubuntu
The intention:
I added a "property" first in Product Property Types in jqadm, so i can edit it in every product, and for ease of use (it is just a Yes/No flag), i would like to add it to the html output (JQADM) in Catalog -> Product so we can check the value of this caracteristic for each product and sort by it.
The problem:
The value of the caracteristic displays but if i can't sort (by clicking on the column):
From the admin log it outputs:
Invalid name "product.property.mypropertytypecode"
aimeos-base/src/Criteria/SQL.php(190): Aimeos\Base\Criteria\Expression\Sort\SQL->toSource()
What i did:
I modified and overriden in list.php:
1) copied vendor list.php to packages/myextension/templates/admin/jqadm/product/list.php
2) added 'product.property.value' to $default
3) added 'product.property.mypropertytypecode' => $this->translate( 'admin', 'Test' ) to $columnList
4) in <?= $this->partial(
$this->config( 'admin/jqadm/partial/listsearch', 'listsearch' ), [
...
'product.property' => [
'op' => '=~',
'type' => 'attribute',
'val' => [
'mypropertytypecode:1' => $this->translate( 'admin', 'Test: Yes' ),
'mypropertytypecode:0' => $this->translate( 'admin', 'Test: No' ),
],
'type:property' => 'mypropertytypecode'
],
5) i also added this trying to respect the structure of html
<?php if( in_array( 'product.property.value', $fields ) ) : ?>
<td class="product-property-someclass">
<a class="items-field" href="<?= $url ?>">
<?php
$propertyItems = $item->getPropertyItems('mypropertytypecode');
if($propertyItems->first()) {
echo $enc->html($propertyItems->first()->getValue() == 1 ? 'Yes' : 'No');
} else {
echo '-';
}
?>
</a>
</td>
<?php endif ?>
Thank you in advance !
Here is my environnement (edit):
Aimeos: latest aimeos/aimeos(2024.10.2
php 8.3
linux ubuntu
The intention:
I added a "property" first in Product Property Types in jqadm, so i can edit it in every product, and for ease of use (it is just a Yes/No flag), i would like to add it to the html output (JQADM) in Catalog -> Product so we can check the value of this caracteristic for each product and sort by it.
The problem:
The value of the caracteristic displays but if i can't sort (by clicking on the column):
From the admin log it outputs:
Invalid name "product.property.mypropertytypecode"
aimeos-base/src/Criteria/SQL.php(190): Aimeos\Base\Criteria\Expression\Sort\SQL->toSource()
What i did:
I modified and overriden in list.php:
1) copied vendor list.php to packages/myextension/templates/admin/jqadm/product/list.php
2) added 'product.property.value' to $default
3) added 'product.property.mypropertytypecode' => $this->translate( 'admin', 'Test' ) to $columnList
4) in <?= $this->partial(
$this->config( 'admin/jqadm/partial/listsearch', 'listsearch' ), [
...
'product.property' => [
'op' => '=~',
'type' => 'attribute',
'val' => [
'mypropertytypecode:1' => $this->translate( 'admin', 'Test: Yes' ),
'mypropertytypecode:0' => $this->translate( 'admin', 'Test: No' ),
],
'type:property' => 'mypropertytypecode'
],
5) i also added this trying to respect the structure of html
<?php if( in_array( 'product.property.value', $fields ) ) : ?>
<td class="product-property-someclass">
<a class="items-field" href="<?= $url ?>">
<?php
$propertyItems = $item->getPropertyItems('mypropertytypecode');
if($propertyItems->first()) {
echo $enc->html($propertyItems->first()->getValue() == 1 ? 'Yes' : 'No');
} else {
echo '-';
}
?>
</a>
</td>
<?php endif ?>
Thank you in advance !
Re: Add a column in jqadm "product list" with a caracteristic of product
You can only sort by column of the mshop_product table, not values of the mshop_product_property table in the list view.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Add a column in jqadm "product list" with a caracteristic of product
So i was trying to do something impossible it is normal it did not work.
Thank you for answering !
Thank you for answering !