File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11<?php
2+
23/**
34 * Copyright since 2007 PrestaShop SA and Contributors
45 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
@@ -140,8 +141,14 @@ private function sendUpsertProduct($parameters)
140141 *
141142 * For the Legacy page, we don't have this problem, because the hook is called only once. But we need to handle it differently.
142143 * In the legacy page, we have the selected carriers only, but we don't have the list of carrier was unselected before.
144+ *
145+ * We have condition for webservice because the webservice is not front office call, and controller doesn't exist.
146+ * We need to handle it differently, with the presence of the webservice container.
143147 */
144- if (\Context::getContext ()->controller instanceof \AdminProductsController) {
148+ if (
149+ \Context::getContext ()->controller instanceof \AdminProductsController
150+ || (isset (\Context::getContext ()->container ) && \Context::getContext ()->container != null && get_class (\Context::getContext ()->container ) == 'WebserviceContainer ' ) // <== Trick for webservice only
151+ ) {
145152 // We are on legacy product page
146153 $ incrementalSyncItems [Config::COLLECTION_CUSTOM_PRODUCT_CARRIERS ] = $ customProductCarrierIds ;
147154
You can’t perform that action at this time.
0 commit comments