![]() |
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"} I would appreciate any help on these two issues. Thanks alot Louise |
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... |
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 |
Can't explain it , just pulled it from the buy now template :)
|
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. |
Quote:
You can disable this: In "general settings: appearance options" Quote:
The default (first) option is then selected. |
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 |
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.