I am new to opencart and want to create new extension module. After order placed and payment process completed after that I need to call 3rd party API.
So, Is there any hooks (like WordPress or Prestashop) that I can apply and use into my module files?
I am currently using opencart version - 2.3.0.2
OpenCart doesn't have any hooks, only events system, which is pretty weak. Instead it uses VQMod. This is a pretty powerful tool for developers, who know some PHP. It works similar to WordPress hooks, but gives you unlimited options.
Hooks use certain points in the code or fire certain events, but with VQMod you can put your code literally anywhere. You only need to find the desired line and put your code before or after it, even replace it, if necessary.
If you're familiar with WP hooks and filters, I'm pretty sure you'll handle VQMod well.
There are three following way :
Opencart Events
Vqmod
Ocmod
PS: I prefer to use ocmod.
Related
I'm admittedly new to Netsuite, so this may be obvious, although I've been unable to find anything specific one way or the other. In fact, I don't even attend any training until next week, but I'm trying to get part of my development environment setup with one of the editors/IDEs I prefer. I know that Netsuite offers an Eclipse plugin, but I'm not an Eclipse fan. I'd prefer to use either WebStorm or TextMate. (I'm on MacOS Sierra)
I tried installing the WebStorm plugin, but it's throwing an exception and is not functional. I submitted a bug on GitHub, but what I'd really like to know is if it's possible for me to write my own script to upload/download files to the cabinet, so I could just roll my own feature in TextMate. Is this possible, and if so, how? (Just a link to the docs is perfectly fine)
In other words, is it possible via their API, to submit changes to a script I've been working on in another editor/IDE? Or interact with our cabinet? (Not sure if I'm using the proper NS verbiage, but hopefully you get my intent) I'm thinking about writing a Python script, that accepts a local script path as a parameter, that will then get submitted to our cabinet. Thanks for the help in advance.
I wrote a plugin for JetBrains IDEs (I use WebStorm specifically though) that mimics NetSuite's Eclipse plugin. Feel free to take a look. It is open source and has ~1500 downloads at the current moment.
https://plugins.jetbrains.com/plugin/8305?pr=
If you are the same person that opened this issue (https://github.com/Topher84/NetSuite-Tools-For-WebStorm/issues/7), it has been closed and was due to using an older version of WebStorm.
I don't like eclipse personally, so I just make my scripts in whatever and use Netsuite's script backend to upload the scripts as 'new' when I'm done. If I want to change them, simply use their backend again to 'edit' the script. You'll see a simple editor, where you can change things, or you just copy and paste what you have in there. It's a little more work than something integrated, but it does work..
I'm developing an OpenCart shop using OC 2.1 and I'm struggling to understand what is the best solution for creating custom changes on controller level.
Here's a simplified example to show you what I'm wondering about:
I'd like to modify my header. The graphic design I'm implementing uses different writing for My account link depending on if the user is already logged in or not. This is of course a very simple thing to change, so here are my ideas:
I could just edit my new template's header.tpl file to use:
<?php echo $logged ? $text_account_signed : $text_account; ?>
That requires a change in a language file and that file is outside of the template folder. I'll leave the language issue out for this example to make it less complicated.
But to create a solution that is more MVC I should make that change in the catalog/controller/header.php file, shouldn't I? Unfortunately that file is outside of the template folder so in case of an update, the change will be lost or would require fixing by hand.
I could however create an extension with an extension.ocmod.xml file that would make a change in the controller header.php file and it would be safer (not sure if 100% sage though) for future updates. But the amount of extensions and/or the complexity of creating them would greatly impact my project time, I suppose. And that makes me tempted to just edit the source code of OpenCart and make my future self worry about it later. But I care about this guy and I'm sure he'd hate me for that at some point.
So, my real question is: Is there a way of creating OpenCart modifications on controller level that would not break future updates?
Regarding modifying existing Controller, Models, Languages yes you either need to use vQmod or OCMOD and for template yes you can create your own template according to need. there is no other option.
If you are using vQmod or OCMOD then you don't have to worry about updates because there is less chances of issue (issue may occur only in major updates).
For vQmod there are other easy tools like vQgen and vQmanager available
For Opencart Overall general info
Am looking for a good and free IDE to work with Django framework. I came to learn that gedit is a powerful one with right plugins.
How to best configure gedit to work with Django ?
My requirements include -
easy navigation (finding usages, declarations etc)
auto completion
replacements/updates across files
(obviously) editing/debugging python, CSS/HTML, database queries etc
(optionally) integration with GitHub
Am new to Python/Django, so please suggest any other plugins that might be useful.
you can use Sublime Text wirh Djaneiro for django and python, SublimeCodeIntel
I'm trying to add some external configuration parameters to a new J2.5 site, and before I resort to hacks, I want to know if it is possible to write a plugin that will actually integrate with, or extend the jConfig object.
I have been googling, and cannot find any discussion or example of such a thing - only component or module configuration, so wanted to know if anyone had attempted this, or knew of a "native" way of accomplishing it.
Note - We'd accomplished this in earlier versions by way of a system plugin that set a global variable to make the information available, but we're hoping to include it in the Joomla Global Configuration to be able to use native Joomla config logic.
The short answer is no, you can't. With a plugin it's only possible to override some minor classes, when the plugins files are first loaded (which would be the first hook for our custom code) JConfig is already loaded along with another 40 classes.
You could however extend it once it's loaded, add your parameters, save, and those should be persisted when the user saves from the backend, and made available in the following requests. Provided you're not saving too many it could work fine.
Otherwise just put your parameters in the component (which would be the standard Joomla way).
Let me first say I am aware of this faq for Mach-II, which discusses using application specific mappings as a third option when:
locating the framework in the server root is not possible and
creating a server wide mapping to the Mach-II framework directory is impossible
Using application specific mappings would also work for other ColdFusion frameworks with similar requirements (ColdSpring). Here is my issue however: my (I should say "their") production servers are all running ColdFusion MX7, and application specific mappings were introduced in ColdFusion 8. I most likely will be unable to do option 1 or 2 because they involve creating server wide changes that could conflict with other applications (I don't have a final word on this but I am preparing for that to be the case).
That said, is there anybody out there who was in similar bind and has done an option 4, in any ColdFusion version, or with any similar framework? The only option 4 I can think of is modifying the entire framework to change this hardcoded path, and even if that worked it would be time consuming and risky. I'm fairly sure that if there was a simple modification or other simple solution it would already be included in the framework (maybe it's included in version 1.8 of Mach-II and I don't know about it yet).
Any thoughts on solving this problem or even unorthodox setups with libraries that have specific path requirements would be appreciated. Any thoughts from Team Mach-II would especially appreciated...we're on the same team here Matt! ;-)
EDIT
Apparently, the ColdBox framework includes a refactor.xml ANT task which includes a target that refactors the ColdBox code to use a different absolute path as a base along with several other useful refactoring targets. So problem solved for ColdBox users.
Looking at the build.xml for Mach-II (1.6 and 1.8) I don't see any target in there that would allow me to refactor the code. I thought about creating a feature request ticket for such a task for Mach-II but frankly I don't think creating such an ANT task is a big priority for the MachII team since the need really only relates to either
a) users of ColdFusion versions below 8
b) someone who wants to use multiple Mach-II versions in the same application, a use I doubt they want to support
The ColdSpring code I have doesn't come with any ANT tasks at all, although I do have unit tests, and I bet if I poked around the SVN I'd find a few build scripts.
Using Ant tasks to refactor and retest the code, or the simpler (and sort of cop out) solution of creating a separate ColdFusion instance for the application are the best answers I've been able to come up with. I don't need this application to exist in the shared scope of other applications, so my first solution is going to be to try and get a dedicated CF instance for this application.
I'm also going to look at the ColdBox refactor.xml ANT task however and see if I can modify it to work generically to recognize and refactor CFC references with modified absolute paths. If I complete this task I'll be sure to post the code somewhere and edit create an answer to link to it. If anybody else wants to take a crack at that or help me out with it feel free.
Until then I'll leave this question open and see if someone comes up with a better solution.
Fusebox is not so strict, I think.
In XML mode (maybe I call this not 100% correcly, just mean using the Application.cfm) it's just proper include in index.cfm, something like:
<cfinclude template="fusebox5/fusebox5.cfm" />
In non-XML mode it will need proper extending in the root Application.cfc:
<cfcomponent extends="path.to.fusebox5.Application" output="false">
All you need is to know the path.
Perhaps you could create a symbolic link and let the operating system resolve the issue for you?
I've been playing with FW/1 lately, and while it may look like you need to add a mapping and extend org.corfield.framework, you can actually move the framework.cfc file into your web root and just extend="framework". It's dead simple, and gets you straight into a great framework with no mess and very little overhead.
It should be as simple as dropping the 'MachII' folder at the root of your domain (i.e. example.com/MachII). No mappings are required to use Mach-II if you just deploy at the root of the domain of your website.
Also:
Please file a ticket for the ANT task you mentioned in your question. Team Mach-II would love to have this issue logged:
Enter a new ticket on the Mach-II Trac
If you want to tackle an ANT task for us, we can get stuff like this incorporated into the builds faster than waiting to for a Team member to work on the ticket. Code submissions from the community are welcome and appreciated.
We don't keep an eye on Stack Overflow very often so we invite you to join our official community group at called "Mach-II for ColdFusion" at Google Groups. The Google Group is the best place to ask questions or comments like this if you want feedback from the Team.