Page 1 of 2

OpenCart 1.4.2 Bugs and Issues

Posted: Tue Mar 09, 2010 8:21 pm
by i2Paq
Please post here all bugs (and those you think they are bugs) found in the release 1.4.2 from the 9th of March 2010.

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Tue Mar 09, 2010 9:27 pm
by dev3fx
First of all thanks for the great work on opencart!!! I personally find it very clean coming from oscommerce.

3 days ago I installed 1.4.0 without any problem, working great.
Yesterday installed 1.4.1 and today 1.4.2 (man, thats even too much releases.. I wasn't prepared to all this as i come from osc ;D ).

Anyway, I noticed the same bug in 1.4.1 and 1.4.2, I got wrong urls like this:

http://www.domain.name\/...etc

so no images, stylesheet and products are showing in the Front End , the Back End works fine.

By the way I am on win vista 32 and apache.

I've seen somebody posted in 1.4.1 bugs that maybe a problem with the rtrim function in index.php , anybody is getting the same problem?

Thanks

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Tue Mar 09, 2010 9:40 pm
by dev3fx
[UPDATE]

I got it working following the instructions of the user Blueforce:

in index.php on line 93 , 97 , 100

Code: Select all

define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/');
replace with:

Code: Select all

define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/');
now everything works for me

Thanks to Blueforce,
Regards

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Tue Mar 09, 2010 11:06 pm
by Daniel
added this in the next version already.

Re: OpenCart 1.4.2 Bugs and Issues [templates]

Posted: Wed Mar 10, 2010 12:28 am
by OSWorX
In the backend System -> Store Manager -> select a store, the template management is wrong.

1. it shows always the last entry
2. all possible templates are marked as ' selected="selected"

This because following is wrong:

Code: Select all

<?php foreach ($templates as $template) { ?>
                <?php if ($template == $template) { ?>
                <option value="<?php echo $template; ?>" selected="selected"><?php echo $template; ?></option>
                <?php } else { ?>
                <option value="<?php echo $template; ?>"><?php echo $template; ?></option>
                <?php } ?>
                <?php } ?>
but it should be:

Code: Select all

<?php foreach ($templates as $tmpl) { ?>
                <?php if ($tmpl == $template) { ?>
                <option value="<?php echo $tmpl; ?>" selected="selected"><?php echo $tmpl; ?></option>
                <?php } else { ?>
                <option value="<?php echo $tmpl; ?>"><?php echo $tmpl; ?></option>
                <?php } ?>
                <?php } ?>
Without that fix, in the frontend the correct template is shown, also DB entry is correct, but the above routine (and wrong display) might confuse some ...

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Wed Mar 10, 2010 12:52 am
by Daniel
thanks!

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Wed Mar 10, 2010 3:33 am
by rph
I've got a work-around for templates/categories/products not loading because of http://www.mystore.com not being matched to http://mystore.com by OpenCart.

/index.php
//Store

Code: Select all

$query = $db->query("SELECT * FROM " . DB_PREFIX . "store WHERE url = '" . $db->escape(HTTP_SERVER) . "'");
to

Code: Select all

$query = $db->query("SELECT * FROM " . DB_PREFIX . "store WHERE url = '" . str_replace('www.', '', ($db->escape(HTTP_SERVER))) . "'");
/admin/model/setting/store.php
public function addStore

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . $this->db->escape($data['url']) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "',  icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "'");
to

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . str_replace('www.', '', ($this->db->escape($data['url']))) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "',  icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "'");
public function editStore

Code: Select all

$this->db->query("UPDATE " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . $this->db->escape($data['url']) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "',  icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "' WHERE store_id = '" . (int)$store_id . "'");
to

Code: Select all

$this->db->query("UPDATE " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . str_replace('www.', '', ($this->db->escape($data['url']))) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "',  icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "' WHERE store_id = '" . (int)$store_id . "'");
/admin/language/english/setting/store.php

Code: Select all

$_['entry_url']               = 'Store URL:<br /><span class="help">Include the full URL to your store. Make sure to add \'/\' at the end. Example: http://wwww.yourdomain.com/path/</span>';
to

Code: Select all

$_['entry_url']               = 'Store URL:<br /><span class="help">Include the URL to your store. Do NOT include \'www.\' and make sure to add \'/\' at the end. Example: http://yourdomain.com/path/</span>';
EDIT: It looks like this will cause problems in the odd occurrence where the store has a name like pawww.com (i.e. their address ends in www.com). It'll work for anyone else but shouldn't be included in the official release. I'll try to take another look at the problem.

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Wed Mar 10, 2010 3:36 am
by i2Paq
Just to let you know that the e-mail is working again.
I had problems getting the order-confirmation out in 1.4.1.

OpenCart 1.4.2

Posted: Wed Mar 10, 2010 9:31 am
by emax4ever
how to fix this bug?
Showing %s to %s of %s (%s Pages) in the product page..

by the way many thanks Daniel for your hard work.

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Wed Mar 10, 2010 9:43 am
by coffeecircus
Hello,

I am new to Opencart, PHP, and many things, but willing to learn. I am setting up a store of my own to sell some coffee.

After changing in index.php on line 93 , 97 , 100, as described by dev3fx, I got this error at the top of my page:
Constant HTTP_SERVER already defined in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/index.php on line 100Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/index.php on line 101Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/catalog/controller/common/header.php on line 82Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/catalog/controller/common/header.php on line 84Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/catalog/controller/common/header.php on line 87
trying to change some HTTPs to HTTP doesn't fix. I might doing something wrong. I also can't get to login tab and other, but still can view the products. Yet, the pictures are missing.

Please help.

Re: OpenCart 1.4.2 Bugs and Issues

Posted: Wed Mar 10, 2010 11:42 am
by Blueforce
Hi coffeecircus,

dev3fx wrote:
I got it working following the instructions of the user Blueforce:

in index.php on line 93 , 97 , 100

Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/');

replace with:

Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/');
Yes, I did post a "fix" for this but NOT in the way dev3fx describes in his post!!!

The ONLY thing you need to change in lines 93, 97, 100 are the part I marked in red colour:

rtrim(dirname($_SERVER['PHP_SELF']), '/')
to
rtrim(dirname($_SERVER['PHP_SELF']), '/.\\')

You should NOT paste the same line in all three places as described by dev3fx.
Just replace the part I marked red and you should be fine.

Best regards,
Leffe

Re: OpenCart 1.4.2

Posted: Wed Mar 10, 2010 1:47 pm
by OSWorX
emax4ever wrote:how to fix this bug?
Showing %s to %s of %s (%s Pages) in the product page..

by the way many thanks Daniel for your hard work.
Do not know where the bug is?
The line changd to:

Code: Select all

'Showing {start} to {end} of {total} ({pages} Pages)';
So, you must have an older (language file) version.

Re: OpenCart 1.4.2

Posted: Wed Mar 10, 2010 6:41 pm
by coffeecircus
Blueforce wrote:Hi coffeecircus,

dev3fx wrote:
I got it working following the instructions of the user Blueforce:

in index.php on line 93 , 97 , 100

Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/');

replace with:

Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/');
Yes, I did post a "fix" for this but NOT in the way dev3fx describes in his post!!!

The ONLY thing you need to change in lines 93, 97, 100 are the part I marked in red colour:

rtrim(dirname($_SERVER['PHP_SELF']), '/')
to
rtrim(dirname($_SERVER['PHP_SELF']), '/.\\')

You should NOT paste the same line in all three places as described by dev3fx.
Just replace the part I marked red and you should be fine.

Best regards,
Leffe
Thank you Leffe,

I fix this and all is well now. I will dig into the power of OpenCart more.

Very best,
:D :D

Re: OpenCart 1.4.2

Posted: Thu Mar 11, 2010 2:40 am
by YellowSnow
Hey All,
I have seen many posts on this in the Forum already but it seems I just can't get it to work. I am having an issue where I create a new Coupon, then I fill out all of the required data here are my settings

* Coupon Name: MATTS10
* Coupon Description: Coupon Description
* Code: BLAH BLAH
Type: Percentage
Discount: 30.0000
Total Amount: 30.0000
Customer Login: "No"
Free Shipping: "No"
Products: I've Selected just one product and tested and I've Selected all and tested (still same error).
Date Start: 2010-01-02
Date End: 2010-08-04
Uses Per Coupon: 1000
Uses Per Customer: 1000
Status: Enabled

The error I'm receiving is the following: "Error: Coupon is either invalid, expired or reached it's usage limit!"

Any help would be greatly appreciated.

THANK YOU!

P.S. The products I'm testing all have an inventory of 1000 or greater and all product options have an inventory of 1000 or greater...and setting "Subtract Inventory" is set to "NO"

Re: OpenCart 1.4.2

Posted: Thu Mar 11, 2010 3:51 am
by rph
Bug: Admin product filtering isn't returning the correct number of rows for pagination.

public function getTotalProducts

Code: Select all

		if (isset($data['filter_name']) && !is_null($data['filter_name'])) {
			$sql .= " AND pd.name LIKE '%" . $this->db->escape($data['filter_name']) . "%'";
		}

		if (isset($data['filter_model']) && !is_null($data['filter_model'])) {
			$sql .= " AND p.model LIKE '%" . $this->db->escape($data['filter_model']) . "%'";
		}
Fix

Code: Select all

		if (isset($data['filter_name']) && !is_null($data['filter_name'])) {
			$sql .= " AND LCASE(pd.name) LIKE '%" . $this->db->escape(strtolower($data['filter_name'])) . "%'";
		}

		if (isset($data['filter_model']) && !is_null($data['filter_model'])) {
			$sql .= " AND LCASE(p.model) LIKE '%" . $this->db->escape(strtolower($data['filter_model'])) . "%'";
		}

Re: OpenCart 1.4.2

Posted: Thu Mar 11, 2010 3:10 pm
by emax4ever
need help!
when i used the ups shipping I got this error
"PHP Unknown: Object of class DOMElement could not be converted to string in /***/***/public_html/shop/catalog/model/shipping/ups.php on line 218"

thank you!

Re: OpenCart 1.4.2

Posted: Thu Mar 11, 2010 3:45 pm
by i2Paq
YellowSnow wrote:Hey All,
I have seen many posts on this in the Forum already but it seems I just can't get it to work. I am having an issue where I create a new Coupon, then I fill out all of the required data here are my settings


THANK YOU!

P.S. The products I'm testing all have an inventory of 1000 or greater and all product options have an inventory of 1000 or greater...and setting "Subtract Inventory" is set to "NO"
Is this releated to OC 1.4.2?

Re: OpenCart 1.4.2 [unescaped & or unknown entity "&"]

Posted: Thu Mar 11, 2010 10:30 pm
by OSWorX
Another great 'side effect' of the latest URL building

Code: Select all

$this->model_tool_seo_url->rewrite(HTTP_SERVER ......
and

Code: Select all

$this->model_tool_seo_url->rewrite(HTTPS_SERVER .....
is, that as result I recieve with a plain, original 1.4.2 installation 26 messages from my frontend:
unescaped & or unknown entity "&..."
which is indeed a 'great result'.

If I go deeper, I will find something like (../catalog/controller/module/manufacturer.php):

Code: Select all

$this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $result['manufacturer_id'])
and something like this (../catalog/controller/module/category.php)

Code: Select all

$this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)
The function 'rewrite' does exactly what it should do:

Code: Select all

public function rewrite($link) {
		if ($this->config->get('config_seo_url')) {
			$url_data = parse_url(str_replace('&', '&', $link));
only when SEO-URLs are activated.
Unfortunately there are so less '&', that why the messages!

Playing around with URL building is once, knowing what to do another 'shoe'.

But great to say:
Daniel wrote:Basicly the url class was pretty stuiped. it should not have existed at all. whch frameworks have a url class like the one I used? I might as well just have used 2 functions.
Now it is 'much' better ???

IF the function rewrite is called every time when an URL is built (what it should - see below), then let the function do the work like (e.g):
instead of having (../catalog/model/tool/seo_url.php):

Code: Select all

} else {
			return $link;
		}
use this:

Code: Select all

} else {
$link = str_replace( '&', '&', $link );
			return $link;
		}
and to be save (because I am shure Mr. Chiefdeveloper will forget something) and to avoid unwanted results:

Code: Select all

} else {
$link = str_replace( '&', '&', $link ); // replace forgotten & with &
$link = str_replace( '&', '&', $link ); // and replace all & with &
			return $link;
		}
No wonder why the current package is that size.
Too much redundant and unecessary code!

Re: OpenCart 1.4.2

Posted: Fri Mar 12, 2010 12:22 pm
by RonA
I notice what might be a bug when I forget to input a model number in the edit products/ data tab..... instead of seeing the red text error message I am taken immediately to the edit products/ general tab and nothing is saved. Very frustrating.

Needs to be corrected so that we can see the error message and be given a chance to correct it. ;-)

Re: OpenCart 1.4.2

Posted: Fri Mar 12, 2010 1:51 pm
by rph
The error is displayed in the data tab. It might be worth moving to above the content div or switching focus to the data tab.