News:

Looking for documentation? Take a look on our wiki

Main Menu

different prices, like unitPrice or product_override_price are not shown

Started by ptrouw, April 20, 2016, 15:58:27 PM

Previous topic - Next topic

ptrouw

I have enabled to show all prices within back-end configuration. I have added code to product detail page, but only salesPrice and taxAmount are shown. All other Pricing fields are empty.
I made a copy of prices.php in my own sublayouts, had a look a the code, I added some echo statement, and again only salesPrice and taxAmount are shown.
If I use a discount calculation rule, it shows the correct salesPrice, so I tried override price as well, but still only salesPrice shown. No other Prices!
What do I do wrong? Any thought?

I am using 3.0.16 en J3.5.1

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

ptrouw

Yes I am using a commercial template, but also disabled all override, renaming /html
And tried another "free" VM template, same results.
I tried just now the code from Max below, but only product_price, product_override_price and override are is show. Are these the only one available? Should I calculate the other prices, from these two?

<?php         
   $usermodel = VmModel::getModel ('user');
   $currentVMuser = $usermodel->getCurrentUser ();
   if(!is_array($currentVMuser->shopper_groups)){
      $virtuemart_shoppergroup_ids = (array)$currentVMuser->shopper_groups;
   } else {
      $virtuemart_shoppergroup_ids = $currentVMuser->shopper_groups;
   }
   $allPrices = VmModel::getModel('product')->loadProductPrices($this->product->virtuemart_product_id, 0,$virtuemart_shoppergroup_ids,true);

   array_reverse($allPrices);

   echo '<table>';
   foreach($allPrices as $prices){
      echo '<tr>';
      echo '<td> '.$this->currency->priceDisplay($prices['override'])  .'</td>';
      echo '<td> '.$this->currency->priceDisplay($prices['product_override_price'])  .'</td>';
      echo '<td> '.$this->currency->priceDisplay($prices['unitPrice'])  .'</td>';
      echo '<td> '.$this->currency->priceDisplay($prices['salesPriceWithDiscount'])  .'</td>';
      echo '<td> '.$this->currency->priceDisplay($prices['salesPrice'])  .'</td>';
      echo '<td> '.$this->currency->priceDisplay($prices['basePrice'])  .'</td>';
      echo '<td> '.$this->currency->priceDisplay($prices['discountAmount'])  .'</td>';
      echo '<td> '.$this->currency->priceDisplay($prices['product_price'])  .'</td>';
      echo '</tr>';
   }
   echo '</table>';
?>