Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
linenumberstrue
CartApi.prototype.doSetShipping = function ()
 {
   var countryCode = request.parameter("countryCode");
   [...]
    
   var cart = carts.current;
    
   if (cart.shippingAddress.countryCode === null) {
     cart.shippingAddress.update({country: countryCode}); // updating countryCode
   }
    
   [...]
    
   return this.doUpdate();
 }
 

Note: the fields are filled with hashes like {country: countryCode}

reading data

Here is an example on how to read data from a JSMA address:

...