[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. 50c5df0e3f67ec9f9ab9a2fe5c63138bd9ab4d18
Stefan Hornburg
racke at rt.icdevgroup.org
Sun May 23 15:13:27 UTC 2010
via 50c5df0e3f67ec9f9ab9a2fe5c63138bd9ab4d18 (commit)
from 6af117f928d840ab72b0426d1631c413da0aa308 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 50c5df0e3f67ec9f9ab9a2fe5c63138bd9ab4d18
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Sun May 23 17:10:23 2010 +0200
Inspect return value of separate_items SpecialSub before combining items in the cart.
This is a supplement to the configuration directive SeparateItems in case you have
items which can be combined and some which cannot be combined.
-----------------------------------------------------------------------
Summary of changes and diff:
lib/WellWell/Cart.pm | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/WellWell/Cart.pm b/lib/WellWell/Cart.pm
index 0f4e9d8..c08d855 100644
--- a/lib/WellWell/Cart.pm
+++ b/lib/WellWell/Cart.pm
@@ -81,7 +81,7 @@ sub cart_item {
sub cart_add {
my ($sku, $quantity, $opt) = @_;
- my ($itemref, $combref);
+ my ($itemref, $subname, $sub, $separate_item, $combref);
$itemref = cart_item($sku, $quantity, $opt);
@@ -97,7 +97,15 @@ sub cart_add {
}
# see if we can combine this item into cart items
- if (!$Vend::Cfg{SeparateItems} && ($combref = combine_items($itemref))){
+ if ($subname = $Vend::Cfg->{SpecialSub}{separate_items}) {
+ $sub = $Vend::Cfg->{Sub}{$subname} || $Global::GlobalSub->{$subname};
+ $separate_item = $sub->($itemref);
+ }
+ else {
+ $separate_item = $Vend::Cfg{SeparateItems};
+ }
+
+ if (!$separate_item && ($combref = combine_items($itemref))){
return $combref;
}
hooks/post-receive
--
Interchange wellwell catalog
More information about the wellwell-devel
mailing list