How To Force Commerce Cart View To Update (Ajax?)
Implement a custom rules action and wire it to rules event Calculating the sell price of a product. The sell price of a line item can be forced to any value using the action Set the unit price to a specific amount. The missing piece is a custom rule action capable of retrieving the amount. As a starting point I propose the following (assuming the custom module is named acme):

/**
 * Implements hook_rules_action_info().
 */
function acme_rules_action_info() {
  return array(
    'acme_random_amount' =&gt; array(
      'label' =&gt; t('Generate random price (with params!)'),
      'group' =&gt; t('Examples'),
      'parameter' =&gt; array(
        'product_id' =&gt; array(
          'type' =&gt; 'text',
          'label' =&gt; t('Product SKU'),
          'description' =&gt; t('The SKU of a product.'),
        ),
        'account' =&gt; array(
          'type' =&gt; 'user',
          'label' =&gt; t('User'),
          'description' =&gt; t('A user account.'),
        ),
      ),
      'provides' =&gt; array(
        'amount' =&gt; array(
          'type' =&gt; 'decimal',
          'label' =&gt; t('Amount'),
          'description' =&gt; 'Return a random numeric amount, except for admin.',
        ),
      ),
    ),
  );
}

/**
 * Rules action: Generate and return random amount of money.
 */
function acme_random_amount($product_id, $account) {
  $amount = mt_rand(100, 1000);

  // Fix price for admin.
  if ($account &amp;&amp; $account-&gt;uid == 1) {
    $amount = 420;
  }

  // Blue sells, let's boost the revenue.
  if (strpos($product_id, 'BLU') !== FALSE) {
    $amount *= 100;
  }

  return array(
    'amount' =&gt; $amount,
  );
}


The rule then looks something like this:

{ "rules_pick_random_price" : {
    "LABEL" : "Pick random price",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "acme", "commerce_line_item", "commerce_product_reference" ],
    "ON" : [ "commerce_product_calculate_sell_price" ],
    "IF" : [
      { "entity_has_field" : { "entity" : [ "commerce-line-item" ], "field" : "commerce_product" } }
    ],
    "DO" : [
      { "acme_random_amount" : {
          "USING" : {
            "product_id" : [ "commerce-line-item:commerce-product:sku" ],
            "account" : [ "commerce-line-item:order:owner" ]
          },
          "PROVIDE" : { "amount" : { "amount" : "Amount" } }
        }
      },
      { "commerce_line_item_unit_price_amount" : {
          "commerce_line_item" : [ "commerce_line_item" ],
          "amount" : [ "amount" ],
          "component_name" : "base_price",
          "round_mode" : "0"
        }
      },
      { "drupal_message" : { "message" : "Set the price of [commerce-line-item:commerce-product:sku] to amount: [amount:value] for user [commerce-line-item:order:owner:name]" } }
    ]
  }
}


Note that in order to get at the product SKU, it is necessary to introduce a condition Entity has field checking for the presence of the commerce_product field on the commerce-line-item variable.

Please keep in mind that this rule will be executed on every page request for every item in the cart. Additionally it is executed whenever an add-to-cart form is displayed. If this is on a high traffic site, you probably need to think about an appropriate caching strategy.