The "continue" button should open the category page from where we come from

Started by open-minds, July 05, 2012, 16:38:18 PM

Previous topic - Next topic

open-minds

Hi,

The "continue" button should open the category page from where we come from, even if it is the top level category.

--- com_virtuemart/controllers/cart.orig.php    2012-07-05 16:29:54.515752189 +0200
+++ com_virtuemart/controllers/cart.php 2012-07-05 16:30:07.140235453 +0200
@@ -105,11 +105,7 @@
                if ($cart) {
                        // Get a continue link */
                        $virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
-                       if ($virtuemart_category_id) {
-                               $categoryLink = '&view=category&virtuemart_category_id=' . $virtuemart_category_id;
-                       } else
-                       $categoryLink = '';
-                       $continue_link = JRoute::_('index.php?option=com_virtuemart' . $categoryLink);
+                       $continue_link = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $virtuemart_category_id);
                        $virtuemart_product_ids = JRequest::getVar('virtuemart_product_id', array(), 'default', 'array');
                        $errorMsg = JText::_('COM_VIRTUEMART_CART_PRODUCT_ADDED');
                        if ($cart->add($virtuemart_product_ids, $errorMsg )) {

Milbo

? the link is doing this already,

What you did is just removing the case, when there isnt any last visited category.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

open-minds

Yes but you doesn't support the case when the last visited category is top level category. The ID of top level category is 0, so the result of "shopFunctionsF::getLastVisitedCategoryId()" is the same when there is no last visited category and when the last visited category is top level category.

Milbo

The id of the toplevel category is 0?

No category should have the id 0. 0 is just the root. That means when you choose the category id 0 in the category view, you get all top level categories. But okey, I can rewrite the function so, that the 0 is also used then.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/


open-minds

Hi,

This issue doesn't seem to be solved in VirtueMart 2.0.10.

Thank you.