6 votes
Accepted

Member Group Tabs throws blank screen after EE upgrade to 2.10

open file /system/expressionengine/third_party/ext.sh_member_group_tabs.php and change line 270: if (APP_VER >= '2.6.0') to if (version_compare(APP_VER, '2.6.0', '>=')) it is also needs to ...
  • 131
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

With new Routing capabilities in EE 2.8 - Trying to figure out the best solution

I can think of two ways to do this. One is to use Resource Router. Your config would look something like this: $config['resource_router'] = array( ':num' => function($router, $wildcard) { $...
  • 4,002
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/');
  • 1,987
3 votes
Accepted

Hook for when viewing single entry

Crelate a plugin containing single function, say, function_name. The plugin will accept member_id of logged in visitor ee()->session->userdata('member_id') and ID of entry being viewed, ...
  • 2,846
3 votes
Accepted

Accessing extension settings from plugin throws a PHP warning

Judging from this statement: "The plugin uses the calculation method of the extension", I assume you're doing something like this in your plugin: $ext = new Your_addon_ext(); return $ext->...
  • 4,002
3 votes
Accepted

Add-on Dev: Extending channel->entries and tagdata

You could create an extension which uses the channel_entries_query_result hook to add your variable to each entry row. That will get parsed along with the native vars. To pass data from your module/...
  • 11.3k
2 votes
Accepted

Expresso Store: Extension to exclude modifier amounts when calculating tax

A concern would be that whatever you do to adjust price calculation, you have to be sure it's being adjusted in all instances - not just display of a product, but basket addition, basket display, ...
  • 5,353
2 votes
Accepted

Unable to modify data with ‘entry_submission_ready’ extension hook

Passing by reference doesn't work when calling extension hooks in EE. If you want to alter the field data inside any of the API Channel Entries hooks, you need to change it directly in the API object,...
  • 17.4k
2 votes
Accepted

With the hook entry_submission_end, is it possible to know if the entry is inserted or updated?

I usually check if entry_id = 0 (for new entry) $this->EE->input->get_post('entry_id') == 0
  • 5,781
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
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["...
  • 5,353
2 votes

Shipping Rates in {shipping_method} Dropdown - Expresso Store

Answering my own question here in case it helps anyone else. This question/answer pointed me in the right direction: Do the Expresso Store shipping methods have to be displayed in a dropdown? The ...
  • 23
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();
  • 1,232
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 ...
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 ...
  • 3,572
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....
  • 3,572
1 vote

Installing Extension Ctrl+S Need Help

If you mean this plugin : https://devot-ee.com/add-ons/ctrls I have used this before. the file you get is called ext.ctrl_s.php, and you should install it here /system/expressionengine/third_party/...
  • 2,418
1 vote

Installing Extension Ctrl+S Need Help

All kinds of add-ons should be put on their own folders inside system/expressionengine/third_party/. The info on installing plugins can be useful. Pay attention that the name of the folder should be ...
  • 6,108
1 vote

Member Group Tabs throws blank screen after EE upgrade to 2.10

Thank you Rakesh and Tom. Member Group Tabs is now compatible with EE v2.10.1.
  • 319
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(...
  • 2,418
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. ...
  • 5,353
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:...
  • 185
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 ...
  • 2,846
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 ...
  • 2,846
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 ...
  • 2,846
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 ...
  • 5,900
1 vote
Accepted

Saving entry with grid field isn’t working

Please note this is UNTESTED but written from the actual code files so should play fair... //load up the grid model for later use ee()->load->model('grid_model'); //first we create our field ...
  • 2,418
1 vote

Saving entry with grid field isn’t working

Have you had a look at the Grid Model that is in the system folder? Specifically /system/expressionengine/models/grid_model.php This model has methods for creating new Grid Fields (create_field on ...
  • 2,418

Only top scored, non community-wiki answers of a minimum length are eligible