Jump to content

Recommended Posts

   Hola, buenas, en esta ocasión les traigo un tema que me tiene pensando.

Verán, en mi tienda, tengo este código:

{**
 * 2007-2016 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 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:
 * http://opensource.org/licenses/osl-3.0.php
 * 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 2007-2016 PrestaShop SA
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
{block name='brand'}
  <li class="brand">
    <div class="brand-img"><a href="{$brand.url}"><img src="{$brand.image}" alt="{$brand.name}"></a></div>
    <div class="brand-infos">
      <h3><a href="{$brand.url}"><b>{$brand.name}</b></a></h3>
      {$brand.text nofilter}
    </div>
    <div class="brand-products">
      <a href="{$brand.url}">{$brand.nb_products}</a>
      <a href="{$brand.url}">{l s='View products' d='Shop.Theme.Actions'}</a>
    </div>
  </li>
{/block}

Que al ejecutarlo en esta ruta: /home/shaarabu/public_html/themes/sp_destino/templates/catalog/_partials/miniatures/brand.tpl

El navegador lo interpreta de esta manera:

image.thumb.png.14f045921662d313ce87e0a6aede92c7.png

Con este código:

<li class="brand">
    <div class="brand-img"><a href="https://shaarabuy.cl/brand/6-brazilian-coffee"><img src="https://shaarabuy.cl/img/m/6-small_default.jpg" alt="Brazilian Coffee"></a></div>
    <div class="brand-infos">
      <h3><a href="https://shaarabuy.cl/brand/6-brazilian-coffee"><b>Brazilian Coffee</b></a></h3>
      <p>Dulces con sabor a café, sin gluten.</p>
    </div>
    <div class="brand-products">
      <a href="https://shaarabuy.cl/brand/6-brazilian-coffee">3 productos</a>
      <a href="https://shaarabuy.cl/brand/6-brazilian-coffee">Ver productos</a>
    </div>
  </li>

 

 

 

   El tema es, que, al colocar el código en la página .tpl de los detalles del producto: /home/shaarabu/public_html/themes/sp_destino/templates/catalog/_partials/product-details.tpl

/home/shaarabu/public_html/themes/sp_destino/templates/catalog/product.tpl

<div {if isset($SP_moreinfo) && $SP_moreinfo == 'tab'} class="tab-pane{if !$product.description} in active{/if}"  {/if} id="product-details">

    {*{block name='product_features'}
      {if $product.features}
        <section class="product-features">
          <dl class="data-sheet">
            {foreach from=$product.features item=feature}
              <dt class="name">{$feature.name}</dt>
              <dd class="value">{$feature.value}</dd>
            {/foreach}
          </dl>
        </section>
      {/if}
    {/block}*}
   
{block name='brand'}
                {include file='catalog/_partials/miniatures/brand.tpl'}
            {/block}    
    
    {if isset($SP_product_sku) && $SP_product_sku}
        {block name='product_reference'}
            {if isset($product.reference_to_display)}
                <div class="product-reference">
                    <label class="label">{l s='Reference:' d='Shop.Theme.Catalog'} </label>
                    <span itemprop="sku">{$product.reference_to_display}</span>
                </div>
                
           {block name='product_prices'}
                {include file='catalog/_partials/product-prices.tpl'}
            {/block}
                       
            
           {/if}
        {/block}
    {/if}
    
	{if isset($SP_product_shortdesc) && $SP_product_shortdesc}
        {block name='product_description_short'}
            <div id="product-description-short-{$product.id}" class="product-short-description" itemprop="description" style="display: block !important;">{$product.description_short nofilter}
                </div>
                
        {/block}
    {/if}

    {block name='product_availability_date'}
        {if $product.availability_date}
            <div class="product-availability-date">
                <label>{l s='Availability date:' d='Shop.Theme.Catalog'} </label>
                <span>{$product.availability_date}</span>
            </div>
        {/if}
    {/block}

    {block name='product_out_of_stock'}
        <div class="product-out-of-stock">
            {hook h='actionProductOutOfStock' product=$product}
        </div>
    {/block}
    
    {block name='product_condition'}
      {if $product.condition}
        <div class="product-condition">
          <label class="label">{l s='Condition' d='Shop.Theme.Catalog'} </label>
          <link itemprop="itemCondition" href="{$product.condition.schema_url}"/>
          <span>{$product.condition.label}</span>
        </div>
      {/if}
    {/block}

    {* if product have specific references, a table will be added to product details section *}
    {block name='product_specific_references'}
      {if isset($product.specific_references)}
        <section class="product-features">
          <h3 class="h6">{l s='Specific References' d='Shop.Theme.Catalog'}</h3>
            <dl class="data-sheet">
              {foreach from=$product.specific_references item=reference key=key}
                <dt class="name">{l s=$key d='Shop.Theme.Catalog'}</dt>
                <dd class="value">{$reference}</dd>
              {/foreach}
            </dl>
        </section>
      {/if}
    {/block}
  
</div>

El navegador, no muestra la Imagen marca, ni el Nombre marca del producto. Solo se ve un punto, un li.

image.thumb.png.f059261bab4bbae4f6d1884c34b962d7.png

Creo que el tema se debe a que el navegador no está reconociendo la ruta de la imagen de la marca, ni el nombre de la marca del producto.

¿Qué podría hacer para solucionarlo?

   Muchas gracias de antemano.

Prestashop: v.1.7.6.4

 

 

PD: Cabe destacar que el hecho de estar realizando esto, es debido a que la tienda NO MUESTRA LA MARCA que uno escoge en el backoffice, donde uno configura el producto:

image.thumb.png.0c954f369dc204ab7ae4019561c9988b.png

 

Slds,

Link to comment
Share on other sites

Para los que tuvieron el mismo problema que yo, esta fue la solución para que en cada producto, en la pagina del mismo, mostrara la imagen de la marca:

<img src="{$link->getManufacturerImageLink({$product->id_manufacturer}, 'small_default')}" alt = "{$product.name|escape:html:'UTF-8'}" />

Me basé en este post, y jugué un poco con los atributos del código: https://victor-rodenas.com/imagen-de-la-marca-en-la-pagina-de-la-marca-en-prestashop-1-7/

   Saludos, y espero que les haya servido.

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...