How to create a direct-to-cart button on a single-product site?

How to create a direct-to-cart button on a single-product site?

SPJVR
Excursionist
17 1 3

Hello!

I sell a product (service) on my Shopify page and would like to create a button similar to the buy button, but instead of going directly to the checkout, I want to go directly to my cart with this one product in it. So I want the button to add the product to my cart and take me to the cart. Once in the cart, the user will need to select the date and time for the service (this is done using the Supertime delivery date picker).

 

Where do I make the changes for this in the code? Does anyone have a snippet that I can grab right away but just replace with my one product?

 

follow-up question, since I only sell one product (service) and you can only buy one at a time, can I limit the cart so that you can only have one of this product? I have noticed that when you add a product and do not complete the purchase and later come back to make a new purchase, the previous product is still there and the customer may have accidentally placed an order for two instead of one.

 

Thanks!

Replies 3 (3)

Guleria
Shopify Partner
4083 801 1154

Hello @SPJVR ,

All possible but not without the customization.
I suggest hire an expert to do it. 

Thanks
 

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
SPJVR
Excursionist
17 1 3

Hi @Guleria 

 

Thanks for your response!

I am fine with doing customization myself, I just need to be pointed in the right direction, do I really need an expert for this?

I can create a button with functionality to add the product to my cart (Embed on a website), with the generated code there should be a (customized) function to open the cart page after the product have been added to the cart, or am I simplifying something complicated?

Guleria
Shopify Partner
4083 801 1154

 

If you are good with code then its simple for you. 
Steps which I think you have to follow:
1) On click of you custom button add product to cart and redirect user to cart page.
You can find this code in your theme just make sure to remove ajax classes. 


2) Every time when page reload check Is same product is already exist in the cart, If yes disable custom atc button else allow user to add it in this custom can't purchase 2 at a time.

3) Make the checkout button hidden until the user will not select day/time with Supertime delivery date picker, or you can add JS validation so the user can't checkout without selecting day/time.   

Thanks

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder