cyberman Posted March 26, 2013 Share Posted March 26, 2013 hi , everyone , i want to move block currencies from top of the page to appear buy block (near price) in product page . i attached photo of requirement for better understand . plz help .. Link to comment Share on other sites More sharing options...
yaniv14 Posted March 26, 2013 Share Posted March 26, 2013 I can give you a quick solution but probably not so 'smart'. you can add an absolute position to currency block just for product page assuming you have a space to put it like you show in the image. you can do it in product.tpl with inline style: {if $page_name == 'product'} or by css: body#product #currencies_block_top {position: absolute; top: xxxx; right: xxxx;} ofcourse you need to find top & right. I guess the 2nd option is easier. 1 Link to comment Share on other sites More sharing options...
cyberman Posted March 26, 2013 Author Share Posted March 26, 2013 yaniv14 thanks for reply , but i cant understand what you say. i find this link http://www.prestashop.com/forums/topic/17877-solved-i-want-to-move-the-blockcurrency-module/ but its working in ps1.3 very well , not worked in PS1.5x .. can you modified this code for PS 1.5.x plz help .. Link to comment Share on other sites More sharing options...
yaniv14 Posted March 27, 2013 Share Posted March 27, 2013 The solution you have in the link is not exactly for your needs. In this solution you will have the currencies block under the add to cart button and not between the price & the items left in stock. There is a hook under the right column of the product info (name, description, attributes, price, add to cart button) that called 'Extra actions on product page' and you can modify the code of the currencies block to be able to transplant in that hook (like Rocky explain in the link you sent). So let me know which way you choose and I will help you. Link to comment Share on other sites More sharing options...
cyberman Posted March 27, 2013 Author Share Posted March 27, 2013 i want just near price or add to cart button . can you help me Link to comment Share on other sites More sharing options...
yaniv14 Posted March 27, 2013 Share Posted March 27, 2013 (edited) I assume that you use prestashop 1.5.3.1? You need to edit 'modules/blockcurrencies/blockcurrencies.php' and instead of all the content put this: Quote <?php/* * 2007-2012 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.or...ses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2012 PrestaShop SA * @license http://opensource.or...ses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_PS_VERSION_')) exit; class BlockCurrencies extends Module { public function __construct() { $this->name = 'blockcurrencies'; $this->tab = 'front_office_features'; $this->version = 0.1; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Currency block'); $this->description = $this->l('Adds a block for selecting a currency.'); } public function install() { return parent::install() && $this->registerHook('top') && $this->registerHook('header'); } private function _prepareHook($params) { if (Configuration::get('PS_CATALOG_MODE')) return false; if (!count(Currency::getCurrencies())) return false; $this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign); return true; } /** * Returns module content for header * * @param array $params Parameters * @return string Content */ public function hookTop($params) { if ($this->_prepareHook($params)) return $this->display(__FILE__, 'blockcurrencies.tpl'); } function hookExtraRight($params) { return $this->hookTop($params); } public function hookHeader($params) { if (Configuration::get('PS_CATALOG_MODE')) return; $this->context->controller->addCSS(($this->_path).'blockcurrencies.css', 'all'); } } or just download and extract from zip: zip_file after you saved the file go to modules -> positions -> transplant a module, choose currencies block and hook into "Extra actions on the product page (right column)." known as "displayRightColumnProduct" and press save. after you finish those steps take a screen shot of your product page so I can see how it looks and how you need it. Edited March 27, 2013 by yaniv14 (see edit history) 1 Link to comment Share on other sites More sharing options...
cyberman Posted March 28, 2013 Author Share Posted March 28, 2013 yes its working but how show in style block ... check live link http://easternmoda.com/index.php?id_product=7&controller=product Link to comment Share on other sites More sharing options...
yaniv14 Posted March 28, 2013 Share Posted March 28, 2013 edit blockcurrencies.css and change, line #50 from: Quote display: block; To: Quote display: inline-block; lines #52-53 from: Quote position: absolute; right: 3px; To: Quote position: relative; left: 49px; Link to comment Share on other sites More sharing options...
cyberman Posted March 28, 2013 Author Share Posted March 28, 2013 hi , thanks for help. its working , but new issue is its not good looking , and drop down list is non attractive . check this link http://easternmoda.com/index.php?id_product=11&controller=product how change font size , (bold) , and how highlight it like previous default PS currency block shown Link to comment Share on other sites More sharing options...
yaniv14 Posted March 29, 2013 Share Posted March 29, 2013 try replacing all the content of blockcurrencies.css with this: Quote /* block top currencies */ #currencies_block_top { float: right; height: 15px; margin: 10px 0 0 0; padding: 2px 6px; -moz-border-radius-bottomright: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-radius-bottomright: 3px; -webkit-border-radius-bottomleft: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background: none repeat scroll 0 0 #000; } #currencies_block_top p { clear: left; padding-right:16px; font: 11px Arial,Verdana,sans-serif; color: #ccc; text-align: right; background: url("img/block_languages_top_p_bg.png") no-repeat scroll right 1px transparent; } #currencies_block_top ul#first-currencies li { margin-right: 3px } #currencies_block_top ul#first-currencies li.selected { opacity: 1 !important; } /*languages with jquery*/ #setCurrency { cursor: pointer; position: relative; top: 1px; } #setCurrency p { position: relative; top: 0; margin-left: 5px; padding-bottom: 0; } #setCurrency p img { padding-left: 5px; } #setCurrency .currencies_ul{ display:none; z-index: 10000; padding:10px; list-style-type:none; } #setCurrency .currencies_ul_hover{ display:block; z-index: 5000; position:absolute; right:3px; padding:5px 10px; height:auto; width:10px; background:#000000; } #setCurrency .currencies_ul_hover a {color:#fff;} Link to comment Share on other sites More sharing options...
cyberman Posted April 1, 2013 Author Share Posted April 1, 2013 thankyou very much its working , and looking nice Link to comment Share on other sites More sharing options...
vekia Posted April 1, 2013 Share Posted April 1, 2013 nice know how guys i marked this topic as solved, many thanks for solution! regards 1 Link to comment Share on other sites More sharing options...
Recommended Posts