5
votes
Accepted
before_channel_entry_save hook
This was driving me insane but I've figured it out.
You need to edit the $entry object (1st parameter of the function) in order for this to work. You can, however, use the 2nd parameter, $values, for ...
4
votes
Accepted
Clearing the cache via API
ref: https://docs.expressionengine.com/latest/development/legacy/libraries/cache.html#class-methods
ee()->cache->delete('/myaddon/');
2
votes
Expresso Store custom tax rule
Sorted thanks. The issue here was a typo (store_orders_taxes not store_order_taxes).
Pro tip folk - use a different name for your method from the hook you are accessing!
2
votes
Accepted
EE3 Extension not showing up - what am I missing?
Turned out that two things were wrong:
In the config.master.php file, $env_config['allow_extensions'] was set to n and should be set to y
This is a migration and had some old entries in ...
2
votes
Custom add-on accessing method from another custom add-on …
I agree with the advice provided by Brian in EECMS Slack. You can do this:
require_once PATH_THIRD . 'your_addon/somefile.php'
$someFile = new SomeFile();
$someFile->method();
2
votes
Accepted
Updating hooks from v2 to v4
There were certainly several extension hook changes with the arrival of EE3, possibly with EE4 too, so you may well need to update the naming of the hooks in your addon.
You can find a complete list ...
2
votes
Accepted
Exp:resso Store Add a new Custom Report
It's not a file path, but a class path. In this function: add_location_reports, change:
$reports["location_summary"] = "\Expresso_store_add_location_reports_ext\LocationReports";
to:
$reports["...
2
votes
Accepted
Is it possible to use an extension in a template like a plugin?
You cannot use ext to call in template as plugin. You must have to create mod.easypost_extention.php file for that. Use this code inside that file.
<?php if ( ! defined('BASEPATH')) exit('No ...
1
vote
Accepted
How to send HTML email (in template) from extension?
Yes Brianne, you can pull the body of the template in your extension. To achieve this you need to create separate library for parsing the template into your extension. And by loading that library you ...
1
vote
Unable to load ext.rte.php after updating from V2 to V6
For the time being, the best solution would be manually remove record from exp_extensions DB table.
And of course, report a bug.
1
vote
How can I use stash->parse in my extension
Quick update - having looked at what causes this error, I found that if I call
ee()->TMPL->fetch_addons();
in my extension before I call stash->parse, it works fine without an issue. Hope ...
1
vote
Accepted
Settings for a module
For modules, you just go ahead and create your own DB table that stores your module settings. So just like you create your modules main table for storing data submitted from your form when you install ...
1
vote
Accepted
How do you get the parsed html of a page on the back end? (Within an Extension Using PHP)
Just in case someone else is looking for the answer:
If after your extension is called you can rebuild the template using the following code
function your_function($obj){
$template_group = "...
1
vote
How do you get the parsed html of a page on the back end? (Within an Extension Using PHP)
I believe you use this extension hook:
https://docs.expressionengine.com/latest/development/extension_hooks/global/template/index.html#template-post-parse
Edit
Here is an example of how this could ...
1
vote
Accepted
How to get data from a hook?
At the end of hook "channel_form_submit_entry_end" it is using the Channel Form Class so $obj->entry['entry_id'] a class property which is not available.
Good news is you can use the method $obj->...
1
vote
Accepted
Storing Single Option Value in Admin
Set up a Global Variable with the value you need. Then you can access the value from within a template simply by including the Global Variable name (within curly brackets) within your templates - e.g....
1
vote
Updating an entry field, without updating every field
It certainly is!
Here's what you need to do (From the manual) based on your example :
ee()->load->library('api');
ee()->api->instantiate('channel_entries');
ee()->api->instantiate(...
1
vote
Accepted
MSM and bespoke extension
Nope, the extension settings are for the entire control panel across all MSM sites by default (no site_id references). You will have to build in your own site_id references into the setting storage. ...
1
vote
Exp:resso Store Send Order Emails To Different Email Addresses
Oh it appears it is very straightforward. So in the extension grab the store emails (I'm just getting all for development) then you can set the BCC attribute as per below.
$emails = Store\Model\Email:...
1
vote
Accepted
Lang text with control panel interface
You can either use built-in Global Variables feature or Low Variables add-on
Both will work same way, you'll just place {variable_name} in your templates, without any other special tags, but you may ...
1
vote
Accepted
How do I find/make the URL to a PHP page in my extension?
You shouldn't be submitting to PHP file in system folder directly, as the system folder might be located outside of web root and so inaccessible for direct requests.
Instead you need to place those ...
1
vote
What's the proper way to alter a form in the control panel? (Using an extension in EE3)
I doubt there is a way to perform that kind of modification using a hook.
What you could do instead (if you need to alter all forms) is modify _shared/form View file (but then of couse you'll need to ...
1
vote
Do something after hook
Well, you are killing the process when you throw a redirect. The redirect() function basically causes a die() affect, ending code termination.
You know you can declare a redirect in the template with ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
extension × 132add-on-development × 32
hook × 24
module × 20
expresso-store × 17
add-on × 16
control-panel × 12
plugin × 11
cartthrob × 9
ee2 × 7
channel-entries × 6
members × 5
php × 4
ee3 × 4
expresso × 4
templates × 3
solspace-freeform × 3
matrix × 3
safecracker × 3
channel × 3
email × 3
javascript × 3
shipping × 3
settings × 3
categories × 2