Author Topic: helpers\calculationh.php on line 1214  (Read 1564 times)

Marquis2000

  • Beginner
  • *
  • Posts: 3
  • A beginner
helpers\calculationh.php on line 1214
« on: November 01, 2020, 10:37:46 am »
Hi Guys,

i have a error in pricing configuration. but i dont know what this ist. Has Anyone same Problem?

Warning: Creating default object from empty value in .....\administrator\components\com_virtuemart\helpers\calculationh.php on line 1214

in this line stay:

      $price = $baseprice;
      $finalprice = $baseprice;
      if (isset($rulesEffSorted)) {

         foreach ($rulesEffSorted as $rule) {

            if(isset($rule['subTotal'])){
               $cIn = $rule['subTotal'];
            }
            else if ($relateToBaseAmount) {
               $cIn = $baseprice;
            } else {
               $cIn = $price;
            }

            $cOut = $this->interpreteMathOp($rule, $cIn);
            $tmp = $this->roundInternal($this->roundInternal($cOut) - $cIn);

            if($setCartPrices){
               $this->_cart->cartPrices[$rule['virtuemart_calc_id'] . 'Diff'] = $tmp;
            }
            //okey, this is a bit flawless logic, but should work
            if ($relateToBaseAmount) {
               $finalprice = $finalprice + $tmp;
            } else {
               $price = $cOut;
            }
         }
      }

      //okey done with it
      if (!$relateToBaseAmount) {
         $finalprice = $price;
      }

      return $finalprice;
   }

Can anyone help?

Greatings Norman

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3853
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: helpers\calculationh.php on line 1214
« Reply #1 on: November 01, 2020, 11:35:47 am »
Probably a PHP upgrade error. You för not tell much of yout Joomla, PHP, VM versions...

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

sirius

  • Jr. Member
  • **
  • Posts: 158
    • OCTeam
  • VirtueMart Version: 3.8.6
Re: helpers\calculationh.php on line 1214
« Reply #2 on: February 02, 2022, 09:38:43 am »
Hi
I assume this is now fixed
like so :
Code: [Select]
if($setCartPrices and isset($this->_cart->cartPrices)){
$this->_cart->cartPrices[$rule['virtuemart_calc_id'] . 'Diff'] = $tmp;
}
J3.10.8 | PHP 7.4.28 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 3.8.9.10622