Jump to content
Sign in to follow this  
cg-tbear

Need Help With Country-State Selector & PWA Mods

Recommended Posts

I have installed the Country-State Selector module and it works great! My problem is that I have also installed the Purchase Without Account module and I want to have the same pulldown lists and other features of the C-SS mod appear during the checkout process for the non-account people as well. It's kind-of important because of how I set up my tax zones.

 

There are 7 new files that you upload:

/catalog/Order_Info.php

/catalog/Order_Info_Process.php

/catalog/includes/login_pwa.php (has the boxes stacked vertically)

/catalog/includes/login_pwa_optional.php (this is for side-by-side boxes)

/catalog/includes/login_acc.php

/catalog/includes/modules/Order_Info_Check.php

/catalog/includes/languages/english/images/buttons/button_create_account.gif

 

I'm not well versed in php, but I think I need to make changes in Order_Info_Process.php & Order_Info_Check.php.

 

In Order_Info_Process.php, I think I need to do something with this code:

 

\ if (ACCOUNT_STATE == 'true') {

if ($entry_country_error) {

$entry_state_error = true;

} else {

$zone_id = 0;

$entry_state_error = false;

$check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "'");

$check_value = tep_db_fetch_array($check_query);

$entry_state_has_zones = ($check_value['total'] > 0);

if ($entry_state_has_zones) {

$zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_name = '" . tep_db_input($state) . "'");

if (tep_db_num_rows($zone_query) == 1) {

$zone_values = tep_db_fetch_array($zone_query);

$zone_id = $zone_values['zone_id'];

} else {

$zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_code = '" . tep_db_input($state) . "'");

if (tep_db_num_rows($zone_query) == 1) {

$zone_values = tep_db_fetch_array($zone_query);

$zone_id = $zone_values['zone_id'];

} else {

$error = true;

$entry_state_error = true;

}

}

} else {

if (!$state) {

$error = true;

$entry_state_error = true;

}

}

}

}

 

In Order_Info_Check.php, I think I need to do something with this code:

 

<?php

if (ACCOUNT_STATE == 'true') {

?>

<tr>

<td class="main"> <?php echo ENTRY_STATE; ?></td>

<td class="main"> 

<?php

$state = tep_get_zone_name($country, $zone_id, $state);

if ($is_read_only) {

echo tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state']);

} elseif ($error) {

if ($entry_state_error) {

if ($entry_state_has_zones) {

$zones_array = array();

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' order by zone_name");

while ($zones_values = tep_db_fetch_array($zones_query)) {

$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('state', $zones_array) . ' ' . ENTRY_STATE_ERROR;

} else {

echo tep_draw_input_field('state') . ' ' . ENTRY_STATE_ERROR;

}

} else {

echo $state . tep_draw_hidden_field('zone_id') . tep_draw_hidden_field('state');

}

} else {

echo tep_draw_input_field('state', tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . ' ' . ENTRY_STATE_TEXT;

}

?></td>

 

There might be other things that need to changed in these files and also, perhaps, in the other files. Does anyone think they can help?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×