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) 264 posts 666 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) 264 posts 666 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 Johansen 2560 posts 8256 karma points
    Nov 05, 2013 @ 08:49
    Anders Burla Johansen
    0

    Hi Paul

    Is that the solution you have posted?

    Kind regards
    Anders

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

    Yep - seems to work for me.


    My new bits in BOLD.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies