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!
Issue set product order in admin
Hi.
In admin, I want to set a default order of products in a category. Basically control which products should be on top for the customer by default.
If I understand it correctly, this should be done by going into Catalog->Categories, select a category, go to the tab "Products"
Then you should be able to set display order by changing the numbers in the Position column, correct?
When I do this, i encounter some oddities.
First, if I change the position value (all is 0 by default) to 1 or -1 the reference to the product disappears from the listing leaving me with just an "eye-icon" instead of product data. The link from the icon also lacks the product id. Using the edit pen, I can see a list of products, but I can't assign it. It says "data saved successfully" but no product data is set.
Looking at the catalog -> products the edited product is still there without changes.
Am I doing something wrong, or is there something else going on here?
In the log i'm getting an integrity costraint violation when I change a value and get an error saving data:
And the product I'm changing position for in mshop_catalog_list looks like this in the db:
In admin, I want to set a default order of products in a category. Basically control which products should be on top for the customer by default.
If I understand it correctly, this should be done by going into Catalog->Categories, select a category, go to the tab "Products"
Then you should be able to set display order by changing the numbers in the Position column, correct?
When I do this, i encounter some oddities.
First, if I change the position value (all is 0 by default) to 1 or -1 the reference to the product disappears from the listing leaving me with just an "eye-icon" instead of product data. The link from the icon also lacks the product id. Using the edit pen, I can see a list of products, but I can't assign it. It says "data saved successfully" but no product data is set.
Looking at the catalog -> products the edited product is still there without changes.
Am I doing something wrong, or is there something else going on here?
In the log i'm getting an integrity costraint violation when I change a value and get an error saving data:
Code: Select all
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8-product-1.2.-default-' for key 'mshop_catalog_list.unq_mscatli_pid_dm_sid_ty_rid':
UPDATE "mshop_catalog_list"
SET
"parentid" = ?, "key" = ?, "type" = ?, "domain" = ?, "refid" = ?, "start" = ?,
"end" = ?, "config" = ?, "pos" = ?, "status" = ?, "mtime" = ?, "editor" = ?
WHERE "siteid" = ? AND "id" = ?
["8","product|default|","default","product","",null,null,"[]",1,1,"2022-02-16 10:59:32","Dev Pigment","1.2.","110"]
Code: Select all
id parentid siteid key type domain refid start end config pos status mtime ctime editor
110 8 1.2. product|default|75 default product 75 [] 0 1 2021-09-30 09:49:07 2021-09-30 09:49:07 sadmin@dinsaluhall.se
_____________
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
Please update to the latest 2021.10 LTS version as the problem is fixed there.
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, we've updated and now we can change the order in admin, but it's not reflected towards the customer which is what we expected. The product order is still the same in the category.
_____________
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
Did you set the position value to an unique integer for each entry?
Did you try to clear the cache using:
Did you try to clear the cache using:
Code: Select all
php artisan aimeos:cache
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
I set the integer value on some of the entries, based on the client saying they want to be able to place 3-4 products at the top and don't care about the rest. Do I need to have all products in the category as unique integers?
Cache cleared of course, both aimeos and browser
Cache cleared of course, both aimeos and browser
_____________
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
By default, all products get position "0" and if you change a few products to position 1, 2, 3 and 4, the rest still remains at position zero and the database will return them first. Thus, you have to set all positions to non-zero but they don't have to be unique.
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, I'll try that.
Was a bit odd that I saw absolutely no effect at all after setting non-zero to some products, I expected the changed ones to move in relation to the 0 ones.
Thank you
Was a bit odd that I saw absolutely no effect at all after setting non-zero to some products, I expected the changed ones to move in relation to the 0 ones.
Thank you
_____________
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
Back at this.
Images shows how I've ordered things in admin, and the result I got.
Note that the product " "0" mjöl till pizza, 1kg" is originally first in the list, and I've positioned it as #2 in admin, still it shows as #1 in the frontend.
Note that I'm using marketplace if that will make a difference, I can only add the product order in the category if I'm in the site that owns the products. I can't set the order from the top level site.
Looking in the mshop_catalog_index i see that the sort order is set for site 1.2 and for 1. it is 0 on all products in the category.
Switching to the other site in the url still gives the same order without position applied.
Intended sort: Resulting sort in frontend: This is after updating to latest release.
Tried php artisan optimize:clear as well, made no difference.
Images shows how I've ordered things in admin, and the result I got.
Note that the product " "0" mjöl till pizza, 1kg" is originally first in the list, and I've positioned it as #2 in admin, still it shows as #1 in the frontend.
Note that I'm using marketplace if that will make a difference, I can only add the product order in the category if I'm in the site that owns the products. I can't set the order from the top level site.
Looking in the mshop_catalog_index i see that the sort order is set for site 1.2 and for 1. it is 0 on all products in the category.
Switching to the other site in the url still gives the same order without position applied.
Intended sort: Resulting sort in frontend: This is after updating to latest release.
Tried php artisan optimize:clear as well, made no difference.
_____________
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
Does executing this command help?
Code: Select all
php artisan aimeos:clear
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
I had tried that and multiple other variants of clearing caches.
Now a couple of days after it worked.
But should I really have to do that each time I change product order?
That would not work at all once the shop is delivered to the customer, they are non technical, but constantly adjusts product orders to push what they want sold from week to week.
There is no way we can allow them onto the server to run commands like this!
How much performance hit would it be to add this as a cron job that runs once an hour or so?
/Dan
Now a couple of days after it worked.
But should I really have to do that each time I change product order?
That would not work at all once the shop is delivered to the customer, they are non technical, but constantly adjusts product orders to push what they want sold from week to week.
There is no way we can allow them onto the server to run commands like this!
How much performance hit would it be to add this as a cron job that runs once an hour or so?
/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