osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

products with attributes. The url in the shopping cart breaks site.

This is a discussion on products with attributes. The url in the shopping cart breaks site. within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi guys, I have a heavily modded oscommerce installed. I have SEO friendly URLS, extra product fields, and the STS ...



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Closed Thread

 

LinkBack Thread Tools
  #1  
Old 02-11-2009, 05:29 AM
New Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
galey1981 is on a distinguished road
Default products with attributes. The url in the shopping cart breaks site.

Hi guys,

I have a heavily modded oscommerce installed. I have SEO friendly URLS, extra product fields, and the STS package.

I've noticed that when I add a product which has attributes associated to it, when it's added to my basket the link when hovered over reads as this:

http://www.mywebsite.co.uk/catalog/product...ts_id=2{4}3{3}6

If i try to continue shopping or click this link, i get a blank page with the following error on it:

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 '{4}3{3}6 and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pe' at line 1

SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM products_extra_fields pef LEFT JOIN products_to_products_extra_fields ptf ON ptf.products_extra_fields_id=pef.products_extra_fi elds_id WHERE ptf.products_id=2{4}3{3}6 and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='1') ORDER BY products_extra_fields_order

[TEP STOP]

All other products I add, which do not have any attributes (e.g. a memory size on a drop down), will be fine and when clicked go to the correct place...... Can you help?

From looking at the code it seems like a extra fields issue - however, I'm not actively adding extra fields right now. I swear it must be a conflict somehow - could be related to Ultimate SEO?

I could just never add any products with attributes but that might not help me out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 02-11-2009, 06:50 AM
New Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
galey1981 is on a distinguished road
Default Re: products with attributes. The url in the shopping cart breaks site.

If my query is too vague please visit the live site and have a look.

Home - Test Platform

If you add a product to the basket which has product attributes, and then a product without them.

One without attributes:
http://www.woodleysnapshot.co.uk/catalog/f...below-p-11.html

One with attributes:
http://www.woodleysnapshot.co.uk/catalog/m...0-32mb-p-2.html

Add them both to the basket and navigate to the shopping cart page. Try clicking on the Fire down below product, there are no problems. Go back to the matrox product, and click on it in the cart.... you get a funny error.

It appears the url is appended with funny numbers at the end should the product contain attributes, and the site doesnt like this link.

I'm wondering if it's a .htaccess issue affected by the SEO friendly contribution, or if it's something wrong with the product_info page. I found this code in product_info which relates to this problem...

HTML Code:
<?php

          // START: Extra Fields Contribution v2.0b - mintpeel display fix

                      $extra_fields_query = tep_db_query("
                      SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
                      FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
             LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
            ON ptf.products_extra_fields_id=pef.products_extra_fields_id
            WHERE ptf.products_id=". (int) $products_id ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
            ORDER BY products_extra_fields_order");

  while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
        if (! $extra_fields['status'])  // show only enabled extra field
           continue;
        echo '<tr>
      <td>
      <table border="0" width="100%" cellspacing="0" cellpadding="2px"><tr>
      <td align="right" vallign="middle">';
        echo '<img src="http://www.woodleysnapshot.co.uk/catalog/images/' .$extra_fields['value'].'.jpg "></tr>
      </table>
      </td>
      </tr>'; 
  }
       // END: Extra Fields Contribution - mintpeel display fix
?> 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 02-11-2009, 10:31 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 2,681
Thanks: 12
Thanked 214 Times in 196 Posts
Rep Power: 20
jpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud of
Default Re: products with attributes. The url in the shopping cart breaks site.

First of all turn off SEO and in htacess. Try it out - maybe your contribs are doing this non-strandard.
__________________
JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
Try out our osCMax at: Live Catalog Demo
Limited access Admin: Live Admin Demo
Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 02-11-2009, 11:40 AM
New Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
galey1981 is on a distinguished road
Default Re: products with attributes. The url in the shopping cart breaks site.

Hey - i just gave that a go, but it did not work. It carried on doing the same thing.

So i can rule out the ultimate seo.... I also stripped out the extra fields code from product_info.php but the same error appeared. It's getting that from somewhere else then.

hmmmm........
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 02-11-2009, 09:35 PM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,722
Thanks: 139
Thanked 607 Times in 519 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: products with attributes. The url in the shopping cart breaks site.

Code:
?options={4}3{3}6
Those are normal and it is how osC keeps track of attributes in the url.

What is not normal is how your site is handling it, the mysql error. There is a problem in a query somewhere, most likely a mod you made.

See how it is supposed to work here:
osCMax v2.0 RC3.0.3 : Welcome to AABox.com's osCMax v2.0 - change this in /english/index.php

There are only 2 products, add one of each. One has attributes, one doesn't. Note the url for the one with attributes. Click away and all works fine.
__________________
Michael Sasek
osCMax Developer

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 02-11-2009, 11:09 PM
New Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
galey1981 is on a distinguished road
Default Re: products with attributes. The url in the shopping cart breaks site.

Thanks for the info - is it possible to localise key pages where the error could be stemming from so I can review the code inside of them?

I downloaded a loaded copy of oscommerce which already had a set of contribs on, all of which are v. useful. However this problem occured from the start.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 02-12-2009, 01:09 AM
New Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
galey1981 is on a distinguished road
Default Re: products with attributes. The url in the shopping cart breaks site.

I fixed it!!! I'm impressed with myself.

I did something that i probably should've done in the first instance. I copied the sql query and did a find of the catalog folder.

It popped up the includes/modules/products_extra_fields.php file and i went in there.

I found that the query on my product_info.php page was different. So i pasted this query over the top of what was in products_extra_fields.php

Before:

HTML Code:
$sql = "SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=".$HTTP_GET_VARS['products_id']." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."') ORDER BY products_extra_fields_order";
After:

HTML Code:
$sql = "SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=". (int) $products_id ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."') ORDER BY products_extra_fields_order";
It did not like the ptf.products_id as $HTTP_GET_VAR for some reason, and i replaced that with an int..... I don't understand the impact but know it now works.

I always hate when someone gets a fix but doesnt share. So I hope this helps someone who might have the same problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
The Following User Says Thank You to galey1981 For This Useful Post:
michael_s (02-12-2009)
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Attributes disappearing when quantity is updated in shopping cart. michael_s New osCommerce Contributions 2 11-15-2008 10:32 PM
Looking for a good shopping cart solution to use with Joomla site markw10 Introduce yourself! 4 06-14-2007 09:43 AM
How to put the product attributes box in the shopping cart? loba osCMax v1.7 Discussion 0 03-23-2005 09:59 PM
Losing products from shopping cart? angelbud osCommerce 2.2 Modification Help 3 05-18-2004 02:08 PM
2 products by page in shopping cart EPierre osCommerce 2.2 Installation Help 1 12-01-2002 08:57 AM


All times are GMT -8. The time now is 05:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax
Inactive Reminders By Icora Web Design