Post by petiar » Wed Sep 06, 2017 4:10 am

Hi there,

I need to add some custom fields to category and products. Of course, that has to be done without modifying core files, so I do not lose my changes with updating core. How do I do that?

How do you usually deploy your projects? Is there any way how to export db configuration to files so I can add it in version control system?

How do I add link to the admin menu programmatically, from my controller?

Thanks.

Newbie

Posts

Joined
Wed Sep 06, 2017 4:06 am

Post by yodapt » Wed Sep 06, 2017 4:47 am

You can use OCMod or VQMod to extend Opencart's functionality without editing core files directly.

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm

Post by petiar » Wed Sep 06, 2017 5:24 pm

"vQmod keeps a list of filenames and changes required, in the form of one XML file per extension. These changes are then created as the core files are used, and the resulting files are stored as cached copies which are executed instead of the original, core PHP or TPL file."

Kidding, right? Ever heard of OOP, guys?

Newbie

Posts

Joined
Wed Sep 06, 2017 4:06 am

User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by yodapt » Thu Sep 07, 2017 7:31 am

petiar wrote:
Wed Sep 06, 2017 5:24 pm
Kidding, right? Ever heard of OOP, guys?
Dont go there, we all went there and got nothing in return. It is how it is.

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm

Post by IP_CAM » Thu Sep 07, 2017 8:39 am

Of course, that has to be done without modifying core files,
so I do not lose my changes with updating core.


Well, you will loose your changes anyway :D , by updating OC-Core,
so, better don't worry about too much. By use of OcMod or VqMod,
it's the easiest way, to eventually make changes later work again with
upgraded Source. Just don't bet on it, OC has and will still be changing
for a good time to come, and new ways of doing it require new ways of
implementing Mods, by Nature of Things!

Just to add my 2 Cents on this 8)
Ernie

Ernie's OpenShop v.1.75 + OpenCart v.1.5.6.5 LIGHT Test Sites with free responsive Themes
http://www.bigmax.ch/shop/ - http://www.ebikes.li - http://www.ipc.li/shop/ - http://www.openshop.li/shop/
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by cedcommerceteam » Thu Sep 07, 2017 8:30 pm

You can use VQMod or OCMod to extend Opencart's functionality without touching core files so that updates will not remove your changes.

Code: Select all

<file name="path from admin or catalog dir to file you want to modify">
	<operation>
		<search position="after">
			<![CDATA[
				// find string after which you want to add your code 
				]]>
		</search>
		<add>
                          <![CDATA[
                            //  code you want to add
			  ]]>
               </add>
       </operation>
<file>   

Code: Select all

<file name="admin/controller/common/header.php">
	<operation>
		<search position="after">
			<![CDATA[
				$results = $this->model_setting_store->getStores();
				]]>
		</search>
		<add>
                          <![CDATA[
                            //  code you want to add
			  ]]>
               </add>
       </operation>
<file>     
you can not add menu programmatically but you can add menu using VQMod or OCMod or modify vqmod xml file by your controller and clear cache programmatically to achieve your requirement of dynamic menu adding in admin.


Posts

Joined
Wed Aug 09, 2017 9:02 pm
Who is online

Users browsing this forum: No registered users and 11 guests