Reputation: 141
I have a fresh installation of magento 1.8
I have created a category called 'TEST'
when I want to add a Product in 'Simple Products' Then I get the following Error.
Fatal error: Class 'Varien_Data_Form_Element_Weight' not found in C:\xampp\htdocs\testmag\lib\Varien\Data\Form\Abstract.php on line 147
I realy don't Understand whats the reason if I add my product in other types like 'Grouprd Products' or 'Virtual Products' Then i get no error and every thing goes fine.
Any help appreciated.
Upvotes: 1
Views: 1767
Reputation: 21
This is a known bug of Magento for several months now
You can fix it this way:
Create or edit this file : public_html/lib/Varien/Data/Form/Element/Weight.php
Paste this code into it:
<?php
class Varien_Data_Form_Element_Weight extends Varien_Data_Form_Element_Text {
}
And That's it! Enjoy
Upvotes: 2
Reputation: 1794
I recently came upon this same issue. The only advice I could find besides this stackoverflow question advised deleting the "weight" attribute, which wasn't feasible for my situation as the weight attribute was being used and couldn't be deleted.
The solution is to change the "frontend_input" field for the "weight" attribute from "weight" to "text":
UPDATE eav_attribute SET frontend_input="text" WHERE frontend_input="weight";
Upvotes: 1
Reputation: 1590
Weight is a required attribute so when you create the simple product you must ensure there is a value for the weight.
In the browser the form validation should ensure that the input field is not blank but I think for your install something is interfering with the forms 'required fields' validation.
Other required fields for simple products are name, SKU, short description long description, status, visibility, price, tax class and quantity. And I recommend you set a Website too.
Upvotes: 0