« first day (1 day earlier)    last day (14 days later) » 

4:07 AM
@Rathinam, can you check logs for any errors?
 
 
1 hour later…
5:15 AM
hi, please check once :
0
Q: Redirect to url of Programatically created Product

vickey colorsonce we click on button in product view page, we are creating New Product Programatically & displaying pop up with message : "new product created" Instead of displaying pop up , i need to redirect to Newly created Product's url. public function createSimpleProductAndRedirectAction() { ...

 
can you show _getRefererUrl function @vickeycolors
 
sure buddy.....
please check : pastebin.com/7v2GS58v
 
where are you being redirect currently? to My account page?
 
once we click on "save design", we are showing pop up , but we neeed to redirect to newly created produict url
here is alll 3 functions..... : pastebin.com/3T4y1BJF
right now after click on "save design: below pop up will come , but i need to redirect to newly created product url instaead of displaying pop up :
link and : kidsdial11@gmail.com, pw : kidsdial11
 
can you please show your phtml file code
 
5:27 AM
sure
login button code : pastebin.com/kbmc9h9r
sory, please be here.... my boss called me, i will be here in 10 min.......
 
i am here bro
please let me know if you need anything......
 
5:47 AM
I need code which shows you message "Your image saved"
javascript or phtml file
 
okay, let me check once.......
please check script.js : pastebin.com/ErUZkFvy
search for "Your Image Saved"
 
6:06 AM
no its not here
 
okay , sorry for that, , in entire site, we are using text " Your Image saved" in only these 2 files...... controller.php file i gave you , than this one..... once registered user click on "save design" , now using the controller code only we are displaying pop up : "your image saved"...... can we replace that code and put code for redirecting to new product url...... ?
 
Can you check for alert ?
 
okay, you want to know what html or javascript code is reason fro alert box right, okay i will try to get that code......
actually you only added that alert code :) i will search now.....
 
6:31 AM
i think this is the one : pastebin.com/UB29DYYp
here please search for text : alert(response.responseText);
yes, when i hide the code : alert(response.responseText); , its not displaying alertbox.....
 
okay great
 
thanks :)
 
Try updating with below code
your php
Your javascript
_ajaxCreateImg: function(dataUrl, startNumber)
{
var firstRequest = 0;
var lastRequest = 0;
var dataUrlPart = dataUrl.substr(startNumber, this.postSize);
this.preventUpdate();

if(startNumber == 0){
firstRequest = 1;
}
if(dataUrl.length < startNumber + this.postSize){
lastRequest = 1;
}

new Ajax.Request(this.createImgUrl, {
method: 'post',
asynchronous: true,
parameters: {
productId: this.tools.config.product_id,
reservedImgId: this.reservedImgId,
pngData : dataUrlPart,
lastRequest : lastRequest,
 
sure
nice, now its redirecting to url : "http://sbdev2.kidsdial.com:81/undefined"
now need to redirect to created product url.......
 
okay
public function createSimpleProductAndRedirectAction()
{
$this->loadLayout();
$originalProductId = $this->getRequest()->getParam("id");
$login = $this->getRequest()->getPost('login');
$newImagePath = $this->getRequest()->getParam("image");
if (!empty($login)) {
} else {

Mage::getSingleton('core/session')->unsProductImage();
Mage::getSingleton('core/session')->setProductImage($newImagePath);
}


$originalProduct = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($originalProductId);
update your php code too
 
6:45 AM
sure
i got error buddy :
<b>Fatal error</b>: Call to undefined method Amasty_Example_AmastyController::getProductUrl() in
$result['redirect'] = $product->getProductUrl();
i checked that error using "network tab
 
full controller file : pastebin.com/EQbJAkaL
related actions : createSimpleProductAndRedirectAction , _createProduct , saveProduct
i am using this code : $product->setUrlKey($rand); to create url for newly created Product and i used this in "saveProduct" function, but we defined the url code before only , means in createSimpleProductAndRedirectAction ..... this is my guess......
 
 
4 hours later…
11:12 AM
hi
still i struggle with category id, how can i get category name export through dataflow profiles
 
did you check your logs?
Is there any error description in there?
@Rathinam
 
11:42 AM
hi, now there is no fatal error, now onclick button its redirecting to url , but url is : http://sbdev2.kidsdial.com:81/undefined

you can help to @Rathinam , when you get free time than please check my issue.....
 
can you provide current codes for both files? @vickeycolors
 
sorry for late reply : controller .php full file : pastebin.com/k6LdRi76
this controller contain only 3 required functions : pastebin.com/fhDyX7Ky
 
11:59 AM
Try with replacing function
public function createSimpleProductAndRedirectAction()
{
$this->loadLayout();
$originalProductId = $this->getRequest()->getParam("id");
$login = $this->getRequest()->getPost('login');
$newImagePath = $this->getRequest()->getParam("image");
if (!empty($login))
{
}
else
{

Mage::getSingleton('core/session')->unsProductImage();
Mage::getSingleton('core/session')->setProductImage($newImagePath);
}


$originalProduct = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($originalProductId);
 
sure
okay , now its not redirecting to any url......
ah buddy , fatal errror
$result['redirect'] = $product->getProductUrl();
 
again?
 
yes buddy, $result['redirect'] = $product->getProductUrl(); line is reason for fatal error
if i remove this line from function createSimpleProductAndRedirectAction() , than no fatal erorr
i included that line code in other 2 functions, there no fatal error
we are not declaring product url right ? may be thats the reason, i am not sure.....
i included this code in saveProduct function : $product->setUrlKey($rand);
 
update below function
protected function _createProduct($type, $doSave = true, $originalProduct, $newImagePath = "")
{

Mage::register('isSecureArea', true);
$session = Mage::getSingleton('customer/session');

$result = array(
'success' => false
);
$res = '';
$login = "";
$productId = "";
if ($this->getRequest()->isPost()) {
$login = $this->getRequest()->getPost('login');
$productId = $this->getRequest()->getPost('product_id');
}

try {
if (isset($login) && (is_array($login) && !empty($login)) || ($login != "")) {
$designId = Mage::getSingleton('core/session')->getData('mydesign_id');
 
sure
same result, redirect to http: //sbdev2.kidsdial.com:81/undefined
 
12:13 PM
:(
 
dear, thats okay, this is nothing for you, you climbed mount everest only before, this and all nothing for you ......
 

« first day (1 day earlier)    last day (14 days later) »