[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. bb256a45b551d6c5a6acf0540ede071b5cea2652
Stefan Hornburg
racke at rt.icdevgroup.org
Wed Jan 20 15:23:10 UTC 2010
via bb256a45b551d6c5a6acf0540ede071b5cea2652 (commit)
via e7663d5f68b7a0858d0f8815827ed594b2780b8d (commit)
from b4468731b10bf46a40c8a443c4e2c2074d789cb9 (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 bb256a45b551d6c5a6acf0540ede071b5cea2652
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Wed Jan 20 10:22:24 2010 -0500
verify that additions to the shopping cart don't exceed OrderLineLimit
don't empty it, as regular users might hit this limit in some cases
commit e7663d5f68b7a0858d0f8815827ed594b2780b8d
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Wed Jan 20 10:16:21 2010 -0500
removed debug message
-----------------------------------------------------------------------
Summary of changes and diff:
lib/WellWell/Cart.pm | 9 ++++++++-
lib/WellWell/Core.pm | 2 --
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/WellWell/Cart.pm b/lib/WellWell/Cart.pm
index 1c4ce95..ab5d262 100644
--- a/lib/WellWell/Cart.pm
+++ b/lib/WellWell/Cart.pm
@@ -78,10 +78,17 @@ sub cart_add {
$itemref = cart_item($sku, $quantity, $opt);
WellWell::Core::hooks('run', 'cart_item_add', $itemref);
+
+ # verify that number of items doesn't go out of bounds
+ if ($Vend::Cfg->{OrderLineLimit} && @$Vend::Items >= $Vend::Cfg->{OrderLineLimit}) {
+ ::logError('Limit %s for number of items in the cart exceeded.',
+ $Vend::Cfg->{OrderLineLimit});
+ return;
+ }
push(@$Vend::Items, $itemref);
- return;
+ return $itemref;
}
sub cart_refresh {
diff --git a/lib/WellWell/Core.pm b/lib/WellWell/Core.pm
index e29c331..13ae6fb 100644
--- a/lib/WellWell/Core.pm
+++ b/lib/WellWell/Core.pm
@@ -39,8 +39,6 @@ sub hooks {
my ($function, $name, @args) = @_;
if ($function eq 'run') {
- ::logError("Running hooks $name.");
-
if (exists $Vend::Cfg->{Hook}->{$name}) {
my @hooks = @{$Vend::Cfg->{Hook}->{$name}};
hooks/post-receive
--
Interchange wellwell catalog
More information about the wellwell-devel
mailing list