VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: bcohen0 on July 29, 2017, 01:24:12 AM

Title: VmConfig setting 'checkout_show_origprice' ?
Post by: bcohen0 on July 29, 2017, 01:24:12 AM
Virtuemart 3.2.2:

I am finding that for my purposes, I would like to be able to set the configuration item 'checkout_show_origprice' to false. Is this setting surfaced anywhere?

It appears in file components/com_virtuemart/views/cart/tmpl/default_pricelist.php  on line 100:

   <td class="vm-cart-item-total">
      <?php
      if (VmConfig::get ('checkout_show_origprice', 1) && !empty($prow->prices['basePriceWithTax']) && $prow->prices['basePriceWithTax'] != $prow->prices['salesPrice']) {
         echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceWithTax', '', $prow->prices, TRUE, FALSE, $prow->quantity) . '</span><br />';
      }
      elseif (VmConfig::get ('checkout_show_origprice', 1) && empty($prow->prices['basePriceWithTax']) && !empty($prow->prices['basePriceVariant']) && $prow->prices['basePriceVariant'] != $prow->prices['salesPrice']) {
         echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $prow->prices, TRUE, FALSE, $prow->quantity) . '</span><br />';
      }
      echo $this->currencyDisplay->createPriceDiv ('salesPrice', '', $prow->prices, FALSE, FALSE, $prow->quantity) ?></td>
Title: Re: VmConfig setting 'checkout_show_origprice' ?
Post by: Milbo on July 29, 2017, 21:19:25 PM
We should create one, but maybe as parameter of the view. In general, when you find a vmconfig::get without GUI, then it is so called hidden config.  https://docs.virtuemart.net/manual/general-concepts/206-hidden-configurations.html
Title: Re: VmConfig setting 'checkout_show_origprice' ?
Post by: bcohen0 on August 14, 2017, 23:59:22 PM
Thank you for that!