404 on dispatch in 2.1.4

im seeing this in logs when i change a color option for an item in the details page of that item…



option has an image as well on it



[26/May/2011:10:42:54 -0400] “POST /index.php?dispatch=products.options&changed_option[6767]=2724 HTTP/1.1” [COLOR=“Red”]404[/COLOR] 64



Any idea ?



this is why my main images doesnt change depending on the option selected…



i would like a hand on it



also in /controllers/customer/products.php

there is no $mode==“options”





this is called from exception.js



url = fn_url(‘products.options?changed_option[’ + id + ‘]=’ + option_id);

for (i in params) {

url += ‘&’ + params[i][‘name’] + ‘=’ + escape(params[i][‘value’]);

}

jQuery.ajaxRequest(url, {

result_ids: update_ids.join(‘,’).toString(),

caching: true,

force_exec: true,

pre_processing: fn_pre_process_form_files,

callback: fn_post_process_form_files,

method: ‘post’

});

tried to find a product on the demo site that had image swapping when options changed but couldnt , and darn is it slow :wink:

Hello Vanderex,



The “options” mode is located in the “controllers/common/product_post.php” file of your CS-Cart installation. Please check this file in the mentioned directory and check permissions for it. The permissions should be set to 755.





Anastasiya Kozlova

CS-Cart Support team

[quote name=‘CS-Cart Support team’]Hello Vanderex,



The “options” mode is located in the “controllers/common/product_post.php” file of your CS-Cart installation. Please check this file in the mentioned directory and check permissions for it. The permissions should be set to 755.





Anastasiya Kozlova

CS-Cart Support team[/QUOTE]



Hmm well



from what i see in my js debugger



/index.php?dispatch=products.options&changed_option[6767]=2724

is called



AND in that product[COLOR=“Red”]s[/COLOR].post.php



You have



if (empty($_REQUEST[‘product_data’]) && empty($_REQUEST[‘cart_products’])) {

return array(CONTROLLER_STATUS_NO_PAGE);

}



as first lines…



AND print_r($_REQUEST);

Array

(

[dispatch] => products.options

[changed_option] => Array

(

[6767] => 2724

)



)



so no wonder it returns…



what is supposed to be passed then from the exceptions.js in function fn_change_options(obj_id, id, option_id)



url = fn_url(‘products.options?changed_option[’ + id + ‘]=’ + option_id);



for (i in params) {

url += ‘&’ + params[i][‘name’] + ‘=’ + escape(params[i][‘value’]);

}





seems im missing params maybe ?



params are hmm



params.push({name: elm.name, value: elm.value});



so you are pusshing from a jquery…where parents = parents = $(‘.cm-reload-’ + obj_id);



so in my products page i have




so your looking into that div for select etc form objects and passing as value ?
so that means i need to have my
$product_data pushed as a hidden field maybe hmmm getting somewhere

i just need to know what ID is the javascript parsing cause my params[] is always empty

[quote name=‘vanderex’]Hmm well



from what i see in my js debugger



/index.php?dispatch=products.options&changed_option[6767]=2724

is called



AND in that product[COLOR=“Red”]s[/COLOR].post.php



You have



if (empty($_REQUEST[‘product_data’]) && empty($_REQUEST[‘cart_products’])) {

return array(CONTROLLER_STATUS_NO_PAGE);

}



as first lines…



AND print_r($_REQUEST);

Array

(

[dispatch] => products.options

[changed_option] => Array

(

[6767] => 2724

)



)



so no wonder it returns…



what is supposed to be passed then from the exceptions.js in function fn_change_options(obj_id, id, option_id)



url = fn_url(‘products.options?changed_option[’ + id + ‘]=’ + option_id);



for (i in params) {

url += ‘&’ + params[i][‘name’] + ‘=’ + escape(params[i][‘value’]);

}





seems im missing params maybe ?



params are hmm



params.push({name: elm.name, value: elm.value});



so you are pusshing from a jquery…where parents = parents = $(‘.cm-reload-’ + obj_id);



so in my products page i have




so your looking into that div for select etc form objects and passing as value ?
so that means i need to have my
$product_data pushed as a hidden field maybe hmmm getting somewhere

i just need to know what ID is the javascript parsing cause my params[] is always empty[/QUOTE]

Hello Vanderex,

First of all the object needs to have the "class = cm-reload-[OBJECT_ID]" (where [OBJECT_ID] is the object id) parameter.

Also the "product_images_1553_update" id is used for the product image block.

I hope it will help you.

Thank you.

---
Mikhail Ponomarev
CS-Cart Support team

I was also getting 404 on index.php?dispatch=products.options when I was changing product options. I realised it was the SEO mod - it was looking in the language folder, ie. for example.com/en/index.php, which obviously did not exist.



To fix, I edited line 2317 of js/core.js, in function fn_url():


url = index_script + '?dispatch=' + url.replace('?', '&');

became

url = '/'+index_script + '?dispatch=' + url.replace('?', '&');



and now I can change product options without the “something goes wrong” error!

Hope this helps :slight_smile: