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

Stefan Hornburg racke at rt.icdevgroup.org
Wed Jul 22 07:31:20 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  1e496d078afa7699dfdfecd6aaab88474712da75 (commit)
      from  5b395a9448fbaac8571faffc9987f7b727707b4d (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 1e496d078afa7699dfdfecd6aaab88474712da75
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Wed Jul 22 09:30:13 2009 +0200

    consider quantity when adding items from wishlist to cart

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

Summary of changes and diff:
 plugins/wishlists/code/wishlists.sub |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/plugins/wishlists/code/wishlists.sub b/plugins/wishlists/code/wishlists.sub
index 47fb884..55080f0 100644
--- a/plugins/wishlists/code/wishlists.sub
+++ b/plugins/wishlists/code/wishlists.sub
@@ -36,10 +36,15 @@ sub {
 
 	# whether to move stuff from wishlist to cart
 	if ($CGI->{movetocart}) {
-		for (@{$CGI_array->{sku}}) {
-			$Tag->addtocart($_, 1);
+		my (@skus, @qtys);
+
+		@skus = @{$CGI_array->{sku}};
+		@qtys = @{$CGI_array->{quantity}};
+
+		for (my $i = 0; $i < @skus; $i++) {
+			$Tag->addtocart($skus[$i], $qtys[$i] || 1);
 			$Tag->wishlist({function => 'remove',
-							sku => $_,
+							sku => $skus[$i],
 							name => $wishlist_name,
 							code => $wishlist_code});
 		}
@@ -49,8 +54,13 @@ sub {
 
 	# whether to copy stuff from wishlist to cart
 	if ($CGI->{addtocart}) {
-		for (@{$CGI_array->{sku}}) {
-			$Tag->addtocart($_, 1);
+		my (@skus, @qtys);
+
+		@skus = @{$CGI_array->{sku}};
+		@qtys = @{$CGI_array->{quantity}};
+
+		for (my $i = 0; $i < @skus; $i++) {
+			$Tag->addtocart($skus[$i], $qtys[$i] || 1);
 		}
 		$CGI->{mv_nextpage} = $Config->{Special}->{order};
 		return 1;


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list