Post by R0G3RRR » Thu Oct 19, 2017 7:04 pm

Hello, I would like your help.

I have to create different layouts for products. EX: One type of layout for mobile phones and others for computers.

In opencart 1.5.1.3 I could do in the controller informing the path of the .tpl file however in opencart 3x I do not know where to put this path.

I've tried creating a layout in layout-> layout when I get to Routes that I do not know which way to report.



=============================Solução==================================
After banging my head a little and looking in forums I realized that inside the product.php controller there is a call to the view


Code: Select all

$this->response->setOutput($this->load->view('product/product', $data));

Changing the product / product to Product/Name-of-Layout and clearing the cache appears the desired .tiwg now just use the getProductLayoutId function that is in the model to know the template and set in control with an IF: D

Newbie

Posts

Joined
Thu Oct 19, 2017 6:57 pm

Post by cyclops12 » Sun Oct 22, 2017 4:33 pm

Or you could create a new layout in Design/Layouts, then in the edit product page, in the Design tab, just assign the new layout from the Layout Override dropdown box

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am
Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 522 guests