Page 9 of 9 FirstFirst ... 789
Results 81 to 84 of 84
  1. #81
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Adding Field to Checkout

    Sorry to bump this post. The first page instructions work great for 1.5.4. I now have working field order_frequent_code populated from checkout_shipping page.
    I am trying to echo order_frequent_code in admin/orders.php page, I have tried number of different things but missing something. Maybe someone has the done it already.

    Here is my 1.5.4 modified code attempt:

    admin/order.php

    PHP Code:
      <?php echo $order->fields['frequent_code']; ?> <?php echo zen_date_long($order->info['frequent_code']); ?> <?php echo zen_draw_input_field('frequent_code'); ?> d </td>

    ==============================================================

    <?php// create search filter  $search = '';  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {    $search_distinct = ' ';    $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));    $search = " and (o.customers_city like '%" . $keywords . "%' or o.customers_postcode like '%" . $keywords . "%' or o.date_purchased like '%" . $keywords . "%' or o.billing_name like '%" . $keywords . "%' or o.billing_company like '%" . $keywords . "%' or o.billing_street_address like '%" . $keywords . "%' or o.delivery_city like '%" . $keywords . "%' or o.delivery_postcode like '%" . $keywords . "%' or o.delivery_name like '%" . $keywords . "%' or o.delivery_company like '%" . $keywords . "%' or o.delivery_street_address like '%" . $keywords . "%' or o.billing_city like '%" . $keywords . "%' or o.billing_postcode like '%" . $keywords . "%' or o.customers_email_address like '%" . $keywords . "%' or o.customers_name like '%" . $keywords . "%' or o.customers_company like '%" . $keywords . "%' or o.customers_street_address  like '%" . $keywords . "%' or o.order_frequent_code  like '%"  . $keywords . "%' or o.customers_telephone like '%" . $keywords . "%' or o.ip_address  like '%" . $keywords . "%')";    $new_table = '';//    $new_fields = ", o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.order_frequent_code, o.ip_address ";  }} // eof: search orders or orders_products    $new_fields = ", o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.order_frequent_code, o.ip_address ";?>

    OR ============================================

    <?php    if (isset($_GET['cID'])) {      $cID zen_db_prepare_input($_GET['cID']);      $orders_query_raw =   "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.frequent_code, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" .                            $new_fields "                            from (" TABLE_ORDERS_STATUS " s, " .                            TABLE_ORDERS " o " .                            $new_table ")                            left join " TABLE_ORDERS_TOTAL " ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') " "                            where o.customers_id = '" . (int)$cID "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$_SESSION['languages_id'] . "' order by orders_id DESC";
    //echo '<BR><BR>I SEE A: ' . $orders_query_raw . '<BR><BR>';
        
    } elseif ($_GET['status'] != '') {      $status zen_db_prepare_input($_GET['status']);      $orders_query_raw "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.frequent_code, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" .                          $new_fields "                          from (" TABLE_ORDERS_STATUS " s, " .                          TABLE_ORDERS " o " .                          $new_table ")                          left join " TABLE_ORDERS_TOTAL " ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') " "                          where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$_SESSION['languages_id'] . "' and s.orders_status_id = '" . (int)$status "'  " .                          $search " order by o.orders_id DESC";
    //echo '<BR><BR>I SEE B: ' . $orders_query_raw . '<BR><BR>';
        
    } else {      $orders_query_raw "select " $search_distinct " o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.frequent_code, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total" .                          $new_fields "                          from (" TABLE_ORDERS_STATUS " s, " .                          TABLE_ORDERS " o " .                          $new_table ")                          left join " TABLE_ORDERS_TOTAL " ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') " "                          where (o.orders_status = s.orders_status_id and s.language_id = '" . (int)$_SESSION['languages_id'] . "')  " .                          $search " order by o.orders_id DESC";
    //echo '<BR><BR>I SEE C: ' . $orders_query_raw . '<BR><BR>';
        
    }
    // Split Page


    admin/includes/classes/order.php
    line 62
    PHP 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_cvv' => $order->fields['cc_cvv'],                          'cc_expires' => $order->fields['cc_expires'],                          'date_purchased' => $order->fields['date_purchased'],                          'orders_status' => $order->fields['orders_status'],                          'total' => $order->fields['order_total'],                          'tax' => $order->fields['order_tax'],                          'last_modified' => $order->fields['last_modified'],                          'ip_address' => $order->fields['ip_address'],                         'order_frequent_code' => $order->fields['frequent_code']); 
    line 23

    PHP Code:
        function query($order_id) {      global $db;      $order $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,                                    customers_suburb, customers_city, customers_postcode, customers_id,                                    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,                                    coupon_code, payment_method, payment_module_code, shipping_method, shipping_module_code,                                    cc_type, cc_owner, cc_number, cc_expires, currency,                                    currency_value, date_purchased, orders_status, last_modified,                                    order_total, order_tax, order_frequent_code, ip_address                             from " TABLE_ORDERS "                             where orders_id = '" . (int)$order_id "'"); 

  2. #82
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Adding Field to Checkout

    Did you also do:

    Quote Originally Posted by example
    $order_query = "... order_flight_airline, order_flight_num, order_flight_arv, order_flight_dep, ...
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #83
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Adding Field to Checkout

    Quote Originally Posted by cpannek and others View Post
    Need to add fields onto the checkout payment page
    ......
    it wont populate in my database.
    Kuroi gave answer on page 1. To clarify:

    EDIT
    includes/modules/pages/checkout_confirmation/header_php.php

    FIND
    $_SESSION['comments'] = $_POST['comments'];

    ADD
    under it
    PHP Code:
    if (isset($_SESSION['frequent_code'])) {$frequent_code $_SESSION['frequent_code'];}

    if (
    zen_not_null($_POST['frequent_code'])) {$_SESSION['frequent_code'] = zen_db_prepare_input($_POST['frequent_code']);}
    $frequent_code $_SESSION['frequent_code']; 




    ALSO I added the same code to includes/modules/pages/checkout_payment/header_php.php (but probably just need to add it to checkout_confirmation/header_php.php)

    EDIT
    includes/modules/pages/checkout_payment/header_php.php

    ADD
    PHP Code:
    if (isset($_SESSION['frequent_code'])) {$frequent_code $_SESSION['frequent_code'];}

    if (
    zen_not_null($_POST['frequent_code'])) {$_SESSION['frequent_code'] = zen_db_prepare_input($_POST['frequent_code']);}
    $frequent_code $_SESSION['frequent_code']; 

    UNDER $_SESSION['comments'] = $_POST['comments'];
    Last edited by vandiermen; 22 Jan 2016 at 06:13 AM.

  4. #84
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Adding Field to Checkout

    Quote Originally Posted by vandiermen View Post
    I am trying to echo order_frequent_code in admin/orders.php page, I have tried number of different things but missing something. Maybe someone has the done it already.
    Thanks.
    Here is working code:

    EDIT
    admin/includes/classes/order.php

    CHANGE
    PHP Code:
                                        currency_valuedate_purchasedorders_statuslast_modified,
                                        
    order_totalorder_taxip_address 
    TO
    PHP Code:
     currency_valuedate_purchasedorders_statuslast_modified,
                                        
    order_totalorder_taxorder_frequent_codeip_address 
    (under function query($order_id) {)


    FIND
    PHP Code:
    $order->fields['last_modified'],
                              
    'ip_address' => $order->fields['ip_address'], 
    CHANGE TO
    PHP Code:
    $order->fields['last_modified'],                          'ip_address' => $order->fields['ip_address'],                          'order_frequent_code' => $order->fields['order_frequent_code'], 
    EDIT
    admin/order.php

    ADD

    PHP Code:
              <tr>                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif''1''5'); ?></td>              </tr>              <tr>                <td class="main"><strong><?php echo "Orders Frequent Code:"?></strong></td>                <td class="main"><?php echo $order->info['order_frequent_code']; ?></td>              </tr>
    where you want the code to be echoed

    I was so close the first time...

 

 
Page 9 of 9 FirstFirst ... 789

Similar Threads

  1. v151 Adding custom field during checkout
    By hues in forum General Questions
    Replies: 1
    Last Post: 9 Nov 2012, 10:39 PM
  2. Adding Field to Checkout
    By earlygrayte in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 17 Feb 2012, 03:00 PM
  3. Adding select field to checkout
    By ETbyrne in forum Managing Customers and Orders
    Replies: 1
    Last Post: 22 Aug 2008, 02:34 AM
  4. adding a field to checkout and db
    By StevenB in forum General Questions
    Replies: 0
    Last Post: 20 May 2007, 12:57 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR