如何添加“按类别过滤”下拉至 Virtuemart shop.browse 页面?

发布于 2024-11-16 20:50:31 字数 775 浏览 8 评论 0原文

VirtueMart (shop.browse) 中的默认浏览页面的格式如下:

The title "Browse"
A "Sort-by" dropdown
Table containing available products in row/column format

默认的 Sort-by 下拉列表提供“按名称”、“按 SKU”等排序选项。它不是任何类型的过滤器。

我想添加一个下拉列表,允许我按类别过滤,这样我的结果页面看起来像:

The title "Browse"
A "Filter-by Category" dropdown
A "Sort-by" dropdown
Table containing available products in row/column format

我的问题是这样的:我知道足够的 PHP 来对其他人的代码进行基本的调试或更改,但我自己写的还远远不够。 我的编码问题如下:

  1. 如何编写一个下拉列表以从 VirtueMart 提取类别信息并将其加载到其下拉选项中?
  2. 如何告诉虚拟机根据所选的下拉选项重新加载产品?

我开始意识到这看起来可疑地像“为我编写代码,因为我不知道如何”类型的问题之一。我讨厌这类问题,因为这意味着作者的懒惰。我不是那种人,所以让我提前声明,我会像实际代码一样高兴得到一些正确方向的指针。我对此进行了相当深入的研究,但在网络上没有发现太多帮助。

The default Browse page in VirtueMart (shop.browse) is formatted like so:

The title "Browse"
A "Sort-by" dropdown
Table containing available products in row/column format

The default Sort-by dropdown provides sorting options like "by name", "by SKU", and so on. It is not a filter of any sort.

I would like to add a dropdown which allows me to FILTER by CATEGORY, so that my resultant page looks like:

The title "Browse"
A "Filter-by Category" dropdown
A "Sort-by" dropdown
Table containing available products in row/column format

My problem is this: I know enough PHP to do basic debugs or alterations of other people's code, but not remotely enough write my own. My coding questions are these:

  1. How do I code a dropdown to pull Category info from VirtueMart and load that into its dropdown options?
  2. How do I tell VM to reload the products based on the dropdown option chosen?

I'm starting to realize that this looks suspiciously like one of those "write my code for me, cuz I don't know how to" types of questions. I hate those sorts of questions because it implies laziness on the part of the author. I'm not that guy, so let me state in advance that I'd be just as happy for some pointers in the right direction as much as I would actual code. I've researched this fairly well, but haven't found much helpful on the web.

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

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

发布评论

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

评论(1

我三岁 2024-11-23 20:50:31

这是一个相当广泛的请求,需要整个组件来完成任务,而无需真正破坏虚拟机核心。你很幸运,有人已经做到了。

http://extensions.joomla.org/extensions /扩展特定/virtuemart-extensions/virtuemart-products-search/10285

http://extensions.joomla.org/extensions/extension -specic/virtuemart-extensions/virtuemart-products-search/10968

这两个都可能适合您想要做的事情。它们是商业性的,但价格合理。

This is quite an extensive request that would require an entire component to accomplish the task without really hacking up the VM core. Lucky for you someone has already done it.

http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-products-search/10285

http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-products-search/10968

Both of these would probably work for what you want to do. They are commercial but reasonably priced.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文