Jump to content

[SOLVED]Products on sale on homepage


Recommended Posts

Good night,

I am setting up my store with prestashop v 1.5.5.0.

I want to make a block with products on sale in the home page, below the featured products?

Know if there is a free module for this change? If no way do through code and how to do it?

Thank you!

shop: www.shopsensual.net

Edited by paulormf (see edit history)

Share this post


Link to post
Share on other sites

i don't know any module for that, but you can try to move specials block to the "home" hook. I think that after little modification it will work exactly the same as homefeatured works :)

---

I tried to make the change through the backend but it was not possible ..
returns the message "this block can not be moved."
I'm looking in the code to make changes to the hook ($ params) but can not find :/
Thanks for the tip and help!

Share this post


Link to post
Share on other sites

 

open blockspecials.php file and right before the last bracket "}"

 

add this code:

 

public function hookHome($params)
{
return $this->hookRightColumn($params);
}

 

---

Vekia, 

you are the best, amazing!!
worked perfectly!
THANK YOU, one more time!
People like you make the difference!
 
SOLVED!

Share this post


Link to post
Share on other sites

  • 2 years later...

Hi,

 

I have preety much the same problem (PS 1.6.0.14).

I hooked module to displayHome, but now I can see only one, random product (on backoffice it's configured to display 5 of them). Is there any easy way to show for example 6 products (3x2)? Here is a .tpl code I guess needs to be modified:

<div class="block_content products-block">
    {if $special}
	<ul>
            <li class="clearfix">
            	<a class="products-block-image" href="{$special.link|escape:'html':'UTF-8'}">
                    <img 
                    class="replace-2x img-responsive" 
                    src="{$link->getImageLink($special.link_rewrite, $special.id_image, 'small_default')|escape:'html':'UTF-8'}" 
                    alt="{$special.legend|escape:'html':'UTF-8'}" 
                    title="{$special.name|escape:'html':'UTF-8'}" />
                </a>
                <div class="product-content">
                	<h5>
                        <a class="product-name" href="{$special.link|escape:'html':'UTF-8'}" title="{$special.name|escape:'html':'UTF-8'}">
                            {$special.name|escape:'html':'UTF-8'}
                        </a>
                    </h5>
                    {if isset($special.description_short) && $special.description_short}
                    	<p class="product-description">
                            {$special.description_short|strip_tags:'UTF-8'|truncate:40}
                        </p>
                    {/if}
                    <div class="price-box">
                    	{if !$PS_CATALOG_MODE}
                        	<span class="price special-price">
                                {if !$priceDisplay}
                                    {displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}
                                {/if}
                            </span>
                             {if $special.specific_prices}
                                {assign var='specific_prices' value=$special.specific_prices}
                                {if $specific_prices.reduction_type == 'percentage' && ($specific_prices.from == $specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $specific_prices.from))}
                                    <span class="price-percent-reduction">-{$specific_prices.reduction*100|floatval}%</span>
                                {/if}
                            {/if}
                             <span class="old-price">
                                {if !$priceDisplay}
                                    {displayWtPrice p=$special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}
                                {/if}
                            </span>
                        {/if}
                    </div>
                </div>
            </li>
	</ul>
<div>

Thanks for any help ;)

 

Here is what it looks like right now: link

Edited by Szkudi (see edit history)

Share this post


Link to post
Share on other sites

  • 5 years later...

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More