<?php
require_once 'app/Mage.php';
Mage::app();
$product_sku='NTWFW12FB052OR41';
$productId = Mage::getModel("catalog/product")->getIdBySku( $product_sku );
//$productId = 29763;
echo $productId;
$product = Mage::getModel('catalog/product')->load($productId);
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
$attributeCode = $attribute->getAttributeCode();
$code = 'csize';// your product attribute name here
if ($attributeCode == $code) {
$label = $attribute->getStoreLabel($product);
$value = $attribute->getFrontend()->getValue($product);
echo $attributeCode . '-' . $label . '-' . $value;
}
}
?>
require_once 'app/Mage.php';
Mage::app();
$product_sku='NTWFW12FB052OR41';
$productId = Mage::getModel("catalog/product")->getIdBySku( $product_sku );
//$productId = 29763;
echo $productId;
$product = Mage::getModel('catalog/product')->load($productId);
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
$attributeCode = $attribute->getAttributeCode();
$code = 'csize';// your product attribute name here
if ($attributeCode == $code) {
$label = $attribute->getStoreLabel($product);
$value = $attribute->getFrontend()->getValue($product);
echo $attributeCode . '-' . $label . '-' . $value;
}
}
?>
Comments
Post a Comment