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/then statement question for products.tpl (https://forum.x-cart.com/showthread.php?t=24137)

dalmuti 08-16-2006 08:49 AM

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

balinor 08-17-2006 03:01 AM

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

dalmuti 08-17-2006 05:37 AM

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

balinor 08-17-2006 05:38 AM

Can't explain it , just pulled it from the buy now template :)

willirl 08-17-2006 06:30 AM

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.

carpeperdiem 08-17-2006 07:34 AM

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.

dalmuti 08-17-2006 07:37 AM

You know, I totally overlooked that option.

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

Thanks,

Louise

thehoneyjarhomedotcom 07-30-2007 08:08 PM

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?


All times are GMT -8. The time now is 11:57 PM.

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