Ejemplo n.º 1
0
 public function testGetAllowAttributes()
 {
     $attributes = $this->_block->getAllowAttributes();
     $this->assertInstanceOf('Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection', $attributes);
     $this->assertGreaterThanOrEqual(1, $attributes->getSize());
 }
Ejemplo n.º 2
0
 $pro[$i]["reviewCount"] = $summaryData->getReviewsCount();
 //$pro[$i]["reviewSummary"]  = round((int) $summaryData->getRatingSummary() / 10);
 $pro[$i]["reviewSummary"] = $summaryData->getRatingSummary();
 //$pro[$i]["ratings"]  = getRating($_product->getId());
 $pro[$i]["available"] = (int) $_product->isSalable();
 $pro[$i]["inStock"] = (int) $_product->getStockItem()->getIsInStock();
 $pro[$i]["hasOptions"] = (int) $_product->getHasOptions();
 $pro[$i]["shotDesc"] = $_product->getShortDescription();
 $pro[$i]["desc"] = $_product->getDescription();
 $EntityId = $_product->getEntityTypeId();
 if ($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
     $temp = new Mage_Catalog_Block_Product_View_Type_Configurable();
     $temp->setData('product', $product);
     //		        echo "<pre>";
     //		        print_r ($temp->getAllowAttributes());
     $_attributes = Mage::helper('core')->decorateArray($temp->getAllowAttributes());
     if ($_product->isSaleable() && count($_attributes)) {
         $z = 0;
         $attr = array();
         foreach ($_attributes as $_attribute) {
             $productAttrib = $_attribute->getProductAttribute();
             //echo "Product_id =".$product->getId()."==>".$_attribute->getLabel()."</br></br></br>";
             $attr[$z]["label"] = $productAttrib->getFrontendLabel();
             $attr[$z]["is_required"] = $productAttrib->getIsRequired();
             $attr[$z]["attribute_id"] = $productAttrib->getAttributeId();
             $attr[$z]["attribute_code"] = $productAttrib->getAttributeCode();
             $attr[$z]["entity_attribute_id"] = $productAttrib->getEntityAttributeId();
             $attr[$z]["attribute_set_id"] = $productAttrib->getAttributeSetId();
             $attr[$z]["attribute_group_id"] = $productAttrib->getAttributeGroupId();
             $productPrices = $_attribute->getPrices();
             // Zend_Debug::dump($productPrice);