Created
June 6, 2023 06:21
-
-
Save danielborzov/c1b58a4e66b5eb5a986315d16e59fbf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/store_locator/func.php b/app/addons/store_locator/func.php | |
index 6378f5941f..9266c53e27 100644 | |
--- a/app/addons/store_locator/func.php | |
+++ b/app/addons/store_locator/func.php | |
@@ -1480,3 +1480,28 @@ function fn_store_locator_pre_update_order(array &$cart, $order_id) | |
} | |
} | |
} | |
+ | |
+/** | |
+ * The "order_fulfillment_set_marketplace_shipping_to_product_group" hook handler. | |
+ * | |
+ * Actions performed: | |
+ * - Adds selected store data to all product groups which are using marketplace shipping | |
+ * | |
+ * @param array $cart Cart contents | |
+ * @param int $group_key Group key | |
+ * @param int $marketplace_group_key Marketplace group key | |
+ * | |
+ * @see \onPrePlaceOrder() | |
+ * | |
+ * @return void | |
+ * | |
+ * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint | |
+ */ | |
+function fn_store_locator_order_fulfillment_set_marketplace_shipping_to_product_group(array &$cart, $group_key, $marketplace_group_key) | |
+{ | |
+ if (empty($cart['select_store'][$marketplace_group_key])) { | |
+ return; | |
+ } | |
+ | |
+ $cart['select_store'][$group_key] = $cart['select_store'][$marketplace_group_key]; | |
+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/store_locator/init.php b/app/addons/store_locator/init.php | |
index 21cc33f6c3..d9ccf53d07 100644 | |
--- a/app/addons/store_locator/init.php | |
+++ b/app/addons/store_locator/init.php | |
@@ -49,5 +49,6 @@ fn_register_hooks( | |
/** @see \fn_store_locator_pre_update_order() */ | |
'pre_update_order', | |
'uninstall_addon_post', | |
+ 'order_fulfillment_set_marketplace_shipping_to_product_group', | |
'api_orders_create_after_add_product_to_cart' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment