Post by Retrofox » Fri Aug 14, 2020 11:43 am

Opencart 3.0.2.0
Custom theme (cart section not changed)

Setup to problem:
1: Customer makes a shopping cart while logged in, they abandon it.
2: Customer returns makes new cart and proceeds to checkout.
3: In checkout customer logs in, merging the saved cart and the guest cart.
4: The customer is completely unaware that this has happened all the way upto the point they have finished payment.
Result : Customer pays for a doubled order unknowingly.

I have thought of a couple ways to get around this, but as im not a coder I need some help.

Idea 1 (maybe preferable, simplest)
Completely disable saved shopping carts from customer accounts (Thats what wish lists is for right?)

Idea 2
When Logging in/Registering during checkout, kick the customer back to the shopping cart page (so they can reconfirm)

Idea 3 (probably most elegant)
Display shopping cart + total along side the whole checkout process, so the customer sees the cart update.


If anyone can help me solve this issue it would be great. People are thinking im trying to scam them and business has slowed down drastically (just finally updated from 1.5.x) Thanks.

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by letxobnav » Fri Aug 14, 2020 2:14 pm

Idea 1: the wishlist is for items you do not yet want to purchase or cannot purchase but want to keep an eye on.
Idea 2: that is a possibility but then better add a message as to why the kick back
Idea 3: also possible, I find that crowded so I just replace the search box with a big cart button front and center blinking 3 times to get their attention and the ability to double check (I do not show that default cart dropdown button anywhere else.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Retrofox » Fri Aug 14, 2020 10:54 pm

Yes im aware of the wishlist function. Since thats what it is for I have zero need for accounts to save carts, asepcially when nearly every single time it causes people to unknowingly pay double the amount they planned.

Do you know how to disable it?

Do you know how to do any of the ideas?

I just need it to stop it now by any means because its making me look like a scammer and I need to pay rent at the end of the month.

Scrap idea 2 and 3, how do I disable it? please.

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by khnaz35 » Fri Aug 14, 2020 10:59 pm

Retrofox wrote:
Fri Aug 14, 2020 10:54 pm
Yes im aware of the wishlist function. Since thats what it is for I have zero need for accounts to save carts, asepcially when nearly every single time it causes people to unknowingly pay double the amount they planned.

Do you know how to disable it?

Do you know how to do any of the ideas?

I just need it to stop it now by any means because its making me look like a scammer and I need to pay rent at the end of the month.

Scrap idea 2 and 3, how do I disable it? please.
If it is urgent better pay to someone to fix it for you.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

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

(deleted for irrelevancy lol)
Last edited by Retrofox on Sat Aug 15, 2020 8:56 pm, edited 1 time in total.

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by khnaz35 » Fri Aug 14, 2020 11:16 pm

Excellent!
No one is being mean here to you, it was your comment that you have to pay rent end of the month and people are thinking that you are scammer. It was your own connivence and quick fix.
Beside if you would share your URL of site or error_logs, php errors etc it may help people to put you in right direction.
If you just need to know the files then you can simply start looking at your controller files

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

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

Fair enough, but thinking them words would signify that I ent' get much cash to my name lol =(.
I been weeks and weeks fixing bugs apon bugs and this is the final issue and I have no idea where to look because the only thread on this issue I could find is for v2 so references a completely different fileset.

I just need to find whatever that function is and delete it, the other options would have been fancier, but id be more than happy to just full on delete the function.. its completely unnecessary for my business. (I ddnt need it before, dnt need it now =) )

There will be no errors because this is how the site functions normally.

Any ideas where this file is? In v2 its system/library/customer.php
( viewtopic.php?t=39900 )

V3 is just an instalable bug at this point haha. Iv had to edit nearly every single twig and language file just so the correct text appears lol.

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by khnaz35 » Sat Aug 15, 2020 12:04 am

Retrofox wrote:
Fri Aug 14, 2020 11:36 pm
Any ideas where this file is? In v2 its system/library/customer.php
( viewtopic.php?t=39900 )
system directory should be in your public_html/system or may be you had placed it anywhere else. it is the same directory when you upgrade to v3 its ask in the admin beginning.
you can look through via FTP for that.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by Retrofox » Sat Aug 15, 2020 12:17 am

Its not the directory it self but the file(s) that replaces the ones referenced in v2.x

Forgive me as there has been quite mistake in my wording.
The card section can show the order above final payment, but the problem shows when on mobiles/thin resolution systems because it doesn't scale to fit so you only see product names and the quantities /totals are cut off (with a scroll bar that everyone ignores)

I have a better solution idea that works and hopefully I can re-find that cart file and change a few things.
I will basically move the table around so the prices or total are bold and on the left side.

Sorry, super frazzled mentally atm, with a heatwave, nearly breaking my wrist and the $$ issue XD.

If anyone has cleaner ideas please share, also this solution sounds more on my level so if I figure it out ill share back.

(Would still like to know how to work with the cart saving removal for future projects, so if anyone knows this please share, it would be greatly appreciated.)

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by jrr » Sat Aug 15, 2020 4:54 am

I am new to OC as well, converting an older cart (oscMax) over, and I just tried out what the OP was talking about and it is potentially annoying to customers. It seems to me that the Checkout Page should LIST THE STUFF THE CUSTOMER IS BUYING! Like most online sites do...

I suspect there may be an extension that will do that, but it seems to me to be a rather silly oversight.

As I suspected in Marketplace there are a number of One Page Checkouts that show the item(s) purchased. I think this will solve the problem for me, might work for the OP as well...

jrr
Active Member

Posts

Joined
Mon Nov 20, 2017 1:48 pm

Expert Member

Posts

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

Post by khnaz35 » Sat Aug 15, 2020 12:25 pm

Retrofox wrote:
Sat Aug 15, 2020 12:17 am
Its not the directory it self but the file(s) that replaces the ones referenced in v2.x
That is true its not the directory its the file system/library/cart/cart.php

you can access here through your FTP, or from hosting control panelhttps://prnt.sc/tzx01y

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by letxobnav » Sat Aug 15, 2020 12:56 pm

The construct function of the cart class where the customer's saved cart is merged and the guest items are assigned to the customer is flawed.

That functionality should never have been put in the class construct, causes duplicate entries, is needlessly executed on overy page load and is difficult to customize to not merge carts.

Search for post with "cart duplicate items", there are instructions there to relocate that logic to separate cart class functions which make it easier to adjust the merging or not merging of customer carts.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by khnaz35 » Sat Aug 15, 2020 1:23 pm

letxobnav wrote:
Sat Aug 15, 2020 12:56 pm
Search for post with "cart duplicate items", there are instructions there to relocate that logic to separate cart class functions which make it easier to adjust the merging or not merging of customer carts.
So far now the sloution is provided for the OC V 2.x didn't see yet for the OC V3.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by letxobnav » Sat Aug 15, 2020 3:03 pm

Just remove all references of customer_id from the cart queries, add, update, getProducts, clear, etc. that means in the cart everybody is customer_id 0 and only the session_id is used to tie the customer to the cart items, and those entries will also be removed as they are now always guest entries.
like:
in catalog/config.php
add:

Code: Select all

// customer cart switch
define('CUSTOMER_CART', false);
in system/library/cart/cart.php
after:

Code: Select all

$this->weight = $registry->get('weight');
add:

Code: Select all

// set customer_id for cart operations, zero if no cart for customers
$this->customer_id = (CUSTOMER_CART ? (int)$this->customer->getId() : 0);
change:

Code: Select all

if ($this->customer->getId()) {
to:

Code: Select all

// no cart merging if no customer cart
if ($this->customer->getId() && CUSTOMER_CART) {

replace all occurrences of:

Code: Select all

(int)$this->customer->getId()
with:

Code: Select all

$this->customer_id

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Retrofox » Sat Aug 15, 2020 8:47 pm

Thanks for all the responses guys, this all looks really helpful.
That cart solution sounds perfectly elegant for a full removal =), Ill test that and see how I go.

This seems to be exacerbating the problem on mobile.
Here is a example of how it looks on a mobile, except the sideways scrollbar is invisible because it turns into a finger slider.
Image
Everything else mobile wise works great.
Im assuming that product list is calling the same file the cart does, maybe this can be resolved making a custom version for the checkout that lays things out differently? Having only Product name + Quantity + Total should fit.

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by Retrofox » Sat Aug 15, 2020 9:31 pm

letxobnav wrote:
Sat Aug 15, 2020 3:03 pm

in catalog/config.php
add:

Code: Select all

// customer cart switch
define('CUSTOMER_CART', false);
Would this be the root config for v3? Not the admin config? (or both?)

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by khnaz35 » Sat Aug 15, 2020 10:38 pm

Retrofox wrote:
Sat Aug 15, 2020 9:31 pm
letxobnav wrote:
Sat Aug 15, 2020 3:03 pm

in catalog/config.php
add:

Code: Select all

// customer cart switch
define('CUSTOMER_CART', false);
Would this be the root config for v3? Not the admin config? (or both?)
catalog/config.php

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by Retrofox » Sat Aug 15, 2020 11:03 pm

I should have been more clear because that file doesn't exist on my server.
I have config in root and admin only.

Newbie

Posts

Joined
Fri Oct 04, 2019 4:41 am

Post by khnaz35 » Sat Aug 15, 2020 11:08 pm

Retrofox wrote:
Sat Aug 15, 2020 11:03 pm
I should have been more clear because that file doesn't exist on my server.
I have config in root and admin only.
Yes, that is in root

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 34 guests