简体   繁体   中英

Magento 2 add custom option in cart without create

I have one virtual product in my backend. The flow is like user can purchase this product with different dynamic option. But I can not add that option in backend as custom option as those option is dynamic.

I want to add this product to cart with that option without create custom option in is it possible ?

For Example :

I have one virtual product that is Tour Package. User can purchase that package but with different duration and price and type. Tour type is dynamic admin can add this from backend. Tour type like golder, silver etc.

Duration is like 1 week, 2 week, 1 month this duration is also dynamic admin can add duration while create tour type.

Now I displayed this tour type in front-end page and added button to add to cart with that virtual product.

Now the issue is that if user purchase Gold tour then I want to pass "Gold" as addition option in cart. and if user select other tour at same time then that product should add to cart individually.

Please give me any solution.

David, you can do it via Admin panel of Magento 2. Go to Catalog > Add product. Choose Virtual product. Then edit it and add all information you need (such as name, price, category, etc). Once you are done with this settings scroll down to Configuration. At step 1 you should create and choose needed attributes, at step 2 you should select values from each attribute. You should go through all the steps and save them. Then put price and quantity. We prepared some screenshots for you to help in this process. 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM