Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. diff --git a/app/addons/wishlist/func.php b/app/addons/wishlist/func.php
  2. index f75cebd..62995fa 100644
  3. --- a/app/addons/wishlist/func.php
  4. +++ b/app/addons/wishlist/func.php
  5. @@ -112,12 +112,6 @@ function fn_wishlist_get_carts(&$type_restrictions)
  6. }
  7. }
  8.  
  9. -function fn_wishlist_get_carts_before_select($params, $items_per_page, $fields, $join, &$condition, &$group, &$sorting, $limit)
  10. -{
  11. - $group = '';
  12. - $sorting = db_quote(' ORDER BY ?:user_session_products.type = ?s ASC', 'C');;
  13. -}
  14. -
  15. function fn_wishlist_get_additional_information(&$product, &$products_data)
  16. {
  17. $_product = reset($products_data['product_data']);
  18. @@ -151,3 +145,23 @@ function fn_wishlist_get_count()
  19.  
  20. return empty($result) ? -1 : $result;
  21. }
  22. +
  23. +/**
  24. + * The "save_cart_content_pre" hook handler.
  25. + *
  26. + * Actions performed:
  27. + * - Gets user data info from session and adds them into records with wishlist type
  28. + *
  29. + * @see fn_save_cart_content
  30. + */
  31. +function fn_wishlist_save_cart_content_pre(&$cart, $user_id, $type, $user_type)
  32. +{
  33. + if ($type == 'W') {
  34. + if (empty($cart['user_data']) && !empty(Tygh::$app['session']['cart']['user_data'])) {
  35. + $cart['user_data'] = Tygh::$app['session']['cart']['user_data'];
  36. + }
  37. + } elseif (!empty(Tygh::$app['session']['wishlist']) && !empty($cart['user_data'])) {
  38. + Tygh::$app['session']['wishlist']['user_data'] = $cart['user_data'];
  39. + fn_save_cart_content(Tygh::$app['session']['wishlist'], $user_id, 'W', $user_type);
  40. + }
  41. +}
  42. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement