0

I have products with a few options.

  • Option 1: Same price.
  • Option 2: -50 cent ($9.50).
  • Option 3: -$1 ($9).

Can I change the display so that it looks like this?

  • Option 1:
  • Option 2: ($0.50 off)
  • Option 2: ($1.00 off)
1

In uc_attribute.module file comment out from line number 1360 (starts at if ($adjustment != 0) {) to 1363 and add the bellow code

if ($adjustment != 0) {
    //$display_price = $adjustment > 0 ? '+' : '-';

    //this variable is used to flag your custom discount on minus values 
    $set_discount = false;

    if($adjustment > 0){
        $display_price = '+';
    }else{
        $display_price = '(';
        $set_discount = true;
    }
    if($set_discount){
        $display_price .= uc_currency_format(abs($adjustment)). ' off)';
    }else{
        $display_price .= uc_currency_format(abs($adjustment));
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.