Overwrite EasyStore Layouts - Question | JoomShaper

Overwrite EasyStore Layouts

B

bergwerk

EasyStore 1 month ago

I did a litte bit of digging, but could not find a solution for this - Is it possible to overwrite the individual layouts from easystore (components/com_easystore/layouts)? If yes, where do i have to put the overwrite files?

I would like to customize the appearance of the "Quick Add" modal (Disable ratings, show Description, remove Link to detail page) but do not seem to find an option to do this? As far as i see, the layout is generated in this file: /components/com_easystore/layouts/cart/quick.php

How can i overwrite this file?

Thanks!

0
2 Answers
B
bergwerk
Accepted Answer
1 month ago #153558

I digged a little bit deeper into the source code and found out:

  • The default Joomla LayoutHelper is used to render the individual layouts - Which is great, as this makes overwriting possible
  • However, a specific path is passed to the "render" function - Which is bad, since this specific path always has higher priority than the template
  • When removing the specific path from src/Helpers/EasyStoreHelper.php, Line 77 everything works fine and i can use the overwrite function from my template by putting a file at for example /my_template/html/layouts/com_easystore/cart/quick.php

Since overwriting template and layout files is a core feature of joomla, i would suggest to adapt the following code in the next easyStore release:

components/com_easystore/src/Helpers/EasyStoreHelper.php, Lines 75 - 78 - Current Version

    public static function loadLayout($layoutFile, $displayData = [])
    {
        return LayoutHelper::render($layoutFile, $displayData, JPATH_ROOT . '/components/com_easystore/layouts');
    }

New Version for Overwrites:

    public static function loadLayout($layoutFile, $displayData = [])
    {
        return LayoutHelper::render($layoutFile, $displayData);
    }

Thanks in Advance!

0
Rashida Rahman
Rashida Rahman
Accepted Answer
Support Agent 1 month ago #153574

Hi there!

Thanks for taking the time to dig into it and share your experience with us. I will review and forward your valuable suggestion to the team. Hopefully it will be adjusted.

We really appreciate it:)

Best Regards

0