<?php echo get_permalink(18);?>
Permalink using page Slug
<?php echo get_permalink( get_page_by_path( ‘about’ ) ); ?>
<?php echo get_permalink(18);?>
Permalink using page Slug
<?php echo get_permalink( get_page_by_path( ‘about’ ) ); ?>
<?php // Breadcrumb navigation
if (is_page() && !is_front_page() || is_single() || is_category()) {
echo ‘<ul>’;
echo ‘<li><a href=”‘.get_bloginfo(‘url’).'”>’.get_bloginfo(‘name’).'</a></li>’;
if (is_page()) {
$ancestors = get_post_ancestors($post);
if ($ancestors) {
$ancestors = array_reverse($ancestors);
foreach ($ancestors as $crumb) {
echo ‘<li><a href=”‘.get_permalink($crumb).'”>’.get_the_title($crumb).'</a></li>’;
}
}
}
if (is_single()) {
$category = get_the_category();
echo ‘<li><a href=”‘.get_category_link($category[0]->cat_ID).'”>’.$category[0]->cat_name.'</a></li>’;
}
if (is_category()) {
$category = get_the_category();
echo ‘<li>’.$category[0]->cat_name.'</li>’;
}
// Current page
if (is_page() || is_single()) {
echo ‘<li>’.get_the_title().'</li>’;
}
echo ‘</ul>’;
} elseif (is_front_page()) {
// Front page
echo ‘<ul>’;
echo ‘<li><a href=”‘.get_bloginfo(‘url’).'”>’.get_bloginfo(‘name’).'</a></li>’;
echo ‘<li>Home Page</li>’;
echo ‘</ul>’;
}
?>
<?php $current_user = wp_get_current_user(); ?>
<td>
<?php if ($isVisibleProduct): ?>
<a href=”<?php echo $this->getConfigureUrl() ?>” title=”<?php echo $this->__(‘Edit item parameters’) ?>”><?php echo $this->__(‘Edit1’) ?></a> <?php endif ?> </td>
<?php
$product = Mage::getModel(‘catalog/product’);
$attributes = Mage::getResourceModel(‘eav/entity_attribute_collection’)->
setEntityTypeFilter($product->getResource()->getTypeId())->addFieldToFilter(‘attribute_code’, ‘your_clothes_brand’); // custome attribute code
$attribute = $attributes->getFirstItem()->setEntity($product->getResource());
$manufacturers = $attribute->getSource()->getAllOptions(false);
?>
<ul>
<?php foreach ($manufacturers as $manufacturer): ?>
<li><a href=”http://<?php echo $_SERVER[‘HTTP_HOST’];?>/catalogsearch/advanced/result/?manufacturer[]=<?php echo $manufacturer[‘value’] ?>”><?php echo $manufacturer[‘label’] ?></a></li>
<?php endforeach; ?>
<?php
$collection = Mage::getModel(‘catalog/product’)->getCollection()
->addAttributeToSelect(‘*’) // select all attributes
->setPageSize(10) // limit number of results returned
->setCurPage(4); // set the offset (useful for pagination)
// we iterate through the list of products to get attribute values
foreach ($collection as $product) {
echo ‘<br />Name :’;
echo $product->getName(); //get name
echo ‘<br />Price : ‘;
echo (float) $product->getPrice(); //get price as cast to float
echo ‘<br />Description : ‘;
echo $product->getDescription(); //get description
echo ‘<br />Shor Description : ‘;
echo $product->getShortDescription(); //get short description
echo ‘<br /> Product type :’;
echo $product->getTypeId(); //get product type
echo ‘<br /> Product Status : ‘;
echo $product->getStatus(); //get product status
// getCategoryIds(); returns an array of category IDs associated with the product
foreach ($product->getCategoryIds() as $category_id) {
$category = Mage::getModel(‘catalog/category’)->load($category_id);
echo ‘<br />Category Name :’;
echo $category->getName();
echo ‘<br />Parent Category :’;
echo $category->getParentCategory()->getName(); // get parent of category
echo ‘<br />’;
}
//gets the image url of the product
echo ‘<br />Image URL :’;
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).
‘catalog/product’.$product->getImage();
echo ‘<br />Special Price :’;
echo $product->getSpecialPrice();
echo ‘<br />Product URL :’;
echo $product->getProductUrl(); //gets the product url
echo ‘<br />’;
} ?>
<?php $_item = $this->getItem()?>
<?php $_product= Mage::getSingleton(‘catalog/product’)->load($_item->getProductId()) ?>
<?php echo $_product->getResource()->getAttribute(‘product_shipping’)->getFrontend()->getValue($_product); ?>