Post by tropnevad » Sat Jul 23, 2011 12:46 am

When I add an item to the cart i get the message popping up saying that it has been successful but there is an exclimation mark on this message, Everything still works, but is there a way to change this to a tick mark or something as it makes me think there is an error.

The official opencart demo also seems to have this problem (if it is a problem)

Attachments

Capture.JPG

Added to cart message - Capture.JPG (24.94 KiB) Viewed 1153 times


New member

Posts

Joined
Wed Jun 01, 2011 4:40 pm

Post by Moggin » Sat Jul 23, 2011 3:32 am

You can edit most of the messages in opencart by editing the language files. In this case try
catalog/language/english/checkout/cart.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by tropnevad » Sat Jul 23, 2011 7:07 pm

THanks for your reply, but the message is good, it was the icon i would like to change

New member

Posts

Joined
Wed Jun 01, 2011 4:40 pm

Post by jcsmithy » Sat Jul 23, 2011 7:25 pm

You actually need to edit the Javascript file

catalog/view/javascript/common.js
Find

Code: Select all

$('#notification').html('<div class="attention" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
Change to

Code: Select all

$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
And then also...
catalog/view/theme/dedault/template/product/product.tpl
Find

Code: Select all

$('#notification').html('<div class="attention" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
Change to

Code: Select all

$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
job done.

Active Member

Posts

Joined
Fri Oct 01, 2010 9:54 pm

Post by Moggin » Sat Jul 23, 2011 7:28 pm

... so sorry. I see now what you're getting at. I think the whole box may be styled incorrectly.

If you successfully add an item to the cart, the source code shows it generates

Code: Select all

<div style="attention">
- with the icon and background color you see.

I think it is meant to show

Code: Select all

<div style="success">
with background-color #EAF7D9 (green) and the tick box in the image file - catalog/view/theme/default/image/success.png

Looks like a minor bug to me?

======
EDIT - thanks for the fix jcsmithy! You got there 2 mins before me :)

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by tropnevad » Sun Jul 24, 2011 6:21 pm

Thanks for helping me :) but i found that your suggested fix did not properly work for me

i found that I also needed to change the line below it in the common.js
From

Code: Select all

$('.attention').fadeIn('slow');
To

Code: Select all

$('.success').fadeIn('slow');
But thanks for pointing me in the right direction

I also changed the same for when the user adds to wishlist or compare, as it was also showing attention, and not success

New member

Posts

Joined
Wed Jun 01, 2011 4:40 pm

Post by caag06 » Sat Dec 17, 2011 1:33 am

Hi everybody.

How can I change the time of the success message when I add product to cart?

Thanks for your answer

Newbie

Posts

Joined
Fri Oct 14, 2011 12:49 am
Who is online

Users browsing this forum: No registered users and 56 guests