Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

call to new function in addon


Portman

Recommended Posts

Hi

I am using BS Frozen

I have been doing some modifications to an add-on and I have created a new <function> to the code to make the add-on operate in the way I need it to...

This has worked fine within the files of the add-on....

Now I want to call that function (located in catalog/includes/module/store/st_addon.php) in catalog/product_info.php...

Can I do that? and if so how?

Link to comment
Share on other sites

Hello Pete @Portman,

If you added the function outside the module class as a independant function, it should be available if the module is active on the product_info page.

Check if there is a page selection if you have product_info.php included.

Then the store module is loaded in template_top.php (supposed it's one of my store module  add-ons, it is a modified header_tag module).

Therefore the function will not be available before the template_top.php call:

  require('includes/template_top.php');

If you need the function before, you should opt to include it in includes/functions/general.php instead of adding it to the module.

Then it is available everywhere after:

  require('includes/application_top.php');

 

Edited by raiwa
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...