If Registered user click on button, we are creating Product Programatically. but when guest user click on button , its creating product with empty product name
button :
<button onclick="return setproductlogin(\'<?php echo
Mage::registry("current_product")->getId()?>\',
event);setrequestlogin();"
id="submit-editorApply-{{rand}}" >SAVE DESIGN</button>
controllers
protected function _createProduct($type, $doSave=true, $originalProduct, $newImagePath="")
{
$product = Mage::getModel('catalog/product');
$product->setName($originalProduct->getName());
$product->setDescription('what ever you need here');
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
$product->setCreatedByCustomerId($customerId);
if ($doSave)
$product->save();
return $product;
}
I tried below code, but didt worked for me
if($_category instanceof Mage_Catalog_Model_Category && $_category->getId()):
$product->setName($originalProduct->getName());
endif;
full controllers : https://pastebin.com/Gn6iMwug
Edit
when Registered user upload image or text and click on "Save Design" button in link , than Product creating with "Product Name".
When Guest user upload image or text and click on "Save Design" button in link , it will ask to login, once Guest login/register , Product is creating with empty Product name
After clicking save design, it redirect to another page :