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

Product Variants in Product Details Table (4.1.x)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-16-2007, 11:40 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default Product Variants in Product Details Table (4.1.x)

If anyone needs to display product variants to a customer (Available sizes, colors, etc.), then I have a small bit of code that will do just that.

It will also grab the {$v.class} which will display a title (Like color or size) and can easily be modified to your liking. It also has the smarty variable that doesn't display an item for the last array object (ie. a comma). There's an image screenshot of a sample I tested with 4.1.9. It should work with 4.1.x versions of X-Cart.

It will display multiple variables and display them for all available product variants (ie. 1. Colors and 2. Sizes).

In product.tpl, find the 'Product Details' table:
Code:
<tr><td colspan="2"><b><font class="ProductDetailsTitle">{$lng.lbl_details}</font></b></td></tr>
Then just add this as an additional row, modify etc.
Code:
{foreach from=$product_options item=v} <tr> <td width="120" align="left" valign="top" class="ProductPriceConverting">Available {$v.class}s:</td> <td valign="top"> {include file="modules/Product_Options/check_options.tpl"} {foreach from=$v.options item=o name=variants} {$o.option_name}{if $smarty.foreach.variants.last}&nbsp;{else},{/if} {/foreach} </td> </tr> {/foreach}

Let me know if it can be improved or how you modified it's use with additional functionality. You may need to remove my use of the word "Available <Class>s:" and can better title the variants using the v.class itself. This is just an easy way to say 'Available Colors:" and so forth.

- Mike
Attached Thumbnails
Click image for larger version

Name:	Variants_Table.gif
Views:	377
Size:	3.6 KB
ID:	648  
__________________
4.1.9
Reply With Quote
  #2  
Old 01-18-2008, 04:22 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Product Variants in Product Details Table (4.1.x)

Probably a wildshot but can you get this to run in the standard products listing in a category, possibly just under the short description?
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 04:16 PM.

   

 
X-Cart forums © 2001-2020