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

Custom Template for Single Category [Paying $$ TO COMPLETE]

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-11-2002, 10:01 AM
  anoack's Avatar 
anoack anoack is offline
 

Senior Member
  
Join Date: Dec 2002
Location: Austin, TX
Posts: 113
 

Default Custom Template for Single Category [Paying $$ TO COMPLETE]

Okay, I want this page: http://www.headsetinnovations.com/cart/customer/home.php?cat=248

To look like this one:
http://www.headsetinnovations.com/?page=tops

But, I want to leave all the other ones the same. Would it be possible for me to just make the change for that one page?
Reply With Quote
  #2  
Old 12-11-2002, 01:20 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

in the products.tpl template you will need to put in a conditional such as

{if $categories[cat_num].categoryid eq 8}
put your new code in here - there is code elsewhere on this forum for multiple products per row

{else}
existing layout
{/if}
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 12-11-2002, 01:31 PM
  anoack's Avatar 
anoack anoack is offline
 

Senior Member
  
Join Date: Dec 2002
Location: Austin, TX
Posts: 113
 

Default

AWESOME DUDE! I figured it would be something like that I was not sure. I will give that a try.
Reply With Quote
  #4  
Old 12-11-2002, 01:43 PM
  anoack's Avatar 
anoack anoack is offline
 

Senior Member
  
Join Date: Dec 2002
Location: Austin, TX
Posts: 113
 

Default

This is what I have:
//
{if $categories[248].categoryid eq 8}
put your new code in here - there is code elsewhere on this forum for multiple products per row
{else}
//

This is what I get
Parse error: parse error, unexpected $ in /home/www/headsetinnovations/cart/templates_c/103/1035601712/0.php on line 145

This is the URL of the custom page I want:
http://www.headsetinnovations.com/cart/customer/home.php?cat=248

Now, How would I exacly do this?
Reply With Quote
  #5  
Old 12-11-2002, 01:48 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

dont put the 248 in there just leave as is and it will work fine. It is telling smarty to look in the array for the cat_num.
__________________
ex x-cart guru
Reply With Quote
  #6  
Old 12-11-2002, 01:49 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

sorry - forgot to say that you should change the 8 for the category number that you want to put a special rule in for.
__________________
ex x-cart guru
Reply With Quote
  #7  
Old 12-11-2002, 01:54 PM
  anoack's Avatar 
anoack anoack is offline
 

Senior Member
  
Join Date: Dec 2002
Location: Austin, TX
Posts: 113
 

Default

Okay, I changed my products.tmpl and this is what I get

Quote:
Headset Tops

Headset Tops
Starset
2 products
Mirage

Supra Monaural

Supra Binaural

Tristar

Encore Monaural

Encore Binaural

Duoset Convertible

Duopro
4 categories


--------------------------------------------------------------------------------

Parse error: parse error, unexpected T_ENDFOR in /home/www/headsetinnovations/cart/templates_c/N13/N1366895660/0.php on line 96

Still getting an error and its at the bottom of the page. I am trying to replace that entire page with a custom look accoring to the cat #
Reply With Quote
  #8  
Old 12-11-2002, 10:56 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

did you put the {/if} at the end?
__________________
ex x-cart guru
Reply With Quote
  #9  
Old 12-12-2002, 11:15 AM
  anoack's Avatar 
anoack anoack is offline
 

Senior Member
  
Join Date: Dec 2002
Location: Austin, TX
Posts: 113
 

Default

Wouldn't I have to modify subcategories.tpl?
Heres my code for subcategories.tpl:

Code:
{* $Id: subcategories.tpl,v 1.21.2.3 2002/11/11 14:04:39 andrew Exp $ *} {if $categories[cat_num].categoryid eq 248} MYCODEHERE {else} {/if} {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"} {include file="modules/Bestsellers/bestsellers.tpl"} {/if} { include file="customer/main/navigation.tpl" } {if ($page eq "")||($page eq "1")}{$current_category.description|regex_replace:"/[\n]/":" "} {/if} {capture name=dialog} {if $enable_subcategories_count} {assign var="tmp" value="0"} {section name=cat_num loop=$subcategories} {if $subcategories[cat_num].product_count or $subcategories[cat_num].subcategory_count} {assign var="tmp" value="1"} {/if} {/section} {else} {assign var="tmp" value="1"} {/if} {section name=cat_num loop=$subcategories} { if %cat_num.first% } {if $tmp} [img]../icon.php?categoryid={$cat}[/img] {/if} <table border=0 cellspacing=5> {/if} {*if $subcategories[cat_num].product_count or $subcategories[cat_num].subcategory_count*} <tr><td align=left nowrap width=95%> <font class="ItemsList">{ $subcategories[cat_num].category|escape }</font> </td> <td align=right nowrap><font class=Text> {if $subcategories[cat_num].product_count} { $subcategories[cat_num].product_count } {$lng.lbl_products} {elseif $subcategories[cat_num].subcategory_count} { $subcategories[cat_num].subcategory_count } {$lng.lbl_categories|lower} {/if} </font></td> </tr> {*/if*} { if %cat_num.last% } </table> {/if} {/section} {if $tmp and $products ne ""} <br clear=_all><hr size=1 noshade> {/if} {include file="customer/main/products.tpl" products=$products} {if $products eq "" and $tmp eq "0"} {$lng.txt_no_products_in_cat} {/if} {/capture} {include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"} {if $products eq ""} {if $f_products ne ""} {include file="customer/main/featured.tpl"} {/if} {/if} { include file="customer/main/navigation.tpl" }

My code for products.tpl:
Code:
{* $Id: products.tpl,v 1.16.2.2 2002/11/13 07:17:50 alfiya Exp $ *} {section name=product loop=$products} <table border=0 width=100%> <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} { $lng.lbl_see_details }</a> </td> <td valign=top> {$products[product].product|escape}</font> <font class=TableCenterProductTitleOrange></font> <font size=1> {$products[product].descr|truncate:300:"...":true} </font> <hr size=1 noshade width=230 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=TableCenterProductTitleOrange>{$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} {else} <font class=TableCenterProductTitleOrange>{$lng.lbl_enter_your_price}</font> {/if} {/if} </td></tr> </table> {/section}

What exacly needs to be changed here? I made the changed to the subcat file and nothing is happening.
Reply With Quote
  #10  
Old 12-12-2002, 12:09 PM
  anoack's Avatar 
anoack anoack is offline
 

Senior Member
  
Join Date: Dec 2002
Location: Austin, TX
Posts: 113
 

Default

Also, if anyone works with me and I get this working the way it needs I will paypal $50.00 Dollars to the person.
More if it gets competed within 3 hours.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:36 AM.

   

 
X-Cart forums © 2001-2020