0

I've created this page on frontend.

enter image description here

I want input field fills with values product based on product id.

I have blank controller. How can I update product attribute in this form trough my controller and my .phtml file.

2
  • provide your block controller and template file – Gopal Patel Feb 28 '17 at 9:05
  • still blank for all @GopalPatel – syahidah humairoh Feb 28 '17 at 9:09
0

You can try this:

In your controller you can load that product using

$product=Mage::getModel('catalog/product')->load($id);

and then pass that product object to your phtml file using register i.e

Mage::register('product', $product->getData());

then in phtml get that product object using

$product_data = Mage::registry('product');

then you will get the product data in form of array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.