HTML or JavaScript block module anywhere in the store
- One year of technical support and lifetime updates; from the second year, support is extended for €12.10/year and includes taking on your general improvement ideas for the module.
- Renews automatically; cancel whenever you want, with no minimum term.
- One year of technical support and lifetime updates; after that, support ends (with the subscription it is extended for €12.10/year).
- A single payment, with no automatic charges.
Place HTML or JavaScript blocks anywhere in your store—homepage, product pages, columns, cart, footer—without modifying the theme, and use rules to decide when and to whom they are displayed. It replaces fscustomhtml and imports its blocks.
Compatible with PrestaShop 1.7.8 through 9.x.
Customized content
A notice on the listing shouldn't require a developer.
A banner for a group of clients, a tracking pixel, or a message only for those sending to a specific country. RKR HTML Blocks puts it where it needs to be and only when it needs to be, without modifying the theme or uploading anything via FTP.
Each block knows where and when to leave
You choose the hook, the position among the blocks on the same site, and the rules. Within a group, all conditions are met; as long as one group is met, the block will be displayed. This way, you can request "in this category, to this group of customers, and with the product on sale" without writing any code.
You write the content as you prefer
Title and content by language, with code editor, visual editor, or plain text. You can use variables like the store name or the customer's name when logged in, wrap the content in reusable templates, and, if needed, process it like Smarty.
/ Reach where your song doesn't reach
If the theme doesn't have a hook in the exact location, you create your own and call it from the template. The blocks are exported to JSON and imported into another store, and in a multi-store setup, each block is associated with the stores where it should appear.
If you're coming from fscustomhtml , install this module while the old one is still installed: the installer will import your blocks, hooks, and templates. Uninstall the old one only afterward, because uninstalling it will delete its tables. And export your blocks before uninstalling RKR HTML Blocks: removing it will also delete them.
Compatible with PrestaShop 1.7.8 through 9.x
Developed and maintained by REKIRE
v4.3.0
Added
- Block segmentation by Mobile App or Web :
- Direct selector in the block header ( Show in: All environments, Mobile App only, or Web only outside the app).
- Advanced conditional rule in Display Rules ( Mobile App : equal to Yes/No), allowing you to combine the condition with pages, categories, products, customers, or carts.
- Column and status badge in the Back-Office listing ( All , App , Web ).
- Compatible and decoupled detection with the
rkrappecosystem (RkrAppMode, User-AgentRkrApp/..., cookierkrapp_modeand parameter?rkrapp=1|0).
v4.2.1
Arranged
- A custom hook was useless if the theme called it with
{hook h='…'}. Creating it only saved its name: the module didn't hook into it (only `install()did, and with the default hooks), so PrestaShop didn't call it and the blocks from that hook didn't appear, without any errors. Only{widget name='rkrhtmlblocks' hook='…'}worked. Now, when saving a custom hook, the module hooks into it (and PrestaShop creates the hook if it doesn't exist); renaming or deleting it unhooks it from the old name, unless it's one of the default hooks or is used by another custom hook. The update hooks any existing custom hooks. - English errors in the source strings , which are what an English store sees: the rule operators were "less then", "greater then", "equals to" and "not equals to" (now "less than", "greater than", "equal to", "not equal to"), and the
displayProductAdditionalInfohook was called "Product addition info" (now "Additional product info"). The rest of the catalog was reviewed: the module description ("block" → "blocks", also inconfig.xml), the "Please provide valid name!" messages without an article, "css" and "cms" in lowercase, the Smarty help ("every smarty functions", "We do not support on help using smarty"), the client name variable and seven hook descriptions ("thumbnails..", "on the top of", "page not found page", "top navigation left side", a missing period). Changing the source changes the key:en.phpandes.phpare regenerated, with the same Spanish as before. The rules help (help_filter_rules.tpl, in English, untranslated) now uses the new operator names.
v4.2.0
RKR Extra Data blocks within an HTML block. With RKR Extra Data 1.2.0 or later installed, its button appears above the block's content (and templates): it opens the tab builder, FAQ, notices, calculators, etc., and inserts it where the cursor is, using any of the four editors (text, basic visual, advanced visual, or code). In the store, the block appears already converted to the chosen hook.
The two modules remain independent: without RKR Extra Data no button appears and everything works as in 4.1.3; without it, RKR Extra Data remains the same in products, categories and pages.
Corrected
- With "Activate Smarty," an RKR Extra Data block was crashing the page. The constructor writes the blocks between curly braces and without spaces (
{rkred-faq} … {/rkred-faq}), which is Smarty syntax: the content compilation failed, and with it, the entire page. Now, these blocks are wrapped in{literal}before going through Smarty and arrive intact in the HTML; variables ({$…},{shop_name}) are still replaced. If the content already has a manually added{literal}, it remains untouched. - Trying to save a block resulted in a "Permission denied" error where the module folder was unwritable (protected hosting, or the module was mounted in development mode). Messages between screens and import data were previously saved as
.jsonfiles within the module; now they are stored in the PrestaShop cache. - JavaScript errors occurred when switching editors. Switching from one visual editor to another resulted in the console displaying "Cannot read properties of null (reading 'body')" within the first 7 seconds, one error per language: TinyMCE's AutoSize plugin continued to measure an editor that had already been removed. The content wasn't lost, but the console filled up with each change.
Addon Validator
What the validator indicated, all prior to this version:
- "Use of class Context" (44 times): the module gives its context to
RkrhtmlblocksHelperwhen it is built and the other classes request it there. - HTML written in PHP : the summary of the listing rules is made up of
tooltip.tpl, the messages go inlineas.tpland the "Back" button uses the HelperForm icon. -
file_get_contents()→Tools::file_get_contents()when importing. -
Module::isEnabled(), deprecated in 9.0: seemodule_shop. -
.htaccessin the module root, which was missing. - PHPStan (level 5, PrestaShop 9.1.5 ):
smartyRegisterFunction()→registerPlugin()from Smarty (it's exactly what I did with$lazy = false), property types andarray_slice()with integers. - Format (PHP CS Fixer) in six files. Tested on ps91: display rules using context (page, category), listing with rule summary, saving a block, AJAX filter calls, all four editors working without errors, and the store with Smarty enabled. No database changes: no update script.
v4.1.3
Fewer queries on the front end: from 40 to 2 on the homepage. The module didn't make heavy queries, it made many : one for each hook or position it rendered (26 on the homepage) and, in addition, one for each block to read its filters (14). Each one took tenths of a millisecond, but they added up to about 18 ms per page.
Now the active store and language blocks are read at once and served from memory via hook, and all filters are read with a single query ( IN ). The memory allocation lasts only as long as the request: there's no persistent cache to invalidate. The HTML and display rules (page, category, group, device, etc.) are exactly the same.
- Homepage: 40 queries to 2. Category: 19 to 2. Product: 25 to 2.
- The administration continues to read the filters for each block live.
v4.1.2
The other half of what happened in 4.1.1. That one closed the 102 "Translation not found" notices left by PHP; there were 54 strings left in the administration templates , which go through another path and overwriting l() is not enough.
smartyTranslate() ` — what's behind ` {ls='...' mod='rkrhtmlblocks'} ` — calls ` getModuleTranslation() with five arguments, so Symfony's backup is enabled and there's no way to disable it from the module. Each of those 54 left a notification in an English store; two also left one in Spanish , Variable and -- , which are spelled the same in both languages — proof that the problem was never "missing translation".
Now they are translated in PHP, in classes/RkrhtmlblocksTextos.php , and the template displays the escaped variable. Measured: 54 → 0 with shared/scripts/medir-avisos-traduccion.py , and in ps1788 with the store in English, a load of the configuration screen goes from 37 of our alerts to 0. The same tool against the 4.1.1 ZIP still gives 54, which is what makes that zero meaningful.
And by the way, a panel that was never translated
The four "How to Use Custom Hooks" texts were hardcoded in English within the template, bypassing any translation function: that panel also appeared in English in a Spanish store. They are now in the catalog, in both languages.
You might also like
4 other products in the same category
Viewed products
También podría interesarte
Questions and answers
-
¿Puedo mostrar un bloque solo a ciertos clientes o en ciertas páginas?
0-
Sí. Cada bloque tiene reglas de página, catálogo (producto, categoría, marca, precio, stock…), cliente y carrito (grupo, si ya ha comprado, total del carrito…), contexto (país, idioma, dispositivo…) y fecha y hora. Dentro de un grupo se cumplen todas las condiciones; basta con que se cumpla un grupo para que se muestre.
-
-
¿Y si mi tema no tiene un hook en el sitio que necesito?
0-
Puedes crear un hook propio y llamarlo desde la plantilla del tema. Además tienes 38 hooks ya agrupados por zona de la tienda, cada uno explicando qué sitio ocupa.
-
-
Uso fscustomhtml. ¿Pierdo mis bloques al cambiar?
0-
No, si lo haces en orden: instala RKR HTML Blocks con el antiguo todavía instalado y el instalador se trae sus bloques, hooks y plantillas. Desinstala fscustomhtml solo después, porque al desinstalarse borra sus tablas.
-
-
¿Puedo pasar los bloques a otra tienda o usarlo en multitienda?
0-
Sí. Los bloques se exportan a JSON y se importan en otra tienda, y en multitienda cada bloque se asocia a las tiendas donde debe verse. Exporta también antes de desinstalar el módulo: al quitarlo se borran sus bloques.
-
-
¿Cómo escribo el contenido y en qué versiones funciona?
0-
Título y contenido por idioma, con editor de código, editor visual o texto plano; admite variables como el nombre de la tienda o del cliente, plantillas reutilizables y, si lo necesitas, Smarty. Es compatible con PrestaShop 1.7.8, 8 y 9.
-