Advertisement:

Author Topic: why osc_run_hook do not works in loop-single-premium.php?  (Read 467 times)

abc500x500

  • Jr. Member
  • **
  • Posts: 96
why osc_run_hook do not works in loop-single-premium.php?
« on: March 08, 2018, 09:56:37 pm »
Hi.
 why osc_run_hook do not works in loop-single-premium.php:-[

How i can use osc_run_hook in this file?


Thanks


abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: why osc_run_hook do not works in loop-single-premium.php?
« Reply #1 on: March 09, 2018, 05:41:48 pm »
problem about custom attribute plugin and bender theme.
I have customized loop-single-premium.php in bender by editing code and put this code to loop-single-premium.php:
Code: [Select]
osc_run_hook('item_detail', osc_item() );
but this code do not show data in premium loop list!

I put this code in loop-single.php and saw it works and show data!

Please say why it can not show data in loop-single-premium.php but can show in loop-single.php?

How can i show data in premium loop section?

thanks

m6mmi

  • Jr. Member
  • **
  • Posts: 72
Re: why osc_run_hook do not works in loop-single-premium.php?
« Reply #2 on: March 09, 2018, 07:51:39 pm »
You have regular item hook that's why it's not showing data
Try this https://doc.osclass.org/HPremium.php

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: why osc_run_hook do not works in loop-single-premium.php?
« Reply #3 on: March 10, 2018, 12:43:32 pm »
I found solution by searching:

https://forums.osclass.org/plugins-20/showing-attributes-of-custom_attributes-in-listing-items-premium-27317/

Hi,

Inside loop-single.php:

Code: [Select]
<?php osc_run_hook('item_detail'osc_item() ); ?>
Inside loop-single-premium.php, problem is that in the plugin osc_item_id() is hardcoded, nothing about osc_premium_id(), so you need to make both equal before invoking the plugin, try:

Code: [Select]
                        <div align="left" style="margin-right:5px;">
                        <?php View::newInstance()->_exportVariableToView('item'View::newInstance()->_current('premiums'));
                              
osc_run_hook('item_detail'osc_item() ); ?>

                        <span class="category"><?php echo osc_premium_category(); ?></span>

Regards