How to hide unique products in catalogue when they are sold?
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!
How to hide unique products in catalogue when they are sold?
Hi,
in a shop selling unique products (works of art) we want to hide them from customers in the catalogue when they are sold.
Is there a possibility to only show products with stocklevel > 0?
Or how can the product be set deactivated or archived when last item is sold/delivered?
Thanks.
BTW: customer likes the new easy/simple mode.
in a shop selling unique products (works of art) we want to hide them from customers in the catalogue when they are sold.
Is there a possibility to only show products with stocklevel > 0?
Or how can the product be set deactivated or archived when last item is sold/delivered?
Thanks.
BTW: customer likes the new easy/simple mode.
Re: How to hide unique products in catalogue when they are s
The stock level data is loaded async via AJAX.
You have three options:
- Extend the Javascript method that's used to add the stock levels to hide those products
- Extend the catalog lists class where you retrieve the stock levels for the products and remove those that are out of stock
- Write a frontend controller decorator that deactivates the product if it's out of stock
The Javascript approach is very simple to implement. The first two options have the disadvantage that a product listing can contain less products than normal, e.g. 23 products instead of 24 on the first page, 24 on the second and so on. Which do you prefer?
That's good to hear that about the new simple admin interface. The next version will be able to cover all functionality and improves usability further
You have three options:
- Extend the Javascript method that's used to add the stock levels to hide those products
- Extend the catalog lists class where you retrieve the stock levels for the products and remove those that are out of stock
- Write a frontend controller decorator that deactivates the product if it's out of stock
The Javascript approach is very simple to implement. The first two options have the disadvantage that a product listing can contain less products than normal, e.g. 23 products instead of 24 on the first page, 24 on the second and so on. Which do you prefer?
That's good to hear that about the new simple admin interface. The next version will be able to cover all functionality and improves usability further
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: How to hide unique products in catalogue when they are s
Thanks for the info.
We will see which way to go.
One thing to improve usability further would be to make the column selection and sort direction in backend list views persitent. Every time the user leaves the shop interface additionally selected columns are gone - both in expert and simple.
We will see which way to go.
One thing to improve usability further would be to make the column selection and sort direction in backend list views persitent. Every time the user leaves the shop interface additionally selected columns are gone - both in expert and simple.
Re: How to hide unique products in catalogue when they are s
In the dev-master branch usability already has improved including the list view. Stay tuned for the 2017.10 version
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: How to hide unique products in catalogue when they are s
Hi, I use aimeos/laravel 2020.07 and have the same requestaimeos wrote: ↑14 Sep 2017, 17:05 The stock level data is loaded async via AJAX.
You have three options:
- Extend the Javascript method that's used to add the stock levels to hide those products
- Extend the catalog lists class where you retrieve the stock levels for the products and remove those that are out of stock
- Write a frontend controller decorator that deactivates the product if it's out of stock
The Javascript approach is very simple to implement. The first two options have the disadvantage that a product listing can contain less products than normal, e.g. 23 products instead of 24 on the first page, 24 on the second and so on. Which do you prefer?
That's good to hear that about the new simple admin interface. The next version will be able to cover all functionality and improves usability further
I want to show products with stock-level > 0 by default and just when customer select show products have stock option in filters show all of products.
can you please explain with code:
- how can I "Extend the catalog lists class where you retrieve the stock levels for the products and remove those that are out of stock"
and
- how can I "Write a frontend controller decorator that deactivates the product if it's out of stock"
Of course I know how extent components and controllers, just I want to know:
- how can I filter products with stock-level > 0
Re: How to hide unique products in catalogue when they are sold?
It's not available in 2020.10 but we've implemented this feature in the dev-master branch now:
- https://github.com/aimeos/aimeos-core/c ... 78bf85eca1
- https://github.com/aimeos/ai-controller ... e918408557
- https://github.com/aimeos/ai-client-htm ... 3377886364
The feature will be part of the 2021.x releases
- https://github.com/aimeos/aimeos-core/c ... 78bf85eca1
- https://github.com/aimeos/ai-controller ... e918408557
- https://github.com/aimeos/ai-client-htm ... 3377886364
The feature will be part of the 2021.x releases
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: How to hide unique products in catalogue when they are sold?
thank you very much for this, but:aimeos wrote: ↑07 Dec 2020, 11:02 It's not available in 2020.10 but we've implemented this feature in the dev-master branch now:
- https://github.com/aimeos/aimeos-core/c ... 78bf85eca1
- https://github.com/aimeos/ai-controller ... e918408557
- https://github.com/aimeos/ai-client-htm ... 3377886364
The feature will be part of the 2021.x releases
- I think you have mistake in https://github.com/aimeos/ai-client-htm ... d849e7R690 and that is we should change f_sort with f_stock
- I get an discoverable exception and check admin log and get this error:
Code: Select all
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'msto.prodid' in 'on clause':
with
Code: Select all
'internaldeps' => ['LEFT JOIN "mshop_stock" AS msto ON mpro."code" = msto."productcode"'],
Is the change I made on this line correct?
Please note that I use 2020.07 not 2020.10, Do I need to upgrade to 2020.10?
Re: How to hide unique products in catalogue when they are sold?
This is due to a different schema for mshop_stock in dev-master than in 2020.10.x. Your change is therefore correct.Ahmad wrote: ↑07 Dec 2020, 14:58 - I get an discoverable exception and check admin log and get this error:after that I change this line https://github.com/aimeos/aimeos-core/c ... b73c2f6R29Code: Select all
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'msto.prodid' in 'on clause':
withand the problem fixed and don't get this error anymore. I do this change because when I check mshop_stock table don't find column named prodidCode: Select all
'internaldeps' => ['LEFT JOIN "mshop_stock" AS msto ON mpro."code" = msto."productcode"'],
Is the change I made on this line correct?
Nevertheless, we've decided to revert the changes because it works with MySQL only - not with MariaDB, PostgreSQL and especially not with ElasticSearch and Solr. You can use the code for your own project but it won't be available in 2021.x due to the principle problems which arise with that feature.
Please also note that stock levels are highly volatile and you can't use caching for the catalog/lists component at all.
Yes, 2020.07 isn't supported any more, onle 2020.10 LTS.
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: How to hide unique products in catalogue when they are sold?
thanks a lot for your answers, I still have 2 problem with this:aimeos wrote: ↑08 Dec 2020, 09:35This is due to a different schema for mshop_stock in dev-master than in 2020.10.x. Your change is therefore correct.Ahmad wrote: ↑07 Dec 2020, 14:58 - I get an discoverable exception and check admin log and get this error:after that I change this line https://github.com/aimeos/aimeos-core/c ... b73c2f6R29Code: Select all
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'msto.prodid' in 'on clause':
withand the problem fixed and don't get this error anymore. I do this change because when I check mshop_stock table don't find column named prodidCode: Select all
'internaldeps' => ['LEFT JOIN "mshop_stock" AS msto ON mpro."code" = msto."productcode"'],
Is the change I made on this line correct?
Nevertheless, we've decided to revert the changes because it works with MySQL only - not with MariaDB, PostgreSQL and especially not with ElasticSearch and Solr. You can use the code for your own project but it won't be available in 2021.x due to the principle problems which arise with that feature.
Please also note that stock levels are highly volatile and you can't use caching for the catalog/lists component at all.
Yes, 2020.07 isn't supported any more, onle 2020.10 LTS.
- I change your code in the Controller/Frontend/Product/Standard.php file for own customize such a way that all of requests get products with stocklevel > 0, but the product counter in catalog/filter still include products with zero stocklevel, for example i have 2 products in category 1 which is one of them have stock level > 0 and another have stock level = 0, with my change when user is in the category 1 just see product with stock level > 0 in the list, but still in the catalog/filter shows there is 2 product in the category 1, how can I change to just show count of products with stock level > 0 in the catalog/filter?
- based on the above description, how can I remove products with stock level = 0 from catalog/filter search suggestions so that when user is typing just show (suggest) products with stock level > 0 in the s
Re: How to hide unique products in catalogue when they are sold?
For the Attribute, Supplier and Tree subpart (https://github.com/aimeos/ai-client-htm ... alog/Count), create own implementations and add this condition, e.g. here:
https://github.com/aimeos/ai-client-htm ... d.php#L252
https://github.com/aimeos/ai-controller ... hp#L53-L62
https://github.com/aimeos/ai-client-htm ... d.php#L252
Code: Select all
->compare( '>', 'stock.stocklevel', 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