1

I've been banging my head against something very very similar to this. I am trying to override a controller in my third party marketplace in Provider/Marketplace/controllers/SellerController.php

As far as I can tell everything is set up properly in my config and SellerController.php files. My code passes test #2, but the code is never executed (just a simple echo). When I run the first test I get this:

Fatal error: Uncaught exception 'Exception' with message 'Warning: include(ZeroBars/Marketplacepolicies/SellerController.php): failed to open stream: No such file or directory in /public_html/lib/Varien/Autoload.php on line 93' in /public_html/app/code/core/Mage/Core/functions.php:245 Stack trace: #0 /public_html/lib/Varien/Autoload.php(93): mageCoreErrorHandler(2, 'include(ZeroBar...', '/...', 93, Array) #1 /public_html/lib/Varien/Autoload.php(93): Varien_Autoload::autoload() #2 [internal function]: Varien_Autoload->autoload('ZeroBars_Market...') #3 /public_html/test.php(11): spl_autoload_call('ZeroBars_Market...') #4 {main} thrown in /public_html/app/code/core/Mage/Core/functions.php on line 245 

Any ideas? I can provide code samples if need be, but I've been through them with a fine toothed comb comparing to the above examples and others I have found. I am running Magento 1.8.1 CE and have cleared cache.

Edited to add:

Here is the SellerController file:

 <?php
require_once Mage::getModuleDir('controllers', 'Webkul_Marketplace').DS.'SellerController.php';
class ZeroBars_Marketplacepolicies_SellerController extends Webkul_Marketplace_SellerController {

   public function indexAction()
    {
        //return parent::indexAction();
        echo "i am called";die;
    }
}

And the config file:

    <?xml version="1.0"?>
<config>
    <modules>
        <ZeroBars_Marketplacepolicies>
            <version>1.0.0</version>
        </ZeroBars_Marketplacepolicies>
    </modules>
    <frontend>
        <routers>
           <marketplace>
                    <use>standard</use>
                    <args>
                        <modules>
                                <ZeroBars_Marketplacepolicies before="Webkul_Marketplace">ZeroBars_Marketplacepolicies</ZeroBars_Marketplacepolicies>
                        </modules>
                    </args>
            </marketplace>
        </routers>
    </frontend>
</config>
Community
  • 1
  • 1
KRay
  • 71
  • 2
  • 10

1 Answers1

0

Strange!!! I am also facing this issue. For now I am using alternate way... Observers class... life saver :)

here is example code:

<?xml version="1.0"?>
<config>
    <global>
        <events>
            <controller_action_predispatch_marketplace_seller_index>
                <observers>
                    <zeroBars_marketplacepolicies_observer>
                        <class>ZeroBars_Marketplacepolicies_Model_Observer</class>
                        <method>sellerIndexPredispatchFunction</method>
                    </zeroBars_marketplacepolicies_observer>
                </observers>
            </controller_action_predispatch_marketplace_seller_index>
        </events>
    </global>
</config>

And the observer model class:

<?php

class ZeroBars_Marketplacepolicies_Model_Observer
{

    public function sellerIndexPredispatchFunction(Varien_Event_Observer $observer)
    {
        //here your logic
    }
}

Hope this helps you. All the best! by the way I am also interested to know what the issue in your code?

Lalit Kaushik
  • 1,062
  • 2
  • 12
  • 30
  • debug in this _validateControllerClassName function in app/code/core/Mage/Core/Controller/Varien/Router/Standard.php. Use var_dump to know why Magento accepted or rejected a module's controller configuration – Lalit Kaushik May 15 '14 at 05:19