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

"Contact to order" for just one category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-24-2010, 08:51 PM
  jadefrolics's Avatar 
jadefrolics jadefrolics is offline
 

Senior Member
  
Join Date: Feb 2010
Posts: 138
 

Default "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!
__________________
shop jadefrolics
illustrated prints, accessories, and other goodies
http://shop.jadefrolics.com
X-Cart Gold Version 4.4.1
Reply With Quote
  #2  
Old 11-24-2010, 10:29 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default 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.

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote

The following user thanks gb2world for this useful post:
jadefrolics (11-25-2010)
  #3  
Old 11-25-2010, 05:01 AM
  jadefrolics's Avatar 
jadefrolics jadefrolics is offline
 

Senior Member
  
Join Date: Feb 2010
Posts: 138
 

Default 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!
__________________
shop jadefrolics
illustrated prints, accessories, and other goodies
http://shop.jadefrolics.com
X-Cart Gold Version 4.4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 03:46 PM.

   

 
X-Cart forums © 2001-2020