[ic] Re: UNSOLVED: Database range-lookup question, CommonAdjust?

Barry Treahy, Jr. interchange-users@icdevgroup.org
Fri Sep 6 13:17:02 2002


Interchange user wrote:

>On Thursday 05 September 2002 09:30 pm, you wrote:
>
>  
>
>>Interchange user wrote:
>>    
>>
>>>This may be a MySQL question; I'm not sure, but someone could save me
>>>countless hours of searching and frustration if they could answer this for
>>>me:
>>>
>>>I have a custom shipping routine that currently does a lookup into a MySQL
>>>database table and gets a price for an exact weight.
>>>
>>>I want to make a change so that the exact weight of the items can be used
>>>to make a range lookup in the table, for example:
>>>
>>>weight	zone1
>>>
>>>60	0.27
>>>100	0.41
>>>150	0.57
>>>200	0.72
>>>
>>>A weight of 1 to 60 costs 0.27, a weight of 61 to 100 costs 0.41, and so
>>>on.
>>>
>>>Can Interchange's 'CommonAdjust' feature be used for this? If so, how?
>>>      
>>>
>>I believe your are mixing apples and oranges as CommonAdjust is for
>>product pricing.  I believe what you want to do is already built in with
>>the use of the shipping.asc file which allows pricing based on quantity,
>>value, or weight...  I'd encourage you to take a look at that file, I
>>believe that's where you want to start looking first...
>>
>>Barry
>>    
>>
>
>Barry,
>
>I wouldn't want to use shipping.asc for that, because there are loads of 
>weight ranges, and they need to be in a db table.
>  
>
You could still use the shipping.asc file and just have a broad weight 
range, say .01 to 999999 and then for that line, use Perl to perform the 
actual database lookup based on the weight into your DB table...

Barry

-- 

Barry Treahy, Jr  *  Midwest Microwave  *  Vice President & CIO 

E-mail: Treahy@mmaz.com * Phone: 480/314-1320 * FAX: 480/661-7028