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 6749705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:43:20+00:00 2026-05-26T12:43:20+00:00

i have a controller that have with in let’s say thingy/stuff directory <?php public

  • 0

i have a controller that have with in let’s say thingy/stuff directory

<?php public function index() { /*thingy stuff */ }

public function anotherfunction() {/*other thingy stuff*/} ?>

i see tthe url like index.php?route=thingy/stuff&var=dd

what i want is to call an $.post to this function inside that controller

so it uses another template file thingy.tpl and return html to use

what the URL should like ??

i searched for hours ans it sounds like there is no development documentation for open-cart out there

  • 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-05-26T12:43:21+00:00Added an answer on May 26, 2026 at 12:43 pm

    let’s say you have a controller called “stuff” under the thingy folder and a function called “my function” within that class, that looks like this:

    class ControllerThingyStuff extends Controller {
        public function index() {  
      // Some code
    }
    public function myfunction() {
    // Your code
    }
    }
    

    if you want to directly communicate with this function using the URL you can add the function name to the end of the route parameter “route=thingy/stuff/myfunction& …” and load the thingy.tpl inside the function and return it after rendering:

    // some code
    $this->template = 'template/product/thingy.tpl';
    ...
    $this->response->setOutput($this->render());
    

    if are using the open cart 1.5 and you want to use jQuery AJAX with JSON then you’ll need to import the JSON library before rendering:

    $this->template = 'thingy/stuff/thingy.tpl';
    $json['output'] = $this->render();
    $this->load->library('json');
    $this->response->setOutput(Json::encode($json));
    

    take a look at the checkout page to get some ideas, the default open cart 1.5 template uses the same technique to load the templates for each section.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have an async controller like that below ~ public class HomeController
Let's say I have a controller template with a before function like so... public
Let's say I have a controller action defined as: public ActionResult(MyModel model, string someParameter)
Let's say I have a controller function with these lines: $this->load->view('stdHeader_view'); echo <div class='main'>;
Let's say I have a Controller that handles a CRUD scenario for a 'Home'.
Let's say I'm using Spring and have a controller that returns a model containing
I have multiple controller actions that takes an id public ActionResult Get(int? id) {
Let's say I have a Tab Bar Controller with a tab A. A has
Let’s say I have a view controller, or a window controller, which is (as
In MVC 3 project, I have a Controller action that returns a View. Let's

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.