Ubercart 2.x - Add produkt line to order via php
I'm trying to add a product to an ubercart order in Drupal 6, for a "free gift for recurring customer". I have already integrated it with ubercart's conditional actions, and that works fine. What I am struggleing with, is adding the product to the order. I'm able to add the produkt to the cart, using: uc_cart_add_item($settings[ 'gift_product'], $settings['gift_product_quantity'] ); To avoid fraud, and the customer not just clicking back and change the quantity of the free product, I would like to add it after checkout, so the line will apear on the order confirmation, and when packing the order. (If there is a better way to achieve this, please enlighten me) The following code, does not add a product line, but a "charge", but it's the closest I have gotten: uc_order_line_item_add($order->order_id, $settings[ 'gift_product' ], $product->title, $settings[ 'gift_product_quantity']); As a side thing, I would like to know, if it's possible, and then how, to set the price, on the added product line, or add a 100% discount to that one order line. I've been searching for a solution for this, for the most of a week, but I can't seem to find the right solution. Thank you in advance.
I was unable to find any modules doing this, so I ended up making my own. The ubercart cart bonus module, was a great inspiration regarding a possible way to do this: http://drupalmodules.com/module/ubercart-cart-bonus I did not change the order, but only the cart, and then made the necessary checks to try and prevent fraud.
how can i see object data returned by node_load() method in Drupal?
drupal_get_form : Manual call to render a form isn't working
Query in Override of node.tpl
Design a site in drupal: General Overview
use drupal hook_nodeapi
Creating a CCK record in a MySQL database
Aggregate various feeds and display them as blog entries?
hook_menu giving 404
Drupal 6 backport of Drupal 7 admin-bar and overlay?
Adding extra multiple fields in Drupal(6.19) comment form
How to modify the HTML tag in Drupal 6?
working with forms and ajax in drupal 6
How to do form validation in drupal?
Drupal: Problem with installing Drupal6
How to conditionally hide a field in a drupal view?
toggle between views in drupal