Accepting credit cards, warehouses, and shipping and fulfilling orders
Solved! Go to the solution
This is an accepted solution.
Hey Rohit, its not possible to do this entirely from the frontend. You will need to setup a serverless backend to handle this use case. Basically, the backend here will be responsible for creating a line item in the cart with the entered price.
This is how it would work.
You will need to create a product and set the price to 0.
Create a new template just for this product and assign it to the product created in the previous step.
Create a new section to render the important information about the product along with the price input field.
Add this section to the template created previously.
Setup click listener for the 'Add to Cart' button which, after performing some basic input validation, will send out a request to the serverless backend with all the required information such as the product ID, the price etc.
The backend will fire a mutation using the Admin API and create a product with the custom price. It will also add it to the cart.
Once done, you will send a response to the frontend indicating that the process was successful.
In the frontend, you can then proceed to the cart or the checkout pages.
I hope it gives you an idea of how it can work.
Hi there!
Yes, it’s absolutely possible to implement a feature like this on Shopify! While it does involve a bit of customization, it’s definitely achievable with some tweaks to your product page and the right setup to handle custom pricing. Apps can be helpful too, but for something as tailored as this, custom coding might be the perfect fit.
If this sounds like something you’d like to explore, I’d be thrilled to help you bring it to life! Let’s make your store even more dynamic and engaging for your customers. Feel free to reach out to me at marvellous.digital.solutions@gmail.com—I’d love to discuss your ideas and get this set up for you.
Looking forward to hearing from you and helping your vision come to life!
I don't want to create an app. I want to know if it's possible for this to work just by adding the code in the admin section of my store?
This is an accepted solution.
Hey Rohit, its not possible to do this entirely from the frontend. You will need to setup a serverless backend to handle this use case. Basically, the backend here will be responsible for creating a line item in the cart with the entered price.
This is how it would work.
You will need to create a product and set the price to 0.
Create a new template just for this product and assign it to the product created in the previous step.
Create a new section to render the important information about the product along with the price input field.
Add this section to the template created previously.
Setup click listener for the 'Add to Cart' button which, after performing some basic input validation, will send out a request to the serverless backend with all the required information such as the product ID, the price etc.
The backend will fire a mutation using the Admin API and create a product with the custom price. It will also add it to the cart.
Once done, you will send a response to the frontend indicating that the process was successful.
In the frontend, you can then proceed to the cart or the checkout pages.
I hope it gives you an idea of how it can work.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025