Post by pac_indahood » Fri Jul 29, 2016 6:12 pm

Hello,

I want to change behavior of check button. now the check button is preseted to be checked and after uncheck will show a form. i want only to inverse like.. when check to show the form.

This is the code:

Code: Select all

<% }else if(f.type == "checkbox"){ %>
	    		

			    <div id="<%= model.config.id %>_<%= f.id %>_input" 
			    class="checkbox-input form-group sort-item <%= display ? '' : 'hidden' %> <%= f.class ? f.class : '' %> <%= require ? 'required' : '' %>" 
			    data-sort="<%= f.sort_order %>">
			    	
			    	<% if(f.options){ %>
			    		<%  var i = 0 %> 
			    		<% _.each(f.options, function(option){ %>
		    			<div class="col-xs-12">
					      <label for="<%= model.config.id %>_<%= f.id %>" >
						      <input type="hidden" 
						          name="<%= model.config.id %>.<%= f.id %>" 
						          value="0" />
					          <input type="checkbox" 
					          autocomplete="<%= autocomplete %>" 
					          name="<%= model.config.id %>.<%= f.id %>.<%= i %>" 
					          id="<%= model.config.id %>_<%= f.id %>_<%= option.value %>" 
					          class="validate not-required" 
					          <%= require ? 'required' : '' %> 
					          value="<%= option.value %>" 
					          <%= model[model.config.id][f.id][i] > 0 ? 'checked="checked"' : '' %> />

					          <span <%= f.tooltip ? 'data-toggle="tooltip"' : '' %> title="<%= f.tooltip %>"><%= htmlDecode(option.name) %></span> 
					        </label>
					    </div>
					    <% i++ %>
					    <% })%>
			    	<% }else{ %>
			    		<div class="col-xs-12">
					      <label for="<%= model.config.id %>_<%= f.id %>" class="control-label" >
						      <input type="hidden" 
						          name="<%= model.config.id %>.<%= f.id %>" 
						          value="0" />
					          <input type="checkbox" 
					          autocomplete="<%= autocomplete %>" 
					          name="<%= model.config.id %>.<%= f.id %>" 
					          id="<%= model.config.id %>_<%= f.id %>" 
					          class="validate <%= require ? 'required' : 'not-required' %>" 
					          <%= require ? 'required' : '' %> 
					          value="1" 
					          <%= model[model.config.id][f.id] == 1 ? 'checked="checked"' : '' %> />
Can someone give an ideea?

Thank you
Regards
Last edited by straightlight on Fri Jul 29, 2016 9:09 pm, edited 1 time in total.
Reason: Added code tags.

New member

Posts

Joined
Sat Oct 30, 2010 2:50 am

Post by straightlight » Fri Jul 29, 2016 9:12 pm

The provided codes are non-PHP codes which are non-compliant with what Opencart delivers out-of-the-box especially since it involves on using aside functions that may originate from extensions. Opencart uses PHP with the delivered default theme.

However, if you wish to use another programming language to accomplish what you need, you can always request custom work to be done from the Commercial Support section of the forum.

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 OSWorX » Fri Jul 29, 2016 10:27 pm

straightlight wrote:The provided codes are non-PHP codes which are non-compliant with what Opencart delivers out-of-the-box especially since it involves on using aside functions that may originate from extensions. Opencart uses PHP with the delivered default theme.

However, if you wish to use another programming language to accomplish what you need, you can always request custom work to be done from the Commercial Support section of the forum.
Partly true, this code follows the 'new' twig temlplate engine which seems to be introduced with 2.3.x.
See for example:
https://github.com/opencart/opencart/bl ... /cart.twig

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by straightlight » Fri Jul 29, 2016 11:08 pm

Good to know new implementation subjects are involved into the v2.3 Beta release of Opencart. Due to the non-stable yet release, this may not be an official stable implementation until the official release of Opencart v2.3 will be announced as a stable release.

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 pac_indahood » Mon Aug 01, 2016 6:39 pm

So... no idea?

New member

Posts

Joined
Sat Oct 30, 2010 2:50 am

Post by straightlight » Mon Aug 01, 2016 6:53 pm

pac_indahood wrote:So... no idea?
Without an extension, at this time, it would be hard to dictate an accurate response based on what's been mentioned above since the abolition of Opencart v2.3 release: http://forum.opencart.com/viewtopic.php?f=2&t=165980

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 pac_indahood » Mon Aug 01, 2016 8:35 pm

This code is from a checkout module aqc - and i want only to reverse functionality.(this part of code is in a .tpl file)

All a wanted it's just an idea... or a place where i can read about it.

Thank you very much straightlight

New member

Posts

Joined
Sat Oct 30, 2010 2:50 am

Post by straightlight » Tue Aug 02, 2016 7:49 am

pac_indahood wrote:This code is from a checkout module aqc - and i want only to reverse functionality.(this part of code is in a .tpl file)

All a wanted it's just an idea... or a place where i can read about it.

Thank you very much straightlight
No problem. An official release of Opencart v2.3.0.2 has been released today: http://forum.opencart.com/viewtopic.php?f=2&t=166011 . :)

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
Who is online

Users browsing this forum: No registered users and 3 guests