I'm helping a friend with his Magento website and I have very little PHP and Magento experience. I haven't had to do too much when it comes to the actual code, but there's one change we want to make that actually involves changing code.
The code contains something like this:
$model = Mage::getModel('catalog/product');
$_product = $model->load($entity_id);
$bedroom = $_product->getTotalrooms();
The above works fine, and I'd like to add the following:
enter code here`$bathroom = $_product->getTotalbathrooms();
I've added totalbathrooms to the Attributes page and tried to make it identical to totalrooms, the only difference I see right now is that in the System column, for totalrooms it says Yes but for totalbathrooms it says No. I've updated the html in the forms to add new places and updated the html of the product page, but currently it isn't displaying the no. of bathrooms. You can see an example product here: http://book.bnbtlv.com/index.php/bathroom-test.html. If you scroll to the middle of the page, you'll notice that there's no value for bathrooms. Bedrooms is 4 however.
One question I have is whether getTotalrooms was defined anywhere or if it was created automatically somehow? If it was defined manually, then where would is that so I can also define getTotalbathrooms there? Also, where would I find the place where setTotalrooms is called? I'm guessing that setTotalbathrooms is never called for my products at the moment.
Lastly, when I go to the Manage Products page on the admin page and click on a product and then click Product Information, I see the no of rooms, but I don't see the number of bathrooms. How can I get the number of bathrooms to display on this page and be editable by the admin?
Thanks