Replace:Lumirion wrote: ↑Thu May 09, 2024 12:17 amOk. Just as a test I switched the route back to the product page and replaced my str_replace withand added that css file with my styles in it. The result is the same error about preg_replace being passed a NULL as the third value in line 65 of action.php. My css is not inserted into the product page either. Line 65 of action.phpCode: Select all
$this->document->addStyle('catalog/view/PDPStyles/productpage.css');
seems to be assembling the route to my insertproductpagestyles.php at admin/controller/extension/module/. $this->route seems to be returning null, so my controller is not referenced and my event handler is not called. Is there something wrong with either of these two addEvent lines?Code: Select all
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);
andCode: Select all
$this->model_setting_event->addEvent('insertproductpagestyles', 'catalog/view/common/header/after', 'extension/module/insertproductpagestyles/addproductpagestyles');
Is it trying to look for my controller in catalog/controller/extension/module/ instead of in admin/controller/extension/module/ ?Code: Select all
$this->model_setting_event->addEvent('insertproductpagestyles', 'catalog/view/product/product/after', 'extension/module/insertproductpagestyles/addproductpagestyles');
Code: Select all
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);
Code: Select all
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', (string)$this->route);