Editing a module seems to have no effect - magento

I am using a module which calculates the shipping method based on item weight. The module appears to install but if I make an edit to the main class, nothing seems to be reflected on the front end.
The main class extends the Mage_Shipping_Model_Carrier_Abstract see below:
<?php
class Laurensmedia_Advancedshipping_Model_Carrier_Advancedshipping
extends Mage_Shipping_Model_Carrier_Abstract
implements Mage_Shipping_Model_Carrier_Interface
{
protected $_code = 'advancedshipping';
The config.xml file looks like this:
<?xml version="1.0"?>
<config>
<modules>
<Laurensmedia_Advancedshipping>
<version>0.1.0</version>
</Laurensmedia_Advancedshipping>
</modules>
<global>
<helpers>
<advancedshipping>
<class>Laurensmedia_Advancedshipping_Helper</class>
</advancedshipping>
</helpers>
<blocks>
<advancedshipping>
<class>Laurensmedia_Advancedshipping_Block</class>
</advancedshipping>
</blocks>
<models>
<advancedshipping>
<class>Laurensmedia_Advancedshipping_Model</class>
<resourceModel>advancedshipping_mysql4</resourceModel>
</advancedshipping>
<advancedshipping_mysql4>
<class>Laurensmedia_Advancedshipping_Model_Mysql4</class>
<entities>
<matrix>
<table>advancedshipping_matrix</table>
</matrix>
</entities>
</advancedshipping_mysql4>
<shipping>
<rewrite>
<shipping>Laurensmedia_Advancedshipping_Model_Shipping_Shipping</shipping>
</rewrite>
</shipping>
</models>
<resources>
<advancedshipping_setup>
<setup>
<module>Laurensmedia_Advancedshipping</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</advancedshipping_setup>
<advancedshipping_write>
<connection>
<use>core_write</use>
</connection>
</advancedshipping_write>
<advancedshipping_read>
<connection>
<use>core_read</use>
</connection>
</advancedshipping_read>
</resources>
</global>
<admin>
<routers>
<advancedshipping>
<use>admin</use>
<args>
<module>Laurensmedia_Advancedshipping</module>
<frontName>advancedshipping</frontName>
</args>
</advancedshipping>
</routers>
</admin>
<adminhtml>
<menu>
<advancedshipping module="advancedshipping">
<title>Advancedshipping</title>
<sort_order>100</sort_order>
<children>
<matrix module="advancedshipping">
<title>Manage Matrix</title>
<sort_order>0</sort_order>
<action>advancedshipping/adminhtml_matrix</action>
</matrix>
<import module="advancedshipping">
<title>Import from CSV</title>
<sort_order>1</sort_order>
<action>advancedshipping/adminhtml_matrix/import</action>
</import>
<settings>
<title>Manage Settings</title>
<sort_order>999</sort_order>
<action>adminhtml/system_config/edit/section/lm_advancedshipping</action>
</settings>
</children>
</advancedshipping>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<advancedshipping translate="title" module="advancedshipping">
<title>Advancedshipping</title>
<sort_order>1000</sort_order>
<children>
<matrix translate="title">
<title>Manage Matrix</title>
<sort_order>0</sort_order>
</matrix>
<import translate="title">
<title>Import from CSV</title>
<sort_order>1</sort_order>
</import>
<settings translate="title">
<title>Manage Settings</title>
<sort_order>999</sort_order>
</settings>
</children>
</advancedshipping>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<advancedshipping>
<file>advancedshipping.xml</file>
</advancedshipping>
</updates>
</layout>
</adminhtml>
<default>
<carriers>
<advancedshipping>
<active>1</active>
<model>advancedshipping/carrier_advancedshipping</model>
<name>Advanced Shipping</name>
<title>Laurensmedia</title>
<description>Laurensmedia Advanced Shipping description</description>
<sort_order>0</sort_order>
</advancedshipping>
</carriers>
</default>
</config>
I have tried the following:
Clearing the Magneto cache
Manually deleting the contents of /var/cache/
Copying all of the other modules to ../disabled/ (Effectively
disabling them)
None of the above seems to have worked. Can anyone offer any suggestions as to why when I edit the main class file nothing happens? Even if I deliberately break the file (i.e - delete half the code) I don't even see any errors.

I don't see a <rewrite> declared for Laurensmedia_Advancedshipping_Model_Carrier_Advancedshipping in the config.
That would explain why it's not being picked up, since it appears to want to rewrite a standard Magento class.
If it's not intended as a rewrite, how is that class being called?

Related

Magento - How to add custom block at the /checkout/cart/ page?

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.

getting 404 page not found error when redirecting in admin

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>

adminhtml tag in config.xml file does not work

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.

Shows wrong url for a custom module magento

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.

Magento Custom Module Admin Permissions

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

Resources