Issue set product order in admin
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!
Re: Issue set product order in admin
Executing that command was only to see if it's cache related. If you can reproduce that it works after changing the product positions, we can see where the problem lies.
There's an "Index" decorator for the backend, which should update the product index each time you change one of the positions:
https://github.com/aimeos/ai-admin-jqad ... /Index.php
Can you check if that decorator is used?
There's an "Index" decorator for the backend, which should update the product index each time you change one of the positions:
https://github.com/aimeos/ai-admin-jqad ... /Index.php
Can you check if that decorator is used?
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: Issue set product order in admin
Disregard the above, now it is working without artisan commands.
Tested it multiple times and it works without any other actions than changing it in the admin, Odd that it took so long before it started working, but good
Tested it multiple times and it works without any other actions than changing it in the admin, Odd that it took so long before it started working, but good
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Issue set product order in admin
Again a revisit to this.
As we deployed the aimeos upgrade etc onto the customers stage site, we noticed that the order set in admin did not reflect live.
Tried the - did not help.
Added some logging to the decorator that handles rebuild of indexes, it's called and goes into the rebuild call.
Started comparing the db to my local install where it works and found one thing.
Locally where it works, the position is saved in the mshop_index_catalog for both the main site for the category and the sub sites for the category (as mentioned I run marketplace), but on the stage site, position was only updated for the sub-site (1.7) for the main siteid 1. was 0 for all products.
Changed it manually in the db and then the sorting was applied in the shop.
What except for the in the decorator handles indexing of this?*
Note, If I run this it rebuilds the indexes properly, but it should rebuild as you save position in admin if I understand you correctly
As we deployed the aimeos upgrade etc onto the customers stage site, we noticed that the order set in admin did not reflect live.
Tried the
Code: Select all
php artisan aimeos:clear
Added some logging to the decorator that handles rebuild of indexes, it's called and goes into the rebuild call.
Started comparing the db to my local install where it works and found one thing.
Locally where it works, the position is saved in the mshop_index_catalog for both the main site for the category and the sub sites for the category (as mentioned I run marketplace), but on the stage site, position was only updated for the sub-site (1.7) for the main siteid 1. was 0 for all products.
Changed it manually in the db and then the sorting was applied in the shop.
What except for the
Code: Select all
\Aimeos\MShop::create( $context, 'index' )->rebuild( $items );
Note, If I run this
Code: Select all
php artisan aimeos:jobs "index/rebuild index/optimize" saluhall
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Issue set product order in admin
The index is updated by the admin backend at the vendor level but not at parent levels like you've already noticed. You shouldn't build the index at the "default" level but aggregate the index records from the vendors like for the products.
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: Issue set product order in admin
Aha.
How do I go about doing that?
I have the following in my shop.php config
Or is it something completely different I need to do?
/Dan
How do I go about doing that?
I have the following in my shop.php config
Code: Select all
'mshop' => [
'locale' => [
'site' => 'saluhall',
'manager' => [
'sitelevel' => 3,
],
],
'common' => [
'manager' => [
'maxdepth' => 3,
],
],
],
/Dan
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Issue set product order in admin
You should not use the the aimeos:jobs command to rebuild the index for the parent site because the index records from the vendor sites should be used instead.
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: Issue set product order in admin
Ok, so you are saying:
"dont' index the parent site, aggregate the vendors index".
But.
If the admin only updates the index for the vendor site as you change position for products in a category, the change is not reflected in the default site where all the purchases are made. Customers don't enter the vendor sites in our setup, those are invisible to the visitor. Everything happens in the default site and products from vendors are displayed in categories in the default site.
The only way I've found to get the sorting change visible in the default site when looking in a category, is to update the index for the default site as well.
So if I I do as you say, and don't run the aimeos:jobs command to rebuild the index for the parent site, the products are not reordered for the visitors. Basically the index records for the vendor sites are not used at all for me.
So when you say:
/Dan
"dont' index the parent site, aggregate the vendors index".
But.
If the admin only updates the index for the vendor site as you change position for products in a category, the change is not reflected in the default site where all the purchases are made. Customers don't enter the vendor sites in our setup, those are invisible to the visitor. Everything happens in the default site and products from vendors are displayed in categories in the default site.
The only way I've found to get the sorting change visible in the default site when looking in a category, is to update the index for the default site as well.
So if I I do as you say, and don't run the aimeos:jobs command to rebuild the index for the parent site, the products are not reordered for the visitors. Basically the index records for the vendor sites are not used at all for me.
So when you say:
I might be stupid here, but unfortunately I don't understand how to do that."you should aggregate the index records from the vendors like for the products"
/Dan
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Issue set product order in admin
Assume you have the following setup:
"default" site:
- categories
Vendor sites:
- products
- product<->category relations
- index records in mshop_index_catalog
If vendors add products and associate them to categories resp. change the order of the products per category in the Catalog > Category panel, the index records in the mshop_index_* tables are created with the vendor site IDs.
Customers browse at the marketplace using the "default" site and records from the mshop_index_* tables are aggregated to the default site (by default if you use "mshop/locale/manager/sitelevel = 3"). The order of the products at the marketplace is determined by the order of the products from the vendor levels. Products at the vendor level with the same position (e.g. 0) are in random order at the marketplace level, while all products at the vendor level with position 1 are in random order at the marketplace level after those products with position 0.
"default" site:
- categories
Vendor sites:
- products
- product<->category relations
- index records in mshop_index_catalog
If vendors add products and associate them to categories resp. change the order of the products per category in the Catalog > Category panel, the index records in the mshop_index_* tables are created with the vendor site IDs.
Customers browse at the marketplace using the "default" site and records from the mshop_index_* tables are aggregated to the default site (by default if you use "mshop/locale/manager/sitelevel = 3"). The order of the products at the marketplace is determined by the order of the products from the vendor levels. Products at the vendor level with the same position (e.g. 0) are in random order at the marketplace level, while all products at the vendor level with position 1 are in random order at the marketplace level after those products with position 0.
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: Issue set product order in admin
- Assumed Setup matches mine.
- Vendors working principle as described matches ours. mshop_index_* tables are updated as you describe
- Customers browse at the marketplace using the "default" site. Correct.
Products are indeed visible in the categories as set by the vendor, but a set order on the vendor level is not applied/aggregated to the default level. It's only visible in admin.
I've tried it many times, including unique positions for each product in a category. It does not work. The only way I get the positions to work is to do what you say I shouldn't, to run
Checking my config and I have this in there for the mshop:
and for jobs I have :
Per instructions...
- Vendors working principle as described matches ours. mshop_index_* tables are updated as you describe
- Customers browse at the marketplace using the "default" site. Correct.
And this is not happening.and records from the mshop_index_* tables are aggregated to the default site (by default if you use "mshop/locale/manager/sitelevel = 3"). The order of the products at the marketplace is determined by the order of the products from the vendor levels
Products are indeed visible in the categories as set by the vendor, but a set order on the vendor level is not applied/aggregated to the default level. It's only visible in admin.
I've tried it many times, including unique positions for each product in a category. It does not work. The only way I get the positions to work is to do what you say I shouldn't, to run
Code: Select all
php artisan aimeos:jobs "index/rebuild index/optimize" saluhall
Checking my config and I have this in there for the mshop:
Code: Select all
'mshop' => [
'locale' => [
'site' => 'saluhall',
'manager' => [
'sitelevel' => 3,
],
],
'common' => [
'manager' => [
'maxdepth' => 3,
],
],
],
Code: Select all
'locale' => [
'manager' => [
'sitelevel' => 3,
],
],
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Issue set product order in admin
We've tested the that setup with 2021.10 and the latest version and both behave as expected:
Marketplace:
- catagories
- no products
- no category <-> product relations
Vendor site 1:
- product 1 & 2
- category <-> product relation at position 0 (product 1) and 2 (product 2)
Vendor site 2:
- product 3 & 4
- category <-> product relation at position 1 (product 3) and 3 (product 4)
No index/rebuild job has been executed. The order of the products in the marketplace is:
1.) producct 1
2.) product 3
3.) product 2
4.) product 4
Maybe your problem is that there are already entrires in the mshop_index_* tables from your marketplace site and they overwrite all relations from the vendor sites. To test, truncate the mshop_index_* tables and only run the index/rebuild job for your vendor sites once, i.e.:
Marketplace:
- catagories
- no products
- no category <-> product relations
Vendor site 1:
- product 1 & 2
- category <-> product relation at position 0 (product 1) and 2 (product 2)
Vendor site 2:
- product 3 & 4
- category <-> product relation at position 1 (product 3) and 3 (product 4)
No index/rebuild job has been executed. The order of the products in the marketplace is:
1.) producct 1
2.) product 3
3.) product 2
4.) product 4
Maybe your problem is that there are already entrires in the mshop_index_* tables from your marketplace site and they overwrite all relations from the vendor sites. To test, truncate the mshop_index_* tables and only run the index/rebuild job for your vendor sites once, i.e.:
Code: Select all
php artisan aimeos:jobs "index/rebuild" "vendor1 vendor2"
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