Skip to content

Instantly share code, notes, and snippets.

@reidblomquist
Created June 10, 2014 20:05
Show Gist options
  • Save reidblomquist/8daada8044e8adb9491e to your computer and use it in GitHub Desktop.
Save reidblomquist/8daada8044e8adb9491e to your computer and use it in GitHub Desktop.
Pull a Magento attribute's available options (in this case 'style_tag')
<?php
/* Ryaan is totes a newb */
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once('../magento/app/Mage.php');
Mage::app();
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'style_tag');
if ($attribute->usesSource()) {
$options = $attribute->getSource()->getAllOptions(false);
print_r($options);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment