Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Product options on products.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #21  
Old 07-02-2003, 09:39 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Any thoughts anybody? This is important for me. Thanks.
Reply With Quote
  #22  
Old 07-02-2003, 01:22 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default

Did you modify the template as well? You need to modify both the PHP source code and the template code to display the options properly.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #23  
Old 07-02-2003, 02:04 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Yes I modified both, and it works well for the category listings. However it doesnt' work for featured products.
Reply With Quote
  #24  
Old 06-23-2005, 09:15 PM
 
Joe Schwartz Joe Schwartz is offline
 

Newbie
  
Join Date: Mar 2005
Location: New York City
Posts: 7
 

Default SQL error in version 4.0.12

I've tried to adapt this code for my 4.0.12 x-cart store, but keep getting this error:

Quote:
SELECT * from WHERE productid='13' Error code : 1064 Description : You have an error in your SQL syntax near 'WHERE productid='13'' at line 1

The error occurs with any product (any productid) regardless of whether or not it has product options. I'm pretty sure the error is in the products.php file in this section:

Code:
// first we build a query to get all the product options with a single query $query="SELECT * from $sql_tbl[product_options] WHERE "; foreach($products as $key=>$value){ $query.="productid='$value[productid]' "; if($i < $productcount-1){ $query.="OR "; } $i++; }

I know this is an old thread, but if anyone has adapted this code for 4.x.x of x-cart, I'd be grateful for any insight.

Many thanks,

Joe
__________________
Version 4.0.14
Unix server
www.happyhappyhappy.com (live)
Reply With Quote
  #25  
Old 06-24-2005, 09:36 AM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default

It looks like you have no value for $sql_tbl[product_options]. Make sure this is defined properly. They may have changed the name of the table in the newer version of x-cart, so just go into your config file or look at your xcart database and make sure you are usnig the correct key name in your $sql_tbl array to specify the product_options table.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #26  
Old 06-24-2005, 04:30 PM
 
Joe Schwartz Joe Schwartz is offline
 

Newbie
  
Join Date: Mar 2005
Location: New York City
Posts: 7
 

Default SQL Error gone, but options still not shown on products.tpl

minorgod,

Thanks so much. You were right on the money that the SQL values were not properly defined. I went into config.php and added:

Code:
"product_options" => "xcart_product_options_ex", "product_options_js" => "xcart_product_options_js",

to the SQL Table aliases (there is also "xcart_product_options_lng" which I have not figured out yet how it works with "xcart_product_options_ex").

I noticed that in the SQL table for xcart_product_options_ex there was no productid field and that now it was called optionid. As such I edited your mod in products.php to reflect this:

Code:
$query="SELECT * from $sql_tbl[product_options] WHERE "; foreach($products as $key=>$value){ $query.="optionid='$value[productid]' "; if($i < $productcount-1){ $query.="OR "; } $i++; }

This removed the SQL errors, however the products.tpl does not display the product options. In fact, the product pages display as if no changes have been made. Obviously I am missing something (not surprising as I feel I am in over my head with this mod). Any suggestions on where to look next would be most appreciated.

Joe
__________________
Version 4.0.14
Unix server
www.happyhappyhappy.com (live)
Reply With Quote
  #27  
Old 10-11-2005, 07:06 AM
 
dgreen dgreen is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 85
 

Default product options on products page

Did you ever get this figured out for 4.0.x?

I am looking for a solution
__________________
X-Cart version 4.1.10
upgraded from 4.0.13 myself slowly and with help from xcart forums. Thanks all!

http://www.discountseforim.com
Hebrew Seforim and Jewish Books
Reply With Quote
  #28  
Old 10-11-2005, 07:21 AM
 
Joe Schwartz Joe Schwartz is offline
 

Newbie
  
Join Date: Mar 2005
Location: New York City
Posts: 7
 

Default Re: product options on products page

Quote:
Originally Posted by dgreen
Did you ever get this figured out for 4.0.x?

I am looking for a solution

I never did find a solution for this. As I needed this for only a couple of products, I ended up making a workaround in which I formatted my product.tpl to resemble my products.tpl and then linked directly via the Categories list to individual products.

Joe
__________________
Version 4.0.14
Unix server
www.happyhappyhappy.com (live)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:40 AM.

   

 
X-Cart forums © 2001-2020