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

if/then statement question for products.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-16-2006, 08:49 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default if/then statement question for products.tpl

Hello,

In the products.tpl template I want to exclude any product from showing the buy now button when there are options for that product.

What would be the if/then statement to use?





Also, I tried to exclude certain categories from showing the buy now button in the products.tpl but could not get it to work as I read in other posts.

This is the code example that was given:
Code:
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y" and $products[product].categoryid ne "5"}

This is the code I tried on a 4.0.18 version and it does not work:
Code:
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y" and $products[product].categoryid ne "370"} <td valign="top" align="left">{include file="customer/main/buy_now.tpl" product=$products[product] style="button"}</td>{/if}{/if}

I would appreciate any help on these two issues. Thanks alot

Louise
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #2  
Old 08-17-2006, 03:01 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

For hiding the buy now button for products with options, use this:

{if $product.is_product_options eq 'N'}

That if statement for the buy now button should be fine...
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 08-17-2006, 05:37 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default Code

When debugging and looking for the variables, I was close with:

Code:
is_product_options eq 'N'

but I could not figure out the first part. Going by example I was coming up with $products[product].is_product_options. Sometimes it looks like its product and sometimes its products??

Can you explain this statement?
Code:
$products[product].is_product_options

I understand the is_product_options is pulled from the database...but how do you determine the first part of that code?

Thanks,

Louise
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #4  
Old 08-17-2006, 05:38 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Can't explain it , just pulled it from the buy now template
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 08-17-2006, 06:30 AM
 
willirl willirl is offline
 

eXpert
  
Join Date: Mar 2004
Location: OHIO
Posts: 271
 

Default

FYI if your product has options the buy now button on the products page will take you to the product page. It will not take you to the cart.

I assume that this is done so the person will have to see the option selection pull down menu.
__________________
Richard

x-cart version 4.0.17
http://roguewavemarine.com
Reply With Quote
  #6  
Old 08-17-2006, 07:34 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default

Quote:
Originally Posted by willirl
FYI if your product has options the buy now button on the products page will take you to the product page. It will not take you to the cart.

I assume that this is done so the person will have to see the option selection pull down menu.

You can disable this:

In "general settings: appearance options"

Quote:
A customer using the "Buy now" button to order a product with product options must be redirected to the product details:

The default (first) option is then selected.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #7  
Old 08-17-2006, 07:37 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default

You know, I totally overlooked that option.

Some days you can't see the sky for the clouds (the ones in my head).

Thanks,

Louise
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #8  
Old 07-30-2007, 08:08 PM
  thehoneyjarhomedotcom's Avatar 
thehoneyjarhomedotcom thehoneyjarhomedotcom is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 32
 

Default Re: if/then statement question for products.tpl

I don't see that option in my admin end. I'm running 4.1.8. Any Ideas?
__________________
Kyle K.
The Honey Jar- Because Home Is Where Your Honey Is
www.thehoneyjarhome.com
x-cart gold v4.1.8
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:44 PM.

   

 
X-Cart forums © 2001-2020