Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
MiniVend 3.15-beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
perusionmike authored and jonjensen committed Jan 2, 2009
1 parent 3468e9a commit b02c8fc
Show file tree
Hide file tree
Showing 10 changed files with 401 additions and 69 deletions.
9 changes: 8 additions & 1 deletion dist/WHATSNEW
Expand Up @@ -133,7 +133,14 @@ MiniVend 3.15 incorporates some new features -- I couldn't resist. 8-)
NAME=Ecom_ShipTo_Postal_StateProv
SIZE=2>


* The [price] tag now supports pricing with attributes (size/color etc.).
If you do

[price code=99-102 size=XL color=RED]
[price code=99-102 size=L color=RED]
[price code=99-102 size=L color=BLUE]

in the demo, this will demonstrate it.

MiniVend 3.14 is a bug fix release with a couple of new features:

Expand Down
6 changes: 3 additions & 3 deletions dist/bin/localize
Expand Up @@ -2,7 +2,7 @@
#
# MiniVend localizer
#
# $Id: localize,v 1.2 1998/04/24 07:13:08 mike Exp $
# $Id: localize,v 1.3 1999/08/09 02:32:21 mike Exp mike $
#
# Copyright 1996-1998 by Michael J. Heins <mikeh@minivend.com>
#
Expand Down Expand Up @@ -129,9 +129,9 @@ else {
warn "Couldn't read merge file $opt_m, continuing without.\n";
}

$C->{Locale} = {} unless $C->{Locale};
$C->{Locale_repository} = {} unless $C->{Locale_repository};

my $Locale = $C->{Locale};
my $Locale = $C->{Locale_repository};

my $one_text;
my $two_text;
Expand Down
4 changes: 2 additions & 2 deletions dist/bin/minivend
Expand Up @@ -2,7 +2,7 @@
#
# MiniVend version 3.15
#
# $Id: minivend,v 1.45 1999/08/05 05:47:59 mike Exp mike $
# $Id: minivend,v 1.46 1999/08/09 02:32:31 mike Exp mike $
#
# This program is largely based on Vend 0.2
# Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
Expand Down Expand Up @@ -151,7 +151,7 @@ sub debug {
}

BEGIN {
$VERSION = '3.15beta1';
$VERSION = '3.15beta2';
}
use strict;
use Fcntl;
Expand Down
4 changes: 1 addition & 3 deletions dist/simple/pages/browse1.html
Expand Up @@ -151,9 +151,7 @@
[page href=browse1 arg="[scratch prev]:[scratch chunk]"]
<B>[L]Previous[/L]</B></A>&nbsp;&nbsp;
[/if]
[if type=explicit compare="[calc]
[value mv_search_match_count] > [scratch next]
[/calc]"]
[if type=explicit compare="[value mv_search_match_count] > [scratch next]"]
[page href=browse1 arg="[scratch next]:[scratch chunk]"]<B>[L]Next[/L]</B></A>
[/if]</BR>&nbsp;
</TD></TR></TABLE>
Expand Down
42 changes: 36 additions & 6 deletions dist/simple/pages/flypage.html
@@ -1,3 +1,4 @@
[fly-list]
<HTML>
[tag flag build][/tag]
<HEAD><TITLE>[item-description]</TITLE></HEAD>
Expand Down Expand Up @@ -53,7 +54,7 @@
<P>
[L]Catalog[/L] [L]Number[/L]: [item-code]<BR>
Our Price:<B>
[item-price]
[price code="[item-code]" quantity="[cgi prospective_price]"]
</B>
&nbsp;
[if ordered [item-code]]
Expand All @@ -64,15 +65,19 @@
[/if]
<P>
[if-field size]
<FORM ACTION="[process-target]" METHOD=POST>
[calc]
$qty = q{[cgi prospective_price]} || 1;
return '';
[/calc]
<FORM NAME=orderform ACTION="[process-target]" METHOD=POST>
<TABLE BACKGROUND="__IMAGE_DIR__/__BGIMAGE__">
<TR><TD VALIGN=TOP>
<INPUT TYPE=SUBMIT VALUE="[L]ORDER NOW[/L]">
<INPUT TYPE=hidden NAME=mv_todo VALUE=refresh>
<INPUT TYPE=hidden NAME=mv_order_item VALUE="[item-code]">
<INPUT TYPE=hidden NAME=mv_separate_items VALUE="1">
</TD><TD VALIGN=TOP BGCOLOR="#00F0F0">
<INPUT SIZE=3 NAME=mv_order_quantity VALUE="1">
<INPUT SIZE=3 NAME=mv_order_quantity VALUE="[calc]$qty[/calc]">
</TD></TR>
<TR>
<TD COLSPAN=2>
Expand All @@ -87,7 +92,22 @@
BACKGROUND=""
__HEADERBG__
TEXT="__HEADERTEXT__">
<H3><B>Quick-order</B></H3>
<FONT SIZE="+1"><B>Quick-order</B></FONT><BR>
[loop arg="1 2 5 10 25"]
[if cgi prospective_price == [loop-code]]
<B>[loop-code]</B>
[elsif !value prospective_price]
<A HREF="[area href=flypage form="
mv_arg=[item-code]
prospective_price=[loop-code]
"]"
onMouseOver="document.orderform.price_display.value='Quantity [loop-code] pricing'"
>[loop-code]</A>
[/elsif]
[/if]
[/loop]<BR>
<FONT SIZE=-1><INPUT NAME=price_display SIZE=16
VALUE='Quantity [calc]$qty[/calc] pricing'></FONT>
</TD>
</TR>
<TR>
Expand All @@ -107,13 +127,22 @@ <H3><B>Quick-order</B></H3>
</TD>
[loop with="-a" arg="[item-accessories size, options]"]
<TD>
[page form="
<A HREF="[area form="
mv_order_item=[item-code]
mv_order_color=[loop-code]
mv_order_size=[loop-code-a]
mv_order_quantity=[cgi prospective_price]
mv_separate_items=1
mv_todo=refresh
"][loop-code-a]</A><BR>
"]"
onMouseOut="document.orderform.price_display.value='hover to see price'"
onMouseOver="document.orderform.price_display.value='[price
code="[item-code]"
color="[loop-code]"
size="[loop-code-a]"
quantity="[cgi prospective_price]"
]'">[loop-code-a]</A>
<BR>
</TD>
[/loop]
</TR>
Expand Down Expand Up @@ -155,3 +184,4 @@ <H3><B>Quick-order</B></H3>
<!-- current page: @@MV_PAGE@@ -->
</BODY>
</HTML>
[/fly-list]
166 changes: 165 additions & 1 deletion doc/minivend.html
Expand Up @@ -1602,6 +1602,8 @@ <H2><A NAME="Catalog_Pages_MiniVend_tags">Catalog Pages -- MiniVend tags</A></H2
/if-sql-field
include Include a file with complete MiniVend interpretation
item-accessories Product accessory functions (set select box)
item-alternate Alternation for table/line build
/item-alternate
item-code Insert current item SKU/code/part number
item-data Insert data entry corresponding to current SKU
item-description Insert description corresponding to current SKU
Expand All @@ -1628,6 +1630,8 @@ <H2><A NAME="Catalog_Pages_MiniVend_tags">Catalog Pages -- MiniVend tags</A></H2
loop-accessories Product accessory functions (set select box)
loop-change Grouping of items in list display
/loop-change
loop-alternate Alternation for table/line build
/loop-alternate
loop-code Insert current item SKU/code/part number
loop-data Insert data entry corresponding to current SKU
loop-description Insert description corresponding to current SKU
Expand All @@ -1645,6 +1649,8 @@ <H2><A NAME="Catalog_Pages_MiniVend_tags">Catalog Pages -- MiniVend tags</A></H2
more-list Display more matches list with links to next series
/more-list
sql Perform any of several types of SQL query
sql-alternate Alternation for table/line build
/sql-alternate
sql-code Insert current item SKU/code/part number
sql-data Insert data entry corresponding to current SKU
sql-description Insert description corresponding to current SKU
Expand Down Expand Up @@ -3191,6 +3197,8 @@ <H2><A NAME="SQL_Access_Methods">SQL Access Methods</A></H2>
[if-sql-data db fld] Returns enclosed text only if data field not empty
[/if-sql-field] Terminator for above
[sql-increment] Returns integer count of row
[sql-alternate n] Alternating text
[/sql-alternate] Terminator for above
[sql-code] The first field of each row returned
[sql-data db fld] Database field for [sql-code]
[sql-description] Product description for [sql-code]
Expand Down Expand Up @@ -3793,6 +3801,24 @@ <H2><A NAME="LOOP_and_TAG_EACH">LOOP and TAG EACH</A></H2>

Evaluates to the value of the Accessories database entry for the item.

<P><DT><STRONG><A NAME="item__loop_alternate">[loop-alternate N] DIVISIBLE [else] NOT DIVISIBLE [/else][/loop-alternate]</A></STRONG><DD>

Set up an alternation sequence. If the loop-increment is divisible by <A HREF="#item_N">N</A>, the text will be displayed. If an <CODE>[else]NOT DIVISIBLE TEXT[/else]</CODE> is present, then the
<FONT SIZE=-1>NOT</FONT>
<FONT SIZE=-1>DIVISIBLE</FONT>
<FONT SIZE=-1>TEXT</FONT> will be displayed.

<P>
For example:

<P>
<PRE> [loop-alternate 2]EVEN[else]ODD[/else][/loop-alternate]
[loop-alternate 3]BY 3[else]NOT by 3[/else][/loop-alternate]
</PRE>
<P><DT><STRONG><A NAME="item__loop_alternate_">[/loop-alternate]</A></STRONG><DD>

Terminate the alternation area.

<P><DT><STRONG><A NAME="item__loop_change">[loop-change marker]</A></STRONG><DD>

Same as <CODE>[on-change]</CODE> but within loop lists.
Expand Down Expand Up @@ -4832,14 +4858,51 @@ <H2><A NAME="PRICE_DESCRIPTION_ACCESSORIES">PRICE, DESCRIPTION, ACCESSORIES</A><
<DL>
<DT><STRONG><A NAME="item__price">[price code quantity* database* noformat*]</A></STRONG><DD>

named attributes: <CODE>[price code=&quot;code&quot; quantity=&quot;quantity&quot; base=&quot;database&quot; noformat=1*]</CODE>
named attributes: <CODE>[price
code=&quot;code&quot;
quantity=&quot;N&quot;
base=&quot;database&quot;
noformat=1*
optionX=&quot;value&quot;]</CODE>

<P>
Expands into the price of the product identified by code as found in the
products database. If there is more than one products file defined, they
will be searched in order unless constrained by the optional argument <STRONG>base</STRONG>. The optional argument <STRONG>quantity</STRONG> selects an entry from the quantity price list. To receive a raw number,
with no currency formatting, use the option <CODE>noformat=1</CODE>.

<P>
As of MiniVend 3.15, if an named attribute corresponding to a product
option is passed, and that option would cause a change in the price, the
appropriate price will be displayed.

<P>

<FONT SIZE=-1>DEMO</FONT>
<FONT SIZE=-1>EXAMPLE:</FONT> The T-Shirt (product code 99-102), with a base price of $10.00, can vary in price depending on size and color.
<CODE>S</CODE>, the small size, is 50 cents less; <CODE>XL</CODE>, the extra large size, is $1.00 more, and the color <CODE>RED</CODE> is 0.75 extra. There are also quantity pricing breaks (see the demo <A HREF="#item_pricing">pricing</A> database. So the following will be true:

<P>
<PRE> [price code=99-102
size=L] is $10.00

[price code=99-102
size=XL] is $11.00

[price code=99-102
color=RED
size=XL] is $11.75

[price code=99-102
size=XL
quantity=10] is $10.00

[price code=99-102
size=S] is $9.50
</PRE>
<P>
An illustration of this is on the <A HREF="#item_flypage">flypage</A> template when passed that item code.

<P><DT><STRONG><A NAME="item__description">[description code database*]</A></STRONG><DD>

named attributes: <CODE>[description code=&quot;code&quot; base=&quot;database&quot;]</CODE>
Expand Down Expand Up @@ -5227,6 +5290,24 @@ <H2><A NAME="Item_Lists">Item Lists</A></H2>
passed any of the optional arguments, initiates special processing of item
attributes based on entries in the product database.

<P><DT><STRONG><A NAME="item__item_alternate">[item-alternate N] DIVISIBLE [else] NOT DIVISIBLE [/else][/item-alternate]</A></STRONG><DD>

Set up an alternation sequence. If the item-increment is divisible by <A HREF="#item_N">N</A>, the text will be displayed. If an <CODE>[else]NOT DIVISIBLE TEXT[/else]</CODE> is present, then the
<FONT SIZE=-1>NOT</FONT>
<FONT SIZE=-1>DIVISIBLE</FONT>
<FONT SIZE=-1>TEXT</FONT> will be displayed.

<P>
For example:

<P>
<PRE> [item-alternate 2]EVEN[else]ODD[/else][/item-alternate]
[item-alternate 3]BY 3[else]NOT by 3[/else][/item-alternate]
</PRE>
<P><DT><STRONG><A NAME="item__item_alternate_">[/item-alternate]</A></STRONG><DD>

Terminate the alternation area.

<P><DT><STRONG><A NAME="item__item_code_">[item-code]</A></STRONG><DD>

Evaluates to the product code for the current item.
Expand Down Expand Up @@ -5847,6 +5928,27 @@ <H2><A NAME="ASP_like_Perl">ASP-like Perl</A></H2>
Using the <CODE>$Tag</CODE> object, you can access any MiniVend tag
including user-defined tags.

<P>
<STRONG>IMPORTANT NOTE:</STRONG> If the tag will access a database that has not been previously opened, you must pass in the table name in the
<FONT SIZE=-1>ASP</FONT> call, i.e.:

<P>
<PRE> # HTML style
&lt;HTML MV=&quot;mvasp&quot; MV.TABLES=&quot;products pricing&quot;&gt;

or

# Named parameters
[mvasp tables=&quot;products pricing&quot;]

or

# Positional parameters
[mvasp products pricing]
</PRE>
<P>
Any tag can be called.

<P>
<PRE> &lt;%
my $user = $Session-&gt;{username};
Expand All @@ -5860,6 +5962,68 @@ <H2><A NAME="ASP_like_Perl">ASP-like Perl</A></H2>
<P>
<PRE> [data table=userdb column=name key=&quot;[data session username]&quot;]
</PRE>
<P>
If the tag has a dash (<CODE>-</CODE>) in it, use an underscore instead:

<P>
<PRE> # WRONG!!!
$Tag-&gt;shipping-desc('upsg');
# Right
$Tag-&gt;shipping_desc('upsg');
</PRE>
<P>
There are two ways of specifying parameters. You can either use the
positional parameters as documented (for an authoritative look at the
parameters, trace the <A HREF="#item__Routine">%Routine</A> value in
Vend::Parse), or you can specify it all with an option hash parameter names
as in any named parameters as you would specify in a MiniVend tag. The
calls

<P>
<PRE> $Tag-&gt;data('products', 'title', '00-0011');
</PRE>
<P>
and

<P>
<PRE> my $opt = {
table =&gt; 'products',
column =&gt; 'title',
key =&gt; '00-0011',
};
</PRE>
<P>
<PRE> $Tag-&gt;data( $opt );
</PRE>
<P>
are equivalent for the <A HREF="#item_data">data</A> tag.

<P>
If you are using the option hash method, and the tag has container text,
you can either specify it in the hash parameter <CODE>body</CODE> or add it as the next argument. The two calls:

<P>
<PRE> $Tag-&gt;item_list( {
'body' =&gt; &quot;[item-code] [item-field title]&quot;,
});
</PRE>
<P>
and

<P>
<PRE> $Tag-&gt;item_list( { }, &quot;[item-code] [item-field title]&quot;)
</PRE>
<P>
are equivalent.





<P>
Parameter names are
<FONT SIZE=-1>ALWAYS</FONT> lower case.

<P><DT><STRONG><A NAME="item__Values">$Values</A></STRONG><DD>

<FONT SIZE=-1>A</FONT> reference to the user form values ala <CODE>[value foo]</CODE>.
Expand Down
2 changes: 1 addition & 1 deletion lib/Vend/Cart.pm
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# MiniVend version 3.15
# MiniVend version 3.12
#
# $Id: Cart.pm,v 1.14 1999/06/07 08:03:57 mike Exp $
#
Expand Down

0 comments on commit b02c8fc

Please sign in to comment.