we have below code and its creating new Product once registered user click on button "create"
_getControlPanelHtml: function()
{
if (this.config.editorEnabled) {
return '<div id="aitcg-control-panel">' +
'<button onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();" id="submit-editorApply-{{rand}}" >Create</button>' +
'</div>';
}
return '';
},
we are trying to apply if else conditions and adding below code for creating new product after guest click on "create" button and login to site. but it showing blank page
<script>
<?php if($customerId){?>
_getControlPanelHtml: function()
{
if (this.config.editorEnabled) {
return '<div id="aitcg-control-panel">' +
'<button onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();" id="submit-editorApply-{{rand}}" >Create</button>' +
'</div>';
}
return '';
},
<?php }else{?>
_getControlPanelHtml: function()
{
if (this.config.editorEnabled) {
return '<div id="aitcg-control-panel">' +
'<button onclick=" setproductlogin('<?php echo $_product->getEntityId()?>');setrequestlogin();" id="submit-editorApply-{{rand}}" >Create</button>' +
'</div>';
}
return '';
},
<?php }?>
</script>