How to save table in opencart module? - opencart2.x

I am try this code on
admin/view/template/module/test.tpl
<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
<div class="page-header">
<div class="container-fluid">
<div class="pull-right">
<button type="submit" form="form-featured" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
<i class="fa fa-reply"></i></div>
<h1><?php echo $heading_title; ?></h1>
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><?php echo $breadcrumb['text']; ?></li>
<?php } ?>
</ul>
</div>
</div>
<div class="container-fluid">
<?php if ($error_warning) { ?>
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
<button type="button" class="close" data-dismiss="alert">×</button>
</div>
<?php } ?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
</div>
<div class="panel-body">
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-featured" class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label" for="input-name"><?php echo $entry_name; ?></label>
<div class="col-sm-10">
<input type="text" name="name" value="<?php echo $name; ?>" placeholder="<?php echo $entry_name; ?>" id="input-name" class="form-control" />
<?php if ($error_name) { ?>
<div class="text-danger"><?php echo $error_name; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
<div class="col-sm-10">
<select name="status" id="input-status" class="form-control">
<?php if ($status) { ?>
<option value="1" selected="selected"><?php echo $text_enabled; ?></option>
<option value="0"><?php echo $text_disabled; ?></option>
<?php } else { ?>
<option value="1"><?php echo $text_enabled; ?></option>
<option value="0" selected="selected"><?php echo $text_disabled; ?></option>
<?php } ?>
</select>
</div>
</div>
<table id="modules" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<td class="text-left"><?php echo $entry_name; ?></td>
<td></td>
</tr>
</thead>
<tbody>
<?php $module_row = 0; ?>
<?php foreach ($test_modules as $test_module) { ?>
<tr id="module-row<?php echo $module_row; ?>">
<td class="text-right"><input type="text" name="test_module[<?php echo $module_row; ?>][name]" value="<?php echo $test_module['name']; ?>" placeholder="<?php echo $entry_name; ?>" class="form-control" /></td>
<td class="text-left"><button type="button" onclick="$('#module-row<?php echo $module_row; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
</tr>
<?php $module_row++; ?>
<?php } ?>
</tbody>
<tfoot>
<tr>
<td colspan="1"></td>
<td class="text-left"><button type="button" onclick="addModule();" data-toggle="tooltip" title="<?php echo $button_module_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
</tr>
</tfoot>
</table>
</form>
</div>
</div>
</div>
<script type="text/javascript"><!--
var module_row = <?php echo $module_row; ?>;
function addModule() {
html = '<tr id="module-row' + module_row + '">';
html += ' <td class="text-right"><input type="text" name="test_module[' + module_row + '][name]" value="" placeholder="<?php echo $entry_name; ?>" class="form-control" /></td>';
html += ' <td class="text-left"><button type="button" onclick="$(\'#module-row' + module_row + '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
html += '</tr>';
$('#modules tbody').append(html);
module_row++;
}
//--></script>
and try this code on admin/controller/module/test.php
<?php
class ControllerModuleTest extends Controller {
private $error = array();
public function index() {
$this->load->language('module/test');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('extension/module');
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
if (!isset($this->request->get['module_id'])) {
$this->model_extension_module->addModule('test', $this->request->post);
} else {
$this->model_extension_module->editModule($this->request->get['module_id'], $this->request->post);
}
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
}
$data['heading_title'] = $this->language->get('heading_title');
$data['text_edit'] = $this->language->get('text_edit');
$data['text_enabled'] = $this->language->get('text_enabled');
$data['text_disabled'] = $this->language->get('text_disabled');
$data['entry_status'] = $this->language->get('entry_status');
$data['entry_name'] = $this->language->get('entry_name');
$data['button_save'] = $this->language->get('button_save');
$data['button_cancel'] = $this->language->get('button_cancel');
$data['button_module_add'] = $this->language->get('button_module_add');
$data['button_remove'] = $this->language->get('button_remove');
if (isset($this->error['warning'])) {
$data['error_warning'] = $this->error['warning'];
} else {
$data['error_warning'] = '';
}
if (isset($this->error['name'])) {
$data['error_name'] = $this->error['name'];
} else {
$data['error_name'] = '';
}
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_module'),
'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL')
);
if (!isset($this->request->get['module_id'])) {
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('module/test', 'token=' . $this->session->data['token'], 'SSL')
);
} else {
$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('module/test', 'token=' . $this->session->data['token'] . '&module_id=' . $this->request->get['module_id'], 'SSL')
);
}
if (!isset($this->request->get['module_id'])) {
$data['action'] = $this->url->link('module/test', 'token=' . $this->session->data['token'], 'SSL');
} else {
$data['action'] = $this->url->link('module/test', 'token=' . $this->session->data['token'] . '&module_id=' . $this->request->get['module_id'], 'SSL');
}
$data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
if (isset($this->request->get['module_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
$module_info = $this->model_extension_module->getModule($this->request->get['module_id']);
}
$data['token'] = $this->session->data['token'];
if (isset($this->request->post['name'])) {
$data['name'] = $this->request->post['name'];
} elseif (!empty($module_info)) {
$data['name'] = $module_info['name'];
} else {
$data['name'] = '';
}
if (isset($this->request->post['status'])) {
$data['status'] = $this->request->post['status'];
} elseif (!empty($module_info)) {
$data['status'] = $module_info['status'];
} else {
$data['status'] = '';
}
if (isset($this->request->post['test_module'])) {
$test_modules = $this->request->post['test_module'];
} elseif (isset($this->request->get['test_id'])) {
$test_modules = $this->config->get('test_module');
} else {
$test_modules = array();
}
$data['test_modules'] = array();
foreach ($test_modules as $test_module) {
$data['test_modules'][] = array(
'name' => $test_module['name']
);
}
$this->load->model('design/layout');
$data['layouts'] = $this->model_design_layout->getLayouts();
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('module/test.tpl', $data));
}
protected function validate() {
if (!$this->user->hasPermission('modify', 'module/test')) {
$this->error['warning'] = $this->language->get('error_permission');
}
if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 64)) {
$this->error['name'] = $this->language->get('error_name');
}
return !$this->error;
}
}
But after save it not saved the values of table .
I am not getting whats the wrong in this code.
Any one please help me.
Thanks

There is two mistakes in your code
1st - Opencart version 2 don't have add module option to layout option in modules. It's moved to layout now. So you can remove your code now,
2nd - In this version to save values to config your module/ shipping/ payment or others extensions input type name must have prefix of module name so your name must be "test_name" here.

Related

getVar() from selected option input codeigniter 4

I have view
<!-- input-text -->
<div class="form-group">
<?php $name = 'name';
$placeholder = 'Nama Lengkap';
$value = old($name); ?>
<label for="<?= $name; ?>"><?= $placeholder; ?></label>
<input type="text" class="form-control <?= ($validation->hasError($name)) ? "is-invalid" : ''; ?>" id="<?= $name; ?>" name="<?= $name; ?>" placeholder="<?= $placeholder; ?>" value="<?= $value ?>">
<div class="invalid-feedback">
<?= $validation->getError($name); ?>
</div>
</div>
<!-- input-select -->
<div class="form-group">
<?php $name = 'gender';
$placeholder = 'Jenis Kelamin';
$value = old($name); ?>
<label for="<?= $name; ?>"><?= $placeholder; ?></label>
<select name="<?= $name; ?>" class="selectpicker form-control" data-live-search="true" id="<?= $name; ?>">
<option value="0">Laki-laki</option>
<option value="1">Perempuan</option>
</select>
</div>
and controller
public function create(){
dd($this->request->getVar());}
it show only name, but gender doesn't. How to show the value of selected option in CodeIgniter 4?
when you try to catch your post in controller u should type the name variable of the input
public function create(){
dd($this->request->getVar('gender'));
}
Use form helper, try it:
<div class="form-group">
<label for="name">Nama Lengkap</label>
<?php echo form_input('name', set_value('name'), 'class="form-control" placeholder="Nama Lengkap"'); ?>
<?php if(!empty($errors)){ ?>
<em class="text-danger"><?php echo $errors->getError('name') ?></em>
<?php } ?>
</div>
<div class="form-group">
<label for="gender">Jenis Kelamin</label>
<?php echo form_dropdown('gender', ['0' => 'Laki-laki', '1' => 'Perempuan'], [], 'class="form-control"'); ?>
</div>
Hope it helpful, cheers...

Codeigniter - upload xls or xlsx and send the data to current view

i been stuck at this problem for a long time. I have a page with list of student and student's score. I want to add a button to upload xls/xlsx file at the current page, and after i uploaded the file, the column data fill the student's score input. How can i do that? Please i need help on this.
View
<form action="<?php echo base_url()?>index.php/nilai/ubahNilaiItem/<?php echo $idKelas ?>/<?php echo $id ?>" method="post" class="form-horizontal">
<button name="tombol" type="submit" value="import" class="btn pull-right btn-primary">Import</button>
<input type="file" name="inputfile" size="20" class="pull-right"/>
</div>
<div class="col-lg-12">
<table class="table">
<thead>
<tr>
<th class="col-md-1 active">No</th>
<th class="col-md-2 active">NIM</th>
<th class="col-md-5 active">Nama</th>
<th class="col-md-1 active">Nilai</th>
</tr>
</thead>
<tbody>
<?php
$no = 0;
foreach($input as $i){
$no++
?>
<tr>
<td><?php echo $no ?></td>
<td><?php echo $i->nim ?></td>
<td><?php echo $i->nama ?></td>
<td>
<div class="input-group">
<input hidden value="<?php echo $i->id ?>" name="id[]">
<input class="text-center form-control" value="<?php echo $i->angka_nilai ?>" name="angka[]"> //this is for inputing student score
<span class="input-group-addon"><i class="glyphicon glyphicon-question-sign" data-toggle="tooltip" title="Gunakan koma (,) untuk nilai desimal"></i></span>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<button name="tombol" value="simpan" type="submit" class="btn pull-right btn btn-primary">Simpan</button>
</form>
Controller for the view
public function itemView($idKelas,$id){
//load model
$this->load->model('nilais');
//take data from database
$data2['input'] = $this->nilais->input_item($idKelas,$id)->result();
$data3['detail'] = $this->nilais->tampil_detail($idKelas)->result();
//merge array
$data4 = array_merge($data2, $data3);
$data4['item'] = $this->nilais->item_detail($id)->result();
$data4['idKelas'] = $idKelas;
$data4['id'] = $id;
//take data for header and notification
$data6['notifikasi'] = $this->nilais->notifikasi($this->session->userdata('id_user'))->result();
$data6['count'] = count($data6['notifikasi']);
$data6['matakuliah'] = $idKelas;
$data6['active'] = 'nilai';
//load view nilai and header
$this->load->view('nilai/item_view',$data4);
$this->load->view('header',$data6);
}
Update
Now i used PHPExcel, but i cant get the null cell. How can i get all cell even if its null?
Controller for excel
public function importAction($idKelas,$id){
//load model
$this->load->model('nilais');
$this->load->library('excel');
$config['upload_path'] = './file/excel/';
$config['allowed_types'] = 'xls|xlsx';
$config['max_size'] = 0;
$this->load->library('upload', $config);
if ($this->upload->do_upload('inputfile')) {
$upload_data = $this->upload->data();
$objPHPExcel = PHPExcel_IOFactory::load($upload_data['full_path']);
$cell_collection = $objPHPExcel->getActiveSheet()->getCellCollection();
foreach ($cell_collection as $cell) {
$column = $objPHPExcel->getActiveSheet()->getCell($cell)->getColumn();
$row = $objPHPExcel->getActiveSheet()->getCell($cell)->getRow();
$data_value = $objPHPExcel->getActiveSheet()->getCell($cell)->getValue();
//header will/should be in row 1 only. of course this can be modified to suit your need.
if ($row == 1) {
$header[$row][$column] = $data_value;
} else {
$arr_data[$row][$column] = $data_value;
}
}
//send the data in an array format
$data['header'] = $header;
$data['values'] = $arr_data;
}
}

How to display 5 columns per row in Opencart?

How to display 5 columns per row in opencart?
What I have tried is Extensions -> Modules ->Featured then edit the module. I have changed the limit to 5 and decreased the width and height but after changing it displays the same. I am not able to get five columns per row. Please suggest me how to acheve it.
Thank you.
Here is my popular.tpl file in catalog/view/theme/promoglasses/template/module
<div class="tab-title">
<h2>Popular Products</h2>
<ul class="tabs tabs-popular-products tab_categorys">
<li class="active" rel="tab129-popular-products">POPULAR Products</li>
</ul>
</div>
<br />
<br />
<br />
<div class="row">
<?php foreach ($products as $product) { ?>
<div class="product-layout col-sm-5ths">
<div class="product-thumb transition">
<div class="image"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></div>
<div class="caption">
<h4><?php echo $product['name']; ?></h4>
<div class="label-cont"> As low as </div>
<div class="label-price">
<?php if ($product['price']) { ?>
<p class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<?php } ?>
</p>
<?php } ?>
</div>
<div class="label-sup">
<b>
<sup>(C)</sup>
</b>
</div>
<br />
<p><?php echo $product['description']; ?></p>
<?php if ($product['rating']) { ?>
<div class="rating">
<?php for ($i = 1; $i <= 5; $i++) { ?>
<?php if ($product['rating'] < $i) { ?>
<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
<?php } else { ?>
<span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
</div>
For the CSS part here I have written the code for class col-sm-5ths:
.col-sm-5ths {
float: left;
width: 20%;
min-height: 1px;
position: relative;
}

Display Description Category for OPencart 2.0

I used mod bycategory to display products on homepage
Now, im' want display description category(don't product) (on homepage)
Code catalog/controller/module/bycategory.php
<?php
class ControllerModuleBycategory extends Controller {
public function index($setting) {
$this->load->language('module/bycategory');
$data['heading_title'] = $setting['name'];
$data['text_tax'] = $this->language->get('text_tax');
$data['button_cart'] = $this->language->get('button_cart');
$data['button_wishlist'] = $this->language->get('button_wishlist');
$data['button_compare'] = $this->language->get('button_compare');
$this->load->model('catalog/product');
$this->load->model('tool/image');
$data['products'] = array();
$filter_data = array(
'sort' => 'p.date_added',
'order' => 'DESC',
'start' => 0,
'limit' => $setting['limit'],
'filter_category_id'=>$setting['category']
);
$data['type'] = $setting['type'];
$results = $this->model_catalog_product->getProducts($filter_data);
if ($results) {
foreach ($results as $result) {
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height']);
} else {
$image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']);
}
if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$price = false;
}
if ((float)$result['special']) {
$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
} else {
$special = false;
}
if ($this->config->get('config_tax')) {
$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']);
} else {
$tax = false;
}
if ($this->config->get('config_review_status')) {
$rating = $result['rating'];
} else {
$rating = false;
}
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $rating,
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
);
}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/bycategory.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/module/bycategory.tpl', $data);
} else {
return $this->load->view('default/template/module/bycategory.tpl', $data);
}
}
}
}
And code catalog/view/theme/default/template/module/bycategory.tpl
<?php foreach ($products as $product) { ?>
<?php
if($type=="vertical"){
?>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<?php
}else{
?>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<?php
}
?>
<div class="product-thumb transition">
<div class="image"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></div>
<div class="caption">
<h4><?php echo $product['name']; ?></h4>
<?php if ($product['rating']) { ?>
<div class="rating">
<?php for ($i = 1; $i <= 5; $i++) { ?>
<?php if ($product['rating'] < $i) { ?>
<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
<?php } else { ?>
<span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
<?php if ($product['price']) { ?>
<p class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
<?php } ?>
</p>
<?php } ?>
</div>
<div class="button-group">
<button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
<button type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-heart"></i></button>
<button type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-exchange"></i></button>
</div>
</div>
</div>
<?php } ?>
</div>
How to display [![description for category][1]][1] (by category in homepage)?
Help me!
Link demo http://duhocaaumy.com/demo.jpg
Try this solution,
Add below code in catalog/controller/module/bycategory.php
$category_info = $this->model_catalog_category->getCategory($setting['category']);
$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
Go to catalog/view/theme/default/template/module/bycategory.tpl
Add below code where you want to display category description
<?php echo $description; ?>

Opencart pagination links on search results just reload first page when clicked, and adds "#" to the URL String

When I submit search results on my site it loads accurate results with the correct number of products displayed... When I go down to the pagination links at the bottom they show the correct links when hovered over them... However when I click on them it just reloads the page I'm already at AND it adds # to the end of the URL string.... The code appears to be correct, my initial feeling is that this maybe because of the SEO URLS I have enabled in opencart, and the HTACCESS edits I have made....
Here is an example: http://www.justicejewelers.com/index.php?route=product/search&filter_name=gold
HTACCESS:
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
Search.php:
$pagination = new Pagination();
$pagination->total = $product_total;
$pagination->page = $page;
$pagination->limit = $limit;
$pagination->text = $this->language->get('text_pagination');
$pagination->url = $this->url->link('product/search', $url . '&page={page}');
Search.TPL:
<?php echo $header; ?>
<?php echo $content_top; ?>
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?>
<a href="<?php echo $breadcrumb['href']; ?>">
<?php echo $breadcrumb['text']; ?>
</a>
<?php } ?>
</div>
<header class="heading">
<h1><?php echo $heading_title; ?></h1>
<div id="notification"></div>
</header>
<?php
if ($column_left || $column_right) { $main = "span9"; }
else { $main = "span12"; }
?>
<div class="row-fluid">
<?php echo $column_left; ?>
<section id="maincontent" class="<?php echo $main; ?> search listing" role="main">
<div class="mainborder">
<?php if ($column_left) { ?>
<div id="toggle_sidebar"></div>
<?php } ?>
<div class="search-criteria">
<div class="contentset center">
<h4 class="inner">
<span><?php echo $text_critea; ?></span>
</h4>
</div>
<div class="controls">
<input type="search" name="filter_name" id="filter_name" value="<?php echo $filter_name; ?>" class="search-box span6" placeholder="Search" />
</div>
<select name="filter_category_id" class="filter-category span4">
<option value="0"><?php echo $text_category; ?></option>
<?php foreach ($categories as $category_1) { ?>
<?php if ($category_1['category_id'] == $filter_category_id) { ?>
<option value="<?php echo $category_1['category_id']; ?>" selected="selected"><?php echo $category_1['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_1['category_id']; ?>"><?php echo $category_1['name']; ?></option>
<?php } ?>
<?php foreach ($category_1['children'] as $category_2) { ?>
<?php if ($category_2['category_id'] == $filter_category_id) { ?>
<option value="<?php echo $category_2['category_id']; ?>" selected="selected"> - <?php echo $category_2['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_2['category_id']; ?>"> - <?php echo $category_2['name']; ?></option>
<?php } ?>
<?php foreach ($category_2['children'] as $category_3) { ?>
<?php if ($category_3['category_id'] == $filter_category_id) { ?>
<option value="<?php echo $category_3['category_id']; ?>" selected="selected"> - <?php echo $category_3['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category_3['category_id']; ?>"> - <?php echo $category_3['name']; ?></option>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
</select>
<div class="controls">
<label class="checkbox inline">
<?php if ($filter_sub_category) { ?>
<input type="checkbox" name="filter_sub_category" value="1" id="sub_category" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="filter_sub_category" value="1" id="sub_category" />
<?php } ?>
<?php echo $text_sub_category; ?>
</label>
<label class="checkbox inline">
<?php if ($filter_description) { ?>
<input type="checkbox" name="filter_description" value="1" id="description" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="filter_description" value="1" id="description" />
<?php } ?>
<?php echo $entry_description; ?>
</label>
</div>
<div class="buttons">
<input type="button" value="<?php echo $button_search; ?>" id="button-search" class="btn btn-inverse" />
</div>
</div>
<div class="contentset center">
<h4 class="inner">
<span><?php echo $text_search; ?></span>
</h4>
</div>
<!-- Products
============================== -->
<?php if ($products) { ?>
<!-- Grid/Lis view, filters
============================== -->
<div class="product-filter">
<div class="btn-group display" data-toggle="buttons-radio">
<button id="grid" class="btn btn-mini" title="<?php echo $text_grid; ?>" onclick="display('grid');"><i class="icon-th"></i></button>
<button id="list" class="btn btn-mini" title="<?php echo $text_list; ?>" onclick="display('list');"><i class="icon-list"></i></button>
</div>
<span class="product-compare"><?php echo $text_compare; ?></span>
<div class="list-options">
<div class="sort">
<?php echo $text_sort; ?>
<select onchange="location = this.value;">
<?php foreach ($sorts as $sorts) { ?>
<?php if ($sorts['value'] == $sort . '-' . $order) { ?>
<option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
<?php } else { ?>
<option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
<?php } ?>
<?php } ?>
</select>
</div>
<div class="limit">
<?php echo $text_limit; ?>
<select onchange="location = this.value;">
<?php foreach ($limits as $limits) { ?>
<?php if ($limits['value'] == $limit) { ?>
<option value="<?php echo $limits['href']; ?>" selected="selected">
<?php echo $limits['text']; ?>
</option>
<?php } else { ?>
<option value="<?php echo $limits['href']; ?>">
<?php echo $limits['text']; ?>
</option>
<?php } ?>
<?php } ?>
</select>
</div>
</div>
</div>
<!-- Product list (Default to Grid)
============================== -->
<div class="product-grid row-fluid">
<?php
$counter=0;
foreach ($products as $product) {
if ($counter == 0 ) $xclass = 'alpha';
else if (($counter+12) % 12 == 0 ) $xclass = 'alpha4 alpha3';
else if (($counter+4) % 4 == 0 ) $xclass = 'alpha4';
else if (($counter+3) % 3 == 0 ) $xclass = 'alpha3';
else $xclass = '';
if (($counter+2) % 2 == 0 ) $xclass .= ' odd';
?>
<div class="grid-box <?php echo $xclass; ?>">
<div class="inner">
<?php if ($product['price'] && $product['special']) { ?>
<span class="onsale">
<?php $this->language->load('module/sellegance');
echo $this->language->get('text_onsale'); ?>
</span>
<?php } ?>
<?php if ($product['thumb']) { ?>
<div class="image">
<img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" />
</div>
<?php } ?>
<div class="name">
<?php echo $product['name']; ?>
</div>
<?php if ($product['rating']) { ?>
<div class="rating">
<img src="catalog/view/theme/sellegance/images/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
</div>
<?php } ?>
<div class="description"><?php echo $product['description']; ?></div>
<?php if ($product['price']) { ?>
<div class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-old"><?php echo $product['price']; ?></span>
<span class="price-new"><?php echo $product['special']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<br />
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
<?php } ?>
</div>
<?php } ?>
<div class="actions">
<div class="cart">
<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="btn btn-cart btn-small" />
</div>
<div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>
</div>
</div>
</div>
<?php $counter++; } ?>
</div> <!-- .produc-grid -->
<div class="paginate"><?php echo $pagination; ?></div>
<?php } else { ?>
<div class="content empty white">
<div class="alert warning"><?php echo $text_empty; ?><a class="close" data-dismiss="alert" href="#">×</a></div>
</div>
<?php } ?>
</div>
</section><!-- #maincontent -->
<?php echo $column_right; ?>
</div> <!-- .row -->
<?php echo $content_bottom; ?>
<script type="text/javascript">
jQuery('#maincontent input[name=\'filter_name\']').keydown(function(e) {
if (e.keyCode == 13) {
jQuery('.button-search').trigger('click');
}
});
jQuery('#button-search').bind('click', function() {
url = 'index.php?route=product/search';
var filter_name = jQuery('#maincontent input[name=\'filter_name\']').attr('value');
if (filter_name) {
url += '&filter_name=' + encodeURIComponent(filter_name);
}
var filter_category_id = jQuery('#maincontent select[name=\'filter_category_id\']').attr('value');
if (filter_category_id > 0) {
url += '&filter_category_id=' + encodeURIComponent(filter_category_id);
}
var filter_sub_category = jQuery('#maincontent input[name=\'filter_sub_category\']:checked').attr('value');
if (filter_sub_category) {
url += '&filter_sub_category=true';
}
var filter_description = jQuery('#maincontent input[name=\'filter_description\']:checked').attr('value');
if (filter_description) {
url += '&filter_description=true';
}
location = url;
});
</script>
The true question is why would this script in search:
<script type="text/javascript">
jQuery('#maincontent input[name=\'filter_name\']').keydown(function(e) {
if (e.keyCode == 13) {
jQuery('.button-search').trigger('click');
}
});
jQuery('#button-search').bind('click', function() {
url = 'index.php?route=product/search';
var filter_name = jQuery('#maincontent input[name=\'filter_name\']').attr('value');
if (filter_name) {
url += '&filter_name=' + encodeURIComponent(filter_name);
}
var filter_category_id = jQuery('#maincontent select[name=\'filter_category_id\']').attr('value');
if (filter_category_id > 0) {
url += '&filter_category_id=' + encodeURIComponent(filter_category_id);
}
var filter_sub_category = jQuery('#maincontent input[name=\'filter_sub_category\']:checked').attr('value');
if (filter_sub_category) {
url += '&filter_sub_category=true';
}
var filter_description = jQuery('#maincontent input[name=\'filter_description\']:checked').attr('value');
if (filter_description) {
url += '&filter_description=true';
}
location = url;
});
</script>
BE effected by bannerpack, and not work without it?
Here is the code for Banner Pack:
(function($){var NivoSlider=function(element,options){var settings=$.extend({},$.fn.nivoSlider.defaults,options);var vars={currentSlide:0,currentImage:'',totalSlides:0,randAnim:'',running:false,paused:false,stop:false};var slider=$(element);slider.data('nivo:vars',vars);slider.css('position','relative');slider.addClass('nivoSlider');var kids=slider.children();kids.each(function(){var child=$(this);var link='';if(!child.is('img')){if(child.is('a')){child.addClass('nivo-imageLink');link=child;}
child=child.find('img:first');}
var childWidth=child.width();if(childWidth==0)childWidth=child.attr('width');var childHeight=child.height();if(childHeight==0)childHeight=child.attr('height');if(childWidth>slider.width()){slider.width(childWidth);}
if(childHeight>slider.height()){slider.height(childHeight);}
if(link!=''){link.css('display','none');}
child.css('display','none');vars.totalSlides++;});if(settings.startSlide>0){if(settings.startSlide>=vars.totalSlides)settings.startSlide=vars.totalSlides-1;vars.currentSlide=settings.startSlide;}
if($(kids[vars.currentSlide]).is('img')){vars.currentImage=$(kids[vars.currentSlide]);}else{vars.currentImage=$(kids[vars.currentSlide]).find('img:first');}
if($(kids[vars.currentSlide]).is('a')){$(kids[vars.currentSlide]).css('display','block');}
slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');slider.append($('<div class="nivo-caption"><p></p></div>').css({display:'none',opacity:settings.captionOpacity}));var processCaption=function(settings){var nivoCaption=$('.nivo-caption',slider);if(vars.currentImage.attr('title')!=''&&vars.currentImage.attr('title')!=undefined){var title=vars.currentImage.attr('title');if(title.substr(0,1)=='#')title=$(title).html();if(nivoCaption.css('display')=='block'){nivoCaption.find('p').fadeOut(settings.animSpeed,function(){$(this).html(title);$(this).fadeIn(settings.animSpeed);});}else{nivoCaption.find('p').html(title);}
nivoCaption.fadeIn(settings.animSpeed);}else{nivoCaption.fadeOut(settings.animSpeed);}}
processCaption(settings);var timer=0;if(!settings.manualAdvance&&kids.length>1){timer=setInterval(function(){nivoRun(slider,kids,settings,false);},settings.pauseTime);}
if(settings.directionNav){slider.append('<div class="ban_direction"><a class="nivo-prevNav">'+settings.prevText+'</a><a class="nivo-nextNav">'+settings.nextText+'</a></div>');if(settings.directionNavHide){$('.ban_direction',slider).hide();slider.hover(function(){$('.ban_direction',slider).show();},function(){$('.ban_direction',slider).hide();});}
$('a.nivo-prevNav',slider).live('click',function(){if(vars.running)return false;clearInterval(timer);timer='';vars.currentSlide-=2;nivoRun(slider,kids,settings,'prev');});$('a.nivo-nextNav',slider).live('click',function(){if(vars.running)return false;clearInterval(timer);timer='';nivoRun(slider,kids,settings,'next');});}
if(settings.controlNav){var nivoControl=$('<div class="banner_control"></div>');slider.append(nivoControl);for(var i=0;i<kids.length;i++){if(settings.controlNavThumbs){var child=kids.eq(i);if(!child.is('img')){child=child.find('img:first');}
if(settings.controlNavThumbsFromRel){nivoControl.append('<a class="ban_control" rel="'+i+'"><img src="'+child.attr('rel')+'" alt="" /></a>');}else{nivoControl.append('<a class="ban_control" rel="'+i+'"><img src="'+child.attr('src').replace(settings.controlNavThumbsSearch,settings.controlNavThumbsReplace)+'" alt="" /></a>');}}else{nivoControl.append('<a class="ban_control" rel="'+i+'">'+(i+1)+'</a>');}}
$('.banner_control a:eq('+vars.currentSlide+')',slider).addClass('active');$('.banner_control a',slider).live('click',function(){if(vars.running)return false;if($(this).hasClass('active'))return false;clearInterval(timer);timer='';slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');vars.currentSlide=$(this).attr('rel')-1;nivoRun(slider,kids,settings,'control');});}
if(settings.keyboardNav){$(window).keypress(function(event){if(event.keyCode=='37'){if(vars.running)return false;clearInterval(timer);timer='';vars.currentSlide-=2;nivoRun(slider,kids,settings,'prev');}
if(event.keyCode=='39'){if(vars.running)return false;clearInterval(timer);timer='';nivoRun(slider,kids,settings,'next');}});}
if(settings.pauseOnHover){slider.hover(function(){vars.paused=true;clearInterval(timer);timer='';},function(){vars.paused=false;if(timer==''&&!settings.manualAdvance){timer=setInterval(function(){nivoRun(slider,kids,settings,false);},settings.pauseTime);}});}
slider.bind('nivo:animFinished',function(){vars.running=false;$(kids).each(function(){if($(this).is('a')){$(this).css('display','none');}});if($(kids[vars.currentSlide]).is('a')){$(kids[vars.currentSlide]).css('display','block');}
if(timer==''&&!vars.paused&&!settings.manualAdvance){timer=setInterval(function(){nivoRun(slider,kids,settings,false);},settings.pauseTime);}
settings.afterChange.call(this);});var createSlices=function(slider,settings,vars){for(var i=0;i<settings.slices;i++){var sliceWidth=Math.round(slider.width()/settings.slices);if(i==settings.slices-1){slider.append($('<div class="banner-slice"></div>').css({left:(sliceWidth*i)+'px',width:(slider.width()-(sliceWidth*i))+'px',height:'0px',opacity:'0',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((sliceWidth+(i*sliceWidth))-sliceWidth)+'px 0%'}));}else{slider.append($('<div class="banner-slice"></div>').css({left:(sliceWidth*i)+'px',width:sliceWidth+'px',height:'0px',opacity:'0',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((sliceWidth+(i*sliceWidth))-sliceWidth)+'px 0%'}));}}}
var createBoxes=function(slider,settings,vars){var boxWidth=Math.round(slider.width()/settings.boxCols);var boxHeight=Math.round(slider.height()/settings.boxRows);for(var rows=0;rows<settings.boxRows;rows++){for(var cols=0;cols<settings.boxCols;cols++){if(cols==settings.boxCols-1){slider.append($('<div class="bannar-box"></div>').css({opacity:0,left:(boxWidth*cols)+'px',top:(boxHeight*rows)+'px',width:(slider.width()-(boxWidth*cols))+'px',height:boxHeight+'px',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((boxWidth+(cols*boxWidth))-boxWidth)+'px -'+((boxHeight+(rows*boxHeight))-boxHeight)+'px'}));}else{slider.append($('<div class="bannar-box"></div>').css({opacity:0,left:(boxWidth*cols)+'px',top:(boxHeight*rows)+'px',width:boxWidth+'px',height:boxHeight+'px',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((boxWidth+(cols*boxWidth))-boxWidth)+'px -'+((boxHeight+(rows*boxHeight))-boxHeight)+'px'}));}}}}
var nivoRun=function(slider,kids,settings,nudge){var vars=slider.data('nivo:vars');if(vars&&(vars.currentSlide==vars.totalSlides-1)){settings.lastSlide.call(this);}
if((!vars||vars.stop)&&!nudge)return false;settings.beforeChange.call(this);if(!nudge){slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');}else{if(nudge=='prev'){slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');}
if(nudge=='next'){slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');}}
vars.currentSlide++;if(vars.currentSlide==vars.totalSlides){vars.currentSlide=0;settings.slideshowEnd.call(this);}
if(vars.currentSlide<0)vars.currentSlide=(vars.totalSlides-1);if($(kids[vars.currentSlide]).is('img')){vars.currentImage=$(kids[vars.currentSlide]);}else{vars.currentImage=$(kids[vars.currentSlide]).find('img:first');}
if(settings.controlNav){$('.banner_control a',slider).removeClass('active');$('.banner_control a:eq('+vars.currentSlide+')',slider).addClass('active');}
processCaption(settings);$('.banner-slice',slider).remove();$('.bannar-box',slider).remove();if(settings.effect=='random'){var anims=new Array('fade');vars.randAnim=anims[Math.floor(Math.random()*(anims.length+1))];if(vars.randAnim==undefined)vars.randAnim='fade';}
if(settings.effect.indexOf(',')!=-1){var anims=settings.effect.split(',');vars.randAnim=anims[Math.floor(Math.random()*(anims.length))];if(vars.randAnim==undefined)vars.randAnim='fade';}
vars.running=true;if(settings.effect=='sliceDown'||settings.effect=='sliceDownRight'||vars.randAnim=='sliceDownRight'||settings.effect=='sliceDownLeft'||vars.randAnim=='sliceDownLeft'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;var slices=$('.banner-slice',slider);if(settings.effect=='sliceDownLeft'||vars.randAnim=='sliceDownLeft')slices=$('.banner-slice',slider)._reverse();slices.each(function(){var slice=$(this);slice.css({'top':'0px'});if(i==settings.slices-1){setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed,'',function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed);},(100+timeBuff));}
timeBuff+=50;i++;});}
else if(settings.effect=='sliceUp'||settings.effect=='sliceUpRight'||vars.randAnim=='sliceUpRight'||settings.effect=='sliceUpLeft'||vars.randAnim=='sliceUpLeft'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;var slices=$('.banner-slice',slider);if(settings.effect=='sliceUpLeft'||vars.randAnim=='sliceUpLeft')slices=$('.banner-slice',slider)._reverse();slices.each(function(){var slice=$(this);slice.css({'bottom':'0px'});if(i==settings.slices-1){setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed,'',function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed);},(100+timeBuff));}
timeBuff+=50;i++;});}
else if(settings.effect=='sliceUpDown'||settings.effect=='sliceUpDownRight'||vars.randAnim=='sliceUpDown'||settings.effect=='sliceUpDownLeft'||vars.randAnim=='sliceUpDownLeft'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;var v=0;var slices=$('.banner-slice',slider);if(settings.effect=='sliceUpDownLeft'||vars.randAnim=='sliceUpDownLeft')slices=$('.banner-slice',slider)._reverse();slices.each(function(){var slice=$(this);if(i==0){slice.css('top','0px');i++;}else{slice.css('bottom','0px');i=0;}
if(v==settings.slices-1){setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed,'',function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed);},(100+timeBuff));}
timeBuff+=50;v++;});}
else if(settings.effect=='fold'||vars.randAnim=='fold'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;$('.banner-slice',slider).each(function(){var slice=$(this);var origWidth=slice.width();slice.css({top:'0px',height:'100%',width:'0px'});if(i==settings.slices-1){setTimeout(function(){slice.animate({width:origWidth,opacity:'1.0'},settings.animSpeed,'',function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({width:origWidth,opacity:'1.0'},settings.animSpeed);},(100+timeBuff));}
timeBuff+=50;i++;});}
else if(settings.effect=='fade'||vars.randAnim=='fade'){createSlices(slider,settings,vars);var firstSlice=$('.banner-slice:first',slider);firstSlice.css({'height':'100%','width':slider.width()+'px'});firstSlice.animate({opacity:'1.0'},(settings.animSpeed*2),'',function(){slider.trigger('nivo:animFinished');});}
else if(settings.effect=='slideInRight'||vars.randAnim=='slideInRight'){createSlices(slider,settings,vars);var firstSlice=$('.banner-slice:first',slider);firstSlice.css({'height':'100%','width':'0px','opacity':'1'});firstSlice.animate({width:slider.width()+'px'},(settings.animSpeed*2),'',function(){slider.trigger('nivo:animFinished');});}
else if(settings.effect=='slideInLeft'||vars.randAnim=='slideInLeft'){createSlices(slider,settings,vars);var firstSlice=$('.banner-slice:first',slider);firstSlice.css({'height':'100%','width':'0px','opacity':'1','left':'','right':'0px'});firstSlice.animate({width:slider.width()+'px'},(settings.animSpeed*2),'',function(){firstSlice.css({'left':'0px','right':''});slider.trigger('nivo:animFinished');});}
else if(settings.effect=='boxRandom'||vars.randAnim=='boxRandom'){createBoxes(slider,settings,vars);var totalBoxes=settings.boxCols*settings.boxRows;var i=0;var timeBuff=0;var boxes=shuffle($('.bannar-box',slider));boxes.each(function(){var box=$(this);if(i==totalBoxes-1){setTimeout(function(){box.animate({opacity:'1'},settings.animSpeed,'',function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){box.animate({opacity:'1'},settings.animSpeed);},(100+timeBuff));}
timeBuff+=20;i++;});}
else if(settings.effect=='boxRain'||vars.randAnim=='boxRain'||settings.effect=='boxRainReverse'||vars.randAnim=='boxRainReverse'||settings.effect=='boxRainGrow'||vars.randAnim=='boxRainGrow'||settings.effect=='boxRainGrowReverse'||vars.randAnim=='boxRainGrowReverse'){createBoxes(slider,settings,vars);var totalBoxes=settings.boxCols*settings.boxRows;var i=0;var timeBuff=0;var rowIndex=0;var colIndex=0;var box2Darr=new Array();box2Darr[rowIndex]=new Array();var boxes=$('.bannar-box',slider);if(settings.effect=='boxRainReverse'||vars.randAnim=='boxRainReverse'||settings.effect=='boxRainGrowReverse'||vars.randAnim=='boxRainGrowReverse'){boxes=$('.bannar-box',slider)._reverse();}
boxes.each(function(){box2Darr[rowIndex][colIndex]=$(this);colIndex++;if(colIndex==settings.boxCols){rowIndex++;colIndex=0;box2Darr[rowIndex]=new Array();}});for(var cols=0;cols<(settings.boxCols*2);cols++){var prevCol=cols;for(var rows=0;rows<settings.boxRows;rows++){if(prevCol>=0&&prevCol<settings.boxCols){(function(row,col,time,i,totalBoxes){var box=$(box2Darr[row][col]);var w=box.width();var h=box.height();if(settings.effect=='boxRainGrow'||vars.randAnim=='boxRainGrow'||settings.effect=='boxRainGrowReverse'||vars.randAnim=='boxRainGrowReverse'){box.width(0).height(0);}
if(i==totalBoxes-1){setTimeout(function(){box.animate({opacity:'1',width:w,height:h},settings.animSpeed/1.3,'',function(){slider.trigger('nivo:animFinished');});},(100+time));}else{setTimeout(function(){box.animate({opacity:'1',width:w,height:h},settings.animSpeed/1.3);},(100+time));}})(rows,prevCol,timeBuff,i,totalBoxes);i++;}
prevCol--;}
timeBuff+=100;}}}
var shuffle=function(arr){for(var j,x,i=arr.length;i;j=parseInt(Math.random()*i),x=arr[--i],arr[i]=arr[j],arr[j]=x);return arr;}
var trace=function(msg){if(this.console&&typeof console.log!="undefined")
console.log(msg);}
this.stop=function(){if(!$(element).data('nivo:vars').stop){$(element).data('nivo:vars').stop=true;trace('Stop Slider');}}
this.start=function(){if($(element).data('nivo:vars').stop){$(element).data('nivo:vars').stop=false;trace('Start Slider');}}
settings.afterLoad.call(this);return this;};$.fn.nivoSlider=function(options){return this.each(function(key,value){var element=$(this);if(element.data('nivoslider'))return element.data('nivoslider');var nivoslider=new NivoSlider(this,options);element.data('nivoslider',nivoslider);});};$.fn.nivoSlider.defaults={effect:'random',slices:15,boxCols:8,boxRows:4,animSpeed:500,pauseTime:5000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:'.jpg',controlNavThumbsReplace:'_thumb.jpg',keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8,prevText:'Prev',nextText:'Next',beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};$.fn._reverse = []._reverse||[].reverse;})(jQuery); jQuery.noConflict();
The problem is definitely a JavaScript problem. The URLs are alright thus there has to be some JavaScript messing up. Because there are tons of JavaScript files and libraries added to Your site/theme I was unable to identify the real problem, but if You turn off the javascript within Your browser and try to click on the pagination links You will see the pagination is working correctly.
I would suggest disabling one JavaScript include after another and refreshing the page (just by commenting out the lines within Your footer, header, or appropriate controllers) and checking the pagination. Finally You should be able to identify the one that causes the problem and we could then lead You to the happy ending.

Resources