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.
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, one to 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).
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.