Skip to content

Instantly share code, notes, and snippets.

@jayelkaake
Last active February 4, 2016 23:43
Show Gist options
  • Select an option

  • Save jayelkaake/d3355a2dcc05b231b48f to your computer and use it in GitHub Desktop.

Select an option

Save jayelkaake/d3355a2dcc05b231b48f to your computer and use it in GitHub Desktop.

Revisions

  1. jayelkaake revised this gist Feb 4, 2016. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion header.phtml
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,6 @@ if (Mage::helper('core')->isModuleEnabled("Wf_CustomerBalance")) {
    ->setWebsiteId($currentWebsiteId)
    ->loadByCustomer();
    $_balanceFormatted = Mage::helper('core')->currency($balance->getAmount(), true, false);

    } else {
    $_balanceFormatted = "";
    }
  2. jayelkaake revised this gist Feb 4, 2016. 1 changed file with 11 additions and 6 deletions.
    17 changes: 11 additions & 6 deletions header.phtml
    Original file line number Diff line number Diff line change
    @@ -30,12 +30,17 @@
    /* BEGIN magecredit.com store credit balance code 1/2 */
    if (Mage::helper('core')->isModuleEnabled("Wf_CustomerBalance")) {
    $currentCustomerId = Mage::getSingleton('customer/session')->getCustomerId();
    $currentWebsiteId = Mage::app()->getWebsite()->getId();
    $balance = Mage::getModel('wf_customerbalance/balance')
    ->setCustomerId($currentCustomerId)
    ->setWebsiteId($currentWebsiteId)
    ->loadByCustomer();
    $_balanceFormatted = Mage::helper('core')->currency($balance->getAmount(), true, false);
    if ($currentCustomerId) {
    $currentWebsiteId = Mage::app()->getWebsite()->getId();
    $balance = Mage::getModel('wf_customerbalance/balance')
    ->setCustomerId($currentCustomerId)
    ->setWebsiteId($currentWebsiteId)
    ->loadByCustomer();
    $_balanceFormatted = Mage::helper('core')->currency($balance->getAmount(), true, false);

    } else {
    $_balanceFormatted = "";
    }
    } else {
    $_balanceFormatted = "";
    }
  3. jayelkaake created this gist Feb 4, 2016.
    72 changes: 72 additions & 0 deletions header.phtml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,72 @@
    <?php
    /**
    * Magento
    *
    * NOTICE OF LICENSE
    *
    * This source file is subject to the Academic Free License (AFL 3.0)
    * that is bundled with this package in the file LICENSE_AFL.txt.
    * It is also available through the world-wide-web at this URL:
    * http://opensource.org/licenses/afl-3.0.php
    * If you did not receive a copy of the license and are unable to
    * obtain it through the world-wide-web, please send an email
    * to license@magento.com so we can send you a copy immediately.
    *
    * DISCLAIMER
    *
    * Do not edit or add to this file if you wish to upgrade Magento to newer
    * versions in the future. If you wish to customize Magento for your
    * needs please refer to http://www.magento.com for more information.
    *
    * @category design
    * @package base_default
    * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
    * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
    */
    /**
    * @var Mage_Page_Block_Html_Header $this
    */

    /* BEGIN magecredit.com store credit balance code 1/2 */
    if (Mage::helper('core')->isModuleEnabled("Wf_CustomerBalance")) {
    $currentCustomerId = Mage::getSingleton('customer/session')->getCustomerId();
    $currentWebsiteId = Mage::app()->getWebsite()->getId();
    $balance = Mage::getModel('wf_customerbalance/balance')
    ->setCustomerId($currentCustomerId)
    ->setWebsiteId($currentWebsiteId)
    ->loadByCustomer();
    $_balanceFormatted = Mage::helper('core')->currency($balance->getAmount(), true, false);
    } else {
    $_balanceFormatted = "";
    }
    /* END magecredit.com store credit balance code 1/2 */
    ?>
    <div class="header-container">
    <div class="header">
    <?php if ($this->getIsHomePage()):?>
    <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
    <?php else:?>
    <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
    <?php endif?>
    <div class="quick-access">
    <?php echo $this->getChildHtml('topSearch') ?>
    <p class="welcome-msg">
    <?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?>

    <?php /* BEGIN magecredit.com store credit balance code 2/2 */ ?>
    <?php if (Mage::getSingleton('customer/session')->isLoggedIn()): ?>
    <?php echo $this->__("Credit Balance:"); ?>
    <a href="<?php echo $this->getUrl('storecredit/info'); ?>">
    <?php echo $_balanceFormatted; ?>
    </a>
    <?php endif; ?>
    <?php /* END magecredit.com store credit balance code 2/2 */ ?>

    </p>
    <?php echo $this->getChildHtml('topLinks') ?>
    <?php echo $this->getChildHtml('store_language') ?>
    </div>
    <?php echo $this->getChildHtml('topContainer'); ?>
    </div>
    </div>
    <?php echo $this->getChildHtml('topMenu') ?>