Interchange

CVS log for interchange/code/SystemTag/discount_space.coretag

[BACK] Up to [Local Repository] / interchange / code / SystemTag

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.5.2.1: download - view: text, markup, annotated - select for diffs
Sat Mar 31 00:20:09 2007 UTC (21 months, 1 week ago) by pajamian
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_3
Diff to: previous 1.5: preferred, colored; next MAIN 1.6: preferred, colored
Changes since revision 1.5: +9 -4 lines
Fix incorrect license in headers GPL v2 -> GPL v2 "or later".  Update copyrights.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Fri Mar 30 23:40:49 2007 UTC (21 months, 1 week ago) by pajamian
Branches: MAIN
CVS tags: STABLE_5_6-root, STABLE_5_6-branch, REL_5_7_1, REL_5_6_1, REL_5_5_3, REL_5_5_2, REL_5_5_1, HEAD, DEB_5_6_1_2, DEB_5_5_1_1_1, DEB_5_5_1
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +9 -4 lines
Fix incorrect license in headers GPL v2 -> GPL v2 "or later".  Update copyrights.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue Nov 8 18:14:35 2005 UTC (3 years, 2 months ago) by jon
Branches: MAIN
CVS tags: STABLE_5_4-root, REL_5_4_2, REL_5_4_1, REL_5_4_0, REL_5_3_3, REL_5_3_2
Branch point for: STABLE_5_4-branch
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +3 -3 lines
Big copyright and version number update to prepare for 5.3.2 release.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Apr 8 14:45:13 2005 UTC (3 years, 9 months ago) by mheins
Branches: MAIN
CVS tags: DEB_5_3_0_20051028_1, DEB_5_3_0_20051004_1
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +13 -8 lines
* Re-relocate discount_space tag to SystemTag.

Revision 1.3
Thu Apr 7 22:51:32 2005 UTC (3 years, 9 months ago) by jon
Branches: MAIN
FILE REMOVED
Changes since revision 1.2: +2 -2 lines
Patch from Ethan Rowe <ethan@endpoint.com>, which I've been sitting on
for far too long. His comments:

Discount-space rework according to agreements reached between involved
core team members; modified initialization logic and configuration such
that discount spaces do not make an impact on page processing for catalogs
that do not explicitly make use of the feature. Changes include:

DiscountSpacesOn -- boolean catalog configuration directive. This is
FALSE by default. When set to true, a dispatch routine is added
to the (relatively new) dispatch routine stack, to be evaluated
per page process prior to autoloads; this routine initializes the
current discount space to 'main', and then checks all CGI variables
specified in the DiscountSpaceVar configuration array in the event
that an alternate discount space has been specified via CGI variables.
When DiscountSpacesOn is FALSE, *all* discount space functions become
a no-op; attempts to specify an alternate discount space will have no
effect, and will result in an error message in the catalog's error log.

DiscountSpaceVar -- array catalog configuration directive, with a default
entry of 'mv_discount_space'; the members of this array are treated as
names of CGI variables to check per page process, such that a CGI variable
can be used to specify the discount space to use for that page process
in a manner akin to values space ('mv_values_space') or named shopping
cart ('mv_cartname'). The CGI variables will *not* be checked unless
DiscountSpacesOn is true. While default behavior of 'mv_discount_space'
is likely to suffice for most purposes, people can tie the discount space
to other things, such as the cart, by including other variable names in
this array (for instance, 'mv_cartname' would tie the discount space to
the cart name, which could be convenient in some situations).

A new global object has been introduced: $::Discounts. This will always
point to the current discount hash; changing the discount space via
CGI variables or the [discount-space] tag will update $::Discounts.
Furthermore, a new Safe object has been introduced for accessing the
current discount space in [perl] and [calc] blocks: $Discounts.

Any code that works directly with the $Vend::Session->{discount} hash
should be updated to work with the $::Discounts variable (in global
space) and the $Discounts variable (in Safe space such as [perl] and
[calc]). Care has been taken to maintain backwards compatibility,
and working directly with the {discount} session member will generally
not cause problems (changing the discount space will in fact change the
hash to which $Vend::Session->{discount} points), except in the case of
reassigning the hash (i.e., $Session->{discount} = { 'SOMEITEM' => ' %s *
0.80 ' }); reassigning the hash will break the $::Discounts reference and
result in unpredictable behavior for the remainder of the page process.
Therefore, it is strongly advised that all such code be updated at some
point to use the new objects. Furthermore, any actions such as clearing
the discounts should be done by dereferencing rather than assigning a
new hashref.

Thus:
%$Discounts = ();
and not:
$Discounts = {};

Furthermore, you can clear the discount space via:
[discount-space name=some_spacename clear=1]

The current discount space name can be checked via:
[discount-space current=1]

Sessions: to maintain backwards compatibility, sessions continue to use a
{discount} member. However, at session initialization, all sessions will
receive a {discount_space}{main} member, and {discount} will point to it.
The session read process is essentially unchanged, with the exception of
a minor assignment in which $::Discounts is initialized to point to the
{discount} member. The modification to discount-spaces was driven in
part to reduce the number of assignments necessary at session read time,
and this new implementation is a reflection of that.

For the future, it may be worthwhile to revise the logic to eliminate
the {discount} session member entirely, and simply expect all code to
work directly through the $::Discounts/$Discounts variables. This would
allow some slight adjustments to the implementation of the discount space
initialization and switching logic, making it slightly more efficient
and certainly cleaner.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed Feb 9 13:39:42 2005 UTC (3 years, 10 months ago) by docelic
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +24 -17 lines
Header/license fix or Version update+minor formatting fix, or both

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jan 25 19:07:31 2005 UTC (3 years, 11 months ago) by mheins
Branches: MAIN

* Move discount_space tag to SystemTag.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

Interchange CVSweb <info@icdevgroup.org>