Post by jty » Sun Nov 09, 2008 11:09 am

Qphoria wrote: Its probably pretty simple.. ill look  into what causes it after 0.7.9 final is out.
Thank-you.  :-*
Then I can get rid of the continue button and use the Add button instead of tick

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by fido-x » Sun Nov 09, 2008 2:09 pm

OK, how's this for an idea?

In "catalog/controller/cart.php", below

Code: Select all

if ($min_qty_error == '1' || $session->get('min_qty_error['.$result['key'].']')) {
   $view->set('error', $language->get('error_min_qty'));
   $session->set('min_qty_error['.$result['key'].']', '0');
   $session->set('line_min_error['.$result['key'].']', '0');
}
insert (somewhere around line 132)

Code: Select all

// inserted by Fido-X
$parent_category = $database->getRow("select distinct p2c.category_id, c.path from product_to_category p2c left join category c on (p2c.category_id = c.category_id) where product_id = '" . (int)$result['product_id'] . "'");
Then change

Code: Select all

$view->set('continue', $url->href('home'));
to

Code: Select all

$view->set('continue', $url->href('category', FALSE, array('path' => $parent_category['path'])));
at  line 143 only.

This should take you back to the category of the last product in your shopping cart.
Last edited by fido-x on Sun Nov 09, 2008 2:13 pm, edited 1 time in total.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by jty » Sun Nov 09, 2008 3:20 pm

Excellent Fido. That works great. Thanks
It solves my Opera problem. When I was using the javascript "back" idea, Opera would leave the items checked in Q's Checklist Contribution which can result in a duplicate buy. IE and FF were fine but Opera wants to be stupid on this one.
It also overcomes the "don't make sense to go back to the product page" concept
But there is still one problem
If the buyer adds an item to cart and removes that item, leaving the cart "empty", the continue button doesn't know to go back to the category page.
I checked out frenchy and they have the same problem so I'm going to leave it as is. I don't want to spend the rest of my life arguing with a Continue button  ::)

Thanks again. You guys are great.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by fido-x » Sun Nov 09, 2008 5:26 pm

jty wrote: Excellent Fido. That works great. Thanks
You're welcome.
But there is still one problem
If the buyer adds an item to cart and removes that item, leaving the cart "empty", the continue button doesn't know to go back to the category page.
If you only make the change at line 143 leave line 161 as

Code: Select all

$view->set('continue', $url->href('home'));
then, when the cart is empty, you return to the home page. This one is for the continue button on the error page, ie. the page that is returned when the cart is empty.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 5 guests