Add extra funtionality to shipping in cart.
Currently the ship in cart prompts the country of the customer using the IP if they are not logged in and the delivery country & post code if they are logged in.
Need to add addional functionality to retain country and postcode if they are changed and prompt with them if the customer returns to the shopping_cart.php.
/includes/moules/[login to view URL]
============================
if ($order->delivery['country']['iso_code_2'] == '') {
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("[login to view URL]{$ip}/json"));
$ctry = $details->country;
} else {
$ctry = $order->delivery['country']['iso_code_2'];
$postcode = $order->delivery['postcode'];
}
$country_query = tep_db_query("SELECT countries_id FROM countries WHERE countries_iso_code_2='".$ctry."'");
$country = tep_db_fetch_array($country_query);
$ctry = (int)$country['countries_id'];
echo '<div class="ui-state-default">' . TEXT_SHIPPING_QUOTES . '</div>';
echo '<div class="ui-widget-content form-fields" style="padding:1%;">
<div class="grid-30">
<label for="country">' . TEXT_COUNTRY . '</label><br>' . tep_draw_pull_down_menu('country', $countries_array, $ctry, 'id="country" style="width:100%;"') . '
</div>
<div class="grid-20">
<label for="postcode">' . TEXT_POSTCODE . '</label><br>' . tep_draw_input_field('postcode', isset( $postcode ) ? tep_output_string( $postcode ) : '', 'id="postcode" style="width:100%;"') . '
</div>
Acceptance Testing
Visit shopping [login to view URL] with products in basket.
Change to Iceland get quote leave page and revisit
Iceland to be prompted.
Add Post code
leave page and revisit
country and post code from last visit to be prompted.
Repeat for USA and UK
Log in and with products in basket.
Shipping address country & PC to be promted
Change shipping address and revisit shopping [login to view URL] with products in basket.
Orig shipping address & PC to be displayed
Change to Iceland get quote leave page and revisit
Iceland to be prompted.
Add Post code
leave page and revisit
country and post code from last visit to be prompted.
Repeat for USA and UK
Hi, We have throughly read your requirements and believe that we can deliver exceptional results. We hope you will consider using our services. Kind Regards,