0

My problem: I am using WooCommerce. And I want each user to be able to define an extra attribute for the products. This attribute will be used to calculate the price of the product. I already have the function to recalculate the price according to other parameters. But now, I wanted to obtain the value that the user-defined or not for a given product.

For example, I have the products: A, B, C, and D. And, the user defines on his profile page that product A has a value of 10, and product C has a value of 15.

How can I add two fields to the profile page, choose the product (or enter the ID) and another to define the respective value? These sets of inputs are dynamic. The user can add more sets depending on whether he wants to add more values for other products.

This image has been manipulated. I intended to build a similar result where I could define several "user meta" with key (product ID) and value (defined by each user on his page). example on profile page

Or is that another suggestion to solve my problem ?! I looked for solutions so that each user could define a custom attribute in the product, but I found nothing.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.