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)
-   -   "Contact to order" for just one category (https://forum.x-cart.com/showthread.php?t=56724)

jadefrolics 11-24-2010 08:51 PM

"Contact to order" for just one category
 
I have a site where all categories are totally normal except for one category where I want customers to contact me directly if they are interested in purchasing, rather than being able to add it to the cart and checkout. However, I want to show the price still.

I tried to use an if statement I found in another thread, but it doesn't seem to work on the product_details.tpl or perhaps it's only for older x-cart versions.

This is what I have...

Code:

       
{if $cat eq "251"}
My alternate code here
{else}
{include file="customer/buttons/add_to_cart.tpl" type="input" additional_button_class="main-button"}
{/if}


But it doesn't do anything. Could someone tell me the proper way for hiding Add To Cart button for one category only on the product_details.tpl?

If I just comment it out it gets rid of the button, so it seems like I'm in the right location..

Thanks!

gb2world 11-24-2010 10:29 PM

Re: "Contact to order" for just one category
 
Enable webmaster mode. Reload the page in question. In the webmaster mode pop up window, select the Show Variables button to see the smarty variables available to you and how they are set. Look for the variable that stores the current category, and what it is set to. On a category page, it probably is $cat or you can use something in the $current_category array, like $current_category.categoryid. You can also make sure that it is set to 251. On the product page, you can do the same thing and look for the category. Maybe you can use $product.categoryid, depending upon if the category in question is the product's Main category setting.

---

jadefrolics 11-25-2010 05:01 AM

Re: "Contact to order" for just one category
 
Thanks so much! Believe it or not, I had no idea that "Show Variables" was an option. ;) Thus far I've not had to mess with that part.

After looking through the variables it was indeed $product.categoryid and now it works.

Thanks again!


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

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