Post by xoomit » Thu Dec 03, 2015 5:16 am

Hi OC-community,

I have some products which are just shipped at certain times. To give customers more information on this I'd like to put a link in the product description that shows some FAQs in a pop-up window. I want the pop-up to be exactly like the terms & conditions box, so no header & footer, but just the text on the information page in a box. Does anyone have an idea how this could be achieved?

Thanks & best,
Torge

New member

Posts

Joined
Tue Jun 19, 2012 6:09 am

Post by jimmyphong » Thu Dec 03, 2015 1:10 pm

in description editor in code view add

<a href="http://demo.opencart.com/index.php?rout ... ation_id=3" class="agree"><b> You Content </b></a>

with href is information you need to show

News CMS || Plus SEO || Live Price change with Option Select


Active Member

Posts

Joined
Sat Aug 13, 2011 2:48 am


Post by xoomit » Thu Dec 03, 2015 2:32 pm

Hej jimmyphong,

I tried that already and it doesn't work unfortunately. See: https://www.diestadtgaertner.de/pflanzen/erdbeerminze. Just retried to make sure but still no luck. Any further ideas?

Thanks & best,
Torge

New member

Posts

Joined
Tue Jun 19, 2012 6:09 am

Post by jimmyphong » Thu Dec 03, 2015 3:05 pm

where link you added ?

News CMS || Plus SEO || Live Price change with Option Select


Active Member

Posts

Joined
Sat Aug 13, 2011 2:48 am


Post by OpenTeam » Thu Dec 03, 2015 3:58 pm

Hello,

You will need to follow the following steps in order to display your text/description in a pop-up (modal) without header and footer.

1. You will need to insert your description in the Admin Panel, in the information section.

2. You will need to modify the Information Controller in order to display the description only without header and footer. Open the file /catalog/information/information.php

3. Look for the following code in the index method:

Code: Select all

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/information.tpl')) {
	$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/information/information.tpl', $data));
} else {
	$this->response->setOutput($this->load->view('default/template/information/information.tpl', $data));
}
4. Replace the code by this one:

Code: Select all

if (isset($this->request->get['type']) && $this->request->get['type']=="textonly") {
	$this->response->setOutput($data['description']);
} else {
	if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/information.tpl')) {
		$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/information/information.tpl', $data));
	} else {
		$this->response->setOutput($this->load->view('default/template/information/information.tpl', $data));
	}
}
5. Copy the following code in your JavaScript file:

Code: Select all

$(document).ready(function() {
	$('#faq-modal').click(function(){
		var $linkdata = $(this);
		var $dialog = $('<div></div>')
			.load('/index.php?route=information/information&information_id=X&type=textonly')
			.dialog({
				autoOpen: false,
				title: $linkdata.attr('title'),
				width: 600
			});
		
		$dialog.dialog('open');
		return false;
	});
});
N.B: You will need to replace the X by the information_id obtained from the Admin Panel while you created a new page with your FAQ description.

6.Finally, add a link in your product description. You will find an example below:

Code: Select all

<a href="javascript:void(0)" id="faq-modal" title="My FAQ Title">MY FAQ TEXT IN THE DESCRIPTION</a>
Hope it helps.

Best Regards,
OpenTeam

User avatar
Active Member

Posts

Joined
Tue May 19, 2015 2:31 am

Post by xoomit » Thu Dec 03, 2015 6:34 pm

Hi OpenTeam,

in a word: WOW! This does the trick perfectly. Thank you so very much. The only thing I change was the width in the JS to width: '80%'. Perfect.

Thanks!

New member

Posts

Joined
Tue Jun 19, 2012 6:09 am

Post by Photospirit » Fri Apr 29, 2016 1:48 pm

Hi,

I've added the code provided by OpenTeam to my last step of the checkout process (confirm.tpl)
However, no pop-up is opening.

I'm having a multistore site where I need to display information for the German Shop only. My code in the confirm.tpl is as follows. Not sure where to place the JS-Snippet.

Code: Select all

<?php 
$url =  "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
if (strpos($url,'.de') !== false) { ?>
<a href="javascript:void(0)" id="faq-modal" title="Wiederrufsrecht"><?php echo $text_returner; ?></a>
<?php } ?>

<script>
$(document).ready(function() {
   $('#faq-modal').click(function(){
	  var $linkdata = $(this);
	  var $dialog = $('<div></div>')
		 .load('/index.php?route=information/information&information_id=4&type=textonly')
		 .dialog({
			autoOpen: false,
			title: $linkdata.attr('title'),
			width: 600
		 });
	  
	  $dialog.dialog('open');
	  return false;
   });
});
</script>
I've also changed the code the information.php File.

Any clue what I'm doing wrong here?
Many thanks, Chris

New member

Posts

Joined
Sat Oct 23, 2010 8:16 pm

Post by smellyjsb » Fri Mar 30, 2018 5:10 pm

is there a code that goes in - extensions - modules - welcome - add module? put code into source section and it creates a pop up?

Newbie

Posts

Joined
Mon Mar 26, 2018 3:20 pm

Post by kestas » Fri Mar 30, 2018 5:43 pm

smellyjsb wrote:
Fri Mar 30, 2018 5:10 pm
is there a code that goes in - extensions - modules - welcome - add module? put code into source section and it creates a pop up?
Hi,
maybe you are looking something like this: https://www.opencart.com/index.php?rout ... =SmartTech

Cheers

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by smellyjsb » Fri Mar 30, 2018 6:56 pm

Thank you for your reply - the code i had just went in there and didn't have any extensions to add - i dont have any ftp or install section to my site as set up by someone else who has since closed - i am really thinking of just closing it all as its getting me down
my site works - www.justsimplyblanks.co.uk
cheers
mel

Newbie

Posts

Joined
Mon Mar 26, 2018 3:20 pm

Post by kestas » Fri Mar 30, 2018 7:09 pm

smellyjsb wrote:
Fri Mar 30, 2018 6:56 pm
Thank you for your reply - the code i had just went in there and didn't have any extensions to add - i dont have any ftp or install section to my site as set up by someone else who has since closed - i am really thinking of just closing it all as its getting me down
my site works - www.justsimplyblanks.co.uk
cheers
mel
Never give up... :) I think yo can all renew if you contact your server provider where your shop is registered and placed. Or find some one who can help to do it for you. Maybe not for free but anyway you should try.
Cheers

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by smellyjsb » Fri Mar 30, 2018 10:15 pm

The company that built my site is closed :( i have a hosting company but no idea what i am doing - the pop up box i had was just text pop into script of some sort that went into the welcome - add module box via admin. I only have admin access to site - nothing on my pc re opencart at all.

I think i might be better off changing the whole site for something easier to use :(

Newbie

Posts

Joined
Mon Mar 26, 2018 3:20 pm

Post by kestas » Fri Mar 30, 2018 10:28 pm

smellyjsb wrote:
Fri Mar 30, 2018 10:15 pm
The company that built my site is closed :( i have a hosting company but no idea what i am doing - the pop up box i had was just text pop into script of some sort that went into the welcome - add module box via admin. I only have admin access to site - nothing on my pc re opencart at all.

I think i might be better off changing the whole site for something easier to use :(
You can find another company which can help to renew your site. From another hand Opencart is very simple for admin. So you can learn little bit and do not change to another platform. With another platform also will be similar difficulties...

Cheers

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am
Who is online

Users browsing this forum: No registered users and 40 guests