Jump to content

10 enheder (kan det ændres)?


Henrik Larsen

Recommended Posts

Ja man kan ændre det fast, men jeg ønsker at kunden skal kunne vælge selv hvor mange produkter de vil se.

faktisk har jeg fundet koden for drop down boxen men den vil ikke virke efter hensigtene:

CODE:

<?php

$nArray = intval(Configuration::get('PS_PRODUCTS_PER_PAGE')) != 10 ? array(intval(Configuration::get('PS_PRODUCTS_PER_PAGE')), 10, 20, 50) : array(10, 20, 50);
asort($nArray);
$n = abs(intval(Tools::getValue('n', intval(Configuration::get('PS_PRODUCTS_PER_PAGE')))));
$p = abs(intval(Tools::getValue('p', 1)));
$range = 2; /* how many pages around page selected */

if (!$n)
$n = $nArray[0];
if ($p < 0)
$p = 0;

if ($p > ($nbProducts / $n))
$p = ceil($nbProducts / $n);
$pages_nb = ceil($nbProducts / intval($n));

$start = intval($p - $range);
if ($start < 1)
$start = 1;
$stop = intval($p + $range);
if ($stop > $pages_nb)
$stop = intval($pages_nb);
$smarty->assign('nb_products', $nbProducts);
$pagination_infos = array('pages_nb' => intval($pages_nb), 'p' => intval($p), 'n' => intval($n), 'nArray' => $nArray, 'range' => intval($range), 'start' => intval($start), 'stop' => intval($stop));
$smarty->assign($pagination_infos);

?>

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