Jump to content

How to Show category as heading on favorite product page.


Recommended Posts

Hi,

I have changed favorite product grid like category page but i wish to show category name as heading on top of added products. for example.

 

http://screencast.com/t/8AKBaExk

 

favoriteproducts-account.tpl file which i modified codes are as follow.

{*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (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:
* http://opensource.org/licenses/afl-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 <[email protected]>
*  @copyright  2007-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{capture name=path}
	<a href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}">
		{l s='My account' mod='favoriteproducts'}
	</a>
	<span class="navigation-pipe">{$navigationPipe}</span>
	<span class="navigation_page">{l s='My favorite products' mod='favoriteproducts'}</span>
{/capture}

<div id="favoriteproducts_block_account">
	<h1 class="page-heading product-listing">{l s='My favorite products' mod='favoriteproducts'}</h1>    
	{if $favoriteProducts}    
    	<ul class="product_list grid row">                                                                              
			{foreach from=$favoriteProducts item=favoriteProduct} 
            {assign var=cat_name value=FrontController::getCategoryName(Product::getDefaultCategoryfav($favoriteProduct.id_product))}
            <h1 class="page-heading product-listing">{$cat_name|escape:'html':'UTF-8'}</h1>                                                            
			<li class="ajax_block_product col-xs-12 col-ms-6 col-sm-3 col-md-4 col-lg-3 first-in-line last-line first-item-of-tablet-line first-item-of-mobile-line last-mobile-line">                        
            	<div class="product-container" itemscope>
                <div class="left-block">
                <div class="product-image-container">                
                <a class="product_img_link" href="{$link->getProductLink($favoriteProduct.id_product, null, null, null, null, $favoriteProduct.id_shop)|escape:'html':'UTF-8'}" itemprop="url">                
                <img class="replace-2x img-responsive img_0" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} src="{$link->getImageLink($favoriteProduct.link_rewrite,$favoriteProduct.id_product, 'home_default')|escape:'html':'UTF-8'}" itemprop="image"/>
                    </a>
                      <div class="functional-buttons functional-buttons-grid clearfix">
						{if isset($quick_view) && $quick_view}
						<div class="quickview col-xs-6">
							<a class="quick-view" href="{$link->getProductLink($favoriteProduct.id_product, null, null, null, null, $favoriteProduct.id_shop)|escape:'html':'UTF-8'}" rel="{$link->getProductLink($favoriteProduct.id_product, null, null, null, null, $favoriteProduct.id_shop)|escape:'html':'UTF-8'}" title="{l s='Quick view'}">
								{l s='Quick view'}
							</a>
							</div>
						{/if}												
					</div>                                  
                </div>
                </div>                    
                    <p class="s_title_block">
                    	<a href="{$link->getProductLink($favoriteProduct.id_product, null, null, null, null, $favoriteProduct.id_shop)|escape:'html':'UTF-8'}">
                    		{$favoriteProduct.name|truncate:35:'...'|escape:'html':'UTF-8'}
                    	</a>
                    </p>                    
					<div itemprop="offers" itemscope class="content_price">						
							<span itemprop="price" class="price product-price">
								{convertPrice price=Product::getDefaultpricefav($favoriteProduct.id_product)|escape:'html':'UTF-8'}
							</span>													
					</div>
                    <div class="button-container">													
								{if isset($static_token)}
									<a class="button ajax_add_to_cart_button btn" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$favoriteProduct.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$favoriteProduct.id_product|intval}">
										<span>{l s='Add to cart'}</span>
									</a>
								{else}
									<a class="button ajax_add_to_cart_button btn" href="{$link->getPageLink('cart',false, NULL, 'add=1&id_product={$favoriteProduct.id_product|intval}', false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$favoriteProduct.id_product|intval}">
										<span>{l s='Add to cart'}</span>
									</a>
								{/if}			
					</div>					
                    <div class="remove">
                    	<a href="#" onclick="return false" rel="ajax_id_favoriteproduct_{$favoriteProduct.id_product}">
                    		<i class="icon-remove"></i>
                    	</a>
                    </div>                
                </div>
			</li>                                                
			{/foreach}                        
        </ul>        
	{else}
		<p class="alert alert-warning">{l s='No favorite products have been determined just yet. ' mod='favoriteproducts'}</p>
	{/if}    
	<ul class="footer_links clearfix">
		<li>
			<a 
			class="btn btn-default button button-small" 
			href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}">
				<span>
					<i class="icon-chevron-left"></i>{l s='Back to your account' mod='favoriteproducts'}
				</span>
			</a>
		</li>
	</ul>
</div>
Edited by ArsalanAnsari (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...