Change text and hide price in minicart

  • Posts: 23
  • Thank you received: 0
11 years 9 months ago #115618

Hi,

I'm making a new template with the views of HikaShop for my ecommerce site and I want to display the minicar only with the quantity of products and a string with the name ('Carro'). The file I'm modifying is com_hikashop > product > cart.php (in the html file of my template), and found these lines:

<span class="hikashop_small_cart_total_title"><?php echo $text; ?></span>

$text = JText::sprintf('X_ITEMS_FOR_X',$qty,$this->loadTemplate());

How that code works? How I only show the quantity and the custom string.

PS: I don't want to use CSS because I would like to learn PHP.

Regards and TIA!

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #115632

Hi,

In this case you just need to change the translation string in HikaShop > Configuration > Languages in the override part of your language file.
Replace:
X_ITEMS_FOR_X="%s items for %s"

By:
X_ITEMS_FOR_X="carro <span class='carro_qty'>%s</span>"

And in the view "product / cart" replace:
$text = JText::sprintf('X_ITEMS_FOR_X',$qty,$this->loadTemplate());

By:
$text = JText::sprintf('X_ITEMS_FOR_X',$qty);

The following user(s) said Thank You: cipionhabla

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

Time to create page: 0.065 seconds
Powered by Kunena Forum