MiniVend Akopia Services

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

RE: shipping selection dropdown box



Hi Robert & All,

I'm currently using:
	<SELECT MV=loop
		MV.SEARCH="fi=country.asc/se=[default country US]/sf=selector/rf=shipmodes"
		MV.OPTION="mv_shipmode"
		onChange="this.form.submit()"
		NAME="mv_shipmode">
[perl interpolate=1]
 $sub = substr '[shipping [loop-code]]',1;
 $shipdesc = ' : [shipping-desc [loop-code]]';
 $returnstring = '<OPTION VALUE="[loop-code]">' . '[shipping [loop-code]]' . $shipdesc;
 return $returnstring if $sub != '0.00';
[/perl]
	</SELECT>

After I discovered that my quickly-coded solution was a little off. I apologize for anyone who had trouble with this.

Cheers,
Tim

-----Original Message-----
From:	Robert Hutchinson [SMTP:hutch@cix.compulink.co.uk]
Sent:	Thursday, July 22, 1999 10:09 AM
To:	minivend-users@minivend.com
Cc:	hutch@cix.compulink.co.uk
Subject:	shipping selection dropdown box

******    message to minivend-users from hutch@cix.compulink.co.uk (Robert Hutchinson)     ******

Back in April, tim@valutech posted a solution to the problem of having 
unwanted shipping options appearing in the dropdown box (as in simple 
checkout.html)
This is what he posted
<SELECT MV=loop
        MV.SEARCH="fi=country.asc/se=[default country 
US]/sf=selector/rf=shipmodes"
        MV.OPTION="mv_shipmode"
        onChange="this.form.submit()"
        NAME="mv_shipmode">
        [perl interpolate=1]
            $sub = [shipping [loop-code]] + 0;
            return '<OPTION VALUE="[loop-code]"> [shipping-desc 
[loop-code]] 
[shipping [loop-code]]' if $sub > 0;
        [/perl]
</SELECT>

Trouble is, my [shipping [loop-code]] has already been 'currencified' and 
crashed horribly,
so after much farting about (pattern matching) I came up with this
<SELECT MV=loop
  MV.ARG="[data
  table=country
  key='[default country UK]'
  sf=selector
  col=shipmodes
  ]"
    MV.OPTION="mv_shipmode"
    onChange="this.form.submit()"
    NAME="mv_shipmode">
    [perl interpolate=1]
    $myvar='[shipping [loop-code]]';
    if ($myvar !~ /\b0\b|\b0.00\b|(.*\D)(0.00)|(0.00)(.*\D)/){
      return "<OPTION VALUE='[loop-code]'> [shipping-desc [loop-code]] 
[shipping [loop-code]] ";
    }
  [/perl]
</SELECT>

Hope it helps someone


Bye :-)=
hutch@cix.co.uk


-
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: