Page 1 of 1
I would like to open a page in a box like T&Cs
Posted: Thu Dec 03, 2015 5:16 am
by xoomit
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
Re: I would like to open a page in a box like T&Cs
Posted: Thu Dec 03, 2015 1:10 pm
by jimmyphong
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
Re: I would like to open a page in a box like T&Cs
Posted: Thu Dec 03, 2015 2:32 pm
by xoomit
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
Re: I would like to open a page in a box like T&Cs
Posted: Thu Dec 03, 2015 3:05 pm
by jimmyphong
where link you added ?
Re: I would like to open a page in a box like T&Cs
Posted: Thu Dec 03, 2015 3:58 pm
by OpenTeam
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
Re: I would like to open a page in a box like T&Cs
Posted: Thu Dec 03, 2015 6:34 pm
by xoomit
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!
Re: I would like to open a page in a box like T&Cs
Posted: Fri Apr 29, 2016 1:48 pm
by Photospirit
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
Re: I would like to open a page in a box like T&Cs
Posted: Fri Mar 30, 2018 5:10 pm
by smellyjsb
is there a code that goes in - extensions - modules - welcome - add module? put code into source section and it creates a pop up?
Re: I would like to open a page in a box like T&Cs
Posted: Fri Mar 30, 2018 5:43 pm
by kestas
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
Re: I would like to open a page in a box like T&Cs
Posted: Fri Mar 30, 2018 6:56 pm
by smellyjsb
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
Re: I would like to open a page in a box like T&Cs
Posted: Fri Mar 30, 2018 7:09 pm
by kestas
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
Re: I would like to open a page in a box like T&Cs
Posted: Fri Mar 30, 2018 10:15 pm
by smellyjsb
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

Re: I would like to open a page in a box like T&Cs
Posted: Fri Mar 30, 2018 10:28 pm
by kestas
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