Author Topic: New extension  (Read 6292 times)

Offline Green

  • Newbie
  • *
  • Posts: 36
  • Karma: +4/-1
    • View Profile
New extension
« on: December 21, 2014, 01:14:42 AM »
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

  • Guest
Re: New extension
« Reply #1 on: December 21, 2014, 04:07:42 AM »
Hello,remove the .php for the $controllers from main.php file so it become like this:

Code: [Select]
$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.

Offline Green

  • Newbie
  • *
  • Posts: 36
  • Karma: +4/-1
    • View Profile
Re: New extension
« Reply #2 on: December 21, 2014, 05:07:04 AM »
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..
« Last Edit: December 21, 2014, 05:11:04 AM by Durga »

yonghan

  • Guest
Re: New extension
« Reply #3 on: December 21, 2014, 08:14:08 AM »
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





Offline Green

  • Newbie
  • *
  • Posts: 36
  • Karma: +4/-1
    • View Profile
Re: New extension
« Reply #4 on: December 21, 2014, 09:30:45 AM »
Yeah..I found where the problem is.Very thanks for your time to reply.
Quote
         if (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.

Offline Green

  • Newbie
  • *
  • Posts: 36
  • Karma: +4/-1
    • View Profile
Re: New extension
« Reply #5 on: December 22, 2014, 03:54:33 AM »
My code is not coming into controller/responses/. where to find the problem?

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: New extension
« Reply #6 on: December 22, 2014, 09:45:08 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

 

Powered by SMFPacks Social Login Mod