Post by FCWC » Sat Jan 28, 2023 6:41 am

OC 3.0.3.1
Theme - default. But switching to another = same.
sk8.worldconspiracy.org (probably cant view less your in the USA)

So just noticed that when you add some items to cart the wrong item is put into the cart.
Example - select says Decks- Street - World Conspiracy Gas Mask 8.5 - Add to cart -
The bread crumb Success: You have added World Conspiracy Gas Mask Deck 8.5 to your shopping cart! Which is correct but the item in the cart is not but rather (Birdhouse Jaws Old School Complete 7.5 Blue) I am unsure when this started. Today I switched my theme back to Default and then I noticed the wrong item problem.
Its not just on 1 item in a particular category. But not matter they all put the same incorrect item into the cart. (Birdhouse Jaws Old School Complete 7.5 Blue)
The incorrect item is in no way or form related to the others. IE the product ID, model, SEO etc are not even close.
I did a full export - re import to see if it clears it up - nothing.
Deleted the Birdhouse Jaws Old School Complete 7.5 Blue product and then nothing is added to cart.
Spent time searching Google and here but nothing. And error logs clean.
Last edited by FCWC on Fri Feb 03, 2023 2:01 am, edited 1 time in total.

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am

Post by SohBH » Sat Jan 28, 2023 2:13 pm

Hi,

Any reason to restrict country access?
Check your html output, which product ID submit by add to cart button

Business Web Development | Content Creation | Analytics and Reporting | SEO


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by FCWC » Mon Jan 30, 2023 7:38 am

Why = I don't ship outside continental USA and it alleviates 99% of all probes/attacks/spam.

Also I am unsure what you mean by
> "Check your html output, which product ID submit by add to cart button"
Unless your just refereeing to inspecting the html on the page. I had and everything is correct. No other products link to the added product. Even within the Db.
I searched all files for the added products ID, Model, name, SEO and came up with nothing.
Even in the DB its all correct.

Even though it is a beloved movie,
I REALLY HATE THOSE DAMN GREMLINs!

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am

Post by paulfeakins » Mon Jan 30, 2023 7:54 pm

FCWC wrote:
Mon Jan 30, 2023 7:38 am
Unless your just refereeing to inspecting the html on the page. I had and everything is correct.
So the correct product ID is inside the cart.add() function?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by by mona » Mon Jan 30, 2023 8:26 pm

Why = I don't ship outside continental USA and it alleviates 99% of all probes/attacks/spam.
You will find that a large amount of "probes/attacks/spam", originate from cloud services located in your very own US of A.
Only amateurs still use their local servers to engage in such efforts.


You can use web developer tools to see what is added by checking the url index.php?route=checkout/cart/add
See the payload tab where you will find the product id which is send by your ajax call.
If that is wrong, it is your template which is picking up the wrong product id.
If that is correct but is not the same as the one added to the cart, it is on your server side.
Then you can put some $this->log->write(); statements in the checkout/cart controller, function add to see what is happening there.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by FCWC » Tue Jan 31, 2023 5:53 am

paulfeakins - yes they are correct:
Example:

Code: Select all

<button type="button" onclick="cart.add('888560132498');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md">Add to Cart</span></button>
The product this will add is product_id 2147483647 (which is the 1 they all do)

by mona -
checked checkout/cart/add
response is correct product_id:888560132498

I will look into logging the cart and assume you mean into the cart.twig file.

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am

Post by agatha65 » Tue Jan 31, 2023 6:11 am

product_id:888560132498
How many products do you have in the database?

Suppliers Module - XML, CSV, XLS Product Feed Import and Update
Rich Snippets | Facebook Open Graph Meta Tags | WebP Images
Image


User avatar
Active Member

Posts

Joined
Fri Mar 16, 2012 10:18 am
Location - Canada, QC

Post by FCWC » Tue Jan 31, 2023 7:48 am

Dont pay attention to that.
I use Bigint in my DB so that I can use UPC (or internal #) for product ID so that I do not have to track arbitrary product id #s every time I import products- which is pretty regularly. (No auto increment)
Also that is not the issue as it has been working for years. This situation is more than likely due to disabling and enabling installed extensions/modifications as I was looking for reason why new Square ext was stuck loading. Noticed this while hunting that and that was the only thing I had done recently. And yes I have since retried them all to see if any change.

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am

Post by purpletreesoft » Tue Jan 31, 2023 8:33 am

This issue could be caused by a number of factors, including a bug in the code, incorrect product ID, or an issue with the user's session. To resolve it, try the following steps:
  • Check if the product ID is correct in the add-to-cart URL or form.
  • Clear your browser cache and cookies.
  • Try adding the item to the cart in a different browser or private/incognito window.
  • Check the logs for any errors related to the add-to-cart function.
  • If the issue persists, reach out to the OpenCart support team for further assistance.

Purpletree Software LLP
New features launched for Multivendor Marketplace Extension


User avatar
New member

Posts

Joined
Thu Jun 22, 2017 10:17 pm


Post by agatha65 » Tue Jan 31, 2023 2:38 pm

I'm pretty sure the problem is the product ID.
Only products with very big IDs have this strange behavior with add to cart.
You should use the SKU field for the external product item number.

Suppliers Module - XML, CSV, XLS Product Feed Import and Update
Rich Snippets | Facebook Open Graph Meta Tags | WebP Images
Image


User avatar
Active Member

Posts

Joined
Fri Mar 16, 2012 10:18 am
Location - Canada, QC

Post by ADD Creative » Tue Jan 31, 2023 8:26 pm

FCWC wrote:
Tue Jan 31, 2023 7:48 am
Dont pay attention to that.
I use Bigint in my DB so that I can use UPC (or internal #) for product ID so that I do not have to track arbitrary product id #s every time I import products- which is pretty regularly. (No auto increment)
Also that is not the issue as it has been working for years. This situation is more than likely due to disabling and enabling installed extensions/modifications as I was looking for reason why new Square ext was stuck loading. Noticed this while hunting that and that was the only thing I had done recently. And yes I have since retried them all to see if any change.
I think that is very significant, as well as the value of the product_id being 2147483647. 2147483647 is the maximum value of a 32 bit signed integer. Somewhere in the code or database your product_id is being restricted to a 32 bit integer.

Check your oc_cart table in the database for structure and if the larger product_id is being stored correctly. Might tell you if the problem is before or after the insert into the database.

www.add-creative.co.uk


Expert Member

Posts

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

Post by FCWC » Wed Feb 01, 2023 1:28 am

THANK YOU!
Turns out something had reverted part of my database back to 4 bit when I was testing. Never even occurred to me.
Simple fix.

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am

Post by paulfeakins » Thu Feb 02, 2023 10:51 pm

FCWC wrote:
Wed Feb 01, 2023 1:28 am
THANK YOU!
Turns out something had reverted part of my database back to 4 bit when I was testing. Never even occurred to me.
Simple fix.
Great, please add [SOLVED] to the start of this post title.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: ravikumar22, Semrush [Bot] and 87 guests