1

I'm running into an odd issue with CartThrob's gift certificates that doesn't seem to be turning up any google results, so I'm hoping someone can help point out what I'm doing wrong or share if they've run into the same issue.

In my shopping cart (and my checkout page, but they're both displaying the same chunk of code so we'll stick with this one) I have the following chunk of code showing order totals & associated information:

{exp:cartthrob:cart_info}
    <span class="label">Subtotal:</span>
    <span class="amount">{cart_subtotal}</span>
    {if "{cart_shipping}" != "$0.00"}
        <span class="label">Standard Shipping:</span>
        <span class="amount">{cart_shipping}</span>
    {/if}
    {if "{cart_discount}" != "$0.00"}
        <span class ="label">Discounts:</span>
        <span class="amount">-{cart_discount}</span>
    {/if}
    {if "{exp:cartthrob_gift_certificates:applied}" != "$0.00"}
        <span class="label">Gift Certificates:</span>
        <span class="amount">-{exp:cartthrob_gift_certificates:applied}</span>
    {/if}
    {if "{cart_tax}" != "$0.00"}
        <span class ="label">Estimated Tax:</span>
        <span class="amount">{cart_tax}</span>
    {/if}
    <span class ="label total">Total:</span>
    <span class="amount total">{exp:cartthrob_gift_certificates:cart_total_minus_gift_certificates}</span>
{/exp:cartthrob:cart_info}

For my example cart, which has no tax and no discounts, and for which I have not applied a gift certificate (No gift certificates have been applied in this session at all), I see the following:

http://cl.ly/image/060u1n182I2D

Subtotal: $5.00 Standard Shipping: $6.00 Gift Certificates: -$2.00 Total: $11.00

Which shows the correct subtotal, shipping and total, but shows a phantom $2 discount that's not actually applied to the total.

Has anyone seen anything like this happen with CT gift certificates? Any thoughts about how to fix the issue? It seems like the total behavior is correct (no gift certificate applied) but the number output by cartthrob_gift_certificates:applied is incorrect.

2

I figured out the answer to this problem, and it's a ridiculous little bug.

When giving gift certificates in the control panel, you can leave off the member ID of the user you want to give the certificate to. If you do this, the certificate disappears into some void, and never shows up in the CP list of gift certificates. It does, however, remain in the database with a member ID of 0.

From there, apparently, the value of the earliest un-assigned gift certificate shows up when the {exp:cartthrob_gift_certificates:applied} tag is used. That value isn't applied to the cart total, but it does show up if you're showing users what their gift certificate value is.

Hopefully this helps if anyone else runs into it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.