1
votes

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.

3
Have you assigned Weight attribute to use simple product also?Dushyant Joshi
did u acutally upgraded magento or downloaded from the official website? because on upgrading the "lib" folder doesnt get upgraded due to some unknown error. So how u downloaded it?Pavan Kumar
I have downloaded it from Magento official websiteHossein
The 'Weight' attribute is by default included in 'Default' Attribute setHossein
What does SELECT * FROM eav_attribute WHERE frontend_input="weight" returns ?Dushyant Joshi

3 Answers

2
votes

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

1
votes

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";
0
votes

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.