Post by massalha » Tue Apr 10, 2012 3:05 am

Hi,

When you work on OpenCart, you keep Save and then re-Open same product for further changes.
In "Joomla" they use: Save or Apply or Close ...
And if "Apply" uses Ajax, it will be perfect.

I can make this change, using Ajax for you, if you want.

Thanks

Newbie

Posts

Joined
Tue Apr 10, 2012 3:03 am

Post by GoGo OpenCart » Tue Apr 10, 2012 4:01 am

massalha wrote:I can make this change, using Ajax for you, if you want.
And who do you refer to, by using "you"?

If you want, make it, and put it in the extensions' store, free or paid, it doesn't really matter :)

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Active Member

Posts

Joined
Mon Nov 14, 2011 11:30 pm

Post by testudoweb » Thu Jul 19, 2012 6:02 pm

Hi,
you can add following lines to admin/view/template/common/header.tpl, somewhere inside <script> tags

Code: Select all

$(document).ready(function(){
	$("a.button").each(function(){
		var onclick = $(this).attr('onclick');
		if(typeof onclick != 'undefined' && onclick.indexOf('#form') != -1 && onclick.indexOf('.submit()') != -1){
			var apply = '<a class="button" onclick="apply_form()">Apply</a>';
			$(this).after(apply);
		}
	});
});

function apply_form(){
	$.ajax({
		type: 'POST',
		url: $('#form').attr('action'),
		data: $('#form').serialize(),
		dataType: 'text',
		success: function(data){
				if($(data).find('.error').length > 0){
					$("#form").submit();
				}else{
					$('.success,.warning,.attention,.required').remove();
					$(data).find('.success,.warning,.attention,.required').clone().appendTo('div.breadcrumb').css('margin-top','10px');
					setTimeout(function(){$('.success,.warning,.attention,.required').remove()},5000);
				}
			}
	});
}
bye

Newbie

Posts

Joined
Thu Jul 19, 2012 5:57 pm

Post by Elnino3838 » Wed Feb 20, 2013 5:41 am

It works great, thanks for this tip!!!

Calgary Web Design - http://www.beginwithb.com


Newbie

Posts

Joined
Wed Feb 20, 2013 5:37 am
Who is online

Users browsing this forum: No registered users and 30 guests