Post by jolo » Mon Nov 29, 2010 8:42 am

Wow thank you so much for this! Loving the opencart community!

Newbie

Posts

Joined
Sun Nov 28, 2010 5:38 pm

Post by waseem » Wed Dec 15, 2010 7:42 pm

This gives following error at my cart when going to login/register page. Please help to fix this.

Code: Select all

Fatal error: Call to a member function rewrite() on a non-object in D:\wamp\www\store\catalog\controller\common\header.php on line 25
using oc version 1.4.7

Thanks
Waseem

http://www.codegotbugs.com/forum/


New member

Posts

Joined
Mon Feb 15, 2010 9:55 pm
Location - Karachi, Pakistan

Post by Chones » Sat Jan 01, 2011 1:14 am

There's actually a much easier way that hardly changes any core files. I posted the solution on my blog:
http://craigmurray.me.uk/opencart-mods/ ... -opencart/

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by Maansy » Sun Jan 02, 2011 6:11 am

Nice alternative method
Good job ;)

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by tessed » Sun Jan 02, 2011 6:25 pm

Chones wrote:There's actually a much easier way that hardly changes any core files. I posted the solution on my blog:
http://craigmurray.me.uk/opencart-mods/ ... -opencart/
Craig,

I have tried your solution, but the cart is not showing after adding a product to the cart. I have check and double checked cart.php, stylesheet.css, header.tpl and the code in ajax_add.js .

I understand php, but don't see no errors. Only changes i have made are that my div for the cart has another name. This new name i have edited in the cart.php code.

Hope someone can help.

http://www.desse.nl - Opencart specialist.


New member

Posts

Joined
Sat May 29, 2010 11:22 pm


Post by Chones » Sun Jan 02, 2011 6:31 pm

You'll need to also change all references to #cart_in_header in the Ajax code too.

Although why not just use the code as it was originally - it works fine.

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by tessed » Sun Jan 02, 2011 6:39 pm

Sorry, that is what i meant, the ajax file.

The strange thing is that when i call minicart directly in the browser it does show the cart.

http://www.desse.nl - Opencart specialist.


New member

Posts

Joined
Sat May 29, 2010 11:22 pm


Post by Chones » Sun Jan 02, 2011 6:58 pm

I'd go back to the original files and try them without changes.

If it works fine then it is a change you have made somewhere to the code.

If it doesn't work, then it may be something elsewhere, such as some other Ajax or Jquery in your template.

That's all I can suggest I'm afraid.

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by tessed » Sun Jan 02, 2011 8:16 pm

It was the ajax_add.js file not being added to the header. Very strange, i thought this ajax file was already being used in the default template, guess it wasn't.

But now, the cart appears when a product is added, but when you go to another page then the minicart dissapears.

http://www.desse.nl - Opencart specialist.


New member

Posts

Joined
Sat May 29, 2010 11:22 pm


Post by Chones » Sun Jan 02, 2011 9:12 pm

You need to have this in your header.tpl so that the cart is always there.

Code: Select all

<div id="cart_in_header">
<?php
$cart_number = $this->cart->countProducts();
if ($cart_number == 1) {echo "1 item in shopping cart";}
else {echo $cart_number." items in shopping cart";}
echo"<br />";
echo "Total: ".$this->currency->format($this->cart->getTotal());
?>
echo"<br />";
<a href="index.php?route=checkout/cart">View Cart</a> |
<a href="index.php?route=checkout/shipping">Checkout</a>
</div>
Please follow the instructions accurately before trying to change things

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by tessed » Mon Jan 03, 2011 2:15 am

I didn't understand how it works to have the same code 2 times, but now I see it just works. Thank you for the help.

http://www.desse.nl - Opencart specialist.


New member

Posts

Joined
Sat May 29, 2010 11:22 pm


Post by meistralf » Thu Apr 09, 2015 12:01 pm

Hi. How to minimize the list of item at header "shopping cart : 0 item(s) - RM0.00" ?

because it become too long list when i add to many item.

Attachments

list.png

list.png (198.38 KiB) Viewed 4092 times


Newbie

Posts

Joined
Tue Mar 24, 2015 4:07 pm
Who is online

Users browsing this forum: No registered users and 18 guests