News:

Looking for documentation? Take a look on our wiki

Main Menu

multi-language site, link to wrong shopping-cart page

Started by herr.proof, March 12, 2013, 11:11:22 AM

Previous topic - Next topic

herr.proof

Hi to all, and thank you for all the exceptional work you're doing here!!

My presentations:
     * multi-language site,
     * joomla 2.5.9
     * Virtuemart 2.0.18a

Problem:
when I click the add-to-cart button it sends me to a wrong shopping-cart-page (the 'main' [all-languages] one)

e.g.:
from the shop in english language it sends me to
    [mysite]/index.php?option=com_virtuemart&view=cart&lang=en
instead of
     [mysite]/index.php?option=com_virtuemart&view=cart&Itemid=210&lang=en

(210 being the ID-menu-item of the shopping cart page in english language.)

__
I looked for a similar topic, but I did not find it. If it exists, please excuse me...  :-[

Thank you in advance for all the answers (and the solutions   ;)  to my problem ... )

jjk

Looks to me like you didn't translate EVERY menu item. Each menu item should be available in every language and make shure each menu item has the correct language tag. Do you really want to redirect the customer directly to the cart? If clicking "Add to cart" redirects you directly to your shopping cart, you probably disabled "Display modal popup upon 'Add to cart' " in Configuration > Checkout tab.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

herr.proof

Quote from: jjk on March 12, 2013, 15:27:34 PM
Looks to me like you didn't translate EVERY menu item. Each menu item should be available in every language and make shure each menu item has the correct language tag. Do you really want to redirect the customer directly to the cart? If clicking "Add to cart" redirects you directly to your shopping cart, you probably disabled "Display modal popup upon 'Add to cart' " in Configuration > Checkout tab.

Thank you for your quick reply!
After reading your words I immediately went to work , so please excuse me for my not-so-quick-response.

I double-checked all  menus, all  menu-items, even all published categories...
all seems sound and proof... ah, I enabled that 'display modal etc' ... no changes.   :'(

to add puzzlement to wonders, I discovered that when I click the  "Add/Edit billing address information" a similar error comes out, sending me to the right language [e.g.. English] BUT in the wrong page (that is, the corresponding one in the "All-languages" template).
This is partially "solved" ,  because  the url says
    index.php?option=com_virtuemart&view=user&task=editaddresscheckout&addrtype=BT&Itemid=210&lang=en

if I edit the url
     index.php?option=com_virtuemart&view=user&task=editaddresscheckout&addrtype=BT&Itemid=210&lang=en
and reload the page,  I find myself magically transported to the right page in the right "language" template (in this case, English...)

Could this send lights to my errands? I do not see those "amp;" when I click 'addtocart' buttons... So I decided to check if it could be wise to put this second mystery in a separate thread or not.

I am a bit worried...    ???

jjk

The "&amp" in your  urls should be "&" only. Do you use a third party menu (maybe included in your template) which generates links with javascript?
Do you have a link to your website, so we can have a look?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

herr.proof

Offline for a long time...
Updated all to
    *Multi-language site
    *joomla 2.5.9
    *virtuemart 2.0.20b

I am not allowed to let others see the site at the time being (the fact is that no one of those-that-could-permit-this is telling 'yes' or 'not' , up to now... let's hope for the best...)

But!

In another site, smaller but very similar, I found similar errors...

There, after hitting 'add to cart' button, popup window allows two options:

A) "continue shopping" otion links UNcorrectly to shop page in English, but in MainMenu-ALL.
   index.php?option=com_virtuemart&view=category&virtuemart_category_id=6&lang=en

instead of
   index.php?option=com_virtuemart&view=category&virtuemart_category_id=6&Itemid=212&lang=en

B)  the ADD TO CART option links UNCORRECTLY to  a cart in english, but in MainMenu-ALL.
      index.php?option=com_virtuemart&view=cart&lang=en
      instead of
     index.php?option=com_virtuemart&view=cart&Itemid=185&lang=en

it LOSES the ItemId=185 part, and that is not due to the 'amp;' error (alas, see more a few linew below...)

(again, '185' being the ID number of the 'Cart' menu voice in MainMenu-English; this link refers to shopping cart [in english language] in MainMenu-English )
*Just a thought: in this wrong url, the "Cart-All" ID number [namely, '124'] is not hinted in the link, but the structure is something that sends us to the 'main menu-all nonetheless...

Now, the (other) oddities:

From the wrong link, in main menu-all...

   1) "add-edit billing" button links UNcorrectly to
      index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT&lang=en
   
   2) "add-edit shipment address" button links correctly to
      index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[0]=0&lang=en
   
   3) "Confirm purchase" links correctly to
      index.php?option=com_virtuemart&view=cart&task=confirm&lang=en
   
   4)  "delete product from cart" button links UNcorrectly to a cart in english, but in MainMenu-ALL.
      index.php?option=com_virtuemart&view=cart&lang=en      

_____

While, from '185' (forcing that url - "index.php?option=com_virtuemart&view=cart&Itemid=185&lang=en")

1) add-edit billing button links correctly to
   index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT&Itemid=185&lang=en

2) add-edit shipment address links correctly to
   index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[0]=0&Itemid=185&lang=en

3)  "confirm purchase" button links UNCORRECTLY to a cart in english, but in MainMenu-ALL.
   index.php?option=com_virtuemart&view=cart&Itemid=185&lang=en

4) "delete product from cart" button links UNCORRECTLY to a cart in english, but in MainMenu-ALL.
   index.php?option=com_virtuemart&view=cart&Itemid=185&lang=en

please do note (again) the 'amp;'  part following the character ' in 3) and 4).
in threads
http://forum.virtuemart.net/index.php?topic=98222.0
and
http://forum.virtuemart.net/index.php?topic=100250.0
I did see something alike, but alas, that code _seems_ to be referred to code outdated for my joomla-VM versions...


NOW:
1)it seems all strange to me
2) maybe "add-edit billing" and "add-edit shipment address" buttons get the itemID of the cart from the page they are? In this case, they are coded differently from "checkout" and "delete product from cart".
3) viewed erratically characters, ampersands etc,  could be due to "collation utf8_general_ci" present in the DB structure I did see a while ago? I remember  there is "collation utf8_unicode_ci", being presented as slower but more reliable...
4) the <addtocart> error looks like something not due to the < 'amp;' > one.

:o  :'(

herr.proof

#5
Part of the problem is 'solved' through the 'hack' presented in
http://forum.virtuemart.net/index.php?topic=112908.0

(obviously that could be wiped out in any update of VM altering the hacked & hacking part ...)

There is still the 'amp;' thing to be solved...

** EDIT of 2013, Mar 25th **
note: the 'amp;' error disappears setting  'ON'  <URL SEF>in Global Configuration...

But ... This is NOT what I would say 'enough to say it 'solved'...

jjk

Since you are referring to links pointing to "Main Menu-All", I wonder if your Joomla multilanguage setup for the menus is correct. There should be only a single menu item (Home), which has the language tag "All" assigned to it. All other menus and menu items should have a language tag assigned to it.

Did you check your Joomla multilanguage settings against one of the available tutorials (first two links on this page)?
http://docs.virtuemart.net/tutorials/36-multilingual-store/99-multilanguage-setup.html
...and does your Joomla 'Multilanguage Status' show only green icons)?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

lindapowers

Now you are making me wonder why we don't have a menu item for the shop assigned to all languages, we use each menu item for each language...

Changing language from the product details or categories makes it go back to the shop in the changed language, could that be the issue?

I mean is that shop menu to all languages really needed?

jjk

Quote from: lindapowers on March 26, 2013, 16:13:39 PM
I mean is that shop menu to all languages really needed?
The Joomla multilanguage tutorial says "It is compulsory to keep a Default Home page assigned to 'All'. To prevent further confusion,
rename the default main Menu to Main Menu-ALL"
If you have that, you should not assign the 'all' language tag to any other menu/menu item. Your 'Shop' link (usually 'VM categories layout' or VM frontpage) should have indivdual language tags like 'es' or 'en'.

If you are i.e. in a spanish VM product details view assigned to category 'manzanas'  (apples) and switch your language to English, the Joomla language switcher looks if there is an english language menu item for category 'Apples'. If it finds one, you will be redirected to page 1 of the english category 'Apples'. If it does not find one, it will fall back to the next higher level for which it finds a english language menu item - which might be your homepage.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

lindapowers

#9
Thanks JJK, is exactly how we have it set up then.

We use menu language assignments in our menu configuration, that way from the "contact" page in spanish if you click in english you are redirected to the english "contact" page.

About the products I have no clue on how to make those assignments cause obviously we don't have a menu item for every product.

There is only one menu item for the shop (in each language) so clicking the language flag redirects to the main shop page in the selected language.

If you have any idea on how to redirect from a concrete product or category to its translated version please tell me, is not a big issue but would be nicer that way.

Regards

herr.proof

Quote from: jjk on March 26, 2013, 13:25:39 PM
Since you are referring to links pointing to "Main Menu-All", I wonder if your Joomla multilanguage setup for the menus is correct. There should be only a single menu item (Home), which has the language tag "All" assigned to it. All other menus and menu items should have a language tag assigned to it.

In mainmenu-all are present, at now,
1) home-all (sign: star);
2) shop-all (currently disabled)
3) cart-all (currently disabled)
4) contact-all (currently disabled)

in mainmenu-eng are present, at now,
1) home-eng (sign: uninion jack flag); language: english
2) shop-eng; language: english
3) cart-eng; language: english
4) contact-eng; language: english

in mainmenu-ita are present, at now,
1) home-ita (sign: italian flag); language: italian
2) shop-ita; language: italian
3) cart-ita; language: italian
4) contact-ita; language: italian

Quote from: jjk on March 26, 2013, 13:25:39 PM
Did you check your Joomla multilanguage settings against one of the available tutorials (first two links on this page)?
http://docs.virtuemart.net/tutorials/36-multilingual-store/99-multilanguage-setup.html
...and does your Joomla 'Multilanguage Status' show only green icons)?

yes I did.
yes, it does... only green lights there.  :-) [plugin language filter enabled... and published predefined home pages are one more than "published language modules" because there is  the 'home-all" one , too, obvioulsy]

'My' site works fine in all aspects, except a few links in virtuemart shop pages as per my preceding posts in this topic...

lindapowers

Make template clones per language, that is how it works for us.

We have a copy of the template in every language, in the template menu assignments you just choose your menu's assigned in the same language. That way in the english version you will just see the english cart which is assigned to your template copy in english.

Same for the italian.

Also make sure each menu item has the template assigned for each language.

Example:

Menu item shop-italian= template assigned= templatecopyitalian
language italian

Menu item shop-english=template assigned= templatecopyenglish
language english

etc

Don't if this is the correct way but is how it works for us.

jjk

@lindapowers
Your approach looks a little bit strange to me. If your current shop is the link in your forum signature, I don't see any elements with language tags there and I can't find any link to switch languages. I can see only Spanish.

You may have a look at the my shop linked in the forum's showcase, which is German/English- just to compare the menu setup to yours.
http://forum.virtuemart.net/index.php?topic=110005.msg368676#msg368676
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

lindapowers

Hi jjk

check here: test.comenaranjas.com (subdomain without www)

The one you checked is only in spanish and in joomla 1.5 and vm 1.1.8, the new one is currently in development but mostly finished.

I don't know if is the correct way, but is the one that worked for us following the advice by the yagendoo guys.

herr.proof

Quote from: lindapowers on March 27, 2013, 18:25:07 PM
Make template clones per language, that is how it works for us.

We have a copy of the template in every language, in the template menu assignments you just choose your menu's assigned in the same language. That way in the english version you will just see the english cart which is assigned to your template copy in english.
...

That is the way templates go: one of them for each language, plus the default for 'all'. As per previous messages, the site responds to all and every click, except for those few links that make up the problem...