Problem with VM edit billing/shipping address page and Joomla SEF on

Started by valekichia, January 20, 2017, 11:11:45 AM

Previous topic - Next topic

valekichia

Hello guys.

Joomla 3.6.5
Virtuemart 3.0.18

Background: I'm developing a site where the homepage is not VM homepage. VM homepage is instead a menu item of the main menu.
I also set (in a different menu) a menu item for each menu item type related to the user (cart, order list, account maintenance, edit address).
This because I don't want the "user" pages to share the same modules of VM homepage.
With SEF turned OFF everything works fine: each menu item points to the correct view, and in particular, clicking on "edit billing/shipping address" buttons from the cart lets the edit page open under the cart view, which is fine (even though I thought it would open under the "edit address" menu item)!

On the other hand, if SEF is ON, the page opens in VM homepage! (and so all VM home modules are there).  :(


This is how my URLS look like:

With SEF off: http://www.mysite.it/index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT&Itemid=313

where itemid=313 is my cart menu item.

With SEF on: http://www.mysite.it/prodotti/user/editaddresscartBT.html

where prodotti is my VM hompeage.


Same URLs and same behaviour clicking on "Buy now" button on cart view, when being a non registered user ("Only registered users can checkout" setting ON)


Can anybody help with this?

Thank you!

jjk

Perhaps you need to limit the display of those modules which you only want on the homepage in the Joomla module settings > 'Menu assignment' tab.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

valekichia

Thank you jjk for your response.
The problem is that the display of the modules is already limited to VM homepage and product category pages.
It's like those "user pages" are routed (I don't know if the term is correct) to the homepage view!
I don't know how to solve it...
Do you have other ideas?

Thanks!

jjk

I have no clue at present. Can you provide a link to your site?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

valekichia

At the moment the site is under construction so I have no public link to provide.
However the site is already hosted online and I'm using a plugin that hides it from viewers and displays a "coming soon" page.
If you want, and if it is allowed by the forum rules, I can send you a private message with the link to the "work in progress" side of it.
Let me know what we can do...

jjk

Quote from: valekichia on January 25, 2017, 19:18:51 PM
if it is allowed by the forum rules, I can send you a private message with the link to the "work in progress" side of it.

It's allowed. Another option would be to set your site to noindex, nofollow in Joomla and your shop links. (Not sure if it works in the latest Joomla. I think there is a bug which ignores the setting).

How did you set up your 'Edit Adress' menu link. There is no menu item type for this and eventually this is why you are redirected to the VM homepage. I think normally you don't need that link in the menu, because new and existing shoppers always can access the edit address from cart view or the account maintenance link.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

valekichia

QuoteHow did you set up your 'Edit Adress' menu link. There is no menu item type for this and eventually this is why you are redirected to the VM homepage. I think normally you don't need that link in the menu, because new and existing shoppers always can access the edit address from cart view or the account maintenance link.

I know that it may not be strictly necessary to have some links, but trying to understand how those pages work I set up every menu item available, that is related to VM users.
So I have the following menu items:

VirtueMart » Shopping Cart
VirtueMart » Account Maintenance
VirtueMart » User Edit Address

At the beginning I thought that the page that you are directed to by clicking on "edit billing address" from the cart would be the same of the menu item VirtueMart » User Edit Address.
Ended up discovering that I was wrong.

In fact, disabling Joomla's SEF settings, these are the URLs of each page:

"edit billing address" page from cart:
http://www.mysite.it/index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT&Itemid=313

VirtueMart » User Edit Address menu item page:
http://www.mysite.it/index.php?option=com_virtuemart&view=user&layout=editaddress&Itemid=316

However it's not a problem if the two things do not coincide as I thought, because at least they both open in the user view (see the parameter in the URL: view=user). This means that VM homepage modules are not displayed. Perfect!

The problem arises when I apply the following SEO settings

Search Engine Friendly URLs: YES
Use URL Rewriting: YES
Adds Suffix to URL: YES

Only in this case the "edit billing address" link on the cart leads to VM homepage.

So I think that the problem comes from the SEF "conversion".

I hope my explanation is clear enough.

Anyway I will provide you the link via PM, so you can take a look if you like.

jjk

Do I understand you correctly, that you don't want to display your VM filter module (I think you are using Cherry Picker) in the cart view?
If that is the case, you need to go to the module settings and make sure that you exclude all your menu items in the customer menu.
For example, if you select 'On all pages except those selected' from the dropdown list, you need to select the customer menu items in order to hide the module in the pages linked in the customer menu.

Suggestions: If possible, unpublish Joomla registration and login forms. The spambots love them. For the shopping cart itself you don't need the Joomla registration/login module in the frontend.

You also don't need the 'Add suffix to url' in Joomla Global configuration. It is abolutely useless since many years in all modern browsers.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

valekichia

Yes I am using Cherry Picker and I already set "Menu assignement" > "Only on the pages selected" (and those pages are my VM homepage and the category pages).
So the module isn't displayed on cart view.
The problem is that the "edit billing address" page from cart opens in VM hompepage...so the module is there.
I think the problem isn't in the module settings, which I think are correct, but somewhere else...

QuoteSuggestions: If possible, unpublish Joomla registration and login forms.

So if I understand correctly you suggest to use only VM registration and login (that is the login in cart view or in account management page)?

QuoteYou also don't need the 'Add suffix to url' in Joomla Global configuration. It is abolutely useless since many years in all modern browsers.

Can I ask you a little more about this? Why is it useless? I thought it was good for SEO...may be not anymore? Has it bad effects and on what?

Thank you for your kindness

valekichia

UPDATE
I discovered something new while playing around with menu items and settings.

I unpublished all the previous user-related menu items, except for "Virtuemart account maintenance" and "Virtuemart list orders" (which I think are the only ones I need).
So now the cart page hasn't a menu item assigned, and is accessible only through the cart module.
Cherry Picker module has the same settings above, that should be display it only on VM homepage and VM category pages.

What I expected:
Cherry Picker module wouldn't be displayed niether on the VM user menu items nor on cart page (as it isn't VM home or a VM category page).

What I obtained:
Cherry Picker module isn't displayed on the published VM user menu items.
On the other hand it is displayed on cart page (and also on edit billing/shipping address pages when using the cart links)

What I discovered:
I was wrong when I said that the problem was in the "view".
Looking at the body classes, I see that the cart page opens correctly in "view-cart" and all user pages open correclty in "view-user". No difference if they have a menu item or not.
The difference is that if they have a menu item, the "itemid-" body class is the correspondant menu item (obviously), but if they don't have one the "itemid-" body class refers to VM homepage menu item.

I think that the problem lies in this "fallback".

With Joomla SEO settings ON the fallback is always VM homepage. So Cherry Picker module is there.
With Joomla SEO settings OFF the fallback seems to be the previous page you are coming from. So if you came from a VM page, it will be VM homepage. If you came from a VM user page with a menu item assigned, it will be its itemid. If you came form another Joomla core page there is no itemid fallback. According to this, Cherry Picker module will/won't be displayed.

Searching this forum I found other questions about this, with some workarounds.

1) creating a Joomla url type menu for the pages that don't have a specific menu type:
https://forum.virtuemart.net/index.php?topic=135757.msg474028#msg474028

2) creating a conditional module position in order to hide the module on some views:
http://forum.virtuemart.net/index.php?topic=135937.0

In my opinion these may be good patches to solve the "layout problem" and so I will take them into consideration.


But I also think that they don't touch the "URLs problems".

In my case, with SEO settings on, I get the following URLs:

- "Virtuemart account maintenance" page (has menu item): www.mysite.it/my-menu-item-alias

- "Virtuemart cart" page (doesn't have a menu item): www.mysite.it/my-vm-homepage-menu-item-alias/cart

- "Edit billing/shipping address" pages from cart links (a specific menu item doesn't exist): www.mysite.it/my-vm-homepage-menu-item-alias/user/editaddresscartBT


What I consider to be "URLs problems" are:

1) the words "cart" and "editaddresscartBT" in the URLs are not translated, and as far as I know aren't translatable

2) I don't get the point of having my-vm-homepage-menu-item-alias in the URL: for example if my alias is "products" (because my menu item title is "Products"), what I get is www.mysite.it/products/cart, or even worse www.mysite.it/products/user/editaddresscartBT. Why having something that relates to the user "under/inside" products (or whatever)?

I solved the last point changing the menu item alias (not the title) to "shop"...which to me makes more sense. But I don't know if it's a good choice.


jjk (or any other of you here), can you share your thoughts about this all?

And regarding what I call "URLs problems", does my reasoning make sense or mine are ghost problems?  :)


Thanks

jjk

Quote from: valekichia on January 31, 2017, 12:04:14 PM
And regarding what I call "URLs problems", does my reasoning make sense or mine are ghost problems?  :)

I think 'Yes', they are ghost problems. In a shop like VM the urls which are important are the product urls. However, there can be various urls for the same product page, depending on how the user ended up on a specific product page. He might have used 'Search' or clicked on a 'Manufacturer', or a category view, etc. Therefore every product page, every category view and every manufacturer view has a 'canonical url', which is what search engines like Google will index, while for example urls resulting from a search use the canonical url of the shop's homepage. And cart urls shouldn't be indexed (Google bots don't put something in the cart).
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

valekichia

jjk thank you for your explanation!

It's a relief knowing that something I was worried about isn't even a problem!  :)
And maybe my reasonings and your answers will help someone else here...

Back to the original issue (the undesired modules on edit billing/shipping address page from cart), I think my only chance is to give a try to the solutions I found in the links above.
Since the URLs are not a problem, I think one of them will be right for me.

Unless you have other suggestions...

Milbo

I did not read the whole thread, but when you want to disable a module, then you need a menuitem. So that you can say "disable it for this menu item".

Google the concept "hidden" or "shadow" menues for joomla. Maybe someone knows more about.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

valekichia

Hi Milbo, thank you for your hint.
I already know what you are saying, but the problem is that the pages I'm speaking about (edit billing/shipping address form cart) don't have a menu item, so there is no chance to use the "disable this module for this menu item" logic.
From the reasonings above and from my searching on Google I conclude that the workarounds for this are:
- creating a "fake" menu item using Joomla URL menu item type
- hiding the module via a conditional module position related to the view
- hiding the module via css

I was investigating if it was possible to solve this using some kind of "override", but I didn't find anything about this and I don't have the skills to figure it out by myself. (Maybe it's not even possible...)
So by now I will stick to the solutions above!