Jump to content

Including THICKBOX on all the pages, not only Product Info Page ...


Recommended Posts

You need to modify all the PHP files of the pages you want to include thickbox. For example, to add thickbox to all CMS pages, add the following before to line 15 of cms.php (before including header.php):

$css_files = array(__PS_BASE_URI__.'css/thickbox.css' => 'all');
$js_files = array(__PS_BASE_URI__.'js/jquery/thickbox-modified.js');



Then you need to add the following in the TPL files of the pages you want to include thickbox. For example, to add thickbox to all CMS pages, add the following to the top of cms.tpl:

{include file=$tpl_dir./thickbox.tpl}

Link to comment
Share on other sites

  • 1 month later...

I'm having a small problem with the order.php file.
I managed to add thickbox on all my required pages, excepting the FIRST STEP of the order page.

When the card has products in it, on the order.php page that displays the cart's content, Thickbox doesn't work. I tried a whole bunch of combinations for adding that

    $css_files = array(__PS_BASE_URI__.'css/thickbox.css' => 'all');
   $js_files = array(__PS_BASE_URI__.'js/jquery/thickbox-modified.js');

in order.php , but it seems i can only get it to work on the other steps.

The rest was easy, because order.php contained:
/*
* Manage address
*/
function processAddress()
.....

so i knew where to add that code. But for the first step that dispalys cart total, i'm unable to make it work.

Help please?

Link to comment
Share on other sites

I think you need to add those lines before line 114 in order.php (the include header.php line). Change this section:

/* Default page */
$smarty->assign('empty', 1);
Tools::safePostVars();
include_once(dirname(__FILE__).'/header.php');
$smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl');



to:

/* Default page */
$smarty->assign('empty', 1);
Tools::safePostVars();
$css_files = array(__PS_BASE_URI__.'css/thickbox.css' => 'all');
$js_files = array(__PS_BASE_URI__.'js/jquery/thickbox-modified.js');
include_once(dirname(__FILE__).'/header.php');
$smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl');

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 months later...

Hi

had rougly the same problem as you, couldn't have thickbox on order page step 1

i fixed it adding this

<!--MODMIKA THICKBOX CUSTOM IMAGES -->
{include file=$tpl_dir./thickbox.tpl} 
<link href="/css/thickbox.css" rel="stylesheet" type="text/css" media="screen" />
[removed][removed]



on top of shopping-cart.tpl

Link to comment
Share on other sites

  • 4 months later...

Hi You Guys,

i just read this tutorial to enhance Thick box on CMS page.
I'd need one more information to get the thing working.
Indeed once the CMS.Php and CMS.tpl files are modified and the pictures are uploaded on the page, how to link the pictures and the script?

Cheers,

Ali

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

In PS 1.4.1 I tried to do the same but with "jquery.fancybox-1.3.4.js", and I'm not able.
If I write "$js_files = array(__PS_BASE_URI__.'js/jquery/jquery/jquery.fancybox-1.3.4.js');" in cms.php.. don't happen nothing!
Someone can help me please?

thanks!

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

What I have done is adding the following call to the thickbox script in tpl files where I needed it:

<link href="{$base_dir}css/thickbox.css" rel="stylesheet" type="text/css"/>
<script src="{$base_dir}js/jquery/thickbox-modified.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
ThickboxI18nClose = "{l s='Close'}";
ThickboxI18nOrEscKey = "{l s='or Esc key'}";
tb_pathToImage = "{$img_ps_dir}loadingAnimation.gif";
//]]>
</script>

Just place this code somewhere at the start of your tpl files.

Then add class="thickbox" to the links which you would like to see as popups.

 

Don't forget to enable 'Force compile' in your backoffice for changes to tpl files.

 

EDIT:

I forgot to mention that this works for PS version 1.4.x

Edited by AKJV (see edit history)
Link to comment
Share on other sites

  • 1 month later...

if I wanted to add ((( class="thickbox" ))) to the cms.tpl file how would i do this? It seems it would go in the foreach loop. But Where?

 

 

 

{/foreach}

</ul>

{/if}

{if isset($cms_pages) & !empty($cms_pages)}

<h4>{l s='Personal Collection of Coin-Op Machines in : '}{$category->name}{l s='...'}</h4>

<ul class="bullet">

{foreach from=$cms_pages item=cmspages}

<li>

<a href="{$link->getCMSLink($cmspages.id_cms, $cmspages.link_rewrite)|escape:'htmlall':'UTF-8'}">{$cmspages.meta_title|escape:'htmlall':'UTF-8'}</a>

</li>

{/foreach}

Link to comment
Share on other sites

  • 2 weeks later...

I would like to use this to save my customers from leaving our site while paying by credit card. The debit process uses a external site.

 

<p class="payment_module">
<a href="javascript:document.dibs_form.submit();" onclick="return doPopup();" title="{l s='Pay with dibs' mod='dibs'}" style="height:48px">
 <img src="{$module_dir}logos/dibs_{$logo_color}.jpg" alt="{l s='dibs logo' mod='dibs'}" style="float:left;"/>
 <br /><strong>{l s='Pay with dibs' mod='dibs'}</strong>
 <br />{l s='Pay safely and quickly with dibs.' mod='dibs'}
 <br style="clear:both" />
</a>
</p>
<form name="dibs_form" action="https://payment.architrade.com/paymentweb/start.action" method="post">
{foreach from=$p key=k item=v}
<input type="hidden" name="{$k}"  value="{$v}" />
{/foreach}
</form>

 

I tried to putt the thickbox class in the a-tag. The thickbox shows upp but i wont load the external site into it. I guess its at conflict with the java submission of the form. Does anyone have a clue on how to get this to work?

Link to comment
Share on other sites

  • 3 weeks later...

What I have done is adding the following call to the thickbox script in tpl files where I needed it:

<link href="{$base_dir}css/thickbox.css" rel="stylesheet" type="text/css"/>
<script src="{$base_dir}js/jquery/thickbox-modified.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
ThickboxI18nClose = "{l s='Close'}";
ThickboxI18nOrEscKey = "{l s='or Esc key'}";
tb_pathToImage = "{$img_ps_dir}loadingAnimation.gif";
//]]>
</script>

Just place this code somewhere at the start of your tpl files.

Then add class="thickbox" to the links which you would like to see as popups.

 

Don't forget to enable 'Force compile' in your backoffice for changes to tpl files.

 

EDIT:

I forgot to mention that this works for PS version 1.4.x

 

Hi,

 

I tried your solution but nothing happens. Copied the code in cms.tpl and made a link with class="thickbox". I'm using 1.4.5.1. btw.

Any ideas what I'm doing wrong?

 

Cheers,

 

Steven

 

Hi guys,

 

I found this solution

 

Works like a charm!

Edited by steviger (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 9 months later...

I would like to use this to save my customers from leaving our site while paying by credit card. The debit process uses a external site.

 

<p class="payment_module">
<a href="javascript:document.dibs_form.submit();" onclick="return doPopup();" title="{l s='Pay with dibs' mod='dibs'}" style="height:48px">
 <img src="{$module_dir}logos/dibs_{$logo_color}.jpg" alt="{l s='dibs logo' mod='dibs'}" style="float:left;"/>
 <br /><strong>{l s='Pay with dibs' mod='dibs'}</strong>
 <br />{l s='Pay safely and quickly with dibs.' mod='dibs'}
 <br style="clear:both" />
</a>
</p>
<form name="dibs_form" action="https://payment.architrade.com/paymentweb/start.action" method="post">
{foreach from=$p key=k item=v}
<input type="hidden" name="{$k}"  value="{$v}" />
{/foreach}
</form>

 

I tried to putt the thickbox class in the a-tag. The thickbox shows upp but i wont load the external site into it. I guess its at conflict with the java submission of the form. Does anyone have a clue on how to get this to work?

 

 

 

 

Hello

 

I want to call my terms and conditions and another cms page, rights of withdrawal, by thickbox or any other means that allow the client to stay on the page. Best would be if I could also size the window so text is better legible.

 

I trief the following but ended up in a loading animation (so far so good..) that loads a white screen with a bookmark js.

 

<a class="thickbox" href="/prestashop/cms.php?id_cms=3" >My special terms </a>

or when needed
<a class="thickbox" href="/cms.php?id_cms=3" >My special terms </a>

 

I made sure by deactivating easy URL that I got the right link and the cms page exists.

 

What is wrong?

 

 

At the moment I have only this working but customers have to 'leave' the page or are being psychologically interupted in the order process...due to the target attribute _blank or self ....

 

<!-- ITO AGB & Widerrufsrecht added by Simon Agostini Steuer--->
<div style="padding: 10px 0 10px 8px;">

  {l s='I have read the terms of service and agree with submit of my order with the conditions'}
		<br>
	   {l s='('}
		<a class="iframe" href="{if $lang_iso=='de'}{$link->getCMSLink('3','agbs')}?content_only=1{else}{$link->getCMSLink('3','terms-and-conditions-of-use')}?content_only=1{/if}" class="iframe">{l s='AGB'}</a>

		{l s='und'}
		<a href="{if $lang_iso=='de'}{$link->getCMSLink('8','widerrufsbelehrung')}&content_only=1{else}{$link->getCMSLink('8','cancellation-policy')}&content_only=1{/if}" target="iframe">{l s='Widerrufsbelehrung'}</a>
		{l s='zur Kenntnis nehmen.)'}

 

 

thanks alot for any clues and help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...