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
Comment #1
Jack_S CreditAttribution: Jack_S commentedComment #2
TR CreditAttribution: TR commentedI'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.
Comment #3
TR CreditAttribution: TR commented