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

cart_details.tpl -- can I insert a variant in cart display?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-27-2006, 06:25 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default cart_details.tpl -- can I insert a variant in cart display?

Dear Brain Trust:

In /skin1/customer/main/cart_details.tpl (the page that has the final listing of items before checkout) -
immediately after {$products[prod_num].product|truncate:"40":"...":true}:
Code:
<A href="product.php?productid={$products[prod_num].productid}" title="{$products[prod_num].product|escape:"html"}{if $products[prod_num].product_options}: {capture name=po}{include file="modules/Product_Options/display_options.tpl" options=$products[prod_num].product_options is_plain='Y'}{/capture}{$smarty.capture.po|escape}{/if}"> {* BEGIN COMMENT OUT SKU DISPLAY AT CHECKOUT *} {* {if $products[prod_num].productcode}{$products[prod_num].productcode}{else}#{$products[prod_num].productid}{/if}. *} {* END COMMENT OUT SKU DISPLAY AT CHECKOUT *} {$products[prod_num].product|truncate:"40":"...":true} </A></TD>
I want to insert the "variant" color option -- like this mockup:
[image removed]

I thought the code that I used on cart.tpl to display the color variant:
Code:
{if $products[product].product_options ne ""} {include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options} {/if}
Would work here -- but nothing displays. Yes, I put it in the same <td> as the product...

Anyone have an idea here? Doesn't everyone want to list the color variant of the item in their final shopping cart? has anyone done this?

Thanks,

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #2  
Old 07-27-2006, 07:57 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default

Look a few lines above where you want to insert the options to see how its done. The array index is [prod_num] instead of [product].
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #3  
Old 07-27-2006, 08:18 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default

Quote:
Originally Posted by geckoday
The array index is [prod_num] instead of [product].
Ralph -- you're the best! Thanks again!
This is exactly what I was trying to do (and it really should be stock, don't you agree? What customer would not want to see the color and/or size variant of the item they are buying?

NOW -- can I ask HOW did you find out all the array index fields? Is there a master directory of what x-cart is keeping track of?

Can you point me somewhere so that I can learn more about what is under the hood?

Thanks for being here and contributing...

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #4  
Old 07-28-2006, 05:46 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default

Quote:
Originally Posted by carpeperdiem
This is exactly what I was trying to do (and it really should be stock, don't you agree? What customer would not want to see the color and/or size variant of the item they are buying?
Yes, it should be stock.

Quote:
NOW -- can I ask HOW did you find out all the array index fields?
In this case it was easy. You posted it in your original post. Look at the second, third and fourth lines of the original X-Cart code you posted. For some strange reason X-Cart puts the options in the link title but doesn't display them.

Quote:
Is there a master directory of what x-cart is keeping track of?

Can you point me somewhere so that I can learn more about what is under the hood?
There is no directory. But you can add this to the top of any template to see what variables are available:
Code:
{php}func_print_r($this->_tpl_vars);{/php}
I wish there was a good reference to what's under the hood but I don't know of any. Its usually a lot of grunt work chasing code to find out how something works and where to put changes.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
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 06:04 AM.

   

 
X-Cart forums © 2001-2020