Page 1 of 1

[MOD] - Put payment terms into an ajax thickbox popup

Posted: Thu Feb 25, 2010 5:05 am
by Qphoria
For those who dislike the way the terms link on the payment page pops up a new page with the full store and confusing buttons, this is a quick mod to display only the terms in a thickbox.

Image


1. EDIT: catalog/controller/information/information.php

2. FIND (the very bottom):

Code: Select all

}
?>
3. BEFORE, ADD:

Code: Select all

public function loadInfo() {
		$this->load->model('catalog/information');
		if (isset($this->request->get['information_id'])) {
			$information_id = $this->request->get['information_id'];
		} else {
			$information_id = ($this->config->get('config_checkout_id')) ? $this->config->get('config_checkout_id') : $this->config->get('config_checkout');
		}		
		$information_info = $this->model_catalog_information->getInformation($information_id);

		$output = '
		<div id="content" style="margin: 0pt; padding: 0pt;">
		  <div class="top">
		    <div class="left"></div>
		    <div class="right"></div>
		    <div class="center">
		      <h1>'.$information_info['title'].'</h1>
		    </div>
		  </div>
		  <div class="middle">
		    <p>'.html_entity_decode($information_info['description']).'</p>
		  </div>
		  <div class="bottom">
		    <div class="left"></div>
		    <div class="right"></div>
		    <div class="center"></div>
		  </div>
		</div>
		';

		$this->response->setOutput($output, $this->config->get('config_compression'));
	}
4. EDIT: catalog/language/english/checkout/payment.php

5. FIND:

Code: Select all

$_['text_agree']           = 'I have read and agree to the <a onclick="window.open(\'%s\');"><b>%s</b></a>';
6. REPLACE WITH:

Code: Select all

$_['text_agree']           = 'I have read and agree to the <a class="thickbox" href="index.php?route=information/information/loadInfo&height=400&width=600" alt="%s"><b>%s</b></a>';
IF USING MY FANCYBOX REPLACEMENT MOD. YOU MUST ALSO DO THESE STEPS:
7. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl

8. FIND:

Code: Select all

</head>
9. BEFORE, ADD:

Code: Select all

<style type="text/css">
div#fancybox-inner { text-align: left; }
</style>
<script type="text/javascript">
$(document).ready(function() {
   $("a.thickbox").fancybox({
      'speedIn' : 600,
      'speedOut' : 500,
      'transitionIn': 'elastic',
      'transitionOut': 'elastic',
      'easingIn' : 'easeOutBack',
      'easingOut' : 'easeInBack',
	  'autoDimensions': false,
	  'width': 620,
      'height': 400,
	  'hideOnContentClick': true,
	  'titleShow': false
   });
});
</script>

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Mon Mar 01, 2010 4:09 pm
by tonyb299
Thanks Q ;D

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Fri Mar 26, 2010 2:14 am
by i2Paq
Nice one Q!

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Fri Mar 26, 2010 3:10 am
by MrConn
Any idea how to do this with fancybox, then? :-)

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Fri Mar 26, 2010 4:09 am
by Qphoria
I've added a step 7 if using the fancybox replacement mod. See the first post

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Wed Apr 14, 2010 9:25 pm
by silanli_53
Thanksss:)

is registered with the privacy policy in how we do it

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Wed Apr 14, 2010 9:55 pm
by Qphoria
its all the same
This is also done for you in 1.4.7 as I've added it to the core

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Fri Apr 16, 2010 4:02 pm
by dramony
Hey Q,

How did you call fancy box on page load?

Thanks!

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Mon May 10, 2010 6:26 am
by sirskull
getting this erro when i open the popup
Fatal error: Cannot redeclare ControllerInformationInformation::loadInfo() in F:\xampp\htdocs\lcfinal\catalog\controller\information\information.php on line 123

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Wed Aug 25, 2010 6:10 am
by smorelli
I'm using 1.48b and this is not working for me. I made sure all the steps were covered, but the agreement is replacing the existing page istead of using the fancybox or thickbox for that matter. What else would be missing?

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Wed Aug 25, 2010 6:17 am
by Qphoria
smorelli wrote:I'm using 1.48b and this is not working for me. I made sure all the steps were covered, but the agreement is replacing the existing page istead of using the fancybox or thickbox for that matter. What else would be missing?
This mod is meant for 146 and earlier. This is already part of the core as of 147 and is implemented slightly differently and not compatible

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Sat Jun 18, 2011 4:24 am
by ifyouseek
Just incase anyone needs it, i was looking how to do this for a while.

This is the link i used to load the thickbox popup for any other information page to popup like the terms and conditions on checkout, the information_id needs changed to the correct page id for your link.

Code: Select all

<a class="thickbox" href="index.php?route=information/information/loadInfo&information_id=29" alt="More Info"><b>More Info...</b></a>

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Sat Aug 29, 2015 7:54 am
by cart builder
I know this is resurrecting an old thread but I could really do with some help please! I've followed Q's instructions to get the ajax thickbox popup for terms & conditions and then ifyouseek's advice for getting the thickbox popup for privacy policy. Everything has worked out fine except on checkout (register account) when clicking the privacy policy link, I get the popup for terms & conditions.

In catalog/language/english/checkout/checkout.php - my script is:

$_['text_agree'] = 'I have read and agree to the <a class="colorbox" href="index.php?route=information/information/loadInfo&height=500&width=400" alt="%s"><b>%s</b></a>';

In catalog/language/english/account/register.php - my script is:

$_['text_agree'] = 'I have read and agree to the <a class="colorbox" href="index.php?route=information/information/loadInfo&information_id=3&height=500&width=400" alt="%s"><b>%s</b></a>';


I'm using OC 1.5.5.1 - any help would be really appreciated!

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Sat Aug 29, 2015 10:41 pm
by Qphoria
change the information_id=x to the id of your pp instead of t&c.

Re: [MOD] - Put payment terms into an ajax thickbox popup

Posted: Sun Aug 30, 2015 12:24 am
by cart builder
Thanks Q. That's what I don't understand - I've already set the id to pp (in my case id=3) in catalog/language/english/account/register.php:

$_['text_agree'] = 'I have read and agree to the <a class="colorbox" href="index.php?route=information/information/loadInfo&information_id=3&height=500&width=400" alt="%s"><b>%s</b></a>'; (This is working fine for the pp link in the Register Account page)

And id is set to t&c (in my case id=5) in catalog/language/english/checkout/checkout.php:

$_['text_agree'] = 'I have read and agree to the <a class="colorbox" href="index.php?route=information/information/loadInfo&information_id=5&height=500&width=400" alt="%s"><b>%s</b></a>'; (This is working fine for the t&c link in the Checkout page)


...and just to test, I set the id for delivery info (id=6) in catalog/language/english/checkout/checkout.php:

$_['text_agree'] = 'I have read and agree to the <a class="colorbox" href="index.php?route=information/information/loadInfo&information_id=6&height=500&width=400" alt="%s"><b>%s</b></a>';

....and the result was the same, that the script in catalog/language/english/checkout/checkout.php overides the ajax popup for the privacy policy link in checkout (register account), and so I got the delivery details in the ajax popup box when clicking the pp link. I'm wondering if changes to the original script in step 3 (catalog/controller/information/information.php) might solve this issue? Thank you.