-
-
Save natrod/9c074cc70351c2cb4bcc8cb806faf0d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$_helper = Mage::helper('catalog/output'); | |
$add = new Mage_Catalog_Block_Product_View_Attributes(); | |
$add->setProduct($productId); | |
$_product = Mage::getModel('catalog/product'); | |
$_product->setStoreId($storeId); | |
$_product->load($productId); | |
Mage::register('product', $_product); | |
$_additional = $add->getAdditionalData(); | |
foreach ($_additional as $_data): | |
$_attribute = $_product->getResource()->getAttribute($_data['code']); | |
if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) !='') && (!is_null($_data['label'])) && (!is_null($_data['value']))) | |
{ | |
$produs->appendChild($xml->createElement(str_replace(" ","_", preg_replace("/[^A-Za-z0-9_ ]/", "",$_data['label'])), str_replace($replace_from, $replace_to, strip_tags($_helper->productAttribute($_product, $_data['value'], $_data['code']))))); | |
} | |
endforeach; | |
Mage::unregister('product'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment