diff --git a/lib/WebGUI/Help/Macro_Product.pm b/lib/WebGUI/Help/Macro_Product.pm new file mode 100644 index 000000000..6417a2bec --- /dev/null +++ b/lib/WebGUI/Help/Macro_Product.pm @@ -0,0 +1,25 @@ +package WebGUI::Help::Macro_Product; + +our $HELP = { + + 'product' => { + title => 'product title', + body => 'product body', + fields => [ + ], + related => [ + { + tag => 'macros using', + namespace => 'Macros' + }, + { + tag => 'manage product', + namespace => 'ProductManager' + }, + ] + }, + +}; + +1; + diff --git a/lib/WebGUI/Macro/Product.pm b/lib/WebGUI/Macro/Product.pm index c18637197..decafdad7 100644 --- a/lib/WebGUI/Macro/Product.pm +++ b/lib/WebGUI/Macro/Product.pm @@ -19,7 +19,7 @@ sub process { ($productId) = WebGUI::SQL->quickArray("select productId from products where sku=".quote($_[0])) unless ($productId); ($productId) = WebGUI::SQL->quickArray("select productId from products where productId=".quote($_[0])) unless ($productId); - return 'Cannot find product' unless ($productId); + return WebGUI::International::get('cannot find product','Macro_Product') unless ($productId); $product = WebGUI::Product->new($productId); diff --git a/lib/WebGUI/i18n/English/Macro_Product.pm b/lib/WebGUI/i18n/English/Macro_Product.pm index 8b39e1079..04501a5de 100644 --- a/lib/WebGUI/i18n/English/Macro_Product.pm +++ b/lib/WebGUI/i18n/English/Macro_Product.pm @@ -15,6 +15,108 @@ our $I18N = { message => q|Product|, lastUpdated => 1128918830, } + + 'cannot find product' => { + message => q|Cannot find product|, + lastUpdated => 1128976376, + }, + + 'product title' => { + message => q|Product Macro|, + lastUpdated => 1128965480, + }, + + 'product body' => { + message => q| + +
+^Product(SKU or productId, [templateId]);
+This macro looks up a Product in the Product Manager by SKU or productId and
+allows information about i to be displayed. If the SKU or productId cannot
+be found, the message ^International("cannot find product","Macro_Product"); will
+be displayed.
The macro may take one optional argument, an alternate template in the Macro/Product namespace for formatting information about the Product. The following variables are available in the template:
+ +variants.message
+The internationalized text "^International("available product configurations","Macro_Product");"
+
variantLoop
+A loop containing information about all variants about the Product.
+
+ ++ +variant.compositionLoop
+ +
+A loop containing information about all variants about the Product. ++ ++ +parameter
+ +
+The parameter that defines this variant, for example, size. +value
+ +
+The value of the parameter, for the example of size, XL. +variant.variantId
+ +
+The Id for this variant of the Product. +variant.price
+ +
+The price for this variant of the Product. +variant.weight
+ +
+The weight for this variant of the Product. +variant.sku
+ +
+The SKU for this variant of the Product. +variant.addToCart.url
+ +
+A URL to add this variant of the Product to the user's shopping cart. +variant.addToCart.label
+ +
+An internationalized label, "^International("add to cart","Macro_Product");", +to display to the user for adding this variant +of the Product to their shopping cart. +
productId
+The unique identifier of this Product.
title
+The title for this Product.
description
+The description of this Product.
+
price
+The Product's base cost.
+
weight
+The Product's base weight.
+
sku
+The Product's base SKU.
+