This "Show calculated price" (calculation) setting has TRUE value so the setting change won't matter.

Comments

vasike’s picture

Title: Calculation settings for Price with Prefix / Suffix won't change » Calculation setting for Price with Prefix / Suffix won't change
Status: Active » Needs review
StatusFileSize
new612 bytes

here is patch that deletes the value for the checkbox, si it can be changed.

ikos’s picture

Status: Needs review » Fixed

Thanks for reporting! Committed to latest dev.

Status: Fixed » Closed (fixed)

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

joerch’s picture

Hi!

I tested the 7.x-1.1+7-dev but it's not working here. Not calculating discount and tax.

heyyo’s picture

not working also for multicurrency. It displays default currency even if "Show calculated price" enabled.

heyyo’s picture

Status: Closed (fixed) » Active
phily’s picture

Hi,
It's not working here neither: it always shows calculated price (inc. VAT) whatever the state of the checkbox.
The website I'm designing needs to display prices excluding VAT if products pages, cart block/form even if the checkout process includes it.

Thanks for any help.

tajindersingh’s picture

This doesn't work at all. 'Show calculated price' marked for 'Price with Prefix / Suffix' doesn't take affect ever.
Similar thing (the one removed in patch) exists for other two formatters in this module i.e. '#value' => TRUE

It seems the values are not getting saved or are if they are then the saved values don't have any effect on the prices displayed.

This field should better be replaced with below, for all of the filters:

// Get all the price calculation options.
  $options = module_invoke_all('commerce_price_field_calculation_options', $field, $instance, $view_mode);

  if (empty($options)) {
    $element['calculation'] = array(
      '#type' => 'value',
      '#value' => FALSE,
    );

    $element['help'] = array(
      '#markup' => '<p>' . t('No configuration is necessary. The original price will be displayed as loaded.') . '</p>',
    );
  }
  else {
    // Add the option to display the original price; unshifting will give it a
    // key of 0 which will equate to FALSE with an Equal operator.
    array_unshift($options, t('Display the original price as loaded.'));

    $element['calculation'] = array(
      '#type' => 'radios',
      '#options' => $options,
      '#default_value' => empty($settings['calculation']) ? '0' : $settings['calculation'],
    );
  }
tajindersingh’s picture

Priority: Normal » Major
Issue summary: View changes

Updating priority as this bug makes the module unusable.

anybody’s picture

Still no change here? Is there an active maintainer?

anybody’s picture

The patch works great for me, the value is being saved correctly (@ #8 I think you forgot to save the whole form after setting the value in the subform).

Anyway from the code perspective the patch is correct, but the logic should be applied to ALL formatters provided by this module. The patch only solves the problem for "commerce_price_prefix_suffix".

Furthermore this kind of code bug requires a new STABLE release from my point of view.