PHP Ürün Url

1 Cevap php

Ben bir sayfada aşağıdaki kodu var.

<?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
<div class="listing-type-list catalog-listing top10full" onclick='window.open("http://google.com")'>

<?php 
$i = 0;
foreach ($_productCollection as $_product): 
$i++;
?>

    <div class="listing-number"><p class="listing-position"><?php echo $i ?></p></div>
    <div class="listing-item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
        <?php // Product Image ?>
        <div class="product-image">
            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getSmallImageLabel()) ?>">
                <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
            </a>
        </div>

Ben ürün url ile http://google.com değiştirmek istiyorum:

<?php echo $_product->getProductUrl() ?>

Zaman foreach döngüsü içinde ancak ürün url alma yukarıdaki şekilde çalışır.

Bunu nasıl işe alabilirim?

1 Cevap

Hangi ürün değiştirmek için kullanmak istiyorum http://google.com? Bir bağlantı ve birçok ürün bulunmaktadır.

Önce birini kullanmayı deneyebilirsiniz <?php $pr = $_productCollection[0]; echo $pr->getProductUrl() ?>