What changes are planned for the “Addition to the Discount API to support complex conditions for BXGY and discount combination logic” listed in the Product Roadmap?
If a specific approach has already been decided, I would appreciate it if you could share that information.
Hey @ogasawarakyohei - generally we’re not able to share too much specifically about our internal roadmaps before release, but if you did have any concerns or suggestions, please feel free to share them here and I’d definitely be happy to look into this further for you to see if I can confirm what those plans will look like. Could you also tell me a bit more about what you’re trying to achieve with BXGY discounts or combination logic or if you’re concerned that some changes might potentially affect your integrations?
Thank you for your response, @Alan_G . I appreciate you taking the time to address my inquiry, and I completely understand the limitations around sharing specific roadmap details before official announcements.
I’d like to elaborate on my primary concern regarding BXGY discount functionality. Currently, my main challenge revolves around the handling of target product additions and quantity modifications within BXGY promotional scenarios. From my understanding, the existing BXGY discount system primarily focuses on the discount calculation and application aspect, but doesn’t inherently provide functionality for automatically managing the addition of qualifying products to the cart or adjusting their quantities.
This means that when we want to implement automatic product additions as part of a BXGY promotion (for example, automatically adding the “Y” products when “X” conditions are met), we need to handle this logic at the application level rather than relying on native platform functionality. While this approach works, it does create additional complexity in our integrations and requires custom development for what seems like it could be a core feature of comprehensive BXGY functionality.
I believe it would be tremendously valuable if the BXGY discount system could evolve to include native support for target product management alongside the existing discount application capabilities. This would streamline the implementation process and potentially reduce the need for custom workarounds in various integration scenarios.
I’d be interested to hear your thoughts on this perspective and whether this aligns with any considerations your team might have for enhancing the BXGY feature set.
No worries @ogasawarakyohei - definitely get where you’re coming from. Have you looked into potentially using Cart Transform Functions for this?
This would require using Shopify Bundles rather than discount codes/the general discount API, but it would essentially allow you to implement automatic product additions and to override prices, etc as needed based on logic you can implement on the Function’s side of things.
Let me know if this doesn’t work for you though and I’d be happy to escalate your feature request up to the product team for sure
Thank you for the suggestion, @Alan_G. I have thoroughly investigated Cart Transform Functions as a potential solution; however, several technical constraints prevent its implementation in our use case.
The primary limitation is the single-function restriction per store, which creates conflicts when multiple applications require this functionality. Additionally, the current architecture presents significant challenges for time-based promotional management, as the existing date/time handling capabilities within Functions are insufficient for our requirements to dynamically enable and disable various product combinations under different conditional parameters.
Regarding the difficulty of managing time-based promotion, the discussion in the following link may be helpful.
Hey @ogasawarakyohei thanks for clarifying here. You’re right, we do technically limit shops to one cart transform function per shop, however, my understanding is that there is a bit of an exception if you install multiple custom apps, each of those can register its own Cart Transform Function, so technically you can exceed the “one function” limit for a single store, but only if you’re creating custom apps (There’s a bit more info in the community thread here).
A couple of things to keep in mind though!
Using multiple custom apps can bypass the one-function limit, but each app demands its own OAuth flow, hosting, and permissions, and there’s no guarantee on the execution order of their functions, so results can be unpredictable (which is why we don’t usually recommend this). Our policy also does discourage splitting a single product into multiple single-purpose apps if you ever go public, so I did just want to mention that.
That said, I totally understand the need for native time based support. Just want to make sure I’m understanding this correctly here though. Would you be needing sub-functions to be running at once, and could you share roughly how many separate sub-functions you’d need running/whether their execution order must be deterministic? I’m also curious if a built-in “auto-add target product” feature inside Discount Functions would cover most of your use-case.
I can’t guarantee that this would be rolled out or when, but. I’m happy to do some more digging into this for you internally here just to make sure I’m understanding things correctly and I can keep this thread updated as soon as I have more concrete timelines.
Thanks again for all the context here, really appreciate it and hope to hear back from you soon
Hi @Alan_G thank you for the detailed clarification and for sharing the workaround regarding custom apps. While I appreciate the technical insight about bypassing the single-function limitation through multiple custom applications, this approach unfortunately cannot address our specific requirements since we are developing a public application.
Would you be needing sub-functions to be running at once, and could you share roughly how many separate sub-functions you’d need running/whether their execution order must be deterministic?
Regarding your inquiry about sub-functions and their concurrent execution, I believe you are referring to scenarios where the Cart Transform API is utilized for automatic addition of discount-eligible products. For our particular implementation, we maintain multiple datasets containing validity periods and various conditional parameters, which necessitate simultaneous execution of sub-functions. These sub-functions would need the capability to store relevant data within their respective metafields. We estimate requiring approximately 10-50 sub-functions to adequately support our use case, though the execution sequence need not follow a predetermined order.
I’m also curious if a built-in “auto-add target product” feature inside Discount Functions would cover most of your use-case.
If Discount Functions allows us to specify items and quantities to be added, and those items are automatically added to the cart, that would at least fulfill our use case!
I understand that concrete timelines cannot be guaranteed at this stage, but I greatly appreciate your willingness to investigate this matter internally. Please keep us informed of any developments, as this functionality would significantly enhance our ability to deliver robust promotional capabilities to our users.
Thanks for clarifying @ogasawarakyohei! My understanding is that we are actively exploring ways to expand Discount Functions so they can do more than just price adjustments. I can’t guarantee any specific functionality, but I’m going to check in with our product team to make sure I have the latest info and will update this thread even if there’s nothing I can confirm/share just yet. Happy to see if there is any info I can provide for sure!
Hey again @ogasawarakyohei - I was able to confirm that at the moment, we don’t support product replacements/adding via Functions, but it should be possible to do this using our AJAX API: About the Shopify Ajax API
The AJAX API isn’t the newest framework, but it is still currently supported, so I just wanted to share that as an option that might work for you.
I’ll pass along your use case as a feature request to our product team as well, definitely understand how having this implemented within Functions would be a great feature to support - let me know if I can help out with anything else, happy to help