Jump to content

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

Creating Custom Dispatch Rate Topic   - - - - -

 
  • horsipede
  • Newbie
  • Trial users
  • Join Date: 02-Dec 19
  • 7 posts

Posted 13 December 2019 - 09:55 AM #1

Hi! I was wondering what are the steps needed to create a custom dispatch location other than just specifying it in the dispatch option in layout settings. Only doing that results in a 404 message appearing when going to that dispatch URL. Thank you!



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 995 posts

Posted 13 December 2019 - 10:50 AM #2

Hello

 

By default, each controller looks for a .tpl template that can be displayed. If it doesn't find it, it shows this error.
You can prevent this by typing exit; after the actions you do in the controller.
If your dispatch=my_controller.update then the update.tpl file is searched in the appropriate directory.
 
Best regards
Robert

Team of SoftSolid
cs-cart.pl

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

Posted 13 December 2019 - 01:46 PM #3

All you need is to create 2 files. For example:

 

1. Controller

 

app/addons/my_changes/controllers/frontend/my_controller.php

 

2. Template 

 

design/themes/responsive/templates/addons/my_changes/views/my_controller/view.tpl


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)

 
  • horsipede
  • Newbie
  • Trial users
  • Join Date: 02-Dec 19
  • 7 posts

Posted 16 December 2019 - 03:18 AM #4

Hi! Thank you for the answers. Will look into how these files are made :)



 
  • horsipede
  • Newbie
  • Trial users
  • Join Date: 02-Dec 19
  • 7 posts

Posted 21 January 2020 - 05:26 AM #5

Hello, I've been able to create and display the files on the frontend side by placing them on the directed paths above but failed to do so in the admin/backend side of the website.

 

I've tried placing the same files on the backend folder of both views and controllers but it still just leads to a 404 page. Does fn_dispatch treat backend files differently? The page I transferred was purely purely text from the database.

Thanks.



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

Posted 21 January 2020 - 05:43 AM #6

It should work for the backend too

 

1. Controller

 

app/addons/my_changes/controllers/backend/my_controller.php

 

2. Template 

 

design/backend/templates/addons/my_changes/views/my_controller/update.tpl


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)

 
  • horsipede
  • Newbie
  • Trial users
  • Join Date: 02-Dec 19
  • 7 posts

Posted 21 January 2020 - 06:22 AM #7

Ah I see, made the mistake of putting the controller directly on the backend folder in controllers instead of in addons.

 

Thanks!