shipping/payment name and description translation

  • Posts: 34
  • Thank you received: 0
  • Hikashop Business
1 week 6 days ago #307548

-- HikaShop version -- : 4.1
-- Joomla version -- : 3.9.6
-- PHP version -- : 7.2.14

Hi, Is it possible to translate shipping method / payment methods names and descriptions without using external components/plugins ?
Regards,
Greg

Please Log in or Create an account to join the conversation.

  • Posts: 66046
  • Thank you received: 9668
  • MODERATOR
1 week 6 days ago #307551

Hi,

There is no option to be able to do that without Falang.

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
  • Hikashop Business
1 week 5 days ago #307583

Hi Nicolas,
It is a pity that it is not possible to use language override in this case as in the case of custom fields or characteristics.
Regards,
Greg

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
  • Hikashop Business
1 week 5 days ago #307586

Hi Nicolas, I have implemented following change in the show_block_shipping.php in the line 115

Before change:

<span class="hikashop_checkout_shipping_name"><?php echo $shipping->shipping_name;?></span>

After change:
<span class="hikashop_checkout_shipping_name"><?php echo JText::_( $shipping->shipping_name);?></span>

Above change caused that shipping name is now translatable using language override in the same way as for example characteristic name.
I understand same change might be implemented to make translatable payment method in show_block_payment.php

Regards,
Greg

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
  • Hikashop Business
1 week 5 days ago #307592

Hi Nicolas, Additionally to have also translation on checkout summary for shipping/delivery I made following changes in show_block_status.php:

Before:

<?php
	$cart = $this->checkoutHelper->getCart();

	$array = array();
	if(!empty($cart->shipping)) {
		$names = array();
		foreach($cart->shipping as $shipping) {
			$names[] = $shipping->shipping_name;
		}


		$array[] = JText::sprintf('HIKASHOP_SHIPPING_METHOD_CHOSEN', '<span class="label label-info">'.implode('</span> <span class="label label-info">', $names).'</span>');
	}

	if(!empty($cart->payment))
		$array[] = JText::sprintf('HIKASHOP_PAYMENT_METHOD_CHOSEN', '<span class="label label-info">'.$cart->payment->payment_name.'</span>');


	echo implode('<br/>', $array);

	if(empty($this->ajax)) { ?>
</div>

After:
<?php
	$cart = $this->checkoutHelper->getCart();

	$array = array();
	if(!empty($cart->shipping)) {
		$names = array();
		foreach($cart->shipping as $shipping) {
			$names[] = JText::_($shipping->shipping_name);
		}


		$array[] = JText::sprintf('HIKASHOP_SHIPPING_METHOD_CHOSEN', '<span class="label label-info">'.implode('</span> <span class="label label-info">', $names).'</span>');
	}

	if(!empty($cart->payment))
		$array[] = JText::sprintf('HIKASHOP_PAYMENT_METHOD_CHOSEN', '<span class="label label-info">'. JText::_($cart->payment->payment_name).'</span>');

	echo implode('<br/>', $array);

	if(empty($this->ajax)) { ?>
</div>

Regards,
Greg

Please Log in or Create an account to join the conversation.

  • Posts: 66046
  • Thank you received: 9668
  • MODERATOR
1 week 5 days ago #307585

Hi,

It could indeed be interesting to handle that. I've noted it for future improvements on my end.

Regarding your modification, you can do it with a view override on your end in the mean time. However, we'll implement that capability differently as we want the payment / shipping method name to be translated everywhere (email notifications, orders listing, checkout, etc).

Last edit: 1 week 5 days ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 0
  • Hikashop Business
1 week 5 days ago #307615

Hi Nicolas, great !
I hope that the change will be implemented soon :)
I think that the full multilingualism of the store would be great and build additional added value
Regards,
Greg

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum