I am working on a custom extension and i want to add additional block to the /checkout/cart/ page.
Take a look:
Here is my config:
<?xml version="1.0"?>
<config>
<modules>
<VivasIndustries_ExpressDelivery>
<version>1.0.0</version>
</VivasIndustries_ExpressDelivery>
</modules>
<global>
<models>
<expressdelivery>
<class>VivasIndustries_ExpressDelivery_Model</class>
<resourceModel>vivasindustries_expressdelivery_resource</resourceModel>
</expressdelivery>
<vivasindustries_expressdelivery_resource>
<class>VivasIndustries_ExpressDelivery_Model_Resource</class>
<entities>
<expressdelivery>
<table>VivasIndustries_ExpressDelivery</table>
</expressdelivery>
</entities>
</vivasindustries_expressdelivery_resource>
</models>
<resources>
<expressdelivery_setup>
<setup>
<module>VivasIndustries_ExpressDelivery</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</expressdelivery_setup>
<expressdelivery_read>
<connection>
<use>core_read</use>
</connection>
</expressdelivery_read>
<expressdelivery_write>
<connection>
<use>core_write</use>
</connection>
</expressdelivery_write>
</resources>
<helpers>
<expressdelivery>
<class>VivasIndustries_ExpressDelivery_Helper</class>
</expressdelivery>
</helpers>
<blocks>
<expressdelivery>
<class>VivasIndustries_ExpressDelivery_Block</class>
</expressdelivery>
</blocks>
</global>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<expressdeliveryadmin>
<title>Vivas - All</title>
</expressdeliveryadmin>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<expressdelivery>
<file>expressdelivery.xml</file>
</expressdelivery>
</updates>
</layout>
</adminhtml>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<VivasIndustries_ExpressDelivery before="Mage_Adminhtml">VivasIndustries_ExpressDelivery_Adminhtml</VivasIndustries_ExpressDelivery>
</modules>
</args>
</adminhtml>
</routers>
</admin>
</config>
How can i add a custom block bellow that block?
Can you please help me out?
Thanks in advance!
For example If you want to add a static block outsite the cart total:
Add below code at checkout_cart_index handle after the cart_totals block in your theme/layout/checkout.xml like
<block type="checkout/cart_totals" name="checkout.cart.totals" as="totals" template="checkout/cart/totals.phtml"/>
<block type="cms/block" name="customblock" after="totals" >
<action method="setBlockId"><block_id>myblock</block_id></action>
</block>
after that call this block in you cart.phtml file after closing tag of
"<div class="cart-totals">"
like:
<?php echo $this->getChildHtml('customblock') ?>
In your case you can create a phtml file for your block and can show as above.
I had installed a custom extension on both live and local server. It is running fine on local server but gives issues i.e. redirects to frontend and gives 404 page not found error when I click on custom extension page in admin.
Below is my config.xml and extension.xml file code:
config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Submitdigital_CustomLogo>
<version>0.1.0</version> <!-- Version number of your module -->
</Submitdigital_CustomLogo>
</modules>
<global>
<helpers>
<customlogo>
<class>Submitdigital_CustomLogo_Helper</class>
</customlogo>
</helpers>
<blocks>
<customlogo>
<class>Submitdigital_CustomLogo_Block</class>
</customlogo>
</blocks>
<models>
<customlogo>
<class>Submitdigital_CustomLogo_Model</class>
<resourceModel>customlogo_mysql4</resourceModel>
</customlogo>
<customlogo_mysql4>
<class>Submitdigital_CustomLogo_Model_Mysql4</class>
<entities>
<customlogo>
<table>customlogo</table>
</customlogo>
</entities>
</customlogo_mysql4>
</models>
<resources>
<customlogo_setup>
<setup>
<module>Submitdigital_CustomLogo</module>
<class>Mage_Eav_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</customlogo_setup>
<customlogo_write>
<connection>
<use>core_write</use>
</connection>
</customlogo_write>
<customlogo_read>
<connection>
<use>core_read</use>
</connection>
</customlogo_read>
</resources>
</global>
<admin>
<routers>
<admin_customlogo>
<use>admin</use>
<args>
<module>Submitdigital_CustomLogo</module>
<frontName>admin_customlogo</frontName>
</args>
</admin_customlogo>
</routers>
</admin>
<adminhtml>
<menu>
<customlogo>
<title>SubmitDigital</title>
<sort_order>100</sort_order>
<children>
<customlogo>
<title>Manage Customlogo</title>
<sort_order>0</sort_order>
<action>customlogo/adminhtml_customlogo</action>
</customlogo>
</children>
</customlogo>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<customlogo translate="title">
<title>SubmitDigital</title>
<sort_order>1000</sort_order>
<children>
<customlogo translate="title">
<title>Manage Customlogo</title>
<sort_order>0</sort_order>
</customlogo>
</children>
</customlogo>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<customlogo>
<file>customlogo.xml</file>
</customlogo>
</updates>
</layout>
</adminhtml>
<frontend>
<routers>
<customlogo>
<use>standard</use>
<args>
<module>Submitdigital_CustomLogo</module>
<frontName>customlogo</frontName>
</args>
</customlogo>
</routers>
<layout>
<updates>
<customlogo>
<file>customlogo.xml</file>
</customlogo>
</updates>
</layout>
</frontend>
</config>
extension.xml(customlogo.xml):
<?xml version="1.0"?>
<layout version="0.1.0">
<customlogo_adminhtml_customlogo_index>
<reference name="content">
<block type="customlogo/adminhtml_customlogo" name="customlogo" />
</reference>
</customlogo_adminhtml_customlogo_index>
</layout>
I am new to magento and making a custom module and want to work on admin end but after installing extension I get this error:
Fatal error: Class 'Submitdigital_CustomLogo_Helper_Data' not found in /var/zpanel/hostdata/zadmin/public_html/unisport_com/app/Mage.php on line 547
After insatalling extension when I clear cashe it give me this error. After somestudy I found that the error is due to this file at path:
app/code/local/Submitdigital/CustomLogo/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Submitdigital_CustomLogo>
<version>0.1.0</version>
</Submitdigital_CustomLogo>
</modules>
<global>
<helpers>
<customlogo>
<class>Submitdigital_CustomLogo_Helper</class>
</customlogo>
</helpers>
<blocks>
<customlogo>
<class>Submitdigital_CustomLogo_Block</class>
</customlogo>
</blocks>
<models>
<customlogo>
<class>Submitdigital_CustomLogo_Model</class>
<resourceModel>customlogo_mysql4</resourceModel>
</customlogo>
<customlogo_mysql4>
<class>Submitdigital_CustomLogo_Model_Mysql4</class>
<entities>
<customlogo>
<table>customlogo</table>
</customlogo>
</entities>
</customlogo_mysql4>
</models>
<resources>
<customlogo_setup>
<setup>
<module>Submitdigital_CustomLogo</module>
<class>Mage_Eav_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</customlogo_setup>
<customlogo_write>
<connection>
<use>core_write</use>
</connection>
</customlogo_write>
<customlogo_read>
<connection>
<use>core_read</use>
</connection>
</customlogo_read>
</resources>
</global>
<admin>
<routers>
<admin_customlogo>
<use>admin</use>
<args>
<module>Submitdigital_CustomLogo</module>
<frontName>admin_customlogo</frontName>
</args>
</admin_customlogo>
</routers>
</admin>
<adminhtml>
<menu>
<customlogo module="customlogo">
<title>SubmitDigital</title>
<sort_order>100</sort_order>
<children>
<customlogo module="customlogo">
<title>Manage Customlogo</title>
<sort_order>0</sort_order>
<action>customlogo/adminhtml_customlogo</action>
</customlogo>
</children>
</customlogo>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<customlogo translate="title" module="customlogo">
<title>SubmitDigital</title>
<sort_order>1000</sort_order>
<children>
<customlogo translate="title">
<title>Manage Customlogo</title>
<sort_order>0</sort_order>
</customlogo>
</children>
</customlogo>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<customlogo>
<file>customlogo.xml</file>
</customlogo>
</updates>
</layout>
</adminhtml>
<frontend>
<routers>
<customlogo>
<use>standard</use>
<args>
<module>Submitdigital_CustomLogo</module>
<frontName>customlogo</frontName>
</args>
</customlogo>
</routers>
<layout>
<updates>
<customlogo>
<file>customlogo.xml</file>
</customlogo>
</updates>
</layout>
</frontend>
</config>
all goes well with the file but when I add <adminhtml>...</adminhtml> in the file it gives the above error and hence I am not able to see anything at my admin end.
Please Help
here is my customlogo.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<customlogo_adminhtml_customlogo_index>
<reference name="content">
<block type="customlogo/adminhtml_customlogo" name="customlogo" />
</reference>
</customlogo_adminhtml_customlogo_index>
</layout>
You have to create the helper class to fix this issue.
app/code/local/Submitdigital/CustomLogo/Helper/Data.php
class Submitdigital_CustomLogo_Helper_Data extends Mage_Core_Helper_Abstract
{
}
You have the following code to call the helper
<customlogo module="customlogo">
Here
module parameter is used to call the helper for translation.
I have created a custom module 'Measurement'.and the frontend url is http://urbanior.grapesdigital.com/measurement/.
I want to add a link in left side like Measurements in my account page. so I added this in my measurement.xml page
measuement.xml
<customer_account>
<reference name="customer_account_navigation">
<action method="addLink" translate="label" module="measurement"><name>grapes_measurement</name><path>measurement/</path><label>Measurements</label></action>
</reference>
</customer_account>
config.xml
<?xml version="1.0"?>
<config>
<modules>
<Grapes_Measurement>
<version>0.1.0</version>
</Grapes_Measurement>
</modules>
<frontend>
<routers>
<measurement>
<use>standard</use>
<args>
<module>Grapes_Measurement</module>
<frontName>measurement</frontName>
</args>
</measurement>
</routers>
<layout>
<updates>
<measurement>
<file>measurement.xml</file>
</measurement>
</updates>
</layout>
</frontend>
<global>
<helpers>
<measurement>
<class>Grapes_Measurement_Helper</class>
</measurement>
</helpers>
<blocks>
<measurement>
<class>Grapes_Measurement_Block</class>
</measurement>
</blocks>
<models>
<measurement>
<class>Grapes_Measurement_Model</class>
<resourceModel>measurement_mysql4</resourceModel>
</measurement>
<measurement_mysql4>
<class>Grapes_Measurement_Model_Mysql4</class>
<entities>
<measurement>
<table>measurements</table>
</measurement>
</entities>
</measurement_mysql4>
</models>
<resources>
<measurement_setup>
<setup>
<module>Grapes_Measurement</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</measurement_setup>
<measurement_write>
<connection>
<use>core_write</use>
</connection>
</measurement_write>
<measurement_read>
<connection>
<use>core_read</use>
</connection>
</measurement_read>
</resources>
</global>
<admin>
<routers>
<measurement>
<use>admin</use>
<args>
<module>Grapes_Measurement</module>
<frontName>admin_measurement</frontName>
</args>
</measurement>
</routers>
</admin>
<adminhtml>
<menu>
<measurement module="measurement">
<title>Measurement</title>
<sort_order>100</sort_order>
<children>
<measurement module="measurement">
<title>Manage Measurement</title>
<sort_order>0</sort_order>
<action>admin_measurement/adminhtml_measurement</action>
</measurement>
</children>
</measurement>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<measurement translate="title" module="measurement">
<title>Measurement</title>
<sort_order>1000</sort_order>
<children>
<measurement translate="title">
<title>Manage Measurement</title>
<sort_order>0</sort_order>
</measurement>
</children>
</measurement>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<measurement>
<file>measurement.xml</file>
</measurement>
</updates>
</layout>
</adminhtml>
</config>
But when I click on this link, it shows the url like http://urbanior.grapesdigital.com/admin_measurement/
It is taking the admin route path instead of frontend path. I don't know how to resolve this issue. It opens the same page but URL is different.
please check in config.xml you have same route "measurement" for admin please remove admin route or change it.
I have created a few custom modules for Magento and when I try to assign permissions to the module (check the checkbox) when I click save it unchecks the box.
Anyone have any ideas? It sort of sounds like there is something off in my config.xml file so I will post it here just in case:
<config>
<modules>
<Wpe_Vendorlist>
<version>0.1.0</version>
</Wpe_Vendorlist>
</modules>
<admin>
<routers>
<vendorlist>
<use>admin</use>
<args>
<module>Wpe_Vendorlist</module>
<frontName>vendorlist</frontName>
</args>
</vendorlist>
</routers>
</admin>
<adminhtml>
<menu>
<customer>
<children>
<items module="vendorlist">
<title>SO Vendor List</title>
<sort_order>999</sort_order>
<action>vendorlist/adminhtml_vendorlist</action>
</items>
</children>
</customer>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<Wpe_Vendorlist>
<title>Vendorlist Module</title>
<sort_order>10</sort_order>
</Wpe_Vendorlist>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<vendorlist>
<file>vendorlist.xml</file>
</vendorlist>
</updates>
</layout>
</adminhtml>
<global>
<models>
<vendorlist>
<class>Wpe_Vendorlist_Model</class>
<resourceModel>vendorlist_mysql4</resourceModel>
</vendorlist>
<vendorlist_mysql4>
<class>Wpe_Vendorlist_Model_Mysql4</class>
<entities>
<vendorlist>
<table>vendorlist</table>
</vendorlist>
</entities>
</vendorlist_mysql4>
</models>
<resources>
<vendorlist_setup>
<setup>
<module>Wpe_Vendorlist</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</vendorlist_setup>
<vendorlist_write>
<connection>
<use>core_write</use>
</connection>
</vendorlist_write>
<vendorlist_read>
<connection>
<use>core_read</use>
</connection>
</vendorlist_read>
</resources>
<blocks>
<vendorlist>
<class>Wpe_Vendorlist_Block</class>
</vendorlist>
</blocks>
<helpers>
<vendorlist>
<class>Wpe_Vendorlist_Helper</class>
</vendorlist>
</helpers>
</global>
</config>
I strongly recomend you to take a look at Alan Storm's article about system configuration, and the rest of his serie, it's the best info I've found about magento programing.
For this particular question, here is how I've done it in my module, with your module name:
<acl><!-- permits -->
<resources>
<admin>
<children>
<customer translate="title" module="vendorlist"><!-- this tag matches the menu tag, and the same for his children -->
<title>what will appears in the checkboxes tree when you create a role</title>
<children>
<firstchild>
<title>what will appears in the checkboxes tree when you create a role</title>
</firstchild>
</children>
</customer>
</children>
</admin>
</resources>
</acl>
You won't need the:
<children>
<firstchild>
<title>what will appears in the checkboxes tree when you create a role</title>
</firstchild>
</children>
as you don't have children in your module, it seems, I just put it as an example.
I hope this helps
Please change your config.xml and replace
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<Wpe_Vendorlist>
<title>Vendorlist Module</title>
<sort_order>10</sort_order>
</Wpe_Vendorlist>
</children>
</admin>
</resources>
</acl>
with
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<vendorlist>
<title>Vendorlist Module</title>
<sort_order>10</sort_order>
</vendorlist>
</children>
</admin>
</resources>
</acl>
Only need to change vendorlist after children tag instead of Wpe_Vendorlist. This change worked for me in my custom module,hope may help others also.
You should use only lower case characters in your resource and menu item names. See the constructor on app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php
public function __construct()
{
...
foreach ($rules_set->getItems() as $item) {
$itemResourceId = $item->getResource_id();
if (array_key_exists(strtolower($itemResourceId), $resources) && $item->getPermission() == 'allow') {
$resources[$itemResourceId]['checked'] = true;
array_push($selrids, $itemResourceId);
}
}
....
I would also suggest you consider moving the acl and menu info to adminhtml.xml instead of having it on config.xml.
Another issue is that you should have exactly the same structure in both menu and acl trees, so your acl reflects the menu structure and magento knows what to enable when a permission is given to a role. There's a great article by Ivan Chepurnyi about this here
So, after the changes, you would end up with someting similar to this, on adminhtml.xml:
<adminhtml>
<menu>
<customer>
<children>
<wpe_vendorlist module="vendorlist">
<title>SO Vendor List</title>
<sort_order>999</sort_order>
<action>vendorlist/adminhtml_vendorlist</action>
</wpe_vendorlist>
</children>
</customer>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<customer>
<children>
<wpe_vendorlist>
<title>Vendorlist Module</title>
<sort_order>10</sort_order>
</wpe_vendorlist>
</children>
</customer>
</children>
</admin>
</resources>
</acl>
</adminhtml>
I found something from magento forum. Go to the following link:
http://www.magentocommerce.com/boards/viewthread/78673/
But still can't set permission to these custom modules from newly created roles.
These custom modules didn't appear in main menu for that newly created roles' users.
after changing syntax in acl tag module is displayed in custom module permission