Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/app/addons/wishlist/func.php b/app/addons/wishlist/func.php
- index f75cebd..62995fa 100644
- --- a/app/addons/wishlist/func.php
- +++ b/app/addons/wishlist/func.php
- @@ -112,12 +112,6 @@ function fn_wishlist_get_carts(&$type_restrictions)
- }
- }
- -function fn_wishlist_get_carts_before_select($params, $items_per_page, $fields, $join, &$condition, &$group, &$sorting, $limit)
- -{
- - $group = '';
- - $sorting = db_quote(' ORDER BY ?:user_session_products.type = ?s ASC', 'C');;
- -}
- -
- function fn_wishlist_get_additional_information(&$product, &$products_data)
- {
- $_product = reset($products_data['product_data']);
- @@ -151,3 +145,23 @@ function fn_wishlist_get_count()
- return empty($result) ? -1 : $result;
- }
- +
- +/**
- + * The "save_cart_content_pre" hook handler.
- + *
- + * Actions performed:
- + * - Gets user data info from session and adds them into records with wishlist type
- + *
- + * @see fn_save_cart_content
- + */
- +function fn_wishlist_save_cart_content_pre(&$cart, $user_id, $type, $user_type)
- +{
- + if ($type == 'W') {
- + if (empty($cart['user_data']) && !empty(Tygh::$app['session']['cart']['user_data'])) {
- + $cart['user_data'] = Tygh::$app['session']['cart']['user_data'];
- + }
- + } elseif (!empty(Tygh::$app['session']['wishlist']) && !empty($cart['user_data'])) {
- + Tygh::$app['session']['wishlist']['user_data'] = $cart['user_data'];
- + fn_save_cart_content(Tygh::$app['session']['wishlist'], $user_id, 'W', $user_type);
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement