oc-shopaholic / oc-shopaholic-plugin

πŸ›οΈ No. 1 e-commerce platform for October CMS
https://shopaholic.one
GNU General Public License v3.0
425 stars 52 forks source link

Cant load css styles after compiled npm run dev #334

Closed jahoora closed 3 years ago

jahoora commented 3 years ago

Hello, please help me I have problem, after compiled npm run dev not load css style on index page Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2021-01-19 Π² 02 12 50 Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2021-01-19 Π² 02 13 17

kharanenka commented 3 years ago

Hi! Do you have compiled files? What local domain do you use?

jahoora commented 3 years ago

Yeah, in attach files My domen is: http://localhost:8888/dps/ Новая папка 2.zip

kharanenka commented 3 years ago

Please fix path to css/js files in tempalte file. Template has absolute path. For example: /themes/***/assets/css/common.css If you uses folder (dps) for your root folder, then you should fix absolute path and add "dps" folder to assets path.

jahoora commented 3 years ago

thank you

jahoora commented 3 years ago

Let me know please what a "template file" you mean?

kharanenka commented 3 years ago

I mean "layouts" files

jahoora commented 3 years ago

This is original code in main layout : `<?php function onInit() { $this['path_css'] = mix('css/common.css', 'themes/'.\Cms\Classes\Theme::getActiveTheme()->getDirName().'/assets'); $this['path_js'] = mix('js/common.js', 'themes/'.\Cms\Classes\Theme::getActiveTheme()->getDirName().'/assets'); $this['cart_is_available'] = false;

/**
 * Check if Cart component has been registered and autoload it
 **/

$obManager = \Cms\Classes\ComponentManager::instance();
if ($obManager->hasComponent('Lovata\OrdersShopaholic\Components\Cart')) {
    $this['cart_is_available'] = true;
    $this->addComponent('Lovata\OrdersShopaholic\Components\Cart', 'Cart', []);
}

if ($obManager->hasComponent('Lovata\MightySeo\Components\SeoToolbox')) {
    $this['seo_toolbox_is_available'] = true;
    $this->addComponent('Lovata\MightySeo\Components\SeoToolbox', 'SeoToolbox', []);
}

}`

Here for example i add "dps" for path_css

`<?php function onInit() { $this['path_css'] = mix('css/common.css', 'dps/themes/'.\Cms\Classes\Theme::getActiveTheme()->getDirName().'/assets'); $this['path_js'] = mix('js/common.js', 'themes/'.\Cms\Classes\Theme::getActiveTheme()->getDirName().'/assets'); $this['cart_is_available'] = false;

/**
 * Check if Cart component has been registered and autoload it
 **/

$obManager = \Cms\Classes\ComponentManager::instance();
if ($obManager->hasComponent('Lovata\OrdersShopaholic\Components\Cart')) {
    $this['cart_is_available'] = true;
    $this->addComponent('Lovata\OrdersShopaholic\Components\Cart', 'Cart', []);
}

if ($obManager->hasComponent('Lovata\MightySeo\Components\SeoToolbox')) {
    $this['seo_toolbox_is_available'] = true;
    $this->addComponent('Lovata\MightySeo\Components\SeoToolbox', 'SeoToolbox', []);
}

} ?>`

but after change i have exception Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2021-01-20 Π² 23 56 18