php - Joomla countdown for all products -
i want write little code module show countdown product in module show 1 of countdown 1 product.
code :
<?php $ic = 1; foreach ($product $products) { $ic++; ?> <div class="slider-item"> <div class="sp-vmslider-counter"> <div id="sp-deal-countdown-<?php echo $ic ?>"></div> </div> <script type="text/javascript"> jquery(function($){ $('#sp-deal-countdown-<?php echo $ic ?>').countdown({ until: new date(<?php $m = jhtml::date($product->product_available_date , 'm', true)-1; $y = jhtml::date($product->product_available_date , 'y', true); $d = jhtml::date($product->product_available_date , 'd', true); echo "$y,$m,$d"; ?>), format: 'dhms', layout: '<ul class="sp-countdown-list">\ <li>\ <p class="sp-countdown-number">{dl}</p>\ <p class="sp-countdown-names">{dn}</p> \ </li>\ <li>\ <p class="sp-countdown-number">{hl}</p>\ <p class="sp-countdown-names">{hn}</p> \ </li>\ <li>\ <p class="sp-countdown-number">{ml}</p>\ <p class="sp-countdown-names">{mn}</p> \ </li>\ <li>\ <p class="sp-countdown-number">{sl}</p>\ <p class="sp-countdown-names">{sn}</p>\ </li>\ </ul>', expirytext: '<div class="label label-important sp-countdown-over">deal over</div>', alwaysexpire:true }); }); </script>
and product variable is:
$products = $productmodel->getproductlisting($product_group, $max_items, true, true, false, true, $category_id);
please me how can show module products? in advance
Comments
Post a Comment