Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Wright (suedeapple) 277 posts 704 karma points
    Nov 04, 2013 @ 23:11
    Paul Wright (suedeapple)
    0

    StarterKit Bug - Region selected state not preserved

    When you checkout, if you go from Customer Information to Shipping & Payment, and then back to customer information, region selected state is not preserved.

    Think its may be a javascript issue.

  • Paul Wright (suedeapple) 277 posts 704 karma points
    Nov 04, 2013 @ 23:58
    Paul Wright (suedeapple)
    0
    function changeRegions(countrySelect) {
        var countryRegionSelect = jQuery('select[data-countryselectid=' + countrySelect.attr('id') + ']'),
            countryId = countrySelect.val(),
            countryRegions = TC.getCountryRegions({ countryId: countryId });

      // Select the Billing region, or Shipping region
    var currentCountryRegion = countryRegionSelect.attr('name') == "shippingCountryRegion" ?
    TC.getCurrentShippingCountryRegion() != null ? TC.getCurrentShippingCountryRegion().id : 0 :
    TC.getCurrentPaymentCountryRegion() != null ? TC.getCurrentPaymentCountryRegion().id : 0;

        countryRegionSelect.find('option[value!=0]').remove();
        for (var i = 0; i < countryRegions.length; i++) {
            var countryRegion = countryRegions[i];

            var selected = (currentCountryRegion == countryRegion.id) ? "selected" : "";

            countryRegionSelect.append('selected + '>' + countryRegion.name + '');
        }
    }
  • Anders Burla 2560 posts 8256 karma points
    Nov 05, 2013 @ 08:49
    Anders Burla
    0

    Hi Paul

    Is that the solution you have posted?

    Kind regards
    Anders

  • Paul Wright (suedeapple) 277 posts 704 karma points
    Nov 05, 2013 @ 11:45
    Paul Wright (suedeapple)
    0

    Yep - seems to work for me.


    My new bits in BOLD.

Please Sign in or register to post replies

Write your reply to:

Draft