      <?php
              foreach ($listRes as $val) {
                    ?>
                <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-6 col-sm-6 col-6">
                      <div class="product-content-wrap product-list-box">
                              <div class="product-content-img">
                    <a href="<?= base_url($val['friendly_url']); ?>" title="<?php echo imagealtTitle('', ucwords(strtolower($val['product_name'])), ''); ?>">
                                              <img src="<?php echo get_image('products', $val['media'], 270, 370, 'R'); ?>" alt="<?php echo imagealtTitle('', ucwords(strtolower($val['product_name'])), ''); ?>" title="<?php echo imagealtTitle('', ucwords(strtolower($val['product_name'])), ''); ?>">
                                        </a>
                                    </div>
                                       <div class="product-content-details">
                                        <div class="product-title"><a href="<?= base_url($val['friendly_url']); ?>" title="<?php echo imagealtTitle('', ucwords(strtolower($val['product_name'])), ''); ?>">
                                            </a><?php echo substr($val['product_name'],0,50); ?>..</div>
                                        <div class="product-content-bottom">
                                            <div class="product-price">
                                                 <?php
                                if ($val['product_discounted_price'] > 0) {
                                     $percent = (($val['product_price'] - $val['product_discounted_price']) * 100) / $val['product_price'];
                                                ?>
                                                <span>
                                                   <?php echo display_price($val['product_discounted_price']); ?></span>
                                                <span class="old-price"><i class="fas
                                                        fa-rupee-sign" aria-hidden="true"></i>
                                                    <?php echo display_price($val['product_price']); ?></span>
                                                
                                                <?php } ?>
                                            </div>
                                            <div class="add-cart">
                                                <a class="add" href="<?= base_url($val['friendly_url']); ?>" title="<?php echo imagealtTitle('', ucwords(strtolower($val['product_name'])), ''); ?>">
                                                    <img src="assets/img/icons/cart-icon.svg">
                                                    Add to cart
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                      </div>
                    </div>
                    <?php
                  }
                  ?>