1

I'd like to add a external file to the CS Cart.

In the admin view I have a link:

{include file="buttons/button_popup.tpl" but_text=Check but_href="orders.check?order_id=`$order_info.order_id`" but_role="tool"}

For this in the orders.php file I added a function:

} elseif ($mode == 'check') {
    if (!empty($_REQUEST['order_id'])) {
    $order_info = fn_get_order_info($_REQUEST['order_id']);
        if (empty($order_info)) {
            return array(CONTROLLER_STATUS_NO_PAGE);
        }

    $view_mail->assign('order_info', $order_info);

        $view_mail->display('orders/check.php');

        exit;

    }

So with this code I'm trying to access a php file that is located in the orders folder.. it doesn't matter, it could be located in the root folder too.

I want my external script to work with Smarty Class, I'd like to get oder_id in my code in order to work with it in my code.

I was working fine, but after my client changed the design (skin) it's breaking down.

in the pup-up window I'm getting this error:

Warning: Smarty error: unable to read resource: "orders/check.php" in D:\Server\xampp\htdocs\tele\lib\templater\Smarty.class.php on line 1095
mrGott
  • 1,066
  • 3
  • 18
  • 53

2 Answers2

0

Try using the absolute path on the server to 'orders/check.php'.

The problem seams to be, that the URL of the pop up window calls a script in a different directory, so the path 'orders/check.php' is not valid from there.

JochenJung
  • 7,183
  • 12
  • 64
  • 113
  • - no, it's doesn't work.. the problem still remains the same: Warning: Smarty error: unable to read resource: "http://localhost/tele/skins/basic/admin/views/orders/check.php" in D:\Server\xampp\htdocs\tele\lib\templater\Smarty.class.php on line 1095 – mrGott Dec 28 '11 at 19:44
  • No, with absolute path, I mean the servers absolute path D:/Server/xampp/htdocs/tele/skins/basic/admin/views/orders/check.php – JochenJung Dec 28 '11 at 21:10
0

I just solved my problem.

The reason why the function that I wrote broke down was the change of the template. this function with the variable $view_mail->display(' that calls a file from the USER side template. it's inside the skins->YOURTEMPLATE->mail->orders

I was calling the file that really didn't exist there.

So just in case someone encounters the same problem, trace the everything till the file location. :)

Cheers!!!

mrGott
  • 1,066
  • 3
  • 18
  • 53