Post by raoshenghong » Sat Aug 23, 2008 10:22 am

I created a new class file in 'admin/controller/',and created .tpl file.it has a error when I opened it with "http://www.???.com/admin/index.php?cont ... ng_cost".I study opencart not long time,so I don't know with how to config the new class file,please help me,thanks!

Error:
Permission Denied!
You do not have permission to access this page, please refer to your system administrator.

My file:
File:/admin/controller/shipping_cost.php

Code: Select all

<?php
class ControllerShippingCost extends Controller {
	function index() {
		$response =& $this->locator->get('response');
		$language =& $this->locator->get('language');
		$template =& $this->locator->get('template');
		$module   =& $this->locator->get('module');
                
                ...

		$template->set('title', $language->get('heading_title'));

		$template->set('content', $this->getForm());
	
		$template->set($module->fetch());
	
    	        $response->set($template->fetch('layout.tpl'));
	}

        function insert() {
        ...
        }

        function update() {
        ...
        }

        ...
}
?>
Last edited by raoshenghong on Sat Aug 23, 2008 11:36 am, edited 1 time in total.

New member

Posts

Joined
Mon May 26, 2008 11:45 am

Post by Qphoria » Sat Aug 23, 2008 10:38 am

Hi. Please search the forums for "permission denied" and you will see how to handle this.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by raoshenghong » Sat Aug 23, 2008 11:15 am

Qphoria wrote: Hi. Please search the forums for "permission denied" and you will see how to handle this.
thank you.I got to Admin->Configuration->User->User Group and added "shipping_cost.php" to allow to access and modify,but it has a new error:

Page Not Found!
The page you request could not be found!
Last edited by raoshenghong on Sat Aug 23, 2008 11:35 am, edited 1 time in total.

New member

Posts

Joined
Mon May 26, 2008 11:45 am

Post by Qphoria » Sat Aug 23, 2008 11:23 am

perhaps you dont have the right name?
the file name should be the same as the controller name without the .php on the end

btw the correct spelling is "shipping_cost" not "shiiping_cost"

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by raoshenghong » Sat Aug 23, 2008 11:29 am

I was checked,the file name same as the controller name.
Last edited by raoshenghong on Sat Aug 23, 2008 11:33 am, edited 1 time in total.

New member

Posts

Joined
Mon May 26, 2008 11:45 am

Post by fido-x » Sat Aug 23, 2008 12:42 pm

Go to Admin->Configuration->Users->User Group, there should be an entry there for "Top Administration". Click the update button in the "Action" column. This should load a page with 2 lists ("Access" and "Modify"). You should then select (use control-click) your "shipping_cost" in BOTH lists, then click the save button.

Regards, Fido-X.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Sat Aug 23, 2008 1:00 pm

But i dont think that will solve Page not found... he already fixed the permissions

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Sat Aug 23, 2008 1:08 pm

Did he? If you are referring to-
I got to Admin->Configuration->User->User Group and added "shipping_cost.php" to allow to access and modify,
There is no mention of editing the "Top Administrator".

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Sat Aug 23, 2008 1:10 pm

lol but he said his problem went from "permission denied" to "page not found" so I guess it could be assumed.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Sat Aug 23, 2008 1:24 pm

Agreed. But I don't like to assume anything, after all, he did say that he added "shipping_cost.php". The real question here is, how did he add it?

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by raoshenghong » Mon Aug 25, 2008 12:03 pm

Qphoria wrote: lol but he said his problem went from "permission denied" to "page not found" so I guess it could be assumed.
thank you!your guess is right.but the error keeping on my website.

Page Not Found!
The page you request could not be found!
Last edited by raoshenghong on Mon Aug 25, 2008 2:47 pm, edited 1 time in total.

New member

Posts

Joined
Mon May 26, 2008 11:45 am

Post by raoshenghong » Mon Aug 25, 2008 2:00 pm

fido-x wrote: Agreed. But I don't like to assume anything, after all, he did say that he added "shipping_cost.php". The real question here is, how did he add it?
thank you!
my configuration is right and I created files:
admin/controller/shipping_cost.php
admin/template/default/content/shipping_cost.tpl
admin/language/english/controller/shipping_cost.php

New member

Posts

Joined
Mon May 26, 2008 11:45 am

Post by raoshenghong » Tue Aug 26, 2008 9:30 am

please help me,thanks

New member

Posts

Joined
Mon May 26, 2008 11:45 am

Post by Qphoria » Tue Aug 26, 2008 9:35 am

Perhaps you could set up a temporary FTP & OpenCart Admin access for and PM me the details. Assuming all the files are there, it might just be something small.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by raoshenghong » Tue Aug 26, 2008 4:33 pm

Qphoria wrote: Perhaps you could set up a temporary FTP & OpenCart Admin access for and PM me the details. Assuming all the files are there, it might just be something small.
Thanks again.
There are my files:
file1: /admin/controller/shipping_cost.php

Code: Select all

<?php
class ControllerShippingCost extends Controller {
	function index() {
		$response =& $this->locator->get('response');
		$language =& $this->locator->get('language');
		$template =& $this->locator->get('template');
		$module   =& $this->locator->get('module');

		$language->load('controller/shipping_cost.php');

		$view = $this->locator->create('template');
		
		$view->set('title', $language->get('heading_title'));

		return $view->fetch('content/shipping_cost.tpl');
	}
}
?>
file2: /admin/language/english/controller/shipping_cost.php

Code: Select all

<?php
$_['headin_title']		= 'Shipping Cost';
?>
file3: /admin/template/default/content/shipping_cost.tpl

Code: Select all

<?php echo $title; ?>
and I added "shipping_cost.php" to allow to access and modify for Top Administrator.but the error keeping on the website.

http://www.???.com/admin/index.php?cont ... pping_cost
Page Not Found!
The page you request could not be found!
Last edited by raoshenghong on Wed Aug 27, 2008 9:46 am, edited 1 time in total.

New member

Posts

Joined
Mon May 26, 2008 11:45 am

Post by fido-x » Tue Aug 26, 2008 5:56 pm

Change the line in your "admin/controller/shipping_cost.php" that reads-

Code: Select all

$language->load('controller/review.php');
to read

Code: Select all

$language->load('controller/shipping_cost.php');
Then edit your "admin/language/english/controller/shipping_cost.php" file. Change from

Code: Select all

<?php
$_['headin_title']		= 'Shipping Cost';
?>
to

Code: Select all

<?php
$_['heading_title']		= 'Shipping Cost';
?>
Hope this helps.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by fido-x » Wed Aug 27, 2008 9:27 am

Update to the previous post. Use the following code in your controller:

Code: Select all

<?php
class ControllerShippingCost extends Controller {
	function index() {
		$response =& $this->locator->get('response');

		$language =& $this->locator->get('language');

		$template =& $this->locator->get('template');

		$module   =& $this->locator->get('module');

		$language->load('controller/shipping_cost.php');

		$template->set('title', $language->get('heading_title'));

		$view = $this->locator->create('template');

		$view->set('heading_title', $language->get('heading_title'));

		$template->set('content', $view->fetch('content/shipping_cost.tpl'));

		$template->set($module->fetch());

		$response->set($template->fetch('layout.tpl'));

	}

}
?>
And edit your "admin/template/default/content/shipping_cost.tpl" to read-

Code: Select all

<?php echo $heading_title; ?>
This should get rid of the "Page not found" error.

Regards, Fido-X.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by raoshenghong » Wed Aug 27, 2008 10:17 am

Fido-X,thank you very much.I'm get rid the "Page not found" error.

Sorry,"$language->load('controller/review.php');" is spelling error in here.

Thanks again.

New member

Posts

Joined
Mon May 26, 2008 11:45 am
Who is online

Users browsing this forum: No registered users and 3 guests