Post by tjonnyc » Tue May 24, 2011 6:12 am

I don't want to redirect to cart every time "Add To Cart" is clicked.
I have the cart installed in header ( "Cart: 2 items | Checkout" ), and it shows (with animation) that product has been added.

I've found a recommendation to replace $this->redirect(HTTPS_SERVER . 'index.php?route=checkout/cart'); with $this->redirect(html_entity_decode($_SERVER['HTTP_REFERER'])); in catalog/controller/checkout/cart.php - but it made no difference.

Cart is DISABLED in admin, AJAX is ENABLED (required for the animation).

Any ideas on how I can force the product page to stay on product page when "Add To Cart" is clicked?

Active Member

Posts

Joined
Tue Dec 21, 2010 5:05 am

Post by ciprianrpp » Tue May 24, 2011 1:48 pm

just put // in front of

Code: Select all

$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/cart');
to comment out

You have 2(TWO) lines of

Code: Select all

$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/cart');
for the POST/GET methods

you have to comment them both

just add // for the 2 lines and that's it :)

this is for cart.php

Do the following mod if the above mode doesn't solve the problem
then go in product.php and comment with // the following line:

Code: Select all

$this->data['action'] = HTTP_SERVER . 'index.php?route=checkout/cart';
cheers!

...some things are never ment to be...


User avatar
New member

Posts

Joined
Tue May 10, 2011 5:25 pm
Location - Bucuresti

Post by Jacob » Wed May 25, 2011 6:48 pm

Hello

I followed the advice for product.php - now I get the message page can not be found when I click on the add to cart button?

Running v1.4.9.1
Cheers

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by qahar » Wed May 25, 2011 11:11 pm

try to add code bellow on product.tpl

Code: Select all

	$('#add_to_cart').removeAttr('onclick');

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by Jacob » Thu May 26, 2011 2:23 am

Like so:

Code: Select all

 <a onclick="$('#add_to_cart').removeAttr('onclick');" id="add_to_cart"><span><img src="/image/add.png"/></span></a>
Or do you have a line number?

I did the above but now it does neither function.

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by qahar » Thu May 26, 2011 5:30 am

This just assumption since I don't know code you use.

1. First Solution
Add

Code: Select all

$('#add_to_cart').removeAttr('onclick');
after

Code: Select all

$.tabs('.tabs a'); 
2. Second Solution
Remove manually "on click" from the add to cart.

Code: Select all

<a id="add_to_cart"><span><img src="/image/add.png"/></span></a>
If you have a link to your site it will help.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by Jacob » Thu May 26, 2011 5:02 pm

The 1st solution rendered the 'add to cart' link inactive.

2nd, I already tried manually removing the code

Code: Select all

onclick="$('#product').submit();"
but that also renders inactive.

Thanks for your help :)
londontshirt dot com

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by ciprianrpp » Fri May 27, 2011 3:03 pm

upgrade to 1.4.9.5 than we will advice further (what i've posted above applies for 1.4.9.5 since you didn't specify in your 1st post wich version you are using, I've assumed the latest)

...some things are never ment to be...


User avatar
New member

Posts

Joined
Tue May 10, 2011 5:25 pm
Location - Bucuresti

Post by Jacob » Fri May 27, 2011 5:54 pm

I think you are mistaking me for Tjonnyc, I did mention the version:
Running v1.4.9.1
Having to upgrade is a pain, I am using the Accordion categories menu v1.1, it is not compatible for 1.4.9.5?

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by ciprianrpp » Fri May 27, 2011 6:23 pm

yes it IS:

"accordion_categories_menu_v1.1 v1.4.8, v1.4.8b, v1.4.9, v1.4.9.1, v1.4.9.2, v1.4.9.3, v1.4.9.4"

If you paied for it you should receive free updates.

and yes i've mistaking you.

anyway If you want help make your own topic, this is the best solution.
Last edited by ciprianrpp on Fri May 27, 2011 6:36 pm, edited 1 time in total.

...some things are never ment to be...


User avatar
New member

Posts

Joined
Tue May 10, 2011 5:25 pm
Location - Bucuresti

Post by Jacob » Fri May 27, 2011 6:27 pm

I did pay for it.

That list only goes up to v1.4.9.4?

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by ciprianrpp » Fri May 27, 2011 6:37 pm

and the 1.4.9.4 should work for 1.4.9.5 ALSO!

please look at release CHANGE LOG!
http://www.opencart.com/index.php?route ... d/download

...some things are never ment to be...


User avatar
New member

Posts

Joined
Tue May 10, 2011 5:25 pm
Location - Bucuresti

Post by Jacob » Fri May 27, 2011 7:35 pm

Ok thanks.

I have never upgraded before. I read the upgrade steps guide, what happens to all the changes I have made to the catalog directory files on my current version? Do I have to re-due all the work I have done?

Thanks

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by ciprianrpp » Fri May 27, 2011 9:59 pm

backup your website.
backup your database from phpmyadmin> EXPORT

upgrade and see what happens. if it's not OK after upgrade than import your backuped database, import your backup files, delete cache and that;s it. :)

...some things are never ment to be...


User avatar
New member

Posts

Joined
Tue May 10, 2011 5:25 pm
Location - Bucuresti

Post by Jacob » Sat May 28, 2011 12:18 am

I trust in that process as I will have made back-ups, but I don't understand how it works ... ???
:)

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by Jacob » Sat May 28, 2011 2:24 am

The upgrade went OK and did not produce any errors. But I have lost my design modifications?

Code: Select all

import your backup files, delete cache and that;s it. 
Do you mean I should upload the backup files, what purpose does this have?

Cheers

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by Jacob » Tue May 31, 2011 9:46 pm

Great, I re-done the upgrade following the Opencart Faq & Tutorials, thanks! it seems to have gone without error ;D

I am still not able to stop the page redirecting to the cart page though? I followed all the suggestions.
londontshirt dot com

Thanks

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by Jacob » Thu Jun 02, 2011 4:48 am

In Admin/Extensions/Modules/Cart I enabled the Ajax add to cart. Now items get added to the cart without re-directing.

Good but I do not want the animation. Got stuck again.

I decided to look at catalog/view/javascript/jquery/jquery-1.3.2.min.js and see if I could stop the animation by changing something in the code.

I did this by changing display 'visible' in two places to display 'none' .

So now I have it working how I wanted, but I am sure there must be a better way of doing it :(

Any suggestions please ;D

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm
Who is online

Users browsing this forum: No registered users and 25 guests