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)
-   -   Custom Template for Single Category [Paying $$ TO COMPLETE] (https://forum.x-cart.com/showthread.php?t=928)

anoack 12-11-2002 10:01 AM

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?

funkydunk 12-11-2002 01:20 PM

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}

anoack 12-11-2002 01:31 PM

AWESOME DUDE! I figured it would be something like that I was not sure. I will give that a try.

anoack 12-11-2002 01:43 PM

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?

funkydunk 12-11-2002 01:48 PM

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.

funkydunk 12-11-2002 01:49 PM

sorry - forgot to say that you should change the 8 for the category number that you want to put a special rule in for.

anoack 12-11-2002 01:54 PM

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 #

funkydunk 12-11-2002 10:56 PM

did you put the {/if} at the end?

anoack 12-12-2002 11:15 AM

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.

anoack 12-12-2002 12:09 PM

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.


All times are GMT -8. The time now is 07:34 PM.

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