Shortcode plugin into WYSIWYG custom field

  • Posts: 3
  • Thank you received: 0
9 years 5 months ago #229300

-- url of the page with the problem -- : www.klamoa.com/index.php/shop/eliana-ric...t/375-tunica-organza
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.5

Hello,
i want to add a WYSIWYG custom field to insert a button with "Shortcode plugin"( Shortcode Plugin ).
This plugin works well into product description (as you see in link page with the problem - GUIDA ALLE TAGLIE - it is a spoiler code).
But if I insert this code into WYSIWYG custom field (i see custom field after characteristics like "info"), it show me the code as text not the button.
I have set "no" to Input filtering setting.

Please can u help me?
Thanks

Last edit: 9 years 5 months ago by altod.

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

  • Posts: 26256
  • Thank you received: 4041
  • MODERATOR
9 years 5 months ago #229303

Hi,

The WYSIWYG custom field display his content directly.
There is some kind of trigger in Joomla to "prepare the content" ; that feature is used in Joomla article and some other places.
In HikaShop, the product description is display with that trigger. It allow the Joomla "content" plugin to modify the data before the display.
But the WYSIWYG custom field do not use that trigger because it display directly the content.

It means that you have to edit the administrator/components/com_hikashop/classes/field.php and modfy the "show" function in the class "hikashopWysiwyg" :

	function show(&$field,$value) {
		return JHTML::_('content.prepare', $this->trans($value));
	}
Otherwise, I'll submit your feature request to the rest of the HikaShop team to see if we add it directly in HikaShop or if we create an option for it.

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.
The following user(s) said Thank You: altod

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

  • Posts: 3
  • Thank you received: 0
9 years 5 months ago #229450

hello!
changed the code and it works! thank you!

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

  • Posts: 303
  • Thank you received: 18
9 years 3 months ago #233418

- url of the page with the problem -- : new.mojooutdoors.com/index.php/products/...mojo-scoot-and-shoot
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

Hi Jerome,

I tried your fix, but still cannot get the shortcode to render properly on the frontend? Still just shows up as text. The shortcode works in any other text editor on the website (e.g. articles, modules, etc.). Any thoughts?

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

  • Posts: 84079
  • Thank you received: 13634
  • MODERATOR
9 years 3 months ago #233419

Hi,

The code modification proposed by jerome was for the support of the plugin replacing in the custom fields of the type "wysiwyg".
Looking at your link, it seems that you're adding your shortcode in the product description. That is supposed to be supported by default by that plugin. So I would guess that this shortcode plugin is not activated or something like that. You might want to contact the support of that plugin as it's supposed to work by default in the product description.
Also, I see that the product layout is heavily customized on your link. So maybe the issue comes from the customization made by your template (or yourself). Try switching to the default template of Joomla and see if that helps. If it does, then it indeed comes from the customization of the product layout, probably in the file templates/YOUR_TEMPLATE/html/com_hikashop/product/show_default.php and in that case, I would recommend to contact your template provider for help as they must have made a mistake with the display of the description.

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

  • Posts: 16
  • Thank you received: 0
8 years 10 months ago #247853

I have the same problem. Shortcodes plugin does not work in Hikashop!
class hikashopWysiwyg in file dministrator/components/com_hikashop/classes/field.php :

code removed by a moderator


What should I do? Please help

Last edit: 8 years 10 months ago by Jerome. Reason: remove code

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

  • Posts: 26256
  • Thank you received: 4041
  • MODERATOR
8 years 10 months ago #247890

Hi,

Be sure you're using the latest HikaShop package.
Because the patch I gave 6 months ago is include in HikaShop since.

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: 16
  • Thank you received: 0
8 years 10 months ago #247949

im using hikashop 2.6.3.

What should I do? Where is the problem?

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

  • Posts: 26256
  • Thank you received: 4041
  • MODERATOR
8 years 10 months ago #247968

Hi,

The code you posted was rightfully a part of the Wysiwyg field class but did not mentioned the "show" function which is below the "display" function.
Now, regarding the fact that the patch I submitted 6 months ago has been approved but, will be in HikaShop 3 and isn't in the current release (when I really thought it was) ; you have to apply the patch manually just as explained in the post #229303
You already found the Wysiwyg field class ; you just have to look for the "show" function and replace it.

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.

Time to create page: 0.113 seconds
Powered by Kunena Forum