Post by strgg » Sat Oct 08, 2016 1:53 am

Hi

Thanks for this forum. I am so glad that i can ask here for help!

I am creating an extension for opencart 2.1.x til 2.2.x.

My extension only needs to keep some general settings within admin, no Frontend catalog files needed.
Lets assume for simplicity's sake it only holds facebook and twitter id.
The settings should not be under settings since there is no need to make it multishop.
extension should save in oc_setting and NOT in oc_module table
Only 1 instance.
I want the menu-entry not to be auto created but i want to add it with ocmod (already done).

I started with copying the Html module and renaming, all working fine. The problem is that after every save of the module a NEW INSTANCE (Module id+) is created. But i want only 1 instance being possible. Can i create a module with only 1 instance?? How to change the code that this happens in the bitbucket module i link at the end?

Could you give me a start?

the module i use for a start is quite identical to https://bitbucket.org/mariavilaro/openc ... module/src this one.

Newbie

Posts

Joined
Wed Feb 04, 2015 7:51 pm

Post by OSWorX » Sun Oct 09, 2016 5:13 pm

strgg wrote:I am creating an extension for opencart 2.1.x til 2.2.x.
Then you should know what to do.
One question: should that module be for you only (your own shop), a client or a commercial module?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by strgg » Tue Oct 11, 2016 7:07 am

Hi OsWorx

Only for me (my shop). Why does this matter? It would be funny if i work for others without any idea what to do ;D . No, its for my wine shop.

btw, we are neighbours. Wohne beim Bodensee (Schweiz).

Newbie

Posts

Joined
Wed Feb 04, 2015 7:51 pm

Post by fido-x » Sat Oct 15, 2016 10:32 am

OpenCart 2.x has two types of modules. I refer to these as "independent" and "global" modules.

Independent modules allow for multiple instances of the module and store their settings in the module table in your database. The HTML module is one of these.

Global modules only allow for a single instance of the module and store their settings in the setting table in your database. The Account and Category modules are examples.

You should use the Account or Category module as a starting point for your own custom module.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 76 guests