Add to Cart a Custom Price Product

Hi Everyone,
I built a page where the customer can buy wood panels and choose the dimensions with 2 Text Inputs (length and width) and 4 Options. With Wix Code, I calculated the final price according to the customer’s choices. Now, I want to add this product (with the price I calculated) in the Cart when the customer click on the “Add to Cart button”.

I thought of 2 “ways” to achieve this goal :


 1) When someone order the product and click on the "Add to cart" button, it programmatically creates a new product in the "Product Database" with parameters that the customer have chosen. However, I cannot find information on the internet to code that. 

 2) Create one product in the "Product Database" and programmatically change it's "parameters" (price, name, ...) every time someone order this product. I managed to find the parameters of the product but I can't programmatically change them. 


Does anyone know a way or have a clue to code the first or/and the second “solution” ?
Thanks in advance.

1 Like

i want to achieve same thing in my website . Have you find any solution. if yes, please share the code

Hi @bastien-ges ! I want to achieve something similar to what you post here.

Did you find any solution to this kind of problem?

Thanks!

Same thing here! Anyone with a solution??

Hi!

I found this article, and I think this is the solution!
https://support.wix.com/en/article/corvid-tutorial-adding-a-product-configurator-to-a-wix-stores-site

@Bastien, did you ever figure out how to add your new calculated price to the cart? If so, would you be willing to share how you did it?

I think I found a workaround. My way is: Just use corvid to Create an entire new product every time, with the custom price. Then, add that product to the cart.

Yes, you would be accumulating a large amount of products in the catalog, but if you use categories, you can filter those so you never display them in a page.

1 Like

Great. I did this and it worked. Thank you. I assume I can simply delete the newly created products from my store from time to time to purge those products. Not ideal but it works.

Actually, we could progamatically delete old products. Check this out!