MiniVend Akopia Services

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

shipping selection dropdown box



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




Search for: Match: Format: Sort by: