Помощь Sj Responsive Listing Joomshopping не переводит на другой язык

Aikon

Постоялец
Регистрация
16 Фев 2015
Сообщения
77
Реакции
32
Здравствуйте. Есть проблема с модулем Sj Responsive Listing. На главном языке выводит товары нормально. Если переключить сайт на другой язык, то товары выводятся на главном языке, а не на том, на который переключил. Кто знает, как исправить ситуацию?
 
Пункты меню, и связь между ними относительно языковой локализации есть? Ссылку на сайт выложи...
 
Связи есть, все другое работает, joomshopping все переводит. Только этот модуль не работет, подтягивает название главного языка
 
Ссылку на сайт выложи...
 
Вот еще файл helper.php модуля. Возможно оно не работает потому, что обновилась Joomla?
PHP:
<?php
/**
* @package Sj Responsive Listing for JoomShopping
* @version 1.0.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @copyright (c) 2012 YouTech Company. All Rights Reserved.
* @author YouTech Company http://www.smartaddons.com
*/

defined('_JEXEC') or die;

include_once dirname(__FILE__).'/helper_base.php';

class JSResponsiveListingHelper extends JSResponsiveListingBaseHelper{
    public static $total = null;
    public static function getList(&$params)
    {
        $db = JFactory::getDBO();
        $jshopConfig = JSFactory::getConfig();
        $jshopConfig->cur_lang = $jshopConfig->frontend_lang;
        JSFactory::loadCssFiles();
        JSFactory::loadLanguageFile();
        $lang = JSFactory::getLang();
        $jshopConfig = JSFactory::getConfig();
       
        $filters = array();
        $order_by = $params->get('source_order_by');
        $itemsOrdering_display = $params->get('itemsOrdering_display');
        if(!empty($itemsOrdering_display) && !in_array($order_by,$itemsOrdering_display)){
            $order_by = $itemsOrdering_display[0];
        }else{
       
        }
        if( $order_by == 'name' ){
            $order_by = "prod.`".$lang->get('name')."`";
        }
        $order_dir = $params->get('product_order_dir');
       
        $app = JFactory::getApplication();
        $appParams = $app->getParams();
        $source_limit = '';
        $limitation = (int)$params->get('source_limit',6);
        $limit_start = $app->input->getInt('ajax_reslisting_start',0);
        $field_sort = $params->get('sort', 'id');
        $ordering = $params->get('ordering', 'asc');
        $count_cat= (int)$params->get('count_cat',10);
        $catidpreload = $params->get('catidpreload');
        $catids = $params->get('catids');
        $_catids = array();
        $list = array();
        $retur = array();
        if(!empty($catids)){
            if(in_array($catidpreload,$catids)){
                array_unshift($catids,$catidpreload);
            }
            $filters['categorys'] = array_unique($catids);
            $catid = implode(", ", $catids);
            $product = JTable::getInstance('product', 'jshop');
            self::$total = $product->getCountAllProducts($filters);
            $categories = self::getCategory($catid,$field_sort,$ordering,1);
            if(!empty($categories)){
                foreach($categories as $i=> $category){
                    //$cat->_description = self::_cleanText($cat->description);
                    //self::getJSCImages($item, $params,'imgcfgcat');
                    $category->count = 0;
                    $list[$category->category_id] = $category;
                }
               
                $retur['categories'] = $list;
                //var_dump($retur['categories']);return;
                $items = $product->getAllProducts(array_unique($filters), $order_by, " ".$order_dir, $limit_start, $limitation);
                foreach($items as $item){
                    $category = self::getCategory($item->category_id,$field_sort,$ordering,1);
                    $category = $list[$item->category_id];
                     
                    if(isset($category->count)){
                            $category->count ++;
                    }else{
                        $category->count = 1;
                    }
                    $item->category_title = $category->name;
                    $product->load($item->product_id);
                   
                    $product->getDescription();
                    //$item->_tax = productTaxInfo($product->getTax()).' '.sprintf(_JSHOP_PLUS_SHIPPING, $product->shippinginfo) ;
                //    var_dump($product->hide_buy);
                    $item->title = $item->name;   
                    $item->product_date_added = $product->product_date_added;
                    $item->date_modify = $product->date_modify;
                    $item->description = $product->description;
                    self::getJSAImages($item, $params);
                    $item->short_desc = self::_cleanText($product->short_description);
                    $item->_description =  self::_cleanText($item->description);
                    $item->_description = ($item->_description !='')?$item->_description:$item->short_desc;
                    $item->link = SEFLink('index.php?option=com_jshopping&controller=product&task=view&category_id=' . $item->category_id.'&product_id=' . $item->product_id ,1);
                }
                if ($params->get('tab_all_display', 1)){
                    $all = new stdClass();
                    $all->category_id = '*';
                    $all->count = count($items);
                    $all->name = JText::_('All');
               
                    array_unshift($retur['categories'], $all);
                }
                // default select
               
                $selected = false;
                foreach ($retur['categories'] as $cat){
                    if ( $cat->category_id == $catidpreload && $cat->count > 0 ){
                        $cat->sel = 'sel';
                        $selected = true;
                       
                    }
                }
                // first tab is active
                if (!$selected){
                    foreach ($retur['categories'] as $cat){
                        if ($cat->count > 0){
                            $cat->sel = 'sel';
                            break;
                        }
                    }
                }
               
                $retur['items'] = $items;
            }
           
        }
        return $retur;   
    }
   
    public static   function getCategory($catid, $order = 'id', $ordering = 'asc', $publish = 0) {
        $_db = JFactory::getDBO();
        $lang = JSFactory::getLang();
        $user = JFactory::getUser();
        $add_where = ($publish)?(" AND category_publish = '1' "):("");
        $groups = implode(',', $user->getAuthorisedViewLevels());
        $add_where .=' AND access IN ('.$groups.')';
        if ($order=="id") $orderby = "category_id";
        if ($order=="name") $orderby = "`".$lang->get('name')."`";
        if ($order=="ordering") $orderby = "ordering";
        if (!$orderby) $orderby = "ordering";
       
        $query = "SELECT `".$lang->get('name')."` as name,`".$lang->get('description')."` as description,`".$lang->get('short_description')."` as short_description, category_id, category_publish, ordering, category_image FROM `#__jshopping_categories`
                   WHERE category_id IN (".$catid.") ".$add_where."
                   ORDER BY ".$orderby." ".$ordering;
        $_db->setQuery($query);
        $categories = $_db->loadObjectList();
        foreach($categories as $key=>$value){
            $categories[$key]->link = SEFLink('index.php?option=com_jshopping&controller=category&task=view&category_id='.$categories[$key]->category_id, 1);
        }       
        return $categories;
    }
   
   

}
 
А в настройках JS режим "Языки" включен? Заполнены названия и описания для каждого языка?
Потому что я не вижу изменений при переключении языка вообще никакого... Только в меню. Категории, например, только на украинском отображаются.

домен/administrator/index.php?option=com_jshopping&controller=config&task=general

домен/administrator/index.php?option=com_jshopping&controller=config&task=adminfunction

домен/administrator/index.php?option=com_jshopping&controller=langpackedit

Что по этим ссылкам у вас?
 
Проверьте настройки вывода ссылок. У вас все ссылки сформированы неверно. Добавляется index.php, в результате чего у вас все ссылки идут на несуществующие страницы.

Кстати, автоматический листинг можете посмотреть тут Для просмотра ссылки Войди или Зарегистрируйся

P.S. Модуль, который вы используете, у разработчика 28.03.2019 обновился. Возможно, они исправили какие-то ошибки.
Для просмотра ссылки Войди или Зарегистрируйся
 
Последнее редактирование:
А в настройках JS режим "Языки" включен? Заполнены названия и описания для каждого языка?
Потому что я не вижу изменений при переключении языка вообще никакого... Только в меню. Категории, например, только на украинском отображаются.

домен/administrator/index.php?option=com_jshopping&controller=config&task=general

домен/administrator/index.php?option=com_jshopping&controller=config&task=adminfunction

домен/administrator/index.php?option=com_jshopping&controller=langpackedit

Что по этим ссылкам у вас?

последняя ссылка выдает ошибку Fatal error: Class 'JshoppingControllerlangpackedit' not found in /www/administrator/components/com_jshopping/jshopping.php on line 62
 
Установил другой модуль и работает. Но нужно ксс менять( . Может кто-то имеет новую версию Sj Responsive Listing Joomshopping?
 
Назад
Сверху