I want to get value from the database (which is created custom module) in dropdown which is custom product attribute.


that seems to be working fine here:

require "app/Mage.php";
$sku = "178934";

// Get data from shop: 
$products = Mage::getResourceModel('catalog/product_collection');
$products->addAttributeToFilter('sku', $sku);

$product        = $products->getFirstItem();
$attribute      = $product->getAttributes();
$my_attribute   = $attribute['my_attribute']->getFrontend()->getValue($product);

echo "\n sku: " . $sku . ' - my_attribute: ' . $my_attribute;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.