Jooma K2 show user description in comments - joomla

I really need help this time - Joomla 2.5 and latest K2.
I'm using the default K2 comment system and I want to show the "Description" field for every commenter on that page.
So far I have this code:
$thisUserdata =& JFactory::getUser($comment->userID);
echo $thisUserdata->profile->description;
But this shows the description for the author of the page only.
If I log in with another account, it'll also show my own Description as long as I'm logged in.
All the coding I'm doing is in /components/com_k2/templates/default/item.php
The whole code for comments looks like this:
<?php if($this->item->numOfComments>0 && $this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2'))): ?>
<!-- Item user comments -->
<ul>
<?php foreach ($this->item->comments as $key=>$comment): ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; echo (!$this->item->created_by_alias && $comment->userID==$this->item->created_by) ? " author-comment" : ""; echo($comment->published) ? '':' unpublishedComment'; ?>">
<div class="avatar">
<?php if($comment->userImage): ?>
<a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" target="_blank" rel="nofollow">
<img src="<?php echo $comment->userImage; ?>" alt="<?php echo JFilterOutput::cleanText($comment->userName); ?>" width="<?php echo $this->item->params->get('commenterImgWidth'); ?>" />
</a>
<?php endif; ?>
</div>
<div class="inner">
<div class="author">
<?php if(!empty($comment->userLink)): ?>
<a href="<?php echo $comment->userLink; ?>" title="View <?php echo $comment->userName; ?> profile" target="_blank" rel="nofollow">
<?php echo $comment->userName; ?>
</a>
<?php else: ?>
<a rel="nofollow"><?php echo $comment->userName; ?></a>
<?php endif; ?>
</div>
<div class="date">
 <?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_COM_MARIO')); ?>
</div>
<p><?php echo $comment->commentText; ?>
<?php
// USER DESCRIPTION
$thisUserdata =& JFactory::getUser($comment->userID);
echo $thisUserdata->profile->description;
?>
</div>
</div>
</li>
<?php endforeach; ?>
</ul>
<div class="itemCommentsPagination">
<?php echo $this->pagination->getPagesLinks(); ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php if($this->item->params->get('commentsFormPosition')=='below' && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
<!-- Item comments form -->
<div class="itemCommentsForm">
<?php echo $this->loadTemplate('comments_form'); ?>
</div>
<?php endif; ?>

With Joomla 2.5 you can use that to get basic user information, but you want to use the following to get the "description" or "about me" content of the commenting user..
$commentUser = JUserHelper::getProfile($comment->userID);
print_r($commentUser);
$about_me = $commentUser->profile['aboutme'];
echo $about_me;
Here is the link as well, this might help if you would like to do other things with the JUserHelper..
http://api.joomla.org/Joomla-Platform/User/JUserHelper.html#getProfile
EDIT: Make sure the plugin "User - Profile" is enabled or this will not work.

Related

Google Testing Tool shows errors in Magento Breadcrumbs

I need help with Magento breadcrumbs. This is what google testing tool tells me:
Breadcrumb 1
url: http://domain.com/
title: Home
Breadcrumb 2
url: http://domain.com/category/
title: Category
Breadcrumb 3
title: missing and required
url: missing and required
And this is breadcrumbs.phtml
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs" xmlns:v="http://rdf.data-vocabulary.org/#">
<ul>
<?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
<li class="<?php echo $_crumbName ?>" typeof="v:Breadcrumb">
<?php if($_crumbInfo['link']): ?>
<a rel="v:url" property="v:title" href="<?php echo $_crumbInfo['link'] ?>" title="<?php echo $this->escapeHtml($_crumbInfo['title']) ?>"><?php echo $this->escapeHtml($_crumbInfo['label']) ?></a>
<?php elseif($_crumbInfo['last']): ?>
<strong><?php echo $this->escapeHtml($_crumbInfo['label']) ?></strong>
<?php else: ?>
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<?php endif; ?>
<?php if(!$_crumbInfo['last']): ?>
<span>/ </span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
How can I fix it?
Thanks in advance!
Ivan
I have use this code to resolve breadcrumb issue by google console warning please click here for test : https://search.google.com/structured-data/testing-tool#
<?php
$separator = $this->getBreadcrumbsSeparator();
?>
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs" >
<ul itemscope itemtype="http://schema.org/BreadcrumbList">
<?php $i = 0; ?>
<?php foreach($crumbs as $_crumbName=>$_crumb): ?>
<li class="<?php echo $_crumbName ?>" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<?php if(!empty($_crumb['link']) && (!$_crumb['last'])): ?>
<a itemprop="item" href="<?php echo $_crumb['link'] ?>" title="<?php echo $this->htmlEscape($_crumb['label']) ?>" rel="v:url" property="v:title">
<?php echo $this->htmlEscape($_crumb['label']) ?>
<meta itemprop="position" content="<?php echo $i; ?>">
<meta itemprop="name" content="<?php echo $this->escapeHtml($_crumb['label']) ?>">
</a>
<?php elseif($_crumb['last']): ?>
<strong>
<?php echo $this->htmlEscape($_crumb['label']) ?>
<meta itemprop="position" content="<?php echo $i; ?>">
<meta itemprop="name" content="<?php echo $this->escapeHtml($_crumb['label']) ?>">
</strong>
<?php else: ?>
<?php echo $this->htmlEscape($_crumb['label']) ?>
<meta itemprop="position" content="<?php echo $i; ?>">
<meta itemprop="name" content="<?php echo $this->escapeHtml($_crumb['label']) ?>">
<?php endif; ?>
<?php if(!$_crumb['last']): ?>
<span><?php echo $separator; ?></span>
<meta itemprop="position" content="<?php echo $i; ?>">
<meta itemprop="name" content="<?php echo $this->escapeHtml($_crumb['label']) ?>">
<?php endif; ?>
</li>
<?php $i++; ?>
<?php endforeach; ?>
</ul>
</div>
Now, copy the code from a product page on your development site into the Google Web master Tools Google Structured Data. If Google can read your page then everything will be good. you can check there and if need then modify code little bit.to ckeck your code click here : https://search.google.com/structured-data/testing-tool
Replace your code with below code..
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs">
<ul xmlns:v="http://rdf.data-vocabulary.org/#">
<?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
<li class="<?php echo $_crumbName ?>" typeof="v:Breadcrumb">
<?php if($_crumbInfo['link']): ?>
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<?php elseif($_crumbInfo['last']): ?>
<strong rel="v:url" property="v:title"><?php echo $this->escapeHtml($_crumbInfo['label']) ?></strong>
<?php else: ?>
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<?php endif; ?>
<?php if(!$_crumbInfo['last']): ?>
<span>/ </span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
Now, copy the code from a product page on your development site into the Google Web master Tools Google Structured Data. If Google can read your page then everything will be good. If not then Full Page Cache disappears them. You need to fix the problem of Magento not caching breadcrumbs. This site may help you to solve caching issue --> Fix Magento Cache Breadcrumb issue. I hope this will solve your issue. Another site to help -->> http://inchoo.net/magento/google-rich-snippets-in-magento/
You don't have a link for the last item of the breadcrumb. Google needs it to display the path instead of the URL
After <?php elseif($_crumbInfo['last']): ?>
add in front of <strong> and don't forget to close the tag in the end of course </strong>
I tried everything and nothing worked, so I ended up going with my own solution.
I created an override for app\design\frontend\base\default\template\page\html\breadcrumbs.phtml in my own theme and replaced this:
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs">
<ul>
<?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
<li class="<?php echo $_crumbName ?>">
<?php if($_crumbInfo['link']): ?>
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<?php elseif($_crumbInfo['last']): ?>
<strong><?php echo $this->escapeHtml($_crumbInfo['label']) ?></strong>
<?php else: ?>
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<?php endif; ?>
<?php if(!$_crumbInfo['last']): ?>
<span>/ </span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
With this:
<?php if($crumbs && is_array($crumbs)): ?>
<div class="breadcrumbs">
<ul itemscope itemtype="http://schema.org/BreadcrumbList">
<?php $i = 0; ?>
<?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
<li class="<?php echo $_crumbName ?>" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<?php if($_crumbInfo['link']): ?>
<a itemprop="item" href="<?php echo $_crumbInfo['link'] ?>" title="<?php echo $this->escapeHtml($_crumbInfo['title']) ?>">
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<meta itemprop="position" content="<?php echo $i; ?>">
<meta itemprop="name" content="<?php echo $this->escapeHtml($_crumbInfo['label']) ?>">
</a>
<?php elseif($_crumbInfo['last']): ?>
<strong itemprop="item">
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<meta itemprop="position" content="<?php echo $i; ?>">
<meta itemprop="name" content="<?php echo $this->escapeHtml($_crumbInfo['label']) ?>">
</strong>
<?php else: ?>
<span itemprop="item">
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<meta itemprop="position" content="<?php echo $i; ?>">
<meta itemprop="name" content="<?php echo $this->escapeHtml($_crumbInfo['label']) ?>">
</span>
<?php endif; ?>
<?php if(!$_crumbInfo['last']): ?>
<span>/ </span>
<?php endif; ?>
</li>
<?php $i++; ?>
<?php endforeach; ?>
</ul>
</div>

Joomla loginform gives 500 error on bad attempt

At http://falkotl76.seventysix.axc.nl/youcollect/nl/inloggen I have a joomla loginform as a menu-item and it shows well.
When I make an attempt to login without any details it gives me a 500error and I cant figure out how to solve that.
Does anybody know how I can solve this ?
Thanks in regards,
Falko
Once I had the same issue and I fixed it by giving write permission to error.php file.
Path is - your joomla folder/log/error.php
Also make sure log and tmp path is correct in configuration.php
You need to load the client side validation javascript library. Create a template override for the com_users login view file default_login.php. At the top, add the JHtml::_('behavior.formvalidation'); line to load the library. And then add the class 'form-validate' to the form element. Below is an example:
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidation');
?>
<div class="login<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
<div class="login-description">
<?php endif ; ?>
<?php if($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>
<?php if (($this->params->get('login_image')!='')) :?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JTEXT::_('COM_USER_LOGIN_IMAGE_ALT')?>"/>
<?php endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
<?php endif ; ?>
<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="form-validate">
<fieldset>
<?php foreach ($this->form->getFieldset('credentials') as $field): ?>
<?php if (!$field->hidden): ?>
<div class="login-fields"><?php echo $field->label; ?>
<?php echo $field->input; ?></div>
<?php endif; ?>
<?php endforeach; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div class="login-fields">
<label id="remember-lbl" for="remember"><?php echo JText::_('JGLOBAL_REMEMBER_ME') ?></label>
<input id="remember" type="checkbox" name="remember" class="inputbox" value="yes" alt="<?php echo JText::_('JGLOBAL_REMEMBER_ME') ?>" />
</div>
<?php endif; ?>
<button type="submit" class="button"><?php echo JText::_('JLOGIN'); ?></button>
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />
<?php echo JHtml::_('form.token'); ?>
</fieldset>
</form>
</div>
<div>
<ul>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
</li>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?></a>
</li>
<?php
$usersConfig = JComponentHelper::getParams('com_users');
if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
I added a couple of links of template overrides for reference. This should solve your issue.
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
http://docs.joomla.org/Understanding_Output_Overrides

Magento displays incorrect products in category view

When I load a productcollection in list.phtml for the first time (or when I turn of caching completely) the products that are returned are the products which reside in the category which was created last (i.e. the category with the highest id). When cache is turned on, on page-refresh the correct products are shown. After the cache is deleted, the same situation occurs (for the correct products to show I need to refresh the page once when the productlisting is shown).
One extra strange thing; If I call
$_product->getCategory()->getName()
the correct categoryname is returned, but when
$_product->getName()
is called, the wrong productname returns... Im at a complete loss here. I have read a similar post elsewhere which stated that when cache is turned on, this problem goes away, but only after the first page-refresh which is highly undesirable.
<?php $_coreHelper = $this->helper('core'); ?>
<?php $_productCollection=$this->getLoadedProductCollection() ?>
<?php echo Mage::getModel('catalog/layer')->getCurrentCategory()->getName(); ?>
<?php echo Mage::getModel('catalog/layer')->getCurrentCategory()->getId(); ?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<div class="category-products">
<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = 4; ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>
<?php echo var_dump($_product->getCategory()->getName()); ?>
<?php if ($i++%$_columnCount==0): ?>
<ul class="products-grid" style="padding-left:0px;">
<?php endif ?>
<li style="height:230px;" class="hreview-aggregate hproduct item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
<h2 class="item fn product-name">
<?php echo substr($this->htmlEscape($_product->getName()), 0, 22).'...' ?>
</h2>
<div>
<div>
<img class="photo fn" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(100); ?>" width="100" height="100" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
</div>
<div style="clear:both"></div>
</div>
<div>
<div>
<div>
<div>
<div><span style="font-size:13px;font-weight:bold;"><?php echo $_coreHelper->currency($newprice,true,false) ?> <?php echo $this->helper('tax')->__('Ex. BTW') ?></span></div><br />
<div><?php echo $_coreHelper->currency($newtaxprice,true,false) ?> <?php echo $this->helper('tax')->__('Inc. BTW') ?></div>
</div>
</div>
<div style="clear:both;"></div>
<br />
<form action="<?=$this->getAddToCartUrl($_product);?>" method="post" id="product_addtocart_form_<?=$_product->getId();?>" <?if($_product->getOptions()){?> enctype="multipart/form-data"<?}?>>
<?if(!$_product->isGrouped()){?>
<input type="text" name="qty" id="qty" maxlength="12" value="<?echo ($this->getMinimalQty($_product)?$this->getMinimalQty($_product):1);?>" style="width:30px;" /> x
<?}?>
<button type="button" class="button-order" onclick="this.form.submit()"><span><span><?=$this->__('Bestellen');?></span></span></button>
<br /><br />
<span>Zet in verlanglijst</span>
</form>
</div>
</div>
<div style="clear:both"></div>
</li>
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
</ul>
<?php endif ?>
<?php endforeach ?>
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
<?php endif; ?>
<div class="toolbar-bottom">
<?php echo $this->getToolbarHtml() ?>
</div>
</div>
Re-Index all your products in re-indexing page.
Clear your cache.
Reload your products page.

Extrafields Visibility. K2 Extension

So i have this code changed in ../html/com_k2/template/default/item.php:
<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
<!-- Item extra fields -->
<div class="itemExtraFields">
<h3><?php echo JText::_('Additional Info:'); ?></h3>
<ul>
<?php foreach ($this->item->extra_fields as $key=>$extraField):?>
<?php $user =& JFactory::getUser(); ?>
<?php if($extraField->name == "Price" && $user->get('Guest') ==1): ?>
<?php else: ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue"><?php echo ($extraField->type=='date')?JHTML::_('date', $extraField->value, JText::_('K2_DATE_FORMAT_LC')):$extraField->value; ?></span>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="clr"></div>
</div>
<?php endif; ?>
What I'm trying to achieve is to hide the extrafield on Guest Viewer on the front-page, and that extrafield will only be visible to certain User groups. I already tried changing this line three times:
name == "Price" && $user->get('Guest')==1): ?>
name == "itemExtraFields" &&$user->get('Guest')
==1): ?>
name == "itemExtraFieldsValue"
&&$user->get('Guest') ==1): ?>
(I named my custom field as Price)
So i don't know if I'm missing something on the code or i got the itemFields name wrong. Any help would be appreciated a ton. I already asked in the k2 forum and joomla forum but no one is answering.
Try this code. It is working fine.
<?php foreach ($this->item->extra_fields as $key=>$extraField):?>
<?php if($extraField->name === "Price" && $this->user->guest){}
else{ ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
</li>
<?php }?>
<?php endforeach; ?>
I just added a strict comparison to the name and brackets for the if else condition. Also altered the way of checking guest user.

Magento Ecommerce - How to call and display a product's details into a CMS page?

I would like to be able to insert and display a product the same way it is displayed in the product page, but into a CMS page (with attributes, prices, order button, etc...)
I've succeeded in creating a single page by inserting copied parts of the source code of a product page but this is quite a lenghty and time consuming process considering that I'm planning to have quite a few pages done.
Therefore I would like to be able to call the product details into a CMS page.
I thought I could use the view.phtml and insert it into the desired CMS page but I couldn't figure out how to define the product_id either...
Thank you all in advance for your comments
Hmm, CMS Macro like this:
{{block type="catalog/product" template="catalog/product/line-item.phtml" sku_id="CI 101"}}
Referencing template catalog/product/line-item.phtml:
<?php //Template_Name/catalog/product/line-item.phtml
//{{block type="catalog/product" template="catalog/product/line-item.phtml" sku_id="CI 100"}}
//Feed template SKU for product listing
?>
<?php $_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->getData('sku_id')); ?>
<?php /* get special freight messages from custom variables */
$freightfree = Mage::getModel('core/variable')->loadByCode('free_freight_text')->getValue('plain');
$hazmat = Mage::getModel('core/variable')->loadByCode('hazmat_text')->getValue('plain');
$ormd = Mage::getModel('core/variable')->loadByCode('ormd_text')->getValue('plain');
?>
<!-- <div class="single-product"> -->
<div class="listing-type-list catalog-listing">
<div class="listing-item last">
<?php $specialshipping = $_product->getAttributeText('special_shipping_group') ?>
<?php // Product Image ?>
<div class="product-image">
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getSmallImageLabel()) ?>">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
</a>
</div>
<?php // Product description ?id= echo $_product->getId();?>
<div class="product-shop">
<h2><?php echo $this->htmlEscape($_product->getName())?></h5>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product) ?>
<?php endif; ?>
<?php echo $this->getPriceHtml($_product, true) ?>
<?php if(!$_product->getNotforsale()): ?>
<?php if(!$_product->getReplace_add_button()): ?>
<?php if($_product->isGrouped()): ?>
<button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('View Selection') ?></span></button>
<?php elseif($_product->getHasOptions()): ?>
<button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('View Options') ?></span></button>
<?php else: ?>
<button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
<?php endif; ?>
<?php else: ?>
<button class="form-button" onclick="setLocation('<?php echo $_product->getProductUrl() ?>')"><span><?php echo $_product->getAttributeText('replace_add_button') ?></span></button>
<?php endif; ?>
<?php endif; ?>
<div class="clear"></div>
<?php /* display special freight messages from custom variables */ ?>
<?php if($specialshipping == "Free Ground" || $specialshipping == "Free Gnd ORMD"): ?>
<?php echo '<span class="regular-price"><span class="freightfree">' . $freightfree . '</span></span>' ?>
<?php endif; ?>
<?php if($specialshipping == "ORM-D"): ?>
<?php echo '<span class="freightfree">' . $ormd . '</span>' ?>
<?php elseif($specialshipping == "Free Gnd ORMD"): ?>
<?php echo '<br><span class="freightfree">' . $ormd . '</span>' ?>
<?php elseif($specialshipping == "HazMat"): ?>
<?php echo '<span class="freightfree">' . $hazmat . '</span>' ?>
<?php endif; ?>
<div class="description">
<?php echo nl2br($_product->getShortDescription()) ?>
<small><?php echo $this->__('Learn More') ?></small>
</div>
<p class="add-to">
Brand Name: <?php echo $_product->getBrand() ?>
</p>
</div>
</div>
</div>
Be aware this is pulling in several custom attributes and variables you probably won't find on your system. The most important is the CMS Macro
{{block type="catalog/product" template="catalog/product/line-item.phtml" sku_id="CI 101"}}
and this line:
<?php $_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->getData('sku_id')); ?>
Use Macro as many times on the CMS page as you want.

Resources