Topic: API for Direct Invoice

I am writing an extension on the Simple API to add "Add Direct Invoice" possibility. I want to call this from the Virtuemart webshop.

According to forum link I have the following code:

include_once($path_to_root . "/sales/includes/cart_class.inc");
// Create cart object
$_SESSION['Items'] = new cart(ST_SALESINVOICE, 0 );

// add customer
$br = get_branch(4); // Use a general customer with id=4
$_POST['customer_id'] = $br['debtor_no'];
$Ajax->activate('customer_id');

// Add items to cart
add_to_order($_SESSION['Items'], '000001', 1, 12, 0, '' );

But no items are added to the card.

Any tips to solve this?

Re: API for Direct Invoice

You have to '000001' item defined first.
Janusz

Re: API for Direct Invoice

itronics wrote:

You have to '000001' item defined first.
Janusz

Hi Janusz,

It is defined.