We have purchased and installed the Business version of HikaShop, and I have set up a custom field. Do you have an example of how I can set this programmatically?
My plugin is hooking into the Koparent extension as it completes a reservation. The config page for the plugin allows the admin to designate on which Hikashop product id it should act ($this->_hikapid, after initialization).
As my plugin is loaded, I instantiate the cart like this:
$this->_hikacart = hikashop_get('class.cart');
$this->_hikacart->loadCart();
$this->_hikacartitems = $this->_hikacart->get();
As the user completes the reservation form, Koparent's save event fires (onContentAfterSave, with a particular context for reservations). My plugin attempts to add an item to the current session's cart like this:
$this->_hikacart->update($this->_hikapid,1)
This works fine, and adds the product to the cart, but additional saves do not appear as additional line items - all cart items of product id "X" are aggregated into a single line item. I do not see any access to the custom fields through hikashopCartClass::update(). I see where it *may* be possible in hikashopCartClass::updateEntry(), but I'm unsure of the structure of the parameters needed for that method.
Can you provide any further guidance? My end goals are to 1) have each reservation be handled as a separate line item in Hikashop, and 2) have Hikashop use the price determined by Koparent.