View Single Post
  #2  
Old 12-19-2006, 12:31 AM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Shipping Description in cart and checkout

You are onto something with the shipping descriptions so I took some time to try and code it up...it works to a point, as soon as the page finishes refreshing (since you need to submit the form to get the updated price) the text goes away.

What I have so far:

in customer/main/cart_totals.tpl look for
Code:
<FONT class="FormButton">{$lng.lbl_delivery}: </FONT> <SELECT name="shippingid" onchange="document.cartform.submit();"> {section name=ship_num loop=$shipping} <OPTION value="{$shipping[ship_num].shippingid}" {if $shipping[ship_num].shippingid eq $cart.shippingid}selected{/if}>{$shipping[ship_num].shipping|trademark:$insert_trademark:"alt"}{if $config.Appearance.display_shipping_cost eq "Y" and ($login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if}</OPTION> {/section} </SELECT>

and replace with
Code:
<script type="text/javascript"> {literal} function shipdesc() { if(document.cartform.shippingid.value==52) document.cartform.shippingdesc.value = "USPS Priority takes about 1-3 business days."; } {/literal} </script> <FONT class="FormButton">{$lng.lbl_delivery}: </FONT> <SELECT name="shippingid" onchange="shipdesc();document.cartform.submit();"> {section name=ship_num loop=$shipping} <OPTION value="{$shipping[ship_num].shippingid}" {if $shipping[ship_num].shippingid eq $cart.shippingid}selected{/if}>{$shipping[ship_num].shipping|trademark:$insert_trademark:"alt"}{if $config.Appearance.display_shipping_cost eq "Y" and ($login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if}</OPTION> {/section} </SELECT> <br><br> <INPUT type="text" name="shippingdesc" disabled="true" size="60">

the shippingid.value may be different for you, im not entirely sure, it doesnt seem to correspond to the admin ordering numbers under the shipping methods section...also you can add more descriptions by using the elseif statements...some improvements would be to use the admin ordering as well as the period to be used for the descriptions, but I dont know how to call those values

I may have another go at it over the weekend, but for now I need to finish up on other things
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote