Skip to content

Conversation

moboutrig
Copy link

… done so far and provide feedback for Jules to continue.

… done so far and provide feedback for Jules to continue.
This commit introduces a new PrestaShop/QloApps module named 'blockheader'.
The module implements a custom sticky header with distinct desktop and mobile views,
and provides extensive configuration options in the admin panel.

Key features and steps completed:

1.  Module Scaffolding:
    *   Created the basic directory structure for `blockheader` inside `modules/`.
    *   Initialized the main module file `blockheader.php` and `index.php` files.

2.  Admin Configuration:
    *   Developed `AdminCustomheaderlogoSettingController.php` to manage all module settings.
    *   Added an admin tab "Header Logo & Branding" for easy access.
    *   Implemented configuration fields for:
        *   Logo upload and branding text lines.
        *   Desktop-specific phone number.
        *   Two distinct text links for the desktop header's top-left section.
        *   A main Call-to-Action button for the desktop header's right side.
        *   Optional mobile header background image upload.
        *   Three configurable links (icon, text, URL) for the mobile fixed bottom bar.
        *   Up to 5 configurable main navigation links (active status, text, URL) for use in both desktop and mobile main navigation areas. URL parsing supports PrestaShop page identifiers (e.g., cms:X, category:X, contact).

3.  Front-End Structure (`headerBlock.tpl`):
    *   Created the Smarty template with distinct HTML structures for desktop and mobile views.
    *   Used Smarty variables to populate the header with configured data.
    *   Included placeholders for standard elements like language selectors (`{hook h='displayNav2'}`) and custom hooks for navigation link injection (`displayBlockHeaderNavigation`, `displayBlockHeaderMobileNavigation`).

4.  Styling (`blockheader.css`):
    *   Developed CSS rules for both desktop and mobile layouts, including:
        *   Flexbox/Grid for column structures.
        *   Dark/light themes as per the design requirements.
        *   Basic sticky header behavior.
        *   Media queries for responsive switching between desktop and mobile views.

5.  JavaScript Functionality (`blockheader.js`):
    *   Implemented the hamburger toggle for the mobile navigation panel.
    *   Added logic for managing an overlay when the mobile menu is open.
    *   Included JavaScript-assisted sticky header class toggling based on scroll position.

6.  Module Integration (`blockheader.php`):
    *   The main module file loads its CSS and JS assets via `hookDisplayHeader`.
    *   It fetches all configurations and passes them to `headerBlock.tpl` via `hookDisplayTop`.
    *   Registered all necessary hooks, including the custom navigation hooks.
    *   Set up default configuration values to provide a better out-of-the-box experience upon module installation.

Note: This submission is prior to the planned "Testing and Refinement" step. You reported a syntax error in `blockheader.php` after the main development phase, which needs to be addressed.
@wdammak
Copy link
Contributor

wdammak commented Jul 16, 2025

@moboutrig
The module contains many errors and its code is broken or incomplete.
Furthermore, this module will not be compatible because the core of the current application is PrestaShop 1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants