How To Install Modules In Opencart Templates

Opencart is a well known ecommerce engine with loads of fantastic features. However to build a very attractive Opencart website you may need to install a premium OpenCart template.

Active4 years, 1 month ago

I know how to create table in wordpress while installing the plugin. But in opencart i have no idea. Please help to know how can i create a new table while installing the module. I have paste the test.php code that is used to install the module.

user1515728user1515728

4 Answers

You can add an install() method in your controller which will run when an install takes place. Simply execute your SQL in there

Jay GilfordJay Gilford
14.6k6 gold badges32 silver badges55 bronze badges

[09/08/2013] you can see here http://www.opencartnews.com/tutorials/creating-a-custom-page-in-opencart-final/ , hope this help also someone out there concerning this problem..

regards

hafidhhafidh

may be this can help you to create your tables during installation of module.

AkelyaAkelya

Both page mentioned above have a little mistake:They are missing ENGINE... at the end of the query, so fix:

JadeyeJadeye
1,8202 gold badges37 silver badges48 bronze badges

Not the answer you're looking for? Browse other questions tagged phpopencart or ask your own question.

Active1 year, 1 month ago

I've read through some guides and watched a YouTube video on how to create a custom theme for OpenCart. After trying various things it still doesn't seem to be working right.

If I go to 'Extensions > Themes > Edit Store' I can switch the theme directory but this doesn't seem right. The question bubble there says changing the theme directory here is only for legacy support of older themes. Current themes should be available through 'System > Settings > Edit Store > General Tab (Select Theme Dropdown).

Why doesn't this seem to work? The new version is supposed to fall back on the default theme if something isn't available but it can't if I change the theme directory. I've even tried simply copying the whole default folder and renaming it.

Haroon
3142 gold badges10 silver badges24 bronze badges
dstanadstana

3 Answers

Go to Extestions >> Extestions >> Choose the extension type >> Select Themes >> Edit Your themes >> change default theme. See screenshots:

Opencart

1 : https://postimg.cc/image/ds02xcmbp/

2 : https://postimg.cc/image/bre4q9fk5/

Cœur
21.9k10 gold badges127 silver badges178 bronze badges
Rashedul Islam SagorRashedul Islam Sagor

In file <Your project name>/catalog/controller/event/theme.phpreplace row 16 from:

to:

Андрей ЛитвиненкоАндрей Литвиненко

I know it's bit late to answer but it can be helpful to others.

In OpenCart 2.3.0.2 creating a custom theme is little complex , finally i found this doc here which helped me a lot http://undefined.gr/site/2016/10/09/custom-opencart-2-3-0-2-theme/

To start with copy the default folder found inupload/catalog/view/theme/defaultto a new folder in the same directory. Name it “mytheme“.

How To Install Modules In Opencart

Then copy the theme_default.php file inupload/admin/controller/extension/themeand place it in same directory. Name it “mytheme.php“.

How To Install Opencart Theme

  • Rename the class to (line 2):

ControllerExtensionThemeMyTheme+ Replace all “theme_default” text to “mytheme“. Yes there are a lot (197).

Copy the theme_default.tpl inupload/admin/view/template/extension/themeand place it in the same directory. Name it “mytheme.tpl“.

How To Install Modules In Opencart Template

  • Replace all “theme_default” text to “mytheme“. (48)

Copy theme_default.php inupload/admin/language/en-gb/extension/themeand place it in the same directory. Name it “mytheme.php“.

How To Install Modules On Linux

  • Set the new theme’s title in heading_title (line 3) to “My Theme”.

Finally for the thumnail image to show correctly in store settings rename default.png to mytheme.png inupload/catalog/view/theme/mytheme/imageNow go into your Administration > Extensions > Extensions and select Themes in “Choose the extension type”. You should be seeing your new theme. Install it with the green (+) button and edit it to enable it. Also ensure you set the correct theme directory whilst editing the theme!

Then in System > Settings edit your store to use your new theme.

That should do it. You can now go ahead and start chopping and changing the default theme

Ankit PrajapatiAnkit Prajapati

How To Install Modules In Opencart Templates Windows 10

Not the answer you're looking for? Browse other questions tagged themesopencartopencart2.3 or ask your own question.