Adding string to description

  • Posts: 197
  • Thank you received: 13
1 year 8 months ago #343869

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.1.5
-- PHP version -- : 7.4

Hi,
I want about 100 products in my site which every of them have different descriptions.

I need to add a static string at the end of all of products descriptions.

is that possible with mass actions ?

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

  • Posts: 197
  • Thank you received: 13
1 year 8 months ago #343871

Sorry I meant "I have about 100 product" by "I want about 100 product".
that was a typing mistake.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
1 year 8 months ago #343872

Hi,

Yes. You can use an action "update the values" on the column product_description with the mode "operation" and the value:

concat(product.product_description, 'my extra text')

The following user(s) said Thank You: khashiz

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

  • Posts: 197
  • Thank you received: 13
1 year 8 months ago #343879

thats why i love this amazing component.

thank you

The following user(s) said Thank You: Philip

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

  • Posts: 197
  • Thank you received: 13
1 year 7 months ago #344357

Hi.

today I tried to use this code.
I put some html instead of "my extra text" and the system returned error.

can't I put html there ?

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

  • Posts: 197
  • Thank you received: 13
1 year 7 months ago #344358

what I exactly want to do is that if my description's html is :
<p>some text</p>

I want to add :
<div class="class1">some other text</div>
at the end of it.

so the final description would be :
<p>some text</p><div class="class1">some other text</div>

screenshot of the error i get is attached

Attachments:
Last edit: 1 year 7 months ago by khashiz.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
1 year 7 months ago #344359

Hi,

HTML is stripped for security reasons.
If you want to temporarily disable that, you can remove the line:
$value = strip_tags($value);
from the file administrator/components/com_hikashop/classes/massaction.php
Then, you'll get the HTML in there too when you process the mass action.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum