View Single Post
  #2  
Old 09-04-2012, 09:33 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Adding Buy Now & Wishlist Buttons - Main Prod Template

X-cart 4.2.2
/customer/main/products_t.tpl
PHP Code:
{*
$Idproducts_t.tpl,v 1.46 2008/12/10 08:29:52 max Exp $
vimset ts=2 sw=2 sts=2 et:
*}
{
list2matrix assign="products_matrix" assign_width="cell_width" list=$products row_length=$config.Appearance.products_per_row}
{
assign var="is_matrix_view" value=true}
{if 
$products_matrix}
  <
table cellspacing="0" class="products products-table width-100" summary="{$lng.lbl_products_list|escape}">
    {foreach 
from=$products_matrix item=row name=products_matrix}
      <
tr{if !$smarty.foreach.products_matrix.first} class="products-row"{/if}>
        {foreach 
from=$row item=product}
          {if 
$product}
            <
td class="product-cell" style="width: {$cell_width}%;">
              <
a href="product.php?productid={$product.productid}&cat={$cat}&page={$navigation_page}class="product-title">{$product.product|escape}</a>
              {if 
$config.Appearance.display_productcode_in_list eq "Y" && $product.productcode}
                <
div class="sku">{$lng.lbl_sku}: {$product.productcode|escape}</div>
              {/if}
            </
td>
          {/if}
        {/foreach}
      </
tr>
      <
tr>
        {foreach 
from=$row item=product}
          {if 
$product}
            <
td class="product-cell">
              <
div class="image">
                <
a href="product.php?productid={$product.productid}&cat={$cat}&page={$navigation_page}">{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url}</a>
                {if 
$active_modules.Special_Offers && $product.have_offers}
                  {include 
file="modules/Special_Offers/customer/product_offer_thumb.tpl"}
                {/if}
              </
div>
            </
td>
          {/if}
        {/foreach}
      </
tr>
      <
tr>
        {foreach 
from=$row item=product}
          {if 
$product}
            <
td class="product-cell">
                <
a href="product.php?productid={$product.productid}&cat={$cat}&page={$navigation_page}class="see-details">{$lng.lbl_see_details}</a>
              {if 
$active_modules.Feature_Comparison && $product.fclassid gt 0}
                <
div align="center">{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$product.productid}</div>
              {/if}
            </
td>
          {/if}
        {/foreach}
      </
tr>
      <
tr>
        {foreach 
from=$row item=product}
          {if 
$product}
            <
td class="product-cell product-cell-price">
              {if 
$product.product_type ne "C"}
                {if 
$active_modules.Subscriptions ne "" && $product.catalogprice}
                  {include 
file="modules/Subscriptions/subscription_info_inlist.tpl"}
                {elseif 
$product.appearance.is_auction}
                  <
span class="price">{$lng.lbl_enter_your_price}</span><br />
                  {
$lng.lbl_enter_your_price_note}
                {else}
                  {if 
$product.appearance.has_price}
                    <
div class="price-row">
                      <
span class="price">{$lng.lbl_our_price}:</span> <span class="price-value">{include file="currency.tpl" value=$product.taxed_price}</span>
                      <
span class="market-price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</span>
                    </
div>
                    {if 
$product.appearance.has_market_price && $product.appearance.market_price_discount gt 0}
                      <
div class="market-price">
                        {
$lng.lbl_market_price}: <span class="market-price-value">{include file="currency.tpl" value=$product.list_price}</span>
                        {if 
$product.appearance.market_price_discount gt 0}
                          {if 
$config.General.alter_currency_symbol ne ""}, {/if}
                          <
class="price-save">{$product.appearance.market_price_discount}% {$lng.lbl_save_price}</p>
                        {/if}
                      </
div>
                    {/if}
                    {if 
$product.taxes}
                      <
div class="taxes">{include file="customer/main/taxed_price.tpl" taxes=$product.taxes is_subtax=true}</div>
                    {/if}
                  {/if}
                  {if 
$active_modules.Special_Offers && $product.use_special_price}
                    {include 
file="modules/Special_Offers/customer/product_special_price.tpl"}
                  {/if}
                {/if}
              {else}
 
              {/if}
            </
td>
          {/if}
        {/foreach}
      </
tr>
      <
tr>
        {foreach 
from=$row item=product}
          {if 
$product}
            <
td class="product-cell product-cell-buynow">
                {if 
$config.Appearance.buynow_button_enabled eq "Y"}
                  {include 
file="customer/main/buy_now.tpl"}
                {else}
 
                {/if}
            </
td>
          {/if}
        {/foreach}
      </
tr>
    {/foreach}
  </
table>
{/if} 
The important bit is :
{include file="customer/main/buy_now.tpl"}
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote