How to connect to hikashop api by custom php code

  • Posts: 10
  • Thank you received: 1
8 years 8 months ago #231498

-- HikaShop version -- : 2.6.1

Hi there. I am going to write a control panel that is going to fetch some products from a xml file. I must add them to the joomla site which is working with hikashop.
How can I use hikashop api in custom php code?? Imagine my project is " www.example.com " and my own custom php directory is like " www.example.com/mypage " .
I found this url to loading helper.php , but I couldn't.
Can anybody help me?

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 8 months ago #231505

Hi,

What do you mean by "you couldn't" ?
It's just an include of the helper.php file of HikaShop.
It's standard PHP. The JPATH_ADMINISTRATOR constant will only exist if you're in a script where Joomla has already been loaded. And you need to load Joomla before you load HikaShop since HikaShop relies on Joomla's library for some of its functions.
So if you're trying to load HikaShop from a third party script, make sure that Joomla is already loaded:
stackoverflow.com/questions/23937651/loa...in-external-php-file

The following user(s) said Thank You: vahid.vdn

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

  • Posts: 10
  • Thank you received: 1
8 years 8 months ago #231543

Thank you.
And one more question. As you have code samples for custom php codes here , I can't find any api for adding product.. There are some codes about loading a product, adding product to cart, loading the current cart data etc, but nothing for adding product. What should I do??

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 8 months ago #231548
The following user(s) said Thank You: vahid.vdn

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

Time to create page: 0.060 seconds
Powered by Kunena Forum