Jump to content

Recommended Posts

Bonjour,

 

Je lance une bouée à la mer.

Je suis en train de changer le thème de mon prestashop, malheureusement j'ai un module développer sur-mesure et quand je met en production le nouveau thème il le ne fonctionne plus.

 

Avez vous un moyen de savoir quelle fichier et manquant ou bien si le code est casser quelque part.

 

J'ai des petites bases mais rien de OUF.

 

c'est ce module

https://shop.leneonnormand.fr/fr/shop/103-1027-customize-product.html

 

merci pour votre aide

Link to comment
Share on other sites

le module doit faire appel à des classes / id qui n'existent pas dans le nouveau thème.

Commencez par vérifier qu'il n'y a pas un répertoire /module/nom_de_votre module dans l'ancien thème avec un tpl spécifique

Vous pouvez aussi comparer l'ancien et le nouveau product.tpl

Link to comment
Share on other sites

Je viens de regarder dans product.tpl j'ai copier/coller le code mais j'ai une erreur 500 maintenant sur le produit

13 hours ago, Eolia said:

le module doit faire appel à des classes / id qui n'existent pas dans le nouveau thème.

Commencez par vérifier qu'il n'y a pas un répertoire /module/nom_de_votre module dans l'ancien thème avec un tpl spécifique

Vous pouvez aussi comparer l'ancien et le nouveau product.tpl

 

Link to comment
Share on other sites

le problème survient quand je rajoute ce morceau de code dans product.tpl " qui fonctionne très bien avec le thème classe"

{if $product.id == 103}

{include file='catalog/product-custom.tpl'}

{else}

{include file='catalog/product-default.tpl'}

{/if}

 

j'ai bien les deux TPL dans catalog

Edited by 13communication (see edit history)
Link to comment
Share on other sites

J'ai avancer voici le code erreur 🙂

 

(1/1) SmartyCompilerException
Syntax error in template "file:/home/leneonv/www/Shop/themes/at_junior/templates/catalog/product.tpl" on line 242 "{/else}" unknown tag 'elseclose'
in smarty_internal_templatecompilerbase.php line 242
at Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag \'elseclose\'', 242, true)
in smarty_internal_templatecompilerbase.php line 1753
at Smarty_Internal_TemplateCompilerBase->compileTag2('elseclose', array(), array())
in smarty_internal_templatecompilerbase.php line 565
at Smarty_Internal_TemplateCompilerBase->compileTag('elseclose', array())
in smarty_internal_templateparser.php line 2468
at Smarty_Internal_Templateparser->yy_r45()
in smarty_internal_templateparser.php line 3383
at Smarty_Internal_Templateparser->yy_reduce(45)
in smarty_internal_templateparser.php line 3479
at Smarty_Internal_Templateparser->doParse(5, '')
in smarty_internal_smartytemplatecompiler.php line 128
at Smarty_Internal_SmartyTemplateCompiler->doCompile('{** * PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License 3.0 (AFL-3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/AFL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright PrestaShop SA * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) * International Registered Trademark & Property of PrestaShop SA *}{extends file=$layout}{block name=\'head_seo\' prepend} <link rel="canonical" href="{$product.canonical_url}">{/block}{block name=\'head\' append} <meta property="og:type" content="product"> <meta property="og:url" content="{$urls.current_url}"> <meta property="og:title" content="{$page.meta.title}"> <meta property="og:site_name" content="{$shop.name}"> <meta property="og:description" content="{$page.meta.description}"> <meta property="og:image" content="{$product.cover.large.url}"> <meta property="product:pretax_price:amount" content="{$product.price_tax_exc}"> <meta property="product:pretax_price:currency" content="{$currency.iso_code}"> <meta property="product:price:amount" content="{$product.price_amount}"> <meta property="product:price:currency" content="{$currency.iso_code}"> {if isset($product.weight) && ($product.weight != 0)} <meta property="product:weight:value" content="{$product.weight}"> <meta property="product:weight:units" content="{$product.weight_unit}"> {/if}{/block}{block name=\'content\'} {if isset($product.productLayout) && $product.productLayout != \'\'} {hook h=\'displayLeoProfileProduct\' product=$product typeProduct=\'detail\'} <div class="page-loading-overlay main-product-details-loading"></div> {else} <section id="main" class="product-detail" itemscope itemtype="https://schema.org/Product"> <meta itemprop="url" content="{$product.url}"> <div class="row"> <div class="col-lg-6 col-md-12 left-column"> {block name=\'page_content_container\'} <section class="page-content" id="content"> {block name=\'page_content\'} {block name=\'product_cover_thumbnails\'} {include file=\'catalog/_partials/product-cover-thumbnails.tpl\'} {/block} {/block} </section> {/block} </div> <div class="col-lg-6 col-md-12"> {block name=\'page_header_container\'} {block name=\'page_header\'} <h1 class="h1 product-detail-name" itemprop="name">{block name=\'page_title\'}{$product.name}{/block}</h1> {/block} {/block} {hook h=\'displayProductButtons\' product=$product} {hook h=\'displayLeoProductReviewExtra\' product=$product} {block name=\'product_prices\'} {include file=\'catalog/_partials/product-prices.tpl\'} {/block} <div class="product-information"> {block name=\'product_description_short\'} <div id="product-description-short-{$product.id}" itemprop="description">{$product.description_short nofilter}</div> {/block} {if $product.is_customizable && count($product.customizations.fields)} {block name=\'product_customization\'} {include file="catalog/_partials/product-customization.tpl" customizations=$product.customizations} {/block} {/if} <div class="product-actions"> {block name=\'product_buy\'} <form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh"> <input type="hidden" name="token" value="{$static_token}"> <input type="hidden" name="id_product" value="{$product.id}" id="product_page_product_id"> <input type="hidden" name="id_customization" value="{$product.id_customization}" id="product_customization_id"> {block name=\'product_variants\'} {include file=\'catalog/_partials/product-variants.tpl\'} {/block} {block name=\'product_pack\'} {if $packItems} <section class="product-pack"> <p class="h4">{l s=\'This pack contains\' d=\'Shop.Theme.Catalog\'}</p> {foreach from=$packItems item="product_pack"} {block name=\'product_miniature\'} {include file=\'catalog/_partials/miniatures/pack-product.tpl\' product=$product_pack} {/block} {/foreach} </section> {/if} {/block} {block name=\'product_discounts\'} {include file=\'catalog/_partials/product-discounts.tpl\'} {/block} {block name=\'product_add_to_cart\'} {include file=\'catalog/_partials/product-add-to-cart.tpl\'} {/block} {* Input to refresh product HTML removed, block kept for compatibility with themes *} {block name=\'product_refresh\'}{/block} </form> {/block} </div> </div> </div> </div> {block name=\'hook_display_reassurance\'} {hook h=\'displayReassurance\'} {/block} {if isset($USE_PTABS) && $USE_PTABS == \'tab\'} {include file="sub/product_info/tab.tpl"} {else if isset($USE_PTABS) && $USE_PTABS == \'accordion\'} {include file="sub/product_info/accordions.tpl"} {else} {include file="sub/product_info/default.tpl"} {/if} {block name=\'product_accessories\'} {if $accessories} <section class="product-accessories clearfix"> <p class="h5 products-section-title">{l s=\'You might also like\' d=\'Shop.Theme.Global\'}</p> <div class="products"> <div class="owl-row {if isset($productClassWidget)} {$productClassWidget}{/if}"> <div id="category-products2"> {foreach from=$accessories item="product_accessory"} <div class="item{if $smarty.foreach.mypLoop.index == 0} first{/if}"> {block name=\'product_miniature\'} {if isset($productProfileDefault) && $productProfileDefault} {* exits THEME_NAME/profiles/profile_name.tpl -> load template*} {hook h=\'displayLeoProfileProduct\' product=$product_accessory profile=$productProfileDefault} {else} {include file=\'catalog/_partials/miniatures/product.tpl\' product=$product_accessory} {/if} {/block} </div> {/foreach} </div> </div> </div> </section> {/if} {/block} <script type="text/javascript"> products_list_functions.push( function(){ $(\'#category-products2\').owlCarousel({ {if isset($IS_RTL) && $IS_RTL} direction:\'rtl\', {else} direction:\'ltr\', {/if} items : 4, itemsCustom : false, itemsDesktop : [1200, 4], itemsDesktopSmall : [992, 3], itemsTablet : [768, 2], itemsTabletSmall : false, itemsMobile : [480, 1], singleItem : false, // true : show only 1 item itemsScaleUp : false, slideSpeed : 200, // change speed when drag and drop a item paginationSpeed :800, // change speed when go next page autoPlay : false, // time to show each item stopOnHover : false, navigation : true, navigationText : ["&lsaquo;", "&rsaquo;"], scrollPerPage :true, responsive :true, pagination : false, paginationNumbers : false, addClassActive : true, mouseDrag : true, touchDrag : true, }); } ); </script> {block name=\'product_footer\'} {hook h=\'displayFooterProduct\' product=$product category=$category} {/block} {block name=\'product_images_modal\'} {include file=\'catalog/_partials/product-images-modal.tpl\'} {/block} {block name=\'page_footer_container\'} <footer class="page-footer"> {block name=\'page_footer\'} <!-- Footer content --> {/block} </footer> {/block} </section> {if $product.id == 103}{include file=\'catalog/product-custom.tpl\'}{else}{include file=\'catalog/product-default.tpl\'}{/else}{/if} {/block}', true)
in smarty_internal_templatecompilerbase.php line 481
at Smarty_Internal_TemplateCompilerBase->compileTemplateSource(object(SmartyDevTemplate), false, null)
in smarty_internal_templatecompilerbase.php line 404
at Smarty_Internal_TemplateCompilerBase->compileTemplate(object(SmartyDevTemplate))
in smarty_template_compiled.php line 184
at Smarty_Template_Compiled->compileTemplateSource(object(SmartyDevTemplate))
in smarty_template_compiled.php line 141
at Smarty_Template_Compiled->process(object(SmartyDevTemplate))
in smarty_template_compiled.php line 105
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))
in smarty_internal_template.php line 216
at Smarty_Internal_Template->render(false, 0)
in smarty_internal_templatebase.php line 232
at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, 'layouts/layout-full-width.tpl', null, 0)
in smarty_internal_templatebase.php line 116
at Smarty_Internal_TemplateBase->fetch('catalog/product.tpl', null, 'layouts/layout-full-width.tpl', null, false, true, false)
in SmartyDev.php line 40
at SmartyDev->fetch('catalog/product.tpl', null, 'layouts/layout-full-width.tpl')
in FrontController.php line 682
at FrontControllerCore->smartyOutputContent('catalog/product.tpl')
in FrontController.php line 666
at FrontControllerCore->display()
in Controller.php line 301
at ControllerCore->run()
in Dispatcher.php line 511
at DispatcherCore->dispatch()
in index.php line 28

 

Link to comment
Share on other sites

le soucis quand je rajoute le else j'ai ce message

(1/1) SmartyCompilerException

Syntax error in template "file:/home/leneonv/www/Shop/themes/at_junior/templates/catalog/product.tpl" on line 37 "{block name='head_seo' prepend}" unclosed '{else}' tag

 

et si je ferme le else

 

(1/1) SmartyCompilerException

Syntax error in template "file:/home/leneonv/www/Shop/themes/at_junior/templates/catalog/product.tpl" on line 36 "{/else}" unclosed '{else}' tag

Edited by 13communication (see edit history)
Link to comment
Share on other sites

22 minutes ago, Eolia said:

le code doit être {if} .... {else} .... {/if} avec aucune autre balise entre les 2 et placées au bon endroit (la {/if} doit être en tout dernier du bloc conditionnel.

J'avoue être perdu, voici le code du tpl

 

{extends file=$layout}

     {if $product.id == 103}

{include file='catalog/product-custom.tpl'}

{else}

{include file='catalog/product-default.tpl'}

{else}

{block name='head_seo' prepend}
  <link rel="canonical" href="{$product.canonical_url}">
{/block}

{block name='head' append}
  <meta property="og:type" content="product">
  <meta property="og:url" content="{$urls.current_url}">
  <meta property="og:title" content="{$page.meta.title}">
  <meta property="og:site_name" content="{$shop.name}">
  <meta property="og:description" content="{$page.meta.description}">
  <meta property="og:image" content="{$product.cover.large.url}">
  <meta property="product:pretax_price:amount" content="{$product.price_tax_exc}">
  <meta property="product:pretax_price:currency" content="{$currency.iso_code}">
  <meta property="product:price:amount" content="{$product.price_amount}">
  <meta property="product:price:currency" content="{$currency.iso_code}">
  {if isset($product.weight) && ($product.weight != 0)}
  <meta property="product:weight:value" content="{$product.weight}">
  <meta property="product:weight:units" content="{$product.weight_unit}">
  {/if}
{/block}

{block name='content'}  

  {if isset($product.productLayout) && $product.productLayout != ''}
    {hook h='displayLeoProfileProduct' product=$product typeProduct='detail'}
    <div class="page-loading-overlay main-product-details-loading"></div>
  {else}

    <section id="main" class="product-detail" itemscope itemtype="https://schema.org/Product">
      <meta itemprop="url" content="{$product.url}">

      <div class="row">
        <div class="col-lg-6 col-md-12 left-column">
          {block name='page_content_container'}
            <section class="page-content" id="content">
              {block name='page_content'}
                {block name='product_cover_thumbnails'}
                  {include file='catalog/_partials/product-cover-thumbnails.tpl'}
                {/block}

              {/block}
            </section>
          {/block}
          </div>
          <div class="col-lg-6 col-md-12">
            {block name='page_header_container'}
              {block name='page_header'}
                <h1 class="h1 product-detail-name" itemprop="name">{block name='page_title'}{$product.name}{/block}</h1>
              {/block}
            {/block}

            {hook h='displayProductButtons' product=$product}
            {hook h='displayLeoProductReviewExtra' product=$product}
            
            {block name='product_prices'}
              {include file='catalog/_partials/product-prices.tpl'}
            {/block}

            <div class="product-information">
              {block name='product_description_short'}
                <div id="product-description-short-{$product.id}" itemprop="description">{$product.description_short nofilter}</div>
              {/block}

            {if $product.is_customizable && count($product.customizations.fields)}
              {block name='product_customization'}
                {include file="catalog/_partials/product-customization.tpl" customizations=$product.customizations}
              {/block}
            {/if}

            <div class="product-actions">
              {block name='product_buy'}
                <form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh">
                  <input type="hidden" name="token" value="{$static_token}">
                  <input type="hidden" name="id_product" value="{$product.id}" id="product_page_product_id">
                  <input type="hidden" name="id_customization" value="{$product.id_customization}" id="product_customization_id">

                      {block name='product_variants'}
                        {include file='catalog/_partials/product-variants.tpl'}
                      {/block}

                      {block name='product_pack'}
                        {if $packItems}
                          <section class="product-pack">
                            <p class="h4">{l s='This pack contains' d='Shop.Theme.Catalog'}</p>
                            {foreach from=$packItems item="product_pack"}
                              {block name='product_miniature'}
                                {include file='catalog/_partials/miniatures/pack-product.tpl' product=$product_pack}
                              {/block}
                            {/foreach}
                        </section>
                        {/if}
                      {/block}

                      {block name='product_discounts'}
                        {include file='catalog/_partials/product-discounts.tpl'}
                      {/block}

                      {block name='product_add_to_cart'}
                        {include file='catalog/_partials/product-add-to-cart.tpl'}
                      {/block}
                       
                      {* Input to refresh product HTML removed, block kept for compatibility with themes *}
                      {block name='product_refresh'}{/block}
                  </form>
                {/block}
              </div>
        </div>
      </div>
    </div>
    {block name='hook_display_reassurance'}
      {hook h='displayReassurance'}
    {/block}
    {if isset($USE_PTABS) && $USE_PTABS == 'tab'}
        {include file="sub/product_info/tab.tpl"}
    {else if isset($USE_PTABS) && $USE_PTABS == 'accordion'}
        {include file="sub/product_info/accordions.tpl"}
    {else}
        {include file="sub/product_info/default.tpl"}
    {/if}    

    {block name='product_accessories'}
      {if $accessories}
        <section class="product-accessories clearfix">
          <p class="h5 products-section-title">{l s='You might also like' d='Shop.Theme.Global'}</p>

          <div class="products"> 
            <div class="owl-row {if isset($productClassWidget)} {$productClassWidget}{/if}">
              <div id="category-products2">
                {foreach from=$accessories item="product_accessory"}
                  <div class="item{if $smarty.foreach.mypLoop.index == 0} first{/if}">
                    {block name='product_miniature'}
                      {if isset($productProfileDefault) && $productProfileDefault}
                        {* exits THEME_NAME/profiles/profile_name.tpl -> load template*}
                        {hook h='displayLeoProfileProduct' product=$product_accessory profile=$productProfileDefault}
                      {else}
                        {include file='catalog/_partials/miniatures/product.tpl' product=$product_accessory}
                      {/if}
                    {/block}
                  </div>
                {/foreach}
              </div>
            </div>
          </div>
        </section>
      {/if}
    {/block}

    <script type="text/javascript">
      products_list_functions.push(
        function(){
          $('#category-products2').owlCarousel({
            {if isset($IS_RTL) && $IS_RTL}
              direction:'rtl',
            {else}
              direction:'ltr',
            {/if}
            items : 4,
            itemsCustom : false,
            itemsDesktop : [1200, 4],
            itemsDesktopSmall : [992, 3],
            itemsTablet : [768, 2],
            itemsTabletSmall : false,
            itemsMobile : [480, 1],
            singleItem : false,         // true : show only 1 item
            itemsScaleUp : false,
            slideSpeed : 200,  //  change speed when drag and drop a item
            paginationSpeed :800, // change speed when go next page

            autoPlay : false,   // time to show each item
            stopOnHover : false,
            navigation : true,
            navigationText : ["&lsaquo;", "&rsaquo;"],

            scrollPerPage :true,
            responsive :true,
            
            pagination : false,
            paginationNumbers : false,
            
            addClassActive : true,
            
            mouseDrag : true,
            touchDrag : true,

          });
        }
      ); 
    </script>

    {block name='product_footer'}
      {hook h='displayFooterProduct' product=$product category=$category}
    {/block}

    {block name='product_images_modal'}
      {include file='catalog/_partials/product-images-modal.tpl'}
    {/block}

      {block name='page_footer_container'}
        <footer class="page-footer">
          {block name='page_footer'}
            <!-- Footer content -->
          {/block}
        </footer>
      {/block}

    </section>
    

{/if}
  
{/block}

 

Link to comment
Share on other sites

Punaise.... c'est quand même pas compliqué

{extends file=$layout}

{if $product.id == 103}

{include file='catalog/product-custom.tpl'}

{else}

{include file='catalog/product-default.tpl'}

{/if}

{block name='head_seo' prepend}
  <link rel="canonical" href="{$product.canonical_url}">
{/block}

 

Link to comment
Share on other sites

2 minutes ago, Eolia said:

Punaise.... c'est quand même pas compliqué



{extends file=$layout}

{if $product.id == 103}

{include file='catalog/product-custom.tpl'}

{else}

{include file='catalog/product-default.tpl'}

{/if}

{block name='head_seo' prepend}
  <link rel="canonical" href="{$product.canonical_url}">
{/block}

 

Merci mais Quand on ne connais le code si !

 

aprés avoir ajouter le code j'ai re l'erreur 500

Edited by 13communication (see edit history)
Link to comment
Share on other sites

Salut,

Comment tu peux encore avoir erreur 500 alors que tu as activé les erreurs ? Tu devrais avoir le détail de l'erreur, comme tu nous a partagé précédemment.

Dis toi bien que quand tu écris ici "j'ai une erreur 500" ça ne sert A RIEN, mais vraiment strictement à rien, personne ne pourra aider sans le détail de l'erreur.

Link to comment
Share on other sites

Just now, Shonen said:

Salut,

Comment tu peux encore avoir erreur 500 alors que tu as activé les erreurs ? Tu devrais avoir le détail de l'erreur, comme tu nous a partagé précédemment.

Dis toi bien que quand tu écris ici "j'ai une erreur 500" ça ne sert A RIEN, mais vraiment strictement à rien, personne ne pourra aider sans le détail de l'erreur.

je le sais bien mais quand j'ai ajouter le code que vous m'avez donner le message d'erreur à disparu pour l'erreur 500.

Link to comment
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...