View Single Post
  #48  
Old 02-28-2005, 06:14 PM
 
Bella Forma Bella Forma is offline
 

Senior Member
  
Join Date: Nov 2004
Location: Australia
Posts: 150
 

Default

Thanks for this really great mod and free too!!!!

Regarding the if statements to only show the tabs when they have content I amended Phils code in the product.tpl to this:

Code:
<ul id="tablist"> {if $product_links ne ""}[*]Related {/if} {if $images ne ""}[*]Detailed Images {/if}[*]Send to Friend {if $active_modules.Customer_Reviews ne ""} {if $config.Modules.customer_voting eq "Y" or $config.Modules.customer_reviews eq "Y"}[*]Reviews {/if} {/if} {if $recommends}[*]Recommended {/if}[/list]

and it works well. The only exception is if you are allowing review but there aren't any yet, it will then show the tab but with no content.

To fix that I changed the skin1/modules/Customer_Reviews/reviews.tpl to move the first /if statement down a bit and added an else to say 'there are no reviews yet'. Just going to paste the whole reviews.tpl file again as I can't work out how to bold within code blocks.

Code:
<FORM method="POST" action="product.php?mode=review&productid={$product.productid}"> <TR><TD colspan="2"> <FONT class="ProductDetailsTitle">{$lng.lbl_customer_reviews}</FONT> </TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> {if $reviews ne ""} {section name=r_i loop=$reviews} <TR> <TD colspan="2"> {$lng.lbl_author}: {$reviews[r_i].email|default:$lng.lbl_unknown} {$reviews[r_i].message|replace:"\n":" "} </TD></TR> {/section} {else} <TR><TD colspan="2"> There are no reviews for this product yet.</TD></TR> {/if} {if ($config.Modules.writing_reviews eq "A") or ($login ne "" and $config.Modules.writing_reviews eq "R")} <TR><TD colspan="2"> <FONT class="ProductDetailsTitle">{$lng.lbl_add_your_review}</FONT> </TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <INPUT type="hidden" name="productid" value='{$product.productid}'> <TR> <TD width="30%"> {$lng.lbl_your_name}:</TD><TD> <INPUT type="text" size="24" name="review_author" {if $login ne ""}value="{$customer_info.firstname} {$customer_info.lastname} ({$customer_info.email})"{/if}></TD></TR> <TR> <TD width="30%">{$lng.lbl_your_message}:</TD><TD><TEXTAREA cols="40" rows="4" name="review_message"></TEXTAREA></TD></TR> <TR> <TD colspan="2"><INPUT type="submit" value="{$lng.lbl_add_review}"></TD></TR> {/if} </FORM>
__________________
X-Cart Gold 4.0.12
X-AOM, X-RMA, X-FancyCat
Apache/Linux Server
PHP 4.3.8
Reply With Quote