Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] New user Account / Quote Number



******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******

Quoting Cameron Prince (PRINCECB@novachem.com):
> ******    message to minivend-users from Cameron Prince <PRINCECB@novachem.com>     ******
> 
> Ven,
> 
> I completed the quotation number support for my catalog and maybe you can
> use it to help you with the id number you need.
> 
> Here's the global sub from minivend.cfg: (DITCHED USING ARRAYS)
> 
> GlobalSub <<EOF
> sub QuoteNumber {
> my $quote_log = '/path/to/quote.number';
>    
> open(QUOTENUM,"<$quote_log");
> my $prev_quote_num = <QUOTENUM>;
> close(QUOTENUM);
>    
> my $new_quote_num = $prev_quote_num + 1;
>    
> open(QUOTENUM,">$quote_log");          
> print QUOTENUM ($new_quote_num); 
> close(QUOTENUM);    
> 
> $Vend::Session->{scratch}->{quote_num} = $new_quote_num;
> return "";
> }  
> EOF
> 
> 
> And the code on the basket page:
> 
> 
> [if scratch quote_num]
> <INPUT TYPE=hidden NAME=quote_number VALUE="[scratch quote_num]">
> [else]
> [perl arg=sub interpolate=1]QuoteNumber('')[/perl]
> [/else]
> [/if]

Might be easier to do:

[if scratch quote_num]
...
[else]
[set name=quote_num interpolate=1][fcounter /path/to/quote.number][/set]
[/else]
[/fi]

I believe fcounter is in most Minivend installations somewhere. It
has the advantage of doing locking...your routine has a good chance
of corrupting the number on a busy system.

-- 
Internet Robotics, 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mikeh@minivend.com>

If you like what you're gettin', keep doin' what you're doin'. -- Hector
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: