Troubleshooting
This page covers the most common issues merchants encounter with Alfo - Functions and provides step-by-step resolution guidance. Each issue includes a debug checklist to help you identify the root cause.
1. Discount Not Applying at Checkout
The discount is configured in the rule builder but does not appear when a customer reaches checkout.
Debug Checklist
- Is the discount enabled? Open the discount in Shopify Admin and confirm it is active, not in draft or paused state.
- Is the rule group enabled? Check that the
enabledfield on the rule group is set totrue. A disabled rule group is skipped during evaluation. - Is the correct discount class enabled? If you are expecting a product discount, verify the target is set to
product. If you are expecting an order discount, verify the target is set toorder. A mismatch between the configured class and the expected behavior is a common cause. - Are all conditions being met? Walk through each condition in the rule group and verify that the test cart and customer actually satisfy every requirement. Pay close attention to:
- Customer tag spelling (case-sensitive)
- Cart subtotal thresholds (is the cart value before or after taxes?)
- Product tags and collection membership on the actual items in the cart
- What is the strategy? If the strategy is
"first"and a higher-priority rule group is matching first, the lower-priority group will never fire. Check rule group ordering. - Are
combinesWithsettings correct? If another discount is already applied to the order, Shopify may block this discount based on thecombinesWithconfiguration. Check whether the discount is allowed to combine with other active discounts. - Is a rejection rule blocking the discount? If the discount is code-based, check the rejection rules of your automatic Alfo discounts and whether their conditions match the current cart/customer state. Rejection rules work only on an automatic Alfo discount, so the rejection rules of an Alfo code discount reject nothing.
- Is the discount function installed? Navigate to Shopify Admin > Settings > Apps and sales channels > Alfo - Discount Functions and confirm the app and its functions are installed. The Shopify admin lists the Alfo app under this name.
2. Wrong Items Getting Discounted
The discount is applying, but it is being applied to items that should not receive the discount (or missing items that should).
Debug Checklist
- Check the target scope. If the scope is
"all", the discount applies to every item in the cart, regardless of product-level conditions. If you want only matching items to be discounted, set the scope to"filtered". - Review product-level conditions. Verify that the
productTag,collection,product, orproductVariantconditions accurately match the items you intend to target:- Are the tags spelled correctly and assigned to the right products in Shopify?
- Are the collection IDs correct? Collection IDs use the format
gid://shopify/Collection/123. - Are the products actually in the collections you are referencing?
- Check item filters (BXGY and Bundle). For BXGY and Bundle functions, verify the
buyItemFilter,getItemFilter, orbundleItemsfilters are targeting the correct products or collections. - Verify condition logic. If using OR logic, remember that any single condition passing makes the entire rule group apply. Product-level conditions under OR logic may produce broader matches than expected.
- Check for gift card exclusions. Alfo’s discount functions never discount gift cards, so a gift card line gets no discount whatever your conditions are.
3. Discount Code Rejected Unexpectedly
A customer enters a valid discount code but receives a rejection message at checkout.
Debug Checklist
- Check rejection rules. Open each automatic Alfo discount and review its
rejectionRulesarray. A rejection rule fires when its conditions match the current cart and customer state. If the customer does not meet the rejection rule’s conditions, the rejection should not fire. - Review rejection rule conditions. Walk through each condition in the rejection rule:
- Is the
customerTagcondition usinghasNonewhen it should usehasAny, or vice versa? - Are the tag values spelled correctly?
- Does the customer actually have (or lack) the required tags in Shopify?
- Is the
- Check the rejection message. The message shown to the customer comes from the
messagefield in the rejection rule. A rule with no message shows “Discount code not applicable.” If the customer saw that text, look for a rejection rule with no message. - Find the discount that holds the rule. The rule that rejected the code is on an automatic Alfo discount, not on the discount of the code. Check the rejection rules of each active automatic Alfo discount.
- Check
combinesWithsettings. If another discount is already applied, Shopify may reject the code at the platform level before the function even evaluates it.
4. Shipping Discount Not Working
A shipping discount is configured but delivery options are not being discounted at checkout.
Debug Checklist
- Verify the target class. The discount target must be set to
shipping, notproductororder. Check thetargetsfield in the configuration. - Check the shipping scope. The scope should be
"all"to discount all delivery options. If the scope is more restrictive, verify it matches the available shipping methods. - Confirm the discount class is enabled. When creating the discount in Shopify Admin, the Shipping discount class must be selected. Even if the JSON configuration targets shipping, the discount class must be enabled at the Shopify level.
- Review conditions. Conditional and Volume & Tiered shipping discounts check only cart-level conditions. Product-level conditions (like
productTagorcollection) have no effect on their shipping discount. The Buy X Get Y and Bundle shipping discounts also need enough matching items in the cart: a complete bundle, or enough items for at least one get item. Product-level conditions decide which lines count toward that bundle or set. - Check Shopify’s shipping settings. Some Shopify shipping configurations may not be compatible with discount functions. Verify that your shipping rates are set up correctly in Shopify Admin > Settings > Shipping and delivery.
- Test in checkout with a different country. If using a
marketcondition, the shipping discount depends on the buyer’s country code. In checkout, change the country to one that the condition allows and check that the result changes.
5. Volume & Tiered Discount Showing Wrong Tier
The tiered discount is applying, but the wrong tier level is being used (e.g., tier 1 is applied when tier 2 should be).
Debug Checklist
- Verify threshold values. Review the
tiersarray and confirm the threshold values match your expectations:- Tier 1: threshold 3 (3+ items)
- Tier 2: threshold 6 (6+ items)
- Tier 3: threshold 10 (10+ items)
- Check tier resolution order. The Volume & Tiered function resolves tiers from highest to lowest. With the default Highest tier reached calculation, the highest qualifying tier always wins. If the customer has 8 items and tiers are at 3, 6, and 10, the function applies tier 2 (threshold 6) because 8 >= 6 but 8 < 10.
- Check the tier calculation. With Tier calculation set to Incremental, the tiers add up on the order subtotal. Each higher tier adds its percentage of only the amount above its own threshold. Below the lowest tier, the cart gets no discount.
- Verify the tier type. Check the
tierTypefield:"cartQuantity"(number of items in the cart),"cartSubtotal"(cart value), or"lineQuantity"(number of items on each line). A quantity-based tier with a threshold of 100 means 100 items, not $100. - Check what the threshold counts. The
cartQuantityandcartSubtotalmetrics count every line in the cart, gift cards included. Conditions, the product scope, and exclusions decide which lines get the discount. They do not change the count. - Count items correctly. The quantity count includes the
quantityfield on each cart line. A single line for “T-Shirt x 3” counts as 3 items, not 1.
6. Bundle Discount Not Triggering
All bundle components appear to be in the cart, but the bundle discount is not applying.
Debug Checklist
- Verify all components are present. Check the
bundleItemsarray and confirm each component has at least the required quantity in the cart:- Is the product in the correct collection?
- Is the product tag spelled correctly?
- Does the cart contain the required quantity for each component?
- Check component filters. Each bundle component has a
filterfield. Verify thefilterTypeand the filter values (collection IDs, product tags, etc.) match the actual products in the cart. - Verify collection IDs. Collection IDs must use the full Shopify GID format:
gid://shopify/Collection/123. A mismatched or stale collection ID will cause the component to never match. - Check for overlapping components. If two bundle components reference the same collection or tag, a single product can match both. Each unit fills one component slot only, so the cart needs enough units for every slot. For a bundle of 2 items from Collection A and 1 from Collection B, a product in both collections needs 3 units in the cart.
- Confirm your plan includes Bundle. The Bundle Discount editor requires the Enterprise plan. On a lower plan, the Bundle editor shows an upgrade message, so you cannot set up the rules.
7. BXGY Giving Too Many or Too Few Free Items
The Buy X Get Y promotion is applying, but the number of free (or discounted) items is not what you expected.
Debug Checklist
- Check
buyQuantityandgetQuantity. These fields define the ratio.buyQuantity: 2andgetQuantity: 1means “for every 2 items bought, 1 item is discounted.” Verify these values match your intended promotion. - Check
maxSets. ThemaxSetsfield limits how many complete sets of the promotion can apply per cart. IfmaxSetsis 1, only one set of buy/get is applied even if the customer has enough items for multiple sets. If you want unlimited sets, setmaxSetsto 0 or omit it. - Verify buy and get filters. The
buyItemFilterandgetItemFiltercontrol which items qualify as “buy” items and which qualify as “get” items. If the filters are too narrow, there may not be enough qualifying items to form a complete set. - Check the get item selection order. By default, the BXGY function discounts the cheapest qualifying get items first. To discount the most expensive items first, set Get item selection order to Most expensive items first (
itemSelectionOrder: "mostExpensiveFirst"). - Count qualifying items. A unit counts as a buy item or as a get item, never as both. For one free item, the cart needs
buyQuantitybuy items plus one more qualifying item. For “Buy 2 Get 1 Free”, the customer needs at least 3 qualifying items. For “Buy 2 Get 2”, 3 items give 1 free item and 4 items give 2.
8. Discount Amount Seems Wrong
The discount is applying, but the dollar amount or percentage does not match your expectations.
Debug Checklist
- Verify the discount type. Check whether the discount is set to
"percentage","fixedAmount", or"fixedPrice"."percentage"reduces the price by a percentage (e.g., 20 means 20% off)."fixedAmount"reduces the price by a fixed dollar amount (e.g., 10 means $10 off). - Check
applies_to_each_itembehavior. For product-class discounts withfixedAmount, the fixed amount is applied per qualifying line, not as a total across all lines. If 3 items qualify and the fixed amount is $10, the total discount is $30 ($10 per item), not $10 total. - Review the target scope. If the scope is
"all"and you expected only filtered items to be discounted, the discount is being applied more broadly than intended. - Check for multiple matching rule groups. If the strategy is
"all", several rule groups can make discounts. Their product discounts add up only when Product discount stacking is set to Apply all matching discounts. By default, Shopify keeps only the highest product discount. Order discounts of one discount never stack. See Selection Strategies for two exceptions. - Verify no rounding issues. Percentage discounts on prices with cents may produce rounding differences. Shopify handles rounding according to the store’s currency settings.
- Check for stacking with other discounts. If
combinesWithallows stacking, another discount function or native Shopify discount may be contributing to the total discount amount. Review all active discounts on the order.
General Debugging Tips
Inspect the Configuration JSON
The rule builder UI generates a JSON configuration stored in a metafield. You can view this JSON by inspecting the metafield value directly. This helps you verify that the UI settings produced the expected configuration.
Test with a Minimal Cart
When debugging, simplify your test cart to the bare minimum needed to trigger (or not trigger) the discount. This eliminates variables and makes it easier to pinpoint the issue.
Check One Condition at a Time
If a rule group has multiple conditions, temporarily remove all but one to confirm each condition works independently. Then add them back one at a time to find the failing condition.
Review the Discount in Shopify Admin
Some settings (like combinesWith, discount class selection, and activation method) are configured at the Shopify discount level, not within the Alfo rule builder. Always check both the rule builder configuration and the Shopify Admin discount settings.
Verify Product Data in Shopify
Conditions that reference product tags, collections, or variants depend on the data being correct in Shopify. If a product tag was recently added or a product was recently moved to a new collection, there may be a propagation delay.
Next Steps
| Page | What it covers |
|---|---|
| FAQ | Answers to common questions about the app. |
| Best Practices | Tips for configuring discounts to avoid common pitfalls. |
| Conditions Overview | Full reference for all 16 condition types. |