I am currently making a module so that users see on the checkout page something like: “People who purchased product X also purchased Y, Z and T”.
I made a cronjob to calculate which are the related products for each product, and I added an attribute to products in the install script.
I decided (for simplicity) – to store the most related 5 products, so I want to store something like: 123-3-5543-1290-9911. But I don’t want the administrator to see this anywhere, and I tried the following:
$setup->addAttribute('catalog_product', $attrCode, array(
// more stuff
'type' => 'hidden',
'input' => 'text',
'visible' => 0,
// more stuff
));
I looked here: http://blog.chapagain.com.np/magento-adding-attribute-from-mysql-setup-file/ and I found some interesting stuff, but not how to completely hide this field.
The alternative would be to create my own table, but this seems to be a slightly more elegant solution.
What do you think? Is it better to create my own table, or to add an attribute and hide it?
Thank you
Setting the ‘is_visible’ property to 0 for catalog attributes will hide them from the admin forms in the backend, as can be seen from this code (Mage_Adminhtml_Block_Widget_Form::_setFieldset()):
So execute