Jump to content

价格在不同浏览器显示的位置不同,在线求救!


Recommended Posts

大家好,我安装了一个fence的模板,但是 product page里面的价格,在firefox, IE,safiri都是错位显示

而在 opera就正常,请大家帮帮我,谢谢

 

大家帮忙看看吧 http://www1.benakedstore.com/product.php?id_product=16

 

以下是product.tpl 代码

 

{include file=$tpl_dir./errors.tpl}
{if $errors|@count == 0}
<script type="text/javascript">
// <![CDATA[
// PrestaShop internal settings
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
var currencyRate = '{$currencyRate|floatval}';
var currencyFormat = '{$currencyFormat|intval}';
var currencyBlank = '{$currencyBlank|intval}';
var taxRate = {$product->tax_rate|floatval};
//JS Hook
var oosHookJsCodeFunctions = new Array();
// Parameters
var id_product = '{$product->id|intval}';
var productHasAttributes = {if isset($groups)}true{else}false{/if};
var quantitiesDisplayAllowed = {if $display_qties == 1}true{else}false{/if};
var quantityAvailable = {if $display_qties == 1 && $product->quantity}{$product->quantity}{else}0{/if};
var allowBuyWhenOutOfStock = {if $allow_oosp == 1}true{else}false{/if};
var availableNowValue = '{$product->available_now|escape:'quotes':'UTF-8'}';
var availableLaterValue = '{$product->available_later|escape:'quotes':'UTF-8'}';
var productPriceWithoutReduction = {$product->getPriceWithoutReduct()|default:'null'};
var reduction_percent = {if $product->reduction_percent}{$product->reduction_percent}{else}0{/if};
var reduction_price = {if $product->reduction_percent}0{else}{$product->getPrice(true, NULL, 2, NULL, true)}{/if};
var reduction_from = '{$product->reduction_from}';
var reduction_to = '{$product->reduction_to}';
var default_eco_tax = {$product->ecotax};
var currentDate = '{$smarty.now|date_format:'%Y-%m-%d'}';
var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties};
var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if};
// Customizable field
var img_ps_dir = '{$img_ps_dir}';
var customizationFields = new Array();
{assign var='imgIndex' value=0}
{assign var='textFieldIndex' value=0}
{foreach from=$customizationFields item='field' name='customizationFields'}
{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$imgIndex}
customizationFields[{$smarty.foreach.customizationFields.index|intval}] = new Array();
customizationFields[{$smarty.foreach.customizationFields.index|intval}][0] = '{if $field.type|intval == 0}img{$imgIndex++}{else}textField{$textFieldIndex++}{/if}';
customizationFields[{$smarty.foreach.customizationFields.index|intval}][1] = {if $field.type|intval == 0 AND $pictures.$key}2{else}{$field.required|intval}{/if};
{/foreach}
// Translations
var doesntExist = '{l s='The product does not exist in this model. Please choose another.' js=1}';
var doesntExistNoMore = '{l s='This product is no longer in stock' js=1}';
var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' js=1}';
var uploading_in_progress = '{l s='Uploading in progress, please wait...' js=1}';
var fieldRequired = '{l s='Please fill all required fields' js=1}';

{if isset($groups)}
// Combinations
{foreach from=$combinations key=idCombination item=combination}
 addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}');
{/foreach}
// Colors
{if $colors|@count > 0}
 {if $product->id_color_default}var id_color_default = {$product->id_color_default|intval};{/if}
{/if}
{/if}
//]]>
</script>
{include file=$tpl_dir./breadcrumb.tpl}
<div id="div_main_product">
<div id="primary_block">
{if $confirmation}
<p class="confirmation">
{$confirmation}
</p>
{/if}
<!-- left infos-->
<div id="pb-right-column">
 <!-- AddThis Button BEGIN -->
 <div class="addthis">
  <span class="addthis_toolbox addthis_default_style">
    <a href="http://www.addthis.com/bookmark.php?v=250&pub=xa-4b0c3a470213246c" class="addthis_button_compact"></a>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4b0c3a470213246c"></script>
  </span>
 </div>
 <!-- AddThis Button END -->
 {if $have_image}
 <div id="image-block">
 <!-- product img-->
 <img src="{$img_prod_dir}{$cover.id_image}-large.jpg" alt="" id="bigpic" title="{$product->name|escape:'htmlall':'UTF-8'}"/>
 {else}
  <img src="{$img_prod_dir}{$lang_iso}-default-large.jpg" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" />
 {/if}
<!-- thumbnails -->
<div id="views_block" {if count($images) < 2}class="hidden"{/if}>
{if count($images) > 3}<a id="view_scroll_left" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Previous'}</a>{/if}
<div id="thumbs_list">
<ul style="width: {math equation="width * nbImages" width=82 nbImages=$images|@count}px">
{foreach from=$images item=image name=thumbnails}
   <li>
  <a href="{$img_prod_dir}{$product->id}-{$image.id_image}-thickbox.jpg" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}">
   <img id="thumb_{$image.id_image}" src="{$img_prod_dir}{$product->id}-{$image.id_image}-medium.jpg" width="50" height="50" alt="{$image.legend|htmlspecialchars}" title="{$image.legend|htmlspecialchars}" />
  </a>
 </li>
 {/foreach}
</ul>
 </div>
{if count($images) > 3}<a id="view_scroll_right" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Next'}</a>{/if}
</div>
</div>
<!-- description and features -->
{if $product->description || $features || $HOOK_PRODUCT_TAB}
<div id="more_info_sheets" class="sheets align_justify">
<ul id="more_info_tabs" class="idTabs idTabsShort">
 <li><a id="more_info_tab_more_info" href="#idTab3">{l s='Product'}</a></li>
 {if isset($accessories) AND $accessories}<li><a id="more_info_tab_more_info" href="#idTab4">{l s='complete your Look'}</a></li>{/if}
 {if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More infos'}</a></li>{/if}
 {$HOOK_PRODUCT_TAB}
</ul>
<!-- full description -->
<div id="idTab3">
   <!-- right infos-->
<div id="pb-left-column">
<h2 class="product_title">{$product->name|escape:'htmlall':'UTF-8'}</h2>
 {if $product->description_short}
 <div id="short_description_block">
  <p id="short_description_content" class="rte align_justify">{$product->description_short}</p>
 </div>
 {/if}
 {if $colors}
 <!-- colors -->
 <div id="color_picker">
  <p>{l s='Pick a color:' js=1}</p>
  <div class="clear"></div>
  {foreach from=$colors key='id_attribute' item='color'}
   <a id="color_{$id_attribute|intval}" class="color_pick" style="background: {$color.value};" onclick="updateColorSelect({$id_attribute|intval});">{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}<img src="{$img_col_dir}{$id_attribute}.jpg" alt="" title="{$color.name}" />{/if}</a>
  {/foreach}
 </div>
 {/if}
 <!-- add to cart form-->
 <form id="buy_block" action="{$base_dir}cart.php" method="post">
  <!-- hidden datas -->
  <p class="hidden">
   <input type="hidden" name="token" value="{$token}" />
   <input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
   <input type="hidden" name="add" value="1" />
   <input type="hidden" name="id_product_attribute" id="idCombination" value="" />
  </p>
  <!-- prices -->
  <p class="price">
   {if $product->on_sale}
 <span class="on_sale">{l s='On sale!'}</span>
   {elseif ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
   {/if}
   <span class="our_price_display"><span id="our_price_display">{convertPrice price=$product->getPrice(true, NULL, 2)}</span> {if $product->getPrice(true, NULL, 2) != $product->getPrice(false, NULL, 2)}{l s='incl. tax'}{/if}</span>
   <br />
   {if $displayPreTax AND $display_ht AND $product->id_tax}
   <br />
   <span id="pretaxe_price">{l s='('}<span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, NULL, 2)}</span> {l s='tax not incl.)'}</span>
   {/if}
  </p>
  {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
   <p id="old_price"><span class="bold"><span id="old_price_display">{convertPrice price=$product->getPriceWithoutReduct()}</span> {l s='incl. tax'}</span></p>
  {/if}
  {if $product->reduction_percent != 0 && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
   <p id="reduction_percent">{l s='(price reduced by'} <span class="reduction_percent_number" style="color:#000000" id="reduction_percent_display">{$product->reduction_percent|floatval}</span> %{l s=')'}</p>
  {/if}
  {if $product->ecotax != 0}
   <p class="price-ecotax">{l s='include'} <span id="ecotax_price_display">{convertPrice price=$product->ecotax}</span> {l s='for green tax'}</p>
  {/if}
  {if $product->reference}<p id="product_reference"><label for="product_reference">{l s='Benaked Price :'} </label><span class="editable">{$product->reference|escape}</span></p>{/if}
  {if isset($groups)}
  <!-- attributes -->
  <div id="attributes">
  {foreach from=$groups key=id_attribute_group item=group}
  <p>
   <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
   {assign var='groupName' value='group_'|cat:$id_attribute_group}
   <select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();">
 {foreach from=$group.attributes key=id_attribute item=group_attribute}
  <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if}>{$group_attribute|escape:'htmlall':'UTF-8'}</option>
 {/foreach}
   </select>
  </p>
  {/foreach}
  </div>
  {/if}
  <!-- quantity wanted -->
  <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity == 0) || $virtual} style="display:none;"{/if}>
   <label>{l s='Quantity :'}</label>
   <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />
  </p>
  <!-- availability -->
  <p id="availability_statut"{if ($allow_oosp && $product->quantity == 0 && !$product->available_later) || (!$product->available_now && $display_qties != 1) } style="display:none;"{/if}>
   <span id="availability_label">{l s='Availability:'} </span>
  </p>
  <!-- number of item in stock -->
  <p style="float:left" id="pQuantityAvailable"{if $display_qties != 1 || ($allow_oosp && $product->quantity == 0)} style="display:none;"{/if}>
   <span id="availability_number">{$product->quantity|intval}</span>
   <span{if $product->quantity > 1} style="display:none;color:#000"{/if} id="quantityAvailableTxt">{l s='item in stock'}</span>
   <span{if $product->quantity < 2} style="display:none;color:#000"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span>
  </p>

  <!-- Out of stock hook -->
  <p id="oosHook"{if $product->quantity > 0} style="display:none;"{/if}>
   {$HOOK_PRODUCT_OOS}
  </p>
  <p class="warning-inline" id="last_quantities"{if ($product->quantity > $last_qties || $product->quantity == 0) || $allow_oosp} style="display:none;"{/if} >{l s='Warning: Last items in stock!'}</p><br /><br />
  <p{if !$allow_oosp && $product->quantity == 0} style="display:none;"{/if} id="add_to_cart" class="buttons_bottom_block"><input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" /></p>
  {if $HOOK_PRODUCT_ACTIONS}
   {$HOOK_PRODUCT_ACTIONS}
  {/if}
	    {if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
 </form>
 {if $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}
</div>
    </div>
{if $product->description}
 <!-- full description -->
 <div id="idTab1">{$product->description}</div>
{/if}
{$HOOK_PRODUCT_TAB_CONTENT}
</div>
{if isset($accessories) AND $accessories}
<div id="idTab4">
<!-- accessories -->
 <div class="accessories_block">
   <ul>
  {foreach from=$accessories item=accessory name=accessories_list}
  {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
  <li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">
	 <div class="boxgrid slideright">
	 <img class="cover" src="{$img_prod_dir}{$accessory.id_image}-home.jpg" width="100" height="100" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}"
	  <h5>
 <a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:20|escape:'htmlall':'UTF-8'}</a>
   </h5>
	    <p><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}">{$accessory.description_short|strip_tags|truncate:50:'...'}</a></p>  
   <p class="price">{displayWtPrice p=$accessory.price}</p>
 <p class="nav">
  <a href="{$productLink}">{l s='Details'}</a>
 </p>
	 </div>
    </li>
   {/foreach}
 </ul>
   </div>
</div>
 {/if}
 </div>
{/if}
</div>
{if $quantity_discounts}
<!-- quantity discount -->
<ul class="idTabs">
<li><a style="cursor: pointer">{l s='Quantity discount'}</a></li>
</ul>
<div id="quantityDiscount">
<table class="std">
  <tr>
   {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
   <th>{$quantity_discount.quantity|intval}
   {if $quantity_discount.quantity|intval > 1}
 {l s='quantities'}
   {else}
 {l s='quantity'}
   {/if}
   </th>
   {/foreach}
  </tr>
  <tr>
   {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
   <td>
   {if $quantity_discount.id_discount_type|intval == 1}
 -{$quantity_discount.value|floatval}%
   {else}
 -{convertPrice price=$quantity_discount.value|floatval}
   {/if}
   </td>
   {/foreach}
  </tr>
</table>
</div>
{/if}
<!-- Customizable products -->
{if $product->customizable}
<ul class="idTabs">
 <li><a style="cursor: pointer">{l s='Product customization'}</a></li>
</ul>
<div class="customization_block">
 <form method="post" action="{$customizationFormTarget}" enctype="multipart/form-data" id="customizationForm">
  <p>
   <img src="{$img_dir}icon/infos.gif" alt="Informations" />
   {l s='After saving your customized product, do not forget to add it to your cart.'}
   {if $product->uploadable_files}<br />{l s='Allowed file formats are: GIF, JPG, PNG'}{/if}
  </p>
  {if $product->uploadable_files|intval}
  <h2>{l s='Pictures'}</h2>
  <ul id="uploadable_files">
   {counter start=0 assign='customizationField'}
   {foreach from=$customizationFields item='field' name='customizationFields'}
 {if $field.type == 0}
  <li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
   {if isset($pictures.$key)}<div class="customizationUploadBrowse"><img src="{$pic_dir}{$pictures.$key}_small" alt="" /><a href="{$link->getUrlWith('deletePicture', $field.id_customization_field)}"><img src="{$img_dir}icon/delete.gif" alt="{l s='delete'}" class="customization_delete_icon" /></a></div>{/if}
   <div class="customizationUploadBrowse"><input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" value="" class="customization_block_input" />{if $field.required}<sup>*</sup>{/if}
   <div class="customizationUploadBrowseDescription">{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}</div></div>
  </li>
  {counter}
 {/if}
   {/foreach}
  </ul>
  {/if}
  <div class="clear"></div>
  {if $product->text_fields|intval}
  <h2>{l s='Texts'}</h2>
  <ul id="text_fields">
   {counter start=0 assign='customizationField'}
   {foreach from=$customizationFields item='field' name='customizationFields'}
 {if $field.type == 1}
  <li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
   {if !empty($field.name)}{$field.name}{/if}<input type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" value="{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}" class="customization_block_input" />{if $field.required}<sup>*</sup>{/if}
  </li>
  {counter}
 {/if}
   {/foreach}
  </ul>
  {/if}
  <p style="clear: left;" id="customizedDatas">
   <input type="hidden" name="quantityBackup" id="quantityBackup" value="" />
   <input type="hidden" name="submitCustomizedDatas" value="1" />
   <input type="button" class="button" value="{l s='Save'}" onclick="javascript:saveCustomization()" />
  </p>
 </form>
 <p class="clear required"><sup>*</sup> {l s='required fields'}</p>
{/if}
{$HOOK_PRODUCT_FOOTER}
{/if}
</div>
</div>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More