Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento error when I try to add special price from admin

The error I get is: Invalid backend model specified: catalog/product_attribute_backend_startdate_specialprice

This is a local copy of magento but I would not want to have to recreate the entire thing on the live site..any ideas on what I can do to fix this?

like image 304
Cisum Inas Avatar asked Nov 29 '22 00:11

Cisum Inas


1 Answers

The above solution didn't work in my case as I didn't develop any module therefore couldn't find any file named "specialprice" in the above mentioned path.

I have installed a module and it changed the "specialprice" backend path in the database to catalog/product_attribute_backend_startdate_specialprice

Here is the solution if you stuck in the same problem like me:

Run the DB query to check the value of specialprice attribute i.e.

SELECT * FROM `<database-name>`.`eav_attribute`
WHERE (
`attribute_id` LIKE '%special_price%'
OR `entity_type_id` LIKE '%special_price%'
OR `attribute_code` LIKE '%special_special_price%'
OR `attribute_model` LIKE '%special_price%'
OR `backend_model` LIKE '%special_price%'
OR `backend_type` LIKE '%special_price%'
OR `backend_table` LIKE '%special_price%'
OR `frontend_model` LIKE '%special_price%'
OR `frontend_input` LIKE '%special_price%'
OR `frontend_label` LIKE '%special_price%'
OR `frontend_class` LIKE '%special_price%'
OR `source_model` LIKE '%special_price%'
OR `is_required` LIKE '%special_price%'
OR `is_user_defined` LIKE '%special_price%'
OR `default_value` LIKE '%special_price%'
OR `is_unique` LIKE '%special_price%'
OR `note` LIKE '%special_price%'
);

NOTE: Replace <database-name> with your magento DB.

You will find three rows in the database. Navigate to the column named as "Backend_model" and then you will see one of the entry written as

catalog/product_attribute_backend_startdate_specialprice

So, change the above entry to

catalog/product_attribute_backend_startdate

Save the database and then refresh the page on the magento frontend/backend (create and save a new product).

I hope everything is working fine. Good Luck!

Cheers, Naveed.

PS: Thanks to all who helps others to learn.

like image 177
Naveed Anwar Avatar answered Dec 06 '22 07:12

Naveed Anwar