Hikashop and Filemaker database tool

  • Posts: 190
  • Thank you received: 9
5 years 5 months ago #298709

Hi there!

I have a customer with an advanced Filemaker solution.
They have thousands of products and continueslu changing stocks.
Workers are on the road and on an ipad (filemaker) they say i now need these products for this job so stock changes.

They want a webshop on a website
Woocommerce is 'easy' with Filemaker the developer told me, they have a great way to connect.
Though woocommerce has not all features needed and i think Hikashop is allot more flexible.
He can't find an easy solution to synchronise actively with Hikashop.

So when a user put a product in his basked it needs to be on hold on the filemaker.
When it is sold it need to synchronise the to filemaker
If it is sold in the stone store or any other place in filemaker it is checked as sold or 1 in stock less the webshop needs to know directly so it is not possible to buy.
Most products are just unique so no stock disappear (i know that is possible).


Does Hikashop has an API or/and Webhook to do stuff like this?
Is there a good documentation for an Api for this?
Do you guys know if there are users with filemaker?

Thanks already!

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
5 years 5 months ago #298711

Hi,

HikaShop has an API for developers here:
www.hikashop.com/support/documentation/6...r-documentation.html
By developing a plugin of the group "system" you could do what you want.
First, when someone adds something to the cart, you can implement the trigger onAfterCartSave(&$element) so that you can connect to the webhook, rest API or whatever filemaker has, to update the status of the products in $element->cart_products which contains the list of all the products in the cart and their new quantity (because the quantity can be changed, the product can be removed from the cart, etc).
Second, when someone places a order you can similarily implement the trigger onAfterOrderCreate or onAfterOrderUpdate to update the products stock of filemaker with $order->products
And finally, you can implement the trigger onAfterRoute() in your plugin and check the parameters given (so you can have filemaker pass a specific parameter so that the plugin can catch it and get the data of the stock being updated). Then, you can initialize the hikashop main helper and use such code to update the stock of the product:

include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikashop'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php');
$product = new stdClass();
$product->product_id = $id_of_the_product;
$product->product_quantity = $new_stock_of_the_product;
$productClass = hikashop_get('class.product');
$productClass->save($product);
If the developer knows PHP, and has access to the filemaker integration documentation it shouldn't be a problem to develop such plugin.

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

  • Posts: 1
  • Thank you received: 0
4 years 10 months ago #306239

I am connecting a Filemaker Database via an OBDC connection to the mySQL tables. I am keeping the inventory quantities in the HikaShop database and running reports with Filemaker. I need to run reports monthly calculating the products sold that month by how may contributors created the product.

In the HikaShop_Order table, there are three date fields. The order_modified is 1556484771. Within HikaShop, the Order Modification date is 2019 04 27 16:52

How do I interpret the 1556484771 do a date (4/27/2019)?

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
4 years 10 months ago #306266

Hi,

The dates stored in the database are stored with the unix timestamp format:
www.unixtimestamp.com/
You can convert a timestamp to a date with the PHP date function ( www.php.net/manual/en/function.date.php ) or the from_unixtime MySQL function ( dev.mysql.com/doc/refman/8.0/en/date-and...nction_from-unixtime )

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

Time to create page: 0.069 seconds
Powered by Kunena Forum