1

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

1

that seems to be working fine here:

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

// Get data from shop: 
$products = Mage::getResourceModel('catalog/product_collection');
$products->addAttributeToSelect('*');
$products->addAttributeToFilter('sku', $sku);
$products->setCurPage(1)->setPageSize(1);
$products->load();

$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.