确定用户所在的产品页面类型 [英] Determine type of product page the user is on

查看:21
本文介绍了确定用户所在的产品页面类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里查看答案,它可以让我找到75%的答案,但是,有没有办法区分捆绑产品与简单产品?

I was looking at the answer here and it gets me 75% of the way there, however, is there a way to distinguish between a bundle product versus a simple product?

确定是否在Magento中以编程方式在产品页面上

运行Magento 1.11

Running Magento 1.11

推荐答案

switch ($product->getTypeId()) {
    case Mage_Catalog_Model_Product_Type::TYPE_SIMPLE:
        //...
        break;
    case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE:
        //...
        break;
    case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE:
        //...
        break;
    case Mage_Catalog_Model_Product_Type::TYPE_GROUPED:
        //...
        break;
    case Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL:
        //...
        break;
}

这篇关于确定用户所在的产品页面类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆