Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Pre-Login Shipping Calculator

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #241  
Old 09-25-2007, 07:18 PM
 
jillsybte jillsybte is offline
 

eXpert
  
Join Date: Jun 2006
Location: New York, USA
Posts: 389
 

Default Re: Pre-Login Shipping Calculator

Does anyone have the BCS Eng. Pre-Login Shipping Calculator working correctly with the BCS Eng. Shipping Methods Per Product mod?

I have 4.1.8 and just installed both of these mods. This problem isn't huge and I realize the shipping calculator is free so I'm not complaining. I'm just wondering if anyone has this combo of mods working properly and can offer me some advice.

I installed the calculator first and it worked properly. Then I installed the Shipping per Product mod. When I try to estimate shipping before logging in/checking out and have products that don't have all available shipping methods in common, the methods not common to all items are shown anyway. The name of the method isn't shown, but a radio button is shown and the cost is displayed as $0.00. The Shipping Per Product mod does work properly in later checkout steps.

I will likely contact BCS in the morning as well. I just thought some X-Cart forum users might have had this same experience. If so, I'd be grateful for any helpful info.

Thanks,
Jill
__________________
X-Cart Gold 4.1.8 (Live)
BCSE Shipping Estimator for FLC Mod
BCSE Shipping Methods per Product Mod
BCSE Customer Review Management Mod
BCSE Catalog Order Form Mod
X-Cart Gold 4.5.2 (Building/Testing)
USA
Reply With Quote
  #242  
Old 09-26-2007, 09:15 AM
 
jillsybte jillsybte is offline
 

eXpert
  
Join Date: Jun 2006
Location: New York, USA
Posts: 389
 

Default Re: Pre-Login Shipping Calculator

I was looking over the source code of the full cart.php page after the shipping calculator has been utilized. I noticed that the value for the radio button corresponding to the shipping methods not common to all cart items was given a value of "". So I went to the shipping_estimator.tpl and placed the following line:

Quote:
{if $shipping[ship_num].shippingid ne ""}

right after the line:

Quote:
{section name=ship_num loop=$shipping}

Then I entered the closing {/if} tag just before the {sectionelse} tag.

That way, the invalid shipping methods don't even show up. I tested and it works.

Also, this is just my personal preference, but I moved the include shipping_estimator.tpl line in skin1/customer/main/cart.tpl. I placed it after the Fast_Lane_Checkout/cart_subtotal.tpl line instead of before as was stated in the shipping calculator readme file. I was afraid that customers would think the displayed subtotal includes the shipping charges displayed when it really doesn't. Having the subtotal displayed first with the calculated shipping charges below should lessen the chance for confusion.

I hope this helps others having the same problem as I was. Thanks to BCS for making these great mods.

Jill
__________________
X-Cart Gold 4.1.8 (Live)
BCSE Shipping Estimator for FLC Mod
BCSE Shipping Methods per Product Mod
BCSE Customer Review Management Mod
BCSE Catalog Order Form Mod
X-Cart Gold 4.5.2 (Building/Testing)
USA
Reply With Quote
  #243  
Old 10-05-2007, 08:11 AM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Pre-Login Shipping Calculator

Hi

Can this mod be changed to cater for UK Postcodes, I updated the text to say Postcode etc and made it accept up to 8 characters and it looked good, but it wouldn't calculate a shipping cost because it didn't seem to be picking up the postcode, the problem with UK codes is that they can be 7 characters (including spaces) i.e. PE6 7QP, or 8 characters (including spaces) i.e. NW12 7AQ, or even 6 i.e. N1 1AA.

I would really appreciate some help.
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
Reply With Quote
  #244  
Old 10-12-2007, 06:31 PM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default Re: Pre-Login Shipping Calculator

I was wondering if their was a version that works internationally. I use UPS Real Time Rates and we ship a lot to UK, Ireland, Canada and misc countries. I just updated to 4.1.8 and am looking to add this. I had it on my 4.0.18 store and I could get Worldwide rates for other countries from that one. They weren't exact, but close.

I think I remember adding the Canada code. Maybe it is giving Canada shipping rates and that is why they are a little off!
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #245  
Old 10-25-2007, 03:45 AM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Pre-Login Shipping Calculator

Hi all, I have managed to change this mod so that it now works with the UK postcode systems and it is great, I have one small problem and that is I have 3 different shipping methods, Free Local Delivery, which is constrained to a set of specific postcodes, Small Packet, which is up to 2kgs and then UK Standard which is everything else.

If the item is more than 2kgs then only the UK Standard and Free Local Delivery are shown, what I could do with help on is stopping the Free Local Delivery coming up regardless of the entered postcode, does anyone have any idea, I'm not a PHP programmer but I was hoping that maybe I could do a if shipping value is not equal to 0 then hide Free shipping, otherwise show it.

Just to clarify, the Free Local Shipping is always displayed even if I enter a postcode that is not entitled to Free shipping, ofcourse I know that this will be changed when the customer finsihes placing the order, but I don't want arguments with peple who claim, "your system said I could select free shipping then you want to charge me"

Any help greatfully appreciated, once I have it 100% I will share the code back here for any UK shop owners who would like to benefit.

Chris
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
Reply With Quote
  #246  
Old 10-25-2007, 05:26 AM
 
jillsybte jillsybte is offline
 

eXpert
  
Join Date: Jun 2006
Location: New York, USA
Posts: 389
 

Default Re: Pre-Login Shipping Calculator

Dear Chris,

Is the entire line for Local Delivery showing (i.e., name and cost)? I was having a similar problem using this calculator along with the Shipping per Product Mod, where all methods were being listed even if they weren't valid for the combination of products in the cart. In my case, only the value was showing (as $0.00) and not the shipping method name.

Anyway, in case it helps, read my post above (#242) for the code I used in shipping_estimator.tpl to keep invalid methods from showing up. The only drawback is that when all existing shipping methods don't get listed, the top method that does get listed doesn't get highlighted with gray and isn't automatically selected. I personally don't care about that anyway. The customer will have a chance to choose shipping later during checkout.

I also modified my calculator to allow shipping calculation for logged in users as well (it uses their profile shipping country and zip and displays a message that the shipping costs are based on those). Then I modified it to just display "FREE SHIPPING" and no link, etc. for calculating when a free shipping coupon has been applied to the cart.

I hope this helps you. Good luck.

Jill
__________________
X-Cart Gold 4.1.8 (Live)
BCSE Shipping Estimator for FLC Mod
BCSE Shipping Methods per Product Mod
BCSE Customer Review Management Mod
BCSE Catalog Order Form Mod
X-Cart Gold 4.5.2 (Building/Testing)
USA
Reply With Quote
  #247  
Old 10-25-2007, 08:37 AM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Pre-Login Shipping Calculator

Hi Jill the entire line is showing but obviously it just puts FREE Local Delivery (£0.00), unless it is actually valid in which case it doens't have the value.

However I looked at your post and it didn't really make sense to me as the approach I used from this thread doesn't use a shipping_estimator.tpl, any suggestions where I could put this code to acheive the same result?
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
Reply With Quote
  #248  
Old 10-25-2007, 09:02 AM
 
jillsybte jillsybte is offline
 

eXpert
  
Join Date: Jun 2006
Location: New York, USA
Posts: 389
 

Default Re: Pre-Login Shipping Calculator

Chris,

I'm using the free estimator that I downladed from BCS. There is a loop in shipping_estimator.tpl that goes through the existing shipping methods in your store:

Quote:
{section name=ship_num loop=$shipping}
<tr>
<td width="5"{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if}>
<input type="radio" name="shippingid" value="{$shipping[ship_num].shippingid}" {if $shipping[ship_num].shippingid eq $cart.shippingid}checked="checked"{else}onclick="j avascript:{*if $shipping[ship_num].code eq "UPS"} document.getElementById('sc').value = 'UPS';{/if*} this.form.submit();"{/if} />
</td>
<td{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if} align="left">
{$shipping[ship_num].shipping|trademark:$insert_trademark}
{if $shipping[ship_num].shipping_time ne ""} - {$shipping[ship_num].shipping_time}{/if}
{if $config.Appearance.display_shipping_cost eq "Y" && ($login ne "" || $config.General.apply_default_country eq "Y" || $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if}
</td>
</tr>
{if $shipping[ship_num].warning ne ''}
<tr>
<td>&nbsp;</td>
<td class="SmallText">{$shipping[ship_num].warning}</td>
</tr>
{/if}
{sectionelse}
...

I placed the if statement

Quote:
{if $shipping[ship_num].shippingid ne ""}

below the first line. I then closed the if statement before the {sectionelse} line.

So if there's some sort of loop, foreach statement, etc. that goes through your shipping methods, you can place some sort of if statement just inside the loop to suppress the methods that aren't valid in certain situations. In your case, it sounds like a value is appearing when the shipping method is NOT valid. So maybe an if statement that says if the name is FREE local delivery (or the ID is the ID for it) and the value eq "", include in the loop, otherwise don't.

I don't know if that will work or not. I can say that you should be able to solve the problem in a .tpl file and be able to avoid messing with PHP code.

I wish I could be of more help. Hopefully someone here will have an answer, especially since you'll be willing to share with other UK users if you get it working properly.

Jill
__________________
X-Cart Gold 4.1.8 (Live)
BCSE Shipping Estimator for FLC Mod
BCSE Shipping Methods per Product Mod
BCSE Customer Review Management Mod
BCSE Catalog Order Form Mod
X-Cart Gold 4.5.2 (Building/Testing)
USA
Reply With Quote
  #249  
Old 10-27-2007, 03:44 PM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Pre-Login Shipping Calculator

Hi Jill

I got the download from BCSE and installed that after updating my system to 4.1.9 (don't even get me started on that one )

I then followed your approach but adapted it based on your advice, I then identified the shippingid and hid that, all works brill, if the Free Local Delivery applies the two other options are shown with £0.00, which is fine, however I thought it would be better to hide any that had a rate of £0.00 so changed it to look at the rate 0.00, that worked great also, but when Free Local Delivery is valid, because it is £0.00 it remains hidden.

Do you or anyone else have any idea how I might change the code below to hide the Free Local Delivery when the other 2 rates actually aren't £0.00, but show just the Free local Delivery when all 3 = £0.00, hope those ramblings make sense.

Here's the code

{section name=ship_num loop=$shipping}
{if $shipping[ship_num].rate ne "0.00"}
<tr>
<td width="8"{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if}>
<input type="radio" name="shippingid" value="{$shipping[ship_num].shippingid}" {if $shipping[ship_num].shippingid eq $cart.shippingid}checked="checked"{else}onclick="j avascript:{*if $shipping[ship_num].code eq "UPS"} document.getElementById('sc').value = 'UPS';{/if*} this.form.submit();"{/if} />
</td>
<td{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if} align="left">
{$shipping[ship_num].shipping|trademark:$insert_trademark}
{if $shipping[ship_num].shipping_time ne ""} - {$shipping[ship_num].shipping_time}{/if}
{if $config.Appearance.display_shipping_cost eq "Y" && ($login ne "" || $config.General.apply_default_country eq "Y" || $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if}
</td>
</tr>
{if $shipping[ship_num].warning ne ''}
<tr>
<td>&nbsp;</td>
<td class="SmallText">{$shipping[ship_num].warning}</td>
</tr>
{/if}
{/if}

Cheers

Chris
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
Reply With Quote
  #250  
Old 10-29-2007, 05:02 AM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Pre-Login Shipping Calculator

OK, I have sorted it for UK Postcodes, I have also managed to hide my £0.00 options when they are not valid.

Here's the code

{if not $login}
{if $estimate ne "NO"}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="right">
{$lng.txt_enter_zipcode}<br /><br />
<select name='country_estimate'>
{section name=country_idx loop=$countries}
<option value="{$countries[country_idx].country_code}"{if $config.General.default_country eq $countries[country_idx].country_code} selected="selected"{/if}>{$countries[country_idx].country|amp}</option>
{/section}
</select>
<input type="text" name='zip_estimate' size="8" maxlength="8" />
{include file="buttons/button.tpl" button_title=$lng.lbl_calculate_shipping href="javascript: document.cartform.submit()" js_to_href="Y"}
</td></tr>
</table>
{else}
{*<input id="sc" type="hidden" name="selected_carrier" value="" />*}
<table cellpadding="1" cellspacing="0" align="right">
{if $shipping[ship_num].rate eq "0.00" && $shipping[ship_num].shippingid eq "161" }
<tr><td><font class="SmallText">{$lng.lbl_Free_Local_Delivery_te xt}</font></td></tr>
{/if}
{section name=ship_num loop=$shipping}
{if $shipping[ship_num].rate eq "0.00" && $shipping[ship_num].shippingid eq "160" }
<tr><td><font class="Text">{$lng.lbl_Free_Local_Delivery_text}</font></td></tr>
{/if}
{if $shipping[ship_num].rate ne "0.00"}
<tr>
<td width="8"{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if}>
<input type="radio" name="shippingid" value="{$shipping[ship_num].shippingid}" {if $shipping[ship_num].shippingid eq $cart.shippingid}checked="checked"{else}onclick="j avascript:{*if $shipping[ship_num].code eq "UPS"} document.getElementById('sc').value = 'UPS';{/if*} this.form.submit();"{/if} />
</td>
<td{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if} align="left">
{$shipping[ship_num].shipping|trademark:$insert_trademark}
{if $shipping[ship_num].shipping_time ne ""} - {$shipping[ship_num].shipping_time}{/if}
{if $config.Appearance.display_shipping_cost eq "Y" && ($login ne "" || $config.General.apply_default_country eq "Y" || $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if}
</td>
</tr>
{if $shipping[ship_num].warning ne ''}
<tr>
<td>&nbsp;</td>
<td class="SmallText">{$shipping[ship_num].warning}</td>
</tr>
{/if}
{/if}
{sectionelse}
<tr><td><font class="ErrorMessage">{$lng.lbl_no_shipping_for_loc ation}</font></td></tr>
{/section}
</table>
<br style="clear:both;" />
<div style="align:right;text-align:right;width:100%;padding-top:10px;"><a href="cart.php?zip_estimate=clear">{$lng.txt_click _change_zip}</a></div>
{/if}
<hr size="1" noshade="noshade" width="100%"/>
{/if}

You need to create a label called lbl_Free_Local_Delivery_text and amend your shippingid to match your setup, but this now works great, you can check it out at my store which is live so please no test orders, use PE1 1AA as your Free Delivery postcode and EC1a 1AA as your chargeable postcode, it's http://www.4furryfeet.com.

You don't need this part
{if $shipping[ship_num].rate eq "0.00" && $shipping[ship_num].shippingid eq "160" }
<tr><td><font class="Text">{$lng.lbl_Free_Local_Delivery_text}</font></td></tr>
{/if}

If you don't have a delivery zone that offers free shipping.

I am not a programmer as I have said before so I hope this jibberish makes sense, thanks.
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:13 PM.

   

 
X-Cart forums © 2001-2020