<?php
    $productArray = array();
    foreach($catProductCollection as $catProduct){
        $productArray&#91;&#93; = $catProduct->getProductUrl();
    }
    $indexvalue =  array_search($product->getProductUrl(),$productArray);
    $output['current'] = $productArray[$indexvalue];
    $output['prev'] = $productArray[$indexvalue-1];
    $output['next'] = $productArray[$indexvalue+1];
    
?>

<div class="prevnxt-ejuice-details">
    <?php if($output&#91;'prev'&#93;): ?>
        <a class="ejuice-prev-p" href="<?php echo $output&#91;'prev'&#93;; ?>"><i class="fa fa-angle-left" aria-hidden="true">&nbsp;</i></a>
    <?php endif; ?>
    <?php if($output&#91;'next'&#93;): ?>
        <a class="ejuice-next-n" href="<?php echo $output&#91;'next'&#93;; ?>"><i class="fa fa-angle-right" aria-hidden="true">&nbsp;</i></a>
    <?php endif; ?>
</div>

Categories: Magento

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *