Community Forums

Post any OpenCart 1.4.9.2 Bugs here!

Bug reports here

Re: Post any OpenCart 1.4.9.2 Bugs here!

Postby Qphoria » Sat Dec 18, 2010 7:57 pm

added it at the create point, not the order point.. but yea you can trim more.. in 1.4.9.3 I trim the streetnames and city too
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: Post any OpenCart 1.4.9.2 Bugs here!

Postby Johnathan » Sat Dec 18, 2010 8:27 pm

There's no problem with doing that, but extra spaces in the company/address section don't seem to screw up the invoice display, so it doesn't really matter. For cleanliness sake, it probably should be done, however.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2845
Joined: Thu Dec 17, 2009 7:08 pm

Re: Error when editing product: Undefined index: sort_order

Postby lucass » Mon Dec 27, 2010 9:24 pm

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:

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


When I add new product, and click "Save", it works properly.

I am looking forward for Your response.

Best regards, Łukasz

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.

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'] . "'");
I removed last parameter "sort_order" so the line content was:
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']) . "'");
After this change, system does not crash (never) when editing product options. But product options order visible from client view is 'random', probably because of sql query which insert and get product data from table. What is the point is knowledge, that parameter 'sort_order' is probably the source of the problem.

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
As we can notice in last array there is no sort_order parameter exactly! It ends with:
[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
lucass
 
Posts: 6
Joined: Fri Dec 17, 2010 9:05 am

Re: Post any OpenCart 1.4.9.2 Bugs here!

Postby Qphoria » Tue Dec 28, 2010 7:13 am

I've not seen this and can't reproduce it. Is it only that 1 product? What if you try to recreate that product new again, then add the options, then edit and save.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: Post any OpenCart 1.4.9.2 Bugs here!

Postby lucass » Tue Dec 28, 2010 12:15 pm

I will give You admin password via pm and You will take a look at it ok? (I recreated product many times)
lucass
 
Posts: 6
Joined: Fri Dec 17, 2010 9:05 am

unable to change redirtection to seo friendly url

Postby anilrmg » Fri Feb 25, 2011 10:14 am

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
anilrmg
 
Posts: 3
Joined: Wed Feb 23, 2011 7:07 pm

Re: Post any OpenCart 1.4.9.2 Bugs here!

Postby broadsighted » Thu Mar 31, 2011 6:26 pm

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:
Code: Select all
$('#postcode').load('index.php?route=checkout/create/postcode&country_id=<?php echo $country_id; ?>');


3. REPLACE WITH:
Code: Select all
$('#postcode').load('index.php?route=checkout/address/postcode&country_id=<?php echo $country_id; ?>');
Image
broadsighted
 
Posts: 10
Joined: Mon Nov 29, 2010 8:27 pm
Location: Denver, CO

Previous

Return to Bug Reports

Who is online

Users browsing this forum: planetlink, tomatito and 14 guests

Hosted by Arvixe Web Hosting