Page 28 of 30

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Thu Feb 23, 2012 7:53 pm
by ADD Creative
Hi Daniel,

There is still a fix needed to latest version in the svn of catalog\controller\payment\sagepay.php.

The 3 utf8_strlen in the simpleXor function need to be changed to just strlen. As $string will contain characters greater then 127 utf8_strlen will return the wrong length.

find:

Code: Select all

		for ($i = 0; $i < utf8_strlen($password); $i++) {
			$data[$i] = ord(substr($password, $i, 1));
		}

		$output = '';

		for ($i = 0; $i < utf8_strlen($string); $i++) {
    		$output .= chr(ord(substr($string, $i, 1)) ^ ($data[$i % utf8_strlen($password)]));
change to:

Code: Select all

		for ($i = 0; $i < strlen($password); $i++) {
			$data[$i] = ord(substr($password, $i, 1));
		}

		$output = '';

		for ($i = 0; $i < strlen($string); $i++) {
    		$output .= chr(ord(substr($string, $i, 1)) ^ ($data[$i % strlen($password)]));
And to be on the safe side in case Sage Pay returns any characters greater than 127.

find:

Code: Select all

$output = $this->simpleXor($string, $password);
change to:

Code: Select all

$output = utf8_encode($this->simpleXor($string, $password));
Thanks

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Thu Feb 23, 2012 10:16 pm
by Daniel
tommieking wrote:I'm getting this from a fresh install of 1513

Code: Select all

Notice: Error: Could not load language english! in /home/user/public_html/scriptstore/system/library/language.php on line 26
I can log into the admin but the homepage is coming up with that message

reupload.

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Thu Feb 23, 2012 10:19 pm
by Daniel
ADD Creative wrote:Hi Daniel,

There is still a fix needed to latest version in the svn of catalog\controller\payment\sagepay.php.

The 3 utf8_strlen in the simpleXor function need to be changed to just strlen. As $string will contain characters greater then 127 utf8_strlen will return the wrong length.

find:

Code: Select all

		for ($i = 0; $i < utf8_strlen($password); $i++) {
			$data[$i] = ord(substr($password, $i, 1));
		}

		$output = '';

		for ($i = 0; $i < utf8_strlen($string); $i++) {
    		$output .= chr(ord(substr($string, $i, 1)) ^ ($data[$i % utf8_strlen($password)]));
change to:

Code: Select all

		for ($i = 0; $i < strlen($password); $i++) {
			$data[$i] = ord(substr($password, $i, 1));
		}

		$output = '';

		for ($i = 0; $i < strlen($string); $i++) {
    		$output .= chr(ord(substr($string, $i, 1)) ^ ($data[$i % strlen($password)]));
And to be on the safe side in case Sage Pay returns any characters greater than 127.

find:

Code: Select all

$output = $this->simpleXor($string, $password);
change to:

Code: Select all

$output = utf8_encode($this->simpleXor($string, $password));
Thanks

ok done.

minor error in Admin Handling Fee

Posted: Fri Feb 24, 2012 11:59 am
by lv2dr65
There is a minor error in the Admin/Extensions/Order Totals/Handling Fee

OC 1.5.1.3.1

the error:
Notice: Undefined variable: entry_tax in /home/xingbot/public_html/admin/view/template/total/handling.tpl on line 28

Also found one on Low Order Fee

Notice: Undefined variable: entry_tax in /home/hobby/public_html/admin/view/template/total/low_order_fee.tpl on line 28

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sun Feb 26, 2012 12:09 am
by Daniel
its already been fixed in the svn.

everything's pretty much done now. i think i can get a release next week.

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sun Feb 26, 2012 2:46 am
by Johnathan
Daniel wrote:its already been fixed in the svn.

everything's pretty much done now. i think i can get a release next week.
Great!

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sun Feb 26, 2012 8:58 pm
by Renato Frota
Daniel,

I'm a moderator in OpenCart Brasil community (http://www.opencartbrasil.com.br/forum).

An expressive number of users are opening support threads regarding the $special price overriding volume prices.

I'd research that most of them doesn't even use groups. It's just because here, in brazil, it's well common to have all (yes, I meant ALL) products advertised as special!! It's just the common pratice here (not only in webstores, but in the phisical ones as well). See an example (most than half are specials in this store): http://www.sosparaiba.com.br. And, to not restrict to an OpenCart, new store, see also these stores (in the list of top webstores in Brazil): http://www.submarino.com.br, http://www.americanas.com.br, http://www.extra.com.br

In OpenCart, if a product price is $120 in special for $100, a volume discount for $90 doesn't apply in ANY case, no matter if it's for a wholesale group (or any other) or for default/guest customers.

The fix is SO SIMPLE, in system/library/cart.php,
find

Code: Select all

if ($product_special_query->num_rows) {
replace

Code: Select all

if ($product_special_query->num_rows && ($product_special_query->row['price'] < $price)) {
Then, I reforce, PLEASE, change this behaviour, or we will continue having new threads about this every week (or day.. we are breaking our online members records frequently!).

Thanks.

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sun Feb 26, 2012 9:58 pm
by solojuve1897
*Updated*

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Wed Feb 29, 2012 3:19 pm
by Maansy
Daniel wrote:its already been fixed in the svn.

everything's pretty much done now. i think i can get a release next week.
This is great news :)

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Wed Feb 29, 2012 7:52 pm
by rubylily
Not sure if this is a bug or not, but when I add my Meta Tag Description in the Admin it does not show up on the home page. I using 1.5.1.3.1. The category tags show up on the category pages no problem.

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Thu Mar 01, 2012 6:23 pm
by JNeuhoff
rubylily wrote:Not sure if this is a bug or not, but when I add my Meta Tag Description in the Admin it does not show up on the home page. I using 1.5.1.3.1. The category tags show up on the category pages no problem.
Works fine on a standard Opencart 1.5.1.3, unable to reproduce your error.

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Thu Mar 01, 2012 6:37 pm
by JNeuhoff
The direct payment methods, such as catalog/controller/payment/pp_pro.php, need to be made more robust for the function send. What frequently happens, is this: Customer clicks on the final 'Confirm Order', an ajax call to the send method is triggered, and when even simple things go wrong in there, such as an unexpected 'PHP Notice' or 'PHP Warning' message, the json response gets corrupted, even though the payment may have gone through successfully. The customer sees an endless 'Please Wait', and might end up doing multiple payments for the same order. I suggest the following bugfix, where PHP Notices or Errors are caught and handled in a proper Exception handler, see example below for PayPal PRO:

Code: Select all

class PaymentPPProErrorHandler  
{  
	/** 
	* catches php errors / warnings / notices and throws 
	* an exception instead 
	* 
	* @param int $errNo 
	* @param string $errStr 
	*/  
	public static function handle($errNo, $errStr=NULL)  
	{  
		switch ($errNo) {  
			case E_WARNING:  
				throw new RuntimeException($errStr,$errNo);  
				break;  
			default:  
				throw new Exception($errStr,$errNo);  
				break;  
		}  
	}  
	
	/** 
	* Overwrites the PHP error handler and uses our own 
	* 
	*/  
	public static function set()  
	{  
		set_error_handler(array(__CLASS__ , 'handle'));  
	}      
}  

class ControllerPaymentPPPro extends Controller {
	..........
	public function send() {

		PaymentPPProErrorHandler::set();
		try {
			..........
		}
		catch (Exception $e) {
			$msg = "PHP Exception: ".($e->getMessage())." in ".($e->getFile())." on line ".($e->getLine());
			$this->log->write( $msg );
			if (!isset($json)) {
				$json = array();
			}
			$json['exception'] = $msg;
			if (!isset($json['success'])) {
				if (!isset($json['error'])) {
					$json['error'] = "Payment could not be processed because of server error:\n".$msg;
				}
			}
		}
		restore_error_handler();
			
		$this->response->setOutput(json_encode($json));
	}
}

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Fri Mar 02, 2012 8:39 am
by SelfMan
Daniel OpenCart doesn't send notifications of product returns requests, nor does it send notifications of new product reviews. Are you planning to add this functionality to OC? I know that this is more a feature request then a Bug, but I consider it more as a missing feature as we are not checking for returns regullary.

I know that there is a module for that, but shouldnt this be directly in OC?

Typo in Admin/System

Posted: Fri Mar 02, 2012 8:31 pm
by lv2dr65
Typo in Admin/System. When using www. in multi store setup the 2nd store's add_to_cart buttons will not work on index page.

OC 1.5.1.3.1

The error:
XMLHttpRequest cannot load http://www.sportinggoods.hobbyjunkie.co ... art/update Origin http://sportinggoods.hobbyjunkie.com is not allowed by Access-Control-Allow-Origin.

Noticed same problem on beta 1.5.2

BTW, setting up a 2nd store in OC 1.5.3.1 is a nightmare of epic proportions...

Image

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sat Mar 03, 2012 7:09 am
by matts118
Hi. I found a bug, and also fixed it. The USPS module gives incorrect values for foreign currencies as it multiplies the US$ value twice. It isn't so noticeable with Euros etc as they are already close to the US$, but if you have Yen or Hungarian Forints, you get shipping equivalents of thousands of dollars.

The fix is:

go to catalog/model/shipping/usps.php

find this line (it occurs several times)
'text' => $this->currency->format($this->tax->calculate($this->currency->convert($cost, 'USD', $this->currency->getCode()), $this->config->get('usps_tax_class_id'), $this->config->get('config_tax')))

replace with
'text' => $this->currency->format($this->tax->calculate($cost, $this->config->get('usps_tax_class_id'), $this->config->get('config_tax')))

find
'cost' => $this->currency->convert($cost, 'USD', $this->config->get('config_currency')),

replace with
'cost' => $cost,

The problem is this $this->currency->convert() converts the currency from US$, and then the format() function does it again, so the initial US$ number is multiplied twice by the new currency. So need to remove the $this->currency->convert().

Re: Typo in Admin/System

Posted: Sat Mar 03, 2012 3:58 pm
by Daniel
lv2dr65 wrote:Typo in Admin/System. When using www. in multi store setup the 2nd store's add_to_cart buttons will not work on index page.

OC 1.5.1.3.1

The error:
XMLHttpRequest cannot load http://www.sportinggoods.hobbyjunkie.co ... art/update Origin http://sportinggoods.hobbyjunkie.com is not allowed by Access-Control-Allow-Origin.

Noticed same problem on beta 1.5.2

BTW, setting up a 2nd store in OC 1.5.3.1 is a nightmare of epic proportions...

Image

this is not a bug just you not using sub domains properly. you don't use www for sub domains!

http://www.maindomain.com
http://subdomainj.maindomain.com

its not a nightmare. its the same as any other script that can run multiple domains.

also its always better to have different domains posted to the same install and not use sub domains.

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sat Mar 03, 2012 10:34 pm
by Calcite
I have been deliberating whether to post this as a bug or not.

Sorry if it is not a bug but here goes...

This may be due to me being a newbie, but I seem to have a problem with running OC 1.5.1.3 on Localhost as far as sales reports go.

I have created accounts and done some test shopping.

The orders show up OK in the Admin panel, ,but if I look in Reports>Sales<Orders nothing shows up if I filter by "All Statuses"

If I changed status of an order to processed, shipped, etc. and filter on that status it shows OK.

Is this the way it is meant to work or should "All Statuses" find everything?

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sun Mar 04, 2012 11:35 am
by storm-cloud
Not 100% sure if this is a bug but thought this would be a good place to start.

I have found that the search box at the top of the store only references one word. For example, if I enter "Word A" and "Word B", the results appear. Then if I change "Word B" even if the word is gibberish, the results stay the same.

Now I have products that "Word A" is the same but "Word B" is different, but if I search with the two words, the results are the nearly same (the order changes slightly but the two word match is not being prioritised in any way). It seems that the search is not paying attention to "Word B" at all.

Surely if I search for a two word string that matches a product with both words, then the products matching with both words should show up at the top of the results list, and those products only matching with one word should be filtered out or placed at the end of the list?

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Sun Mar 04, 2012 8:18 pm
by solojuve1897
*Reposted* - Is there no fix for this?

Do the following:

First: Have a clean install of OpenCart 1.5.1.3

1. Put something in the cart.

2. Go to checkout

3. Choose Register account

4. Input all your details and uncheck "My delivery and billing addresses are the same."

5. Choose "I want to use a new address" and input your details

6. Complete the order.

7. Go to the admin and check the new order.

8. Choose "Payment Details"

The bug: The payment details are empty!

It's really strange that this hasnt been reported before? Or maybe it has? It's kind of a big bug. What to do to fix this issue?

Image

Re: OpenCart 1.5.1.3 Bug Thread

Posted: Mon Mar 05, 2012 3:36 am
by JNeuhoff
Calcite wrote:I have been deliberating whether to post this as a bug or not.

Sorry if it is not a bug but here goes...

This may be due to me being a newbie, but I seem to have a problem with running OC 1.5.1.3 on Localhost as far as sales reports go.

I have created accounts and done some test shopping.

The orders show up OK in the Admin panel, ,but if I look in Reports>Sales<Orders nothing shows up if I filter by "All Statuses"

If I changed status of an order to processed, shipped, etc. and filter on that status it shows OK.

Is this the way it is meant to work or should "All Statuses" find everything?
This is a known bug, reported earlier in this bugthread.

Try attached bugfix for 1.5.1.3: