Post by Qphoria » Thu Feb 25, 2010 5:05 am

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>

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tonyb299 » Mon Mar 01, 2010 4:09 pm

Thanks Q ;D

picture mouse mats and mugs


New member

Posts

Joined
Mon Jan 11, 2010 5:51 am
Location - East of England, UK

Post by i2Paq » Fri Mar 26, 2010 2:14 am

Nice one Q!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by MrConn » Fri Mar 26, 2010 3:10 am

Any idea how to do this with fancybox, then? :-)

Image
Nemmelig.no - Billige Gadgets!


Active Member

Posts

Joined
Tue Mar 23, 2010 8:08 am

Post by Qphoria » Fri Mar 26, 2010 4:09 am

I've added a step 7 if using the fancybox replacement mod. See the first post

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by silanli_53 » Wed Apr 14, 2010 9:25 pm

Thanksss:)

is registered with the privacy policy in how we do it

Cafe Koltuk Çeşitleri

Laptop Sırt Çantası


User avatar
New member

Posts

Joined
Fri Feb 19, 2010 8:54 am


Post by Qphoria » Wed Apr 14, 2010 9:55 pm

its all the same
This is also done for you in 1.4.7 as I've added it to the core

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dramony » Fri Apr 16, 2010 4:02 pm

Hey Q,

How did you call fancy box on page load?

Thanks!

Active Member

Posts

Joined
Sat Oct 24, 2009 12:34 pm

Post by sirskull » Mon May 10, 2010 6:26 am

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

Igor S. Costa


User avatar
New member

Posts

Joined
Sat Mar 27, 2010 2:45 pm

Post by smorelli » Wed Aug 25, 2010 6:10 am

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?

New member

Posts

Joined
Wed Jan 27, 2010 6:28 am

Post by Qphoria » Wed Aug 25, 2010 6:17 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ifyouseek » Sat Jun 18, 2011 4:24 am

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>

Active Member

Posts

Joined
Thu May 06, 2010 4:40 pm

Post by cart builder » Sat Aug 29, 2015 7:54 am

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!

New member

Posts

Joined
Wed May 15, 2013 7:11 pm
Location - England

Post by Qphoria » Sat Aug 29, 2015 10:41 pm

change the information_id=x to the id of your pp instead of t&c.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by cart builder » Sun Aug 30, 2015 12:24 am

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.

New member

Posts

Joined
Wed May 15, 2013 7:11 pm
Location - England
Who is online

Users browsing this forum: Google Adsense [Bot] and 7 guests