persona non grata
PHP код: <?php
preg_match ( '#^(.*) - ([^ ]*)$#i' , $text_items , $matches );
$count = $matches [ 1 ];
$total = $matches [ 2 ];
?>
<div id="cart" class="item">
<div class="cart-total">
<span class="icon show-phone hide-desktop hide-tablet"></span><span class="cart-total-text"><?php echo $total ; ?> </span>
<div class="drop-arrow"></div>
</div>
<div class="cart-wrap">
<div class="cart-text"><?php echo $heading_title ; ?> </div>
<div class="cart-count"><?php echo $count ; ?> </div>
</div>
<div class="drop-content">
<div class="drop-body">
<?php if ( $products || $vouchers ) { ?>
<table class="cart-list">
<tbody>
<?php foreach ( $products as $product ) { ?>
<tr>
<td class="image">
<?php if ( $product [ 'thumb' ]) { ?>
<a href="<?php echo $product [ 'href' ]; ?> ">
<img src="<?php echo $product [ 'thumb' ]; ?> " alt="<?php echo $product [ 'name' ]; ?> "
title="<?php echo $product [ 'name' ]; ?> ">
</a>
<?php } ?>
</td>
<td class="name ta-left">
<a href="<?php echo $product [ 'href' ]; ?> "><?php echo $product [ 'name' ]; ?> </a>
<div>
<?php foreach ( $product [ 'option' ] as $option ) { ?>
- <?php echo $option [ 'name' ]; ?> <?php echo $option [ 'value' ]; ?> <br />
<?php } ?>
</div>
</td>
<td class="quantity ta-center"><?php echo $product [ 'quantity' ]; ?> </td>
<td class="total"><?php echo $product [ 'total' ]; ?> </td>
<td class="remove"><div title="<?php echo $button_remove ; ?> " onclick="DeleteFromCart('<?php echo
$product [ 'key' ]; ?> ');"></div></td>
</tr>
<?php } ?>
<?php foreach ( $vouchers as $voucher ) { ?>
<tr>
<td class="image"></td>
<td class="name ta-left"><?php echo $voucher [ 'description' ]; ?> </td>
<td class="quantity ta-center">1</td>
<td class="total"><?php echo $voucher [ 'amount' ]; ?> </td>
<td class="remove"><div title="<?php echo $button_remove ; ?> " onclick="DeleteFromCart('<?php echo
$voucher [ 'key' ]; ?> ');"></div></td>
</tr>
<?php } ?>
</tbody>
</table>
<table class="cart-end">
<tbody>
<?php foreach ( $totals as $total ) { ?>
<tr>
<th><?php echo $total [ 'title' ]; ?> :</th>
<td><?php echo $total [ 'text' ]; ?> </td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="cart-buttons">
<a href="<?php echo $checkout ; ?> " class="button button-small button-alt"><?php echo $text_checkout ; ?> </a>
<a href="<?php echo $cart ; ?> " class="button button-small"><?php echo $text_cart ; ?> </a>
</div>
<?php } else { ?>
<div class="empty"><?php echo $text_empty ; ?> </div>
<?php } ?>
</div>
</div>
</div>
Выходит вместо значений: Notice: Undefined offset: 1 in public_html/cart/main.tpl on line 5 Notice: Undefined offset: 2 in public_html/cart/main.tpl on line 6 То есть строки: $count = $matches[1]; $total = $matches[2]; В чем проблема? Делаешь сайты онлайн/оффлайн, но не зарабатываешь? В ЛС.