K2 item display

when will i get an answer, are you guys just ignoring. i paid for this service
12 years 3 weeks ago #7 by hissam
The topic has been marked as resolved.
Hi Hisyam, really sorry for your frustation. It is our fault that we've been missed this thread and thought that this thread already resolved.
Let me check your inquiry for a few minutes
12 years 3 weeks ago #8 by andy
The topic has been marked as resolved.
Hi Hisyam,
I've been playing arround your inquiry and here are my solutions :

You need to edit these 2 files :
<root>/templates/deals_plazza/html/com_k2/dealplazza/item.php
<root>/templates/deals_plazza/html/com_k2/dealplazza/category_item.php

Item.php
Please find these codes in the item.php (arround lines 77 - 133)
<div class="k2deals-inner-value-header">
		                <ul><li><span><?php echo JText::_('Value'); ?></span><?php echo $custom[5]->value;?></li><li><span><?php echo JText::_('Discount'); ?></span><?php echo $custom[6]->value;?></li><li class="li-end"><span><?php echo JText::_('You Save'); ?></span><?php echo $custom[7]->value;?></li></ul>
		                <div class="clr"></div>
		            </div>
		            <div class="clr"></div>
		            <div class="k2deals-inner-timeleft">
		                <p><i class="icon-clock"></i> <?php echo JText::_('Time left to buy'); ?></p>
		                <?php if ($expiration_date > $today): ?>
		                        <script type="text/javascript">
		                        jQuery(document).ready(function() {
		                            var austDay = new Date(
		                                    <?php // year 
		                                    echo $custom[2]->value;?>,
		                                    <?php // month
		                                    echo ($custom[1]->value) - 1;?>,
		                                    <?php //day
		                                    echo $custom[0]->value;?>,  
		                                    00,
		                                    00)
		                            jQuery("#dealcounts-<?php echo $this->item->id; ?>").countdown({
		                                until: austDay,
		                                format:'DHMS',
		                                layout: '<span><b>{d<}{dn}</b> {dl} and {d>}'+ '<b>{hn}</b> {hl}, <b>{mn}</b> {ml}, <b>{sn}</b> {sl}</span>'
		                            });
		                        });
 
		                </script>         
 
 
		                <div id="dealcounts-<?php echo $this->item->id; ?>"></div> 
 
		                <?php else: ?>
		                <span><?php echo JText::_('Expired'); ?></span>
		                <?php endif; ?>
		            </div> 
 
		            <?php if($this->item->params->get('catItemRating')): ?>
		            <!-- Item Rating -->
		            <div class="k2deals-inner-rating">
		                <p><i class="icon-thumbs-up"></i> <?php echo JText::_('K2_RATE_THIS_ITEM'); ?></p>            
		                <div class="catItemRatingBlock">
		                    <div class="itemRatingForm">
		                    <ul class="itemRatingList">
								<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
								<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
								<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
								<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
								<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
								<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
							</ul>
		                    <div class="clr"></div>
		                    </div>
		                    <div class="clr"></div>
		                </div>
		                <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
		            </div>            
		            <?php endif; ?>

replace that with these ones :
<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
	  <!-- Item extra fields -->
 
 
					  	<div class="catItemLinks">
					  	 	<h2><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h2>
							<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
							<?php if($extraField->value): ?>
								<div class="catItemCategory">
									<span><?php echo $extraField->name; ?>:</span>
									<a><?php echo $extraField->value; ?></a>
									<div class="clr"></div>
								</div>
 
							<?php endif; ?>
							<?php endforeach; ?>
						</div>
 
					  <?php endif; ?>



Then remove these code (arround line 237)
<?php if ($expiration_date > $today): ?>
				<div class="k2deals-buynow">
					<div class="k2deals-buynow_inner">
				    <a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$custom[3]->value.'&Itemid=135'); ?>"><i class="icon-basket"></i> <?php echo JText::_('Buy'); ?> <span><?php echo $custom[4]->value;?></span></a>
				    </div>
 
				</div>
				<?php else: ?>
				<div class="k2deals-buynow-expired">
				    <div class="k2deals-buynow_inner-expired">
				    <p><i class="icon-basket"></i> <?php echo JText::_('Expired'); ?> </p>
				    </div>
				</div>
				<?php endif; ?>

This will produce output just like in the attachemnt
12 years 3 weeks ago #9 by andy
The topic has been marked as resolved.
and for category_item.php please find then remove these codes (arround lines 68 - 88)
<?php 
	        $exp_date = $custom[2]->value ."-". $custom[1]->value ."-".$custom[0]->value;
	        $todays_date = date("Y-m-d");
	        $today = strtotime($todays_date);
	        $expiration_date = strtotime($exp_date);
	        if ($expiration_date > $today): ?>
	        <div class="k2deals-buynow">
	        	<div class="k2deals-buynow_inner">
 
 
	            <a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$custom[3]->value.'&Itemid=999'); ?>"><i class="icon-basket"></i> <?php echo JText::_('Buy'); ?> <span><?php echo $custom[4]->value;?></span></a>
	            </div>
 
	        </div>
	        <?php else: ?>
	        <div class="k2deals-buynow-expired">
	            <div class="k2deals-buynow_inner-expired">
	            <p><i class="icon-basket"></i> <?php echo JText::_('Expired'); ?> </p>
	            </div>
	        </div>
	        <?php endif; ?>

then find these codes (starting from line 90)
<div class="k2deals-inner-value-header">
	                <ul><li><span><?php echo JText::_('Value'); ?></span><?php echo $custom[5]->value;?></li><li><span><?php echo JText::_('Discount'); ?></span><?php echo $custom[6]->value;?></li><li class="li-end"><span><?php echo JText::_('You Save'); ?></span><?php echo $custom[7]->value;?></li></ul>
	                <div class="clr"></div>
	            </div>
	            <div class="clr"></div>
	            <div class="k2deals-inner-timeleft">
	                <p><i class="icon-clock"></i> <?php echo JText::_('Time left to buy'); ?></p>
	                <?php if ($expiration_date > $today): ?>
	                        <script type="text/javascript">
	                        jQuery(document).ready(function() {
	                            var austDay = new Date(
	                                    <?php // year 
	                                    echo $custom[2]->value;?>,
	                                    <?php // month
	                                    echo ($custom[1]->value) - 1;?>,
	                                    <?php //day
	                                    echo $custom[0]->value;?>,  
	                                    00,
	                                    00)
	                            jQuery("#dealcounts-<?php echo $this->item->id; ?>").countdown({
	                                until: austDay,
	                                format:'DHMS',
	                                layout: '<span><b>{d<}{dn}</b> {dl} and {d>}'+ '<b>{hn}</b> {hl}, <b>{mn}</b> {ml}, <b>{sn}</b> {sl}</span>'
	                            });
	                        });
 
	                </script>         
 
 
	                <div id="dealcounts-<?php echo $this->item->id; ?>"></div> 
 
	                <?php else: ?>
	                <span><?php echo JText::_('Expired'); ?></span>
	                <?php endif; ?>
	            </div> 
 
	            <?php if($this->item->params->get('catItemRating')): ?>
	            <!-- Item Rating -->
	            <div class="k2deals-inner-rating">
	                <p><i class="icon-thumbs-up"></i> <?php echo JText::_('K2_RATE_THIS_ITEM'); ?></p>            
	                <div class="catItemRatingBlock">
	                    <div class="itemRatingForm">
	                    <ul class="itemRatingList">
							<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
							<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
							<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
							<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
							<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
							<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
						</ul>
	                    <div class="clr"></div>
	                    </div>
	                    <div class="clr"></div>
	                </div>
	                <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
	            </div>            
	            <?php endif; ?>

change that with the same code as for item.php
<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
	  <!-- Item extra fields -->
 
 
					  	<div class="catItemLinks">
					  	 	<h2><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h2>
							<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
							<?php if($extraField->value): ?>
								<div class="catItemCategory">
									<span><?php echo $extraField->name; ?>:</span>
									<a><?php echo $extraField->value; ?></a>
									<div class="clr"></div>
								</div>
 
							<?php endif; ?>
							<?php endforeach; ?>
						</div>
 
					  <?php endif; ?>

To make it works with category layout, you need to enable the extrafields for category layout from your joomla backend. Go to : Components > K2 > Categories then choose any category. Click on it then from the right parameters in the tab "Item view options in category listings" set the field Extra Fields to show

I have attached both of modified item.php and category_item.php so it will be easier for you to just replacing both of these files with the new one.


Hope this helps :)
12 years 3 weeks ago #10 by andy
The topic has been marked as resolved.
thanks alot mate this has worked like a charm exactly what i wanted. thanks again.
12 years 3 weeks ago #11 by hissam
The topic has been marked as resolved.
Glad to know it's finally resolved hisyam :)
12 years 3 weeks ago #12 by andy
The topic has been marked as resolved.
Powered by Kunena Forum