Hello,

Seems the problem has been encountered by others in thread #1864786.
It's not possible to show a calculated price when suffix and prefix is enabled in display.

Thanks for this great module !

CommentFileSizeAuthor
#1 QQ20130806-26.png13.3 KBrogical

Comments

rogical’s picture

Title: No calculated prices with suffix/prefix » Show calculated price doesn't work with suffix/prefix
StatusFileSize
new13.3 KB

same issue here, I have to use 'formated amount' which works with calculated price

asd

T.Mardi’s picture

Thanks for this great module. I also need to be able to show a calculated price for use with prefix / suffix.

Is there currently a solution?

Thanks.

famishedroad’s picture

+1 for this. The check box always reverts to ticked. I need to be able to show the price ex VAT.

macman911’s picture

Anyway news on this issue? I need to be able to show a sale price.

macman911’s picture

Any progress on this issue?

-Mania-’s picture

Issue summary: View changes

Sigh, the only reason I downloaded the module was to get a "+ GST" to my prices and it doesn't even work because the checkbox isn't functioning.

-Mania-’s picture

FYI if you remove line number 106 ('#value' => TRUE,) it will work and let you change the checkbox value. All the other checkboxes on the page have the same problem.

anybody’s picture

Same problem here. It still exists.

anybody’s picture

Is this module still maintained? The bug is major but nothing happened. :(

selinav’s picture

Same problem since 5 years...

selinav’s picture

I've the same problem with the cart view.

I have commented the line number 106 ('#value' => TRUE,). I can display the price without VAT on my product page but on the cart view, the checkbox isn't checked but the price displayed is ever the calculated price.
How to correct this ?

selinav’s picture

I've found the solution for the view.

function commerce_extra_price_formatters_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
...
		case 'commerce_price_prefix_suffix':
	//add this to get value of the calculation checkbox
	$settings = $display['settings'];
			
        
	$markup = '';
         $text_format = empty($display['settings']['text_format']) ? NULL : $display['settings']['text_format'];
		
							
          if (!empty($display['settings']['prefix'])) {
            $markup .= '<span class="price_prefix">' . check_markup($display['settings']['prefix'], $text_format) . '</span> ';
          }

	// test if calculation checkbox is checked
	 if ($settings['calculation'] == TRUE) {
		// display with tax
          	$markup .= commerce_currency_format($item['amount'], $item['currency_code'], $entity);
	  } else {
		//display without tax
                if(isset($item['data']['components'][0])){
	 	    $markup .= commerce_currency_format( $item['data']['components'][0]['price']['amount'], $item['currency_code'], $entity);
               }
	  }
		
          if (!empty($display['settings']['suffix'])) {
            $markup .= ' <span class="price_suffix">' . check_markup($display['settings']['suffix'], $text_format) . '</span>';
          }

          $element[$delta] = array(
            '#markup' => $markup,
          );
...

Please add this for the next release.