Jump to content

currency box and paypal


Recommended Posts

Hello,

 

My site is here

 

I'm trying and move the currency box from the left side column to the header. It's well hooked to the header and to the top. But it doesn't show up there.

 

I also would like to move the paypal and refund logo above the categories box.

 

I have been looking for a solution for days and am just about to give in ...

 

Does anyone have an idea where should I look?

 

Thanks in advance for your help.

Link to comment
Share on other sites

Alex,

 

Did you try to add the currency module to the 'pages header' block in modules->positions?

(You can try to transplant the currency block to hook: DisplayHeader(pages header)

 

About the paypal box. Did you try to use LiveEdit already?

 

or:

If you go to Modules->positions, and scroll down to left column blocks

do you have any module name between categories and something called 'refund badge' or so? Should be something like payment logos/paypal etc. If so, move this one above categories (press arrow up in front of module name)

 

Hope this helps,

pascal.

Link to comment
Share on other sites

Hi Pascal,
 
Thanks for your reply. I've already tried your suggestions but to no avail. In the left column block, there's only the Categories block.
 
I think this was coded directly into the files. For exemple I can see the following at the bottom of blockcurrencies.php  

 

===

public function hookDisplayCurrencyChoose($params)
    {
        if ($this->_prepareHook($params))
            return $this->display(__FILE__, 'blockcurrencies.tpl');
    }

===

 

The header.tpl is also heavily customized. I can see some code for login, paypal and badge in there. I've loaded the original header.tpl and the currency block shows in the header, so that's clearly in there to look.

 

Is it safe to paste the modified header.tpl here so that maybe someone could help me out?

 

Thanks in adavance.

Alex

PS: Yes I'm in Chiang Mai : )

Link to comment
Share on other sites


I think this was coded directly into the files. For exemple I can see the following at the bottom of blockcurrencies.php  

 

===

public function hookDisplayCurrencyChoose($params)
    {
        if ($this->_prepareHook($params))
            return $this->display(__FILE__, 'blockcurrencies.tpl');
    }

===

No, this seems to be normal php/tpl coding. The way to call the 'layout' of the module. php has the functionality. tpl displays it on the screen...

Only the hook itself is a custom one, I believe. It's probably hooked into header.tpl. So please attach/copy (please copy as 'code', past code text in dialog box when pressing the <> icon, next to the text balloon (quote icon)). If you attach the file, give it an extension .txt, or zip the file, otherwise the forum doesn't allow the upload.

 

Off topic:

Chiang Mai! Like to meet sometime? :-)

Link to comment
Share on other sites

Here-pasted ...

 

Sure thing, can have a coffe anytime  : )

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 lt-ie6 " lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8 ie7" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9 ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]> <html lang="fr" class="no-js ie9" lang="en"> <![endif]-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$lang_iso}">
	<head>
		<title>{$meta_title|escape:'htmlall':'UTF-8'}</title>
{if isset($meta_description) AND $meta_description}
		<meta name="description" content="{$meta_description|escape:html:'UTF-8'}" />
{/if}
{if isset($meta_keywords) AND $meta_keywords}
		<meta name="keywords" content="{$meta_keywords|escape:html:'UTF-8'}" />
{/if}
		<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
		<meta http-equiv="content-language" content="{$meta_language}" />
		<meta name="generator" content="PrestaShop" />
		<meta name="robots" content="{if isset($nobots)}no{/if}index,{if isset($nofollow) && $nofollow}no{/if}follow" />
		<link rel="icon" type="image/vnd.microsoft.icon" href="{$favicon_url}?{$img_update_time}" />
		<link rel="shortcut icon" type="image/x-icon" href="{$favicon_url}?{$img_update_time}" />
		
		<script type="text/javascript">
			var baseDir = '{$content_dir}';
			var baseUri = '{$base_uri}';
			var static_token = '{$static_token}';
			var token = '{$token}';
			var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals};
			var priceDisplayMethod = {$priceDisplay};
			var roundMode = {$roundMode};
		</script>
{if isset($css_files)}
	{foreach from=$css_files key=css_uri item=media}
	<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
	{/foreach}
{/if}
{if isset($js_files)}
	{foreach from=$js_files item=js_uri}
	<script type="text/javascript" src="{$js_uri}"></script>
	{/foreach}
{/if}
		{$HOOK_HEADER}
		
	<!--[if lt IE 8]>
		<link rel="stylesheet" type="text/css" href="{$base_dir}themes/default/css/ie7.css">
	<![endif]-->
	
	<script type="text/javascript" >
		/*
		window.addEvent('domready', function() {			
			var myMenu = new MenuMatic({ orientation:'vertical' });			
		});
		*/		
	</script>	
		
	</head>
	
	<body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if $hide_left_column}hide-left-column{/if} {if $hide_right_column}hide-right-column{/if} {if $content_only} content_only {/if}">

	{if !$content_only}
		{if isset($restricted_country_mode) && $restricted_country_mode}
		<div id="restricted-country">
			<p>{l s='You cannot place a new order from your country.'} <span class="bold">{$geolocation_country}</span></p>
		</div>
		{/if}
		<div id="page" class="container clearfix">

			<!-- Header -->
			<div id="header" class="clearfix">
				<div class="box alpha omega">
					<a id="header_logo" href="{$base_dir}" title="{$shop_name|escape:'htmlall':'UTF-8'}">
						<img class="logo" src="{$logo_url}" alt="{$shop_name|escape:'htmlall':'UTF-8'}" {if $logo_image_width}width="{$logo_image_width}"{/if} {if $logo_image_height}height="{$logo_image_height}" {/if} />
					</a>
					<div id="header_right" >
						<div id="main-menu">	
							<ul>
								<li><a href="{$link->getPageLink('order', true)}?step=1">CHECKOUT</a></li>
								<li><a href="{$link->getPageLink('order', true)}">SHOPPING CART</a></li>
								<li><a href="{$link->getCMSLink('4','about-us')|replace:'/4':''}">ABOUT US</a></li>
								<li><a href="{$link->getPageLink('contact', true)}.php">CONTACT US</a></li>
								<li><a href="{$link->getPageLink('index', true)}">HOME</a></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<div id="cart-content" class="clearfix">
				<div class="box alpha omega">
					<div class="special-checkout right">
						<span> | </span>
						<a href="{$link->getPageLink('order', true)}?step=1">Checkout</a>
					</div>
					<div class="right">
						{$HOOK_CART}
					</div>
					<div class="right">
						{if $currentController!='AuthController'}
							{if $logged}
								<a  href="{$base_dir}index.php?mylogout">{l s='Log off'}</a>
								<span> | </span>
							{/if}
						{/if}
					</div>
					<div class="right">
						<a href="{$link->getPageLink('my-account', true)}">{l s='Your Account'}</a>
						<span> | </span>
					</div>
					<div class="right">
						<span style="float:left;"> Search </span>
						{$HOOK_SEARCH_BOX}
					</div>

					
				</div>
			</div>
		
			<div id="columns" class="clearfix">
				<div class="box alpha omega">

					<!-- Left -->
					<div id="left_column">
						{$HOOK_LEFT_COLUMN}
						
						<div class="rw-paypal">
							<a onclick="javascript:window.open('https://www.paypal.com/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');" href="#">
								<img border="0" alt="Solution Graphics" src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif">
							</a>
						</div>
						
						{if $page_name == 'index'}
							<div class="refund_badge">
								<img vspace="5" border="0" alt="" src="{$base_dir}/img/refund_badge.gif">
							</div>
						{/if}
						
						{if $currentController!='AuthController'}
							{if !$logged}
								<div id="login-box">
									<div class="title">
										Sign In
									</div>
									{include file='./authentication.tpl'}
									<div class="create-new-account">
										<p>Are you a new client?</p>
										<a href="{$link->getPageLink('authentication', true)}">create an account</a>
									</div>
								</div>
							{else}
								<div id="login-box">
									<div class="title">
										Your Account
									</div> 
									<div class="customer_name">Welcome : <a href="{$link->getPageLink('my-account', true)}">{$customerName}</a></div>
									<div class="account-box">
										<a href="{$link->getPageLink('identity', true)}">Personal information</a>
										<a href="{$link->getPageLink('addresses', true)}">Addresses</a>
										<a href="{$link->getPageLink('history', true)}">Order history</a>
										<a href="{$link->getPageLink('order-slip', true)}">Credit slips</a>
									</div>
									<div class="logout">
										<a  href="{$base_dir}index.php?mylogout">{l s='Log off'}</a>
									</div>
								</div>
							{/if}
						{/if}
						
						{$HOOK_CURRENCY_CHOOSE}
						
						
					</div>

					<!-- Center -->
					<div id="center_column">
	{/if}

Link to comment
Share on other sites

Hi Alex,

 

We will split the code up in parts, so that you can choose where you want to put it:

 

 

The very first part is the header part. For now we leave this part as is. It loads all kind of java scripts needed on the pages, puts the logo, the top menu, the search box, you r account, log off and checkout links on the page.

 

We focus on the left column part:

			<div id="columns" class="clearfix">
				<div class="box alpha omega">

					<!-- Left -->
					<div id="left_column">
						{$HOOK_LEFT_COLUMN}
						
						<div class="rw-paypal">
							<a onclick="javascript:window.open('https://www.paypal.com/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');" href="#">
								<img border="0" alt="Solution Graphics" src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif">
							</a>
						</div>
						
						{if $page_name == 'index'}
							<div class="refund_badge">
								<img vspace="5" border="0" alt="" src="{$base_dir}/img/refund_badge.gif">
							</div>
						{/if}
						
						{if $currentController!='AuthController'}
							{if !$logged}
								<div id="login-box">
									<div class="title">
										Sign In
									</div>
									{include file='./authentication.tpl'}
									<div class="create-new-account">
										<p>Are you a new client?</p>
										<a href="{$link->getPageLink('authentication', true)}">create an account</a>
									</div>
								</div>
							{else}
								<div id="login-box">
									<div class="title">
										Your Account
									</div> 
									<div class="customer_name">Welcome : <a href="{$link->getPageLink('my-account', true)}">{$customerName}</a></div>
									<div class="account-box">
										<a href="{$link->getPageLink('identity', true)}">Personal information</a>
										<a href="{$link->getPageLink('addresses', true)}">Addresses</a>
										<a href="{$link->getPageLink('history', true)}">Order history</a>
										<a href="{$link->getPageLink('order-slip', true)}">Credit slips</a>
									</div>
									<div class="logout">
										<a  href="{$base_dir}index.php?mylogout">{l s='Log off'}</a>
									</div>
								</div>
							{/if}
						{/if}
						
						{$HOOK_CURRENCY_CHOOSE}
						
						
					</div>

OK, let's break it up in pieces:

it starts with this part:

						{$HOOK_LEFT_COLUMN}

This is the general Prestashop "Left column" hook, where you normally would hook your modules. In your case, only categories is hooked into the left column like this. So this block is for the categories.

 

 

next:

						<div class="rw-paypal">
							<a onclick="javascript:window.open('https://www.paypal.com/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');" href="#">
								<img border="0" alt="Solution Graphics" src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif">
							</a>
						</div>

The next part, you guessed is when looking at your front page, is the PayPal logo, where your customer can see what Credit Cards are accepted by PayPal. Clicking the logo opens a pop up window, with some explanation what Paypal is. (We need to consider to make the pop up window wider, as the window contents shows badly! actually width=1000px is needed. I'll check later if we can wrap the text, so we can keep it smaller)

So this block is the Paypal Logo.

 

 

next:

						{if $page_name == 'index'}
							<div class="refund_badge">
								<img vspace="5" border="0" alt="" src="{$base_dir}/img/refund_badge.gif">
							</div>
						{/if}

This page checks if the current page is the home page (Index page). If so, it shows the Refund badge logo.

 

 

next:

						{if $currentController!='AuthController'}
							{if !$logged}
								<div id="login-box">
									<div class="title">
										Sign In
									</div>
									{include file='./authentication.tpl'}
									<div class="create-new-account">
										<p>Are you a new client?</p>
										<a href="{$link->getPageLink('authentication', true)}">create an account</a>
									</div>
								</div>
							{else}
								<div id="login-box">
									<div class="title">
										Your Account
									</div> 
									<div class="customer_name">Welcome : <a href="{$link->getPageLink('my-account', true)}">{$customerName}</a></div>
									<div class="account-box">
										<a href="{$link->getPageLink('identity', true)}">Personal information</a>
										<a href="{$link->getPageLink('addresses', true)}">Addresses</a>
										<a href="{$link->getPageLink('history', true)}">Order history</a>
										<a href="{$link->getPageLink('order-slip', true)}">Credit slips</a>
									</div>
									<div class="logout">
										<a  href="{$base_dir}index.php?mylogout">{l s='Log off'}</a>
									</div>
								</div>
							{/if}
						{/if}

This block checks if you're not on the login page. If not, it shows the authentication block. If Not logged in, it gives the sign in block, when signed in already, it gives links to the customer's order history, account info etc.

So this is the 'my account' info block.

 

 

next:

						{$HOOK_CURRENCY_CHOOSE}

It ends with a (I believe) custom made hook by which the currency choice block is being displayed.

 

 

That's it. So as long as you move these blocks in total, you can swap them as desired.

 

Don't move them outside the <div id="left_column"> and </div> above/under the blocks, as then they will move out of the left column.

 

 

Hope this helps,

pascal

 

 

P.S. about the currencies Hook. If you want it to the header, we need to move the

                        {$HOOK_CURRENCY_CHOOSE}

 
to the header part. Not sure yet where this will be most elegant. Maybe I should play with it a little, but easiest would be directly on your site. Maybe we could do this during some coffee, if you bring your laptop or login info :-)
 
pascal
  • Like 1
Link to comment
Share on other sites

Hi Pascal,

 

It's now much clearer. I've been able to move the currency box from the left side column to the header and the paypal / refund logo above the categories box.

 

 

Clicking the logo opens a pop up window, with some explanation what Paypal is. (We need to consider to make the pop up window wider, as the window contents shows badly! actually width=1000px is needed. I'll check later if we can wrap the text, so we can keep it smaller)

So this block is the Paypal Logo.

 

As you have recommended, I've widened it to 1000px but wasn't able to wrap the text. I think it's fine as is.

 

Thank you so much for your help!

 

Alex

 

 

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...