Get Current Stock via PHP

Discuss the webshop here.

Moderator: Developers

flo
Posts: 87
Joined: Mon Jan 26, 2009 11:49 am

Get Current Stock via PHP

Postby flo » Fri Feb 11, 2011 1:16 pm

Are there any special api's for communicating with the billing module? Like getting the current stock of a product in the catalog displayed on an external website via php. Or do I just use my own mysql selects?
flo
Posts: 87
Joined: Mon Jan 26, 2009 11:49 am

Re: Get Current Stock via PHP

Postby flo » Sat Feb 12, 2011 10:43 am

I use this code on my wordpress page to get the current stock of my products:

Code: Select all

SELECT DISTINCT bs_products.id, bs_products.stock, bs_product_languages.name  ".
 "FROM bs_products, bs_product_languages ".   
    "WHERE bs_products.id = bs_product_languages.product_id AND product_id IN ($customField[0])".
    "ORDER BY bs_product_languages.name


I use custom fields in my wordpress setup, where I define wich product belongs to wich wordpress site, if someone needs the full code, leave a reply.
User avatar
WilmarVB
Group-Office Developer
Group-Office Developer
Posts: 86
Joined: Mon May 10, 2010 3:47 pm
Location: Den Bosch, Netherlands
Contact:

Re: Get Current Stock via PHP

Postby WilmarVB » Wed Jul 27, 2011 2:40 pm

Hello Flo,

An API for the billing module is not open to the public. However, we recommend wrapping the queries inside functions just like it happens in the open source modules.
Kind regards,
WilmarVB
Intermesh
valeria
Posts: 14
Joined: Wed Jan 30, 2013 9:36 am
Contact:

Re: Get Current Stock via PHP

Postby valeria » Tue Mar 05, 2013 11:11 am

Thanks for the update Flo.
Abbysam007
Posts: 1
Joined: Sat Dec 14, 2013 10:49 am

Re: Get Current Stock via PHP

Postby Abbysam007 » Sat Dec 14, 2013 10:50 am

I need a heading for this info, and this text would always be displayed even if the custom field is not filled out, how could I display text on the invoice, only if the custom field is filled out?
***UsEr***
mschering
Site Admin
Site Admin
Posts: 8154
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Get Current Stock via PHP

Postby mschering » Mon Dec 16, 2013 8:09 am

You can only do this by customizing the PDF script:

https://www.group-office.com/wiki/Billi ... PDF_script
Best regards,

Merijn Schering
Intermesh

Return to “Webshop products”

Who is online

Users browsing this forum: No registered users and 1 guest

cron