Display product price

Rate this topic: Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.3.50 out of 6 based on 2 vote(s)
GK User
Thu Jun 11, 2015 9:51 am
Reply with quote
Report this post
Hello

I can't display prices in product list page. When I enter to details page, I can see the price normally, but I can't see it in products list...

http://ag-25.com/productos/camisetas
This is the product list page where I need to display the product price

http://ag-25.com/productos/banner/camis ... us-detalle
This is the detail page where the price is displaying normally

Please, can you say me how can I fix this problem ?

Thank you very much !!
User avatar
Fresh Boarder

teitbite
Thu Jun 11, 2015 11:29 am
Reply with quote
Report this post
Hi

Please check if You have tax set in Virtuemart configuration. If You do not have one create a tax of 0% and include in products. Virtuemart is using "priceWithTax" to display here and if tax is not configured this price is always a default 0.

If this will not fix the problem please send me an access to ftp.
User avatar
Moderator

GK User
Thu Jun 11, 2015 12:09 pm
Reply with quote
Report this post
Hello

Thank's for your reply !! Please, can you say me how can I create a Tax 0 ?

Thank you very much !!
User avatar
Fresh Boarder

teitbite
Sun Jun 14, 2015 10:09 am
Reply with quote
Report this post
Hi

I'm sure it's in VM documentation :) I'm not VM expert, but I guess You need to go to Tax and Discount section and just click add new. Than when You will configure it just select it for all products or in category settings.
User avatar
Moderator

GK User
Sun Jun 14, 2015 12:39 pm
Reply with quote
Report this post
Hi.

I create a tax 0% and don't work :(
Please, can you post here in wich file I can find "priceWithTax" for change this value ?¿

Can be useful for the rest of the users

Thank you very much
Best regards :)
User avatar
Fresh Boarder

teitbite
Tue Jun 16, 2015 8:34 pm
Reply with quote
Report this post
Hi

Look in /html/com_virtuemart/category/default.php

Start from renaming this file to _default.php to test if pure VM will display the price ok.
User avatar
Moderator

GK User
Wed Jun 17, 2015 11:55 pm
Reply with quote
Report this post
SOLVED !!!

In this location:
/html/com_virtuemart/category/default.php
From Line. 197 to 209

Remove the comment and PHP tags

Code: Select all
/* REMOVE THE COMMENT AND PHP TAGS IF YOU NEED TO

DISPLAY PRICES ON THE CATEGORY LISTING
               <div

class="catProductPrice" id="productPrice<?php echo

$product->virtuemart_product_id ?>">
                  <?php
                  if

($this->show_prices == '1') {
                     

if ($product->prices['salesPrice']<=0 and VmConfig::get

('askprice', 1) and  !$product->images[0]-

>file_is_downloadable) {
                     

   echo JText::_

('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                     

}
                     

echo $this->currency->createPriceDiv ('salesPrice',

'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
                  } ?>
               </div>
               */


Thank you very much :)
User avatar
Fresh Boarder

GK User
Sun Sep 20, 2015 4:23 am
Reply with quote
Report this post
I actually have followed all the steps and have VAT set but the price still does not show up, if I rename default, the price does show up, could anyone help? The web address: www.youmatt.me Thanks
User avatar
Fresh Boarder

teitbite
Sun Sep 20, 2015 1:07 pm
Reply with quote
Report this post
Hi

Doesn't look like the code was uncommented. If it was there would be "catProductPrice" label visible in source of Your site. Please check one more time file /html/com_virtuemart/category/default.php and make sure no cache is running preventing this file to be updated in site.
User avatar
Moderator

GK User
Thu Sep 24, 2015 3:58 pm
Reply with quote
Report this post
Hello,

thanks for the reply, I thought I am supposed to delete the relevant rows not to uncomment any section of the code? I have no cache applied. I inputted the default.php, could you have a look if I applied the changes to the code in a right way? Otherwise it would certainly appear with the prices on the webpage. Here is the code:

Code: Select all
<?php
/**
*
* Show the products in a category
*
* @package   VirtueMart
* @subpackage
* @author RolandD
* @author Max Milbers
* @todo add pagination
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified paursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: default.php 5120 2011-12-18 18:29:26Z electrocity $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

/* javascript for list Slide
  Only here for the order list
  can be changed by the template maker */
$js = "jQuery(document).ready(function () {
   jQuery('.orderlistcontainer').hover(
      function() { jQuery(this).find('.orderlist').stop().show()},
      function() { jQuery(this).find('.orderlist').stop().hide()}
   )
});";

$document = JFactory::getDocument();
$document->addScriptDeclaration($js);
//var_dump($this->category);
?>

<?php
/* Show child categories */
if ( VmConfig::get('showCategory',1) and empty($this->keyword)) {
      if (!empty($this->category->haschildren)) {
      // Category and Columns Counter
      $iCol = 1;
      $iCategory = 1;
      // Calculating Categories Per Row
      $categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
      $category_cellwidth = ' width'.floor ( 100 / $categories_per_row );
      $BrowseTotalProducts = count($this->products);
      // Separator
      $verticalseparator = " vertical-separator";
   ?>
   <div class="category-view">
      <?php // Start the Output
      if(!empty($this->category->children)) {
      foreach ( $this->category->children as $category ) { ?>
      <?php if ($iCol == 1 && $iCategory > $categories_per_row) : ?>
      <div class="horizontal-separator"></div>
      <?php endif; ?>
      
      <?php if ($iCol == 1) : ?>
      <div class="row">
      <?php endif; ?>
            <?php
         // Show the vertical seperator
         if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
            $show_vertical_separator = ' ';
         } else {
            $show_vertical_separator = $verticalseparator;
         }

         // Category Link
         $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

            // Show Category ?>
            <div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
               <div class="spacer">
                  <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>"><?php echo $category->images[0]->displayMediaThumb("",false); ?></a>
                  
                  <h2 class="catSub"> <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>"> <?php echo $category->category_name ?> </a> </h2>
               </div>
            </div>
            <?php
         $iCategory ++;

      // Do we need to close the current row now?
      if ($iCol == $categories_per_row) { ?>
            <div class="clear"></div>
      </div>
      <?php
         $iCol = 1;
      } else {
         $iCol ++;
      }
   }
   }
   // Do we need a final closing row tag?
   if ($iCol != 1) { ?>
      <div class="clear"></div>
</div>
<?php } ?>
</div>
<?php }
}

?>

<div class="browse-view">
<?php
   // Show child categories
   if (!empty($this->products)) {
      if (!empty($this->keyword)) {
         ?>
   <h1><?php echo $this->keyword; ?></h1>
   <?php
      }
      ?>
   <?php // Category and Columns Counter
   $iBrowseCol = 1;
   $iBrowseProduct = 1;
   
   // Calculating Products Per Row
   $BrowseProducts_per_row = $this->perRow;
   $Browsecellwidth = ' width'.floor ( 100 / $BrowseProducts_per_row );
   
   // Separator
   $verticalseparator = " vertical-separator";
?>

      <?php if(!empty($this->category->category_name)) : ?>
      <h1><?php echo $this->category->category_name; ?></h1>
      <?php endif; ?>
      
      <?php if (empty($this->keyword) && !empty($this->category) && !empty($this->category->category_description)) : ?>
      <p class="category_description">
         <?php echo $this->category->category_description; ?>
      </p>
      <?php endif; ?>
      
      <form action="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=category&limitstart=0&virtuemart_category_id=' . $this->category->virtuemart_category_id, FALSE); ?>" method="get">
            <?php if (!empty($this->products)) : ?>
            <div class="orderby-displaynumber"><?php echo $this->orderByList['orderby']; ?>
                  <div class="display-number"><?php echo $this->vmPagination->getResultsCounter();?> <?php echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>
                  
            </div>
            <?php endif ?>
            
            <?php if (!empty($this->keyword)) {
            
            $category_id  = JRequest::getInt ('virtuemart_category_id', 0); ?>
            <!--BEGIN Search Box -->
            <!--<div class="virtuemart_search"> <?php echo $this->searchcustom ?> <br />
                  <?php echo $this->searchcustomvalues ?>
                  <input style="height:16px;vertical-align :middle;" name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>" />
                  <input type="submit" value="<?php echo JText::_('COM_VIRTUEMART_SEARCH') ?>" class="button" onclick="this.form.keyword.focus();"/>
            </div>
            <input type="hidden" name="search" value="true" />
            <input type="hidden" name="view" value="category" />
            <input type="hidden" name="option" value="com_virtuemart"/>
            <input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/>-->
            <!-- End Search Box -->
            <?php } ?>
      </form>
      <?php // Start the Output
foreach ( $this->products as $product ) {

   // Show the horizontal seperator
   if ($iBrowseCol == 1 && $iBrowseProduct > $BrowseProducts_per_row) { ?>
      <div class="horizontal-separator"></div>
      <?php }

   // this is an indicator wether a row needs to be opened or not
   if ($iBrowseCol == 1) { ?>
      <div class="row">
            <?php }

   // Show the vertical seperator
   if ($iBrowseProduct == $BrowseProducts_per_row or $iBrowseProduct % $BrowseProducts_per_row == 0) {
      $show_vertical_separator = ' ';
   } else {
      $show_vertical_separator = $verticalseparator;
   }
      // Show Products ?>
      <div class="product floatleft<?php echo $Browsecellwidth . $show_vertical_separator ?>">
         <div class="spacer">
            <div>
               <a title="<?php echo $product->product_name ?>" href="<?php echo $product->link; ?>">
                  <?php
                     echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false);
                  ?>
                </a>
            </div>
            
            <div>
               <h3 class="catProductTitle"><?php echo JHTML::link($product->link, $product->product_name); ?></h3>
               
               
               <?php if ( VmConfig::get ('display_stock', 1)) : ?>
               <div class="stockLavel"> <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span> <span class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span> </div>
               <?php endif; ?>
            </div>
            
            <a href="<?php echo $product->link; ?>" class="readon"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'); ?></a>
         </div>
      </div>
   <?php

   // Do we need to close the current row now?
   if ($iBrowseCol == $BrowseProducts_per_row || (isset($BrowseTotalProducts) && $iBrowseProduct == $BrowseTotalProducts)) {?>
      </div>
      <?php
      $iBrowseCol = 1;
   } else {
      $iBrowseCol ++;
   }

   $iBrowseProduct ++;
}
// Do we need a final closing row tag?
if ($iBrowseCol != 1) { ?>
   <div class="clear"></div>
</div>
<?php
}
?>

<?php if($this->vmPagination->getPagesLinks() != '') : ?>
<div class="pagination">
   <?php echo str_replace('</ul>', '<li class="counter">'.$this->vmPagination->getPagesCounter().'</li></ul>', $this->vmPagination->getPagesLinks()); ?>
</div>
<?php endif; ?>


</div>
<?php
} elseif (!empty($this->keyword)) {
   echo JText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword ? ' : (' . $this->keyword . ')' : '');
}
?>


Kind regards

Matt
User avatar
Fresh Boarder

teitbite
Mon Sep 28, 2015 11:38 am
Reply with quote
Report this post
Hi

Really hard to tell when code is squeezed in this code box. Here attached a file as it should be to show this element:
User avatar
Moderator

GK User
Tue Sep 29, 2015 1:55 am
Reply with quote
Report this post
Perfect thank you, using your code it works now.

Regards

Matt
User avatar
Fresh Boarder

teitbite
Thu Oct 01, 2015 11:46 am
Reply with quote
Report this post
Hi

Great to hear that, but I did nothing more than to delete the lines mentioned in comments of this file. So if template gets updated You can still do this transformation on Your own :)
User avatar
Moderator

GK User
Sat Mar 19, 2016 2:27 am
Reply with quote
Report this post
How can i change the font size and color just of this line?

http://www.loucherie.com.br/loja/index. ... /pijamas-1
User avatar
Fresh Boarder

teitbite
Tue Mar 22, 2016 1:31 pm
Reply with quote
Report this post
Hi

Selector in css would be:

Code: Select all
.catProductPrice div.PricesalesPrice {

}


you can add styling to it than.
User avatar
Moderator


cron