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

adding a button to detailed description box

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-11-2009, 08:49 AM
 
fotodog13 fotodog13 is offline
 

Senior Member
  
Join Date: Sep 2007
Posts: 126
 

Default adding a button to detailed description box

How to place a button in your product description.tpl
that will only show up on the category pages you have indicated by the category POS in the admin section.

In this case the button I have created pulls to an embedded help page that I have created.

First in the product.php find this line of code

( it is near the top, just after #
# Put all product info into $product array
# )


$main = "product";
$smarty->assign("main",$main);

right after that ad this

$cat_order_by = func_query_first_cell("select order_by from $sql_tbl[categories] where categoryid = '$cat'");
$smarty->assign("cat_order_by",$cat_order_by);


$order_by = func_query_hash("SELECT order_by FROM xcart_categories");
$smarty->assign("order_by", $order_by);

save and close this file

Next open the
skin1/customer/main/product.tpl


and add this statement

{if $cat_order_by gt 4 and $cat_order_by lt 41}
{include file="buttons/sizing_help.tpl"}{/if}

*IMPORTANT NOTE- THE #-S 4 AND 41 NEED TO BE CHANGED TO THE PAGES THAT YOU HAVE SET IN YOUR CATEGORY /ADMIN

In this example all the detailed product description pages that are positioned between page #4-41 will have a button I have made that is indicated by the
{include file=button/sizing_help.tpl}

The sizing_help.tpl that I have placed in the buttons directory is a button that links in this example to a page that helps the customer to determine the correct size product for them.

When the person clicks the link they are taken to the sizing help page that is built, and I have included a back1 button on this page so that if clicked the person goes right back to the product page they were on.

I made a new .tpl here and entered the button details and link information here.


I hope this mod helps someone out there it works great so far ( 1/8/09 -in Xcart version 4.1.2 ) I have seen others that use a pop-up but my thinking is that this works without the customer having to enable pop ups .

I wish I could say I figured this out myself but boy that would be a big fat lie.
In no particular order many thanks to the following for helping me figure this out


Ashely
Jon (CDSE pro)
gb2world
Vetrivel


Hope this is a help
Best

Scott V
fotodog13
__________________
scott v
x cart version 4.1.8 (Unix)
Reply With Quote

The following 2 users thank fotodog13 for this useful post:
Bouma (02-27-2009), SCUBA1609 (07-05-2009)
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 05:52 PM.

   

 
X-Cart forums © 2001-2020