Jump to content
likeminded

[solved] I want to move the Blockcurrency module

Recommended Posts

To just above where the price is displayed in the product.tpl file can this be done as I cannot find anyway to do it (I am abit of a noob though)

I would also like to use images of flags for the currency selection rather than the currency symbol

is any of this at all possible?

thanks for any help you can give

Share this post


Link to post
Share on other sites

Unfortunately, you will need to do a bit of code modification to do this.

For your first question, transplant the "Currency block" to the "Extra actions on the product page (right column)" hook. Modify modules/blockcurrencies/blockcurrencies.php and add the following function before the last curly brace:

function hookExtraRight($params)
{
   return $this->hookTop($params);
}



The currency block should now appear below the buy block on the product page. To move it above the buy block, find the following code in product.tpl in your theme directory:

{if $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}



and move it just above:

       <!-- add to cart form-->
       <form id="buy_block" action="{$base_dir}cart.php" method="post">



You should now have the currency block above the buy block. Modify the /* block top currencies */ section of css/global.css in your theme directory to style it.


For your second question, you will need to modify modules/blockcurrencies/blockcurrencies.tpl and change the links from text links to image links. Use the flags in the img/l directory.

Share this post


Link to post
Share on other sites

Thanks Rocky worked a treat!!

now just have to figure out how to get the flags as the list is created dynamically from the database

if any one can help with this I would be greatfull !!

Share this post


Link to post
Share on other sites

To display flags instead of currency, change line 8 of modules/blockcurrencies/blockcurrencies.tpl from:

{$f_currency.sign}


[/code]

to:




This code assumes that each language and corresponding currency have the same ID, so you will need to make sure they match. For example, Australia and Australian Dollar both have ID 1 and France and Euro both have ID 2. You may need to manually modify the currency and lang tables in your database to do this.

You will also need to modify the block top currencies section of global.css in your theme directory. For example, change:

/* block top currencies */
#header #currencies_block_top {
   margin: 0.4em 0.5em 0 0;
   float: left;
}
#header #currencies_block_top ul {
   float: left;
   height: 1.5em;
}
#header #currencies_block_top ul li {
   float:left;
   margin-right:0.2em;
}
#header #currencies_block_top ul li a {
   border: none;
   background-color: transparent;
   font-size: 1.1em;
   line-height: 1.2em;
   font-weight: bold;
   color: black;
}
#header #currencies_block_top p {
   clear: left;
}



to:

/* block top currencies */
#header #currencies_block_top {
   margin: 0.4em 0.5em 0 0;
   float: left;
}
#header #currencies_block_top ul {
   float: left;
   height: 1.5em;
}
#header #currencies_block_top ul li {
   float:left;
   margin-right:0.2em;
}
#header #currencies_block_top ul li a {
   border: none;
   background-color: transparent;
   font-size: 1.1em;
   line-height: 1.2em;
   font-weight: bold;
   color: black;
}
#header #currencies_block_top p {
   clear: left;
}

Share this post


Link to post
Share on other sites

Ok Thanks for the help

seem to have it where i want it and flags displaying - just some css to style the list

next question is how can i get the links to change the currency - again sorry if this is a noob question I can change code etc no problems its just the smarty thing that has me stumped

thanks again

Share this post


Link to post
Share on other sites

for some reason its not working on my theme...it works on the default prestashop theme - images and all but not on my theme and cannot figure out why, if any one can help me that would be great I can post code sinippets etc here justt let me know

Share this post


Link to post
Share on other sites

To display flags instead of currency, change line 8 of modules/blockcurrencies/blockcurrencies.tpl from:

 

[url="[removed]setCurrency({$f_currency.id_currency});"]{$f_currency.sign}[/url]

[/code]

 

to:

 

[url="[removed]setCurrency({$f_currency.id_currency});"][img=../../img/l/{$f_currency.id_currency}.jpg][/url]

 

This code assumes that each language and corresponding currency have the same ID, so you will need to make sure they match. For example, Australia and Australian Dollar both have ID 1 and France and Euro both have ID 2. You may need to manually modify the currency and lang tables in your database to do this.

 

You will also need to modify the block top currencies section of global.css in your theme directory. For example, change:

 

/* block top currencies */
#header #currencies_block_top {
margin: 0.4em 0.5em 0 0;
float: left;
}
#header #currencies_block_top ul {
float: left;
height: 1.5em;
}
#header #currencies_block_top ul li {
float:left;
margin-right:0.2em;
}
#header #currencies_block_top ul li a {
border: none;
background-color: transparent;
font-size: 1.1em;
line-height: 1.2em;
font-weight: bold;
color: black;
}
#header #currencies_block_top p {
clear: left;
}

 

to:

 

/* block top currencies */
#header #currencies_block_top {
margin: 0.4em 0.5em 0 0;
float: left;
}
#header #currencies_block_top ul {
float: left;
height: 1.5em;
}
#header #currencies_block_top ul li {
float:left;
margin-right:0.2em;
}
#header #currencies_block_top ul li a {
border: none;
background-color: transparent;
font-size: 1.1em;
line-height: 1.2em;
font-weight: bold;
color: black;
}
#header #currencies_block_top p {
clear: left;
}

 

The code i need is missing. can you correct your post. thanks

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More