[ic] shipping control

New Media E.M.S. ic_users at newmediaems.com
Wed Jun 30 17:55:36 EDT 2004


At 01:07 PM 6/30/2004, you wrote:

>New Media E.M.S. wrote:
>
> > At 11:50 AM 6/30/2004, you wrote:
> >
> >> New Media E.M.S. wrote:
> >>
> >> > At 10:50 AM 6/30/2004, you wrote:
> >> >
> >> >> New Media E.M.S. wrote:
> >> >>
> >> >> > At 08:30 AM 6/30/2004, you wrote:
> >> >> >
> >> >> >> Hi All,
> >> >> >>
> >> >> >> I've got a problem that I need to address rather quickly. Some
> >> of the
> >> >> >> products we sell using interchange are such that they will not ship
> >> >> UPS
> >> >> >> even though individually they meet the 150lb. per item requirement.
> >> >> >> Because of this they need to be shipped by common carrier.
> >> >> >>
> >> >> >> What I need to do is check the cart on the checkout page and if
> >> one or
> >> >> >> more of these items exists in the cart replace the shipping method
> >> >> drop
> >> >> >> down menu with a message that their contains items that require
> >> >> >> specialized shipping and that they should call for shipping
> >> costs and
> >> >> >> arrangements reguardless of whether they're logged in or not. The
> >> >> >> checkout page has to read the cart and alert the customer of this
> >> >> >> special nee without assigning any shipping charges to the order.
> >> >> >>
> >> >> >> I'm really not sure exactly where to start to accomplish this so
> >> >> any and
> >> >> >> all help will be hugely appreciated.
> >> >> >>
> >> >> >> thanks,
> >> >> >>
> >> >> >> --
> >> >> >>  Mark Weaver
> >> >> >>  American Micro - Webmaster
> >> >> >>  1-800-558-2058
> >> >> >
> >> >> >
> >> >> > I assume there is some kind of flag field in the products table for
> >> >> > these items which must go by motor freight? If so, it could be as
> >> easy
> >> >> > as adding something like this to the cart recap code on the checkout
> >> >> page:
> >> >> >
> >> >> > [if-item-field motor_freight_flag_field]
> >> >> >         [tmp motor_freight]1[/tmp]
> >> >> > [/if-item-field]
> >> >> >
> >> >> >
> >> >> > ...and then in the shipping info area:
> >> >> >
> >> >> > [if scratch motor_freight]
> >> >> >         [value name=mv_shipmode value='']
> >> >> >         <b>Your order requires special shipping arrangements.
> >> >> >         Please contact customer service.</b>
> >> >> > [else]
> >> >> >         (regular shipping selector code here)
> >> >> > [/else]
> >> >> > [/if]
> >> >> >
> >> >> >
> >> >> > - Ed L.
> >> >> >
> >> >>
> >> >> Hi Ed,
> >> >>
> >> >> I checked both the inventory and product tables and there doesn't
> >> appear
> >> >> to be any type of flag that the cart could look for. Couldn't this
> >> just
> >> >> as easily be done with the sku? I've created options for the
> >> individual
> >> >> products in question, but all they do is half the job in that they
> >> >> display a message that tells the customer that the item requires
> >> special
> >> >> shipping.
> >> >
> >> >
> >> > Unless you are only selling one or two items that require special
> >> > handling, or the SKU's for said items contain some common pattern, you
> >> > are better off adding a flag field which can contain a binary value for
> >> > this purpose - it makes the logic at checkout much simpler.
> >> >
> >> > - Ed
> >>
> >> Actually these items do have something in common which is part of the
> >> sku. MLVB is the first four characters of the sku followed by a few
> >> different letters and numbers detailing their precise application and
> >> attributes.
> >>
> >> So far I've used your example in the file
> >> include/checkout/shipping_address and its telling printing out the
> >> message for anything and everything that is placed into the cart
> >> thinking...well I haven't got a clue what its thinking. Here's what I've
> >> got in that file:
> >>
> >> >>>>>>>>>>>>>>>>>>>>>>>>>
> >>           [if-item-field sku]
> >>                 [tmp sku]1[/tmp]
> >>           [/if-item-field]
> >
> >
> > Not positive,  but I think at one time somebody added code to
> > [if-PREFIX] to allow simple regex's:
> >
> > [if-item-field sku =~ /^MLVB/]
> >         [tmp sku]1[/tmp]
> > [/if-item-field]
> >
> > ...otherwise you can just put something like this at the top of
> > checkout.html:
> >
> > [calc]
> >   foreach (@{$Items}) {
> >     if ($_->{code} =~ /^MLVB/) {
> >       $Tag->tmp('sku', '1');
> >       last;
> >     }
> >   }
> >   return;
> > [/calc]
> >
> > This should at least get you pointed in the right direction.
> >
> > - Ed
> >
>
>ok.... it seems like I'm getting closer, but its still either showing
>the shipping method menu or its not. There's no in between. Just in case
>it matters I'm using IC 5.2 foundation.
>
>I've added a field to the product table, "CommonCarrier" and its a set
>field that can contain either a 1 or a 0.
>
>1 = commoncarrier
>0 = normal shipping ( UPS Ground )
>
>The code has been placed in the include/checkout/shipping_address file
>and appears thusly:
>
> >>>>>>>>>>>>>>>>>>>>
>           [if-item-field CommonCarrier]
>                 [tmp CommonCarrier]1[/tmp]
>           [/if-item-field]
>           [if scratch CommonCarrier]
>              [value name=CommonCarrier value='1']
>              <b>Your Order requires special shipping arrangements.<br>
>                 Please contact customer service about your order.<br>
>                1-800-558-2058</b>
>           [else]
>
>           <tr>
>                 <td align="right" class="contentbar1">
>                   <b>[L]Shipping method[/L]</b>
>                 </td>
>                 <td colspan="3" class="contentbar1">
>                   <SELECT NAME=mv_shipmode>
>                   [loop option=mv_shipmode
>                   list=|[data table=country key='[default country US]'
>col=shipmodes]|
>                   ]
>                   <OPTION VALUE="[loop-code]"> [shipping-desc [loop-code]]
>                   [/loop]
>                   </SELECT>
>                 </td>
>           </tr>
>
>           [/else]
>           [/if]
><<<<<<<<<<<<<<<<<<<<<<<<
>
>Can you see what it is I might be doing wrong?

Yes - you need some table tags around your message about motor freight - 
something like:

<tr>
         <td colspan=4>
                 <b>Your Order requires special shipping arrangements.<br>
                 Please contact customer service about your order.<br>
                1-800-558-2058</b>
         </td>
</tr>

Please don't take it the wrong way, but this was quite obvious, just from 
the snippet you posted to this list. Also, [value name=CommonCarrier 
value='1'] is completely functionless and meaningless.

- Ed

===============================================================
New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          edl at newmediaems.com
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax
=============================================================== 



More information about the interchange-users mailing list