1

I am using Cartthrob and am trying to figure out how to create a discount system. The goal is to create discounts for only certain products and set an automatic expiration date for the discounts. Where the product is displayed on the website (before adding to the cart), I would like to display the discount information such as the amount off, discounted price, etc.

Adding an expiring discount is easy with Cartthrob’s ‘Amount off Product’ discount type (where the discount applies to only specific entry IDs), however, there does not seem to be a way to show the discount information on a product page before adding the product to the cart. In the exp:channel:entries loop, trying to display discount information (amount off, discounted priced, etc.) using the tags described here results in unparsed tags. Once the product has been added to the cart those tags work. The documentation appears to confirm this behavior.

Has anyone using Cartthrob found a way around this limitation?

I am using EE v2.5.3 and Cartthrob v2.2.9.

1 Answer 1

0

The Cart Throb discount tags will only be parsed if a customer has actually applied a discount that has been accepted which you've obviously figure already.

I think the only way you can tell someone about a discount before they add the item to their basket is by having a field in your products channel where you could add discount details. This would work independently of your discounts channel so you wouldn't be able to link this to the expiry date of the discount.

So you could add 2 fields to your products channel; one for the discount detail, and a date field for the expiry, that might look like this:

{if current_time < discount_expiry_date}
{discounts_available}
{/if}

Once the discount expiry date has passed, the {discounts_available} content would be hidden.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.