skip to Main Content

I have Shopify Store, where customer can design/customise their product before buying it. and based on the design / customisation price of the selected variant may get varied. but I think Shopify does not facilitate to change variant price dynamically while adding into cart.

Is any solution there I might be missing ? Any help will be appreciated.

2

Answers


  1. There are a few solutions none of which are great.

    Quantity based

    Make the product price $1 and based on the options increase the quantity in order to meet the required price. With a little code you can change the cart to look like it’s a single product, but the checkout will not be OK.

    Variant based

    If the product will have only a few price changes you can create different variants and change the variants based on the selected options. For example 10 different variants for 10 different prices.

    App based

    You can use an App such as https://apps.shopify.com/product-options to create options that can modify the product price. ( this will add dummy products to the checkout as well )

    Login or Signup to reply.
  2. For Plus, you can use shopify script to edit the line items directly.

    If you’re not Plus users, you have to do it on server-side, i.e. your backend

    1. submit an ajax request on your custom product page
    2. backend receives the request. Use admin API to create a new product variant on the fly
    3. set the variant price, weight, quantity, or other properties based on your business rules
    4. return response to client
    5. client receives a successful response. use cart ajax to add the new variant to cart
    6. let client continue checkout

    Upon order is made, use webhook to update inventory or other information required. But there is a problem regarding variant limit. For each product, you can only add 100 variants.

    So you need to create new products when the variant is used up for the product. Alternatively, you can delete the existing variants. But the variants in customer carts will be cleared.

    I am doing something similar to what you’re doing so I think our approach will be more or less the same. Basically, there are only 2 solutions, either create a new product or new discount dynamically. Both approaches create many dummy/garbage data

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search