Jump to content
zombiesbyte

Going down the Development route

Recommended Posts

Hi

Just want to clarify a couple of things with me being new to CC. I'm on version 6 and trying to understand the market place a bit better since I'm finding it slightly confusing.

This may just be a case of me understand the terminology...

So my installation of CC has a nice admin area where I can manage everything I need to but I'm missing a few features I'd like to develop. Before I start down this route I need to understand if and how I may perhaps share these on the marketplace as it may be something that others would find beneficial (I haven't wrote anything yet but wanted to get it straight in my head and start out on the right foot).

The section under "PLUGINS" has a link to my list of installed "plugins" but the marketplace goes to "extensions". This is my first question. Are "extensions" the same thing as "plugins"?

If they are then the extensions menu also has a sub section of plugins together with other categories which is confusing.

If I wanted to write a module (I'm calling them module as I can't distinguish between all the terminology used) then this would have a complete set of installation instructions for CC to automatically install and update DB, PHP etc and probably write directories specific to the modules requirements etc. Is this what a plugin is and is a plugin a particular type of extension?

If I wanted to write a code snippet, a product feed or a skin then these would all be regarded as an extension but not regarded as a plugin?

Also is a code snippet something that is used under "Manage hooks" in the admin?

 

I there a visual map or something?

 

I'm struggling to write the questions so I'll stop here until I understand what all of this means.

 

Share this post


Link to post
Share on other sites

"I need to understand if and how I may perhaps share these on the marketplace as it may be something that others would find beneficial "

The MarketPlace, last I checked, requires one to have a PayPal account (to collect your license sales) even for free extensions. If so, then sign up to market on the MarketPlace. There is also a third-party CubeCart website at www.cubecartforums.org. You can post your contribution there as well. (The CubeCartForums.org site was a necessary solution due to this CubeCart.com forum's restrictive rules that were once in existence a few years ago.)

"Are "extensions" the same thing as "plugins"?"

All Plugins are extensions. There are more to extensions than just Plugins. Other extensions include shipping, payment, affiliate, social, and external modules in the /modules/ folder, skins in the /skins/ folder, and language packs in the /language/ folder. (Code in the /includes/ folder is not pluggable, although they can be swapped out, and are not to be considered as extending the functionality of CC6.)

Also, a "Plugin" (capitalized) is the proper name given for a particular type of extension -- and all extensions are modularized and can be thought of (programmatically and installed) as a "plugin" (lowercase).

"[My module] would have a complete set of installation instructions for CC to automatically install and update DB, PHP etc and probably write directories specific to the modules requirements etc."

Yes. If a dedicated database table or column is needed, then the module will need to test for this, and if necessary make the schema changes, every time when the admin opens the module's config screens.

CC6 does not yet have a proper module uninstaller, so any changes to the database schema must be "abandonment-proof". Likewise, we suggest any dedicated new folders/files remain inside the module's structure.

"If I wanted to write a code snippet, a product feed or a skin then these would all be regarded as an extension but not regarded as a plugin?"

CC6 has three locations for extensions as mentioned above. All are automatically detected by CC6 using corresponding internal methods. Thus, using the term "pluggable" leads to their characteristic as being called a "plugin". But not all plugins are Plugins. (Plugins are in the /modules/plugins/ folder.)

"Is a code snippet something that is used under "Manage hooks" in the admin?"

A Code Snippet is a free-standing chunk of code that CubeCart will execute when CC processes a hook trigger and the Code Snippet is assigned to that hook trigger. It's physical existence is slightly different than a hook file in a Plugin's /hooks/ folder. It serves the same purposes, but is free-standing in that there is no Plugin overseer.

I have argued for the re-arrangement of admin screens that would put certain things (Manage Hooks being one) in the Advanced section. Managing Hooks by an untrained admin could cause unintended consequences.

"Is there a visual map or something?"

Of what? If you are wanting an SDK, then sorry. No such beast as of today. There are hit and miss wiki pages at wiki.cubecart.com.

Share this post


Link to post
Share on other sites

Thanks bsmither for answering in detail.

I have to admit, this sounds like organised chaos when it comes to both the module/Plugin/plugin concept AND the naming of these things. On a more positive note, I have had a look at the code for CC in more detail and although it doesn't seem to be particularly well structured in terms of OOP the code is clean, lean and clear and has a number of admirable points in terms of advanced php practices which I don't see very often. I just thought I'd say that as I felt quite blessed after seeing some of the OpenSource eCom projects out there.

Anyway, I think it's going to take me quite a while to grasp what you've said (not anything to do with your explanation) although some of it has answered questions I had.

By "visual map" I mean something like a flow chart explaining the entry points of each of the extensions and what they effect.

Didn't realise there wasn't a way to uninstall an extension... so would it be customary to include an uninstall script within the admin area if the plugin/extension had it's own sections?

Example project:

I may start my first mod as a way to turn off the page heading on a document page as it doesn't grant much control if you don't want to include it or change it from becoming a <h1> tag (i.e. you want to add a css class on only one of your 'documents'). Since this is a modification (additional field in DB, additional form tickbox on admin view, additional model & controller tasks, language entry for labels (I imagine)) based on this explanation, what kind of extension type would this be? Secondly, since all the skins will be different (potentially) I presume that there will need to be clear instructions provided on how to manually update the template to allow for the condition checking of if the h1 should be turned off? Am I right in presuming all of this?

Kind regards

James

Share this post


Link to post
Share on other sites

"visual map"

That would be the SDK I spoke of earlier.

"would it be customary to include an uninstall script within the admin area"

For a properly written extension, as easy as it is to FTP the extension's folder into the correct parent folder (/modules/plugins/ for example) and enable it, it is as easy to disable it and delete the folder. The concern is any residual detritus must be inconsequential.

"a way to turn off the page heading on a document page" "what kind of extension type would this be?"

Depending on comprehensiveness, a Code Snippet will suffice, otherwise a Plugin. But do not dismiss the ability to include style tags in the document content. Such as:

Switch the Edit Document, Content tab, editor to Source mode. Enter:

<p>This can be managed under <span class="navTitle">Documents in the admin control panel.</span></p>
<style type="text/css">#main_content h2:first-child { display:none; }</style>

The document's Title (an H2 in Foundation) is NOT gone. Just not displayed. A search engine will still find it in the received source HTML.

But, as you say, you would need to accurately guess/identify the css xpath for any given skin. But given that, there may be very little you can do to suppress any targeted skin code if you don't know what skin is in play.

More complex solutions can use the "class.gui.css" and/or "class.gui.body_js" hook trigger. (The list of available hook triggers can be found in the /modules/plugins/ folder.)

Share this post


Link to post
Share on other sites

Thanks again bsmither. I think I have enough information to make a start on things. :)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×