Jump to content

No se muestran las etiquetas de disponibilidad en product.tpl


Recommended Posts

Hola,

 

al ir arreglando diversos problemas, he creado otros: ahora la etiqueta verde que indica que un producto está en stock aparece como un pequeño rectángulo verde sin texto en su interior. 

 

Si a un producto le añado en el back office el texto a mostrar cuando está disponible, este se muestra dos veces, lo cual hace que aumente mi confusión. Modificar las traducciones en el back office tampoco lo soluciona. 

 

post-1084449-0-55327200-1487064801_thumb.jpg

 

post-1084449-0-09546300-1487065276_thumb.jpg

 

Además, al entrar en un producto las etiquetas de disponiblidad desparecen por completo, mientras que en una instalación limpia que he hecho en local sí aparecen.

 

El código de los dos archivos en la parte afectada: 

 

SOLUCIÓN AL PRIMER PROBLEMA: ELIMINAR UN ESPACIO EN EL TEXTO DE COLOR ROJO

 

"{if isset($product.available_now) && $product.available_now}{$product.available_now}{ else}{l s='En Stock'} {/if}"

 

product-list.tpl

 
{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
						{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
							<span class="availability">
								{if ($product.allow_oosp || $product.quantity > 0)}
									<span class="{if $product.quantity <= 0 && isset($product.allow_oosp) && !$product.allow_oosp} label-danger{elseif $product.quantity <= 0} label-warning{else} label-success{/if}">
										{if $product.quantity <= 0}
											{if $product.allow_oosp}
												{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='Disponible en 7 dias'} {/if}
												{else} {l s='Out of stock'} {/if}
											{else} {if isset($product.available_now) && $product.available_now}{$product.available_now}{ else}{l s='En Stock'} {/if}
										{/if}
									</span>
																		{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
									<span class="label-warning">
										{l s='Product available with different options'}
									</span>
								{else}
									<span class="label-danger">
										<!--{l s='This product is no longer in stock'}-->
										{l s='Descatalogado'}  <!— ‘Discontinued’—>
										
									</span>
								{/if}
							</span>
						{/if}
					{/if}

product.tpl

<div class="pb-center-column col-xs-12 col-sm-4">
			{if $product->online_only}
				<p class="online_only">{l s='Online only'}</p>
			{/if}
			<h1 itemprop="name">{$product->name|escape:'html':'UTF-8'}</h1>
			<!--******** ISBN *********-->
			<p id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>
				<!--<label>{l s='Reference:'} </label>-->
				<label>{l s='ISBN:'} </label>
				<span class="editable" itemprop="sku"{if !empty($product->reference) && $product->reference} content="{$product->reference}"{/if}>{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>
			</p>
			
		  
            <!--****** AUTOR *******-->			
				{if $product->description_short || $packItems|@count > 0}
						<div id="short_description_block">
				
							{if $product->description_short}
								<label>{l s='Autor/es:'} </label>	<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description_short}</div>
							{/if}

						{if $product->description}
						<p class="buttons_bottom_block">
							<a href="javascript:{ldelim}{rdelim}" class="button">
								{l s='More details'}
							</a>
						</p>
					{/if}
					
		<!-- ************* FIN AUTOR***********-->		
			
			<!--************EDITORIAL*************-->
				<p id="manufacturer" {if !$product_manufacturer->name}style="display: none;"{/if}>
				<label>{l s='Editorial: '} </label>
				<a href="{$link->getManufacturerLink($product_manufacturer->id_manufacturer, $product_manufacturer->link_rewrite)|escape:'html':'UTF-8'}"><span>{$product->manufacturer_name}</span></a>
				</p>				
				<!--************FIN EDITORIAL********-->		
							
			<!--**************COLACION Y EDICION *************-->		
			<p id="product_reference">
				<label>{l s='Colación:'} </label>				
                <span class="editable" itemprop="sku" content="{$product->tapa}">{$product->tapa|escape:'html':'UTF-8'}</span>
			</p>
            <p id="product_reference">
				<label>{l s='Edición:'} </label>				
                <span class="editable" itemprop="sku" content="{$product->edc}">{$product->ean13|escape:'html':'UTF-8'} | {$product->upc|escape:'html':'UTF-8'}</span>
			</p>
					
				</div> <!-- end short_description_block -->
			{/if}
						
			
			{if ($display_qties == 1 && !$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && $product->available_for_order)}
				<!-- number of item in stock -->
				<p id="pQuantityAvailable"{if $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'}</span>
					<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items'}</span>
				</p>
			{/if}
			
			<!-- availability or doesntExist -->
			<p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
				{*<span id="availability_label">{l s='Availability:'}</span>*}
			<span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>				
			</p>
			{if $PS_STOCK_MANAGEMENT}
				{if !$product->is_virtual}{hook h="displayProductDeliveryTime" product=$product}{/if}
				<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties || $product->quantity <= 0) || $allow_oosp || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}</p>
			{/if}
		
			<p id="availability_date"{if ($product->quantity > 0) || !$product->available_for_order || $PS_CATALOG_MODE || !isset($product->available_date) || $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
				<span id="availability_date_label">{l s='Availability date:'}</span>
				<span id="availability_date_value">{if Validate::isDate($product->available_date)}{dateFormat date=$product->available_date full=false}{/if}</span>
			</p>
			
			<!-- Out of stock hook -->
			<div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
				{$HOOK_PRODUCT_OOS}
			</div>
			{if isset($HOOK_EXTRA_RIGHT) && $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}
			{if !$content_only}
				<!-- usefull links-->
				<ul id="usefull_link_block" class="clearfix no-print">
					{if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
					<li class="print">
						<a href="javascript:print();">
							{l s='Print'}
						</a>
					</li>
				</ul>
			{/if}
		</div>
		<!-- end center infos-->

¿Alguna idea del origen del error?

 

Gracias

Edited by lupradoa (see edit history)
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...