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?
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();
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?
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.
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?
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?
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:
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?
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.
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?
This condition is false in my code shipmentRateQuotes.Any() && !invoice.ShippingLineItems().Any()
Rusty, when I debug inside library, this error show. How can I resolve this?
Are you trying to ship to a country you don't have setup to ship to?
No Rusty, I try some country but it still is not ok. Here is my shipping setting.
Make sure your products are set to shippable and have a catalog (usually Default Catalog) selected in the back office.
Rusty, how can I set catalog by manual code? I need a script to create new product and set catalog for it.
Checkout the Merchello Bazaar installler - https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Bazaar/Install/BazaarDataInstaller.cs
is working on a reply...