Public Discount App for each variant

Solved

Public Discount App for each variant

devopskecg
Shopify Partner
2 0 0

I am working on the Dicsount Shopify Public.
The App a basically based where customers can add the different discount percentage for each variant of the product.
I want to mange this disocunt from App database.
-- I want to create the From in Shopify Admin where customers can Add and select the product, Variants, Product qauntity , Percentage etc and store these inputs in my APP Database.

-- Next step who instaled the app they can get the auto discount on the CART and CHECKOUT page based on the information which are stored in the 1st step.

 

Can anyone help me to doen this process?
I am looking forward from you.

Thanks.

Accepted Solution (1)

Kudosi-Tracy
Shopify Partner
853 103 375

This is an accepted solution.

Hello @devopskecg

What you’re describing is definitely doable, but it does involve building a custom solution that touches both the Shopify Admin and the storefront. Here’s a high-level breakdown of one approach:

  1. Build an Embedded Admin Form:

    • Use Shopify App Bridge and Polaris to create an embedded app interface within Shopify Admin.
    • In your form, let merchants select products, variants, quantities, discount percentages, etc.
    • Save these discount rules to your own app database.
  2. Apply Auto Discounts on the Storefront:

    • Once your discount rules are stored, you need a way to automatically apply them in the cart/checkout.
    • If you’re on Shopify Plus or using Shopify Functions (via discount extensions), you can implement a discount function that reads your rules and applies the appropriate discount.
    • Alternatively, you might inject a discount code (if auto-application isn’t supported) via custom scripts or an app proxy that calls your backend to fetch the right discount.
  3. Integration & Testing:

    • Make sure your embedded form is well integrated (using Shopify’s recommended UI frameworks) so that merchants can easily manage discounts.
    • Test thoroughly to ensure that the auto discount logic correctly applies the discount based on the cart contents.

This approach lets you manage discount rules from your app’s admin side while seamlessly applying them during checkout, without relying on manual discount codes.

Hope that gives you a clear roadmap! Let me know if you have more questions or need further details on any step.

 

Best,
Tracy from Kudosi Reviews

- Was my answer helpful? Please hit Like or Mark it as solution!
- Kudosi Product Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!

View solution in original post

Replies 2 (2)

Kudosi-Tracy
Shopify Partner
853 103 375

This is an accepted solution.

Hello @devopskecg

What you’re describing is definitely doable, but it does involve building a custom solution that touches both the Shopify Admin and the storefront. Here’s a high-level breakdown of one approach:

  1. Build an Embedded Admin Form:

    • Use Shopify App Bridge and Polaris to create an embedded app interface within Shopify Admin.
    • In your form, let merchants select products, variants, quantities, discount percentages, etc.
    • Save these discount rules to your own app database.
  2. Apply Auto Discounts on the Storefront:

    • Once your discount rules are stored, you need a way to automatically apply them in the cart/checkout.
    • If you’re on Shopify Plus or using Shopify Functions (via discount extensions), you can implement a discount function that reads your rules and applies the appropriate discount.
    • Alternatively, you might inject a discount code (if auto-application isn’t supported) via custom scripts or an app proxy that calls your backend to fetch the right discount.
  3. Integration & Testing:

    • Make sure your embedded form is well integrated (using Shopify’s recommended UI frameworks) so that merchants can easily manage discounts.
    • Test thoroughly to ensure that the auto discount logic correctly applies the discount based on the cart contents.

This approach lets you manage discount rules from your app’s admin side while seamlessly applying them during checkout, without relying on manual discount codes.

Hope that gives you a clear roadmap! Let me know if you have more questions or need further details on any step.

 

Best,
Tracy from Kudosi Reviews

- Was my answer helpful? Please hit Like or Mark it as solution!
- Kudosi Product Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!
devopskecg
Shopify Partner
2 0 0

Hi @Kudosi-Tracy ,
Thanks for you reply.
I really appreciate to understand my requirements.
But I want to publish this APP on shopify Store so merchants can use this app for to assign the Percentage discount and Fixed discount for products variants. So App should be works for all the Accounts owners not only Plus accounts.

Can you please send me a DOC and help me to done my app functionality?
I am working with this DOC: https://shopify.dev/docs/apps/build/discounts/build-discount-function?extension=javascript#replace-t...

And please let me know how we can inject our Stored discounts on the Cart and checkout page?

I am looking forward from you.

Thanks.