Strona główna forum Wsparcie Moduły i dodatki Wyświetlanie dostępnego kredytu obok "Welcome message"

Wyświetlanie dostępnego kredytu obok "Welcome message"

Wszystko o modułach i dodatkach dla Magento...


Posty: 1
Gadu-Gadu: 0

Witam,

Potrzebuję pomocy przy dodaniu kodu do pliku header.html
Mam zainstalowany moduł inic_customercredit, odpowiedzialny on jest za przyznawanie punktów Klientom.
Punkty wyświetlają się po zalogowaniu na stronie, na dashbordzie oraz w panelu administracyjnym.
Chciałbym aby punkty były zawsze widoczne, najlepiej obok "Witaj ........ masz XX punktów.
Znalazłem kod odpowiedzialny za wyświetlanie punktów w załączeniu, ale niemogę poradzić sobie z wstawieniem go do pliku header.phtml lub do welcome.php
Z góry dziękuję za pomoc.

1. Creditpayment.php
<?php

class Inic_Creditpayment_Model_Creditpayment extends Mage_Core_Model_Abstract
{
public function _construct()
{

parent::_construct();
$this->_init('creditpayment/creditpayment');

}
}


2.creditpayment.phtml
<div class="box-account">
<div class="box-head">
<h2><?php echo $this->__('Credit Limit')?></h2>
</div>
<div>
<?php echo $this->__('Your Credit balance is %s',$this->helper('core')->currency($this->getCustomer()->getCreditLimit(),true,false));?>

</div>

</div>

3.header.phtml
<?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@magentocommerce.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.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
/**
* @var Mage_Page_Block_Html_Header $this
*/
?>
<div class="shadow"></div>
<div class="swipe-left"></div>
<div class="swipe">
<div class="swipe-menu">
<a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->__('Home') ?>" class="home-link"><?php echo $this->__('Home') ?></a>
<?php echo $this->getChildHtml('topLinks') ?>
<?php echo $this->getChildHtml('currency_2') ?>
<?php echo $this->getChildHtml('store_language_2') ?>
<?php echo $this->getChildHtml('footer_links') ?>
<?php echo $this->getChildHtml('cms_footer_links') ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('cms_footer_links')->toHtml() ?>
<div class="footer-links-menu">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_links')->toHtml() ?>
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('page/template/custum_link_header.phtml')->toHtml(); ?>
</div>
</div>
</div>
<div class="top-icon-menu">
<div class="swipe-control"><i class="fa fa-align-justify"></i></div>
<div class="top-search"><i class="fa fa-search"></i></div>
<span class="clear"></span>
</div>
<div class="header-container">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="header">
<div class="top_row">
<p class="welcome-msg"><?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?>

<div class="header-buttons">
<?php echo $this->getChildHtml('currency') ?>
<?php echo $this->getChildHtml('store_language') ?>

</div>
<?php echo $this->getChildHtml('cart_header'); ?>
</div>
<?php if ($this->getIsHomePage()):?>
<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>"><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="top_row2">
<?php echo $this->getChildHtml('topLinks') ?>
<?php echo $this->getChildHtml('topSearch') ?>
</div>
<div class="clear"></div>
<?php echo $this->getChildHtml('topContainer'); ?>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php echo $this->getChildHtml('topMenu') ?>

4. Welcome.php
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-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 Mage
* @package Mage_Page
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/**
* Html page block
*
* @category Mage
* @package Mage_Page
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Page_Block_Html_Welcome extends Mage_Core_Block_Template
{
/**
* Get block messsage
*
* @return string
*/
protected function _toHtml()
{
if (empty($this->_data['welcome'])) {
if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
$this->_data['welcome'] = $this->__('Welcome, %s!', $this->escapeHtml(Mage::getSingleton('customer/session')->getCustomer()->getName()));
} else {
$this->_data['welcome'] = Mage::getStoreConfig('design/header/welcome');
}
}
$returnHtml = $this->_data['welcome'];

if (!empty($this->_data['additional_html'])) {
$returnHtml .= ' ' . $this->_data['additional_html'];
}

return $returnHtml;
}

/**
* Get tags array for saving cache
*
* @return array
*/
public function getCacheTags()
{
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
$this->addModelTags(Mage::getSingleton('customer/session')->getCustomer());
}

return parent::getCacheTags();
}
}

Wyświetlanie dostępnego kredytu obok "Welcome message"

PostTeraz jest 19 kwi 2024, o 03:34
Google

Posty: 427
Lokalizacja: Internet

Powrót do Moduły i dodatki



cron