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

Stefan Hornburg racke at rt.icdevgroup.org
Fri Apr 10 10:58:51 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  e3b4cd67a31586f3869646f8f3d35fafa01857b2 (commit)
      from  562091f45b110851abe8bcc254479d65038da95a (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 e3b4cd67a31586f3869646f8f3d35fafa01857b2
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Fri Apr 10 12:58:43 2009 +0200

    wishlist update function added

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

Summary of changes and diff:
 plugins/wishlists/code/wishlist.tag  |   12 ++++++++++++
 plugins/wishlists/code/wishlists.sub |   16 ++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/plugins/wishlists/code/wishlist.tag b/plugins/wishlists/code/wishlist.tag
index 76d8547..1713966 100644
--- a/plugins/wishlists/code/wishlist.tag
+++ b/plugins/wishlists/code/wishlist.tag
@@ -93,7 +93,19 @@ sub {
 		$Tag->error({name => 'wishlist', set => 'Wishlist is missing.'});
 		return;
 	}
+	
+	if ($function eq 'update') {
+		# update product in wishlist
+		my %data;
 
+		for (keys %product_fields) {
+			if (exists $opt->{$_} && $opt->{$_} =~ /\S/) {
+				$data{$_} = $opt->{$_};
+			}
+		}
+
+		$Db{cart_products}->set_slice([$wishlist_code, $sku], %data);
+	}
 	elsif ($function eq 'remove') {
 		# remove product from wishlist
 		$Db{cart_products}->delete_record([$wishlist_code, $sku]);
diff --git a/plugins/wishlists/code/wishlists.sub b/plugins/wishlists/code/wishlists.sub
index fdb3ef2..1b5b58f 100644
--- a/plugins/wishlists/code/wishlists.sub
+++ b/plugins/wishlists/code/wishlists.sub
@@ -58,6 +58,22 @@ sub {
 		$Tag->wishlist('remove', $CGI->{remove}, $CGI->{cart});
 	}
 
+	# whether to update wishlist
+	if ($CGI->{update}) {
+		for (my $i = 0; $i < @{$CGI_array->{sku}}; $i++) {
+			my %data = (function => 'update',
+						sku => $CGI_array->{sku}->[$i],
+						name => $wishlist_name,
+						code => $wishlist_code);
+
+			for my $f (split(/\s*,\s*/, $Variable->{WISHLISTS_PRODUCTS_FIELDS})) {
+				$data{$f} = $CGI_array->{$f}->[$i];
+			}
+
+			$Tag->wishlist(\%data);
+		}
+	}
+
 	# show wishlist for the current user
 	if ($args[0] eq 'carts') {
 		$CGI->{mv_nextpage} = 'wishlists/carts';


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list