Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Add-On Controller Not Displaying View Rate Topic   - - - - -

 
  • ninthvector
  • Junior Member
  • Members
  • Join Date: 13-Jun 07
  • 17 posts

Posted 01 November 2013 - 04:51 PM #1

Hello!

I have followed http://docs.cs-cart....ocs-controllers and feel I have a good understanding of Controller->View function in CSCart, but I just can't get this particular scenario to work for me.

I'm trying to setup an admin page that will allow the user to perform tasks. I have folders/files setup correctly and I have verified that my controller is being called and my 'manage' mode is being executed, but still no view. I just get a 404 Page not Found.

Attempting to access page at:
/store_admin.php?dispatch=test_controller.manage

My view is located in:
/admin/addons/test_addon/views/test_controller/manage.tpl

Any ideas? Is there some place where the view needs to be registered? Do I have to manually display the view from the controller (CSCart docs says it should be called by convention)?

 
  • wjdwndud
  • Member
  • Trial users
  • Join Date: 18-Jun 15
  • 17 posts

Posted 24 June 2015 - 08:02 PM #2

Doesn't /store_admin.php?dispatch=test_controller.manage call a controller named test_controller with mode = 'manage'?
So you would need a controller/backend/test_controller.php
I'm a noob at this so sorry if I am wrong.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12031 posts

Posted 25 June 2015 - 01:57 AM #3

If you want the view for backend test_controller.manage, the template should be installed as
design/backend/templates/addons/test_controller/views/test_controller/manage.tpl

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 25 June 2015 - 08:48 AM #4

Hi,

For creating new controller we recomend to use addon functionallity. So please create the following files with code:

1. app/addons/my_changes/controllers/backend/test_controller.php

<?php

if (!defined('BOOTSTRAP')) { die('Access denied'); }


if ($mode == 'manage') {
    // some code...
}

2. design/backend/templates/addons/my_changes/views/test_controller/manage.tpl

{* Some code *}


3. Then install "My changes" addon and clear cache :-)

Best regards,
WSA team

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21717 posts

Posted 25 June 2015 - 09:04 AM #5

Wow, the question was posted on 01 November 2013 :)
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12031 posts

Posted 25 June 2015 - 06:54 PM #6

Yep, at least @wjdwndud did his research first and found a related thread to ask his question in...

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.