Guest user enters details and click on "submit" to register. It's working fine for below code :
<form action="<?php echo $this->getUrl('example/amasty/create1'........>
Here we are using the following controller action : getUrl('example/amasty/create1
Instead of this, if we change the controller as below and change the form, then the registration is not working anymore.
<form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect1'....>
Controllers
public function createSimpleProductAndRedirect1Action()
{
$originalProductId = $this->getRequest()->getParam("id");
$newImagePath = $this->getRequest()->getParam("image");
$originalProduct = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($originalProductId);
if ($product = $this->_create1(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, true, $originalProduct, $newImagePath)) {
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode("Your Image Saved"));
}
}
protected function _create1Action()
Here we replaced controller action to example/amasty/createSimpleProductAndRedirect1
update
:
Fatal error: Call to undefined method Amasty_Example_AmastyController::_create1()` in
if ($product = $this->_create1(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, true, $originalProduct, $newImagePath))