Sometimes you need to make a script usig the prestashop framework. To do that, just add these 2 lines at the top of your script
include(dirname(__FILE__).'/../../config/config.inc.php'); include_once(_PS_ROOT_DIR_.'/init.php');
Sometimes you need to make a script usig the prestashop framework. To do that, just add these 2 lines at the top of your script
include(dirname(__FILE__).'/../../config/config.inc.php'); include_once(_PS_ROOT_DIR_.'/init.php');
You want to see all values of an attribute, for debug purpose or something else ?
$attr_model = Mage::getModel('catalog/resource_eav_attribute'); $attr_model->load(959); // you can find the attribute_id on the eav_attribute table $options = $attr_model->getSource()->getAllOptions(false); foreach($options as $value) { print_r($value); echo "<br />"; }
You will get something like that :
Array ( [value] => 154 [label] => 2008 ) Array ( [value] => 155 [label] => 2009 ) Array ( [value] => 156 [label] => 2010 )