Best method for adding selection error message?

How to configure and adapt Aimeos based shops as developer
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!
bpqr
Posts: 1
Joined: 09 Mar 2024, 18:34

Best method for adding selection error message?

Post by bpqr » 09 Mar 2024, 18:38

Laravel 10, Berlin Theme

We have begun to move products from Magento into Aimeos. One area we want to customize is the error message displayed when a product is attempted to add to cart without selecting one of the radio buttons for size/color. Presently it appears to just change the color of the selection text to --ai-danger.

Is there a generally accepted method for enhancing this? Ideally something to make it clear to customers that they need to select an option, instead of simply changing the color to --ai-alert CSS value. Before we started working on adapting this, I figured we'd see what was recommended.

All around impressed with the code and performance.

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Best method for adding selection error message?

Post by aimeos » 11 Mar 2024, 12:58

Add the error messages where they should appear in the template and hide them by default by adding "display:none" in the CSS file for those messages. If one of the message (or several) should be shown, add a CSS class (which contains "display:block") to the messages by Javascript. You can the JS code to add/remove the CSS class for the error messages here:
https://github.com/aimeos/ai-client-htm ... #L272-L612
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply