简体   繁体   English

Opencart标题购物车摘要

[英]Opencart header cart summary

We tried to find a module/plugin or something like that that shows a cart summary in the page header (instead of in the sidebar as we currently have it) of our OpenCart webshop. 我们试图找到一个模块/插件或类似的东西在我们的OpenCart网上商店的页面标题中(而不是在当前的侧边栏中)显示购物车摘要。

But it is difficult to search for this because we do not have matching search parameters (eg the keyword "cart" gives many results but all of them are not what we are searching for). 但是搜索起来很困难,因为我们没有匹配的搜索参数(例如,关键字“ cart”给出了很多结果,但是所有这些都不是我们要搜索的结果)。

Does anybody have an idea how such a module would be named so that we will be able to search for it? 有谁知道如何命名这样的模块,以便我们能够搜索它?

Does anybody already used such an module for OpenCart and could give us a recommendation/link to a good module? 是否有人已经为OpenCart使用了这样的模块,并且可以给我们推荐/链接到一个好的模块?

We think that there must already exist ready to use plugins like that - so we do not want to invent the wheel again by coding an own one. 我们认为必须已经可以使用类似的插件了-因此我们不想通过编写自己的插件来再次发明轮子。

As you have (instead of in the sidebar as we currently have it) you want to show module in header 如您所愿(而不是像现在那样在侧边栏中),您想在标题中显示模块

you can call any module in header as well. 您也可以在标头中调用任何模块。 eg i have passed category module to header which is by default can be assigned to sidebar , top and bottom onlly. 例如,我已经将category模块传递给标题,默认情况下可以将其分配给sidebar,top和bottom。 In /catalog/controller/common/header.php here you can load required module. /catalog/controller/common/header.php ,您可以加载所需的模块。

$this->children = array(
            'module/language',
            'module/currency',
            'module/cart',
            'module/category'
);

Now echo it on /catalog/view/theme/default/template/common/header.tpl file where you want it to appear. 现在,在您希望它出现的/catalog/view/theme/default/template/common/header.tpl文件中echo它。

<?php echo $category; ?>

In this way you can use any module to header and footer as well. 这样,您就可以使用任何模块作为页眉和页脚。

Good Luck 祝好运

I've always hated the limitations on module positioning in OC. 我一直讨厌在OC中对模块定位的限制。 Take the code from the cart summary module itself and implement it directly into the /common/header.tpl or wherever would be appropriate for this level of customization. 从购物车摘要模块本身获取代码,并将其直接实现到/common/header.tpl或适用于此定制级别的任何地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM