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

Stefan Hornburg racke at rt.icdevgroup.org
Sun Apr 11 07:46:50 UTC 2010


       via  3cd0748591e056796878c93a42a59fb98607d989 (commit)
      from  d1b0521a08c75d5f2f21a7b09757910ba3bdab55 (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 3cd0748591e056796878c93a42a59fb98607d989
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Sun Apr 11 09:46:12 2010 +0200

    added configuration variables for inactive field name and value

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

Summary of changes and diff:
 plugins/wishlists/code/wishlist.tag |   10 +++++++++-
 plugins/wishlists/plugin.cfg        |    3 +++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/plugins/wishlists/code/wishlist.tag b/plugins/wishlists/code/wishlist.tag
index ad3cc4a..8a79678 100644
--- a/plugins/wishlists/code/wishlist.tag
+++ b/plugins/wishlists/code/wishlist.tag
@@ -64,7 +64,13 @@ sub {
 		$pref = $Db{products}->row_hash($sku);
 
 		# check whether product is valid
-		unless ($pref && ! $pref->{inactive}) {
+		unless ($pref) {
+			$Tag->error({name => $sku, set => 'Product discontinued.'});
+			return;
+		}
+
+		if ($Variable->{WISHLISTS_INACTIVE_FIELD}
+			&& $pref->{$Variable->{WISHLISTS_INACTIVE_FIELD}} eq $Variable->{WISHLISTS_INACTIVE_VALUE}) {
 			$Tag->error({name => $sku, set => 'Product discontinued.'});
 			return;
 		}
@@ -160,6 +166,8 @@ sub {
 			# items were removed, update timestamp on cart
 			$Db{carts}->set_field($wishlist_code, 'last_modified', $Tag->time({format => '%s'}));			
 		}
+
+		return $ret;
 	}
 	elsif ($function eq 'addtocart') {
 		# add all wishlist items to the session-bound shopping cart
diff --git a/plugins/wishlists/plugin.cfg b/plugins/wishlists/plugin.cfg
index adb9715..eabb9c7 100644
--- a/plugins/wishlists/plugin.cfg
+++ b/plugins/wishlists/plugin.cfg
@@ -12,4 +12,7 @@ Variable WISHLISTS_DEFAULT_TYPE wishlist
 # additional fields for cart_products table
 Variable WISHLISTS_PRODUCTS_FIELDS quantity
 
+Variable WISHLISTS_INACTIVE_FIELD inactive
+Variable WISHLISTS_INACTIVE_VALUE 1
+
 ActionMap wishlists wishlists


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list