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)
-   -   vote.tpl in popup window (https://forum.x-cart.com/showthread.php?t=1670)

ciava 02-28-2003 02:19 AM

vote.tpl in popup window
 
Hi i'm having a problem with customer review section on the product.tpl, basically my product template now opens in it's own window so when you try to rate a product it loads the entire page in the popup window instead of just updating the review with the specific product. Here's the code for the vote tpl i think it's to do with the form action, just need to know what to change it to so whole site doen't upload in the window


<FORM method=GET action="../customer/product.php">
<INPUT type=hidden name=mode value=vote>
<INPUT type=hidden name=productid value={$product.productid}>
<tr><td colspan=2>
<font class=ProductDetailsTitle>{$lng.lbl_customers_rati ng}</font>
</td></tr>
<tr><td class=Line height="1" colspan=2>[img]{$ImagesDir}/orangespacer.gif[/img]</td></tr>
{if $vote_max_cows ne ""}
<TR>
<TD>
{$lng.lbl_customers_rating}</TD>
<TD>

{section name=full_cows loop=$vote_max_cows}
[img]{$ImagesDir}/star_4.gif[/img]
{/section}
{if $vote_little_cow ne "0"}
[img]{$ImagesDir}/star_{$vote_little_cow}.gif[/img]
{/if}
{section name=free_cows loop=$vote_free_cows}
[img]{$ImagesDir}/star_0.gif[/img]
{/section}
</TD></TR>
{/if}
<TR>


regards

jon

funkydunk 03-01-2003 09:57 AM

Can you put the whole of the tpl code in as the answer does not appear to be here.

The form action specified would not open it in a new window.

ciava 03-02-2003 05:55 AM

Hi Funkydunk

the full tpl is

Code:

{* $Id: product.tpl,v 1.57 2002/09/25 12:39:40 zorg Exp $ *}
{literal}
<SCRIPT language=JavaScript1.2>
<!--
function product_option(name_of_option)
{
{/literal}
for(i=0; i<{php}echo count($product_options) {/php}; i++)
  if (document.orderform[i].name.search(name_of_option) != -1)
        return document.orderform[i];
return -1;     
{literal}
}

function FormValidation()

{/literal}
{if $javascript_code}
{$javascript_code}
{else}
return true;
{/if}
{literal}
}
-->
</SCRIPT>
{/literal}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" bgcolor="ff6600">[img]{$ImagesDir}/productbanner.gif[/img]</td>
  </tr>
  <tr>
    <td align="left" height="8"></td>
  </tr>
</table>
<table border=0 width=100%>
<form name=orderform method=post action="product.php" target="mainwin">
<INPUT type=hidden name=actions value=''>
<tr>
      <td valign=top align=left rowspan=2 width=51> </td>
      <td valign=top width="695">
        <table border=0 width=100% cellpadding=0 cellspacing=0>
          <tr>
            <td colspan=2>
              <div align="center"><font class=gry_bld_txt_big>{$product.product}</font></div>
            </td>
          </tr>
          <tr align="left">
            <td colspan=2></td>
          </tr>
          <tr align="center">
            <td colspan=2 height="14"></td>
          </tr>
          <tr align="center">
            <td colspan=2 height="5">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td valign="top">{include file="product_thumbnail.tpl" productid=$product.productid
                    image_x=$product.image_x image_y=$product.image_y product=$product.product}

                    <font size="1">Image for illustrative purposes only.</font>
                  </td>
                  <td>
                    <table width="250" border="0" cellspacing="0" cellpadding="0">
                      <tr valign="bottom">
                        <td colspan="2">[img]{$ImagesDir}/product_top.gif[/img]</td>
                      </tr>
                      <tr>
                        <td colspan="2">
                          <table width="250" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td background="{$ImagesDir}/prod_table_bg.gif">
                                <table width="250" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="80"><font class=red_bld_txt_sml>Quantity:</font></td>
                                    <td width="170">{if $product.avail gt 0}{$product.avail}{else}{$lng.txt_no}{/if}
                                      {$lng.txt_items_available}</td>
                                  </tr>
                                  <tr>
                                    <td width="80" bgcolor="cccccc"><font class=red_bld_txt_sml>Efind:</font></td>
                                    <td width="170" bgcolor="cccccc">{$product.productcode}</td>
                                  </tr>
                                  <tr>
                                    <td width="80"><font class=red_bld_txt_sml>Mfr
                                      Sku:</font></td>
                                    <td width="170">{$product.param01}</td>
                                  </tr>
                                  <tr bgcolor="#cccccc">
                                    <td width="80">Mfr</td>
                                    <td width="170">{$product.param00}</td>
                                  </tr>
                                  <tr>
                                    <td width="80"></td>
                                    <td width="170"></td>
                                  </tr>
                                </table>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr valign="top">
                        <td colspan="2">[img]{$ImagesDir}/product_bot.gif[/img]</td>
                      </tr>
                      <tr valign="top">
                        <td width="250" colspan="2"></td>
                      </tr>
                      <tr valign="top">
                        <td align="right" width="80"></td>
                        <td align="right" width="170"><span align="left">Price:</span><font class=red_bld_txt_big>{if
                          $product.price ne 0} {include file="currency.tpl" value=$product.price}
                          {include file="customer/main/alter_currency_value.tpl"
                          alter_currency_value=$product.price} ex VAT{if $config.General.use_vat
                          eq "Y"}, including VAT {$product.vat}%{/if} {else}
                          <input type=text size=7 name=price2>
                          {/if}

                          ({math equation="price*amount" price=$product.price
                          amount=1.175 format="%.2f" assign=unformatted}{include
                          file="currency.tpl" value=$unformatted} inc VAT)</font></td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr> </tr>
          {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"}
          {/if}
          <tr>
            <td height=25 width=30%>{$lng.lbl_quantity}{if $product.min_amount
              gt 1}

              <FONT class=TableCenterProductTitleOrange>{$lng.txt_need_min_amount}
              {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</td>
            <td> {if $config.General.show_in_stock eq "Y" and ($product.avail
              le 0 or $product.avail lt $product.min_amount)} {$lng.txt_out_of_stock}
              {else} {if $config.General.show_in_stock ne "Y"} {assign var="mq"
              value=$config.General.max_select_quantity} {else} {math equation="min(maxquantity+minamount,
              productquantity)+1" assign="mq" maxquantity=$config.General.max_select_quantity
              minamount=$product.min_amount productquantity=$product.avail} {/if}
              {if $product.distribution eq ""}
              <select name=amount>
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
{section name=quantity loop=$mq start=$start_quantity}
                <option value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</option>
{/section}
              </select>
              {else} <font class=TableCenterProductTitleOrange>1</font>
              <input type=hidden name=amount value=1>
              {$lng.txt_product_downloadable} {/if} {/if} </td>
          </tr>
          <tr>
            <td colspan=2><span class=TableCenterSubCategoryListTitleBlue">
              <input type=hidden name=mode value=add>
              {if $config.General.show_in_stock ne "Y" or ($product.avail gt 0
              and $product.avail ge $product.min_amount)} {include file="customer/main/product_prices.tpl"}
              <a href="javascript:if (FormValidation()) document.orderform.submit()">{include
              file="buttons/add_to_cart.tpl"}</a> 
              {if $login ne "" and $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"}
              {/if} {/if} </span></td>
          </tr>
          <tr>
            <td colspan=2 height="5"></td>
          </tr>
          <td height="1" colspan=2 background="{$ImagesDir}/blue_dot.gif"></td>
          </tr>
          <tr>
            <td height="9" colspan=2></td>
          </tr>
          <tr>
            <td colspan=2><span class=TableCenterSubCategoryListTitleBlue"> {if
              $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if}
              </span></td>
          </tr>
          <tr align="center">
            <td height="9" colspan=2></td>
          </tr>
          <tr>
            <td height="1" colspan=2 background="{$ImagesDir}/blue_dot.gif"></td>
          </tr>
                  <tr>
            <td height="12" colspan=2></td>
          </tr>
          <tr>
            <td colspan=2>{if $active_modules.Detailed_Product_Images
              ne ""}
             

 {/if} {if $active_modules.Upselling_Products ne ""}
             

 {include file="modules/Upselling_Products/related_products.tpl"
                } {/if} {if $active_modules.Recommended_Products ne ""}
             

 {include file="modules/Recommended_Products/recommends.tpl"
                } {/if} {if $active_modules.Customer_Reviews ne ""}
             

 {include file="modules/Customer_Reviews/vote_reviews.tpl" }
                {/if}
            </td>
          <tr>
            <td height="10" colspan=2 ></td>
         
        </table>
</td>
      <td align=right valign=top width=127> {if $product.discount ne 0}
<table border=0><tr><td width=55 height=56 background="{$ImagesDir}/save_money.gif" align=center valign=middle>


<font color=#FFFFFF>{ $product.discount }%</font>
</td></tr></table>{/if}
</td>
</tr>
<input type=hidden name=productid value="{$product.productid}">
<input type=hidden name=cat value="{$smarty.get.cat}">
<input type=hidden name=page value="{$smarty.get.page}">
</form>
</table>
[/quote]

[/quote]



All times are GMT -8. The time now is 08:34 PM.

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