Post by anikedeshpande » Tue Jun 22, 2021 2:02 am

I am using V 3.0.3.7

I have added in oc_setting table around 80 rows with
code = module_myabc - same for all 80 rows
key = module_myabc_color , module_myabc_bgcolor, module_myabc_font_size ....... like these total 80 rows
value = #FF0000, #999999, 12px .... according to above keys.

it is like
---------------------------------------------------------------------------------------------------------
id | code | key | value
----------------------------------------------------------------------------------------------------------
1 | module_myabc | module_myabc_color | #FF0000
----------------------------------------------------------------------------------------------------------
2 | module_myabc | module_myabc_bgcolor | #999999
----------------------------------------------------------------------------------------------------------
3 | module_myabc | module_myabc_font_size | 12px
----------------------------------------------------------------------------------------------------------

Now I want to use these values in style declared in twig file.

e.g.

Code: Select all

<style>
.myclass {
color : {{ module_myabc_color }}; (which should get as #FF0000 as per database table)
background: {{ module_myabc_bgcolor }}};
font-size: {{ module_myabc_font_size }};
}
</style>
How can I achieve this ?

I am getting this data with

Code: Select all

 $this->load->model('setting/setting');
   $this->model_setting_setting->getSetting('module_myabc');
But in controller file, unable to set this data as

Code: Select all

$data['module_myabc_color'] = '#FF0000';
$data['module_myabc_bgcolor'] = '#999999';
$data['module_myabc_font_size'] = '12px';
How can I retrieve all 80 rows in this format ?


Posts

Joined
Fri May 21, 2021 4:13 pm

Post by straightlight » Tue Jun 22, 2021 3:35 am

This could be accomplished with an Event.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by paulfeakins » Tue Jun 22, 2021 6:29 pm

straightlight wrote:
Tue Jun 22, 2021 3:35 am
This could be accomplished with an Event.
Why not give an example then?

And not just a link to the Events documentation.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by straightlight » Tue Jun 22, 2021 6:37 pm

paulfeakins wrote:
Tue Jun 22, 2021 6:29 pm
straightlight wrote:
Tue Jun 22, 2021 3:35 am
This could be accomplished with an Event.
Why not give an example then?

And not just a link to the Events documentation.
Because the documentation that is located on the same location at Github Opencart repository already provides an example.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by paulfeakins » Fri Jun 25, 2021 7:33 pm

straightlight wrote:
Tue Jun 22, 2021 6:37 pm
Because the documentation that is located on the same location at Github Opencart repository already provides an example.
Ok but a link that that specific example would help?

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by straightlight » Fri Jun 25, 2021 7:35 pm

paulfeakins wrote:
Fri Jun 25, 2021 7:33 pm
straightlight wrote:
Tue Jun 22, 2021 6:37 pm
Because the documentation that is located on the same location at Github Opencart repository already provides an example.
Ok but a link that that specific example would help?
There are many topics covering this already. There's enough to tell people to use Google and the forum search, there's no need for moderation to follow the same unleads.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Users browsing this forum: No registered users and 19 guests