haochen Posted December 20, 2013 Share Posted December 20, 2013 (edited) i want to move this to the right side in the box, but i cant find out how on firebug... and tested on many blocks of Productscomments.css and couldnt either Edited December 23, 2013 by haochen (see edit history) Link to comment Share on other sites More sharing options...
haochen Posted December 21, 2013 Author Share Posted December 21, 2013 no one can give me a hand? Link to comment Share on other sites More sharing options...
vekia Posted December 21, 2013 Share Posted December 21, 2013 it's because it's non-default solution and no one here knows what you use there. please attach url to your website where you use this feature. it will be much easier to say what you have to change. Link to comment Share on other sites More sharing options...
haochen Posted December 21, 2013 Author Share Posted December 21, 2013 oh ok, i discovered how to move down-top the stars but cant move the number of comments, i can move top-down the stars on .cancel, .star { on global.css, and my web is www.pieces4pc.com Link to comment Share on other sites More sharing options...
vekia Posted December 21, 2013 Share Posted December 21, 2013 hello to <a> element add class="starsratings" like i show below: <a class="starsratings" href="http://pieces4pc.com/es/musica-ipods/1-ipod-nano.html#idTab5"><div class="star star_on"></div><div class="star star_on"></div><div class="star star_on"></div><div class="star star_on"></div><div class="star star_on"></div>(1)</a> then you can use in css styles: .startsratings {padding-left:50px;} Link to comment Share on other sites More sharing options...
haochen Posted December 22, 2013 Author Share Posted December 22, 2013 only have to add .starsratings {padding-....} on global css really? thanks very much vekia and merry xmas! Link to comment Share on other sites More sharing options...
haochen Posted December 22, 2013 Author Share Posted December 22, 2013 just tried with .starsratings .... on global.css and seems i was wrong, where should i have to add the <a class.... ? my theme is default, and one more thing, if we put "http://pieces4pc.com/es/musica-ipods/1-ipod-nano.html#idTab5" on a class, only stars from ipod nano box would be moved right? Link to comment Share on other sites More sharing options...
vekia Posted December 22, 2013 Share Posted December 22, 2013 in what file you added these stars? can you show it please? it's necessary to define class definition for object with stars. Link to comment Share on other sites More sharing options...
haochen Posted December 22, 2013 Author Share Posted December 22, 2013 (edited) i followed instructions from this spanish post THIS, i modified homefeatured.php public function hookDisplayHome($params) { $category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10)); $link = new Link(); foreach ($products as $p) { $query_sum = 'SELECT COUNT(*) as sum FROM '._DB_PREFIX_.'product_comment WHERE validate AND id_product = '.$p['id_product']; $sum_votes = Db::getInstance()->getValue($query_sum); $query_grades = 'SELECT SUM(grade) as grades FROM '._DB_PREFIX_.'product_comment WHERE validate AND id_product = '.$p['id_product']; $grades = Db::getInstance()->getValue($query_grades); if ($sum_votes > 0) $star = floor($grades / $sum_votes); else $star = 0; if ($star > 0) { $url_product = $link->getProductLink($p['id_product']).'#idTab5'; $stars[$p['id_product']] .= '<a href="'.$url_product.'">'; for ($i=1; $i<=5; $i++) { if ($star >= $i) $stars[$p['id_product']] .= '<div class="star star_on"></div>'; else $stars[$p['id_product']] .= '<div class="star star_off"></div>'; } $stars[$p['id_product']] .= '('.$sum_votes.')</a>'; } } $this->smarty->assign(array( 'products' => $products, 'stars' => $stars, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize('home_default'), )); return $this->display(__FILE__, 'homefeatured.tpl'); } homefeatured.tpl <div class="star_content"> {if isset($stars[$product.id_product])} {$stars[$product.id_product]} {/if} </div> product.tpl <script type="text/javascript"> // <![CDATA[ $(document).ready(function() { if(window.location.hash === '#idTab5') { $("#more_info_tabs").idTabs("idTab5"); } }); productcomments.css .star_content div.star_on {background-position: 0 -12px } Edited December 22, 2013 by haochen (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 22, 2013 Share Posted December 22, 2013 where you added this: <div class="star_content"> {if isset($stars[$product.id_product])} {$stars[$product.id_product]} {/if} </div> show me exact code that you use Link to comment Share on other sites More sharing options...
haochen Posted December 23, 2013 Author Share Posted December 23, 2013 im using this on homefeatured.tpl {* * 2007-2013 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.org/licenses/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 [email protected] 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 <[email protected]> * @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <!-- MODULE Home Featured Products --> <div id="featured-products_block_center" class="block products_block clearfix"> <p class="title_block">{l s='Featured products' mod='homefeatured'}</p> {if isset($products) AND $products} <div class="block_content"> {assign var='liHeight' value=450} {assign var='nbItemsPerLine' value=3} {assign var='nbLi' value=$products|@count} {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight} <ul style="height:{$ulHeight}px;"> {foreach from=$products item=product name=homeFeaturedProducts} {math equation="(total%perLine)" total=$smarty.foreach.homeFeaturedProducts.total perLine=$nbItemsPerLine assign=totModulo} {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} <li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - $totModulo)}last_line{/if}"> <a href="{$product.link|escape:'html'}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, '210')}" alt="{$product.name|escape:html:'UTF-8'}" />{if isset($product.new) && $product.new == 1}<span class="new">{l s='New' mod='homefeatured'}</span>{/if}</a> <div class="star_content"> {if isset($stars[$product.id_product])} {$stars[$product.id_product]} {/if} <div> <p class="s_title_block"><a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p> {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if} {if ($product.id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product.available_for_order AND !isset($restricted_country_mode) AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE} {if ($product.quantity > 0 OR $product.allow_oosp)} <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart')|escape:'html'}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a> {else} <span class="exclusive">{l s='Add to cart' mod='homefeatured'}</span> {/if} {else} <div style="height:23px;"></div> {/if} </div> </li> {/foreach} </ul> </div> {else} <p>{l s='No featured products' mod='homefeatured'}</p> {/if} </div> <!-- /MODULE Home Featured Products --> Link to comment Share on other sites More sharing options...
vekia Posted December 23, 2013 Share Posted December 23, 2013 you forgot about div closing tag, take a look: <div class="star_content"> {if isset($stars[$product.id_product])} {$stars[$product.id_product]} {/if} <div> and it should looks be: <div class="star_content"> {if isset($stars[$product.id_product])} {$stars[$product.id_product]} {/if} </div> <div> Link to comment Share on other sites More sharing options...
haochen Posted December 23, 2013 Author Share Posted December 23, 2013 i just added the close tag but seems it dont make difference, and after closing this how should i do for moving Link to comment Share on other sites More sharing options...
vekia Posted December 23, 2013 Share Posted December 23, 2013 ok, it was just one step now open homefeatured.css and change code from first line to: #featured-products_block_center li { margin-right: 15px; padding: 10px 0; width: 242px; height: 290px; } now you can use in global.css something like: .star_content{ margin-left:80px;} effect: Link to comment Share on other sites More sharing options...
haochen Posted December 23, 2013 Author Share Posted December 23, 2013 ohhh right! thx boss Vekia! i havent change #featured-products_block_center li code because my homefeatured boxes would overlap or something like that, but i used width and margin-left on star_content, thanks again and merry xmas! Link to comment Share on other sites More sharing options...
Recommended Posts