[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. fcbd385486cd419d4c670ef20d2a69a8990b58ed

Stefan Hornburg racke at rt.icdevgroup.org
Sun Mar 14 12:26:32 UTC 2010


       via  fcbd385486cd419d4c670ef20d2a69a8990b58ed (commit)
      from  a626f89a1cb0870a04ad30739e2e8638575ecb0e (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 fcbd385486cd419d4c670ef20d2a69a8990b58ed
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Sun Mar 14 13:25:54 2010 +0100

    [cart-refresh] can now be used internally to add items as well

-----------------------------------------------------------------------

Summary of changes and diff:
 lib/WellWell/Cart.pm |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/WellWell/Cart.pm b/lib/WellWell/Cart.pm
index 97ada41..a0e5c96 100644
--- a/lib/WellWell/Cart.pm
+++ b/lib/WellWell/Cart.pm
@@ -34,7 +34,9 @@ Vend::Config::parse_tag('UserTag', 'cart_item Order sku quantity');
 Vend::Config::parse_tag('UserTag', 'cart_item AddAttr');
 Vend::Config::parse_tag('UserTag', 'cart_item MapRoutine WellWell::Cart::cart_item');
 
+Vend::Config::parse_tag('UserTag', 'cart_refresh Order function sku quantity modifiers');
 Vend::Config::parse_tag('UserTag', 'cart_refresh MapRoutine WellWell::Cart::cart_refresh');
+
 Vend::Config::parse_subroutine('GlobalSub', 'cart_refresh WellWell::Cart::cart_refresh_form_action');
 
 # [cart-item] - returns item hash ready to put it into cart
@@ -105,10 +107,15 @@ sub cart_add {
 }
 
 sub cart_refresh {
-	my ($cart, $new_cart, $itemref, $quantity);
+	my ($function, $sku, $quantity, $modifiers) = @_;
+	my ($cart, $new_cart, $itemref);
 
 	$cart = $Vend::Items;
 	$new_cart = [];
+
+	if ($function eq 'add') {
+		cart_add($CGI::values{mv_order_item}, $CGI::values{mv_order_quantity}, $modifiers);
+	}
 	
 	return 1 unless defined $CGI::values{"quantity0"};
 
@@ -188,7 +195,7 @@ sub cart_refresh_form_action {
 			}
 		}
 		
-		cart_add($CGI::values{mv_order_item}, $CGI::values{mv_order_quantity}, $opt);
+		cart_refresh('add', $CGI::values{mv_order_item}, $CGI::values{mv_order_quantity}, $opt);
 	}
 	else {
 		cart_refresh();


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list