I admit to being a Commerce -novice-. It's getting better, but it's still quite confusing in some spots. I've posted several questions here over the past year trying to skin the same cat in different ways. We have a Drupal 7 cart. The pricing is pulled in from an external web site via http_request which updates the unit price of all items in the cart on hook_form_alter().
The problem is that the -initial- price that displays in the cart is always 0. The user always has hit to refresh the page for that pricing to update the View. Commerce seems to want to pull the unit price in from the Product nodes so after a user hits the cart displays but with a 0 unit price. When they hit -then- our code fires and updates the price.
So... I need is either: a) a way to force that view to 'refresh' when the page is rendered (ie. it initially loads with the zero prices, runs the http_request code and -then- renders again). Yeah, it's ugly but I'm just sick of this.
b) Figure out a way using the Rules (which I haven't been able to do) to get the line item price to pull in from the http_request with PHP. This -never- seems to work. It -always- wants to use a rule based on an existing field. If someone could give me a tutorial on how to use PHP with Commerce for the Unit Price I'd buy them a CASE of virtual beer!
c) Figure out a way to assign that http_request price as the line item price when the user hits the 'Add' button. Again, probably a noob thing, but I cannot figure out how to override the Unit Price for the Line Item to the value I want. It -always- wants to use the Unit Price from the Product node.
ANY help would be most appreciated!