3

I have created one controller inside catalog/controller/module/same_collection.php

Inside that :

class ControllerModuleSameCollection extends Controller {
        //User Product History
        public function index($product_id) {
           echo $product_id;
        } 
}

I have try to call it inside another controller like this $data['same_color'] = $this->load->controller('module/same_color' ,['product_id' => 2] );

and I try to by access it using url like this

  mydomain.com/index.php?route=module/same_collection&product_id=2

but it's not working. Please help!!!

chhorn soro
  • 179
  • 2
  • 13

1 Answers1

4

It seems like you have not created your module properly. Make sure your module's setting is saved in module table . If your module's code is not there in the table then you won't get any parameter in your index() method.

Narendrasingh Sisodia
  • 19,948
  • 5
  • 40
  • 50
Vidhyut Pandya
  • 1,481
  • 1
  • 12
  • 23