Post by werepair » Tue Oct 04, 2011 7:47 pm

j8yba wrote:
werepair wrote:You have been logged off your account. It is now safe to leave the computer.
Is this a normal exit quote? "safe to leave the computer" ? Surely safe to leave this website or something would be better?

Hi, Yes his is the normal quote in opencart

Code: Select all

You have been logged off your account. It is now safe to leave the computer.
this can easilly be changed to what ever text you want.
Best Regards

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by bepdaniels » Tue Nov 01, 2011 4:03 pm

Perfect j8yba! I was just about to use $this->cart->clear() in my logout script, but this is much cleaner. Hooray for vQmod! :)

iPhone Jailbreak/Unlock: http://www.unlockiphone.com.au
ALL Phone's Genuine Factory Unlock: http://www.unlockcodes.com.au
COMING SOON: Unlock your iPhone through iTunes. No codes, software or downloads!


Newbie

Posts

Joined
Wed Jun 29, 2011 1:08 pm

Post by jussi » Fri Feb 03, 2012 8:49 pm

Hi,

vqmod doesn´t work for me (1.5.1.3). The log gives this error: REQUEST URI : /admin/index.php?route=tool/error_log&token=a3ab1d27adc8615b99be3ff8f75d9900
DOM UNABLE TO LOAD: /public_html/vqmod/xml/disable_shopping_cart_saving.xml

Any suggestions? I would really like to use this mod!

Newbie

Posts

Joined
Tue Jan 24, 2012 7:57 pm

Post by 92marriw8 » Tue Feb 07, 2012 2:27 pm

Yes I have exactly the same problem! Does anybody have a solution for this mistake?





Image

Newbie

Posts

Joined
Sun Feb 05, 2012 11:03 am

Post by wakabayashi » Tue Mar 06, 2012 1:11 am

Does anybody have a solution for this "problem" which works with the version 1.5.2?

New member

Posts

Joined
Thu Aug 04, 2011 2:55 am

Post by rdvapors » Sat Mar 30, 2013 1:49 am

I have been running OP 1.5.5.1, and noticed that when a customer (logged in or not) adds items to the cart and then abandoned it, then returns later the cart still has the items in it. Is there a way to clear the cart when it is abandoned by simply the customer closing the browser?

New member

Posts

Joined
Thu Dec 13, 2012 11:29 pm

Post by SXGuy » Tue Oct 17, 2017 7:53 pm

I apreciate this is an old thread, but i thouht id add the fix for OC 2.X as i searched around and didnt find anywhere with this information.

To do this in OC 2.x you need to go to System/Library/Cart/Customer.php

Find

Code: Select all

	public function login($email, $password, $override = false) {
		if ($override) {
			$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND status = '1'");
		} else {
			$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");
		} 
Replace with

Code: Select all

	public function login($email, $password, $override = false) {
		if ($override) {
			$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND status = '1'");
		} else {
			$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");
			$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '" . $customer_query->row['customer_id'] . "'");
		} 
So if any cart data in the cart table was assigned to a customer after login during a session, but the customer fails to check out, this will clear the cart table of cart data associated with the customer when they next login. This does not clear any cart contents added prior to logining in either.

On side note. i didnt like the way the cart table keeps entries with customer id's of 0, which may never be assigned to a customer in the future so to clear the content i added this to System\Cart\Cart.php

find

Code: Select all

if ($this->customer->getId()) {
Add above

Code: Select all

$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE (api_id = '0' AND customer_id = '0') AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR)"); 

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by Vapeministry » Tue Feb 13, 2018 7:08 am

That's nice, but if the customer makes an error in the log-in (inputs wrong username or password) the system returns a Notice: Undefined index: customer_id in /system/library/cart/customer.php on line XX i guess cos there's no customer_id passed.

Newbie

Posts

Joined
Sat Nov 04, 2017 12:48 am

Post by antstyl » Thu Aug 01, 2019 9:12 pm

Has anyone tested it with Opencart 3.0.2.0?

User avatar
Active Member

Posts

Joined
Mon Nov 12, 2012 5:40 pm

Post by Retrofox » Fri Aug 14, 2020 11:13 pm

Sorry to bump but when I make my own threads people just get sarcastic and I cant understand why.
What is the equivalent file in v3.x? (Im starting to think v3 is designed broken to artificially create more need for the marketplace, Iv been bug fixing for weeks lol)

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am
Who is online

Users browsing this forum: No registered users and 21 guests