Version Notes
First Release
Download this release
Release Info
| Developer | Prashant Kumar |
| Extension | prashant_remove_customeraccount_links |
| Version | 1.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0
- app/code/community/Prashant/RemoveCustomerAccountLinks/Block/Navigation.php +24 -0
- app/code/community/Prashant/RemoveCustomerAccountLinks/Helper/Data.php +14 -0
- app/code/community/Prashant/RemoveCustomerAccountLinks/Model/System/Source/Link.php +71 -0
- app/code/community/Prashant/RemoveCustomerAccountLinks/etc/config.xml +63 -0
- app/code/community/Prashant/RemoveCustomerAccountLinks/etc/system.xml +34 -0
- app/code/community/Prashant/RemoveCustomerAccountLinks/sql/prashant_removecustomeraccountlinks_setup/mysql4-install-2.0.0.2.php +15 -0
- app/etc/modules/Prashant_RemoveCustomerAccountLinks.xml +9 -0
- package.xml +18 -0
app/code/community/Prashant/RemoveCustomerAccountLinks/Block/Navigation.php
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Prashant_RemoveCustomerAccountLinks_Block_Navigation extends Mage_Customer_Block_Account_Navigation
|
| 3 |
+
{
|
| 4 |
+
/**
|
| 5 |
+
* @return $this
|
| 6 |
+
*/
|
| 7 |
+
public function removeLink()
|
| 8 |
+
{
|
| 9 |
+
foreach (Mage::helper('prashant_removecustomeraccountlinks')->getNavigationLinksToRemove() as $link) {
|
| 10 |
+
unset($this->_links[$link]);
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
return $this;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* @return mixed
|
| 18 |
+
*/
|
| 19 |
+
protected function _toHtml()
|
| 20 |
+
{
|
| 21 |
+
$this->removeLink();
|
| 22 |
+
return parent::_toHtml();
|
| 23 |
+
}
|
| 24 |
+
}
|
app/code/community/Prashant/RemoveCustomerAccountLinks/Helper/Data.php
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Prashant_RemoveCustomerAccountLinks_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
+
{
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* @param mixed $store
|
| 7 |
+
* @return array
|
| 8 |
+
*/
|
| 9 |
+
public function getNavigationLinksToRemove($store = null)
|
| 10 |
+
{
|
| 11 |
+
$items = Mage::getStoreConfig('customer/prashant_removecustomeraccountlinks/items', $store);
|
| 12 |
+
return explode(',', $items);
|
| 13 |
+
}
|
| 14 |
+
}
|
app/code/community/Prashant/RemoveCustomerAccountLinks/Model/System/Source/Link.php
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Prashant_RemoveCustomerAccountLinks_Model_System_Source_Link
|
| 3 |
+
{
|
| 4 |
+
/**
|
| 5 |
+
* @return array
|
| 6 |
+
*/
|
| 7 |
+
public function toOptionArray()
|
| 8 |
+
{
|
| 9 |
+
$options = array(array(
|
| 10 |
+
'value' => '-',
|
| 11 |
+
'label' => '',
|
| 12 |
+
));
|
| 13 |
+
|
| 14 |
+
foreach($this->getLinks() as $link) {
|
| 15 |
+
$options[] = array(
|
| 16 |
+
'value' => $link->getName(),
|
| 17 |
+
'label' => Mage::helper('customer')->__($link->getLabel()),
|
| 18 |
+
);
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
return $options;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Fetch all customer account navigation links from layout-block
|
| 26 |
+
*
|
| 27 |
+
* @return array of Varien_Object(s)
|
| 28 |
+
*/
|
| 29 |
+
public function getLinks()
|
| 30 |
+
{
|
| 31 |
+
$links = array();
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Save current store and design package
|
| 35 |
+
*/
|
| 36 |
+
$currentStoreId = Mage::app()->getStore()->getId();
|
| 37 |
+
$currentDesign = Mage::registry('_singleton/core/design_package');
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* Fetch all links from customer account navigation block
|
| 41 |
+
*/
|
| 42 |
+
foreach (Mage::app()->getStores() as $store) {
|
| 43 |
+
|
| 44 |
+
Mage::app()->setCurrentStore($store->getId());
|
| 45 |
+
Mage::unregister('_singleton/core/design_package');
|
| 46 |
+
|
| 47 |
+
/** @var $layout Mage_Core_Model_Layout */
|
| 48 |
+
$layout = Mage::getModel('core/layout');
|
| 49 |
+
$layout->getUpdate()->load('customer_account');
|
| 50 |
+
$layout->generateXml();
|
| 51 |
+
$layout->generateBlocks();
|
| 52 |
+
|
| 53 |
+
/** @var $navigation Mage_Customer_Block_Account_Navigation */
|
| 54 |
+
$navigation = $layout->getBlock('customer_account_navigation');
|
| 55 |
+
|
| 56 |
+
if($navigation instanceof Mage_Customer_Block_Account_Navigation) {
|
| 57 |
+
$storeNavigationLinks = $navigation->getLinks();
|
| 58 |
+
$links = array_merge($links, $storeNavigationLinks);
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Restore store and design package
|
| 64 |
+
*/
|
| 65 |
+
Mage::app()->setCurrentStore($currentStoreId);
|
| 66 |
+
Mage::unregister('_singleton/core/design_package');
|
| 67 |
+
Mage::register('_singleton/core/design_package', $currentDesign);
|
| 68 |
+
|
| 69 |
+
return $links;
|
| 70 |
+
}
|
| 71 |
+
}
|
app/code/community/Prashant/RemoveCustomerAccountLinks/etc/config.xml
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* @package Prashant_RemoveCustomerAccountLinks
|
| 5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software Licence 3.0 (OSL-3.0)
|
| 6 |
+
* @author Prashant Kumar
|
| 7 |
+
*/
|
| 8 |
+
-->
|
| 9 |
+
<config>
|
| 10 |
+
<modules>
|
| 11 |
+
<Prashant_RemoveCustomerAccountLinks>
|
| 12 |
+
<version>2.0.0.2</version>
|
| 13 |
+
</Prashant_RemoveCustomerAccountLinks>
|
| 14 |
+
</modules>
|
| 15 |
+
<global>
|
| 16 |
+
<blocks>
|
| 17 |
+
<customer>
|
| 18 |
+
<rewrite>
|
| 19 |
+
<account_navigation>Prashant_RemoveCustomerAccountLinks_Block_Navigation</account_navigation>
|
| 20 |
+
</rewrite>
|
| 21 |
+
</customer>
|
| 22 |
+
</blocks>
|
| 23 |
+
<helpers>
|
| 24 |
+
<prashant_removecustomeraccountlinks>
|
| 25 |
+
<class>Prashant_RemoveCustomerAccountLinks_Helper</class>
|
| 26 |
+
</prashant_removecustomeraccountlinks>
|
| 27 |
+
</helpers>
|
| 28 |
+
<models>
|
| 29 |
+
<prashant_removecustomeraccountlinks>
|
| 30 |
+
<class>Prashant_RemoveCustomerAccountLinks_Model</class>
|
| 31 |
+
</prashant_removecustomeraccountlinks>
|
| 32 |
+
</models>
|
| 33 |
+
<resources>
|
| 34 |
+
<prashant_removecustomeraccountlinks_setup>
|
| 35 |
+
<setup>
|
| 36 |
+
<module>Prashant_RemoveCustomerAccountLinks</module>
|
| 37 |
+
<class>Mage_Core_Model_Resource_Setup</class>
|
| 38 |
+
</setup>
|
| 39 |
+
<connection>
|
| 40 |
+
<use>core_setup</use>
|
| 41 |
+
</connection>
|
| 42 |
+
</prashant_removecustomeraccountlinks_setup>
|
| 43 |
+
</resources>
|
| 44 |
+
</global>
|
| 45 |
+
<adminhtml>
|
| 46 |
+
<translate>
|
| 47 |
+
<modules>
|
| 48 |
+
<Prashant_RemoveCustomerAccountLinks>
|
| 49 |
+
<files>
|
| 50 |
+
<default>Prashant_RemoveCustomerAccountLinks.csv</default>
|
| 51 |
+
</files>
|
| 52 |
+
</Prashant_RemoveCustomerAccountLinks>
|
| 53 |
+
</modules>
|
| 54 |
+
</translate>
|
| 55 |
+
</adminhtml>
|
| 56 |
+
<default>
|
| 57 |
+
<customer>
|
| 58 |
+
<prashant_removecustomeraccountlinks>
|
| 59 |
+
<items/>
|
| 60 |
+
</prashant_removecustomeraccountlinks>
|
| 61 |
+
</customer>
|
| 62 |
+
</default>
|
| 63 |
+
</config>
|
app/code/community/Prashant/RemoveCustomerAccountLinks/etc/system.xml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* @package Prashant_RemoveCustomerAccountLinks
|
| 5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software Licence 3.0 (OSL-3.0)
|
| 6 |
+
* @author Prashant Kumar
|
| 7 |
+
*/
|
| 8 |
+
-->
|
| 9 |
+
<config>
|
| 10 |
+
<sections>
|
| 11 |
+
<customer>
|
| 12 |
+
<groups>
|
| 13 |
+
<prashant_removecustomeraccountlinks translate="label" module="prashant_removecustomeraccountlinks">
|
| 14 |
+
<label>Remove Customer Account Links</label>
|
| 15 |
+
<sort_order>120</sort_order>
|
| 16 |
+
<show_in_default>1</show_in_default>
|
| 17 |
+
<show_in_website>1</show_in_website>
|
| 18 |
+
<show_in_store>1</show_in_store>
|
| 19 |
+
<fields>
|
| 20 |
+
<items translate="label">
|
| 21 |
+
<label>Remove links</label>
|
| 22 |
+
<frontend_type>multiselect</frontend_type>
|
| 23 |
+
<source_model>prashant_removecustomeraccountlinks/system_source_link</source_model>
|
| 24 |
+
<sort_order>10</sort_order>
|
| 25 |
+
<show_in_default>1</show_in_default>
|
| 26 |
+
<show_in_website>1</show_in_website>
|
| 27 |
+
<show_in_store>1</show_in_store>
|
| 28 |
+
</items>
|
| 29 |
+
</fields>
|
| 30 |
+
</prashant_removecustomeraccountlinks>
|
| 31 |
+
</groups>
|
| 32 |
+
</customer>
|
| 33 |
+
</sections>
|
| 34 |
+
</config>
|
app/code/community/Prashant/RemoveCustomerAccountLinks/sql/prashant_removecustomeraccountlinks_setup/mysql4-install-2.0.0.2.php
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
| 3 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
| 4 |
+
$installer = $this;
|
| 5 |
+
|
| 6 |
+
$installer->startSetup();
|
| 7 |
+
|
| 8 |
+
$configTable = $this->getTable('core/config_data');
|
| 9 |
+
$oldConfigPath = 'removecustomeraccountlinks/settings/remove';
|
| 10 |
+
$newConfigPath = 'customer/prashant_removecustomeraccountlinks/items';
|
| 11 |
+
|
| 12 |
+
$query = sprintf("UPDATE %s SET path = '%s' WHERE path = '%s'", $configTable, $newConfigPath, $oldConfigPath);
|
| 13 |
+
$installer->getConnection()->query($query);
|
| 14 |
+
|
| 15 |
+
$installer->endSetup();
|
app/etc/modules/Prashant_RemoveCustomerAccountLinks.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Prashant_RemoveCustomerAccountLinks>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
</Prashant_RemoveCustomerAccountLinks>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>prashant_remove_customeraccount_links</name>
|
| 4 |
+
<version>1.0.0</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Remove customer myaccount links in Magento. </summary>
|
| 10 |
+
<description>Removes customer account links in Magento from backend easily.</description>
|
| 11 |
+
<notes>First Release</notes>
|
| 12 |
+
<authors><author><name>Prashant Kumar</name><user>prashantkr</user><email>vicky.bgp@gmail.com</email></author></authors>
|
| 13 |
+
<date>2016-03-29</date>
|
| 14 |
+
<time>10:55:05</time>
|
| 15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Prashant_RemoveCustomerAccountLinks.xml" hash="bb37b8a15253d0c46550cbe28b8e9f82"/></dir></target><target name="magecommunity"><dir name="Prashant"><dir name="RemoveCustomerAccountLinks"><dir name="Block"><file name="Navigation.php" hash="e0ee12818ab5e552ff3523b46193d34f"/></dir><dir name="Helper"><file name="Data.php" hash="bfed3071eb905a0a9cf4f8f2f5db9a59"/></dir><dir name="Model"><dir name="System"><dir name="Source"><file name="Link.php" hash="873f099d3118221cb4f449f615e9074d"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="f17e062d808cc6b7858723e71f9ed864"/><file name="system.xml" hash="7ae909b3b335598e5c0b3f322867458a"/></dir><dir name="sql"><dir name="prashant_removecustomeraccountlinks_setup"><file name="mysql4-install-2.0.0.2.php" hash="919ba2a19402155295cba20feab1b62e"/></dir></dir></dir></dir></target></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.0.1</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
+
</package>
|
