Small fix for the zone select lists in the checkout

  • Impression eStudio
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 months 1 week ago #164204 by Impression eStudio
Small fix for the zone select lists in the checkout was created by Impression eStudio
Hi, 

In the steps of the checkout the user selects the country and the zone for the payment and shipping address. The problem has to do with the zone list.

Specifically the files: 
- components\com_eshop\themes\default\views\checkout\guest_shipping.php
- components\com_eshop\themes\default\views\checkout\guest.php
- components\com_eshop\themes\default\views\checkout\payment_address.php
- components\com_eshop\themes\default\views\checkout\register.php
- components\com_eshop\themes\default\views\checkout\shipping_address.php
- components\com_eshop\themes\default\views\customer\address.php
use the code:
$('select[name=\'zone_id\']').html(html);
in order to update the values of the zone select list after the country is selected.

The problem is that this is a general selection of all the zone lists of all steps and not of the current step. 
So if I, as a guest user, change the delivery zone in the 3rd step, the zone list in the 2nd step will be also affected, and if I return to the second step I will have to reselect the zone.

The solution is to include the ID of the current step, like it is included for the same code for the country list.
So the code in the file "components\com_eshop\themes\default\views\checkout\guest_shipping.php" will change from
$('select[name=\'zone_id\']').html(html);
to: 
$('#shipping-address select[name=\'zone_id\']').html(html);

The code in the file "components\com_eshop\themes\default\views\checkout\payment_address.php" will change from
$('select[name=\'zone_id\']').html(html);
to: 
$('#payment-address select[name=\'zone_id\']').html(html);

And so on...

I hope I wrote the above in an easy way to understand.

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
8 months 4 weeks ago #164569 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Small fix for the zone select lists in the checkout
Hello,

Thank you for your report. I think it is really useful and rather easy to understand. I will check and correct this issue.

Sincerely, Giang

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong