Jump to content


Photo
- - - - -

Поиск в том числе и через артикулу jbzoosearch


62 replies to this topic

#51 Den1762

Den1762
  • JBZoo User (rus)
  • User rate: 0.5
  • posts: 172
  • topics: 43

Posted 13 October 2016 - 05:15

Прикрепленные файлы

Все заработало. Не правильно вставлен был код.

 

Спасибо.


  • 0

#52 SmetDenis

SmetDenis
  • Administrators
  • User rate: 139.4
  • posts: 16232
  • topics: 200

Posted 13 October 2016 - 06:02

Все заработало. Не правильно вставлен был код.

 

Спасибо.

 

Отлично :)


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#53 pavel-ip

pavel-ip
  • JBZoo User (rus)
  • User rate: 0.3
  • posts: 49
  • topics: 11

Posted 13 October 2016 - 07:54

Спасибо за решение. Работает отлично. Осталось еще прикрутить тизеровские карточки в поиск и будет все как надо!


  • 0

#54 SmetDenis

SmetDenis
  • Administrators
  • User rate: 139.4
  • posts: 16232
  • topics: 200

Posted 13 October 2016 - 08:32

Спасибо за решение. Работает отлично. Осталось еще прикрутить тизеровские карточки в поиск и будет все как надо!

 

К сожалению, это только с хаком шаблонов Joomla. Ссылку на маркет я приложил выше.


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#55 efemerid

efemerid
  • JBZoo User (rus)
  • User rate: 0
  • posts: 16
  • topics: 9

Posted 13 October 2016 - 16:38

 

O4tfZEe4X6k.jpg
 
MlhmXnxaLh8.jpg
 
kjQVW2iORIE.jpg
 
administrator/components/com_zoo/controllers/item.php
 
150 строка примерно:
 

		if ($search) {
			$from   .= ' LEFT JOIN '.ZOO_TABLE_SKU.' AS t ON a.id = t.item_id';
			$where[] = '(LOWER(a.name) LIKE '.$this->db->Quote('%'.$this->db->escape($search, true).'%', false)
			. ' OR LOWER(t.value_s) LIKE '.$this->db->Quote('%'.$this->db->escape($search, true).'%', false)
			. ' OR LOWER(a.alias) LIKE '.$this->db->Quote('%'.$this->db->escape($search, true).'%', false) . ')';
			$where[] = 't.param_id = \'_sku\'';

		}

или не то?

 

Как вы сделали такой вывод материалов в админке?


  • 1

#56 CB9TOIIIA

CB9TOIIIA
  • Administrators
  • User rate: 230.6
  • posts: 3680
  • topics: 235

Posted 13 October 2016 - 16:46

Как вы сделали такой вывод материалов в админке?

 

хак хаку через кхаку  :) переопределил страницу под заказчика.

 

 

gcEWCterwAk.jpg
 
<?php

// no direct access
defined('_JEXEC') or die('Restricted access');

// add js
$this->app->document->addScript('assets:js/item.js');
$this->app->jbassets->fancybox();

?>
<style media="screen">
.skudata {
  background-color: #3071a9;
  padding: 5px;
  color: #fff;
   display: inline-block;
  width: 50px;
}
.valuedata {
    background-color: #378137;
    width: 80px;
    padding: 5px;
    color: #fff;
    display: inline-block;
}
.numberprod {
    background-color: #470b8c;
    padding: 2px;
    color: #fff;
}
</style>
    <script type="text/javascript">
        jQuery(function ($) {
            $('.popup-item').fancybox({
                overlay: {locked: false}
            });
        });
    </script>

    <form class="items-default" action="<?php echo $this->app->link(); ?>" method="post" name="adminForm" id="adminForm"
          accept-charset="utf-8">

    <?php echo $this->partial('menu');  ?>

    <div class="box-bottom">

    <?php if ($this->is_filtered || $this->pagination->total > 0) : ?>

        <ul class="filter">
            <li class="filter-left">
                <input type="text" name="search" id="search" value="<?php echo $this->lists['search']; ?>"
                       class="rounded"/>
                <button onclick="this.form.submit();"><?php echo JText::_('Search'); ?></button>
                <button
                    onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_('Reset'); ?></button>
            </li>
            <?php if ($this->app->joomla->version->isCompatible('3.0')) : ?>
                <li class="filter-right">
                    <?php echo str_replace(array('input-mini', 'size="1"'), '', $this->pagination->getLimitBox()); ?>
                </li>
            <?php endif ?>
            <li class="filter-right">
                <?php echo $this->lists['select_category']; ?>
            </li>
            <li class="filter-right">
                <?php echo $this->lists['select_type']; ?>
            </li>
            <li class="filter-right">
                <?php echo $this->lists['select_author']; ?>
            </li>
        </ul>

    <?php endif;

    if ($this->pagination->total > 0) : ?>

        <table class="list stripe">
        <thead>
        <tr>
            <th class="checkbox">
                <input type="checkbox" class="check-all"/>
            </th>
            <th class="name" colspan="2">
                <?php echo $this->app->html->_('grid.sort', 'Name', 'a.name', @$this->lists['order_Dir'], @$this->lists['order']); ?>
            </th>
            <th class="alias">
                <?php echo "<center> link </center>"; ?>
            </th>
            <th class="jbzoosku">
            <center>Арт.</center>
            </th>
            <th class="jbzooprice">
            <center>Цена</center>
            </th>
            <th class="numberprods">
            <center>По каталогу</center>
            </th>
            <th class="published">
                <?php echo $this->app->html->_('grid.sort', 'Published', 'a.state', @$this->lists['order_Dir'], @$this->lists['order']); ?>
            </th>
            <th class="frontpage">
                <?php echo JText::_('Frontpage'); ?>
            </th>
            <th class="searchable">
                <?php echo JText::_('Searchable'); ?>
            </th>
            <th class="comments" style="display:none">
                <?php echo JText::_('Comments'); ?>
            </th>
            <th class="priority">
                <?php echo $this->app->html->_('grid.sort', 'Order Priority', 'a.priority', @$this->lists['order_Dir'], @$this->lists['order']); ?>
            </th>
            <th class="access"  style="display:none">
                <?php echo $this->app->html->_('grid.sort', 'Access', 'a.access', @$this->lists['order_Dir'], @$this->lists['order']); ?>
            </th>
            <th class="author">
                <?php echo $this->app->html->_('grid.sort', 'Author', 'a.created_by', @$this->lists['order_Dir'], @$this->lists['order']); ?>
            </th>
            <th class="date">
                <?php echo $this->app->html->_('grid.sort', 'Date', 'a.created', @$this->lists['order_Dir'], @$this->lists['order']); ?>
            </th>
            <th class="hits"  style="display:none">
                <?php echo $this->app->html->_('grid.sort', 'Hits', 'a.hits', @$this->lists['order_Dir'], @$this->lists['order']); ?>
            </th>
        </tr>
        </thead>
        <tfoot>
        <tr>
            <td colspan="13">
                <?php echo $this->pagination->getListFooter(); ?>
            </td>
        </tr>
        </tfoot>
        <tbody>
        <?php
        $nullDate = $this->app->database->getNullDate();
        for ($i = 0, $n = count($this->items); $i < $n; $i++) :

            $row = $this->items[$i];
            $now = $this->app->date->create()->toUnix();
            $publish_up = $this->app->date->create($row->publish_up);
            $publish_down = $this->app->date->create($row->publish_down);
            $offset = $this->app->date->getOffset();
            $publish_up->setTimezone(new DateTimeZone($offset));
            $publish_down->setTimezone(new DateTimeZone($offset));

            $img = '';
            $alt = '';
            if ($now <= $publish_up->toUnix() && $row->state == 1) {
                $img = 'publish_y.png';
                $alt = JText::_('Published');
            } else if (($now <= $publish_down->toUnix() || $row->publish_down == $nullDate) && $row->state == 1) {
                $img = 'publish_g.png';
                $alt = JText::_('Published');
            } else if ($now > $publish_down->toUnix() && $row->state == 1) {
                $img = 'publish_r.png';
                $alt = JText::_('Expired');
            } else if ($row->state == 0) {
                $img = 'publish_x.png';
                $alt = JText::_('Unpublished');
            }

            if ($row->searchable == 0) {
                $search_img = 'publish_x.png';
                $search_alt = JText::_('None searchable');
            } elseif ($row->searchable == 1) {
                $search_img = 'tick.png';
                $search_alt = JText::_('Searchable');
            }

            if ($row->frontpage) {
                $frontpage_img = 'tick.png';
                $frontpage_alt = JText::_('JYES');
            } else {
                $frontpage_img = 'publish_x.png';
                $frontpage_alt = JText::_('JNO');
            }

            $comments_enabled = (int)$row->getParams()->get('config.enable_comments', 1);
            $comments_img = $comments_enabled ? 'tick.png' : 'publish_x.png';
            $comments_alt = $comments_enabled ? JText::_('Comments enabled') : JText::_('Comments disabled');

            $times = '';

            if (isset($row->publish_up)) {
                if ($row->publish_up == $nullDate) {
                    $times .= JText::_('Start: Always');
                } else {
                    $times .= JText::_('Start') . ": " . $publish_up->format('Y-m-d H:i:s', true);
                }
            }

            if (isset($row->publish_down)) {
                if ($row->publish_down == $nullDate) {
                    $times .= "<br />" . JText::_('Finish No Expiry');
                } else {
                    $times .= "<br />" . JText::_('Finish') . ": " . $publish_down->format('Y-m-d H:i:s', true);
                }
            }

            // author
            $author = $row->created_by_alias;
            if (!$author) {
                if (isset($this->users[$row->created_by])) {
                    $author = $this->users[$row->created_by]->name;

                    if ($this->app->user->get()->authorise('core.edit', 'com_users')) {
                        $author = '<a href="' . $this->app->component->users->link(array('task' => 'user.edit', 'layout' => 'edit', 'view' => 'user', 'id' => $row->created_by)) . '" title="' . JText::_('Edit User') . '">' . $author . '</a>';
                    }
                } else {
                    $author = JText::_('Guest');
                }
            }
            ?>
            <tr>
                <td class="checkbox">
                    <input type="checkbox" name="cid[]" value="<?php echo $row->id; ?>"/>
                </td>
                <td class="icon"></td>
                <td class="name">
                        <span class="editlinktip hasTip"
                              title="<?php echo JText::_('Edit Item'); ?>::<?php echo $row->name; ?>">
                        <?php
                        if ($row->canEdit()) {
                            echo '<a href="' . $this->app->link(array('controller' => $this->controller, 'changeapp' => $this->application->id, 'task' => 'edit', 'cid[]' => $row->id)) . '">' . $row->name . '</a>';
                        } else {
                            echo $row->name;
                        }
                        ?>
                        </span>
                    <?php
                    $itemUrl = $this->app->route->item($row, false);
                    $siteUrl = str_replace('administrator/', '', JUri::base());
                    $item = $this->app->table->item->get($row->id);
                    $jbprice = $item->getElement('f4483451-befa-4f92-b5bf-e2e9c3e90283');
                    $numberprod = $item->getElement('d60e15cc-e340-4666-a748-9ee970bf3f5a')->get('value');
                    $skuData = $jbprice->getList()->current()->get('_sku')->getValue();
                    $valueData = $jbprice->getList()->current()->get('_value')->getValue();
                    ?>
                    <a href="<?php echo $siteUrl . $itemUrl; ?>&tmpl=component&jbquickview=full" class="popup-item" title=""
                       data-fancybox-type="iframe">
                        <em class="icon-out-2"></em>
                    </a>
                </td>
                <td class="alias">
                        <?php echo '<a target="_blank" href="/item/'.$row->alias.'.html"><center> <em class="icon-out-2"></em> </center></a>' ?>
                </td>
                <td class="jbzoosku" style="text-align:center; width: 80px;" >
<?php

echo "<span class='skudata'>".$skuData."</span>";

 ?>
                </td>
                <td class="jbzooprice" style="text-align:center; width: 100px;" >
                  <?php
echo "<span class='valuedata'>".$valueData."</span>";


                   ?>
                </td>
                <td class="numberprod" style="text-align:center; width: 140px;" >
                  <?php
echo "<span class='numberprod'>".$numberprod."</span>";

                   ?>
                </td>
                <td class="published">
                        <span class="editlinktip hasTip"
                              title="<?php echo JText::_('Publish Information'); ?>::<?php echo $times; ?>">
                            <?php if ($row->canEditState()) : ?>
                                <a href="#" rel="task-<?php echo $row->state ? 'unpublish' : 'publish'; ?>">
                                    <img src="<?php echo $this->app->path->url('assets:images/' . $img); ?>" width="16"
                                         height="16" border="0" alt="<?php echo $alt; ?>"/>
                                </a>
                            <?php else: ?>
                                <img src="<?php echo $this->app->path->url('assets:images/' . $img); ?>" width="16"
                                     height="16" border="0" alt="<?php echo $alt; ?>"/>
                            <?php endif; ?>
                        </span>
                </td>
                <td class="frontpage">
                    <?php if ($row->canManageFrontpage()) : ?>
                        <a href="#" rel="task-<?php echo 'toggleFrontpage'; ?>"
                           title="<?php echo JText::_('Toggle frontpage state'); ?>">
                            <img src="<?php echo $this->app->path->url('assets:images/' . $frontpage_img); ?>"
                                 width="16" height="16" border="0" alt="<?php echo $frontpage_alt; ?>"/>
                        </a>
                    <?php else: ?>
                        <img src="<?php echo $this->app->path->url('assets:images/' . $frontpage_img); ?>" width="16"
                             height="16" border="0" alt="<?php echo $frontpage_alt; ?>"/>
                    <?php endif; ?>
                </td>
                <td class="searchable">
                    <?php if ($row->canEdit()) : ?>
                        <a href="#" rel="task-<?php echo $row->searchable ? 'makenonesearchable' : 'makesearchable'; ?>"
                           title="<?php echo JText::_('Edit searchable state'); ?>">
                            <img src="<?php echo $this->app->path->url('assets:images/' . $search_img); ?>" width="16"
                                 height="16" border="0" alt="<?php echo $search_alt; ?>"/>
                        </a>
                    <?php else: ?>
                        <img src="<?php echo $this->app->path->url('assets:images/' . $search_img); ?>" width="16"
                             height="16" border="0" alt="<?php echo $search_alt; ?>"/>
                    <?php endif; ?>
                </td>
                <td class="comments"  style="display:none">
                    <?php if ($row->canEdit()) : ?>
                        <a href="#" rel="task-<?php echo $comments_enabled ? 'disablecomments' : 'enablecomments'; ?>"
                           title="<?php echo JText::_('Enable/Disable comments'); ?>">
                            <img src="<?php echo $this->app->path->url('assets:images/' . $comments_img); ?>" width="16"
                                 height="16" border="0" alt="<?php echo $comments_alt; ?>"/>
                        </a>
                    <?php else: ?>
                        <img src="<?php echo $this->app->path->url('assets:images/' . $comments_img); ?>" width="16"
                             height="16" border="0" alt="<?php echo $comments_alt; ?>"/>
                    <?php endif; ?>
                </td>
                <td class="priority">
                    <?php if ($row->canEdit()) : ?>
                        <span class="minus"></span>
                        <input type="text" class="value" value="<?php echo $row->priority; ?>" size="5"
                               name="priority[<?php echo $row->id; ?>]"/>
                        <span class="plus"></span>
                    <?php else: ?>
                        <input type="text" class="value" value="<?php echo $row->priority; ?>" size="5"
                               name="priority[<?php echo $row->id; ?>]" disabled/>
                    <?php endif; ?>
                </td>
                <td class="access"  style="display:none">
                    <span><?php echo JText::_($this->app->zoo->getGroup($row->access)->name); ?></span>
                </td>
                <td class="author">
                    <?php echo $author; ?>
                </td>
                <td class="date">
                    <?php echo $this->app->html->_('date', $row->created, JText::_('DATE_FORMAT_LC4'), $this->app->date->getOffset()); ?>
                </td>
                <td class="hits"  style="display:none">
                    <?php echo $row->hits ?>
                </td>
            </tr>
        <?php endfor; ?>
        </tbody>
        </table>

    <?php
    elseif ($this->is_filtered) :

        $title = JText::_('SEARCH_NO_ITEMS') . '!';
        $message = null;
        echo $this->partial('message', compact('title', 'message'));

    else :

        $title = JText::_('NO_ITEMS_YET') . '!';
        $message = JText::_('ITEM_MANAGER_DESCRIPTION');
        echo $this->partial('message', compact('title', 'message'));

    endif;
    ?>

    </div>

    <input type="hidden" name="controller" value="<?php echo $this->controller; ?>"/>
    <input type="hidden" name="task" value=""/>
    <input type="hidden" name="boxchecked" value="0"/>
    <input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>"/>
    <input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>"/>
    <input type="hidden" name="changeapp" value="<?php echo $this->application->id; ?>"/>
    <?php echo $this->app->html->_('form.token'); ?>

    </form>

    <script type="text/javascript">
        jQuery(function ($) {
            $('#adminForm').BrowseItems();
        });
    </script>

<?php echo ZOO_COPYRIGHT;


  • 2

#57 Tunga

Tunga
  • JBZoo User (rus)
  • User rate: 9.7
  • posts: 595
  • topics: 129

Posted 13 October 2016 - 17:17

Отлично :)

Спасибо Денис!!!

Спустя два года мы все таки побороли этот джумловский поиск)


  • 2

JBZoo это круто!


#58 mkm-nn

mkm-nn
  • JBZoo User (rus)
  • User rate: 0.5
  • posts: 77
  • topics: 19

Posted 20 October 2016 - 08:00

это круто! а когда в самой JBZoo заработает поиск по артиклу.


  • 0

#59 SmetDenis

SmetDenis
  • Administrators
  • User rate: 139.4
  • posts: 16232
  • topics: 200

Posted 20 October 2016 - 09:18

это круто! а когда в самой JBZoo заработает поиск по артиклу.

 

Уже включено в v2.3.0


  • 2
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#60 mkm-nn

mkm-nn
  • JBZoo User (rus)
  • User rate: 0.5
  • posts: 77
  • topics: 19

Posted 20 October 2016 - 10:59

Уже включено в v2.3.0

Обновил ,ввел артикул в  2colomns результат. К сожалению, по вашему запросу ничего не найдено.


  • 0




Click to return to top of page in style!