Copied to clipboard

Flag this post as spam?

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


  • Zac 239 posts 541 karma points
    Jun 16, 2014 @ 18:33
    Zac
    0

    Setting payment and shipping region not working

    We're setting the Payment country region and shipping country region in a form post but they aren't getting set.

    We were originally setting the region via a select list, but it wasn't working.  As a quick test, we hard coded the state id, but it still isn't working.  
    The order properties and country are being set, but the country region (state in our case) isn't being set.
    This is preventing our order total from recalculating correctly.

     

          <form action="/base/TC/FormPost.aspx" method="post">
            <input name="storeId" type="hidden" value="@storeId" />
            <input name="AddOrUpdateOrderProperties" type="hidden" value="properties : properties" />
            <input name="properties" type="hidden" value=" [ OUR ACTUAL PROPERTIES ] " />

            <input name="SetCurrentPaymentCountry" type="hidden" value="countryId" />
            <input name="SetCurrentPaymentCountryRegion" value="stateSet" type="hidden" />
            <input name="SetCurrentShippingCountryRegion" value="stateSet" type="hidden" />
            <input name="SetCurrentShippingCountry" type="hidden" value="countryId" />
            <input name="countryId" value="1" type="hidden" />
            <input name="stateSet" value="21" type="hidden" />

    FYI: We're using TeaCommerce 2.3.1 on umb 7.1.4

     

  • Anders Burla 2560 posts 8256 karma points
    Jun 17, 2014 @ 14:14
    Anders Burla
    100

    The parameter for SetCurrentPaymentCountryRegion MUST be countryRegionId as stated by the documentation.
    http://documentation.teacommerce.net/html-api/country-region/setcurrentpaymentcountryregion/

    If you have both payment and shipping region on the same page you can have liek this:
    <input name="SetCurrentPaymentCountryRegion" value="countryRegionId : paymentCountryRegionId" type="hidden" />
    <input name="SetCurrentShippingCountryRegion" value="countryRegionId : shippingCountryRegionId" type="hidden" />
    <input name="paymentCountryRegionId" value="1" type="hidden" />
    <input name="shippingCountryRegionId" value="21" type="hidden" />

  • Zac 239 posts 541 karma points
    Jun 17, 2014 @ 16:30
    Zac
    0

    This is working now using the second method.

    A few comments:
    1. I think the documentation should be updated to show the example where both payment and shipping region are set on the same page.  Without your help we would not have been able to find this.  We set the value to a name different than countryRegionId because we did not know how to set these two parameters otherwise
    2. It would also be helpful to state that the payment / shipping country must be set before the region.  In one case we had the SetCurrentShippingCountryRegion one line above SetCurrentShippingCountry and that prevents the region from getting set.  

  • Anders Burla 2560 posts 8256 karma points
    Jun 18, 2014 @ 09:01
    Anders Burla
    0

    Hi Summit

    The documentation has now been updated to explain how multiple methods are invoked.
    http://documentation.teacommerce.net/html-api/

    The reason for country before region is that the system checks if the region is valid for the current country which is first changed after your region change method.

    Kind regards
    Anders

Please Sign in or register to post replies

Write your reply to:

Draft