[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] simple variable fetch for shipping mode cost
>
> Is it possible to make a shipping mode that simply grabs the value of
> some variable (perhaps global) for the cost?
>
> For instance, let's say I add a shipping mode like this:
>
> CAN2 testomode weight 0 0 e Nothing to ship! {'ui_ship_type' =>
> "weight",'ups' => "0",'PriceDivide' => "1",}
> CAN2 testomode weight 0 9999999 f [@@F2CAN@@] {'PriceDivide' => "1",}
>
> Will the checkout page grab the value of the global variable F2CAN and
> use it as the shipping cost for mode testomode? And what about sessions?
> If I have to use a global variable for this hypothetical scenario would
> I be able to have different values for each unique transaction?
>
You could use [var F2CAN 1] to get the value of your @@F2CAN@@
variable. If you want to just make up a value, using whatever
method you see fit, you could create your own UserTag and call it
as [myusertag]. For instance, you may have noticed the use of the
[ups-query] and [fedex-query] tags in the Foundation-supplied
shipping.asc file.
>
> I'm trying to do a ups style fetch from a different shipper to get some
> shipping costs. Where is the code that talks to ups and gets their
> prices? Perhaps this would be easier and more elegant if I could clone
> the ups system and adapt it to my needs.
>
The [ups-query] global UserTag is in a file called "ups_query.tag".
Which will be in your global usertags directory.
>
> So far I have a globalsub that opens a socket, sends out the package
> info and receives a bunch of shipping options which I display on the
> checkout page. Am I re-inventing the wheel? Are there already functions
> similar to this built into interchange?
>
I would personally build a (global) UserTag, rather than a GlobalSub,
as it would save having to switch nasty things like AllowGlobal on.
As far as your question is concerned, I have no idea. Sorry.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/