打开购物车...每个类别都有不同的 CSS

发布于 2024-12-24 01:51:48 字数 165 浏览 3 评论 0原文

我正在尝试在 opencart 购物车中加载每个类别完全不同的 CSS 文件。我尝试在 header.tpl 中使用 switch 语句,但它对我没有帮助。

基本上我只有四个类别,并且所有类别都有不同的 CSS。像类别有56个不同、57个不同、58个不同和59个不同。

我该怎么做呢?

I am trying to load completely different CSS file per category in opencart shopping cart. I have tried to use switch statement in header.tpl but it did not help me.

Basically I have only four categories and all will have different CSS. Like category 56 has different, 57 different, 58 different and 59 different.

How would I do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

还给你自由 2024-12-31 01:51:48

您可以通过 category.php 控制器文件添加所需的 css 文件。

文件:

catalog/controller/product/category.php

查找:

$this->document->setTitle($category_info['meta_title']);

添加在其前面:

if($category_id == 20){
    $this->document->addStyle('catalog/view/theme/mytheme/stylesheet/category20.css');
}

You can add your desired css file, via category.php controller file.

File:

catalog/controller/product/category.php

Find:

$this->document->setTitle($category_info['meta_title']);

Add before it:

if($category_id == 20){
    $this->document->addStyle('catalog/view/theme/mytheme/stylesheet/category20.css');
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文