I have suggestions how to reproduce error discussed above. It happens when we add few options with few option values to product. Next try to edit options/option values and/or edit "Sort order" parameter in options and/or option values.lucass wrote:Hello
I am using Opencart 1.4.9.1 patched to 1.4.9.2.
In my store I have only one product at the moment. I added few options to this product (options were edited and saved many times), but suddenly system stopped working properly. When I go to product edit page, and click "Save" button (even without making any changes) I receive following error:
When I add new product, and click "Save", it works properly.Code: Select all
2010-12-17 8:56:52 - PHP Notice: Undefined index: sort_order in /home/public_html/admin/model/catalog/product.php on line 136 2010-12-17 8:56:52 - PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/admin/index.php:72) in /home/public_html/system/engine/controller.php on line 27
I am looking forward for Your response.
Best regards, Łukasz
When I added new product, and I added option to this product, saved changes, edited product -> added option value, saved changes, edited product -> added next option value, saved changes etc etc (and this all without editing once added options nor "Sort order parameter") then error does not occur.
Error message points to file product.php to line 136 which is:
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value SET product_option_id = '" . (int)$product_option_id . "', product_id = '" . (int)$product_id . "', quantity = '" . (int)$product_option_value['quantity'] . "', subtract = '" . (int)$product_option_value['subtract'] . "', price = '" . (float)$product_option_value['price'] . "', prefix = '" . $this->db->escape($product_option_value['prefix']) . "', sort_order = '" . (int)$product_option_value['sort_order'] . "'");
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value SET product_option_id = '" . (int)$product_option_id . "', product_id = '" . (int)$product_id . "', quantity = '" . (int)$product_option_value['quantity'] . "', subtract = '" . (int)$product_option_value['subtract'] . "', price = '" . (float)$product_option_value['price'] . "', prefix = '" . $this->db->escape($product_option_value['prefix']) . "'");
Next I restored 'sort_order' parameter to line 136 and I printed $product_option_value variable with function print_r() added to code:
Code: Select all
if (isset($product_option['product_option_value'])) {
foreach ($product_option['product_option_value'] as $product_option_value) {
print_r($product_option_value);
echo "<br>";
$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value SET product_option_id = '" . (int)$product_option_id . "', product_id = '" . (int)$product_id . "', quantity = '" . (int)$product_option_value['quantity'] . "', subtract = '" . (int)$product_option_value['subtract'] . "', price = '" . (float)$product_option_value['price'] . "', prefix = '" . $this->db->escape($product_option_value['prefix']) . "', sort_order = '" . (int)$product_option_value['sort_order'] . "'");
$product_option_value_id = $this->db->getLastId();
foreach ($product_option_value['language'] as $language_id => $language) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value_description SET product_option_value_id = '" . (int)$product_option_value_id . "', language_id = '" . (int)$language_id . "', product_id = '" . (int)$product_id . "', name = '" . $this->db->escape($language['name']) . "'");
}
}
}
What I receive now is this:
Code: Select all
Array ( [language] => Array ( [2] => Array ( [name] => XS ) [1] => Array ( [name] => XS ) ) [quantity] => 0 [subtract] => 0 [price] => 0.0000 [prefix] => + [sort_order] => 0 )
Array ( [language] => Array ( [2] => Array ( [name] => S ) [1] => Array ( [name] => S ) ) [quantity] => 0 [subtract] => 0 [price] => 0.0000 [prefix] => + [sort_order] => 0 )
(...)
many parameters
(...)
Array ( [language] => Array ( [2] => Array ( [name] => Brak ) [1] => Array ( [name] => None ) ) [quantity] => 0 [subtract] => 0 [price] => 0.0000 [prefix] => + [sort_order] => 0 )
Array ( [language] => Array ( [2] => Array ( [name] => Mały: rozmiar do 10 cm x 8 cm ) [1] => Array ( [name] => Mały: rozmiar do 10 cm x 8 cm ) ) [quantity] => 0 [subtract] => 0 [price] => 1.0000 [prefix] => + [sort_order] => 0 )
Array ( [language] => Array ( [2] => Array ( [name] => Duży: rozmiar do 30 cm x 22 cm ) [1] => Array ( [name] => Duży: rozmiar do 30 cm x 22 cm ) ) [quantity] => 0 [subtract] => 0 [price] => 3.0000 [prefix] => + )
Notice: Undefined index: sort_order in /srv/home/lv121791/public_html/admin/model/catalog/product.php on line 138Warning: Cannot modify header information - headers already sent by (output started at /srv/home/lv121791/public_html/admin/model/catalog/product.php:136) in /srv/home/lv121791/public_html/system/engine/controller.php on line 27
[price] => 3.0000 [prefix] => + here_should_be_param )
Unfortunately this bug makes OpenCart platform almost useless for me. Please take a look at this bug.
Best regards
Łukasz
I am working on v1.4.9.3 OC
http://192.168.0.122/www.opencart.com/i ... ount/login
to
http://192.168.0.122/www.opencart.com/login
Is it possible ?
Any idea ?
great full for any help
thanx
http://192.168.0.122/www.opencart.com/i ... ount/login
to
http://192.168.0.122/www.opencart.com/login
Is it possible ?
Any idea ?
great full for any help
thanx
Thank you!!! I was worried I screwed something up, but this fixed my problem.
Qphoria wrote:Ah you are right... there is a bug
1. EDIT: catalog/view/theme/default/template/checkout/address.tpl
2. FIND:3. REPLACE WITH:Code: Select all
$('#postcode').load('index.php?route=checkout/create/postcode&country_id=<?php echo $country_id; ?>');
Code: Select all
$('#postcode').load('index.php?route=checkout/address/postcode&country_id=<?php echo $country_id; ?>');
Who is online
Users browsing this forum: No registered users and 33 guests