Search button move to the topbar in opencart 2.0 - javascript

How to move search button in the topbar in Opencart 2.0 this is the complete code of my header.tpl And col-sm-5 is the Search bar when move it to the nav bar it stops searching products how to solve it. Because I need it to move in the navbar in place after language and currency.
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<!--[if IE 8 ]><html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<!--<![endif]-->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content= "<?php echo $keywords; ?>" />
<?php } ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<script src="catalog/view/javascript/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<script src="catalog/view/javascript/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,400i,300,700" rel="stylesheet" type="text/css" />
<link href="catalog/view/theme/default/stylesheet/stylesheet.css" rel="stylesheet">
<?php foreach ($styles as $style) { ?>
<link href="<?php echo $style['href']; ?>" type="text/css" rel="<?php echo $style['rel']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script src="catalog/view/javascript/common.js" type="text/javascript"></script>
<?php foreach ($scripts as $script) { ?>
<script src="<?php echo $script; ?>" type="text/javascript"></script>
<?php } ?>
<?php echo $google_analytics; ?>
</head>
<body class="<?php echo $class; ?>">
<nav id="top">
<div class="container">
<?php echo $currency; ?>
<?php echo $language; ?>
<div id="top-links" class="nav pull-right">
<ul class="list-inline">
<li><i class="fa fa-phone"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $telephone; ?></span></li>
<li class="dropdown"><i class="fa fa-user"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_account; ?></span> <span class="caret"></span>
<ul class="dropdown-menu dropdown-menu-right">
<?php if ($logged) { ?>
<li><?php echo $text_account; ?></li>
<li><?php echo $text_order; ?></li>
<li><?php echo $text_transaction; ?></li>
<li><?php echo $text_download; ?></li>
<li><?php echo $text_logout; ?></li>
<?php } else { ?>
<li><?php echo $text_register; ?></li>
<li><?php echo $text_login; ?></li>
<?php } ?>
</ul>
</li>
<li><i class="fa fa-heart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_wishlist; ?></span></li>
<li><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_shopping_cart; ?></span></li>
<li><i class="fa fa-share"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_checkout; ?></span></li>
</ul>
</div>
</div>
</nav>
<header>
<div class="container">
<div class="row">
<div class="col-sm-4">
<div id="logo">
<?php if ($logo) { ?>
<img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" class="img-responsive" />
<?php } else { ?>
<h1><?php echo $name; ?></h1>
<?php } ?>
</div>
</div>
<div class="col-sm-5"><?php echo $search; ?>
</div>
<div class="col-sm-3"><?php echo $cart; ?></div>
</div>
</div>
</header>
<?php if ($categories) { ?>
<div class="container">
<nav id="menu" class="navbar">
<div class="navbar-header"><span id="category" class="visible-xs"><?php echo $text_category; ?></span>
<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<?php foreach ($categories as $category) { ?>
<?php if ($category['children']) { ?>
<li class="dropdown"><?php echo $category['name']; ?>
<div class="dropdown-menu">
<div class="dropdown-inner">
<?php foreach (array_chunk($category['children'], ceil(count($category['children']) / $category['column'])) as $children) { ?>
<ul class="list-unstyled">
<?php foreach ($children as $child) { ?>
<li><?php echo $child['name']; ?></li>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php echo $text_all; ?> <?php echo $category['name']; ?> </div>
</li>
<?php } else { ?>
<li><?php echo $category['name']; ?></li>
<?php } ?>
<?php } ?>
</ul>
</div>
</nav>
</div>
<?php } ?>

I found the solution for it, as I move the search col-sm-5 to the navbar, also we have to modify the common.js file where the script for search is specified, here we have to change header into nav.

Related

Php code My image is no showing on website

my uploaded image are not showing on webpage.
<div class="col-md-8 news-item">
<a href="<?php echo base_url('home/newsdetail/'); ?><?php echo $newsdetail[0]['id']; ?>" style="text-decoration: none; color:black;" >
<h1><?php echo $newsdetail[0]['heading']; ?></h1>
</a>
<p class="author-name"><?php echo $newsdetail[0]['staffname']; ?> <span class="time"><i class="fa fa-clock-o"></i><?php echo date("d-m-Y H:i:s",strtotime($newsdetail[0]['created_date'])); ?></span></p>
<div class="read-img">
<?php if($newsdetail[0]['image']==''){ ?>
<img class="img-responsive" src="<?php echo base_url('assets/img/noimage.gif')?>" height="70"/>
<?php } else { ?>
<?php $multiimage=explode(",",$newsdetail[0]['image']); ?>
<div id="jssor_1" style="position:relative;margin:0 auto;top:0px;left:0px;width:980px;height:480px;overflow:hidden;visibility:hidden;">
<!-- Loading Screen -->
<div data-u="loading" class="jssorl-009-spin" style="position:absolute;top:0px;left:0px;width:100%;height:100%;text-align:center;background-color:rgba(0,0,0,0.7);">
<img style="margin-top:-19px;position:relative;top:50%;width:38px;height:38px;" src="//jssorcdn7.azureedge.net/theme/svg/loading/static-svg/spin.svg" />
</div>
<div data-u="slides" style="cursor:default;position:relative;top:0px;left:0px;width:980px;height:380px;overflow:hidden;">
<?php foreach($multiimage as $imgrow){ ?>
<div>
<img data-u="image" src="<?php echo base_url('uploads/newsimages/'); ?><?php echo $imgrow; ?>" />
<img data-u="thumb" src="<?php echo base_url('uploads/newsimages/'); ?><?php echo $imgrow; ?>" />
</div>
<?php } ?>
</div>
First, try to print image path array. see if those are correct.
<?php
$multiimage=explode(",",$newsdetail[0]['image']);
print_r($multiimage);
?>
Then make sure those images are in the right directory.
Also for debugging purpos try printing the path if it's ok. you can check the image by simply putting the path on a browser URL.
<?php echo base_url('uploads/newsimages/').$imgrow ?>

why pagination in my wordpress theme is not showing (wp-paginate plugin)

I use the rethink theme in wordpress, and use the wp-paginate plugin
in arcive.php, category.php and index.php pagination is fine
but why in page.php not running?
and I created my own template showing all the posts
posting.php
<?php
/*
Template Name: posting
*/
get_header();
?>
<div class="full-content">
<div class="grid_17 alpha">
<div class="content_bar">
<div class="feature_content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$count_posts = wp_count_posts();
$published_posts = $count_posts->publish;
$myposts = get_posts(array('posts_per_page'=>3)); ;
foreach($myposts as $post) :
setup_postdata($post);
?>
<div id="post-<?php the_ID(); ?>" <?php post_class('product'); ?>>
<div class="post-info">
<h1 class="product_title">
<a href= "<?php the_permalink(); ?>" rel="bookmark" title="<?php echo sprintf(__("Permanent link to %s", 'rethink'), get_the_title(get_the_ID())); ?>">
<?php the_title(); ?>
</a>
</h1>
<div class="detail">
<ul class="post_meta">
<li class="admin"><?php printf(__("Posted by %s", 'rethink'), get_the_author_link()); ?></li>
<li class="date"><?php printf(__('Posted on %s', 'rethink'), get_the_time('F j, Y')); ?></li>
<li class="category"><?php the_category(','); ?></li>
<li class="commentt"><?php comments_popup_link(__('No Comments.', 'rethink'), __('1 Comment.', 'rethink'), __('% Comments.', 'rethink')); ?></li>
</ul>
</div>
</div>
<div class="post_thumbnail_wrapper">
<?php if (has_post_thumbnail()) { ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('post_thumbnail', array('class' => 'postimg')); ?>
</a>
<?php
} else {
echo rethink_main_image();
}
?>
</div>
<div class="product_content"><?php the_excerpt(); ?><div class="buttons"><a class="btn-2" href="<?php the_permalink() ?>"><span><?php _e('Read Review', 'rethink') ?></span></a></div>
</div>
</div>
<?php endforeach;
if(function_exists('wp_paginate')){
wp_paginate(); }
wp_reset_postdata(); ?>
<div class="clear"></div>
<?php endwhile;
else:
?>
<div class="product">
<p>
<?php _e('Sorry, no posts matched your criteria.', 'rethink'); ?>
</p>
</div>
<?php endif; ?>
</div>
</div>
</div>
<div class="grid_7 omega">
<!--Start Sidebar-->
<?php get_sidebar(); ?>
<!--End Sidebar-->
</div>
</div>
<?php get_footer(); ?>
how i want to display the pagination of my coding ????
sorry if the line of code is not neat I still newbie
Update this Code:
if(function_exists('wp_paginate')){
wp_paginate();
}
to this code:
if(function_exists('wp_paginate')){
wp_paginate(array('page' => 'page'));
}

Remove Post View Count at the end of the Content

I have a 4.3 wordpress system that i install on it the "Orca Theme".
I notice i have duplicate indication of Post View Count:
I want to remove the First Indicator.
I try to look around amd search in the theme code and didnt find what display the First indicator.
postformat/standart.php:
<?php
$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id, 'postlist', true);
$title_meta = get_post_meta($post->ID, 'title_style', true);
$title_meta = ($title_meta == ('banner' || 'title')) ? $title_meta : "standard";
$category = get_the_category();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> class="post standard">
<?php if($title_meta == "banner"){ ?>
<a class="basicfeature" href="<?php esc_url(the_permalink()); ?>" style="background-image:url('<?php echo esc_url($thumb_url[0]); ?>');"></a>
<h1><?php the_title(); ?></h1>
<?php }elseif($title_meta == "feature"){ ?>
<a href="<?php esc_url(the_permalink()); ?>" class="largeimage postfeature" style="background-image:url('<?php echo esc_url($thumb_url[0]); ?>');">
<div class="shadow"></div>
<h1><?php the_title(); ?></h1>
</a>
<?php }else{ ?>
<h1><?php the_title(); ?></h1>
<?php } ?>
<div class="info">
<div class="left">
<i class="issticky fa fa-thumb-tack "></i><img src="http://0.gravatar.com/avatar/<?php echo esc_attr(md5(get_the_author_meta('user_email'))); ?>?s=32" alt="author" class="minigravatar"><?php the_author(); ?>
</div>
<div class="right">
<i class="fa fa-clock-o"></i><?php echo esc_html(orca_get_time()); ?>
<div class="category"><i class="fa fa-tags"></i>
<?php if($category){
echo '' . $category[0]->name.' ';
} ?>
</div>
</div>
</div>
<div class="postcontents">
<?php the_content('', FALSE, ''); ?>
</div>
<div class="footer">
<?php esc_html_e('Read More', 'orcawp'); ?>
<i class="fa fa-comments"></i><?php echo esc_html(get_comments_number($post->id)); ?>
<?php if(get_post_meta($post->ID, '_count-views_all', true) != ''){ ?>
<i class="fa fa-bullseye"></i><?php echo esc_html(get_post_meta($post->ID, '_count-views_all', true)); ?>
<?php } ?>
</div>
Solve it!
I just Deactivated the "BAW Post Views Count" plugin and now it removed!

OpenCart - function addToCart / no success message / no cart refresh

I have a problem with a custom template, as after i add a product to the cart, no confirmation is displayed.In detail, after adding a product nothing happens and for example the cart information in the header stays empty. (See picture one)
http://de.tinypic.com/r/2hozei0/8
After clicking on the empty cart suddenly the product appears. (See picture two)
So its seems that the success message and the cart refresh is missing after adding a product.
http://i58.tinypic.com/20zcl6g.png
Figured it out that the needed handling appears in catalog/view/javascript/common.js
Functions like "addToWishList" or "addToCompare" are working but the "addToCart" is NOT working.
function addToCart(product_id, quantity) {
quantity = typeof(quantity) != 'undefined' ? quantity : 1;
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: 'product_id=' + product_id + '&quantity=' + quantity,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information, .error').remove();
if (json['redirect']) {
location = json['redirect'];
}
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#cart-total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
}
});}
Any help appreciated! I am using OC 1.5.6
Regards!
see my /template/common/header.tpl
<!DOCTYPE html>
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/stylesheet.css" />
<link href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/cloud-zoom.css" rel="stylesheet" type="text/css" />
<link href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/superfish.css" rel="stylesheet" type="text/css" />
<link href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/slideshow.css" rel="stylesheet" type="text/css" />
<link href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/jquery.prettyPhoto.css" rel="stylesheet" type="text/css" />
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="catalog/view/javascript/jquery/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery.cycle.js"></script>
<link href="catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/stylesheet/skin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/colorbox/colorbox.css" media="screen" />
<link href='//fonts.googleapis.com/css?family=Krona+One' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
<!--[if IE]>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4-iefix.js"></script>
<![endif]-->
<!--[if lt IE 8]><div style='clear:both;height:59px;padding:0 15px 0 15px;position:relative;z-index:10000;text-align:center;'><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></div><![endif]-->
<script type="text/javascript" src="catalog/view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/easyTooltip.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jQuery.equalHeights.js"></script>
<script type="text/JavaScript" src="catalog/view/javascript/cloud-zoom.1.0.2.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jscript_zjquery.anythingslider.js"></script>
<script type="text/javascript" src="catalog/view/javascript/superfish.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery.bxSlider.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/script.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/nivo-slider/jquery.nivo.slider.pack.js"></script>
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
<!--[if IE 8]>
<style>
.success, #header #cart .content { border:1px solid #e7e7e7;}
</style>
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template');?>/stylesheet/livesearch.css"/>
<?php if ($stores) { ?>
<script type="text/javascript"><!--
$(document).ready(function() {
<?php foreach ($stores as $store) { ?>
$('body').prepend('<iframe src="<?php echo $store; ?>" style="display: none;"></iframe>');
<?php } ?>
});
//--></script>
<?php } ?>
<?php echo $google_analytics; ?>
</head>
<body class="<?php echo empty($this->request->get['route']) ? 'common-home' : str_replace('/', '-', $this->request->get['route']); ?>">
<div class="bg-1">
<div class="main-shining">
<div class="row-1">
<div id="header">
<div class="toprow">
<div class="outer1">
<?php echo $currency; ?>
<div id="welcome">
<?php if (!$logged) { ?>
<?php echo $text_welcome; ?>
<?php } else { ?>
<?php echo $text_logged; ?>
<?php } ?>
</div>
<div class="phone">
<?php echo $telephone; ?>
</div>
<?php echo $language; ?>
<div class="clear"></div>
</div>
</div>
<div class="outer1">
<?php if ($logo) { ?>
<div id="logo"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></div>
<?php } ?>
<div class="header-top1">
<div id="search">
<div class="button-search"></div>
<input type="text" name="search" placeholder="<?php echo $text_search; ?>" value="<?php echo $search; ?>" />
</div>
<div class="clear"></div>
<div class="cart-position">
<div class="cart-inner"><?php echo $cart; ?></div>
</div>
<div class="clear"></div>
<div class="topmenu">
<ul class="links">
<?php if (!isset($this->request->get['route'])) { $route='active'; } else {$route='';}?> <li class="first"><a class="<?php echo $route; if (isset($this->request->get['route']) && $this->request->get['route']=="common/home") {echo "active";} ?>" href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
<li><a class="<?php if (isset($this->request->get['route']) && $this->request->get['route']=="account/wishlist") {echo "active";} ?>" href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a></li>
<li><a class="<?php if (isset($this->request->get['route']) && $this->request->get['route']=="account/account") {echo "active";} ?>" href="<?php echo $account; ?>"><?php echo $text_account; ?></a></li>
<li><a class="<?php if (isset($this->request->get['route']) && $this->request->get['route']=="checkout/cart") {echo "active";} ?>" href="<?php echo $shopping_cart; ?>"><?php echo $text_shopcart; ?></a></li>
<li><a class="<?php if (isset($this->request->get['route']) && $this->request->get['route']=="checkout/checkout") {echo "active";} ?>" href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></li>
</ul>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div id="menu">
<script type="text/javascript">
$(document).ready(function(){
$('.menu ul li').last().addClass('last');
$('.menu ul li li').last().addClass('last');
});
</script>
<?php if ($categories) { ?>
<ul class="menu">
<?php $cv=0;?>
<?php foreach ($categories as $category) { $cv++; ?>
<?php if ($category['category_id'] == $category_id) { ?>
<li class="active cat_<?php echo $cv ?>">
<?php } else { ?>
<li class="cat_<?php echo $cv ?>">
<?php } ?>
<?php echo $category['name']; ?>
<?php if ($category['children']) { ?>
<?php for ($i = 0; $i < count($category['children']);) { ?>
<ul>
<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
<?php for (; $i < $j; $i++) { ?>
<?php if (isset($category['children'][$i])) { ?>
<?php $id=$category['children'][$i]['category_id'];?>
<?php if ( $id == $child_id) { ?>
<li class="active">
<?php } else { ?>
<li>
<?php } ?>
<?php if ($category['children'][$i]['children3']) {?>
<a class="screenshot1" href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name'];?></a>
<ul>
<?php foreach ($category['children'][$i]['children3'] as $ch3) { ?>
<li>
<?php if ($ch3['category_id'] == $ch3_id) { ?>
<?php echo $ch3['name']; ?>
<?php } else { ?>
<?php echo $ch3['name']; ?>
<?php } ?>
</li>
<?php } ?>
</ul>
<?php } else {?>
<a class="screenshot1" href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name'];?></a>
<?php }?>
</li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
<?php } ?>
</li>
<?php } ?>
</ul>
<?php } ?>
<div class="clear"></div>
</div>
</div>
<?php if ($modules) {?>
<div class="header-modules">
<?php foreach ($modules as $module) { ?>
<?php echo $module; ?>
<?php } ?>
<div class="clear"></div>
</div>
<?php }?>
<div class="main-container">
<p id="back-top"> <span></span> </p>
<div id="container">
<div id="notification"> </div>
I think it should be ok, any clue why the functions $('.success').fadeIn('slow'); / $('#cart-total').html(json['total']); are not working?
I tried to change to the default template and the same problem appears, so maybe its no problem with the template?
You have to add , and this portion in the header template.

opencart jcarousel on latest product

Right now I'm learning Opencart, and I'm trying to make my latest product display with jCarousel. I'm using Opencart 1.5.4.
This is what I've already tried, but still failed: http://www.packtpub.com/article/opencart-themes-using-jCarousel-plugin
I'm editing the latest.tpl file step-by-step as in the tutorial, but I'm getting stuck on the eight step.
When I open Firefox and hit refresh nothing happens, no error or message. This is my latest.tpl file:
<script type="text/javascript" src="catalog/view/javascript/jquery/jCarousel/js/jquery.jcarousel.min.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/jCarousel/skins/tango/skin.css" />
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#latestcarousel').jcarouseljcarousel();
});
</script>
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div id="latestcarousel" class="box-product">
<?php foreach ($products as $product) { ?>
<div class="jCarousel-skin-tango">
<?php if ($product['thumb']) { ?>
<div class="image"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></div>
<?php } ?>
<div class="name"><?php echo $product['name']; ?></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 } ?>
</div>
<?php } ?>
<?php if ($product['rating']) { ?>
<div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
<?php } ?>
<div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div>
</div>
<?php } ?>
</div>
</div>
</div>
Any suggestion?
This is what I do with latest.tpl file. It works now.
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/jCarousel/skins/tango/skin.css" />
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#latestcarousel').jcarousel({
scroll: 1,
visible: 3,
auto: 3,
rtl: true,
wrap: 'circular'
});
});
</script>
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div class="box-product">
<ul id="latestcarousel" class="jcarousel-skin-tango">
<?php foreach ($products as $product) { ?>
<li class="carousel-latest">
<div class="image"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></div>
<div class="name"><?php echo $product['name']; ?></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 } ?>
</div>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
Thanks for anything.

Categories