COVID2019 и это вот все. Друзья, вся эта история начинает плохо пахнет. Мойте руки, не ходите в люди. Отложите все плановые покупки и положите в носок заначку. Заприте ваших родителей, бабушек-дедушек на даче. Лучше перебдеть чем недобдеть. Берегите себя!

shturmavik

Соучастники
  • Публикации

    9
  • Зарегистрирован

  • Посещение

  • Days Won

    1

Изменения репутации

  1. Upvote
    shturmavik получил репутацию от sashamaximiv в Проверить есть ли товар в Wishlist   
    Добавил код в catalog/model/account/wishlist.php   public function getAllWishlist() { // by nix if ($data = $this->getWishlist()) { $out = array(); foreach ($data as $key => $value) { $out[] = $value['product_id']; } return $out; } else if (isset($this->session->data['wishlist'])) { return $this->session->data['wishlist']; } }  
      Добавил код в catalog/controller/product/product.php $this->load->model('account/wishlist');         $zol_wish = $this->model_account_wishlist->getAllWishlist();         if (isset($product_id) && isset($zol_wish)) {           if (in_array($product_id, $zol_wish)) {             $data['AllWishlist'] = true;           }           } Выше этого кода: if ($product_info) {             $url = '';             if (isset($this->request->get['path'])) {  
     
      В файл catalog/view/theme/default/template/product/product.tpl заменил кнопку сердечка на такой код: <?php if ($logged) { ?> <script type="text/javascript"> function ChangeColor(Element) { Element.style.color = 'red'; } </script> <button <?php if(isset($AllWishlist)) { ?> style="color: red" <?php } ?> type="button" data-toggle="tooltip" class="btn btn-default" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product_id; ?>'); ChangeColor(this);"><i class="fa fa-heart"></i></button> <?php } ?>  
    Добавил код в catalog/controller/product/category.php   Вот такой код: $this->load->model('account/wishlist'); $data['AllWishlist'] = $this->model_account_wishlist->getAllWishlist(); Выше этого кода:
    $data['breadcrumbs'] = array(); В файл catalog/view/theme/default/template/product/category.tpl заменил кнопку сердечка на такой код:
    <?php if ($logged) { ?> <script type="text/javascript"> function ChangeColor(Element) { Element.style.color = 'red'; } </script> <button <?php if(isset($AllWishlist)) { ?> <?php if(in_array($product['product_id'], $AllWishlist)) { ?> style="color: red" <?php } ?> <?php } ?> type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>'); ChangeColor(this);"><i class="fa fa-heart"></i></button> <?php } ?> Теперь если мы залогинимся, то у товара появиться сердечко. Если нажмём, то оно загорится красным и товар добавиться в закладки. Если удалил из закладок, то сердечко перестанет быть красным.

    Пример http://best-socks.ru/
     
  2. Upvote
    shturmavik получил репутацию от bazilio в Проверить есть ли товар в Wishlist   
    Добавил код в catalog/model/account/wishlist.php   public function getAllWishlist() { // by nix if ($data = $this->getWishlist()) { $out = array(); foreach ($data as $key => $value) { $out[] = $value['product_id']; } return $out; } else if (isset($this->session->data['wishlist'])) { return $this->session->data['wishlist']; } }  
      Добавил код в catalog/controller/product/product.php $this->load->model('account/wishlist');         $zol_wish = $this->model_account_wishlist->getAllWishlist();         if (isset($product_id) && isset($zol_wish)) {           if (in_array($product_id, $zol_wish)) {             $data['AllWishlist'] = true;           }           } Выше этого кода: if ($product_info) {             $url = '';             if (isset($this->request->get['path'])) {  
     
      В файл catalog/view/theme/default/template/product/product.tpl заменил кнопку сердечка на такой код: <?php if ($logged) { ?> <script type="text/javascript"> function ChangeColor(Element) { Element.style.color = 'red'; } </script> <button <?php if(isset($AllWishlist)) { ?> style="color: red" <?php } ?> type="button" data-toggle="tooltip" class="btn btn-default" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product_id; ?>'); ChangeColor(this);"><i class="fa fa-heart"></i></button> <?php } ?>  
    Добавил код в catalog/controller/product/category.php   Вот такой код: $this->load->model('account/wishlist'); $data['AllWishlist'] = $this->model_account_wishlist->getAllWishlist(); Выше этого кода:
    $data['breadcrumbs'] = array(); В файл catalog/view/theme/default/template/product/category.tpl заменил кнопку сердечка на такой код:
    <?php if ($logged) { ?> <script type="text/javascript"> function ChangeColor(Element) { Element.style.color = 'red'; } </script> <button <?php if(isset($AllWishlist)) { ?> <?php if(in_array($product['product_id'], $AllWishlist)) { ?> style="color: red" <?php } ?> <?php } ?> type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>'); ChangeColor(this);"><i class="fa fa-heart"></i></button> <?php } ?> Теперь если мы залогинимся, то у товара появиться сердечко. Если нажмём, то оно загорится красным и товар добавиться в закладки. Если удалил из закладок, то сердечко перестанет быть красным.

    Пример http://best-socks.ru/
     
  3. Upvote
    shturmavik получил репутацию от admin в Проверить есть ли товар в Wishlist   
    Добавил код в catalog/model/account/wishlist.php   public function getAllWishlist() { // by nix if ($data = $this->getWishlist()) { $out = array(); foreach ($data as $key => $value) { $out[] = $value['product_id']; } return $out; } else if (isset($this->session->data['wishlist'])) { return $this->session->data['wishlist']; } }  
      Добавил код в catalog/controller/product/product.php $this->load->model('account/wishlist');         $zol_wish = $this->model_account_wishlist->getAllWishlist();         if (isset($product_id) && isset($zol_wish)) {           if (in_array($product_id, $zol_wish)) {             $data['AllWishlist'] = true;           }           } Выше этого кода: if ($product_info) {             $url = '';             if (isset($this->request->get['path'])) {  
     
      В файл catalog/view/theme/default/template/product/product.tpl заменил кнопку сердечка на такой код: <?php if ($logged) { ?> <script type="text/javascript"> function ChangeColor(Element) { Element.style.color = 'red'; } </script> <button <?php if(isset($AllWishlist)) { ?> style="color: red" <?php } ?> type="button" data-toggle="tooltip" class="btn btn-default" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product_id; ?>'); ChangeColor(this);"><i class="fa fa-heart"></i></button> <?php } ?>  
    Добавил код в catalog/controller/product/category.php   Вот такой код: $this->load->model('account/wishlist'); $data['AllWishlist'] = $this->model_account_wishlist->getAllWishlist(); Выше этого кода:
    $data['breadcrumbs'] = array(); В файл catalog/view/theme/default/template/product/category.tpl заменил кнопку сердечка на такой код:
    <?php if ($logged) { ?> <script type="text/javascript"> function ChangeColor(Element) { Element.style.color = 'red'; } </script> <button <?php if(isset($AllWishlist)) { ?> <?php if(in_array($product['product_id'], $AllWishlist)) { ?> style="color: red" <?php } ?> <?php } ?> type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>'); ChangeColor(this);"><i class="fa fa-heart"></i></button> <?php } ?> Теперь если мы залогинимся, то у товара появиться сердечко. Если нажмём, то оно загорится красным и товар добавиться в закладки. Если удалил из закладок, то сердечко перестанет быть красным.

    Пример http://best-socks.ru/