941-685-8851

‘Magento’

Magento sidebar category navigation 1 level reversed order

I needed to create a left sidebar category navigation which display only the top level categories. The category display order in this navigation needed to be reverse that of the default category display order. For example, here is a screen capture of the Manage Categories interface in the Magento administration.

Magento Ecommerce web design

Below is a screen capture of the Magento shopping cart website frontend. Sorting the category order in the Manage Categories administration (shown above) will determine how the categories are sorted on the frontend.

Magento Ecommerce shopping cart website design

The code to create this Magento vertical category navigation is:

<ul id=”category-nav”>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php if($_category->name!=””):  ?>
<ul id=”category-nav”><?php foreach ($this->getStoreCategories() as $_category): ?><?php if($_category->name!=””):  ?><li><?php echo $this->drawItem($_category) ?></li><?php endif?><?php endforeach ?></ul>
<?php endif?>
<?php endforeach ?>
</ul>

But in the case of this particular ecommerce shopping cart web design, I need the top horizontal navigation to retain the sort order defined in Manage Categories, and the left sidebar vertical navigation to display a reverse order of that defined in Manage categories.

Magento Ecommerce shopping cart website development

The code to create this Magento vertical category navigation with a reverse sort order is:

<ul id=”category-nav”>
<?php $helper = Mage::helper(‘catalog/category’);
$categoryCollection = $helper->getStoreCategories(false,true,false);
$categoryCollection->addAttributeToSort(‘level’, ‘asc’)
->addAttributeToSort(‘position’, ‘desc’)
->addAttributeToFIlter(‘level’, array(‘eq’ => ’2′));  //Added to limit to only level 1 categories.; ?>

<?php foreach ($categoryCollection as $_category): ?>
<?php if($_category->name!=”"):  ?>
<li><a href=”<?php echo $this->getCategoryUrl($_category); ?>”title=”<?php echo $this->htmlEscape($_category->getName(‘position’, ‘desc’)); ?>”>
<?php echo $this->htmlEscape($_category->getName()); ?></a></li>
<?php endif?><?php endforeach ?>
</ul>

Share
 

Magento Category navigation top level only

Sometimes ecommerce websites can have a lot of sub-categories. The Magento shopping cart provides an extremely flexible and powerful toolset to organize ecommerce shopping cart products and their respective category and sub-category parent child assignments.

But sometimes numerous sub-category levels can be overwhelming for the average shopping cart website consumer. There is a method in the Magento shopping cart administration to limit category levels globally for the whole ecommerce website. But what if you want to limit category levels for just one custom navigation menu. Here is how to do it.

Edit the template file, usually located in: app > design > frontend > default > your_theme > template > catalog > navigation >

The Magento category navigation code looks like this:

<ul id=”category-nav”>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php if($_category->name!=”"):  ?>
<li><?php echo $this->drawItem($_category) ?></li>
<?php endif?>
<?php endforeach ?>
</ul>
Replace the following line:
<li><?php echo $this->drawItem($_category) ?></li>
with this line:

<ul id=”category-nav”><?php foreach ($this->getStoreCategories() as $_category): ?><?php if($_category->name!=”"):  ?><li><?php echo $this->drawItem($_category) ?></li><?php endif?><?php endforeach ?></ul>

Your Magento category navigation will now display only the top level category.

Share
 

Magento remove discount coupon code

Magento offers a built in coupon code feature to provide shopping cart customers with discounts when shopping on their ecommerce website. You can post discount codes in emails, blogs and social networks to generate more traffic and entice paying customers to your ecommerce website. But often, website owners don’t want to offer discount codes on their shopping cart.  Fortunately for ecommerce web designers, it is quite easy to disable the discount coupon code function on a Magento shopping cart website.

Edit your checkout.xml layout file. The default file in Magento 1.6 would be located in app/design/frontend/base/default/layout/checkout.xml

Remove the following block:

<block type=”checkout/cart_coupon” name=”checkout.cart.coupon” as=”coupon” template=”checkout/cart/coupon.phtml”/>

This block can be found within <reference name=”content”>

Refresh the Magento cache and the discount coupon code menu will be removed.

Share
 

Magento remove Try Magento Go for Free

In the Magento admin to the right of the top navigation menu bar, there is a “Try Magento Go for Free” link, which links to the magentocommerce website. This is great for someone who is installing, developing and administrating a Magento ecommerce website themselves. However, what if you are a Magento shopping cart web designer developing an ecommerce website for a client. When the client tries to administer the shopping cart website,  such a link can prove to be quite confusing. To avoid this client confusion, it is best to simply remove the link. Here is how to  remove the “Try Magento Go for Free” link in the Magento admin.

Edit the following file:

/app/design/adminhtml/default/default/template/page/header.phtml

Delete the following:

<a href=”http://golinks.magento.com/CE15″ onclick=”this.target=’_blank’” class=”go-try”><?php echo $this->__(‘Try Magento Go for Free’) ?></a><span class=”separator”>|</span>

The ”Try Magento Go for Free” link will now be removed from the Magento admin.

Share
 

Magento remove Get help for this page

In the Magento admin to the right of the top navigation menu bar, there is a “Get help for this page” link, which links to the magentocommerce website. This is great for someone who is installing, developing and administrating a Magento ecommerce website themselves. However, what if you are a Magento shopping cart web designer developing an ecommerce website for a client. When the client tries to administer the shopping cart website,  such a link can prove to be quite confusing. To avoid this client confusion, it is best to simply remove the link. Here is how to  remove the “Get help for this page” link in the Magento admin.

Edit the following file:

/app/design/adminhtml/default/default/template/page/menu.phtml

Delete the following:

<a id=”page-help-link” href=”<?php echo Mage::helper(‘adminhtml’)->getPageHelpUrl() ?>”><?php echo $this->__(‘Get help for this page’) ?></a>
<script type=”text/javascript”>$(‘page-help-link’).target = ‘magento_page_help’</script>

<a id=”page-help-link” href=”<?php echo Mage::helper(‘adminhtml’)->getPageHelpUrl() ?>”><?php echo $this->__(‘Get help for this page’) ?></a>    <script type=”text/javascript”>$(‘page-help-link’).target = ‘magento_page_help’</script>

The ”Get help for this page” link will now be removed from the Magento admin.

Share
 

Magento remove Estimate Shipping and Tax

Magento offers a built in Estimate Shipping and Tax feature to provide shopping cart customers with realtime feedback of tax and shipping estimation when shopping on an ecommerce website. But often, website owners don’t want to display the Estimate Shipping and Tax function on their shopping cart website. For example, some shopping cart website owners will offer free shipping or flat rate shipping, which makes shipping estimation irrelevant, not to mention confusing and distracting to ecommerce customers.  Fortunately for ecommerce web designers, it is quite easy to disable the Estimate Shipping and Tax function on a Magento shopping cart website.

Edit your checkout.xml layout file. The default file in Magento 1.6 would be located in app/design/frontend/base/default/layout/checkout.xml

Remove the following block:

<block type=”checkout/cart_shipping” name=”checkout.cart.shipping” as=”shipping” template=”checkout/cart/shipping.phtml”/>

This block can be found within <reference name=”content”>

Refresh the Magento cache and the Estimate Shipping and Tax menu will be removed.

Share