Adding optional fees to products.

HadiS
New Member
4 0 0

Hello everyone,

I'm trying to build a Shopify store which interacts with a custom app. Many products on this store should have many options such as "add extra message for 2.99". I've been able to add all the options to cart using line item properties, but these don't add a price. I don't have the option to use an app from the store for this. I want to know how to implement optional choices on a product page, which adds fees to the cart. So that customers can purchase optional add-ons. These options are separate from existing variants for the customer to choose from. An app is not usable because I add products to my store with a custom app I made, which doesn't interact with apps from the app store. 

I've searched everywhere but I can't seem to find a solution. There are apps that do it, so this is definitely possible. If anyone knows where I can start, or point me in the right direction, it would be much appreciated. 

0 Likes
satsinghrana
Shopify Partner
147 13 22

Hello @HadiS 

 

Check this one: https://productoptions.hulkapps.store/products/t-shirt

You can find the way how they are adding the product  price according to the custom selections by observing the functionality.

I believe if you have build a custom app yourself then its easy for you to understand the flow they are following for this.

Good Luck!

If helpful then please Like and Accept Solution
Hire for Custom Shopify Solutions, Apps development or Any kind of Web development work.
Contact : satsinghrana1@gmail.com
See our Shopify Apps: HERE
0 Likes
HadiS
New Member
4 0 0

Yes this is what I'm trying to achieve with my own shop and code. But unfortunately I can't deduce how it's been done from the view itself. I can only see that the options are added as line item properties, which I know how to do. Problem is that I can't add a price to line item properties. So I assume they modified the cart page to change the price based on the line items and also modify the eventual checkout price? Is modifying the checkout price from cart page even possible without Shopify Plus?

 

0 Likes
satsinghrana
Shopify Partner
147 13 22

No it's not possible to edit the checkout without Shopify Plus, And the are adding an extra product(Contains the selected option and price) along side the original ordered product. This is how they managed to increase the price. Involved good amount of work behind this. 

If helpful then please Like and Accept Solution
Hire for Custom Shopify Solutions, Apps development or Any kind of Web development work.
Contact : satsinghrana1@gmail.com
See our Shopify Apps: HERE
0 Likes
HadiS
New Member
4 0 0

I'm pretty sure they aren't adding an extra product. The options appear under the same product in the cart. So cart_data[cart][0][properties] is how line item properties are displayed. As additional data attached to the entries in the cart, not standalone products. The price stated here in the properties is just for their calculation I believe. The total price of the cart as seen on cart_data[cart][total_price] remains 20 dollars, the regular product price. So I guess the price display is just adjusted through liquid code. I believe I would be able to change my cart page's liquid code to make this happen too, but this is purely visual. How am I supposed to actually add the extra option to the price if I can't adjust checkout? Screen Shot 2021-04-28 at 10.36.53 AM.png

Screen Shot 2021-04-28 at 10.33.07 AM.png

0 Likes
satsinghrana
Shopify Partner
147 13 22

Have a look on their checkout, you will see the product there.

If helpful then please Like and Accept Solution
Hire for Custom Shopify Solutions, Apps development or Any kind of Web development work.
Contact : satsinghrana1@gmail.com
See our Shopify Apps: HERE
0 Likes
HadiS
New Member
4 0 0

From what I gather, they display the options as a seperate product but when they use the create_draft_order call they add 1 product only. I tried this app on my own shop to see how it works. I do indeed see 2 products in my admin's order view, but not in the calls made during checkout. From what I gather, they manipulate the discount field to increase the price? So instead of a typical discount which reduces, they just add to it. At least I get the approach, I understand that changing the price through discount would solve my problem. Another question I have, which I couldn't find out is how they made an extra product for the final order based on the line item properties, this wasn't seen in the calls. I assume it is done with code, which I naturally can't see.

But this is all during checkout? So without Shopify Plus, am I just at a dead end?

Any idea how I can then manipulate the price with discount outside of the checkout based on customer choices? Storefront, GraphQL APIs? Thank you so much for your patience and help.

 

Screen Shot 2021-04-28 at 11.12.34 AM.png

0 Likes
satsinghrana
Shopify Partner
147 13 22

Possible they create products when we create any option, I have not reviewed it deeply but got some idea by observing the things how the app works, and what could be the possibility to do such things. Just assuming

I love to dig the things to find out how stuff works.

If helpful then please Like and Accept Solution
Hire for Custom Shopify Solutions, Apps development or Any kind of Web development work.
Contact : satsinghrana1@gmail.com
See our Shopify Apps: HERE
0 Likes