Post by mars99 » Wed May 12, 2021 10:54 pm

Hi there!
(i'm a newbie in opencart structure and coding, sorry in advance)

I'm trying to use some custom product values in product tabs, product filter in category page and so on, at the moment I'm using VQmod embedding with xml or uplaoding edited files in modification folder.
Now I declared and processed all the variables in the catalog/controller/product/category.php and in the catalog/model/catalog/product.php but I can't use them in the .twig files. sometimes I get some errors and sometimes ju nothing happens, there's a "known" way to do that?
Should I just create the function to get values in model then load it in controller and then use it in template?

At the moment I'm looking for the $data declaration to hook there my custom fields so I get these products info all in $data with the others.

Thanks in advance!

Newbie

Posts

Joined
Wed Mar 17, 2021 11:09 pm

Post by straightlight » Wed May 12, 2021 11:20 pm

mars99 wrote:
Wed May 12, 2021 10:54 pm
Hi there!
(i'm a newbie in opencart structure and coding, sorry in advance)

I'm trying to use some custom product values in product tabs, product filter in category page and so on, at the moment I'm using VQmod embedding with xml or uplaoding edited files in modification folder.
Now I declared and processed all the variables in the catalog/controller/product/category.php and in the catalog/model/catalog/product.php but I can't use them in the .twig files. sometimes I get some errors and sometimes ju nothing happens, there's a "known" way to do that?
Should I just create the function to get values in model then load it in controller and then use it in template?

At the moment I'm looking for the $data declaration to hook there my custom fields so I get these products info all in $data with the others.

Thanks in advance!
OC version. This is what CMS is about. Declaring your models from the controllers and call the response object to load the TWIG files. Bunch of examples from the core controllers can be used to achieve this.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Thu May 13, 2021 4:38 pm

mars99 wrote:
Wed May 12, 2021 10:54 pm
(i'm a newbie in opencart structure and coding, sorry in advance)
Do you understand MVC?

If not, Google it and learn it, then look at how other pages in OC get their data from the controller to the view.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by mars99 » Thu May 13, 2021 10:07 pm

straightlight wrote:
Wed May 12, 2021 11:20 pm
OC version. This is what CMS is about. Declaring your models from the controllers and call the response object to load the TWIG files. Bunch of examples from the core controllers can be used to achieve this.
Hi there! My OC version is 3.0.3.2
paulfeakins wrote:
Thu May 13, 2021 4:38 pm
Do you understand MVC?

If not, Google it and learn it, then look at how other pages in OC get their data from the controller to the view.
Hi and thanks for answering, yes I know what's MVC, I'm not able to hook $data variable and add my custom field, in Admin everything worked fine, I think I'm missing something.

Newbie

Posts

Joined
Wed Mar 17, 2021 11:09 pm

Post by straightlight » Thu May 13, 2021 11:16 pm

mars99 wrote:
Thu May 13, 2021 10:07 pm
straightlight wrote:
Wed May 12, 2021 11:20 pm
OC version. This is what CMS is about. Declaring your models from the controllers and call the response object to load the TWIG files. Bunch of examples from the core controllers can be used to achieve this.
Hi there! My OC version is 3.0.3.2
paulfeakins wrote:
Thu May 13, 2021 4:38 pm
Do you understand MVC?

If not, Google it and learn it, then look at how other pages in OC get their data from the controller to the view.
Hi and thanks for answering, yes I know what's MVC, I'm not able to hook $data variable and add my custom field, in Admin everything worked fine, I think I'm missing something.
Indeed. The codes you are referring about are not posted. However, you could always create a new service request in the Commercial Support section to have this incident request resolved as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mars99 » Fri May 14, 2021 3:15 pm

straightlight wrote:
Thu May 13, 2021 11:16 pm
mars99 wrote:
Thu May 13, 2021 10:07 pm
straightlight wrote:
Wed May 12, 2021 11:20 pm
OC version. This is what CMS is about. Declaring your models from the controllers and call the response object to load the TWIG files. Bunch of examples from the core controllers can be used to achieve this.
Hi there! My OC version is 3.0.3.2
paulfeakins wrote:
Thu May 13, 2021 4:38 pm
Do you understand MVC?

If not, Google it and learn it, then look at how other pages in OC get their data from the controller to the view.
Hi and thanks for answering, yes I know what's MVC, I'm not able to hook $data variable and add my custom field, in Admin everything worked fine, I think I'm missing something.
Indeed. The codes you are referring about are not posted. However, you could always create a new service request in the Commercial Support section to have this incident request resolved as a custom job.
ok

Newbie

Posts

Joined
Wed Mar 17, 2021 11:09 pm
Who is online

Users browsing this forum: No registered users and 103 guests