Post by OSWorX » Thu Oct 09, 2014 8:31 pm

While this sql-query is a bit unlucky built, I have tried it and it works.
Could it be another mod?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by ADD Creative » Fri Oct 10, 2014 1:34 am

frankleng wrote:
Simply search with a qualified editor for:

Code: Select all

SELECT date_end FROM
in all files you have on your server / shop.
May need a few seconds, but you will find that phrase.
I'm a little lucky. It takes me little time to find it in a mod,
http://www.opencart.com/index.php?route ... _license=0

Code: Select all

<?php
class ModelModuleSpecialPriceCountDown extends Model {
	
	public function getSpecialPriceEndData($product_id) {
		if ($this->customer->isLogged()){
			$customer_group_id = $this->customer->getCustomerGroupId();
		} else {
			$customer_group_id = 0;
		}
		
		$sql = "SELECT date_end FROM " . DB_PREFIX . "product_special 
				WHERE product_id ='" . $product_id . "' AND date_start <= NOW() AND date_end >= NOW() ORDER BY priority ";
		if ($customer_group_id){
			$sql .= " AND customer_group_id ='" . $customer_group_id . "'";
		}
		
		$sql .= "LIMIT 0,1";
		
		$query = $this->db->query($sql);
		
		if ($query->num_rows){
			return $query->row['date_end'];
		} else {
			return 0;
		}		
			
	}	
}
?>
i'm not sure it's this mod triggered the error, It's appreciated if you can tell me the solution. Thanks.
That code may error if a string and not an integer is being passed as product_id.

Try changing

Code: Select all

WHERE product_id ='" . $product_id . "' AND date_start <= NOW() AND date_end >= NOW() ORDER BY priority ";
to

Code: Select all

WHERE product_id ='" . (int)$product_id . "' AND date_start <= NOW() AND date_end >= NOW() ORDER BY priority ";
Note the (int) before $product_id.

And you could also change

Code: Select all

$sql .= " AND customer_group_id ='" . $customer_group_id . "'";
to

Code: Select all

$sql .= " AND customer_group_id ='" . (int)$customer_group_id . "'";
Depending on how the method is used, there could also be a chance on SQL injection.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by frankleng » Fri Oct 10, 2014 12:02 pm

OSWorX wrote:While this sql-query is a bit unlucky built, I have tried it and it works.
Could it be another mod?
This error comes out occassionally. Actually, I don't know what operation triggered this. Thanks for your attention.

Active Member

Posts

Joined
Sun Apr 22, 2012 5:49 pm

Post by frankleng » Fri Oct 10, 2014 12:05 pm

ADD Creative wrote:
frankleng wrote:
Simply search with a qualified editor for:

Code: Select all

SELECT date_end FROM
in all files you have on your server / shop.
May need a few seconds, but you will find that phrase.
I'm a little lucky. It takes me little time to find it in a mod,
http://www.opencart.com/index.php?route ... _license=0

Code: Select all

<?php
class ModelModuleSpecialPriceCountDown extends Model {
	
	public function getSpecialPriceEndData($product_id) {
		if ($this->customer->isLogged()){
			$customer_group_id = $this->customer->getCustomerGroupId();
		} else {
			$customer_group_id = 0;
		}
		
		$sql = "SELECT date_end FROM " . DB_PREFIX . "product_special 
				WHERE product_id ='" . $product_id . "' AND date_start <= NOW() AND date_end >= NOW() ORDER BY priority ";
		if ($customer_group_id){
			$sql .= " AND customer_group_id ='" . $customer_group_id . "'";
		}
		
		$sql .= "LIMIT 0,1";
		
		$query = $this->db->query($sql);
		
		if ($query->num_rows){
			return $query->row['date_end'];
		} else {
			return 0;
		}		
			
	}	
}
?>
i'm not sure it's this mod triggered the error, It's appreciated if you can tell me the solution. Thanks.
That code may error if a string and not an integer is being passed as product_id.

Try changing

Code: Select all

WHERE product_id ='" . $product_id . "' AND date_start <= NOW() AND date_end >= NOW() ORDER BY priority ";
to

Code: Select all

WHERE product_id ='" . (int)$product_id . "' AND date_start <= NOW() AND date_end >= NOW() ORDER BY priority ";
Note the (int) before $product_id.

And you could also change

Code: Select all

$sql .= " AND customer_group_id ='" . $customer_group_id . "'";
to

Code: Select all

$sql .= " AND customer_group_id ='" . (int)$customer_group_id . "'";
Depending on how the method is used, there could also be a chance on SQL injection.
Thank you very much. I've done this.

Active Member

Posts

Joined
Sun Apr 22, 2012 5:49 pm

Post by frankleng » Mon Oct 13, 2014 9:09 am

Hi, i think my paypal mismatch problem is perfectly solved.
However, I still got this error:
2014-10-13 3:01:41 - PP_STANDARD :: IPN RESPONSE: VERIFIED
2014-10-13 3:01:41 - PP_STANDARD :: RECEIVER EMAIL MISMATCH! xxxxxx@hotmail.com

I have checked that the OC amount is same with Paypal amount now. No problem.
But, i still see thiis error at backend of OC.
Does this really mean I need to use the same email address in Opencart to get notice and in paypal as primary address to get paid?
i used to set the same email address for notice and getting paid, at that time oc amount and paypal amount mismatch, same error happens, what's the problem now?
Here is amount, i notice that the subtotal is not match, will paypal check that?:
ddd.jpg

ddd.jpg (56.34 KiB) Viewed 5944 times


Active Member

Posts

Joined
Sun Apr 22, 2012 5:49 pm

Post by ADD Creative » Mon Oct 13, 2014 4:29 pm

It does not matter that the sub-totals do not match (and they probably never will).

You need to set your email address that is registered with PayPal in the PayPal Standard settings page of OpenCart. This does not need to be the same as the one set in the General Settings.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by frankleng » Mon Oct 13, 2014 6:42 pm

ADD Creative wrote:It does not matter that the sub-totals do not match (and they probably never will).

You need to set your email address that is registered with PayPal in the PayPal Standard settings page of OpenCart. This does not need to be the same as the one set in the General Settings.
I have paypal account linked with more than 3 email addresses, i think anyone is ok for getting paid.
As you said, i have set it right in PP standard setting page of OC.
I'm wondering whether customers will still see an error message from paypal when this error is still logged at OC backend.
Because i was reminded once before from customer. He said, when checking out with paypal, there is error, but he did paid, asking me to check that order.

Active Member

Posts

Joined
Sun Apr 22, 2012 5:49 pm

Post by ADD Creative » Mon Oct 13, 2014 10:43 pm

Dose the email address in the "PP_STANDARD :: RECEIVER EMAIL MISMATCH!" log massage match the one set in OpenCart's PayPal settings?

If it does then the issue is still total related. If not the issue is probably with you PayPal settings outside OpenCart.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by frankleng » Tue Oct 14, 2014 9:52 am

ADD Creative wrote:Dose the email address in the "PP_STANDARD :: RECEIVER EMAIL MISMATCH!" log massage match the one set in OpenCart's PayPal settings?

If it does then the issue is still total related. If not the issue is probably with you PayPal settings outside OpenCart.
No. in the log message, it's xxx@hotmail.com, while in OpenCart's PayPal settings, it's a different email address i set in paypal for receiving payment. And, i have got the payment in paypal.
Currently, i set that xxx@hotmail.com as Primary in Paypal account.
and, the other as secondary address for getting money.
Is this caused the problem? The Primary address in paypal should be same with that in OC pp standard setting?
Now, in paypal acount, i set Primary address same as that in opencart pp standard setting.
Maybe, this time paypal will recognize it?

Active Member

Posts

Joined
Sun Apr 22, 2012 5:49 pm

Post by ADD Creative » Tue Oct 14, 2014 7:22 pm

From https://developer.paypal.com/docs/class ... Variables/
receiver_email Primary email address of the payment recipient (that is, the merchant). If the payment is sent to a non-primary email address on your PayPal account, the receiver_email is still your primary email.
Note: The value of this variable is normalized to lowercase characters.
Length: 127 characters
As OpenCart checks "receiver_email" matches the one you have set in its PayPal setting, it looks like you have to use the primary email address.

If you do want to use another email address also adding a check for "business" in the PayPal Standard Controller may work.
business Email address or account ID of the payment recipient (that is, the merchant). Equivalent to the values of receiver_email (if payment is sent to primary account) and business set in the Website Payment HTML.
Note: The value of this variable is normalized to lowercase characters.
Length: 127 characters

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by frankleng » Tue Oct 14, 2014 7:33 pm

thanks. I have changed the primary email. That's enough for me. You are very kind. Thank you very much.

Active Member

Posts

Joined
Sun Apr 22, 2012 5:49 pm

Post by olfactorymaven » Wed Aug 10, 2016 6:57 am

My post was deleted (assuming) about the Customer Online Report. I posted yesterday. If it is due to one of these reasons:

If your bug report was deleted, it is because it was either:
- Already Confirmed and added to the list below
- Rejected as a non-issue
- A Duplicate of another bug already mentioned.

I can understand that, but, it would've been nice to be pointed to the specific solution. I am honestly searching the detailed work you guys have put in (thank you for all you do), but still cannot find what I need.

Not sure if it is even against the rules to post this in here. I'm sure I'll find out.

Active Member

Posts

Joined
Fri Apr 19, 2013 3:35 am


Post by straightlight » Wed Aug 10, 2016 8:15 pm

- A Duplicate of another bug already mentioned.
That would be the one. You posted a reply for the same reason on an already created and not too old topic. Then, you created your own topic for the same reason. The forum notifications will already propagate the fact that you did posted the first time for that same particular reason. That being said, there is absolutely no need and in any case to create a new topic since you already sent your post reply to an existing topic along with it unless the topic is really old.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by olfactorymaven » Sat Aug 13, 2016 3:32 am

straightlight wrote:
- A Duplicate of another bug already mentioned.
That would be the one. You posted a reply for the same reason on an already created and not too old topic. Then, you created your own topic for the same reason. The forum notifications will already propagate the fact that you did posted the first time for that same particular reason. That being said, there is absolutely no need and in any case to create a new topic since you already sent your post reply to an existing topic along with it unless the topic is really old.
Understood and it makes sense. However, it still doesn't help me with the problem I am facing. I will continue to search for a solution.

Active Member

Posts

Joined
Fri Apr 19, 2013 3:35 am

Who is online

Users browsing this forum: No registered users and 28 guests