Hi,
Im trying to put the cart in the header but can't seem to find instructions that apply to v 1.34.
Anyone out there done it for this version?
Thanks,
Chris
Im trying to put the cart in the header but can't seem to find instructions that apply to v 1.34.
Anyone out there done it for this version?
Thanks,
Chris
Last edited by i2Paq on Sat May 08, 2010 9:14 pm, edited 1 time in total.
Reason: Title adjusted
Reason: Title adjusted
Ive done this so far
Opened file /admin/view/template/module/cart.tpl and added the following code directly after the left/right position code, before the </select> tag.
Added code to the controller that processes the header data so it will find the module. File, /catalog/controller/common/header.php
Directly below
I have added
and then in /catalog/view/theme/default/template/common/header.tpl inside <DIV3>
But I'm getting the path: "http://www.thinking-forward.co.uk/index ... ckout/cart" displayed instead of the basket contents. Any ideas? Site is http://www.thinking-forward.co.uk
Opened file /admin/view/template/module/cart.tpl and added the following code directly after the left/right position code, before the </select> tag.
Code: Select all
<?php if ($information_position == 'header') { ?>
<option value="header" selected="selected"><?php echo 'Header'; ?></option>
<?php } else { ?>
<option value="header"><?php echo 'Header'; ?></option>
<?php } ?>
Directly below
Code: Select all
protected function index() {
Code: Select all
$module_data = array();
$this->load->model('checkout/extension');
$results = $this->model_checkout_extension->getExtensions('module');
foreach ($results as $result) {
if ($this->config->get($result['key'] . '_status') && ($this->config->get($result['key'] . '_position') == 'header')) {
$module_data[] = array(
'code' => $result['key'],
'sort_order' => $this->config->get($result['key'] . '_sort_order')
);
$this->children[] = 'module/' . $result['key'];
}
}
$sort_order = array();
foreach ($module_data as $key => $value) {
$sort_order[$key] = $value['sort_order'];
}
array_multisort($sort_order, SORT_ASC, $module_data);
$this->data['modules'] = $module_data;
Code: Select all
<?php foreach ($modules as $module) { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
I've turned this off for now as my site is live, but here is a screen shot of how the top right of my store looks with it switched on.


i am trying to do almost the same thing.
i want to display:
2 item(s) : $29.99
in the header
but seems like no one want to help
i want to display:
2 item(s) : $29.99
in the header
but seems like no one want to help

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
no 1 tried to do this before? maybe its impossible to do.. 

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
Hey Guys,
Thought I might as well post the simpest solution as I had to just do this one for a client.
In catalog/controller/common/header.php add
after:
Then, wherever in your header template you want the amount of products in cart to be displayed simple use:
and where you want the cart total:
Note that this method will only refresh totals after a page load, so if you have a cart in your sidebar you will want to turn off AJAX. This is the simplest implementation of a cart in your header.
Scott
Thought I might as well post the simpest solution as I had to just do this one for a client.
In catalog/controller/common/header.php add
Code: Select all
$this->data['text_cart_count'] = $this->cart->countProducts();
$this->data['text_cart_total'] = $this->cart->getTotal();
Code: Select all
$this->language->load('common/header');
Code: Select all
<?php echo $text_cart_count; ?>
Code: Select all
<?php echo $text_cart_total; ?>
Scott
Scott Lawrence - Creative agency - Bespoke web and graphic design
Hi,
Hope this helps people out in this thread
I have created a Mod which can be downloaded for FREE from here.....
http://www.opencart.com/index.php?route ... ion_id=716
It shows the cart in the header & to the right of the search box & also shows the Item count & Sub-Total that updates when the main add to cart buttons are clicked.
I have also started a Thread which can be seen here.....
http://forum.opencart.com/viewtopic.php?f=112&t=22043
Please post question, issues or any problems with the 'Cart In Header' Mod & I will reply to them from within the thread
cheers
harryo
Hope this helps people out in this thread

I have created a Mod which can be downloaded for FREE from here.....
http://www.opencart.com/index.php?route ... ion_id=716
It shows the cart in the header & to the right of the search box & also shows the Item count & Sub-Total that updates when the main add to cart buttons are clicked.
I have also started a Thread which can be seen here.....
http://forum.opencart.com/viewtopic.php?f=112&t=22043
Please post question, issues or any problems with the 'Cart In Header' Mod & I will reply to them from within the thread

cheers
harryo
Add To Cart Confirm Ajax Popup for OC 1.5.1.3 --> 1.5.5.1 - Add to Cart Confirmation Popup
Image Map Banner Module - Image Map Banner Module
----------------------------------------------------------------------
Womens Famous Name Fashion Clothing at bargain prices - Next2nowt.com
Who is online
Users browsing this forum: No registered users and 12 guests