Product Donations
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: Product Donations
Hello!
I have sent you the error as a private message,
Regards,
I have sent you the error as a private message,
Regards,
Re: Product Donations
Hello Aimeos,
I checked in detail the error and made several tests. The issue occurs because the getCatalogIds function returns an empty array. I checked the configuration of the category and had it configured with the state: "hidden", apparently this function does not take into account the categories that have this state.
To avoid generating an error in the frontend, it might be a good idea to verify that the $treeCatalogIds variable that contains the array is not empty to avoid generating a MariaDB/MySQL error.
Best regards!
I checked in detail the error and made several tests. The issue occurs because the getCatalogIds function returns an empty array. I checked the configuration of the category and had it configured with the state: "hidden", apparently this function does not take into account the categories that have this state.
To avoid generating an error in the frontend, it might be a good idea to verify that the $treeCatalogIds variable that contains the array is not empty to avoid generating a MariaDB/MySQL error.
Best regards!
- Attachments
-
- query
- get catalog id by code.png (69.24 KiB) Viewed 4335 times
-
- getCatalogIds return empty array
- query-error-laravel-aimeos.png (18.62 KiB) Viewed 4335 times
Re: Product Donations
I was analyzing, and as in this part the products will be donated, then the customers should not set the delivery address in the checkout process.
Is there any way you recommend to hide the delivery address form?
One option I can think of is to create a page where you list the products that can be donated. When the user enters that page, a cookie or a value will be saved in the localstorage, if the customer goes immediately to the checkout (after adding products to the cart), in step 2 of the checkout, check if there is a cookie called for example "from_donation". If the cookie exists, then hide the delivery address form, otherwise show it.
What do you think of this approach?
Thank you very much for your help,
Regards!
Is there any way you recommend to hide the delivery address form?
One option I can think of is to create a page where you list the products that can be donated. When the user enters that page, a cookie or a value will be saved in the localstorage, if the customer goes immediately to the checkout (after adding products to the cart), in step 2 of the checkout, check if there is a cookie called for example "from_donation". If the cookie exists, then hide the delivery address form, otherwise show it.
What do you think of this approach?
Thank you very much for your help,
Regards!
Re: Product Donations
The used "->filter(true)" statement adds "status > 0" to the filter and hidden has a value of "2" so that should not be the problem. Can you check if the configured category codes are different from the used ones in the mshop_catalog table?peter69 wrote: ↑31 Jan 2023, 04:40 I checked in detail the error and made several tests. The issue occurs because the getCatalogIds function returns an empty array. I checked the configuration of the category and had it configured with the state: "hidden", apparently this function does not take into account the categories that have this state.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Product Donations
You could write a decorator for the address part of the checkout/standard component which removes the existing delivery addresses from the view and sets the config to disable new delivery addresses if all products in the basket are donations.
If the basket contains mixed products (donations and non-donations), you should show the delivery addresses nevertheless.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Product Donations
I have checked the table and they have the correct code configured. I checked the filter and filterBase function and I see that when you pass true, it will only take into account the state: 1.aimeos wrote: ↑01 Feb 2023, 09:21The used "->filter(true)" statement adds "status > 0" to the filter and hidden has a value of "2" so that should not be the problem. Can you check if the configured category codes are different from the used ones in the mshop_catalog table?peter69 wrote: ↑31 Jan 2023, 04:40 I checked in detail the error and made several tests. The issue occurs because the getCatalogIds function returns an empty array. I checked the configuration of the category and had it configured with the state: "hidden", apparently this function does not take into account the categories that have this state.
You can see it in the screenshots.
- Attachments
-
- screenshot---.png (41.2 KiB) Viewed 4308 times
-
- screenshot--.png (35.46 KiB) Viewed 4308 times
-
- screenshot-.png (54.3 KiB) Viewed 4308 times
Re: Product Donations
I will try it!aimeos wrote: ↑01 Feb 2023, 09:23You could write a decorator for the address part of the checkout/standard component which removes the existing delivery addresses from the view and sets the config to disable new delivery addresses if all products in the basket are donations.
If the basket contains mixed products (donations and non-donations), you should show the delivery addresses nevertheless.
Thank you so much for your recommendations!!!
Re: Product Donations
OK, this means we need to change:
Code: Select all
filter( true) -> filter( null )
Code: Select all
composer req aimeos/aimeos-core:2022.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,

Re: Product Donations
I will update it!
Thank so much!!!
Thank so much!!!