如何在线创造更多产品 [英] How to create more product in line

查看:100
本文介绍了如何在线创造更多产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的opencart中有最新产品页面,但我需要在一行中创建更多产品。现在一行是三个产品,我需要有。

有我的代码:



<

 <   script    类型  =  text / javascript < span class =code-keyword>>  
(函数($){$。fn.equalHeights = function(minHeight,maxHeight){tallest =(minHeight)?minHeight:0; this。每个(函数(){如果($(本).height()>最高){最高= $(本).height()}});如果((maxHeight)及;&安培;最高> maxHeight)最高= maxHeight; return this.each(function(){$(this).height(tallest)})}})(jQuery)
$(window).load(function(){
if($ (。maxheight-feat)。length){
$(。maxheight-feat)。equalHeights()}
})
< / script >
< div class = wrapper > < / div >
< div class = 框中包含 >
< div class = box-heading > <? php echo $ heading_title; > < / div >
< div class = box-content >

< div class = box-product >
< ul >
<? php $ i = 0; >
< ; php foreach ($ products as $ product) { $ i ++; >
<? php

< span class =code-summarycomment> if ($ i%3 = = 1) {

< span class =code-summarycomment> $ a =' class =first-in-line' ;

}

elseif ($ i% 3 = = 0) {

$ a =' class =last-in-line' ;

< span class =code-summarycomment> }

else {
< span class =code-summarycomment>
< span class =code-summarycomment> < span class =code-summarycomment> $ a =' ' ;
< span class =code-summarycomment>
< span class =code-summarycomment> }

>
< < span class =code-leadattribute> li
<?php echo $ a? > >
< div < span class =code-attribute> class = inner-indent >
<? php if ($ product ['thumb']) { >
< div class = image2 > < a href = <?php echo $ product ['href']; ?> > < img src = <?php echo $ product ['thumb']; ?> alt = <?php echo $ product ['name']; ?> / > < / a > < / div >
<? php < span class =code-summarycomment>}
>
< div class = rating >

< / div >
< div class = name maxheight-feat > < a href = <?php echo $ product ['href']; ?> > <? php echo < span class =code-summarycomment> $ product ['name']; > < / a > < / div >


<? php >

< div class = wrapper >

<? php if ($ product [ 'special']) { >
< div class = 价格 >
<? php echo $ product ['special']; >
< / div >
<? php } else {? >
< div class = price < span class =code-keyword>>
<? php echo $ product ['price']; >
< / div >
<? php }? >

< / div >
< div class = 购物车 >
< a data-id = <?php echo $ product ['product_id']; ?> ;; class = button addToCart > < span > <? php echo $ button_cart; > < / span > < / a >
< div class = extra-button >

< / div >
< div class = clear > < / div >
< / div >
< / div >
< / li >
<? php } >
< / ul >
< / div >
< / div >
< / div >

解决方案

){


.fn .equalHeights =函数(了minHeight,maxHeight){最高=(了minHeight)了minHeight:0; this.each(函数(){如果(

(本).height()>最高){最高=

Hello,
I have a latest product page in my opencart, but i need create more product in one line. Now in one line are three products, i need that there will be for.
There is my code:

<

<script type="text/javascript">
        (function($){$.fn.equalHeights=function(minHeight,maxHeight){tallest=(minHeight)?minHeight:0;this.each(function(){if($(this).height()>tallest){tallest=$(this).height()}});if((maxHeight)&&tallest>maxHeight)tallest=maxHeight;return this.each(function(){$(this).height(tallest)})}})(jQuery)
    $(window).load(function(){
        if($(".maxheight-feat").length){
        $(".maxheight-feat").equalHeights()}
    })
</script>
<div class="wrapper"></div>
<div class="box featured">
  <div class="box-heading"><?php echo $heading_title; ?></div>
      <div class="box-content">

        <div class="box-product">
            <ul>
                <?php $i=0; ?>
              <?php foreach ($products as $product) { $i++; ?>
              <?php

                        if ($i%3==1) {

                            $a='class="first-in-line"';

                        }

                        elseif ($i%3==0) {

                            $a='class="last-in-line"';

                        }

                        else {

                            $a='';

                        }

                    ?>
              <li  <?php echo $a?>>
                <div class="inner-indent">
                     <?php if ($product['thumb']) { ?>
                    <div class="image2"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
                    <?php } ?>
                    <div class="rating">

                    </div>
                    <div class="name maxheight-feat"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>


                    <?php ?>

                    <div class="wrapper">

                        <?php if ($product['special']) { ?>
                        <div class="price">
                          <?php echo $product['special']; ?>
                        </div>
                        <?php } else  {?>
                            <div class="price">
                              <?php echo $product['price']; ?>
                            </div>
                        <?php }?>

                    </div>
                    <div class="cart">
                        <a data-id="<?php echo $product['product_id']; ?>;" class="button addToCart"><span><?php echo $button_cart; ?></span></a>
                        <div class="extra-button">

                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
              </li>
              <?php } ?>
          </ul>
        </div>
  </div>
</div>

解决方案

){


.fn.equalHeights=function(minHeight,maxHeight){tallest=(minHeight)?minHeight:0;this.each(function(){if(


(this).height()>tallest){tallest=


这篇关于如何在线创造更多产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆