I need to create product description with mass action. But dot symbol is break

  • Posts: 2281
  • Thank you received: 309
  • Hikamarket Frontedition Hikamarket Multivendor Hikashop Multisite
3 months 2 weeks ago #328656

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24

I try to create mass action that create product description with combination of static text and product name.
Some kind of:
concat('Great pizza of Moscow. Here is ', product.product_name, ' you get the best!')

But I get error message that table is not found. The problem with dot symbol.
What should I do?


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

  • Posts: 72763
  • Thank you received: 11096
  • MODERATOR
3 months 2 weeks ago #328667

Hi,

Yes, the dot is used as a separator for the table name and the column name in operations.
So there is a mechanism to retrieve them in order to add joins to the tables if necessary.

Add the line:
$entry = preg_replace('/\'(.*)\'/U', '', $entry);
before the line:
$data = explode('.',$entry);
in the file administrator/components/com_hikashop/classes/massaction.php and it should fix the problem.
Another solution is to use

˙
instead of a dot since the description is HTML code.

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

  • Posts: 2281
  • Thank you received: 309
  • Hikamarket Frontedition Hikamarket Multivendor Hikashop Multisite
3 months 2 weeks ago #328698

do you include this solution to next release of hikashop?
I don't want to hack the code...


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

  • Posts: 2281
  • Thank you received: 309
  • Hikamarket Frontedition Hikamarket Multivendor Hikashop Multisite
3 months 2 weeks ago #328706

˙
is an upper dot - not usual dot
here it is - ˙


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Last edit: 3 months 2 weeks ago by progreccor.

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

  • Posts: 2281
  • Thank you received: 309
  • Hikamarket Frontedition Hikamarket Multivendor Hikashop Multisite
3 months 2 weeks ago #328712

I have added this code:

foreach($entries as $entry){
				$entry = preg_replace('/\'(.*)\'/U', '', $entry);
				$data = explode('.',$entry);
				if(!isset($data[1]) || (is_numeric($data[0]) && is_numeric($data[1])))
					continue;
				$strings[]['table'] = $data[0];
				$strings[]['column'] = $data[1];
			}
but it doesn't help
still get error message


here is the sample for concat
concat('Хотите заказать пиццу с доставкой в Ульяновске? Предлагаем заказать пиццу ', product_name, ' на сайте oran-g.ru ☎️ 8 800 300-66-03 Только Моцарелла! Только итальянский пицца-соус из мякоти томатов! Никаких кетчупов и майонезов. Быстрая доставка пиццы', product_name)


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Last edit: 3 months 2 weeks ago by progreccor.

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

  • Posts: 72763
  • Thank you received: 11096
  • MODERATOR
3 months 2 weeks ago #328714

Hi,

I see. That's because of the dashes in your strings which splits the strings before and thus makes my modification not do anything.
Alright then, revert back the change, and instead, change the code:

$string = str_replace($symbols,'||',$action['value']);
to:
$string = preg_replace('/\'(.*)\'/U', '', $action['value']);
			$string = str_replace($symbols,'||',$string);
in that same file and it should work fine.

The following user(s) said Thank You: progreccor

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

  • Posts: 2281
  • Thank you received: 309
  • Hikamarket Frontedition Hikamarket Multivendor Hikashop Multisite
3 months 1 week ago #328919

yes, this solution really help me.
Do you include this patch to next version of hikashop?


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

  • Posts: 12786
  • Thank you received: 1757
  • MODERATOR
3 months 1 week ago #328966

Hello,

Of course that patch will be include through next Hikashop versions.

Kind regards,
Mohamed.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum