X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to let a product detailed page use different template? (https://forum.x-cart.com/showthread.php?t=71739)

Eyeglasses Expert 04-01-2015 11:26 AM

How to let a product detailed page use different template?
 
My new site www.glassespeople.com need 3 different templates for eyeglasses, sunglasses, and help.
because these 3 categories related products have3 different contents to display.

Say:
category Eyeglasses: need prescription form
category Sunglasses: no need prescription form
category Help: only need prodcut description function

totaltec 04-02-2015 05:00 AM

Re: How to let a product detailed page use different template?
 
The easiest way to handle these needs is to assign a custom variable to the product details page in admin. In your case you have a checkbox "this is a prescription product". If you uncheck it the prescription options go away.

In the case of your category "Help" the plan is to not have product pages, rather use categories and subcategories to display the content. If you need a specific product page template for your Help category, a new checkbox can easily be added to the product details page, and you can mark the product as help. Then we can take action in the templates based on this checkbox.

For example:
Code:

{if $product.help eq 'Y'}
  {include file="customer/main/help.tpl}
{else}
  {include file="customer/main/product.tpl}
{/if}


Eyeglasses Expert 04-02-2015 05:22 AM

Re: How to let a product detailed page use different template?
 
good idea, would you pls add this function for www.glassespeople.com ?
tks


All times are GMT -8. The time now is 02:18 PM.

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