Copied to clipboard

Flag this post as spam?

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


  • Nguyen Hien 52 posts 133 karma points
    Jan 13, 2016 @ 10:32
    Nguyen Hien
    0

    Can not save shipping address

    Currently, I can't save shipping address. I call function preparation.SaveShipToAddress(shippingAddress); in SaveAddresses() method but when I call function var shippingaddress = invoice.GetShippingAddresses().FirstOrDefault(); ShippingAddress always return null?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 13, 2016 @ 16:51
    Rusty Swayne
    0

    The shipping address is actually stored in the shipping line item of the invoice. My guess is you are using the invoice extension before you have saved a shipping rate quote via the SalePreparation so the shipping line item is never generated.

    When you are in the checkout workflow, there are:

       var preparation = CurrentCustomer.Basket().SalePreparation();
    
       preparation.SaveShipToAddress(shippingAddress);
    
      // to get it later in the checkout use
    
      var address = preparation.GetShipToAddress();
    
  • Nguyen Hien 52 posts 133 karma points
    Jan 13, 2016 @ 23:54
    Nguyen Hien
    0

    Thanks Rusty, I use default SaveAddress function in SalePreparationOperationsController. But after finishing checkout, i can see any LineItem in invoice. Where can I debug for save Shippingaddress as LineItem of invoice?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 14, 2016 @ 00:03
    Rusty Swayne
    0

    Checkout the Merchello.Bazaar controller code here

    https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Bazaar/Controllers/BazaarCheckoutConfirmController.cs#L45

    Between lines 45 and 66.

    The way it works, is you "package" your basket into a shipment.

    You then quote the shipment.

    The quote is saved to the SalePreparation (which will behind the scenes create the shipment line item). The shipment itself is serialized and stored in the extended data collection associated with the shipment line item.

  • Nguyen Hien 52 posts 133 karma points
    Jan 14, 2016 @ 00:36
    Nguyen Hien
    0

    Hi Rusty, I debuged in this line of code, Shipping address is ok. But ShipmentRateQuotes is null. I don't need ShippingRateQuotes value. Reason from ShipmentRateQuotes is null?

    enter image description here

  • Nguyen Hien 52 posts 133 karma points
    Jan 14, 2016 @ 00:37
    Nguyen Hien
    0

    enter image description here

  • Nguyen Hien 52 posts 133 karma points
    Jan 14, 2016 @ 00:38
    Nguyen Hien
    0

    This condition is false in my code shipmentRateQuotes.Any() && !invoice.ShippingLineItems().Any()

  • Nguyen Hien 52 posts 133 karma points
    Jan 14, 2016 @ 06:51
    Nguyen Hien
    0

    Rusty, when I debug inside library, this error show. How can I resolve this? enter image description here

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 14, 2016 @ 15:04
    Rusty Swayne
    0

    Are you trying to ship to a country you don't have setup to ship to?

  • Nguyen Hien 52 posts 133 karma points
    Jan 14, 2016 @ 17:37
    Nguyen Hien
    0

    No Rusty, I try some country but it still is not ok. Here is my shipping setting.

    enter image description here

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 15, 2016 @ 02:03
    Rusty Swayne
    0

    Make sure your products are set to shippable and have a catalog (usually Default Catalog) selected in the back office.

  • Nguyen Hien 52 posts 133 karma points
    Jan 15, 2016 @ 04:38
    Nguyen Hien
    0

    Rusty, how can I set catalog by manual code? I need a script to create new product and set catalog for it.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 15, 2016 @ 14:50
Please Sign in or register to post replies

Write your reply to:

Draft