Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Смена CSS в зависимости от языка


Recommended Posts

Здравствуйте,


Помогите, плз.
image.png
Перевожу шаблон на иврит (RTL). Застрял на ерунгде. 


Продублировал все файлы css (добавил в имя _rtl).
Теперь нужно в зависимости от языка подгрузить нужный css.

 

Вот часть кода из header.twig:

//.............................................
{% if direction == 'rtl' %}
        <link href="catalog/view/theme/modern/js/bootstrap/css/bootstrap_rtl.min.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/stylesheet/skins/stylesheet_rtl.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/stylesheet/skins/modern_rtl.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/js/jquery/magnific/magnific-popup_rtl.css" rel="stylesheet" media="screen" />
        <link href="catalog/view/javascript/font-awesome/css/font-awesome_rtl.min.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/js/font-viber/fa-viber_rtl.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/stylesheet/skins/modern_modules_rtl.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/js/jquery/swiper/css/swiper_rtl.min.css" rel="stylesheet">
    {% else %}
        <link href="catalog/view/theme/modern/js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/stylesheet/skins/stylesheet.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/stylesheet/skins/modern.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/js/jquery/magnific/magnific-popup.css" rel="stylesheet" media="screen" />
        <link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/js/font-viber/fa-viber.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/stylesheet/skins/modern_modules.css" rel="stylesheet">
        <link href="catalog/view/theme/modern/js/jquery/swiper/css/swiper.min.css" rel="stylesheet">
    {% endif %}

 

Врогде все правильно, но заменяются не все файлы на _rtl. 

Например, 
stylesheet.css и modern.css заменились
magnific-popup.css и modern_modules.css - нет


В php нужно что-то менять?
Например, в ...\catalog\controller\product\product.php
 
Ггде-то в этом месте

$this->document->setTitle($product_info['meta_title']);
$this->document->setDescription($product_info['meta_description']);
$this->document->setKeywords($product_info['meta_keyword']);
$this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');
$this->document->addScript('catalog/view/javascript/jquery/magnific/jquery.magnific-popup.min.js');
$this->document->addStyle('catalog/view/javascript/jquery/magnific/magnific-popup.css');
$this->document->addScript('catalog/view/javascript/jquery/datetimepicker/moment/moment.min.js');
$this->document->addScript('catalog/view/javascript/jquery/datetimepicker/moment/moment-with-locales.min.js');
$this->document->addScript('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js');
$this->document->addStyle('catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css');

Да должно быть:
image.png
 
Спасипотому что.

header (1).twig product (1).php

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.