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
  #271  
Old 05-03-2008, 05:28 PM
 
swamp-industries swamp-industries is offline
 

Newbie
  
Join Date: Oct 2007
Posts: 1
 

Default Re: Pre-Login Shipping Calculator

I had a similar edition made to my site, so customers can enter a postcode or select a country to receive a quote for all items in the shopping cart, before checking out.

The developer I used was excellent, here is a link to his site.
http://xcartmod.com/cart/home.php
__________________
ok
Reply With Quote
  #272  
Old 05-07-2008, 12:18 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

Yesterday I was adding the BCS Pre-login shipping calculator to my store. I suddenly started getting the No available shipping methods message for orders. I went back and tried to remove it, but found that the ownership had been removed on cart.php and I could not edit or replace it.

I did an xcartdump.sql and saved the file on my computer. I then restored my website from a daily backup done by my plesk server, through the plesk interface.

Everything seemed to be okay, until I tried to place a test order and I kept getting this message:

Your order is being placed. Please wait...
INVALID SQL: 1062 : Duplicate entry '0' for key 1
SQL QUERY FAILURE:INSERT INTO xcart_orders (`login`, `membershipid`, `membership`, `total`, `giftcert_discount`, `giftcert_ids`, `subtotal`, `shipping_cost`, `shippingid`, `tax`, `taxes_applied`, `discount`, `coupon`, `coupon_discount`, `date`, `status`, `payment_method`, `paymentid`, `payment_surcharge`, `flag`, `details`, `customer_notes`, `clickid`, `language`, `extra`, `title`, `firstname`, `lastname`, `phone`, `fax`, `email`, `url`, `company`, `tax_number`, `tax_exempt`, `b_title`, `b_firstname`, `b_lastname`, `b_address`, `b_city`, `b_county`, `b_state`, `b_country`, `b_zipcode`, `s_title`, `s_firstname`, `s_lastname`, `s_address`, `s_city`, `s_county`, `s_state`, `s_country`, `s_zipcode`) VALUES ('anonymous-0', '0', '', '1.00', '0', '', '1.00', '0.00', '0', '0.00', 'N;', '0.00', '', '0.00', '1210194300', 'Q', 'Purchase Order', '2', '0', 'N', 'B-996124656afcff0fc6c91a2a8f389982fbf9716b6bd587dcce 19c205f2070b31038a1ff1928010306d4a71f158329791d1ca 191f5510dea59c71f18746266cf792244565c050f232517d00 ddc354171e25b23370a67ee46f9e77c91a6697855d44115772 684444d0', '', '', 'US', 'a:2:{s:17:\"additional_fields\";a:1:{i:0;a:4:{s:7 :\"fieldid\";s:1:\"3\";s:7:\"section\";s:1:\"S\";s :5:\"value\";s:0:\"\";s:5:\"title\";s:7:\"Company\ ";}}s:8:\"tax_info\";a:5:{s:26:\"display_taxed_ord er_totals\";s:1:\"N\";s:31:\"display_cart_products _tax_rates\";b:0;s:14:\"taxed_subtotal\";s:4:\"1.0 0\";s:25:\"taxed_discounted_subtotal\";s:4:\"1.00\ ";s:14:\"taxed_shipping\";s:4:\"0.00\";}}', '', 'Jenny', 'Fine', '', '', 'ml@dinnerandamurder.com', '', '', '', 'N', '', 'Jenny', 'Fine', 'AMCTt ', 'MH', '', 'CA', 'US', '60626', '', 'Jenny', 'Fine', 'AMCT ', 'MH', '', 'CA', 'US', '60626')
INVALID SQL: 1062 : Duplicate entry '0-ip' for key 1
SQL QUERY FAILURE:INSERT INTO xcart_order_extras (orderid, khash, value) VALUES ('', 'ip', '68.119.107.238')
INVALID SQL: 1062 : Duplicate entry '0' for key 1
SQL QUERY FAILURE:INSERT INTO xcart_order_details (`orderid`, `productid`, `product`, `product_options`, `amount`, `price`, `provider`, `extra_data`, `productcode`) VALUES ('', '16183', 'Nothing', '', '1', '1.00', 'coolbaby2', 'a:3:{s:15:\"product_options\";N;s:5:\"taxes\";a:0 :{}s:7:\"display\";a:3:{s:5:\"price\";s:4:\"1.00\" ;s:16:\"discounted_price\";s:4:\"1.00\";s:8:\"subt otal\";s:4:\"1.00\";}}', 'SKU16183')

(I replaced personal info. No email, name, or address had been used before. No username was provided)

Access denied !

You are not allowed to access that resource!

Error ID: 59

First n order with Order ID# 0 is actually placed, in spite of the message and queued. I am at about Order ID# 11778 now, not 0. The second time it was not placed. It appears to me as if it keeps assigning an order ID of 0 to new orders and that is the reason for the Duplicates.

I have tried to restore the xcartdump.sql from within x-cart and it acts like it does so, but the missing orders from the xcartdump.sql are not there and no one can purchase anything. I have restored my site from 2 different backups I have on the server, twice each, and the store still will not work. Customers cannot buy anything.

I also went in and tried to clean the logs and received this following error:

Not enough permissions to delete the following files:
xxxxxxxx/store/var/log/x-errors_env-070807.php

I am beginning to suspect that some type of serious permission thing is going on here. I don't know if it is the store or the server, but since it is only in the store, I have to think it is something going on in there.

I have tried deleting xcart_sessions xcart_users_online, optimizing the tables. Nothing is working. Please help! I would be happy to pay someone to help me with this, if they know. I have an Urgent Ticket into x-cart, but 6 hours with no reply yet, so I am hoping someone can help me here, as I know xcart can take a week or more now to handle things.

I have also found that when I start a new topic in the forum here, the post does not go to the Search: New Posts, so no one views it. I have posted twice with not one view. I am hoping this post makes it into the New Posts, which actually get read quickly.
__________________
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
  #273  
Old 05-07-2008, 01:50 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

ALMOST SOLVED: I discovered that when the backup restored it took out the Auto Increment Settings in the Orders, Order_Details and the Order_Extras. Selecting Auto Increment in the Extra Field in Phpmyadmin for the Order ID in these 3 tables. I am still getting the error message for the User name, I think. Anonomous-0 is how this is coming up in the order, so I am not sure which field in what table I need to Auto Increment. Anyone have any ideas???
__________________
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
  #274  
Old 05-08-2008, 10:59 AM
 
ReadytoCover ReadytoCover is offline
 

Senior Member
  
Join Date: Apr 2008
Posts: 124
 

Default Re: Pre-Login Shipping Calculator

I'm getting the Sorry, no shipping methods with the BCES Shipping Calculator as well...using UPS Real Time only...anyone else run into and fix this problem?

My one page checkout page still computes and displays shipping without a problem, its just the pre-login calculator that doesn't work.

Unfortunately I don't know enough about your issue to assit Mary Lee...I'd probably just make it worse! I hope it gets resolved soon
__________________
x-cart 4.1.9
Reply With Quote
  #275  
Old 05-08-2008, 11:17 AM
  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 ended up re-installing from a VPS backup after I exported my data as INSERT so I could add in the new orders since the last VPS backup a couple days ago. Another reason I am so glad I have a VPS.

I too would really like to resolve the No Shipping Methods Available, as I don't really want to spend another 2 days like I just went through. Heads up to everyone. The original problem came in when I did a restore from backup for the domain using Plesk. Apparently this is an issue with some versions of Plesk. They do not restore the Auto Increment settings in a database. That is just nuts!
__________________
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
  #276  
Old 05-09-2008, 02:53 PM
 
ReadytoCover ReadytoCover is offline
 

Senior Member
  
Join Date: Apr 2008
Posts: 124
 

Default Re: Pre-Login Shipping Calculator

Well, I figured out the Sorry, No shipping problem (at least for me). It didn't work with the Default Location unchecked in General Settings, but I noticed it DID work if I checked that box AND entered the same zipcode. Once I removed the zipcode in the Default Location it worked for that entire state. However, since you cannot de-select a state it wouldn't work for anyone who was outside of the state.

So I went into cart.php around line 415 and commented out:

Code:
$userinfo["b_state"] = $userinfo["s_state"] = $config["General"]["default_state"];


Now it works. (Make sure you have the assume default location box CHECKED in General Settings)

I'm not a code guru by any sorts so back up your file before attempting this.

Hope it helps.
__________________
x-cart 4.1.9
Reply With Quote
  #277  
Old 05-15-2008, 07:53 PM
 
MBA MBA is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 245
 

Default Re: Pre-Login Shipping Calculator

Well, so..., geese... ok, not to rebirth this thread or anything but... 4.1.10... It works with a vanilla install of 4.1.10 sort of. The odd thing is I'm getting both radial buttons and a drop down menu. I've enable all FEDEX, UPS, USPS and DHL options just for fun. All real-time rates. The odd thing is only the drop down menu will change the shipping rate. You can click the radial buttons and the page refreshes but the shipping rate doesn't change.

Will look more closely at this. It should convert to something usable without much time commitment but for those of you patching to 4.1.10, it won't work directly from the patch.

Say Carrie, how about saving me the headache and updating your mod for 4.1.10 and charging a pence for it?!
__________________
xCart Pro Version 4.0.17, 4.0.19, 4.1.8, 4.1.10, 4.1.11, 4.1.12 - retired
xCart Pro Version 4.3.1 - production
xCart Pro Version 4.5.1 - testing
RHEL Platform
Reply With Quote
  #278  
Old 05-16-2008, 12:31 AM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Pre-Login Shipping Calculator

MBA thanks for that it helps my decision about moving from 4.1.9 to .10, I'll wait as my store is pretty modded right now with some nice stuff from the support guys, Eugene has been fantastic, but this mod is one that took me a while to get working and I'd prefer it to stay this way.

Thanks for the info.
__________________
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
  #279  
Old 05-23-2008, 10:33 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Pre-Login Shipping Calculator

I wasn't sure if I should post this here or start a new thread but here it is. Moderators please move if necessary. I have this solution to show rates for FedEx on the prelogin calculator. As far as I can tell it works. Attached is a sql file to create and populated a table with the zip codes for USA. Please note that the info in this file is 4-5 years old but for the purpose of getting zip code and appropriate state works fine. Also here is the code for the shipping calculator that goes into cart.php

PHP 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 strlen($zipcode_estimate);
if(
$count 4){ //checking length 
$zipcode_estimate "";

func_header_location("cart.php"); 

if(
$zipcode_estimate != ""){ 
$customer_temp_state func_query_first_cell("SELECT state_abbr FROM `zip_codes` WHERE zip_code='$zipcode_estimate'");
$count strlen($zipcode_estimate);
if(
$count == 5) { 
$config["General"]["default_country"] = "US";
$config["General"]["default_state"] = $customer_temp_state;
$config["General"]["default_zipcode"] = $zipcode_estimate
$config["General"]["apply_default_country"] = "Y";
$userinfo["s_country"] = "US";
$userinfo["s_state"] = $customer_temp_state;
$userinfo["s_zipcode"] = $zipcode_estimate;
$smarty->assign("estimate","NO"); 
} else {
$config["General"]["apply_default_country"] = "Y"
$config["General"]["default_country"] = "CA";
$config["General"]["apply_default_state"] = "Y";
$config["General"]["default_zipcode"] = $zipcode_estimate
$userinfo["s_country"] = "CA";
$userinfo["s_zipcode"] = $zipcode_estimate;
$smarty->assign("estimate","NO"); 
}

# prelogin calculator end 

This is for USA only as I do not ship to Canada so I was not looking for a solution for Canada.
Turns out I can attached only 512K so I split the file.
Attached Files
File Type: zip zip_codes_1.zip (322.8 KB, 110 views)
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #280  
Old 05-23-2008, 10:34 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Pre-Login Shipping Calculator

Second part of the above
Attached Files
File Type: zip zip_codes_2.zip (358.4 KB, 104 views)
__________________
Steve Stoyanov
CFLSystems.com
Web Development
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:42 AM.

   

 
X-Cart forums © 2001-2020