Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:14:03+00:00 2026-06-16T00:14:03+00:00

I have finally got my first extension built thanks to everyone here! I managed

  • 0

I have finally got my first extension built thanks to everyone here! I managed to get the extension added as a tab in the admin area as well. I have a menu that says enable or disable. I would like to make this function work giving the customer more control with this extension. Before it is mentioned, I am aware that you can enable and disable extensions under the advanced menu. However, most Magento customers are not. I would like to add this directly to my extension.

If the module is enabled I would like to overide the shipping.phtml file located in the checkout/cart/shipping.phtml with my own custom shipping template.

  1. How can I make my enable or disable dropdown box work? Below is my code:

etc/system.xml

<?xml version="1.0"?>
<config>
<tabs>
    <beckinconfig translate="label" module="dropdownshipping">
        <label>Beckin Extensions</label>
        <sort_order>100</sort_order>
    </beckinconfig>
</tabs> 
<sections>  
    <dropdownshipping translate="label" module="dropdownshipping">
        <label>Drop Down Shipping Options</label>
        <tab>beckinconfig</tab>
        <frontend_type>text</frontend_type>
        <sort_order>1000</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>

        <groups>            
                  <general>
            <label>General</label>
            <frontend_type>text</frontend_type>
            <sort_order>1</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>       
              <fields>
                            <enable translate="label">
                            <label>Enable</label>
                            <comment>
                            <![CDATA[Enable or Disable this extension.]]>
                            </comment>
                            <frontend_type>select</frontend_type>
                                 <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>                    
                            </enable>           
             </fields>                 
        </general>
        </groups>
    </dropdownshipping>
</sections>     
</config>

etc/config.xml

<?xml version="1.0"?>
<config>    
<modules>
<Beckin_DropDownShipping><version>1.0.0</version></Beckin_DropDownShipping>
    </modules>

<global>

            <blocks>
                 <beckin_dropdownshipping>
                      <class>Beckin_DropDownShipping_Block</class>
                 </beckin_dropdownshipping>
            </blocks>

    <helpers>
         <beckin_dropdownshipping>
         <class>Beckin_DropDownShipping_Helper</class>
         </beckin_dropdownshipping>
    </helpers>      
</global>

<frontend>
    <layout>
        <updates>
            <beckin>
                <file><!-- beckin_dropdownshipping.xml --></file>
            </beckin>
        </updates>
    </layout>
    <routers>
        <dropdownshipping>
            <use>standard</use>
            <args>
                <module>Beckin_DropDownShipping</module>
                <frontName>dropdownshipping</frontName>
            </args>
        </dropdownshipping>
    </routers>  
</frontend>


<adminhtml>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <dropdownshipping_options>
                                        <title>Beckin Drop Down Shipping Extension</title>
                                    </dropdownshipping_options>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>

</config>

Helper/Data.php

<?php
class Beckin_DropDownShipping_Helper_Data extends Mage_Core_Helper_Abstract
{   

}

Block/Cart/Shipping.php

<?php


class Beckin_DropDownShipping_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Shipping
{

protected function _construct()
{

      if(Mage::getStoreConfig('beckin/dropdownshipping_options/enable', Mage::app()->getStore()->getId()){
     {
     $this->setTemplate('Beckin/dropdownshipping/drop_down_shipping.phtml');
     }
        else
        {
        $this->setTemplate('checkout/cart/shipping.phtml');
        }
}
}

Thanks for any help provided!! I am getting a blank admin page now when I go to the system/config section where my extension is located. I am sure it is something simple that I am missing. I have included every file above that I am using except for the template file which I believe is irrelevant. Can you spot my error? I wished it would show me an error instead of the page being blank 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:14:04+00:00Added an answer on June 16, 2026 at 12:14 am

    Without known exactly what your module does and where and how your loading it. Assuming that it is not a custom shipping extension. You could do

    Eg. 1

    if((Mage::getStoreConfig('deckin/dropdownshipping_options/beckin_enable', Mage::app()->getStore()->getId()){
       module enable/display .phtml
       assuming that beckin_enable value are 0 or 1
    }
    

    I’m not 100% sure what you mean by ‘… the template xml file to set the template to override the shipping.phtml file …’
    `
    You may need to find and rewrite the block construct that set the template file for the shipping

    Eg. 2

    protected function _construct()
    {
        if(Mage::getStoreConfig('deckin/dropdownshipping_options/beckin_enable', Mage::app()->getStore()->getId()){
            $this->setTemplate('.../my_custom_shipping.phtml');
         }
         else{
            $this->setTemplate('.../regular_shipping.phtml');
         }
    }
    

    Also, You don’t need to create you own ‘source model’ for yes/no, magento have it pre-built

    <beckin_enable>
        ....
        <source_model>dropdownshipping/enable</source_model>                           
        ...                    
    </beckin_enable>
    

    You could have done

    <beckin_enable>
        ....
        <source_model>adminhtml/system_config_source_yesno</source_model>                          
        ...                    
    </beckin_enable>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have finally managed to get javan-whenever gem working on my site5 server, and
I finally got all of my queries written (thanks to all who have helped
I have finally got in my mind what worried me about Dependency Injection and
I have finally worked out how to get stdin and stdout to pipe between
I've got a 'best practice' question about using PDO. I'm trying to finally get
I finally got some understanding of how Ninject handles DI, but have faced the
I have finally got my Delphi application to send data using direct sockets with
After significant voodoo, I have finally got the scores API working. Turns out you
Finally got my first iPhone app ready for launch. There's a large publisher backing
I got a problem here, implementing a Sorted Doubly Linked List of first and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.