我在向 prestashop 前台添加任何样式表时遇到了问题。我阅读了多篇文章,尝试了多种解决方案,但无法使其发挥作用。将样式添加到后台不是问题(但我认为这段用于将样式添加到后台的代码是解决方法)。这是模块代码。(我在多个位置添加了样式表导入来检查每个解决方案。在其他模块中,此方法按预期工作)。抱歉,代码很乱,我不太擅长 PHP。
\n\n<?php\n\nif (!defined(\'_PS_VERSION_\'))\n exit();\n\nclass PromotionBanner extends Module\n{\n public function __construct()\n {\n $this->name = \'promotionbanner\';\n $this->tab = \'front_office_features\';\n $this->version = \'1.0.0\';\n $this->author = \'example\';\n $this->author_uri = \'https://example.com\';\n $this->ps_versions_compliancy = array(\'min\' => \'1.7.1.0\', \'max\' => _PS_VERSION_);\n $this->bootstrap = true;\n $this->need_instance = 0;\n $this->dir = \'/modules/promotionbanner\';\n $this->css_path = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . \'modules/\' . $this->name\n . \'/\' . $this->_path . \'views/css/\';\n\n parent::__construct();\n\n $this->displayName = $this->l(\'Promotion Banner\', \'promotionbanner\');\n $this->description = $this->l(\'This module provides configurable promotion banner on your website\');\n\n …Run Code Online (Sandbox Code Playgroud)