| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Hide Product Options Title in Product Detail If No Options | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Hide Product Options Title in Product Detail If No Options
Hi
I'd like to hide the Options Title on my product detail page if there are no options available for the product. I've been able to locate the code related to this in product.tpl and customer_options.tpl however, I am not able to construct the if statement needed to do this (my knowledge of code is limited). Since I have only one product with options (gift wrapping), to show the options title on each product detail page seems needless. Any help would be appreciated and thanks in advance.
__________________
Mike X-Cart Gold Version 4.6.0 PHP 5.2.17 |
|||||||
#2
|
|||||||
|
|||||||
I got step 1 of this done, first take out:
Code:
from customer/main/product.tpl and put it in skin1/modules/Product_Options/customer_options.tpl put it on top of the beginning of the section loop so it looks like this: Code:
Doing this will only display the Options header if the customer_options.tpl is called. The problem is, even if there are no product options, the customer_options.tpl will always be called and still display the Options header because of this code in product.tpl: {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"} {/if} If you check the Product Options module to be active in your admin section, the header will always show unless someone can come up with another if statement, like if product options greater than 0 or something, then show customer_options.tpl[/code] |
|||||||
#3
|
|||||||
|
|||||||
Hi Xcell,
I appreciate your respone. I was able to get this figured out a few days ago. In my case the only product in our inventory with the need for options is gift wrapping. What I ended up doing is this; In skin1/customer/main/product.tpl around line 51, I replaced this; {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"} with this; {if $active_modules.Product_Options ne "" and $product.productcode eq "ZWRAP"} { include file="modules/Product_Options/customer_options.tpl"} It seems to work well but could be a problem for those who have alot of products with options. Again, thanks for your help with this. I should have posted back to this thread when I figured out a solution. Mike
__________________
Mike X-Cart Gold Version 4.6.0 PHP 5.2.17 |
|||||||
#4
|
|||||||
|
|||||||
Hi Mike,
Thanks for your response, your solution gave me an idea to create a mod for users who need to hide the options header for more than one item. First take out: Code:
from skin1/customer/main/product.tpl and then paste on top in skin1/modules/Product_Options/customer_options.tpl Then, using phpmyadmin or xcarts patch/upgarde thingy; create a new field called od, type: char, lenght/values: 1, null: no in the table xcart_products then edit include/product_modify.php: find the line Code:
then go to skin1/main/product_modify.tpl and add this: Code:
you can put this anywhere, it is for your use to mark the item to display the options or not, I put mine after the free shipping option. then finally, go back to skin1/customer/main/product.tpl and change the line: Code:
to Code:
Instead of modifying each product, you should use the import function to change the od field. Now products that don't have product options will cease to display the Options header. |
|||||||
#6
|
|||||||
|
|||||||
xcell67, that was most helpful. Only a few of my products have options, so this was perfect. Thank you very much!
|
|||||||
|
|||
X-Cart forums © 2001-2020
|