();
+
constructor(private context: ProductContextFacade, private checkoutFacade: CheckoutFacade) {}
- ngOnInit() {
- this.context.hold(this.context.validDebouncedQuantityUpdate$(), quantity => {
- this.checkoutFacade.updateBasketItem({ itemId: this.pli.id, quantity });
- });
+ ngOnChanges(changes: SimpleChanges): void {
+ if (changes.pli) {
+ if (this.updateSubscription) {
+ // eslint-disable-next-line ban/ban
+ this.updateSubscription.unsubscribe();
+ }
+
+ this.updateSubscription = this.context
+ .validDebouncedQuantityUpdate$()
+ .pipe(takeUntil(this.destroy$))
+ .subscribe(quantity => {
+ this.checkoutFacade.updateBasketItem({ itemId: this.pli.id, quantity });
+ });
+ }
}
get oldPrice() {
@@ -38,4 +52,9 @@ export class LineItemListElementComponent implements OnInit {
onDeleteItem(itemId: string) {
this.checkoutFacade.deleteBasketItem(itemId);
}
+
+ ngOnDestroy() {
+ this.destroy$.next();
+ this.destroy$.complete();
+ }
}
diff --git a/src/app/shared/components/line-item/line-item-list/line-item-list.component.html b/src/app/shared/components/line-item/line-item-list/line-item-list.component.html
index 275124283d..ddedbac7c7 100644
--- a/src/app/shared/components/line-item/line-item-list/line-item-list.component.html
+++ b/src/app/shared/components/line-item/line-item-list/line-item-list.component.html
@@ -12,7 +12,7 @@
this.pageSize;
}
- trackByFn(_: number, item: Partial) {
- return item.id;
- }
-
/**
* Refresh items to display after changing the current page
*
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts
index 54afa72352..b068957871 100644
--- a/src/app/shared/shared.module.ts
+++ b/src/app/shared/shared.module.ts
@@ -68,6 +68,7 @@ import { BasketApprovalInfoComponent } from './components/basket/basket-approval
import { BasketBuyerComponent } from './components/basket/basket-buyer/basket-buyer.component';
import { BasketCostCenterSelectionComponent } from './components/basket/basket-cost-center-selection/basket-cost-center-selection.component';
import { BasketCostSummaryComponent } from './components/basket/basket-cost-summary/basket-cost-summary.component';
+import { BasketCustomFieldsComponent } from './components/basket/basket-custom-fields/basket-custom-fields.component';
import { BasketDesiredDeliveryDateComponent } from './components/basket/basket-desired-delivery-date/basket-desired-delivery-date.component';
import { BasketErrorMessageComponent } from './components/basket/basket-error-message/basket-error-message.component';
import { BasketInfoComponent } from './components/basket/basket-info/basket-info.component';
@@ -83,6 +84,7 @@ import { BasketValidationProductsComponent } from './components/basket/basket-va
import { BasketValidationResultsComponent } from './components/basket/basket-validation-results/basket-validation-results.component';
import { ClearBasketComponent } from './components/basket/clear-basket/clear-basket.component';
import { MiniBasketContentComponent } from './components/basket/mini-basket-content/mini-basket-content.component';
+import { BasketCustomFieldsViewComponent } from './components/checkout/basket-custom-fields-view/basket-custom-fields-view.component';
import { BasketInvoiceAddressWidgetComponent } from './components/checkout/basket-invoice-address-widget/basket-invoice-address-widget.component';
import { BasketShippingAddressWidgetComponent } from './components/checkout/basket-shipping-address-widget/basket-shipping-address-widget.component';
import { AccordionItemComponent } from './components/common/accordion-item/accordion-item.component';
@@ -97,6 +99,8 @@ import { ModalDialogLinkComponent } from './components/common/modal-dialog-link/
import { ModalDialogComponent } from './components/common/modal-dialog/modal-dialog.component';
import { PagingComponent } from './components/common/paging/paging.component';
import { SuccessMessageComponent } from './components/common/success-message/success-message.component';
+import { CustomFieldsFormlyComponent } from './components/custom-fields/custom-fields-formly/custom-fields-formly.component';
+import { CustomFieldsViewComponent } from './components/custom-fields/custom-fields-view/custom-fields-view.component';
import { FilterCheckboxComponent } from './components/filter/filter-checkbox/filter-checkbox.component';
import { FilterCollapsibleComponent } from './components/filter/filter-collapsible/filter-collapsible.component';
import { FilterDropdownComponent } from './components/filter/filter-dropdown/filter-dropdown.component';
@@ -106,8 +110,10 @@ import { FilterNavigationSidebarComponent } from './components/filter/filter-nav
import { FilterNavigationComponent } from './components/filter/filter-navigation/filter-navigation.component';
import { FilterSwatchImagesComponent } from './components/filter/filter-swatch-images/filter-swatch-images.component';
import { FilterTextComponent } from './components/filter/filter-text/filter-text.component';
+import { LineItemCustomFieldsComponent } from './components/line-item/line-item-custom-fields/line-item-custom-fields.component';
import { LineItemEditDialogComponent } from './components/line-item/line-item-edit-dialog/line-item-edit-dialog.component';
import { LineItemEditComponent } from './components/line-item/line-item-edit/line-item-edit.component';
+import { LineItemInformationEditComponent } from './components/line-item/line-item-information-edit/line-item-information-edit.component';
import { LineItemListElementComponent } from './components/line-item/line-item-list-element/line-item-list-element.component';
import { LineItemListComponent } from './components/line-item/line-item-list/line-item-list.component';
import { LineItemWarrantyComponent } from './components/line-item/line-item-warranty/line-item-warranty.component';
@@ -228,6 +234,7 @@ const declaredComponents = [
FilterTextComponent,
LineItemEditComponent,
LineItemEditDialogComponent,
+ LineItemInformationEditComponent,
LineItemListElementComponent,
LineItemWarrantyComponent,
LoginModalComponent,
@@ -247,6 +254,7 @@ const exportedComponents = [
AccordionComponent,
AccordionItemComponent,
AddressComponent,
+ BasketCustomFieldsComponent,
BasketAddressSummaryComponent,
BasketApprovalInfoComponent,
BasketBuyerComponent,
@@ -311,6 +319,10 @@ const exportedComponents = [
ProductVariationSelectSwatchComponent,
ProductWarrantyComponent,
ProductWarrantyDetailsComponent,
+ CustomFieldsFormlyComponent,
+ LineItemCustomFieldsComponent,
+ CustomFieldsViewComponent,
+ BasketCustomFieldsViewComponent,
PromotionDetailsComponent,
PromotionRemoveComponent,
SearchBoxComponent,
diff --git a/src/assets/i18n/de_DE.json b/src/assets/i18n/de_DE.json
index 79a5b00818..25d6fca5b5 100644
--- a/src/assets/i18n/de_DE.json
+++ b/src/assets/i18n/de_DE.json
@@ -715,6 +715,7 @@
"checkout.credit_card.user.lastname.missing.error": "Bitte geben Sie den Nachnamen des Karteninhabers an.",
"checkout.credit_card.user.name.missing.error": "Bitte geben Sie den Namen des Karteninhabers an.",
"checkout.credit_card.validityTime.error.notFound": "Die maximale Gültigkeitsdauer der Kartenprüfnummer wurde nicht gefunden.",
+ "checkout.custom-field.no-value": "Kein Wert",
"checkout.desired_delivery_date.apply.button.label": "Übernehmen",
"checkout.desired_delivery_date.error.date": "Das Datum ist ungültig. Bitte verwenden Sie das korrekte Format ({{ translate, common.placeholder.shortdate-caps }}).",
"checkout.desired_delivery_date.error.max_date": "Ihr gewünschter Liefertermin kann nicht realisiert werden, weil das Datum zu weit in der Zukunft liegt.",
diff --git a/src/assets/i18n/en_US.json b/src/assets/i18n/en_US.json
index 40f92a42b0..c533a219bc 100644
--- a/src/assets/i18n/en_US.json
+++ b/src/assets/i18n/en_US.json
@@ -715,6 +715,16 @@
"checkout.credit_card.user.lastname.missing.error": "Please enter a cardholder last name.",
"checkout.credit_card.user.name.missing.error": "Please enter a cardholder name.",
"checkout.credit_card.validityTime.error.notFound": "The maximum validity time for CVC has not been found.",
+ "checkout.custom-field.no-value": "No value",
+ "checkout.custom-fields.add.button.label": "Add",
+ "checkout.custom-fields.add.link.label": "Add product information",
+ "checkout.custom-fields.basket.dialog.confirm": "OK",
+ "checkout.custom-fields.basket.dialog.reject": "Cancel",
+ "checkout.custom-fields.basket.dialog.title": "Custom Fields for Shopping Cart",
+ "checkout.custom-fields.cancel.button.label": "Cancel",
+ "checkout.custom-fields.define-cta": "Click here to define additional Shopping Cart attributes",
+ "checkout.custom-fields.edit.link.label": "Edit product information",
+ "checkout.custom-fields.save.button.label": "Save changes",
"checkout.desired_delivery_date.apply.button.label": "Apply",
"checkout.desired_delivery_date.error.date": "The date is invalid. Please use the correct format ({{ translate, common.placeholder.shortdate-caps }}).",
"checkout.desired_delivery_date.error.max_date": "Your desired delivery date cannot be realized because the date is too far in the future.",
@@ -823,12 +833,13 @@
"checkout.tax.text": "Tax",
"checkout.termsandconditions.details.title": "Terms & conditions",
"checkout.update.label": "Edit {{0}}",
- "checkout.variation.edit.button.label": "Edit",
+ "checkout.variation.edit.button.label": "Edit variation",
"checkout.widget.billing-address.heading": "Invoice address",
"checkout.widget.buyer.TaxationID": "Taxation ID:",
"checkout.widget.buyer.costcenter": "Cost center",
"checkout.widget.buyer.heading": "Buyer",
"checkout.widget.buyer.orderReferenceId": "Customer order ID",
+ "checkout.widget.custom_fields": "Custom fields",
"checkout.widget.message_to_merchant": "Message to merchant",
"checkout.widget.payment_method.heading": "Payment method",
"checkout.widget.promotion.discount": "Discount",
diff --git a/src/styles/pages/checkout/shopping-cart.scss b/src/styles/pages/checkout/shopping-cart.scss
index 8dc9fc4a58..3e9a7eacb0 100644
--- a/src/styles/pages/checkout/shopping-cart.scss
+++ b/src/styles/pages/checkout/shopping-cart.scss
@@ -186,3 +186,11 @@
max-width: 100%;
}
}
+
+.list-item-actions {
+ padding: $table-cell-padding * 0.2 0 $table-cell-padding * 0.9 0;
+
+ .btn-tool.btn-link {
+ padding: 0 divide($space-default, 3);
+ }
+}