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

How can I change the "View Cart Template"

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-07-2006, 02:46 PM
 
smartoption smartoption is offline
 

Advanced Member
  
Join Date: Feb 2006
Location: York UK
Posts: 87
 

Default How can I change the "View Cart Template"

Hi All

Can anyone tell me what part to change to make the "view Cart" page smaller. It holds to much info I think. Ideally i would like it to display Product code, title and price, all on one line.

Any idea's

Thanks
__________________
X-Cart Gold - Version 4.0.18
Reply With Quote
  #2  
Old 03-09-2006, 11:57 AM
 
Inner Eye Inner Eye is offline
 

Member
  
Join Date: Jan 2005
Posts: 25
 

Default

Here's what I did in 4.0.9 (should work in 4.0.17 also, but haven't tried).
This will show only the cart details that you would normally see at the top of "checkout".



in customer/main/cart.tpl replace:

Code:
{if $products ne ""} <FORM action="cart.php" method="post" name="cartform"> <TABLE border="0" width="100%"> {section name=product loop=$products} {if $products[product].hidden eq ""} <TR><TD width="90" align="center" valign="top"> {if $active_modules.Special_Offers ne "" and $products[product].have_offers} {include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]} {else} {include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].image_x image_y=$products[product].image_y product=$products[product].product tmbn_url=$products[product].tmbn_url} {/if} </TD> <TD valign="top"> <FONT class="ProductTitle">{$products[product].product}</FONT> <TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD> {$products[product].descr} </TD></TR></TABLE> {if $products[product].product_options ne ""} {$lng.lbl_selected_options}: {include file="modules/Product_Options/display_options.tpl" options=$products[product].product_options} {/if} {assign var="price" value=$products[product].display_price} {if $active_modules.Product_Configurator ne "" and $products[product].product_type eq "C"} {include file="modules/Product_Configurator/pconf_customer_cart.tpl" main_product=$products[product]} {assign var="price" value=$products[product].pconf_display_price} {/if} <DIV align="left"> {if $active_modules.Subscriptions ne "" and $products[product].catalogprice and $products[product].product_type ne "C"} {include file="modules/Subscriptions/subscription_priceincart.tpl"} {else} {if $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/cart_price_special.tpl"} {/if} <FONT class="ProductPriceConverting">{include file="currency.tpl" value=$price} x {if $active_modules.Egoods and $products[product].distribution}1<INPUT type="hidden"{else}<INPUT type="text" size=3{/if} name="productindexes[{$products[product].cartid}]" value="{$products[product].amount}"> = </FONT><FONT class="ProductPrice">{math equation="price*amount" price=$price amount=$products[product].amount format="%.2f" assign=unformatted}{include file="currency.tpl" value=$unformatted}</FONT><FONT class="MarketPrice"> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$unformatted}</FONT> {if $config.Taxes.display_taxed_order_totals eq "Y" and $products[product].taxes} {include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes} {/if} {if $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/cart_free.tpl"} {/if} {/if} {include file="buttons/delete_item.tpl" href="cart.php?mode=delete&productindex=`$products[product].cartid`"} {if $products[product].product_options ne ''} {if $config.UA.platform eq 'MacPPC' && $config.UA.browser eq 'MSIE'} {include file="buttons/edit_product_options.tpl" href="javascript: window.open('popup_poptions.php?target=cart&id=`$products[product].cartid`','POptions','width=400,height=350,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" js_to_href="Y"} {else} {include file="buttons/edit_product_options.tpl" href="javascript: window.open('popup_poptions.php?target=cart&id=`$products[product].cartid`','POptions','width=400,height=350,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');"} {/if} {/if} </DIV> </TD></TR> <TR><TD colspan="2"><HR size="1" noshade></TD></TR> {/if} {/section} </TABLE> {if $active_modules.Gift_Certificates ne ""} {include file="modules/Gift_Certificates/gc_cart.tpl" giftcerts_data=$cart.giftcerts} {/if} {include file="customer/main/cart_totals.tpl"}

with:

Code:
{if $products ne ""} <FORM action="cart.php" method="POST" name="cartform"> {if $config.Appearance.show_cart_details eq "Y" or ($config.Appearance.show_cart_details eq "L" and $smarty.get.paymentid ne "" and $smarty.get.mode eq "checkout")} {include file="customer/main/cart_details.tpl"} {else} {include file="buttons/update.tpl" href="javascript: document.cartform.submit()" js_to_href="Y"} {include file="customer/main/cart_contents.tpl"} {/if} <HR noshade size="1"> {include file="customer/main/cart_totals.tpl"} {if $active_modules.Gift_Certificates ne ""} {include file="modules/Gift_Certificates/gc_cart.tpl" giftcerts_data=$cart.giftcerts} {/if}
__________________
Before you criticize someone, walk a mile in his shoes.
That way, if he gets angry, he\'ll be a mile away - and barefoot.

Version 4.0.9
Reply With Quote
  #3  
Old 03-09-2006, 12:10 PM
 
Inner Eye Inner Eye is offline
 

Member
  
Join Date: Jan 2005
Posts: 25
 

Default

For a cleaner cart details replace everything in customer/main/cart_details.tpl with the code below:

Code:
{* $Id: cart_details.tpl,v 1.12.2.1 2004/10/19 12:05:37 svowl Exp $ *} {assign var="colspan" value=6} <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <TR class="TableHead"> <TD align="center" width="55">{$lng.lbl_product}</TD> <TD width="35%">{$lng.lbl_description}</TH> {if $cart.display_cart_products_tax_rates eq "Y"} <TD align="center">{if $cart.product_tax_name ne ""}{$cart.product_tax_name}{else}{$lng.lbl_tax}{/if}</TD> {math equation="x+1" x=$colspan assign="colspan"} {/if} </TD> <TD align="right">{$lng.lbl_price}</TD> {if $cart.discount gt 0} <TD align="right">{$lng.lbl_discount}</TD> {math equation="x+1" x=$colspan assign="colspan"} {/if} {if $active_modules.Discount_Coupons ne "" and $cart.coupon} <TD align="right">{$lng.lbl_discount_coupon}</TD> {math equation="x+1" x=$colspan assign="colspan"} {/if} {if $cart.discounted_subtotal ne $cart.subtotal} <TD align="right">{$lng.lbl_discounted_price}</TD> {math equation="x+1" x=$colspan assign="colspan"} {/if} <TD align="center">{$lng.lbl_quantity}</TD> <TD align="right">{$lng.lbl_subtotal}</TD> </TR> {assign var="products" value=$cart.products} {assign var="summary_price" value=0} {assign var="summary_discount" value=0} {if $active_modules.Discount_Coupons ne ""} {assign var="summary_coupon_discount" value=0} {/if} {assign var="summary_discounted_price" value=0} {assign var="summary_subtotal" value=0} {section name=prod_num loop=$products} {if $products[prod_num].deleted eq ""} {assign var="have_products" value="Y"} {math equation="x+y*z" x=$summary_price y=$products[prod_num].display_price z=$products[prod_num].amount assign="summary_price"} {math equation="x+y*z" x=$summary_discount y=$products[prod_num].discount z=$products[prod_num].amount assign="summary_discount"} {if $active_modules.Discount_Coupons ne "" and $products[prod_num].coupon_discount} {math equation="x+y*z" x=$summary_coupon_discount y=$products[prod_num].coupon_discount z=$products[prod_num].amount assign="summary_coupon_discount"} {/if} {math equation="x+y*z" x=$summary_discounted_price y=$products[prod_num].display_discounted_price z=$products[prod_num].amount assign="summary_discounted_price"} {math equation="x+y" x=$summary_subtotal y=$products[prod_num].display_subtotal assign="summary_subtotal"} <TR{if $bg eq ""}{assign var="bg" value="1"} bgcolor="#FFFFFF"{else}{assign var="bg" value=""} bgcolor="#EEEEEE"{/if}> <TD align="center"><a href="product.php?productid={$products[prod_num].productid}"> {include file="product_thumbnail.tpl" productid=$products[prod_num].productid image_x=55 product=$products[product].product tmbn_url=$products[product].tmbn_url}</A></TD> <TD> <Table border="0" cellspacing="0" cellpadding="0"> <tr> <td><A href="product.php?productid={$products[prod_num].productid}" title="{$products[prod_num].product|escape:"html"}{if $products[prod_num].product_options}: {include file="modules/Product_Options/display_options.tpl" options=$products[prod_num].product_options is_plain='Y'}{/if}"> {if $products[prod_num].productcode}{*{$products[prod_num].productcode}{else}#{$products[prod_num].productid}*}{/if}{$products[prod_num].product|truncate:"30":"...":true}</A> </td> </tr> <tr> <td> <TABLE> {foreach from=$products[prod_num].product_options item=v} <TR> <TD>{$v.class}:</TD> <TD>{$v.option_name}{/foreach} {if $products[prod_num].hidden eq ""} {if $products[prod_num].product_options ne ''} {if $config.UA.platform eq 'MacPPC' && $config.UA.browser eq 'MSIE'} {include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/popup_poptions.php?target=cart&id=`$products[prod_num].cartid`','POptions','width=250,height=200,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" js_to_href="Y"} {else} {include file="buttons/edit_product_options.tpl" href="javascript:window.open('`$catalogs.customer`/popup_poptions.php?target=cart&id=`$products[prod_num].cartid`','POptions','width=250,height=200,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');"} {/if} {/if} {/if} </TD> </TR> </TABLE> </td> </tr> </table> </TD> {if $cart.display_cart_products_tax_rates eq "Y"} <TD align="center"> {foreach from=$products[prod_num].taxes key=tax_name item=tax} {if $tax.tax_value gt 0} {if $cart.product_tax_name eq ""}<NOBR>{$tax.tax_display_name}</NOBR> {/if} {if $tax.rate_type eq "%"}{$tax.rate_value}%{else}{include file="currency.tpl" value=$tax.rate_value}{/if} {/if} {/foreach} </TD> {/if} <TD align="right" nowrap>{include file="currency.tpl" value=$products[prod_num].display_price}</TD> {if $cart.discount gt 0} <TD align="right" nowrap>-{include file="currency.tpl" value=$products[prod_num].discount}</TD> {/if} {if $active_modules.Discount_Coupons ne "" and $cart.coupon} <TD align="right" nowrap>-{include file="currency.tpl" value=$products[prod_num].coupon_discount}</TD> {/if} {if $cart.discounted_subtotal ne $cart.subtotal} <TD align="right" nowrap>{include file="currency.tpl" value=$products[prod_num].display_discounted_price}</TD> {/if} <TD align="center">{if $products[prod_num].hidden or $config.Appearance.allow_update_quantity_in_cart eq "N" or ($active_modules.Egoods and $products[prod_num].distribution) or ($active_modules.Subscriptions and $products[prod_num].sub_plan)}{$products[prod_num].amount}{else}<INPUT type="text" size="3" name="productindexes[{$products[prod_num].cartid}]" value="{$products[prod_num].amount}">{/if} {include file="buttons/update_no_img.tpl" href="javascript: document.cartform.submit()" js_to_href="Y"}</TD> <TD align="right" nowrap>{include file="currency.tpl" value=$products[prod_num].display_subtotal}</TD> </TR> {/if} {/section} {if $cart.products and $have_products eq "Y"} <TR class="TableHead"> <TH align="left"></TH> {if $cart.display_cart_products_tax_rates eq "Y"} <TD> </TD> {/if} <TD align="right">{$lng.lbl_summary}:</TD> <TD align="right" nowrap>{include file="currency.tpl" value=$summary_price}</TD> {if $cart.discount gt 0} <TD align="right" nowrap>-{include file="currency.tpl" value=$summary_discount}</TD> {/if} {if $active_modules.Discount_Coupons ne "" and $cart.coupon} <TD align="right" nowrap>-{include file="currency.tpl" value=$summary_coupon_discount}</TD> {/if} {if $cart.discounted_subtotal ne $cart.subtotal} <TD align="right" nowrap>{include file="currency.tpl" value=$summary_discounted_price}</TD> {/if} <TD align="center">{*{include file="buttons/update.tpl" href="javascript: document.cartform.submit()" js_to_href="Y"}*}</TD> <TD align="right" nowrap>{include file="currency.tpl value=$summary_subtotal}</TD> </TR> {/if} {if $active_modules.Gift_Certificates ne "" and $cart.giftcerts} {include file="modules/Gift_Certificates/gc_cart_details.tpl"} {/if} </TABLE>
__________________
Before you criticize someone, walk a mile in his shoes.
That way, if he gets angry, he\'ll be a mile away - and barefoot.

Version 4.0.9
Reply With Quote
  #4  
Old 03-09-2006, 12:36 PM
 
smartoption smartoption is offline
 

Advanced Member
  
Join Date: Feb 2006
Location: York UK
Posts: 87
 

Default

This is great, Got the first part working and its just what i am looking for, could'nt get the second one working but thats not a prob, it was really the first part that i was looking for.

Many thanks for your help.

James
__________________
X-Cart Gold - Version 4.0.18
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 07:40 AM.

   

 
X-Cart forums © 2001-2020