Jump to content

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

How To Create And Access Front End Page Of An Addon? Rate Topic   - - - - -

 

Posted 07 June 2021 - 05:56 AM #1

Hello,

We are trying to create the front end page for our addon but not able to do so. So please let us know in detail about files need to created and also let us know how to access it.

Thanks!



 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1275 posts

Posted 07 June 2021 - 07:56 AM #2

1. Create controller filename

app/addons/[ADDON_NAME]/controllers/frontend/[CONTROLLER_NAME].php

2. Create template view + content

design/themes/[THEME_NAME]/templates/addons/[ADDON_NAME]/views/[CONTROLLER_NAME]/[VIEW_NAME].tpl

# add content



#Example:

ADDON_NAME=my_changes
CONTROLLER_NAME=custom_page
THEME_NAME=responsive
VIEW_NAME=view

#Files

app/addons/my_changes/controllers/frontend/custom_page.php
design/themes/responsive/templates/addons/my_changes/views/custom_page/view.tpl

#URL

http://www.example.com/?dispatch=custom_page.view


 

Posted 07 June 2021 - 11:14 AM #3

Hello,

Thank you for your quick reply. We have created both files but we are getting page not found error. So please let us know how to proceed further.

Thanks!



 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1275 posts

Posted 07 June 2021 - 06:04 PM #4

Please attach the urls for the files you created



 

Posted 08 June 2021 - 05:09 AM #5

Hello,

We have created the files as you asked, just changed the addon name. We are developing in localhost. So you will not be able to access it.

Thanks!



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

Posted 08 June 2021 - 01:27 PM #6

Please make sure that the $mode value in controller corresponds the template file name


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)

 

Posted 09 June 2021 - 06:48 AM #7

Hello,

Yes, it is same but still not working. We have also tried with the other addons already present but not able to make it working. So can anyone share some sample code to just display a message and stops need to followed.

Thanks!



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

Posted 09 June 2021 - 01:25 PM #8

For example, the Gift Certificates addon

 

Controller

app/addons/gift_certificates/controllers/frontend/gift_certificates.php

 

Template:

design/themes/responsive/templates/addons/gift_certificates/views/gift_certificates/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)

 

Posted 10 June 2021 - 05:16 AM #9

Hello,

We have tried to follow the files but still getting the same result. So can some one suggest some debugging tricks. So that we can check where is the exact issue.

Thanks!



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

Posted 10 June 2021 - 05:57 AM #10

At first try to delete the var/cache directory manually


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)

 

Posted 10 June 2021 - 11:13 AM #11

Hello,

We have tried it but didn't worked for us. Can you please let us know some debugging tricks.

Thanks!



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

Posted 10 June 2021 - 01:31 PM #12

Use the following code in the controller to check if the system uses it

fn_print_die('test');

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)

 

Posted 10 June 2021 - 02:07 PM #13

Hello,

We have added this code but still getting the same result.

Thanks!



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

Posted 11 June 2021 - 05:14 AM #14

How are you trying to reach new page?


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)

 

Posted 11 June 2021 - 05:41 AM #15

Hello,

We are accessing via http://localhost/csc...ustom_page.view.

We have also tried with update, http://localhost/csc...tom_page.update, as in the gift_certificate addon.

Thanks!



 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1275 posts

Posted 11 June 2021 - 11:30 AM #16

Please attach a screenshot of the addons and design folder tree and also make sure the add-on is active ;)



 

Posted 11 June 2021 - 12:25 PM #17

Hello,

Module is active and working in back end with no issue. Please see the attached images.

Thanks!

Attached Thumbnails

  • Selection_001.png
  • Selection_002.png


 

Posted 12 June 2021 - 01:57 PM #18

Hello,

The controller issue is now resolve. Now when we are trying to use Registry::set('addons.demo.test', 'some value'); then the value is not reflected in our addon setting page. So please let us know if there is any issue.

Thanks!



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

Posted 14 June 2021 - 06:08 AM #19

Use Registry::get instead of Registry::set


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)