以下是特定于magento基本安装的方案。 我希望能够在选择制造商过滤器时更改我的类别页面上的某些内容。
我看到的是http://www.myurl.com/path/to/cat.html?manufacturer=777
从这里我可以通过以下方式获得制造商ID:
$request->getParam('manufacturer');我希望能够做的是跳转到eav_attribute_option_value并根据value_id (在我的情况下为8404)和制造商ID获取制造商名称以返回制造商的名称。
我相信还有其他用例,这也会变得很方便。 对于我的情况,我将基于其他一些逻辑将品牌添加到类别标题标签。 这将创建新的高品牌类别页面,应该在谷歌排名很好。
所以您的基本类别标题标签可能如下所示:'洗衣机'
然后Maytag的制造商品牌过滤页面看起来像:'Maytag洗衣机'
Here is the scenario specific to a base installation of magento. I would like to be able to change some content on my category pages when a manufacturer filter has been chosen.
What I see is http://www.myurl.com/path/to/cat.html?manufacturer=777
From this I can get the manufacturers id by doing something like:
$request->getParam('manufacturer');What I would like to be able to do is jump into eav_attribute_option_value and get the manufacturers name based on the value_id (8404 in my case) and the manufacturer id to return the name of the manufacturer.
I am sure there are other use cases where this would become handy too. For my case I will be prepending the brand to the category title tag based on some other logic. This will create new highly branded category pages that should rank well on google.
So your base category title tag might look like: 'Washing Machines'
And then the manufacturer brand filter page for Maytag would look like: 'Maytag Washing Machines'
最满意答案
我能找到一种肮脏的方式来做到这一点。 $ query =“SELECT * FROM mg_eav_attribute_option_value WHERE option_id =”。 $ request_params ['制造商']。 “限制0,30”; $ read = Mage :: getSingleton('core / resource') - > getConnection('core_read'); $ manufacturer = $ read-> fetchAll($ query);
I was able to find a dirty way to do this. $query = "SELECT * FROM mg_eav_attribute_option_value WHERE option_id =" . $request_params['manufacturer'] . " LIMIT 0 , 30"; $read = Mage::getSingleton('core/resource')->getConnection('core_read'); $manufacturer = $read->fetchAll($query);
更多推荐
发布评论