StraightAndAlert Posted May 26, 2014 Share Posted May 26, 2014 (edited) Bonjour. Je fais appel à vous car je suis confronté depuis environ 2 ou 3 semaines à un problème de déclinaisons très handicapant pour mes ventes. Pour information de vend des disques vinyles et Tshirts de groupes, ma boutique : http://www.straightandalert.com/index.php En effet sur les pages des produits comportant des déclinaisons, que ce soit de tailles ou de couleurs, lorsque l'on sélectionne une déclinaison en particulier : - La page ne s'actualise pas ( par exemple l'image du produit qui devrait changer ou alors le prix pour les lots de disques). L'url ne devrait-t-elle pas s'actualiser également ? - Lorsque l'on clique sur "ajouter au panier" cela ajoute dans le panier la déclinaison par défaut (définie en Back Office), quelque soit la déclinaison sélectionnée. J'ai passé mon weekend à chercher la solution sur le forum et autres sans trouver de solution, vidé le cache manuellement, changer de navigateur... rien à faire. Je ne sais pas exactement quand le problème est arrivé mais je n'ai pas fait de modifs de Prestashop récemment. Je suis sur prestashop 1.3.1.1 Merci d'avance pour votre aide, je deviens chèvre ! Edited May 30, 2014 by StraightAndAlert (see edit history) Link to comment Share on other sites More sharing options...
samyha Posted May 26, 2014 Share Posted May 26, 2014 Bonjour, Tu pourrais me poster l'url de ta boutique stp ? Merci Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 26, 2014 Author Share Posted May 26, 2014 Bonjour Samyah. Je me disais bien que j'avais oublié quelque chose ! http://www.straightandalert.com/index.php Link to comment Share on other sites More sharing options...
samyha Posted May 26, 2014 Share Posted May 26, 2014 Merci ! Je viens de tester sur un t-shirt et effectivemenht ça bloque. Tes déclinaisons apparaissent-elles bien dans ton "Catalogue > Produits > Choix du produit > Déclinaisons" ? Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 26, 2014 Author Share Posted May 26, 2014 Oui oui, côté back office tout est opérationnel. Cela doit faire 2 ou 3 ans que mon site est en prod et jusqu'à il y a même pas 3 semaines ça a toujours bien marché. Link to comment Share on other sites More sharing options...
samyha Posted May 27, 2014 Share Posted May 27, 2014 Et au niveau des quantités tout est ok ? Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 27, 2014 Author Share Posted May 27, 2014 Oui également, je peux tout modifier normalement en Back office comme je l'ai toujours fait. C'est vraiment au niveau du Front Office que ça ne marche plus correctement Link to comment Share on other sites More sharing options...
samyha Posted May 27, 2014 Share Posted May 27, 2014 Ce problème est apparût tout de suite après que tu aies ajouté tes déclinaisons ou ça a marché à un moment donné et ça ne marche plus maintenant ? Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 28, 2014 Author Share Posted May 28, 2014 C'est apparu soudainement, comme je le disais dans le premier message le site est en fonctionnel depuis plus de 2 ans (ou 3 je ne sais plus) et je n'ai jamais eu de soucis avant. J'ai toujours utilisé les déclinaisons et cela marchait correctement Link to comment Share on other sites More sharing options...
samyha Posted May 28, 2014 Share Posted May 28, 2014 Je te conseille de passer un coup de fil à notre équipe support dans ce cas, ils pourront t'aiguiller: 01.40.18.30.04 Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 28, 2014 Author Share Posted May 28, 2014 Je ne savais pas qu'il y avait un support téléphonique pour presta ! Sachant que c'est de l'open source / gratuit je ne pensais pas que vous offriez ce type de service. Je vais tenter ça demain ou vendredi ! Merci 1 Link to comment Share on other sites More sharing options...
samyha Posted May 28, 2014 Share Posted May 28, 2014 Demain étant férié je te conseille plus Vendredi ! Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 28, 2014 Author Share Posted May 28, 2014 pas bête ! Link to comment Share on other sites More sharing options...
Zebx Posted May 28, 2014 Share Posted May 28, 2014 (edited) Bonjour, A priori tu aurais un problème avec toute une série de variables javascript. Les retours à la ligne sont manquants et le tout mélangé avec des lignes de commentaires, ça fait planter tes variables... Tu peux contrôler dans ton product.tpl, en début de page, tout ce qui se trouve entre <script type="text/javascript"> // <![CDATA[ et //]]> </script> Chaque variable déclarée devrait aller à la ligne, or chez toi, tout est sur une ligne... (pas oublier de désactiver le cache pendant les essais) Edit: je connais pas la version 1.3 m'enfin j'imagine qu'on est tjs sur le même principe Edited May 28, 2014 by Zebx (see edit history) Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 29, 2014 Author Share Posted May 29, 2014 Bonjour Zebx. Merci pour ton aide, en effet je viens de me rendre compte de ça, je n'ai pas la moindre idée de pourquoi mon product.tpl est sur une ligne uniquement. J'ai tenté de remettre ça au propre et re-uploader le fichier (en vidant le cache manuellement car pas d'option pour vider le cache sur 1.3.1) mais rien n'y fait. Ceci dit le fichier n'est peut être toujours pas clean comme il devrait être. Je le colle dessous si jamais tu es OK pour jeter un oeil . {include file=$tpl_dir./errors.tpl}{if $errors|@count == 0}<script type="text/javascript">// <![CDATA[ // PrestaShop internal settingsvar 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}; var jqZoomEnabled = {if $jqZoomEnabled}true{else}false{/if}; //JS Hookvar oosHookJsCodeFunctions = new Array();// Parametersvar 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, $smarty.const.NULL, 2, $smarty.const.NULL, true)}{/if}; var reduction_from = '{$product->reduction_from}'; var reduction_to = '{$product->reduction_to}'; var group_reduction = '{$group_reduction}'; var default_eco_tax = {$product->ecotax}; var currentDate = '{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}'; var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties}; var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if}; var displayPrice = {$priceDisplay}; var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}'; // Customizable fieldvar 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:$field.id_customization_field} 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}// Imagesvar img_prod_dir = '{$img_prod_dir}'; var combinationImages = new Array();{foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'} combinationImages[{$combinationId}] = new Array();{foreach from=$combination item='image' name='f_combinationImage'}combinationImages[{$combinationId}][{$smarty.foreach.f_combinationImage.index}] = {$image.id_image|intval};{/foreach}{/foreach}combinationImages[0] = new Array();{foreach from=$images item='image' name='f_defaultImages'} combinationImages[0][{$smarty.foreach.f_defaultImages.index}] = {$image.id_image};{/foreach}// Translationsvar 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="primary_block" class="clearfix"> <h2>{$product->name|truncate:70|escape:'htmlall':'UTF-8'}</h2> {if $confirmation} <p class="confirmation"> {$confirmation} </p> {/if} <!-- right infos--> <div id="pb-right-column"> <!-- product img--> <div id="image-block"> {if $have_image} <img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large')}" {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic"/> {else} <img src="{$img_prod_dir}{$lang_iso}-default-large.jpg" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" /> {/if} </div> {if $rotw_product} <div style="position:relative;top:-300px;right:-2px;display:inline"><a href="{$base_dir}records-of-the-week.php"><img src="http://www.straightandalert.com/img/Logo_Records_Of_The_Week.png" width="300" height="300" ></a></div> {/if} {if count($images) > 0} <!-- thumbnails --> <div id="views_block" {if count($images) < 2}class="hidden"{/if}> {if count($images) > 3}<span class="view_scroll_spacer"><a id="view_scroll_left" class="hidden" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Previous'}</a></span>{/if} <div id="thumbs_list"> <ul style="width: {math equation="width * nbImages" width=80 nbImages=$images|@count}px" id="thumbs_list_frame"> {foreach from=$images item=image name=thumbnails} {assign var=imageIds value=`$product->id`-`$image.id_image`} <li id="thumbnail_{$image.id_image}"> <a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox')}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}"> <img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" /> </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> {/if} {if count($images) > 1}<p class="align_center clear"><a id="resetImages" href="{$link->getProductLink($product)}" style="display:none;" onclick="$('a#resetImages').hide('slow');return (false);">{l s='Display all pictures'}</a></p>{/if} <!-- usefull links--> <ul id="usefull_link_block"> {if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if} </ul> </div> <!-- left infos--> <div id="pb-left-column"> {if $product->description_short OR $packItems|@count > 0} <div id="short_description_block"> {if $product->description_short} <div id="description_content" class="rte align_justify">{$product->description}</div> {/if} {if $packItems|@count > 0} <h3>{l s='Pack content'}</h3> {foreach from=$packItems item=packItem} <div class="pack_content"> {$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'}</a> <p>{$packItem.description_short}</p> </div> {/foreach} {/if} </div> {/if} {if $colors} <!-- colors --> <div id="color_picker"> <p>{l s='Pick a color:' js=1}</p> <div class="clear"></div> <ul id="color_to_pick_list"> {foreach from=$colors key='id_attribute' item='color'} <li><a id="color_{$id_attribute|intval}" class="color_pick" style="background: {$color.value};" onclick="updateColorSelect({$id_attribute|intval});$('#resetImages').show('slow');" title="{$color.name}">{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$color.name}" width="20" height="20" />{/if}</a></li> {/foreach} </ul> <a id="color_all" onclick="updateColorSelect(0);$('a#resetImages').hide('slow');" title="{l s='Cancel'}"><img src="{$img_dir}icon/cancel.gif" alt="{l s='Cancel'}" /></a> <div class="clear"></div> </div> {/if} <!-- add to cart form--> <form id="buy_block" action="{$base_dir}cart.php" method="post">{if $product->getPrice(true, $smarty.const.NULL, 0) != 0} <!-- hidden datas --> <p class="hidden"> <input type="hidden" name="token" value="{$static_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>{/if}{if $product->getPrice(true, $smarty.const.NULL, 0) != 0} <!-- prices --> <p class="price">{/if} {if $product->on_sale} <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/> <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 %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))} <span class="discount">{l s='Price lowered!'}</span> {/if} {if $product->second_hand} <img src="{$img_dir}second_hand_{$lang_iso}.png" alt="{l s='Second hand'}" class="second_hand_img"> <span class="on_sale">{l s='Second hand!'}</span>{/if}{if $product->coming_soon} <img src="{$img_dir}coming_soon_{$lang_iso}.png" alt="{l s='Coming soon'}" class="coming_soon_img"> <span class="on_sale">{l s='Coming soon!'}</span><span class="coming_soon"><br/>{l s='You can reserve this product by email at'} <a href="mailto:[email protected]" target="_self">[email protected]</a></span>{/if} <br />{if $product->getPrice(true, $smarty.const.NULL, 0) != 0} <span class="our_price_display"> {if !$priceDisplay || $priceDisplay == 2} <span id="our_price_display">{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}</span> {if $tax_enabled}{l s='tax incl.'}{/if} {/if} {if $priceDisplay == 1} <span id="our_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {if $tax_enabled}{l s='tax excl.'}{/if} {/if} </span> {if $priceDisplay == 2} <br /> <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'}</span> {/if}{/if} <br /> </p> {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))} <p id="old_price"><span class="bold"> {if !$priceDisplay || $priceDisplay == 2} <span id="old_price_display">{convertPrice price=$product->getPriceWithoutReduct()}</span> {if $tax_enabled}{l s='tax incl.'}{/if} {/if} {if $priceDisplay == 1} <span id="old_price_display">{convertPrice price=$product->getPriceWithoutReduct(true)}</span> {if $tax_enabled}{l s='tax excl.'}{/if} {/if} </span> </p> {/if} {if $product->reduction_percent != 0 && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))} <p id="reduction_percent">{l s='(price reduced by'} <span id="reduction_percent_display">{$product->reduction_percent|floatval}</span> %{l s=')'}</p> {/if} {if $packItems|@count} <p class="pack_price">{l s='instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p> <br class="clear" /> {/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 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();{if $colors|@count > 0}$('#resetImages').show('slow');{/if}"> {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} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option> {/foreach} </select> </p> {/foreach} </div> {/if} <p id="product_reference" {if isset($groups) OR !$product->reference}style="display:none;"{/if}><label for="product_reference">{l s='Reference :'} </label><span class="editable">{$product->reference|escape}</span></p> <!-- quantity wanted --> <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity == 0) || $virtual} style="display:none;"{/if}>{if $product->getPrice(true, $smarty.const.NULL, 0) != 0} <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 ($product->quantity == 0 && !$product->available_later) OR ($product->quantity != 0 && !$product->available_now)} style="display:none;"{/if}> <span id="availability_label">{l s='Availability:'}</span> <span id="availability_value"{if $product->quantity == 0} class="warning-inline"{/if}> {if $product->quantity == 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if} </span> </p> <!-- number of item in stock --> <p id="pQuantityAvailable"{if $display_qties != 1 || $product->quantity == 0} style="display:none;"{/if}> <span id="quantityAvailable">{$product->quantity|intval}</span> <span{if $product->quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}</span> <span{if $product->quantity == 1} style="display:none;"{/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> <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} </form> {/if} {if $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if} </div></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}{$HOOK_PRODUCT_FOOTER}<!-- description and features -->{if $product->description || $features || $accessories || $HOOK_PRODUCT_TAB || $attachments}<div id="more_info_block" class="clear"> {$HOOK_PRODUCT_TAB} </ul> <div id="more_info_sheets" class="sheets align_justify"> {if $features} <!-- product's features --> <ul id="idTab2" class="bullet"> {foreach from=$features item=feature} <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li> {/foreach} </ul> {/if} {if $attachments} <ul id="idTab9" class="bullet"> {foreach from=$attachments item=attachment} <li><a href="{$base_dir}attachment.php?id_attachment={$attachment.id_attachment}">{$attachment.name|escape:'htmlall':'UTF-8'}</a><br />{$attachment.description|escape:'htmlall':'UTF-8'}</li> {/foreach} </ul> {/if} {if isset($accessories) AND $accessories} <!-- accessories --> <ul id="idTab4" class="bullet"> <div class="block products_block accessories_block clearfix"> <div class="block_content"> <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"> <h5><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:22:'...':true|escape:'htmlall':'UTF-8'}</a></h5> <p class="product_desc"> <a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}" class="product_image"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" /></a> <a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='More'}" class="product_description">{$accessory.description_short|strip_tags|truncate:752:'...'}</a> </p> <p class="product_accessories_price"> <span class="price">{displayWtPrice p=$accessory.price}</span> <a class="button" href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a> <a class="exclusive button ajax_add_to_cart_button" href="{$base_dir}cart.php?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}">{l s='Add to cart'}</a> </p> </li> {/foreach} </ul> </div> </div> </ul> {/if} {$HOOK_PRODUCT_TAB_CONTENT} </div></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}" class="customization_block_input {if isset($pictures.$key)}filled{/if}" />{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> </div>{/if}{if $packItems|@count > 0} <div> <h2>{l s='Pack content'}</h2> {include file=$tpl_dir./product-list.tpl products=$packItems} </div>{/if}{/if}<script type="text/javascript"> {literal} jQuery(function (){ jQuery('#description_content a').attr('target', '_blank'); }); {/literal}</script> Merci d'avance ! Link to comment Share on other sites More sharing options...
Zebx Posted May 29, 2014 Share Posted May 29, 2014 Hello, Voici déjà la partie javascript nettoyée : <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}; var jqZoomEnabled = {if $jqZoomEnabled}true{else}false{/if}; //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, $smarty.const.NULL, 2, $smarty.const.NULL, true)}{/if}; var reduction_from = '{$product->reduction_from}'; var reduction_to = '{$product->reduction_to}'; var group_reduction = '{$group_reduction}'; var default_eco_tax = {$product->ecotax}; var currentDate = '{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}'; var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties}; var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if}; var displayPrice = {$priceDisplay}; var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}'; // 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:$field.id_customization_field} 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} // Images var img_prod_dir = '{$img_prod_dir}'; var combinationImages = new Array(); {foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'} combinationImages[{$combinationId}] = new Array(); {foreach from=$combination item='image' name='f_combinationImage'} combinationImages[{$combinationId}][{$smarty.foreach.f_combinationImage.index}] = {$image.id_image|intval}; {/foreach} {/foreach} combinationImages[0] = new Array(); {foreach from=$images item='image' name='f_defaultImages'} combinationImages[0][{$smarty.foreach.f_defaultImages.index}] = {$image.id_image}; {/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> Normalement ça devrait déjà résoudre les bugs. J'ai pas corrigé la partie html car normalement là les retours à la ligne absents ne devraient pas poser de problème. Cela dit pour une question de lisibilité du code, ce serait en effet mieux de corriger aussi... mais à tout hasard, t'as pas un backup de ton site où tu pourrais aller piocher cette page en version non plantée? Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 30, 2014 Author Share Posted May 30, 2014 (edited) Oh la belle idée le fichier de backup ! Ça remarche ! Merci beaucoup Zebx pour avoir ciblé le problème (le fichier product.tpl en question). Je n'ai toujours pas la moindre idée de pourquoi du jour au lendemain tout le code est passé sur une ligne alors que celui d'avant ne l'était pas. Quoi qu'il en soit ça remarche, je fais un backup de mon site direct ! Du coup je ne suis pas sûr de comment passer le sujet en résolu, suffit il que je clique sur "Mark Solved" après le dernier post ? Edited May 30, 2014 by StraightAndAlert (see edit history) Link to comment Share on other sites More sharing options...
Zebx Posted May 30, 2014 Share Posted May 30, 2014 Bonne nouvelle donc Pour l'origine du problème, je dirais que ton fichier a pu être corrompu lors d'un transfert FTP... Si ça n'arrive qu'une fois, on va dire pas de chance, mais si ça se reproduit faudra sans doute investiguer un peu plus loin... Je crois que pour passer en résolu il faut juste éditer ton premier post (en mode full editor) et changer le sujet manuellement. Pour le "mark solved" aucune idée, jamais vu ce bouton, peut-être que ça sert à sélectionner la meilleure réponse pour la mettre en début de topic... Link to comment Share on other sites More sharing options...
StraightAndAlert Posted May 30, 2014 Author Share Posted May 30, 2014 voilà qui est fait ! merci à nouveau Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now