[SOLVED] YouTube Embed Code Stripped from Variant

  • Posts: 202
  • Thank you received: 13
  • Hikashop Business
9 years 3 weeks ago #248963

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 7.0.6
-- Browser(s) name and version -- : Firefox 48.0.1
-- Error-message(debug-mod must be tuned on) -- : No error message

We are attempting to add an embedded YouTube video into a product variant description, however, upon saving the variant the iframe embed code is stripped out of the description field. I've ruled out an editor issue by disabling all editors. Also, the code is not stripped from the main product description or Joomla articles.

Is this a bug, or are you purposefully stripping some HTML from variant descriptions?


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters
Last edit: 9 years 3 weeks ago by 3by400.

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

  • Posts: 84424
  • Thank you received: 13718
  • MODERATOR
9 years 3 weeks ago #248976

Hi,

Well, it's not really a bug because you're not supposed to do that for security reasons. It's better to use a content tag plugin which replaces the tag when the description is displayed.
But yes, it should be consistent with the product description behavior.
We've added a patch on our end so that it is consistent between the product and the variant descriptions.
It's quite easy. I've replaced the code:

$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
			$product->product_description = $safeHtmlFilter->clean($product->product_description, 'string');
by:
if((int)$config->get('safe_product_description', 0)) {
				$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
				$product->product_description = $safeHtmlFilter->clean($product->product_description, 'string');
			}
in the backSaveVariantForm function of the file administrator/components/com_hikashop/classes/product.php

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

  • Posts: 202
  • Thank you received: 13
  • Hikashop Business
9 years 3 weeks ago #249021

Thank you for the reply. I've installed the latest version and the video is no longer stripped out of the variant description, however, the video is not shown on the frontend for the main product even though it does appear on the backend.

Here is an example:
fsrinc.com/fsr-products/product/109-cb-12

The main product description and the CB-12P variant both have the video embedded in the same location of their respective descriptions, however, as you can see the video only shows in the variant's description.


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters

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

  • Posts: 84424
  • Thank you received: 13718
  • MODERATOR
9 years 3 weeks ago #249037

Hi,

The iframe tag is only in the CB-12P description on your product page, not in the other variants:
take.ms/RnPBM

So I suppose that you must have a description configured for the other variants without the video and in that case, the description of the other variants is used over the description of the main product.

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

  • Posts: 202
  • Thank you received: 13
  • Hikashop Business
9 years 3 weeks ago #249042

Correct, I do not have the video in other variants. I have the video in the main 'parent' product and in the CB-12 variant.

So, the video should be showing when the page initially loads and "select one..." is in the variant drop down.

"The main product description and the CB-12P variant both have the video embedded in the same location of their respective descriptions,"


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters

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

  • Posts: 84424
  • Thank you received: 13718
  • MODERATOR
9 years 3 weeks ago #249053

Hi,

No. The default description on the product page is the description of the variant selected by default. So if you don't see the youtube video on the default description, it means that you have a description without the video in the default variant.
The main product description is only used if:
- there is no description in the variant on the product page
- on the products listing

The following user(s) said Thank You: 3by400

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

  • Posts: 202
  • Thank you received: 13
  • Hikashop Business
9 years 3 weeks ago #249097

Oh, that's right! Thank you for your assistance!


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters

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

Time to create page: 0.065 seconds
Powered by Kunena Forum