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)
-   -   If/else on specific product page (https://forum.x-cart.com/showthread.php?t=72906)

mcpilot 10-11-2015 05:19 AM

If/else on specific product page
 
This should be a simple task but it doesn't appear to be based on the work I have done thus far;

When displaying a category, I want to be able to designate whether the product comes in rolls or cartons. On the products_list.tpl, I can easily do this with {if $cat eq 183} ROLLS {else} CARTONS {/if}

However, once the user clicks on the specific PRODUCT, I seem to lose the ability to control this. The "If Category" no longer works, because X-Cart is not carrying over the category in the URL, it's just the product now.

How can I then, continue to get the rolls v. cartons to display on product_details.tpl using the same "If Cat" code? I can't break it down per product, there are too many.

Thanks you in advance,

Pat

cflsystems 10-11-2015 05:55 AM

Re: If/else on specific product page
 
$product array hold the categoryid for the product. Note that this is the category id for the main category the product is assigned to.

{if $product.categoryid eq 183}.....


All times are GMT -8. The time now is 01:26 AM.

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