Kriuchko
1/9/2019 - 10:09 AM

Get price currecny цена after price

Magento1 get price currency

<block type="catalog/product" name="filter-list" as="filter-list" template="additional/products-list.phtml"/>
 

Just open \app\design\frontend\base\default\template\catalog\product\price.phtml

and change

$_specialPriceStoreLabel = $this->getProductAttribute('special_price')->getStoreLabel();

to

$specialPriceAttr = $this->getProductAttribute('special_price');
    if (!is_null($specialPriceAttr)) {
        $_specialPriceStoreLabel = $specialPriceAttr->getStoreLabel();
    } else {
        $_specialPriceStoreLabel = '';
    } 

<?php echo $this->getPriceHtml($_product, true) ?>

<?php echo Mage::helper('core')->currency($productModel->getPrice()); ?>

<?php $_coreHelper = $this->helper('core'); $_taxHelper  = $this->helper('tax');?>
  <?php $_price = $_taxHelper->getPrice($_product, $_product->getPrice()) ?>
  <?php $_regularPrice = $_taxHelper->getPrice($_product, $_product->getPrice(), $_simplePricesTax) ?>
  <?php $_finalPrice = $_taxHelper->getPrice($_product, $_product->getFinalPrice()) ?>
  <?php if($_finalPrice != $_regularPrice ):?>

  <div class="price-box">
      <span class="regular-price"><span class="price">
      <?php $pos = strrpos($_regularPrice,'.');
      if($pos == false){ print $_regularPrice.',00'; }
      else {
          $mainprice = substr($_regularPrice, 0 ,($pos));
          $subprice = substr($_regularPrice, ($pos+1));
          if(strlen($subprice) == 1){ $subprice = $subprice.'0';} elseif(strlen($subprice) == false){$subprice = '00';}
          print $mainprice.','.$subprice;
      }
      ?> <?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?></span></span>
  </div>

  <?php endif;?>
  <div class="price-box">
      <span class="regular-price"><span class="price">
      <?php $pos = strrpos($_finalPrice,'.');
      if($pos == false){ print $_finalPrice.',00'; }
      else {
          $mainprice = substr($_finalPrice, 0 ,($pos));
          $subprice = substr($_finalPrice, ($pos+1));
          if(strlen($subprice) == 1){ $subprice = $subprice.'0';} elseif(strlen($subprice) == false){$subprice = '00';}
          print $mainprice.','.$subprice;
      }
      ?> <?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?></span></span>
  </div>

для группед продукта get groped price

{{block type="catalog/product_list" category_id="25" products_count="4" name="home-category" template="catalog/product/home-category.phtml"}}

<?php
$products_count = $this->getproducts_count();
if(empty($products_count)){ $products_count = 4; }

$_productCollection=$this->getLoadedProductCollection()->setPageSize($products_count);
$_productCollection->clear();
$_productCollection->setPage(1,$products_count);

$_helper = $this->helper('catalog/output');
?>
<?php if($_productCollection->count()): ?>
<section class="product-block">
<h2><?php echo $this->__('Featured Products'); ?></h2>
<ul class="products-grid">
    <?php $_collectionSize = $_productCollection->count() ?>
    <?php $_columnCount = 3; ?>
    <?php $i=0; foreach ($_productCollection as $_product): ?>
        <li class="item">
            <a href="<?php echo $_product->getProductUrl() ?>" class="link">
                <div class="product-image">
                    <span>
                        <img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(234,150) ?>" width="234" height="150" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
                        <?php 
                            $newFromDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsFromDate();
                            $newToDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsToDate();
                            $now = date("Y-m-d H:m(worry)");
                            if(!empty($newFromDate) && !empty($newToDate)):
                                if($newFromDate < $now && $newToDate > $now || !empty($newFromDate) && $newFromDate < $now && empty($newToDate)):
                        ?>
                            <img class="label" alt="image description" src="<?php echo $this->getSkinUrl('images/label-new.png'); ?>" width="62" height="61">
                        <?php endif; endif; ?>
                        <?php 
                            $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();
                            $regular_price = Mage::getModel('catalog/product')->load($_product->getId())->getPrice(); 
                                                                                                            
                            $specialPriceFromDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialFromDate();
                            $specialPriceToDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialToDate();
                            $today =  time();
                         
                            if (!empty($specialprice) && $specialprice < $regular_price):
                                if($today >= strtotime( $specialPriceFromDate) && $today <= strtotime($specialPriceToDate) || $today >= strtotime( $specialPriceFromDate) && is_null($specialPriceToDate)):
                        ?>
                            <img class="label" alt="image description" src="<?php echo $this->getSkinUrl('images/label-offer.png'); ?>" width="64" height="63">
                        <?php  
                                endif;
                            endif;
                        ?>
                    </span>
                </div>
                <?php echo $this->getPriceHtml($_product, true) ?>
                <h3 class="product-name"><?php echo $_product->getName(); ?></h3>
            </a>
        </li>
    <?php endforeach ?>
</ul>
</section>
<?php endif; ?>