- Posts: 14
- Thank you received: 0
Help with empty cart in multi language site
- MarioMagno
-
Topic Author
- Offline
my compliments for support team.
I have one issue to submit to all of you:
I've inserted a code:
<input type="submit" class="button" name='EMPTY_CART' value="Svuota carrello" onclick="window.location='<?php echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode('index.php?lang=it'))); ?>';return false;"/>.
and works.
But I have a multilanguage site. So, in this way I do not have a different sentences (Empty cart) in all of languges.
Can you hel me please?
Thanks in advance
Please Log in or Create an account to join the conversation.
You need to change the piece:
<?php echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode('index.php?lang=it'))); ?>
to:
<?php $lang = JFactory::getLanguage(); $locale=strtolower(substr($lang->get('tag'),0,2)); echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode('index.php?lang='.$locale))); ?>
Please Log in or Create an account to join the conversation.
- MarioMagno
-
Topic Author
- Offline
- Posts: 14
- Thank you received: 0
nicolas wrote: Hi,
You need to change the piece:
<?php echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode('index.php?lang=it'))); ?>
to:
<?php $lang = JFactory::getLanguage(); $locale=strtolower(substr($lang->get('tag'),0,2)); echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode('index.php?lang='.$locale))); ?>
Hi Nicolas,
thanks for your quick reply, but unfortunately it doesn't work.
It shown always the same label "Empty Cart" in all languages (maybe caused from input string: input type="submit" class="button" name='EMPTY_CART' value="Svuota carrello" ... )?
Thanks
Mario
Please Log in or Create an account to join the conversation.
For the name of the button, you can use such code:
EMPTY_CART="Empty cart"
www.hikashop.com/download/languages.html#modify
Please Log in or Create an account to join the conversation.
- MarioMagno
-
Topic Author
- Offline
- Posts: 14
- Thank you received: 0
nicolas wrote: I thought that the issue was with the lang parameter not the name of the button.
For the name of the button, you can use such code:And then add a translation override :Code:<?php echo JText::_('EMPTY_CART'); ?>
EMPTY_CART="Empty cart"
www.hikashop.com/download/languages.html#modify
Ok, but where can I write the piece of code you mentioned?
Maybe I can write like this:
<?php echo JText::_('EMPTY_CART'); ?>
<?php $lang = JFactory::getLanguage(); $locale=strtolower(substr($lang->get('tag'),0,2)); echo hikashop::completeLink('product&task=cleancart&return_url='. urlencode(base64_encode('index.php?lang='.$locale))); ?>
Please Log in or Create an account to join the conversation.
As I said, you need to replace the name of the button by that code.
So:
Please Log in or Create an account to join the conversation.
- MarioMagno
-
Topic Author
- Offline
- Posts: 14
- Thank you received: 0
Please Log in or Create an account to join the conversation.