Mailing List Archive

Discount ALL_ITEMS - bug ?
Hello All,

I have set up a test store which uses the
[discount ALL_ITEMS] tag to apply a flat percentage
discount across the catalog.

The store is an instance of the "Construct Something"
demo and the [discount ....] tag is on the cart
component in templates/components. The version is
4.6.0.

The problem I have is that when viewing the cart,
the line items are shown un-discounted while the
sub-total reflects the correctly discounted amounts.

I think I have tracked this to some lines in the
sub conditional in Interpolate.pm :

elsif($base eq 'discount') {
$CacheInvalid = 1;
$op =
qq%$Vend::Session->{discount}->{$term}%;
$op = "q{$op}" unless defined $noop;
$op .= qq% $operator $comp%
if defined $comp;
}

The ALL_ITEMS attribute of the discount tag creates
a key value of ALL_ITEMS in the discount hash in the
Session structure. However, the product SKU ($term
above) does not appear in the discount hash and so
the product does not appear to be discounted. Other
parts of the discount code (subs apply_discount and
discount_price) appear to make special allowances
for the ALL_ITEMS case.

Any feedback much appreciated,
Regards,
James Griffiths



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/
Discount ALL_ITEMS - bug ? [ In reply to ]
Quoting James Griffiths (griffiths_james@yahoo.com):
>
> Hello All,
>
> I have set up a test store which uses the
> [discount ALL_ITEMS] tag to apply a flat percentage
> discount across the catalog.
>
> The store is an instance of the "Construct Something"
> demo and the [discount ....] tag is on the cart
> component in templates/components. The version is
> 4.6.0.
>
> The problem I have is that when viewing the cart,
> the line items are shown un-discounted while the
> sub-total reflects the correctly discounted amounts.

Did you try editing the cart component to always display
[discount-price]?

--
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Friends don't let friends use Outlook. -- Bob Blaylock
Discount ALL_ITEMS - bug ? [ In reply to ]
Mike Heins wrote:

>> The problem I have is that when viewing the cart,
>> the line items are shown un-discounted while the
>> sub-total reflects the correctly discounted
amounts.

> Did you try editing the cart component to always
> display [discount-price]?

I am working with pretty much the standard cart
component from the Construct Something demo. This
as you know has an [if discount [item-code]] tag for
each line item to decide whether to display
[discount-price] or [item-price] for the line item.
I have left this "as is" because I want to refine the
discount later to apply to selected users only -
then the [if discount ..] tag should be handy.

I think the problem is that the [if discount ..]
tag is returning false for all items because of the
bug I suspect in the conditional sub in Interpolate.pm

If there is anything I can do to refine the problem
report, just let me know.

Regards,
James




__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/
Discount ALL_ITEMS - bug ? [ In reply to ]
Quoting James Griffiths (griffiths_james@yahoo.com):
> Mike Heins wrote:
>
> >> The problem I have is that when viewing the cart,
> >> the line items are shown un-discounted while the
> >> sub-total reflects the correctly discounted
> amounts.
>
> > Did you try editing the cart component to always
> > display [discount-price]?
>
> I am working with pretty much the standard cart
> component from the Construct Something demo. This
> as you know has an [if discount [item-code]] tag for
> each line item to decide whether to display
> [discount-price] or [item-price] for the line item.
> I have left this "as is" because I want to refine the
> discount later to apply to selected users only -
> then the [if discount ..] tag should be handy.
>
> I think the problem is that the [if discount ..]
> tag is returning false for all items because of the
> bug I suspect in the conditional sub in Interpolate.pm
>
> If there is anything I can do to refine the problem
> report, just let me know.

Then just make it:

[if discount [item-code]]
[or discount ALL_ITEMS]

This is just a cart issue -- not a bug. The cart as it is is
not set up to handle ALL_ITEMS. Either edit the cart to remove
the conditional, showing [discount-price] and [discount-subtotal]
always, or add the above.

--
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Nature, to be commanded, must be obeyed. -- Francis Bacon