X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   need help adding buttons to templates (https://forum.x-cart.com/showthread.php?t=2653)

thundernugs 05-11-2003 05:46 PM

need help adding buttons to templates
 
hi all,
wonderful forum we have here. would love some help on the following....

i am trying to put an add to cart button so a customer can add an item to cart without clicking on the "see details" to get the detailed description first. i'm not sure which template should be edited, nor what code should be inserted to accomplish this. anyone...anyone......?

i am also trying to move the update button on the customer/main/cart.tpl

where it says delete item go, i'd like to have the update button in its place, moving the delete button over to the right. it doesn't make sense to me to have the update button at the bottom of the box instead of right underneath the text box you are updating.

these don't seem to be terribly difficult mods, and i've searched the forums to no avail. any help is greatly appreciated!

i am on version 3.3.5

anyone....bueller....?

shan 05-12-2003 01:41 AM

heres the products.tpl with the add to cart etc. i usually make my own buttons for this so you may want to do the same. Just make new template files and drop them in the buttons folder

Code:

{* $Id: products.tpl,v 1.21.2.2 2003/03/11 10:49:14 svowl Exp $ *}
{section name=product loop=$products}
<table border=0 width=100% cellpadding="5" cellspacing="0">
  <tr>
    <td width=90 align=center valign=top> <a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include
      file="product_thumbnail.tpl" productid=$products[product].productid image_x=70
      product=$products[product].product}</a></td>
    <td valign=top>
 {$products[product].product}</font>
      <font size=1>

     

      {$products[product].descr|truncate:300:"...":true}

      </font>
      <hr size=1 noshade align=left>
      {if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
      {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else}
      {if $products[product].price ne 0} {if $products[product].discount ne 0}
      <font class=MarketPrice>{$lng.lbl_market_price}: <s> {math equation="price/(1-(discount/100))"
      price=$products[product].price discount=$products[product].discount format="%d.00"
      assign=unformatted}{include file="currency.tpl" value=$unformatted} </s></font>

      {/if} <font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl"
      value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl"
      alter_currency_value=$products[product].price}</font>{if $products[product].discount
      ne 0}, save {$products[product].discount}%{/if}{if $config.General.use_vat
      eq "Y"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if} {else}
      <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if} {/if}
    </td>
  </tr>
  <tr>
    <td width=90 align=center valign=top></td>
    <td valign=top>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="left" width="50%"><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="buttons/details.tpl"}</a></td>
          <form name=orderform_{%product.index%} method=post action="cart.php?mode=add">
            <td align="left" width="50%"> <a href="javascript: document.orderform_{%product.index%}.submit()">
              {include file="buttons/add_to_cart.tpl"}</a>
              <input type=hidden name=amount value=1>
<input type=hidden name=mode value=add>
<input type=hidden name=productid value="{$products[product].productid}">
<input type=hidden name=cat value="{$smarty.get.cat}">
<input type=hidden name=page value="{$smarty.get.page}">


</td></form>
  </tr>
</table>
</td>
  </tr>
</table>






{/section}



heres my modified cart.tpl with update / delete / go back / checkout etc

Code:

{* $Id: cart.tpl,v 1.45.2.1 2003/01/20 12:57:59 svowl Exp $ *}
{include file="location.tpl" last_location=$lng.lbl_your_shopping_cart}
<h3>{$lng.lbl_your_shopping_cart}</h3>
{$lng.txt_cart_header}
{if $active_modules.Gift_Certificates ne ""}
{$lng.txt_cart_note}
{/if}



{capture name=dialog}



{if $products ne ""}
<form action="cart.php" method=post name=cartform>
  <table border=0 width=100% cellpadding="0" cellspacing="5">
    {section name=product loop=$products}
    <tr>
      <td width=100 valign=top> <a href="product.php?productid={$products[product].productid}">{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}</a>
      </td>
      <td valign=top> <font class=ProductTitle>{$products[product].product|escape}</font>
       

 {$products[product].descr|truncate:150:"...":true}

         

          {if $products[product].product_options ne ""} {$lng.lbl_selected_options}:

          {$products[product].product_options|replace:"\n":"

          \n"}

         

          {/if}
        <div align=left> {if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
          {include file="modules/Subscriptions/subscription_priceincart.tpl"}
          {else} <font class=ProductPriceConverting>{include file="currency.tpl"
          value=$products[product].price} x
          <input type=text size=3 name="productindexes[{$smarty.section.product.index}]" value="{$products[product].amount}">
          = </font><font class=ProductPrice>{math equation="price*amount" price=$products[product].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.General.use_vat eq "Y"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if}
          {/if}

         

    </div>
      </td>
    </tr>
    <tr>
      <td width=100 valign=top></td>
      <td valign=top>
        <table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td width="50%"><a href="cart.php?mode=delete&productindex={$smarty.section.product.index}">{include
              file="buttons/delete_item.tpl"}</a> </td>
            <td width="50%"><a href="javascript: document.cartform.submit()">{include
              file="buttons/update.tpl"}</a> </td>
          </tr>
        </table>
      </td>
    </tr>
    {/section}
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td>
        <hr size=1 noshade>
      </td>
    </tr>
  </table>
  {if $active_modules.Gift_Certificates ne ""} {include file="modules/Gift_Certificates/gc_cart.tpl"}
  {/if}
  <div align=right>
{include file="customer/main/cart_totals.tpl"}
</div>
  <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td>
        <hr size=1 noshade>
      </td>
    </tr>
  </table>
  <table width="100%" border="0" cellspacing="5" cellpadding="0">
    <tr>
      <td width="100"></td>
      <td>{include file="buttons/go_back.tpl"}
      </td>
      <td>{include file="buttons/checkout.tpl"}
        </td>
    </tr>
  </table>
</form>
{else}
{$lng.txt_your_shopping_cart_is_empty}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_items content=$smarty.capture.dialog extra="width=100%"}
{if $cart.coupon_discount eq 0 and $products ne ""}



{if $active_modules.Discount_Coupons ne ""}
{include file="modules/Discount_Coupons/add_coupon.tpl}
{/if}
{/if}


be sure to back things up first just in case

thundernugs 05-12-2003 05:00 PM

ah, beautiful.

thanks!!

:D


All times are GMT -8. The time now is 10:32 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.