PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 27, 2022

[FIXED] how to add text to the miniature list block

 October 27, 2022     prestashop-1.7     No comments   

Issue

I am creating a module for prestashop 1.7, and I would like to add a text inside this block but I do not know how to do it:

a busy cat

I do not know if to use a hook, and which one!

edit : without modifying the tpl file of the theme Thank's!


Solution

You can use this hook:

{hook h='displayProductPriceBlock' product=$product type="before_price"}
public function HookDisplayProductPriceBlock($params)
{
    if ($params['type'] == "before_price") {
        return 'TEXT'; // or return TPL file
    }
}

UPDATE:

On your module, you just need to register "displayProductPriceBlock" hook during installation process and add above function to yourmodule.php file.



Answered By - Mahdi Shad
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing