## AddCartLine
<table class="TableStyle-Borders" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetCartLine</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If the parameter CartLine is not null, sets the result CartLine to the parameter CartLine, otherwise looks through existing CartLines for a matching CartLine for the parameter Product, UnitOfMeasure and CustomProperties and if found, sets the result CartLine to that CartLine.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CreateCartLine</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If the result CartLine is null, creates a new CartLine for the parameter Product, UnitOfMeasure, Notes, CustomProperties and CostCode (if AllowCostCodeEdit is True, if not finds the first active CostCode for the Customer, if there is none, sets CostCode to blank). Then sets result CartLine to the new CartLine.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">AddCartLine</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If the Cart does not already contain the CartLine:</p> <ul> <li>Sets the CartLine Website to the Cart Website if the CartLine Website is not null, if the Cart Website is null, sets it to the current Website.</li> <li>Sets the CartLine TaxCode1 and TaxCode2 to the Cart TaxCode1 and TaxCode2 if they are not set.</li> <li>Sets the CartLine Warehouse to the Cart DefaultWarehouse.</li> <li>Sets the CartLine ShipSite to the CartLine Warehouse ShipSite if it is set.</li> <li>Sets the CartLine Line to the next Line number if the Cart Status is not PunchoutOrderRequest</li> <li>Adds the CartLine to the Cart's CartLines collection.</li> <li>Sets result WasAdded to true.</li> </ul></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">SetRecalculateCartFlags</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result WasAdded is true:</p> <ul> <li>Sets Cart RecalculatePromotions to true.</li> <li>Sets Cart ShippingCalculationNeededAsOf to the current date time.</li> <li>Sets Cart RecalculateTax to true.</li> <li>Calls CartPipeline.CalculateHandling on the Cart.</li> </ul></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">SetQtyOrdered</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If the parameter QtyOrdered is not null:</p> <ul> <li>Determines the quantity to set the CartLine QtyOrdered by checking the CartSettings ReplaceOnAdd, if it is true and the Cart Status is not Requisition, it uses the parameter QtyOrdered, otherwise it uses the parameter QtyOrdered plus the CartLine QtyOrdered.</li> <li>If the CartLine Product has a MinimumOrderQty, adjusts the quantity based on that and the unit of measure and sets result IsQtyAdjusted to true.</li> <li>Applies rounding rules to the quantity and if different than the original quantity sets result IsQtyAdjusted to true.</li> <li>Sets the CartLine QtyOrdered to the final calculated quantity.</li> </ul></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">RemoveCartLine</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If the final QtyOrdered is zero, calls CartPipeline.RemoveCartLine to remove the CartLine.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">700</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">SetImpersonatedBy</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">If there is an Impersonation Cookie, sets the Cart ImpersonatedByAdminUserProfile.</td> </tr> </tbody> </table>
## CalculateHandling
<table class="TableStyle-Borders" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CheckIsCalculationNeeded</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Sets Cart HandlingCharges to zero and then sets result IsCalculationNeeded to true if the Cart Status is not PunchOutOrderRequest and the Cart Website is not null and the Cart Type is Quote or any CartLine Products have IsQuoteRequired set to false.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CalculateAmount</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result IsCalculationNeeded is true and ShippingGeneralSettings HandlingCalculation is set to Amount:</p> <ul> <li>If all Products in the Cart have a HandlingAmountOverride of zero, sets the Handling Charges to zero.</li> <li>Sums up the HandlingAmountOverride for the Products in the Cart that have one and will multiply that by the QtyOrdered if ShippingGeneralSettings HandlingAmountMultiplyByQtyOrdered is true.</li> <li>Adds the Cart ShipTo State HandlingAmount if there is one.</li> <li>Adds the ShippingGeneralSettings HandlingAmount if there is one.</li> <li>Rounds the final Cart HandlingCharges.</li> </ul></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">CalculatePercent</td> <td class="TableStyle-Borders-BodyA-Regular-Row1"><p>If result IsCalculationNeeded is true and ShippingGeneralSettings HandlingCalculation is set to Percent:</p> <ul> <li>If all Products in the Cart have a HandlingAmountOverride of zero, sets the Handling Charges to zero.</li> <li>Uses the last found non zero HandlingAmountOverride times the Cart sub total with discounts to calculate the override amount.</li> <li>Adds the Cart ShipTo State HandlingAmount (if there is one) times the Cart sub total with discounts.</li> <li>Adds the ShippingGeneralSettings HandlingAmount (if there is one) times the Cart sub total with discounts.</li> <li>Rounds the final Cart HandlingCharges.</li> </ul></td> </tr> </tbody> </table>
## CreateGetCartLineResult
<table class="TableStyle-Borders" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CreateGetCartLineResult</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Maps the parameter GetCartResult, CartLine and ProductDto in to the result GetCartLineResult.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetInventory</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If InventorySettings AllowBackOrder is true and the parameter CartLine Product is not discontinued or the parameter CartLine Product is not inventory tracked, sets GetCartLineResult QtyLeft to -1 and if RealTime Inventory is enabled, gets the realtime inventory (most likely from cache) and sets the GetCartLineResult ProductDto Availability.</p> <p>Otherwise, calls the InventoryPipeline GetInventory to get the Availability and sets the GetCartLineResult QtyLeft equal to the QtyOnHand minus the QtyOrdered and the GetCartLineResult HasInsufficientInventory to true if the QtyLeft is less than zero and the Product does not require a quote.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">MapConfigurationToSectionOptions</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If the parameter CartLine has OrderLineConfigurationValues, it maps them in to result GetCartLineResult SectionOptions.</p> <p>If the parameter CartLine is xml configured, it maps the CartLine ConfigDataSet in to the result GetCartLineResult SectionOptions.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">CopyCustomPropertiesToResult</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">Copies the CartLine custom properties in to the result GetCartLineResult Properties collection.</td> </tr> </tbody> </table>
## GetCartDataSet
Order | Pipe | Description |
100 | CreateDataSet | Sets result DataSet to a new DataSet named CustomerOrderDataSet. |
200 | AddBillTo | Adds the Cart BillTo as table Customer, BillTo CustomProperties as table CustomerProperty, BillToState as table BillToState and BillToCountry as table BillToCountry to the DataSet. |
300 | AddShipTo | Adds the Cart ShipTo as table ShipTo, ShipTo CustomProperties as table ShipToProperty, ShipToState as table ShipToState and ShipToCountry as table ShipToCountry to the DataSet. |
400 | AddGiftCardTransactions | Adds the Cart GiftCardTransactions as table GiftCardTransaction to the DataSet. |
500 | AddPromotions | Adds the Cart CustomerOrderPromotions as table CustomerOrderPromotion and their corresponding Promotions as table Promotion to the DataSet. |
600 | AddCreditCardTransactions | Adds the Cart CreditCardTransactions as table CreditCardTransaction to the DataSet, if OrderSubmitSettings SubmitAllPaymentInfo is false, this only includes successful transactions with the transaction types S, D, C and V. |
700 | AddShipVia | Adds the Cart ShipVia as table ShipVia to the DataSet. |
800 | AddAffiliates | Adds the Cart Affiliate as table Affiliate to the DataSet if it is not null. |
900 | AddDropShip | Adds the Cart DropShipCustomer as table DropShip to the DataSet if it is not null. |
1000 | AddWebsite | Adds the Cart Website as table Website to the DataSet if it is not null. |
1100 | AddUserProfiles | Adds the Cart ApprovedByUserProfile, InitiatedByUserProfile, QuoteByUserProfile and PlacedByUserProfile with tables of the same name to the DataSet if they are not null. |
1200 | AddSalesPerson | Adds Cart Salesperson as table Salesperson to the DataSet if it is not null. |
1300 | AddWarehouse | Adds Cart DefaultWarehouse as table Warehouse to the DataSet if it is not null. |
1400 | AddCurrency | Adds Cart Currency as table Currency to the DataSet if it is not null. |
1500 | AddLanguage | Adds Cart Language as table Language to the DataSet if it is not null. |
1600 | AddCustomerOrder | Adds Cart including a column for DefaultWarehouseName and DiscountAmount as table CustomerOrder and Cart CustomProperties as table CustomerOrderProperty to the DataSet. |
1700 | AddOrderLines | Adds Cart CartLines including columns DollarOffOrder, DollarOffShipping, PercentOffOrder, PercentOffShipping, ProductDiscount, PromotionResultName, ProductDiscountPerEach, Warehouse and ErpNumber as table OrderLine, CartLine CustomProperties as table OrderLineProperty, CartLine ConfigurationValues as table OrderLineConfigurationValue, CartLine Product as table Product, CartLine Product CustomProperties as table ProductProperty, CartLine Product Vendor as table Vendor if it is not null and CartLine Warehouse as table Warehouse if it is not null to the DataSet. |
1800 | AddCustomerOrderTaxes | Adds Cart CustomerOrderTaxes as table CustomerOrderTaxProperty to the DataSet. |
## RemoveCartLine
<table class="TableStyle-Borders" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">RemoveCartLine</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If the parameter Cart contains the parameter CartLine, deletes the CustomProperties for that CartLine, deletes the CustomerOrderPromotions for that CartLine and then deletes the CartLine, removes it from the Cart CartLines collection, and sets result WasRemoved to true.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">RenumberCartLines</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If parameter RenumberLines is true and there are CartLines, calls UnitOfWork.Save() to save the current state so there aren't problems renumbering. Sets all CartLine numbers to the current max line number plus one, plus their current line number and calls UnitOfWork.Save(), then goes through and renumbers the lines in order from 1 and calls UnitOfWork.Save().</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">SetRecalculateCartFlags</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result WasRemoved is true:</p> <ul> <li>Sets Cart RecalculatePromotions to true.</li> <li>Sets Cart ShippingCalculationNeededAsOf to the current date time.</li> <li>Sets Cart RecalculateTax to true.</li> <li>Calls CartPipeline.CalculateHandling on the Cart.</li> </ul></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">SetImpersonatedBy</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">If there is an Impersonation Cookie, sets the Cart ImpersonatedByAdminUserProfile.</td> </tr> </tbody> </table>
## SetBillTo
<table class="TableStyle-Borders" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">SetBillTo</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If the parameter BillTo is not null:</p> <ul> <li>Sets Cart Customer to BillTo.</li> <li>Sets Cart CustomerId to BillTo.Id.</li> <li>Sets Cart CustomerNumber to BillTo.CustomerNumber.</li> <li>Sets Cart TermsCode to BillTo.TermsCode.</li> <li>Sets Cart BTCompanyName to BIllTo.CompanyName.</li> <li>Sets Cart BTFirstName to BillTo.FirstName.</li> <li>Sets Cart BTMiddleName to BillTo.MiddleName.</li> <li>Sets Cart BTLastName to BillTo.LastName.</li> <li>Sets Cart BTPhone to BillTo.Phone.</li> <li>Sets Cart BTAddress1 to BillTo.Address1.</li> <li>Sets Cart BTAddress2 to BillTo.Address2.</li> <li>Sets Cart BTAddress3 to BillTo.Address3.</li> <li>Sets Cart BTAddress4 to BillTo.Address4.</li> <li>Sets Cart BTCity to BillTo.City.</li> <li>Sets Cart BTState to BillTo.State.Name.</li> <li>Sets Cart BTPostalCode to BillTo.PostalCode.</li> <li>Sets Cart BTCountry to BillTo.Country.Name</li> <li>Sets Cart BTEmail to BillTo.Email.</li> </ul></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">SetShipTo</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">If the parameter BillTo is not null and the parameter ShipTo is AbandonedCart, calls the CartPipeline.SetShipTo passing in the BillTo as the ShipTo.</td> </tr> </tbody> </table>
## SetShipTo
<table class="TableStyle-Borders" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CheckIsShipToChanged</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If the parameter ShipTo is not null, sets result IsShipToChanged to true if:</p> <ul> <li>The Cart ShipToId equals Guid.Empty.</li> <li>The Cart ShipTo does not equal the parameter ShipTo.</li> <li>The Cart STState or STCountry do not equal the parameter ShipTo State and Country.</li> <li>The Cart STCity does not equal the parameter ShipTo City.</li> <li>The Cart STPostalCode does not equal the parameter ShipTo PostalCode.</li> <li>The Cart CustomerSequence does not equal the parameter ShipTo CustomerSequence.</li> <li>The Cart STCompanyName does not equal the parameter ShipTo CompanyName.</li> <li>The Cart STFirstName does not equal the parameter ShipTo FirstName.</li> <li>The Cart STLastName does not equal the parameter ShipTo LastName.</li> <li>The Cart STAddress1 does not equal the parameter ShipTo Address1.</li> <li>The Cart STAddress2 does not equal the parameter ShipTo Address2.</li> </ul></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">SetShipTo</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If the parameter ShipTo is not null:</p> <ul> <li>Sets Cart ShipTo to ShipTo. </li> <li>Sets Cart ShipToId to ShipTo.Id.</li> <li>Sets Cart CustomerSequence to ShipTo.CustomerSequence.</li> <li>Sets Cart DefaultWarhouse to ShipTo.DefaultWarhouse if it is not null, otherwise, ShipTo.Parent.DefaultWarehouse if it is not null, otherwise, the system default Warehouse.</li> <li>Sets Cart SalespersonId to ShipTo.PrimarySalesPersonId if it is not null, otherwise, the Cart BillTo PrimarySalespersonId.</li> <li>Sets Cart ShipEarly to ShipTo.ShipEarly.</li> <li>Sets Cart ShipPartial to ShipTo.ShipPartial.</li> <li>Sets Cart TaxCode1 to ShipTo.TaxCode1.</li> <li>Sets Cart TaxCode2 to ShipTo.TaxCode2.</li> <li>Sets Cart STCompanyName to ShipTo.CompanyName.</li> <li>Sets Cart STFirstName to ShipTo.FirstName.</li> <li>Sets Cart STMiddleName to ShipTo.MiddleName.</li> <li>Sets Cart STLastName to ShipTo.LastName.</li> <li>Sets Cart STPhone to ShipTo.Phone.</li> <li>Sets Cart STAddress1 to ShipTo.Address1.</li> <li>Sets Cart STAddress2 to ShipTo.Address2.</li> <li>Sets Cart STAddress3 to ShipTo.Address3.</li> <li>Sets Cart STAddress4 to ShipTo.Address4.</li> <li>Sets Cart STCity to ShipTo.City.</li> <li>Sets Cart STState to ShipTo.State.Name.</li> <li>Sets Cart STPostalCode to ShipTo.PostalCode.</li> <li>Sets Cart STCountry to ShipTo.Country.Name</li> <li>Sets Cart STEmail to ShipTo.Email.</li> </ul></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CalculateHandling</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If the parameter ShipTo is not null and the Cart Status is Cart, calls CartPipeline.CalculateHandling.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">SetRecalculateCartFlags</td> <td class="TableStyle-Borders-BodyA-Regular-Row1"><p>If the parameter ShipTo is not null and result IsShipToChanged is true:</p> <ul> <li>Sets Cart RecalculatePromotions to true.</li> <li>Sets Cart ShippingCalculationNeededAsOf to the current date time.</li> <li>Sets Cart RecalculateTax to true.</li> </ul></td> </tr> </tbody> </table>