Advertisement
Guest User

item_alter

a guest
Feb 8th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. function edost_calculate_uc_line_item_alter(&$item, $order) {
  2.   $mid = db_query("select mid from {uc_flatrate_methods} where title=:title", array(':title'=> $item['title']))->fetchField();
  3.   // dsm($mid, 'db_query result');
  4.   if (!$mid) {
  5.     return;
  6.   }
  7.   if ($order->payment_method == 'qiwi' || $order->payment_method == 'uc_onpay') {
  8.     if ($mid == 4) {
  9.       $item['amount'] = 300;
  10.     }
  11.     else if ($mid == 5) {
  12.       $item['amount'] = 350;
  13.     }
  14.     else if ($mid == 7) {
  15.       $item['amount'] = 500;
  16.     }
  17.     else if ($mid == 8) {
  18.       $item['amount'] = 700;
  19.     }
  20.   }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement