Is it possible to use only the OC Event system for these overrides?
I need to override the core index function of the product controller. I want to edit the core file and add this line:
$data['quantity'] = $product_info['quantity'];
to the function index() in "class ControllerProductProduct extends Controller"
and then I need add this line in product.twig file:
<span>{{ quantity }}</span>
I want to use only the OC Event system, not ocmod or vqmod.
It is real?
Thanks for help.
First you need to add your event into database, you can use
addEvent
function inside your moduleinstall
function, like this:Or add it manually:
Now create this file:
And its contents:
Result: