drupal - Programatically change price to Ubercart item when added to cart -


i have built javascript app provides custom configuration product. js app submit relevant data drupal module i've prepared. purpose of module validate input , submit details ubercart system.

i need submit custom price based on items chosen module when custom build submitted module. have looked @ uc_variable_price, uc_custom_price , hook_add_to_cart i'm not seeing way add custom price programmatically.

/** * implements hook_cart_item(). */ function module_cart_item($op, &$item) { switch ($op) { case 'load': $order = db_result( db_query("select price_total {module_orders} id = %d", $id) ); if (!empty($order)) { $item->price = $order; } break; } } 

check logic


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -