opencart / opencart

A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.

Home Page:https://www.opencart.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Events Bugs

ppalashturov opened this issue · comments

Hello,

After I updated to the latest "master" branch and tried to upload a module with an event:

Example:

$view = $this->load->view('extension/oc_module/shipping/module', $data);
$output = str_replace('</fieldset>', '</fieldset>' . $view, $output);

This thing duplicates the code in 3 more places. I had to edit the given twig file, but it edits and adds code everywhere! And it also doesn't find lines that worked without problems in an older version of master from two weeks ago!

This also broke the work of many other places in events!

@danielkerr @stalker780

Greetings!

Same problem here!

@ppalashturov Please stop mentioning me, I have nothing to do with this and I do not manage this project.

Don't know why you mentioned me.
I did not change anything in events engine :)

What template do you try to modify?
Check how many events you have for this route.
I cannot reproduce this with my extensions. I use the same str_replace for some twig templates.

Does your $output contain multiple '</fieldset>' occurances in your rendered twig template which you are trying to modify in your after-event ?

No. I replace </body> tag

No. I replace </body> tag

My question was for @ppalashturov

Hello @mhcwebdesign,

My Event:

`$event_data_address = [
            'code' => 'oc_shipping',
            'description' => '',
            'trigger' => 'catalog/view/checkout/shipping_method/after',
            'action' => 'extension/oc_shipping/shipping/shipping.address',
            'status' => 1,
            'sort_order' => 1
        ];
        $this->model_setting_event->addEvent($event_data_address);`

My Output:

$view = $this->load->view('extension/oc_module/shipping/module', $data);
$output = str_replace('</fieldset>', '</fieldset>' . $view, $output);

This thing duplicates the code in 3 more places.
Test URL Site: https://shipping.opencartsupports.com/ in checkout not working!

Greetings!