Question

I can add the custom option file so my clients add pictures or files to their products. To here all perfect.

When I try to retrieve the files this becomes an issue and I get 500 error like this:

[Mon Feb 06 10:52:33 2012] [error] [client x.x.x.x] PHP Fatal error:  Undefined class constant ‘OPTION_PREFIX’ in /var/www/vhosts/domain.com/httpdocs/app/code/core/Mage/Sales/controllers/DownloadController.php on line 160, referer: https://www.domain.com/index.php/admin/sales_order/view/order_id/15/key/3f88d86de2532ab233077d978054dfe2/

Has anybody had anything like this before?

Was it helpful?

Solution

The constant OPTION_PREFIX is declared on the Mage_Catalog_Model_Product_Type_Abstract class in CE 1.7 and newer. Based on the results of searching with ack OPTION_PREFIX on the CLI, the term does not exist nor is referenced in older versions of Magento.

Would I be correct to surmise that your installation used to be running an older version of Magento and has been upgraded to CE 1.7?

My suggestion would be to verify that the constant is defined in the class declaration found in app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php. Assuming it is, I would go looking for a copy of that class that is overriding the core file, like say, a file in the local code pool which overrides the core class declaration with a copy of the class from an older version of Magento.

OTHER TIPS

From your comments and above post by other members I would say that

  1. You have upgraded Magento version or some module you have added is compatible with CE 1.7 so first you need to make out whether your Magento version was upgraded.

  2. Second thing you will have to check is that your Mage_Catalog_Model_Product_Type_Abstract is this copy also in local/mage/ folder. If case 2 exist then copy in ;local/mage folder will be considered by Magento code and this being a copy from a precious version does not have the stated constant ‘OPTION_PREFIX’.

  3. Also in case compiler was set to on check for a copy of this class code where all class files are placed /includes/src.

Make sure that Mage_Catalog_Model_Product_Type_Abstract class code from 1.7 is there.

Also in case you have a Mage folder in local folder(some developers just overwrite rather then extend) then better would be to create a customer module and extend Magento core class modules.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top