Magento - get current product

前端 未结 4 1990
天涯浪人
天涯浪人 2021-02-05 08:18

I have a sidebar block in my layout that is being displayed on different pages.

In this block I have a list of products, and I want to select the current product when I

4条回答
  •  有刺的猬
    2021-02-05 08:35

    You can get the current product ID and product details from the below code.

    $_proId  = $this->getProduct()->getId();
    $_product= Mage::getModel('catalog/product')->load($_proId);
    

提交回复
热议问题