Placing a URL in the product descriptions

  • Posts: 173
  • Thank you received: 14
  • Hikashop Business
6 years 4 weeks ago #290004

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 5.6.34
-- Browser(s) name and version -- : opera 51.0.2830.55

Hi,
we have 2 licenced Hikashop sites and would like to include a standard clickable URL in the description field of one of the sites to the other. This so we only have to have one working checkout (we also have 2 separate physical shops).

We'd prefer to do this as a mass action and would like to know how to format the string (we know how to do text only).

Many thanks,
Ian and Stu

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

  • Posts: 81507
  • Thank you received: 13064
  • MODERATOR
6 years 4 weeks ago #290011

Hi,

The mass actions system allows you to concatenate strings in the "update the values" action in operation mode, but it doesn't allow for HTML, for security reasons.
So I'm afraid you'll have to do that with a MySQL query in your PHPMyAdmin.
It's however quite easy... Something like that:
UPDATE #__hikashop_product SET product_description = CONCAT(product_description, 'MyHTML');

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

  • Posts: 173
  • Thank you received: 14
  • Hikashop Business
6 years 4 weeks ago #290091

Hi,
I'll get someone to do this for use but would our new description with the link in it replace 'MyHTML' in your example?

Thanks,
Ian and Stu

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

  • Posts: 81507
  • Thank you received: 13064
  • MODERATOR
6 years 4 weeks ago #290103

Hi,

Since it's a concatenation, what you put instead of "MyHTML" will be added at the end of the product_description you already have in each product.

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

  • Posts: 173
  • Thank you received: 14
  • Hikashop Business
6 years 3 weeks ago #290190

Hi,
it comes back with a syntax error when I just try the word 'test' instead of 'MyHTML'.

Regards,
Ian and Stu

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 3 weeks ago #290205

Hello,

What syntax error ?
You can "concat" any content you want but you need to be sure that the content is right escaped and between quotes.
Do not hesitate to look for some MySQL documentation or tutorial to escape and quote your content correctly.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 173
  • Thank you received: 14
  • Hikashop Business
6 years 3 weeks ago #290207

Hi,
it's;

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

I'll ask a friend who know a bit about sql to take a look.

Thanks,
Ian and Stu

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 3 weeks ago #290233

Hello,

near '' at line 1

It means that you have quotes in your content and you need to escape it.
Generally, we recommend you use backslashes.
stackoverflow.com/questions/887036/how-t...ngle-quotes-in-mysql

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 173
  • Thank you received: 14
  • Hikashop Business
6 years 3 weeks ago #290263

Hi,
escaping the characters results in the same error. If I select 'update' from the phpadmin interface it gives me;

UPDATE `mus_hikashop_product` SET `product_description`=[value-4] WHERE 1

Can I adapt this?

Thanks,
Ian and Stu

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

  • Posts: 81507
  • Thank you received: 13064
  • MODERATOR
6 years 3 weeks ago #290265

Hi,

It's the same in PHPMyAdmin:
UPDATE `mus_hikashop_product` SET `product_description`=concat(product_description, 'MyHTML') WHERE 1

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

  • Posts: 173
  • Thank you received: 14
  • Hikashop Business
6 years 3 weeks ago #290289

Thanks Nicolas. That worked!

Kind regards,
Ian and Stu

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

Time to create page: 0.077 seconds
Powered by Kunena Forum