Hello, I am using Drupal 7 and Ubercart 7.x in combination with the Ubercart Auction module.

I am trying to overide the cart sell price with the price of the highest bid to correct a problem with the auction modules implementation of hook_uc_cart_alter.

I have added a module as follows:

/**
* Implements uc_cart_alter.
*/
function mymodule_uc_cart_alter(&$items ) {

foreach ($items as $index => $item) {

//you can add condition for your bid product

$items[$index]->price = 100;
}
}

And a corresponding info file. The module installs fine however it does not change the price on the add to cart to the higest bid. Where am i going wrong with this hook?

Many thanks, Jack

Comments

Jack_S’s picture

Issue summary: View changes
TR’s picture

Assigned: Jack_S » Unassigned
Issue tags: -hook_uc_cart_alter

I'm assuming you've verified that your hook is being called ... If so then perhaps the problem is that it's being called before the uc_auction hook, so uc_auction is overriding what you're doing. To correct that, you can set the weight of your module so that your hook runs last. The module's weight is stored in the {system} table. You can alter that weight in the DB to test to see if that's the problem.

TR’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.