Jump to content

Cant find admin "Open Pricing" template


dezio

Recommended Posts

admindomainpricing.gif

 

I would like to add my jQuery code so when I enter domain pricing for 1 year period, jQuery automatically add values to "2,3,4... years" fields but I cannot find where is that template.. Can someone help me?

 

I find out hook "AdminAreaHeadOutput" but it didnt run on "Open Pricing" popup page. Also maybe this is a suggestion but I think jQuery script tag should come before executing AdminAreaHeadOutput hooks because when someone want to hook some jQuery code, problem is that jQuery isnt still active.

Link to comment
Share on other sites

I cant find it, is it encrypted?

 

Because I didn't find any hook related to this, i appended code inside jquery core.

 

This is a code if someone want to have this functionality:

 

$(document).ready(function(){
   if (location.href.match(/configdomains\.php\?action=editpricing/)) {
	$('form').before('<input type="checkbox" id="automatically_fill_years" /> Automatically fill 2-10 years based on first year value');

	$('form').submit(function(){
		if( ! $('#automatically_fill_years').is(':checked') )
			return true;

		var $form = $(this);
		var $register = $form.find('input[name^="register\\[0\\]"][name$="\\[1\\]"]');
		var $transfer = $form.find('input[name^="transfer\\[0\\]"][name$="\\[1\\]"]');
		var $renew = $form.find('input[name^="renew\\[0\\]"][name$="\\[1\\]"]');

		$register.each(function(){
			var price = parseFloat( $(this).val() );
			var name_array = $(this).attr('name').match(/[0-9]+/g);
			var currency_id = name_array[1];

			for(i = 2; i <= 10; i++) {
				var $input = $form.find('input[name="register\\[0\\]\\[' + currency_id + '\\]\\[' + i + '\\]"]');

				if( parseInt( $input.val() ) != -1 )
					$input.val( ( price * i ).toFixed(2) );
			}
		});

		$transfer.each(function(){
			var price = parseFloat( $(this).val() );
			var name_array = $(this).attr('name').match(/[0-9]+/g);
			var currency_id = name_array[1];

			for(i = 2; i <= 10; i++) {
				var $input = $form.find('input[name="transfer\\[0\\]\\[' + currency_id + '\\]\\[' + i + '\\]"]');

				if( parseInt( $input.val() ) != -1 )
					$input.val( ( price * i ).toFixed(2) );
			}
		});

		$renew.each(function(){
			var price = parseFloat( $(this).val() );
			var name_array = $(this).attr('name').match(/[0-9]+/g);
			var currency_id = name_array[1];

			for(i = 2; i <= 10; i++) {
				var $input = $form.find('input[name="renew\\[0\\]\\[' + currency_id + '\\]\\[' + i + '\\]"]');

				if( parseInt( $input.val() ) != -1 )
					$input.val( ( price * i ).toFixed(2) );
			}
		});
	});
}
}); 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated