News:

AbanteCart v1.4.2 is released.

Main Menu
support

New extension

Started by Green, December 21, 2014, 01:14:42 AM

Previous topic - Next topic

Green

This is my new sample extension.I replicated the code of product-purchased for testing. When i run this code, "page not found " is what i get. I have went through the documentations of abantecart, but i don know how to resolve this problem.Please give any suggestions to resolve this.

yonghan

Hello,remove the .php for the $controllers from main.php file so it become like this:

$controllers = array(
    'storefront' => array(),
    'admin' => array(
        'pages/trial/trial',
        'responses/trial/trial'));


The developer tools add .php to $controllers by default,so we need to remove it manually.

Hope it helps.

Green

#2
I dont know how to thank you... Thousands of thanks to you.... Its working.. :D :D :D :D :D :) :) :) :) .... But i dont get value in listing_grid?.. Could you please help me..

yonghan

I suggest you to read abantecart code first before creating extension that utilize listing_grid,so you know the flow or else you will be stuck.I previously spend time to read the code before creating extension.Here's a hint for you.Learn from the product listing grid:

admin\controller\pages\catalog\product.php from line 61-84
admin\controller\responses\listing_grid\product.php

Hope it helps





Green

Yeah..I found where the problem is.Very thanks for your time to reply.
Quoteif (is_file($dir_app .  $path_build . '.php')) {
             echo "<script> console.log('inside if')</script>";
            //Set pure controller route
            $this->controller = $path_build;
            //Set full file path to controller
            $this->file = $dir_app . $path_build . '.php';
            echo "<script> console.log('file :   $dir_app/$path_build ')</script>";
            //Build Controller class name
            $this->class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $path_build);
            array_shift($path_nodes);
            $pathfound = true;
            break;
         }

here my pages/trial/trial.php is not taken as file,its taken as folder.I don know why.

Green

My code is not coming into controller/responses/. where to find the problem?

abantecart

Quote from: Durga on December 22, 2014, 03:54:33 AM
My code is not coming into controller/responses/. where to find the problem?
What do you mean?
Response controller should be called directly from URL or dispatcher instance.
Make sure the name of the controller and path is correct, as well as class name inside of controller itself.   
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Forum Rules Code of conduct
AbanteCart.com 2010 -