Author Topic: Checkout page / Cart page SEF URL problems  (Read 39770 times)

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Checkout page / Cart page SEF URL problems
« on: January 21, 2015, 21:31:16 pm »
Hello,

Another SEO /SEF related issue..

In my current VM project (VM 3.0.0) I have set the cart page to a menu item with root ALIAS "indkobskurv", as I always do with my VM shops.
The idea is to make the cart page associated with a menu item, for menu item specific module assignments, and to always show the cart page with this URL address:  www.mysite.com/indkobskurv

And this works as intended, well almost..
Let me try to explain this as simple as I can:

The first problem is that in all instances the cart URL is generated with /cart  trailing to the URL, as this example:  www.mysite.com/indkobskurv/cart
It should only be: www.mysite.com/indkobskurv

The second problem is a bit more complicated to explain..:
When I click on "Go to cart" from the front page, then the cart URL is:  www.mysite.com/indkobskurv/cart
When I click on "Go to cart" from any Joomla article landing page, then the cart URL is:  www.mysite.com/indkobskurv/cart
But.. when I click on "Go to cart" from any VM category page or product detail page, then the cart URL is:  www.mysite.com/categoryalias/subcategoryalias/cart
(categoryalias and subcategoryalias are of course any given VM category alias for the page that I was on when clicking "Go to cart")

So, it seems that the "Go to cart" link that VM produces changes according to category and/or product detail page, and it does not follow the native Joomla menu item routing behavior.
This needs to be fixed
And, as I mentioned, I need to remove the trailing /cart from the URL.
My goal is simply to make the cart page adhere to a specific Joomla menu item and resolve to: "www.mysite.com/indkobskurv"  in all instances and under all circumstances.

Please someone advice how I fix these issues.
It is very important that I fix this because I need to be able to assign modules and other content specifically for the VM cart page.

P.S.
This may be a problem that only exists in VM3 (and not in VM2xx) because I have never seen this problem before on any previous Virtuemart project I have worked with.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10240
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Checkout page / Cart page SEF URL problems
« Reply #1 on: January 22, 2015, 01:24:37 am »
have u tried VM3.0.3?  many bug fixes

2nd .. to assign modules to the cart pages I always use either a snippet in the template (detect the view) or there is a module available (advanced VM module or something)
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: Checkout page / Cart page SEF URL problems
« Reply #2 on: January 22, 2015, 14:36:37 pm »
Thanks for the answer.
No, I have not tried v3.0.3
Where do I find this upgrade?
On the VM main site there is only 3.0.2...

Regarding module assignment it is very inappropriate that you cannot assign modules to the cart page using the Joomla core menu item system, don´t you think?
Especially when this worked fine in previous versions of Virtuemart.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28192
  • Always on vacation
    • Jenkin Hill Internet
Re: Checkout page / Cart page SEF URL problems
« Reply #3 on: January 22, 2015, 15:01:32 pm »
Where I need to assign modules to the cart page I use a hidden menu item for the cart.

VM3.0.3?  As with all files it is on http://dev.virtuemart.net/projects/virtuemart/files
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: Checkout page / Cart page SEF URL problems
« Reply #4 on: January 22, 2015, 16:28:56 pm »
"Where I need to assign modules to the cart page I use a hidden menu item for the cart. "

That is exactly what I´m doing, but as you can see I´m having some trouble with the SEF URL.

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: Checkout page / Cart page SEF URL problems
« Reply #5 on: January 22, 2015, 16:37:57 pm »
To be more specific, when the system generates the "go to cart" URL with:

Code: [Select]
JRoute::_("index.php?option=com_virtuemart&view=cart")
it should always resolve to the alias of the menu item assigned to the cart view, correct?
But in my case it does not always do this.
For some reason, when I´m on product details page or on category page the menu item alias is not in effect.

So this seems to be an issue related to the VM routing framework.

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: Checkout page / Cart page SEF URL problems
« Reply #6 on: January 22, 2015, 17:04:53 pm »
I have now upgraded VM to the latest version (v3.0.3) and the problem remains the same.

Please advice.

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: Checkout page / Cart page SEF URL problems
« Reply #7 on: January 22, 2015, 17:07:36 pm »
If some of the developers want to investigate this I´m willing to provide full access to my test site, ofc. both back end and front-end.

ceitean

  • Beginner
  • *
  • Posts: 10
Re: Checkout page / Cart page SEF URL problems
« Reply #8 on: February 12, 2015, 23:43:51 pm »
Is there any news regarding this issue?  It's not just a SEO problem as one cannot control the designated menu item for the cart location, thereby modules will show in the cart depending on the category view layout and (not looking at all the different urls) the site will look untidy unless one adds the same modules to the actual cart menu item.
thanks
 

ceitean

  • Beginner
  • *
  • Posts: 10
Re: Checkout page / Cart page SEF URL problems
« Reply #9 on: March 18, 2015, 14:06:39 pm »
Hi again,

Another revisit to this question. Is it just me who has this problem? I'am surprised because if its a general problem, and not something I have completely missed, its a major issue for the use of VM3 as one cannot assign a (hidden) menu item to the cart.
see also:
http://forum.virtuemart.net/index.php?topic=127886.0

thanks, andrew

during testing of VM3.0.0 to VM 3.0.6
J!3.3-3.4
PHP 5.4.31


jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3733
  • using Matomo instead of Google Analytics
Re: Checkout page / Cart page SEF URL problems
« Reply #10 on: March 18, 2015, 23:09:15 pm »
The idea is to make the cart page associated with a menu item, for menu item specific module assignments, and to always show the cart page with this URL address:  www.mysite.com/indkobskurv

I think the only thing you have to do to achieve this is to replace the string "varekurv" in the file da-DK.com_virtuemart.sef.ini with your "indkobskurv" in a language override.

However, to me it makes no sense to insist on a SEF url for a cart view, unless you want Google and other search engines to index your cart view, with the eventual risk that the page is being indexed including one of your customer's data. I've set my cart to NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

ceitean

  • Beginner
  • *
  • Posts: 10
Re: Checkout page / Cart page SEF URL problems
« Reply #11 on: March 19, 2015, 02:46:18 am »
Quote
I think the only thing you have to do to achieve this is to replace the string "varekurv" in the file da-DK.com_virtuemart.sef.ini with your "indkobskurv" in a language override.

However, to me it makes no sense to insist on a SEF url for a cart view, unless you want Google and other search engines to index your cart view, with the eventual risk that the page is being indexed including one of your customer's data. I've set my cart to NOINDEX, NOFOLLOW, NOARCHIVE, NOSNIPPET

Thanks for your answer jjk; my issue is not really about SEF url's. I also noindex the cart pages for the same reason you are mentioning (however, since the cart is never assigned to an item (because of the router problem), your no-indexing will have no effect as far as i see and the bots will index them anyway, as the cart is located at the end of all categories and subs across your site). 
Another consequence, as noted earlier in posts, since the cart is added to the current category, one cannot build a clean cart with a customized view (specific sales pitches, or just a clean cart with no other modules). 

I looked at the router now for a few minutes (w/o debugging ide) and see that i must re-set the $query['Itemid']). This fixed my problem.

Code: [Select]
case 'cart';

if ( isset($jmenu['cart']) ) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}

$segments[] = $helper->lang('cart') ;

break;


from this:

Code: [Select]
case 'cart';
if(!isset($query['Itemid'])){
if ( isset($jmenu['cart']) ) {
$query['Itemid'] = $jmenu['cart'];
} else if ( isset($jmenu['virtuemart']) ) {
$query['Itemid'] = $jmenu['virtuemart'];
}
}
$segments[] = $helper->lang('cart') ;

break;

line 249.
This is a quick hack that should be corrected properly (although too late for me tonight).

andrew

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10124
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Checkout page / Cart page SEF URL problems
« Reply #12 on: April 05, 2015, 09:18:13 am »
Regarding module assignment it is very inappropriate that you cannot assign modules to the cart page using the Joomla core menu item system, don´t you think?
Especially when this worked fine in previous versions of Virtuemart.

Maybe the reason is not the VM version, maybe it is the joomla version. Do you have the same problem with j2.5? The router changed drastically in j3
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3487
  • VirtueMart Version: 3.8.9
Re: Checkout page / Cart page SEF URL problems
« Reply #13 on: April 05, 2015, 10:56:39 am »
Still the same behaviour in VM 3.0.7 and as noted:-

Quote
one cannot build a clean cart with a customized view (specific sales pitches, or just a clean cart with no other modules). 
Regards
A

Joomla 3.9.27
php 7.4

kgrzybowski

  • Beginner
  • *
  • Posts: 8
Re: Checkout page / Cart page SEF URL problems
« Reply #14 on: April 10, 2015, 07:30:39 am »
Hi,

I'm having quite the same issue on J 3.4.1 and VM 3.0.7, in cart module (on my homepage) my href to cart looks like this: /cart/cart
but if I'm on any product page it looks this way: /some-category/some-other-category/product-name-details/cart
and on my vm default view it looks: /shop-default-page/cart

I have menu position assigned to cart and it's always present at the top of the page and it's fine there, I mean it's always /cart as it should be, so SEF is wrong only in cart module and in cart popup window (after adding product to cart).

Best regards,
Chris