Run Joomla Code/ plugins inside Page View

  • Posts: 77
  • Thank you received: 3
11 years 9 months ago #87161

Hey Guys,
We need to run a plugin on the product page. Basically have a plugin run.
If placed into the description it will run, however we want to be able to run
by code added to either the page view itself.

For example: we are using pay plans, & a gallery app. On a product page we want to have a way to show
a gallery based on a plugin.

Since we have thousands of products, creating an article for each and using pay plans restriction is not an option.
If we have a plugin run on each product page, this would help.

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 9 months ago #87238

Hi,

A plugin ?
If you use a system plugin with content override, it would work on every pages.
If you use a module, you could add it in the module under the product page.

After that, you can override all views in HikaShop so you can override the product page view (product | show_default) in order to call your plugin (by loading it and launch 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.

  • Posts: 77
  • Thank you received: 3
11 years 9 months ago #87316

Maybe I need to explain better ...
We use a gallery Admiror Gallery
as a plugin.. When inserted into the description / or regular article the plugin will run fine. and do what we need.

However we wish to NOT place in the description but into the tabular VIEW page.
When placed on this page or any VIEW page it prints out the actual code, NOT run or process the plugin.

Along with this, we want to insert the gallery path dynamically based on your Custom fields.
So for each product we would want to put in the view page:
we include the path to our gallery along with a custom field. {AG}galleries/products/<?php echo $this->row->CUSTOM_FIELD_COLUMN_NAME; ?>{/AG}

We have tried with and without the custom field, along with other settings & options with NO success.
Again , if you take this same code and place into the description or an article it runs fine ....

I hope I explained this ok ..

Any Suggestions as to why it is not triggering plugin ? ? PLEASE ?

Thank YOU Guys !

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #87401

Could you give us the code part where the code is added to call the plugin ?
Are you adding it in the view "product / show_tabular" ?

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

  • Posts: 77
  • Thank you received: 3
11 years 9 months ago #87863

Yes we are adding to View/ Tabular .. or for that matter
ANY View page ...

The code we would like to add is:
{AG}galleries/products/<?php echo $this->row->CUSTOM_FIELD_COLUMN_NAME; ?>{/AG}
As you can see, it is a regular plugin code, with YOUR call to a custom field inside.
But even without the custom part included, your Hika shop spits out the actual code, Not
the plugin actions.

Thanks ....

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

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
11 years 9 months ago #88147

Hi,

The Admirror Gallery plugin is a content plugin, not a system plugin.
You cannot add the tags anywhere you want in your website.
You can only add the AG tags in "content". So a product description, a joomla article, a category description, etc.

If you add it in the middle of a view, the plugin won't replace it. It's not a problem of HikaShop but of the plugin which is not made to do that.
You will have to change your code to force the content plugins on your tags. So you should use such code instead of what you're doing:
<?php echo JHTML::_('content.prepare','{AG}galleries/products/'.$this->row->CUSTOM_FIELD_COLUMN_NAME.'{/AG}'); ?>

The following user(s) said Thank You: colpc

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

  • Posts: 77
  • Thank you received: 3
11 years 9 months ago #88252

Great !
Appreciate the answr and example..
Will give it a shot and let you know.

Thank YOU
nicolas

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

Time to create page: 0.073 seconds
Powered by Kunena Forum