VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: open-minds on July 05, 2012, 16:38:18 PM

Title: The "continue" button should open the category page from where we come from
Post by: open-minds on July 05, 2012, 16:38:18 PM
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 )) {
Title: Re: The "continue" button should open the category page from where we come from
Post by: Milbo on July 05, 2012, 18:13:11 PM
? the link is doing this already,

What you did is just removing the case, when there isnt any last visited category.
Title: Re: The "continue" button should open the category page from where we come from
Post by: open-minds on July 05, 2012, 18:37:50 PM
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.
Title: Re: The "continue" button should open the category page from where we come from
Post by: Milbo on July 05, 2012, 20:34:26 PM
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.
Title: Re: The "continue" button should open the category page from where we come from
Post by: open-minds on July 06, 2012, 11:14:23 AM
Thank you.
Title: Re: The "continue" button should open the category page from where we come from
Post by: open-minds on August 25, 2012, 14:31:55 PM
Hi,

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

Thank you.