Jump to content

combinesom

Members
  • Posts

    3
  • Joined

  • Last visited

combinesom's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. It's an amazing script - worth every cent of its value! Thank you Klejd!
  2. Create your new pagination.tpl file and name it paginationto.tpl. Then change name of classes inside them and adjust to your page styles.
  3. Problem already solved. I modified the following files: modules/homefeatured/homefeatured.tpl - delete all content. modify index.php in root: <?php include(dirname(__FILE__).'/config/config.inc.php'); if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) $rewrited_url = __PS_BASE_URI__; include(dirname(__FILE__).'/header.php'); $smarty->assign('HOOK_HOME', Module::hookExec('home')); $smarty->display(_PS_THEME_DIR_.'index.tpl'); include(dirname(__FILE__).'/homefeaturedto.php'); include(dirname(__FILE__).'/footer.php'); ?> Create homefeaturedto.php in the root <?php include(dirname(__FILE__).'/product-sort.php'); $category = new Category(1); $nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true); include(dirname(__FILE__).'/pagination.php'); $smarty->assign('nb_products', $nbProducts); $cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay); $smarty->assign(array( 'products' => (isset($cat_products) AND $cat_products) ? $cat_products : NULL, 'id_category' => intval($category->id), 'id_category_parent' => intval($category->id_parent), 'return_category_name' => Tools::safeOutput(Category::hideCategoryPosition($category->name)), 'path' => Tools::getPath(intval($category->id), $category->name) )); $smarty->display(_PS_THEME_DIR_.'homefeaturedto.tpl'); ?> create homefeaturedto.tpl in your themes: <!-- MODULE Home Featured Products --> {l s='New arrivals'} {if isset($products) AND $products} {assign var='liHeight' value=342} {assign var='nbItemsPerLine' value=4} {assign var='nbLi' value=$products|@count} {assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil} {assign var='ulHeight' value=$nbLines*$liHeight} {foreach from=$products item=product name=homeFeaturedProducts} {$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'} {$product.description_short|strip_tags|truncate:130:'...'} getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /> {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {l s='View'} {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart'} {else} {l s='Add to cart'} {/if} {/foreach} {else} {l s='No new arrivals'} {/if} <!-- Pagination --> {if $products} {include file=$tpl_dir./pagination.tpl} {/if} <!-- /MODULE Home Featured Products --> I know that a better solution would be to create a modified module homefeatured, but that's beyond me ... I finished the economies and not IT. For sure will be a programmer who embrace it.
  4. I have modified Homefeatured.php file so that show all the products of its category on the first page. The problem is that I can not do the pagination to the list of displayed products. Can anyone tell me what's next? Oh, and there is still a problem with the display of thumbnails. I was changed in homefeatured.php function hookHome($params) { global $smarty; $category = new Category(1); $nb = intval(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); $smarty->assign(array('products' => $products, 'homeSize' => Image::getSize('home'))); return $this->display(__FILE__, 'homefeatured.tpl'); } to: function hookHome($params) { global $smarty; $category = new Category(1); $nb = intval(Configuration::get('HOME_FEATURED_NBR')); $products = Product::getProducts($params['cookie']->id_lang, 0, NULL, 'name', 'ASC', false, true); include(dirname(__FILE__).'/pagination.php'); $smarty->assign(array('products' => $products, 'homeSize' => Image::getSize('home'))); return $this->display(__FILE__, 'homefeatured.tpl'); } what's next? Please help me!
×
×
  • Create New...

Important Information

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