Results 1 to 1 of 1
  1. #1
    Join Date
    Sep 2008
    Posts
    1
    Plugin Contributions
    0

    red flag Help showing a custom field to the admin orders.php

    Hello to all,

    I am getting crazy with a small modification I am making to a ZC installation.
    I have added a new field to the orders table, which gets fullfilled with a URL (literal) when the customer checks out. No problem with that part.

    Now, I am wanting to show this field in the Admin->Orders page and after over six hours working with it, I cant get it to work

    I tried to modify the order.php query function to include this field

    First modification: Add the field to the select query: (order_attach is the name of the new field)

    Code:
    $order_query = "select order_attach, customers_id, customers_name, customers_company,
                             customers_street_address, customers_suburb, customers_city,
                             customers_postcode, customers_state, customers_country,
                             customers_telephone, customers_email_address, customers_address_format_id,
                             delivery_name, delivery_company, delivery_street_address, delivery_suburb,
                             delivery_city, delivery_postcode, delivery_state, delivery_country,
                             delivery_address_format_id, billing_name, billing_company,
                             billing_street_address, billing_suburb, billing_city, billing_postcode,
                             billing_state, billing_country, billing_address_format_id,
                             payment_method, payment_module_code, shipping_method, shipping_module_code,
                             coupon_code, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value,
                             date_purchased, orders_status, last_modified, order_total, order_tax, ip_address 
    						 from " . TABLE_ORDERS . "
                            where orders_id = '" . (int)$order_id . "'";
    Then I included this field in the $order->info array

    Code:
        $this->info = array('currency' => $order->fields['currency'],
                            'currency_value' => $order->fields['currency_value'],
                            'payment_method' => $order->fields['payment_method'],
                            'payment_module_code' => $order->fields['payment_module_code'],
                            'shipping_method' => $order->fields['shipping_method'],
                            'shipping_module_code' => $order->fields['shipping_module_code'],
                            'coupon_code' => $order->fields['coupon_code'],
                            'cc_type' => $order->fields['cc_type'],
                            'cc_owner' => $order->fields['cc_owner'],
                            'cc_number' => $order->fields['cc_number'],
                            'cc_expires' => $order->fields['cc_expires'],
                            'date_purchased' => $order->fields['date_purchased'],
                            'orders_status' => $order_status->fields['orders_status_name'],
                            'last_modified' => $order->fields['last_modified'],
                            'total' => $order->fields['order_total'],
                            'tax' => $order->fields['order_tax'],
                            'ip_address' => $order->fields['ip_address'],
    						'order_attach' => $order->fields['order_attach']);
    Then I added this code to the orders.php page:

    Code:
               <td class="main"><?php echo $order->info ['order_attach']; ?></td>
    Nada. Nothing. The field value does not show using the modified functions in order.php

    ----------------------------------

    After this I tried to read directly the data from orders.php, without using the function query in order.php. This is the code I wrote:

    Code:
    		   /**/
    		   function show_attach()
    		   {
    		       global $db;
    			   $attach=$db->Execute("SELECT order_attach FROM zen_orders WHERE orders_id='$oID'");
    			   echo (string)$attach;
    		   }
    It does not work either กกก

    Can someone please have a quick look to this issue, and tell me what I am doing wrong ?ฟ

    (Additionally --> I tested the SQL queries directly in PHPMyAdmin and they work fine there, and they give me the value กกก)
    Last edited by jeronij; 27 Sep 2008 at 11:52 AM. Reason: small code correction

 

 

Similar Threads

  1. v151 Free orders not showing up in the admin/customer/orders
    By jodean in forum Managing Customers and Orders
    Replies: 10
    Last Post: 12 Jan 2016, 05:23 PM
  2. How do I add an order field to the admin orders page?
    By izar74 in forum General Questions
    Replies: 4
    Last Post: 4 Jun 2015, 07:53 PM
  3. Custom Field in Admin orders super_orders
    By sbbemn in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 24 Jan 2012, 04:34 PM
  4. Creating a custom button on the admin orders.php page
    By vooboo13 in forum Managing Customers and Orders
    Replies: 0
    Last Post: 12 Jan 2011, 04:33 PM
  5. How to display custom field values on admin/invoice.php?
    By flashmxfreak in forum General Questions
    Replies: 0
    Last Post: 4 Jul 2010, 12:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg