If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / attrib stock - 32 character string getting appended to each item in shopping cart

attrib stock - 32 character string getting appended to each item in shopping cart

Locked

Started by johnnybravoh on 17 Jun 2007, 11:47 AM · Views: 1,753

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
17 Jun 2007, 11:47 AM
#1
johnnybravoh avatar

johnnybravoh

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

Post #1 by johnnybravoh

Hello there,

I have a very odd problem that seems to have popped up out of nowhere.

A 32 character string is being appended to each product ID for only one category in my store. This only shows up in the shopping cart. Nowhere else. Here is an example of a URL in the shopping cart.

http://www.some_random_URL.com/shop/index.php?main_page=product_info&products_id=180**:b46420006b9a8139c243e890f2e8bed5**

See that :b46420006b9a8139c243e890f2e8bed5?

I get a different 32 character string for each product, but it's persistent across sessions - i.e. I get the same 32 character string for products_id 180 no matter which computer I view this on.

Where's that coming from? It's breaking queries! When I click on a link in the shopping cart, I get a message like:

"1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':b46420006b9a8139c243e890f2e8bed5 and stock_attributes=1150' at line 1
in:
[select quantity from shop_products_with_attributes_stock where products_id=180:b46420006b9a8139c243e890f2e8bed5 and stock_attributes=1150]"

I don't really know where to find what is causing this behavior and appreciate any help you can provide.

Thank you in advance,

Jon

17 Jun 2007, 2:35 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

That is shown when Attributes are added to the Product and inserted in the Cart ...

If you go to the product from the shopping_cart and there are Attributes, you will see it so that the settings are set as in the shopping_cart ...

If you go to the Product from anywhere else you will only see the =180 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

17 Jun 2007, 5:15 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #3 by drbyte

Your products-with-attribute-stock module appears to need to be treating your products_id value as a string with quotes around it, but isn't.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jun 2007, 12:43 AM
#4
johnnybravoh avatar

johnnybravoh

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

Post #4 by johnnybravoh

It sounds then like this is expected behavior but if that's the case then why are the links broken in the shopping cart?

Every time I click on a link I get the error as stated in the original post. This can't be right.

18 Jun 2007, 2:08 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #5 by ajeh

Have you an URL where we can see this happening, perhaps? :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Jun 2007, 3:14 AM
#6
johnnybravoh avatar

johnnybravoh

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

Post #6 by johnnybravoh

Yes - it's password protected to keep anyone from purchasing while the shop is in development.

url:http://www.akianestour.com/shop
userid: tmp
pass: tmp123

Add any painting to your shopping cart. When you're viewing the shopping cart contents you'll see the 32 character appended products_id I'm speaking of.

Jon

18 Jun 2007, 3:19 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #7 by drbyte

johnnybravoh:

Add any painting to your shopping cart. When you're viewing the shopping cart contents you'll see the 32 character appended products_id I'm speaking of.Yes, that is entirely normal for products that have attributes associated with them.

Your problem has nothing to do with those necessary characters.
The problem is that your SQL Query should be enclosing the product id in quotes because if it's not in quotes, it treats the : character as a divider instead of part of the product id.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jun 2007, 6:17 AM
#8
johnnybravoh avatar

johnnybravoh

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

Post #8 by johnnybravoh

DrByte:

Yes, that is entirely normal for products that have attributes associated with them.

Your problem has nothing to do with those necessary characters.
The problem is that your SQL Query should be enclosing the product id in quotes because if it's not in quotes, it treats the : character as a divider instead of part of the product id.

Oh that's great news. Means an easy fix. Would you happen to know the file I need to alter to insert the quotes?

Thanks again!

18 Jun 2007, 2:58 PM
#9
johnnybravoh avatar

johnnybravoh

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

Post #9 by johnnybravoh

johnnybravoh:

Oh that's great news. Means an easy fix. Would you happen to know the file I need to alter to insert the quotes?

Thanks again!
Alright - I found it. It was code that I inserted in the file includes/modules/attributes.php to display attribute quantities in the attribute list so you can see that there are 500 24x30 paintings and 475 30x46 paintings for instance...

I really appreciate your assistance in pointing me in the right direction.