Skip to content

halfhope/oc_custom_template_pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCart Custom templates Pro

License: GPLv3

The extension can replace any tpl / twig file in the engine, including tpl / twig files of any third-party modules. It has an extended set of conditions for replacing templates. For example, this module can replace product/product.twig template with product/product_showcase.twig without file replacement.

Other Languages

Change Log

Screenshots

Advantages

  • Uses the event mechanism, works without injection into files.
  • Compatible with 99% of themes.
  • Doesn't affect performance. The extension is used only when needed. Unnecessary calculations are not carried out.
  • User friendly interface.

Features

The extension will allow:

  • change the template for pages of selected products / categories / manufacturers / information pages / products in selected categories / products of selected manufacturers and for any modules located on them;
  • replace the template for mobile, tablets, desktops / Apple devices, Android / for operating systems Windows, macOS, Linux / for browsers Chrome, Firefox, Opera and so on;
  • change the template for selected languages / currencies / user groups / stores;
  • change the template depending on the range of the basket cost / weight, number of goods;
  • change the template depending on the specified $_GET parameters;

Available filters

For any page:

  • user groups;
  • languages;
  • currencies;
  • shops (supports multistore);
  • mobile devices (Mobile, Tablets, Desktops);
  • platforms (Windows, macOS, Linux, etc);
  • browsers (Chrome, Firefox, Opera, etc);
  • cart - ranges (subtotal, total, weight, number of products in a cart);
  • custom $_GET parameters.

Additional filters for individual pages:

  • Product page
    • selected products;
    • products from selected categories;
    • products of selected manufacturers.
  • Category page
    • selected categories.
  • Manufacturer's page
    • selected manufacturers.
  • Information page
    • selected information pages.

You can combine all of these options. For example, change the extension/module/featured template.twig of the "Featured" module to extension/module/featured_apple.twig only when the module is located on the product page of the manufacturer "Apple" in USD currency.

Compatibility

  • OpenCart 2.3, 3.x, 4.x.
  • Compatible with 99% of themes.

Demo

Admin

Catalog

The demo site has a top menu for quick navigation.

Description of the demo site

In the demo, 9 templates are replaced:

Installation

  • Install the extension through the standard extension installation section.
  • Go to the modules section and install the "Custom templates Pro" module.

Management

Nuances

  • Paths to templates are specified without a file extension. For example common/home or extension/module/featured.
  • The template to be replaced is assigned in the first pop-up window. The template that will replace it is in the second one (in the conditional form).
  • Be careful not to forget about third-party modifications that make changes to template files. The module has a function to display a list of modifications that make changes to the template file being replaced. This makes it much easier to find the right modifiers. I recommend using any convenient modification editor for quick editing of modifiers.

Example

Let's say we need to replace the template of a certain product (product.twig) with our own (product_showcase.twig). For this:

  • make a copy of catalog/view/theme/our-theme/product/product.twig and name it product_showcase.twig;
  • open product_showcase.twig and make the changes we need;
  • go to the "Custom templates Pro" extension page and create a new replacement. In the first pop-up window, enter product / product, in the second; product/product_showcase and select the conditions we need or products for which we need to change the template;
  • save the settings.

If you have any questions, write to the support thread or private messages.

License

Thank You for Using My Extensions!

I have decided to make all my OpenCart extensions free and open-source to benefit the community. Developing, maintaining, and updating these extensions takes time and effort.

If my extensions have been helpful for your project and you’d like to support my work, any donation is greatly appreciated.

💙 You can support me via:

Your support inspires me to keep improving and developing these tools. Thank you!