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.
Fix Drupal 6 menu urls on test server
Drupal 6 - is node_submit() needed when saving node?
Apache Solr : Filter results by minimum relevancy in drupal 6.x
How can I add the tracking number to the message the users receive?
How can I get the term id after using taxonomy_save_term?
Why can't my user access a certain page?
jqModal popup does not opens
Access alias of a node programatically using Drupal 6
When variable_get() can be used while variable_set() has not been used?
How can I redirect users to login page and then add item to wishlist?
How to change Ubercart status messages in Drupal?
How do you add Fedex SmartPost as a shipping option?
Group Checkboxes in webform in drupal
Drupal 6 - How can I disable comments on all nodes / content_types?
Webservice creation in Drupal 6.22
Authorize.net returning multiple deliminators