Difference between revisions of "Template:Adafruit item row"

From MidsouthMakers - Memphis Area Hackerpace
Jump to navigation Jump to search
(adding in option for discount overrides)
Line 3: Line 3:
 
| {{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | <s> }} {{#if: {{{name|{{{url|<noinclude>x</noinclude>}}}}}} | [{{{url}}} {{{name}}}] | ''N/A''}} {{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | </s> ''OUT OF STOCK'' }}
 
| {{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | <s> }} {{#if: {{{name|{{{url|<noinclude>x</noinclude>}}}}}} | [{{{url}}} {{{name}}}] | ''N/A''}} {{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | </s> ''OUT OF STOCK'' }}
 
| {{{quantity|{{{qty|1}}}}}}
 
| {{{quantity|{{{qty|1}}}}}}
| ${{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | 0 | {{#expr: {{{quantity|{{{qty|1}}}}}} * {{{cost|{{{price|0}}}}}} }} }}
+
| ${{padright: {{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | 0 | {{#expr: {{{quantity|{{{qty|1}}}}}} * {{{cost|{{{price|0}}}}}} }} }} | 4 | .00 }}
 
| ${{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | 0 | {{#expr: {{{quantity|{{{qty|1}}}}}} * {{#if: {{{discounted_cost|}}} | {{{discounted_cost}}} | {{{cost|{{{price|0}}}}}} - {{{discount|0.1}}} * {{{cost|{{{price|0}}}}}} }} }} }}
 
| ${{#ifeq: {{{out_of_stock|{{{oos|no}}}}}} | yes | 0 | {{#expr: {{{quantity|{{{qty|1}}}}}} * {{#if: {{{discounted_cost|}}} | {{{discounted_cost}}} | {{{cost|{{{price|0}}}}}} - {{{discount|0.1}}} * {{{cost|{{{price|0}}}}}} }} }} }}
 
<noinclude>{{adafruit item bottom}}
 
<noinclude>{{adafruit item bottom}}

Revision as of 20:55, 8 August 2010

Item Qty Cost/Item Cost Discounted Cost/Item Discounted Cost
[{{{url}}} {{{name}}}] 1 $0.00 $0
[edit] [purge] Template documentation

Usage

{{adafruit item row
|name = 
|url = 
|quantity = 
|out_of_stock = 
|price = 
|discount = 
}}