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
  #251  
Old 02-04-2008, 07:09 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default Making it work with DHL/Airborne + Taxes

I just downloaded the official "FastLane" version of this mod from BCSE and installed it in Xcart 4.1.8 Gold. It seems to work well for U.S. addresses, but I'm still having a couple of issues...
  1. It doesn't seem to be working with international rates and DHL/Airborne, even though it looks like it should work with DHL/Airborne.
  2. Has anyone got a clue how to make this work so that it also calculates taxes prior to login? It looks like the right tweaks to the func_get_customer_zones_avail() or func_get_customer_zone_ship() inside /include/func/func.cart.php might do the trick, but I can't seem to get my head around it at the moment.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #252  
Old 02-04-2008, 07:25 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Pre-Login Shipping Calculator

There was some discussion in this thread about taxes and non-US postal codes. Another glitch is still the fact that it does not seem to want to pull real-time rates for FedEx when you are using their new integrated method. Rates show fine when logged in, but the shipping calculator won't pull them.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #253  
Old 02-05-2008, 08:58 AM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default Re: Pre-Login Shipping Calculator

I've managed to get the Free X-cart Shipping Estimator for Fastlane Checkout mod to calculate taxes on US orders for a specific state. Simply open /include/shipping_calculator.php

FIND:
Code:
$config["General"]["default_zipcode"] = $zipcode_estimate;
AFTER ADD:
Code:
$config["General"]["default_state"] = "NY";

Presumably, at least for the time being, US stores only need to calculate tax on orders shipped to the state where the business is physically located, so if your store is in NY, the you simply need to set the default_state variable to "NY" and any zipcodes that are in your NY zone will get taxed, but zipcodes that are outside NY will not calculate taxes. Apparently, the zipcode is not enough to get x-cart to calculate taxes...it actually needs the state too. This will probably cause no end of frustration to international store owners.

Also, you might want to add this to your /skin1/mods/Fast_Lane_Checkout/cart_subtotal.tpl file:
Code:
{* normally this would only display if we have $config.Taxes.display_taxed_order_totals checked, but this totally screws up tax calculations on discounted products because it causes taxes to be applied before discounts rather than after discounts, so I'm just showing taxes here even if that setting is turned off *} {* if $cart.taxes and $config.Taxes.display_taxed_order_totals eq "Y" *} {if $cart.taxes} {foreach key=tax_name item=tax from=$cart.taxes} <tr class="TableSubHead"> <td nowrap="nowrap" align="right">{$tax.tax_display_name}:</td> <td><img src="{$ImagesDir}/null.gif" width="5" height="1" alt="" /><br /></td> <td nowrap="nowrap" align="right">{include file="currency.tpl" value=$tax.tax_cost}</td> <td nowrap="nowrap" align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$tax.tax_cost}</td> </tr> {/foreach} {/if}

I'm still working on a solution to getting this working with international shipping. If anyone out there has a working solution to DHL/Airborne that will let my users choose just their country and zipcode and get a realtime rate, I will pay a reasonable fee for the code. Meanwhile, I'll be living in my debugger and will update this thread if I find a solution.


UPDATE: I was able to get international shipping estimates working with USPS and UPS. DHL is another story since you must supply a valid address to get a rate back from DHL. For anyone that is trying to get this working with DHL, here's some comments I just got from their XMLAPI support that might help:
Quote:
The elements <State> and <PostalCode> are required for Canada and Puerto Rico.
They are optional for other Countries.
If you do not know the PostalCode, you can use a default because RateIT
uses the Country to return a rate.

The State and Country elements must be two characters in length.

I have also discovered that if you enable UPS realtime rates with this mod, it totally messes up the returned rates for USPS and other shippers -- they show up as blank. To fix this problem, I did the following, though I'm not sure if there's any implications on performance or functionality of the UPS realtime rates, but it seems to work for me so far.....

OPEN: /xcart/shipping/shipping.php
FIND:
Code:
if ($config["Shipping"]["realtime_shipping"] == "Y" && $current_carrier == "UPS") { $ups_condition .= " AND $sql_tbl[shipping].code='UPS' AND $sql_tbl[shipping].service_code!=''"; }

and change to
Code:
if ($config["Shipping"]["realtime_shipping"] == "Y" && $current_carrier == "UPS") { //$ups_condition .= " AND $sql_tbl[shipping].code='UPS' AND $sql_tbl[shipping].service_code!=''"; }

If you don't comment that out, a bit of invalid SQL is added to queries for non-UPS shipping rates that keeps it from finding non-UPS rates when ithe /shipping/shipping.php file builds the actual $shipping array further down where it says:
Code:
$query = "SELECT *, '$intershipper_rate[rate]' AS rate, '$intershipper_rate[warning]' AS warning, $ship_time_column FROM $sql_tbl[shipping] WHERE subcode='$intershipper_rate[methodid]' AND active='Y' $weight_condition ORDER BY orderby"; $result = func_query_first($query);

If anyone understands the implications of my tweaks on the UPS mod, please post info here.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.

Last edited by minorgod : 02-07-2008 at 12:22 PM. Reason: UPDATED INFO
Reply With Quote
  #254  
Old 02-11-2008, 12:29 PM
 
ValhallaComics ValhallaComics is offline
 

Member
  
Join Date: Aug 2007
Location: Centreville, VA USA
Posts: 12
 

Default Re: Pre-Login Shipping Calculator

Hello,

I'm using 4.1.8 Gold (UNIX), and I have installed this mod, here:
http://forum.x-cart.com/showpost.php?p=174133&postcount=197

I was wondering, however, if I could get this to work as a pop-up box that will list the available shipping options/prices to the customer, instead of only having this available on the checkout/view cart page. Do any of you have a solution for this?

Here's a link to my site, where the calculator is in the category listing:

http://www.valhallacomics.com/home.php
__________________
Kevin Bush
kevin@valhallacomics.com
http://www.valhallacomics.com

X-Cart DB Version: 4.1.8 GOLD [UNIX]
Reply With Quote
  #255  
Old 02-26-2008, 11:41 AM
 
imimin imimin is offline
 

Senior Member
  
Join Date: Mar 2007
Posts: 195
 

Default Re: Pre-Login Shipping Calculator

Does someone know how I can take the code:

Code:
{if $not_logged_message eq "1"} {if $estimate ne "NO"} Enter your zip code to calculate shipping charges. <input type=TEXT name='zip_estimate' size=5 maxlength=5> <input type=image alt="Calculate Shipping" src="../skin1/images/calculate.gif" border=0 align=middle name=btnCalculate > {else} Click here to change your zip code {/if} {/if}

and make the entry box come up in a pop-up box intead?
__________________
Demoing v4.4.2 for new site
Licensed v4.0.19
Reply With Quote
  #256  
Old 02-26-2008, 02:17 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default Re: Pre-Login Shipping Calculator

Quote:
Originally Posted by imimin
Does someone know how I can take the code:

Code:
{if $not_logged_message eq "1"} {if $estimate ne "NO"} Enter your zip code to calculate shipping charges. <input type=TEXT name='zip_estimate' size=5 maxlength=5> <input type=image alt="Calculate Shipping" src="../skin1/images/calculate.gif" border=0 align=middle name=btnCalculate > {else} Click here to change your zip code {/if} {/if}

and make the entry box come up in a pop-up box intead?

Check out the shipping calculator on http://www.bonobospants.com/store/ . I used the Highslide JS library to do it. You can probably view the source and the Highslide JS documentation and figure it out. If not, feel free to contact me and I will give you a quote to do it for you.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #257  
Old 03-13-2008, 09:19 AM
 
shippersplus shippersplus is offline
 

Newbie
  
Join Date: Feb 2008
Posts: 3
 

Default Re: Pre-Login Shipping Calculator

i can not seem to get this mod to work on 4.1.9 anyone able to?
the mod has no errors, but i do not see the click for zip code
__________________
version 4.1.9
Reply With Quote
  #258  
Old 03-13-2008, 12:09 PM
 
samz724 samz724 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 84
 

Thumbs up Re: Pre-Login Shipping Calculator

This mod is excellent. Exactly what I needed, thanks!
__________________
Samz
--------------------------------------
Heavily modified
X-Cart Gold v4.1.10
Reply With Quote
  #259  
Old 03-22-2008, 11:20 AM
 
deltron3030 deltron3030 is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 32
 

Default Re: Pre-Login Shipping Calculator

This mod works fine for me in 4.1.9, Balinor you can get fedex rates my adding this twice below

just under $ship_mods[] = "DHL";

add
if ($fedex_mod == 'FEDEX_direct')
$ship_mods[] = $fedex_mod;



in the myshipper.php file
__________________
xcart 4.2
Reply With Quote
  #260  
Old 03-22-2008, 11:22 AM
 
deltron3030 deltron3030 is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 32
 

Default Re: Pre-Login Shipping Calculator

Something funny i noticed is that for logged in customers they do not get the shipping estimate if they decide to update their cart with more products. Although anonymous customers do not have this problem.

Weird
__________________
xcart 4.2
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 01:33 PM.

   

 
X-Cart forums © 2001-2020