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
  #151  
Old 12-14-2005, 08:03 PM
 
Mr Bob Mr Bob is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 199
 

Default

It doesn't help much if the user can't easily find out what the shipping is for the items in their cart. One day... someone will create/sell the mod.
__________________
Product: X-Cart Gold
Current version: 4.0.14

Additional Mods: X-Affiliate
Reply With Quote
  #152  
Old 12-15-2005, 03:43 PM
 
yuehan yuehan is offline
 

Advanced Member
  
Join Date: Oct 2005
Posts: 44
 

Default

It is VERY easy! And it's working now!

I highly recommend this mod.
__________________
John -- USA
X-Cart Gold 4.3.2
Linux CentOS 5
Apache 2.2.15
PHP 5.2.13
MySQL 5.0.91
Reply With Quote
  #153  
Old 12-18-2005, 03:31 PM
 
dprice.sf dprice.sf is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 66
 

Default

I've got this mod to work in 4.0.16 for fedex rates - but once a customer adds a zip code and calculates the shipping the option to change that entry doesn't appear.

It should be displaying "Click here to change your zip code"

Anyone have any ideas?

Heres what my code looks like

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="{$ImagesDir}/calculate.gif" border=0 align=middle name=btnCalculate> {else} Click here to change your zip code {/if} {/if}
__________________
Version 4.0.14
Reply With Quote
  #154  
Old 12-19-2005, 03:16 PM
 
dprice.sf dprice.sf is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 66
 

Default

I figured out what the problem was with my previous post. Works now thats to BCS Engineerings Mod.

Nwo I'm trying to remove the default shipping message

"Sorry, there are no available shipping methods for your location.:
anonymous"

Does anyone have any idea on how hide this message - I assume its tied to the login querry in cart.php

And that if someone enters a zip which fedex doesn't ship to - they'll get a similar message

So I can't just delete the function

Any thought/ideas would be great
__________________
Version 4.0.14
Reply With Quote
  #155  
Old 01-17-2006, 04:56 PM
 
simco simco is offline
 

Advanced Member
  
Join Date: Sep 2005
Posts: 45
 

Default

Does this mod work for version 4.0.17?
__________________
www.templatedepot.com

PROGRAM: X-CART PRO
VERSION: Version 4.0.14
RUNNING ON: Linux Enterprise 3.0
Reply With Quote
  #156  
Old 01-29-2006, 08:30 PM
  rubberneck's Avatar 
rubberneck rubberneck is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 161
 

Default Tax

Ok, I think I'm missing something. I've got this working perfectly, except for the tax. I have my cart set to charge MA sales tax for orders in MA. This works fine on checkout, but with the pre-login shipping calculator, it includes the tax no matter which zip code is input. This is confusing to the user as it shouldn't be showing tax in the total if they're not using a MA zip code.

Any ideas.

I'm in version 4.0.17 by the way.

Thanks,
jeff
__________________
--
Version 4.0.17 Gold
Version 4.1 Gold
Version 4.4 Gold
Reply With Quote
  #157  
Old 02-07-2006, 09:08 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default Shipping Estimator for US and Canada

I've modified the original code to take Canada into consideration and allow both US and CA zipcodes to be utilized.

Edit Cart.php locate:
Code:
$intershipper_recalc = "Y";

BEFORE this add:
Code:
# prelogin calculator start # modified by cart-lab.com to allow US and CA zipcodes x_session_register("zipcode_estimate"); $trusted_post_variables = array("zip_estimate"); require $xcart_dir."/include/states.php"; if($HTTP_GET_VARS['zip_estimate'] == "clear"){ $zipcode_estimate = ""; func_header_location("cart.php"); } if(!empty($zip_estimate)){ $zipcode_estimate = $zip_estimate; #$count = substr_count($zipcode_estimate,"0") + substr_count($zipcode_estimate,"1") + substr_count($zipcode_estimate,"2") + substr_count($zipcode_estimate,"3") + substr_count($zipcode_estimate,"4") + substr_count($zipcode_estimate,"5") + substr_count($zipcode_estimate,"6") + substr_count($zipcode_estimate,"7") + substr_count($zipcode_estimate,"8") + substr_count($zipcode_estimate,"9"); $count = strlen($zipcode_estimate); if($count < 4){ //checking for 5 digits $zipcode_estimate = "";} func_header_location("cart.php"); } if($zipcode_estimate != ""){ $count = strlen($zipcode_estimate); if($count == 5) { $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_zipcode"] = $zipcode_estimate; $userinfo["s_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); } else { $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_country"] = "CA"; $config["General"]["default_zipcode"] = $zipcode_estimate; $userinfo["s_country"] = "CA"; $userinfo["s_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); } } # prelogin calculator end

Now onto the .tpl, edit skin1/customer/main/cart_totals.tpl and locate:
Code:
<input type=hidden name=paymentid value="{$smarty.get.paymentid|escape:"html"}">

BEFORE this line add:

Code:
{* Shipping Estimate *} {*{if $not_logged_message eq "1"}{$lng.txt_order_total_msg}{/if}*} {if $login eq ""} {if $estimate ne "NO"} Enter your zip code to estimate shipping charges: <input type=TEXT name='zip_estimate' size=6 maxlength=6> {*{include file="main/states.tpl" states=$states name="s_state" default=$userinfo.s_state default_country=$userinfo.s_country}*} <input type=image alt="Calculate Shipping" src="{$ImagesDir}/go.gif" border=0 align=absmiddle name=btnCalculate> {else} Click here to change your zip code: {$userinfo.s_zipcode} {/if} {/if} {* END Shipping Estimate *}

Note the original commented code that will need to be replaced as well:
Code:
{*{if $not_logged_message eq "1"}{$lng.txt_order_total_msg}{/if}*}

Anyhow, I figured I would contribute this extension to an already much needed mod X-Cart should have by default if you ask me
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #158  
Old 02-08-2006, 12:29 PM
 
AWDC AWDC is offline
 

Advanced Member
  
Join Date: Jul 2004
Posts: 62
 

Default

Some people have asked about this and no one has responded. Does anyone know of way to let the customer calculate the shipping cost for an item BEFORE adding it to the cart? Like maybe adding this to the product description page? This seems much more logical than making the customer add the product to the cart and THEN seeing how much the shipping is.
__________________
Thanks, Greg

X-Cart Version 4.2.0
Litecommerce Version 2.2.21
Reply With Quote
  #159  
Old 02-08-2006, 01:19 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Best method I could think of is to utilize this same code but rather make a seperate form on product pages that submits to a custom PHP page where you can easily add it to the customers cart, get the calculation, display it to the user and remove the item from the customers cart.

Basically adding and removing the product to the customers cart would be transparent as to get all the needed $cart variables to perform the estimation. Problem with this is if a customer already has something in their cart, the calculation would be for both items instead of one.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #160  
Old 02-28-2006, 03:05 PM
 
speedworx speedworx is offline
 

Member
  
Join Date: Jan 2006
Posts: 10
 

Default Advanced Order Management

Has anyone figured out how to get this to wok in AOM? If you attempt to modify an order, it throws an error:
Invalid argument supplied for foreach() in /xxx/shipping/mod_UPS.php on line 275

I'm assuming that the problem is due to the fact that the products aren't "in the cart" anymore, but rather in an orders table. The section of code that causes the error is:

Code:
EOT; //<? //only in here to make code look nicer in php editor..doesn't affect anything global $cart; $upsmxwt = "150"; if ($UPS_weight >= $upsmxwt) { foreach($cart['products'] as $prodKey => $prodArray) { for( $quantity=0; $quantity<$prodArray['amount'];$quantity++) { $UPS_weight = $prodArray['weight']; $query .=<<<EOT <Package> <PackagingType> <Code>$packaging_type</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>$UPS_wunit</Code> </UnitOfMeasurement> <Weight>$UPS_weight</Weight> </PackageWeight> $dimensions_query $pkgparams </Package> EOT;
__________________
XCart4.0.19
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 09:39 PM.

   

 
X-Cart forums © 2001-2020