I am new with nop commerce, and we are planning to migrate our business in nop commerce.
I want to add one Drop Down selection of order type, and when a customer clicks on add to cart button, then the customer needs to select any one value compulsory from the drop-down and I want to pass this in the cart and need to store in database as well. So I can check this order type value in the admin side as well.
Can someone help me with how to do this?
I have created one component (Plugin) which provides order type, but I don't know how to validate this and how to store this in Database as well.
I know how to configure attributes and how to validate them.
We have created one plugin in which we bind dropdown which contains 'RX', 'S0', and 'ST', and this all value binds into dropdown as per customer roles.
So from the plugin I want to validate and want to store into the database.
If you use the built-in product attributes, then it will automatically "store into the database". On the other hand, if you created a widget using custom dropdown, then you will need to customize how you attach the info to the cart item.
Okay, let's go with Product Attributes. Can you give us some ideas on how to bind product attributes conditionally on the product page as per the below example?
Example: Order Type Contain thee values RX, SO, and ST.
For some customers, we want to display on RX and ST. For some customers, we want to display on SO and ST. For some customers, we want to display only ST.
To do that type of logic based on customer role (or similar) would require customization. You can probably use an Action Filter to remove items from the dropdown (model).