-
We have a custom control on the cart on RetailSDK and it is working there. When I step through the source code using Chrome developer tools, it does go into my custom control, however it never calls the onReady method. So it is clearly not binding the control to the cart. So what is different between CommerceSDK and RetailSDK that the control works on retailSDK but not CommerceSDK? RetailSDK doesn't need a 3rd argument for the ko.applyBindingsToNode. So what should it be for commerceSDK to be bound to the cart? Hope to get an answer ASAP. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Never mind. While switching to CommerceSDK I have decided to change the publisher and package name to reflect our company's new name and I totally forgot that for cart controls one has to use the exact package and publisher names on the screen layout for the control. for the 3rd argument on the applyBindingsToNode, I used "this". don't know if that is what it should be, but it works. public onReady(element: HTMLElement): void { |
Beta Was this translation helpful? Give feedback.
Never mind. While switching to CommerceSDK I have decided to change the publisher and package name to reflect our company's new name and I totally forgot that for cart controls one has to use the exact package and publisher names on the screen layout for the control.
for the 3rd argument on the applyBindingsToNode, I used "this". don't know if that is what it should be, but it works.
public onReady(element: HTMLElement): void {
ko.applyBindingsToNode(element, {
template: {
name: CartSONumControl.TEMPLATE_ID,
data: this
}
}, this);