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

Stefan Hornburg racke at rt.icdevgroup.org
Wed Apr 8 08:34:03 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  e3b86054e695cc1314031502b8155478a15afac4 (commit)
      from  28175e1082c4bf8f66a562482cc30f98d3fc426d (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 e3b86054e695cc1314031502b8155478a15afac4
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Wed Apr 8 10:33:47 2009 +0200

    [product_order] tag added

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

Summary of changes and diff:
 code/product_order.tag  |   36 ++++++++++++++++++++++++++++++++++++
 components/product_info |    2 +-
 2 files changed, 37 insertions(+), 1 deletions(-)
 create mode 100644 code/product_order.tag

diff --git a/code/product_order.tag b/code/product_order.tag
new file mode 100644
index 0000000..a32288a
--- /dev/null
+++ b/code/product_order.tag
@@ -0,0 +1,36 @@
+UserTag product_order Order sku qty
+UserTag product_order AddAttr
+UserTag product_order Routine <<EOR
+sub {
+	my ($sku, $qty, $opt) = @_;
+	my ($class, $qty_el, $qty_class, $text, $form, $sid, $action);
+
+	$class = $opt->{class} || 'cart';
+
+	if ($qty) {
+		$qty_class = $opt->{qty_class} || 'cart';
+		$qty_el = qq{<input name="mv_order_quantity" class="$qty_class" value="$qty" size="2">};
+	}
+	else {
+		$qty_el = '';
+	}
+
+	$text = $opt->{text} || errmsg('Add to Cart');
+
+	# produce form to order item
+	$sid = $Tag->form_session_id();
+	$action = $Tag->area({href => $Config->{Special}->{order}, match_security => 1});
+
+	$form = <<EOF;
+<form action="$action" method="post">
+$sid
+<input type="hidden" name="mv_action" value="refresh">
+<input type="hidden" name="mv_order_item" value="$sku">
+$qty_el
+<button class="$class" type="submit"><span>$text</span></button>
+</form>
+EOF
+
+	return $form;
+}
+EOR
diff --git a/components/product_info b/components/product_info
index 99859b9..60be0ac 100644
--- a/components/product_info
+++ b/components/product_info
@@ -19,7 +19,7 @@
 
 <ul>
 <li><strong>[item-price]</strong></li>
-<li>Qty: |INPUT|  |Add to cart button|
+<li>[product_order [item-code] 1]
 </li>
 </ul>
 


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list