BigCommerce - Hosted Ecommerce Software by Interspire

Interspire Forum

 
Go Back   Interspire Forum > Interspire Shopping Cart Community Forum > Customization and Integration > Code Modification and Development Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2008, 01:10 AM
Joshua Walcher + Joshua Walcher is offline
Josh W (Interspire Staff)
 
Join Date: Aug 2008
Posts: 594
Default Shipping Address Hack

This hack is not supported by Interspire, but it will allow you to add/remove countries & states to your database. This is especially handy if you're from a country that needs more or less options than what ISC currently is defaulting to (UK comes to mind). To use this hack:

1) Unzip the attached folder.
2) Move the unzipped folder to your admin folder.
3) Adjust the authorizations for the ischack folder to 777.
4) Point your browser to: *shoppingcart*/admin/ischack/ (replacing *shoppingcart* with your actual shopping cart location)

The script will walk you through the rest. You will need to know your database name, database user's username and password, and host, which I've defaulted to localhost.

Enjoy!
Attached Files
File Type: zip ischack.zip (54.3 KB, 384 views)

Last edited by Joshua Walcher; 08-20-2008 at 01:17 AM..
Reply With Quote
  #2  
Old 08-21-2008, 11:23 PM
darkhelmet darkhelmet is offline
Member
 
Join Date: Aug 2008
Posts: 56
Default

Thanks joshua.

Before I do this, and i know you said it walks you thru, but will it help me delete all the countries we don't ship to? So on the checkout page or anywhere there is a address the only choice will be our country?
Reply With Quote
  #3  
Old 08-21-2008, 11:26 PM
Joshua Walcher + Joshua Walcher is offline
Josh W (Interspire Staff)
 
Join Date: Aug 2008
Posts: 594
Default

Yes, you may delete any country you don't want to have in the list. However, once it's gone, it's gone. To get it back again, you'd have to add it back manually using this app.
Reply With Quote
  #4  
Old 09-15-2008, 07:48 PM
darkhelmet darkhelmet is offline
Member
 
Join Date: Aug 2008
Posts: 56
Default

joshua i finally got around to tying your hack, but it did not work

please see the screen - none of the drop-downs are populated with chioices to delete.

i was practicing on a copy of the site on my local server.
Attached Images
File Type: png shipAddrHack.png (5.0 KB, 420 views)
Reply With Quote
  #5  
Old 09-15-2008, 10:34 PM
Joshua Walcher + Joshua Walcher is offline
Josh W (Interspire Staff)
 
Join Date: Aug 2008
Posts: 594
Default

That screenshot would seem to indicate that the code is connecting to the database, but the table names don't match. You'll need to change the code on index.php to match your table names. My guess? Your tables names probably have a prefix like isc_ instead of just being the straight table name. As in, "isc_countries" instead of just "countries".
Reply With Quote
  #6  
Old 09-15-2008, 11:09 PM
darkhelmet darkhelmet is offline
Member
 
Join Date: Aug 2008
Posts: 56
Default

Not hardly as versed in PHP and stuff as you, so I tried the following:

on line #97 I changed it to read

"while($a = mysql_fetch_assoc($isc_countries)){"

to match the country database table.

on line #140 I changed it to read "while($a = mysql_fetch_assoc($isc_country_states)){"

to match U.S. states database table.

I made a couple more changes i thought it needed but the screen looks the same as my last post.
Reply With Quote
  #7  
Old 09-16-2008, 12:07 AM
Joshua Walcher + Joshua Walcher is offline
Josh W (Interspire Staff)
 
Join Date: Aug 2008
Posts: 594
Default

Sorry, I should have explained it better.

The changes you made were not correct.

Here's an example of what I'm talking about. If your tables are named with an isc_ in front of them, then you would change:

$sql = "SELECT * FROM `countries` ORDER by `countryname` ASC";
$country = mysql_query($sql,$connection);
while($a = mysql_fetch_assoc($country)){

to:

$sql = "SELECT * FROM `isc_countries` ORDER by `countryname` ASC";
$country = mysql_query($sql,$connection);
while($a = mysql_fetch_assoc($country)){

The $country should stay the same. You just need to change the table name in the SELECT statements.
Reply With Quote
  #8  
Old 10-21-2008, 09:58 PM
Joshua Walcher + Joshua Walcher is offline
Josh W (Interspire Staff)
 
Join Date: Aug 2008
Posts: 594
Default

Hey everyone, I'm going to update this hack for 4.0 and add the db prefix feature and make it a little easier to use. I'll post the update here.
Reply With Quote
  #9  
Old 10-22-2008, 08:35 PM
bubblecableboxes + bubblecableboxes is offline
Interspire Customer
 
Join Date: Sep 2008
Posts: 36
Default

In the next relese why dont you place this into the install.... that would be totaly better
Reply With Quote
  #10  
Old 10-23-2008, 08:06 AM
Joshua Walcher + Joshua Walcher is offline
Josh W (Interspire Staff)
 
Join Date: Aug 2008
Posts: 594
Default

Finished it off. This is for version 4.0 of the shopping cart. I removed the installation step and it automatically pulls prefixes for you. Read the readme for more detail.
Attached Files
File Type: zip Countries.zip (66.6 KB, 258 views)

Last edited by Joshua Walcher; 10-23-2008 at 11:39 PM..
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump