When updating from 8.0.1.0 I somehow lost my override functionality at /includes/system/override/actions/os_c__actions_add_product.php.
I would guess wildly that it has something to do with the name changes?
Overriding catalog actions in v1.0.8.1 and later
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Overriding catalog actions in v1.0.8.1 and later
Try (doubled underscore is intentional) saved in includes/hooks/shop/system/_22_actions.php, rename the override files to something like add_product.php, and update the action file as done in https://github.com/CE-PhoenixCart/Phoen ... e018a5b558
At least one of Rainer's add-ons does this correctly. QTPro maybe?
Code: Select all
class hook_shop_system__22_actions {
public function listen_startApplication() {
$GLOBALS['class_index']->find_all_actions_under(DIR_FS_CATALOG . 'includes/system/override/actions');
}
}At least one of Rainer's add-ons does this correctly. QTPro maybe?
- edfaught
- Member
- Posts: 49
- Joined: Mon Oct 26, 2020 3:22 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 2 times
Re: Overriding catalog actions in v1.0.8.1 and later
PHP Fatal error: Uncaught Error: Call to a member function find_all_actions_under() on null in \includes\hooks\shop\system\_22_actions.php:28
Stack trace:
#0 \includes\system\versioned\1.0.8.1\hooks.php(160): hook_shop_system__22_actions-
>listen_startApplication(Array)
#1 \includes\application_top.php(34): hooks->generate('startApplicatio...')
#2 \index.php(13): require('C:\\Users\\Ed_2\\M...')
#3 {main}
thrown in \includes\hooks\shop\system\_22_actions.php on line 28
I searched for this function and found it named tep_find_all_actions_under() in autoloader.php but renaming it here didn't fix the problem. I'm not even sure what the issue is...
Stack trace:
#0 \includes\system\versioned\1.0.8.1\hooks.php(160): hook_shop_system__22_actions-
>listen_startApplication(Array)
#1 \includes\application_top.php(34): hooks->generate('startApplicatio...')
#2 \index.php(13): require('C:\\Users\\Ed_2\\M...')
#3 {main}
thrown in \includes\hooks\shop\system\_22_actions.php on line 28
I searched for this function and found it named tep_find_all_actions_under() in autoloader.php but renaming it here didn't fix the problem. I'm not even sure what the issue is...
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Overriding catalog actions in v1.0.8.1 and later
It says $class_index doesn't exist. You might have to update more. It looks like class_index was v1.0.8.3: https://github.com/CE-PhoenixCart/Phoen ... cf9d8b29dc
- edfaught
- Member
- Posts: 49
- Joined: Mon Oct 26, 2020 3:22 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 2 times
Re: Overriding catalog actions in v1.0.8.1 and later
My editor (Netbeans) shows this as syntax error also.
PHP Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting function (T_FUNCTION) or const (T_CONST) in \includes\system\override\actions\add_product.php on line 59
Phoenix 1.0.8.4
PHP Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting function (T_FUNCTION) or const (T_CONST) in \includes\system\override\actions\add_product.php on line 59
Code: Select all
\Href::redirect(\Guarantor::ensure_global('Linker')
->build($GLOBALS['goto'])
->retain_parameters($GLOBALS['parameters']));-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Overriding catalog actions in v1.0.8.1 and later
This is the kind of thing that happens when you have a mismatched }. It's saying that it has the code you posted but is expecting a function or const. It would be expecting a function or const if it is outside a function. If it were inside a function (where it should be), it wouldn't give that error.