Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 4 Ответов
  • 2996 Просмотров
*

DaVinchy

  • Захожу иногда
  • 326
  • 42 / 3
minicart.tpl.php
« : 03.09.2010, 19:58:18 »
Всем добрый вечер  ;)
помогите подправить код корзины  *DRINK*
требование только Одно  ^-^ :
 Когда корзина пустая нужно чтобы слово "пусто" заменяло выделенное

если возможно - помогите пожалуйста  :D

вот код minicart.tpl.php  ^-^

Код
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );



if($empty_cart) { ?>
    
    <div style="margin: 0 auto; text-align:center">
    <?php if(!$vmMinicart) { ?>
   <p> <?php }
    echo $VM_LANG->_('PHPSHOP_EMPTY_CART')?>
    </p>
    </div>
<?php }
else {
$db = &JFactory::getDBO();
    // Loop through each row and build the table
    foreach( $minicart as $idx => $cart ) {

foreach( $cart as $attr => $val ) {
// Using this we make all the variables available in the template
// translated example: $this->set( 'product_name', $product_name );
$this->set( $attr, $val );

}

        if(!$vmMinicart) { // Build Minicart
echo '<div class="ice-basket-row '.(($idx%2==0)?'even':'odd').'">';
         $tmp = explode("&", str_replace("&amp;",'&',$cart['url']) );
$pid = 0;
foreach( $tmp as $item ){
list( $var, $val ) = explode( "=", $item );
if( trim($var) == 'product_id' ){
$pid = $val;
}
}
?>
           </div>
           <?php  
        }
    }
}



if(!$vmMinicart) { ?>
<?php } ?>

    <a class="showcart" href="http://davinchyshop.loc/index.php?page=shop.cart&option=com_virtuemart&Itemid=17">Корзина:</a>

<div class="ice-cartinfo clearfix" style="clear:both">
    <div class="ice-totalproduct" style="margin-top:3px;" >
    <?php echo $total_products ?><?php echo $total_price ?>
    </div>
    
   <a class="oformitzakaz" href="http://davinchyshop.loc/index.php?page=checkout.index&option=com_virtuemart&Itemid=17&redirected=1&Itemid=17">Оформить заказ</a>  
</div>
« Последнее редактирование: 03.09.2010, 20:09:38 от DaVinchy »
*

beagler

  • Moderator
  • 3276
  • 392 / 4
  • https://alorisman.ru/
Re: minicart.tpl.php
« Ответ #1 : 03.09.2010, 21:58:45 »
Код
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );



if($empty_cart) { ?>
   
    <div style="margin: 0 auto; text-align:center">
    <?php if(!$vmMinicart) { ?>
   <p> <?php }
    echo $VM_LANG->_('PHPSHOP_EMPTY_CART')?>
    </p>
    </div>
<?php }
else {
$db = &JFactory::getDBO();
    // Loop through each row and build the table
    foreach( $minicart as $idx => $cart ) {

foreach( $cart as $attr => $val ) {
// Using this we make all the variables available in the template
// translated example: $this->set( 'product_name', $product_name );
$this->set( $attr, $val );

}

        if(!$vmMinicart) { // Build Minicart
echo '<div class="ice-basket-row '.(($idx%2==0)?'even':'odd').'">';
          $tmp = explode("&", str_replace("&amp;",'&',$cart['url']) );
$pid = 0;
foreach( $tmp as $item ){
list( $var, $val ) = explode( "=", $item );
if( trim($var) == 'product_id' ){
$pid = $val;
}
}
?>
           </div>
           <?php 
        }
    }
}


if(!$vmMinicart) { ?>
 <a class="showcart" href="http://davinchyshop.loc/index.php?page=shop.cart&option=com_virtuemart&Itemid=17">Корзина:</a>

<div class="ice-cartinfo clearfix" style="clear:both"> 
    Пусто
 </div>

<?php } else {?>

    <a class="showcart" href="http://davinchyshop.loc/index.php?page=shop.cart&option=com_virtuemart&Itemid=17">Корзина:</a>

<div class="ice-cartinfo clearfix" style="clear:both">
    <div class="ice-totalproduct" style="margin-top:3px;" >
    <?php echo $total_products ?><?php echo $total_price ?>
    </div>
   
  <a class="oformitzakaz" href="http://davinchyshop.loc/index.php?page=checkout.index&option=com_virtuemart&Itemid=17&redirected=1&Itemid=17">Оформить заказ</a>   
</div>
<?php } ?>
*

DaVinchy

  • Захожу иногда
  • 326
  • 42 / 3
Re: minicart.tpl.php
« Ответ #2 : 03.09.2010, 22:37:21 »
beagler спасибо, но вы явно меня не поняли  ^-^

 
Цитировать
Когда корзина пустая нужно чтобы слово "пусто" заменяло выделенное
но при этом, когда корзина заполнена, выделенное должно появиться, а "пусто" исчезнуть  ;)
*

DaVinchy

  • Захожу иногда
  • 326
  • 42 / 3
Re: minicart.tpl.php
« Ответ #4 : 04.09.2010, 12:04:11 »
beagler большое тебе человеческое спасибо  :D
держи плюсик =)
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Дополнительное поле в minicart

Автор Sanyo

Ответов: 10
Просмотров: 4597
Последний ответ 28.07.2010, 15:03:54
от VIPersone