Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2009
    Posts
    12
    Plugin Contributions
    0

    red flag Error in my code - please help!

    Experts,
    The following code is displaying only the title ($this->title) and not the other elements on my site! Please help me in finding my error.
    Thanks!

    PHP Code:

     $confirmation 
    = array('title' => $this->title,
                                
    'fields' => array(array('title' => 'Clique no botão "Exibir Boleto" ao lado e após ser exibido o boleto, confirme o Pedido clicando no botão abaixo.',
                                                        
    'field' => zen_draw_form('boleto'MODULE_PAYMENT_BOLETOPHP_URL'post''target=_blank') .
                                                                   
    zen_draw_hidden_field('order_id'$n_pedido'') .
                                                                   
    //zen_draw_hidden_field('local_pagamento', MODULE_PAYMENT_BOLETOPHP_LOCALPAGAMENTO, '') .
                                                                                                                               //zen_draw_hidden_field('agencia', MODULE_PAYMENT_BOLETOPHP_AGENCIA, '') .
                                                                   //zen_draw_hidden_field('conta', MODULE_PAYMENT_BOLETOPHP_CONTA, '') .
                                                                   //zen_draw_hidden_field('convenio', MODULE_PAYMENT_BOLETOPHP_CONVENIO, '') .
                                                                   //zen_draw_hidden_field('contrato', MODULE_PAYMENT_BOLETOPHP_CONTRATO, '') .
                                                                   //zen_draw_hidden_field('formatacao_nosso_numero', MODULE_PAYMENT_BOLETOPHP_NNUMERO, '') .
                                                                   //zen_draw_hidden_field('carteira', MODULE_PAYMENT_BOLETOPHP_CARTEIRA, '') .
                                                                   //zen_draw_hidden_field('cpf_cnpj', MODULE_PAYMENT_BOLETOPHP_CNPJ, '') .
                                                                   //zen_draw_hidden_field('endereco', MODULE_PAYMENT_BOLETOPHP_ENDERECO, '') .
                                                                   //zen_draw_hidden_field('cidade', MODULE_PAYMENT_BOLETOPHP_CIDADE, '') .
                                                                   //zen_draw_hidden_field('cedente', MODULE_PAYMENT_BOLETOPHP_CEDENTE, '') .
                                                                   //zen_draw_hidden_field('demonstrativo', MODULE_PAYMENT_BOLETOPHP_DEMONSTRATIVO, '') .
                                                                   //zen_draw_hidden_field('instrucoes', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES, '') .
                                                                   //zen_draw_hidden_field('instrucoes1', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES1, '') .
                                                                   //zen_draw_hidden_field('instrucoes2', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES2, '') .
                                                                   //zen_draw_hidden_field('instrucoes3', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES3, '') .
                                                                   //zen_draw_hidden_field('instrucoes4', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES4, '') .
                                                                   //zen_draw_hidden_field('data_vencimento', date("d/m/Y", time()+60*60*24*MODULE_PAYMENT_BOLETOPHP_PRAZOVENCIMENTO), '') .
                                                                   
    zen_draw_hidden_field('valor_boleto'$order->info['total'], '') .
                                                    
    zen_draw_hidden_field('sacado_id'session_is_registered('customer_id'), '') .
                                                                   
    zen_draw_hidden_field('sacado'$order->customer['firstname'] . ' ' $order->customer['lastname'], '') .
                                                                   
    zen_draw_hidden_field('endereco_sacado'$order->customer['street_address'] . " - " $order->customer['suburb'] . " / " $order->customer['city'] . "-" $order->customer['state'] . " / " .$order->customer['postcode'], '') .
                                                                   
    zen_draw_input_field('BGB''Exibir Boleto''''submit'true) .
                                                                   
    '</form>')));
    return 
    $confirmation

  2. #2
    Join Date
    Feb 2009
    Posts
    12
    Plugin Contributions
    0

    Default Re: Error in my code - please help!

    Anyone? Please?
    Im still starting out with PHP...
    By the way, the code segment above was ported from OsCommerce...

  3. #3
    Join Date
    Feb 2009
    Posts
    12
    Plugin Contributions
    0

    Default Re: Error in my code - please help!

    Here is the entire function:


    PHP Code:
        function confirmation() {
          global 
    $order$n_pedido;
          global 
    $db;

    $pedido_query $db->Execute("select orders_id from " TABLE_ORDERS " order by orders_id desc limit 0,1");
    $res_pedido $db->Execute($pedido_query);
    if (
    $res_pedido->fields['orders_id'] < 1) {
    $n_pedido 1;
    }else{
    $n_pedido $res_pedido->fields['orders_id'] + 1;
    }
         


     
    $confirmation = array('title' => $this->title,
                                
    'fields' => array(array('title' => 'Clique no botão "Exibir Boleto" ao lado e após ser exibido o boleto, confirme o Pedido clicando no botão abaixo.',
                                                        
    'field' => zen_draw_form('boleto'MODULE_PAYMENT_BOLETOPHP_URL'post''target=_blank') .
                                                                   
    zen_draw_hidden_field('order_id'$n_pedido'') .
                                                                   
    //zen_draw_hidden_field('local_pagamento', MODULE_PAYMENT_BOLETOPHP_LOCALPAGAMENTO, '') .
                                                                                                                               //zen_draw_hidden_field('agencia', MODULE_PAYMENT_BOLETOPHP_AGENCIA, '') .
                                                                   //zen_draw_hidden_field('conta', MODULE_PAYMENT_BOLETOPHP_CONTA, '') .
                                                                   //zen_draw_hidden_field('convenio', MODULE_PAYMENT_BOLETOPHP_CONVENIO, '') .
                                                                   //zen_draw_hidden_field('contrato', MODULE_PAYMENT_BOLETOPHP_CONTRATO, '') .
                                                                   //zen_draw_hidden_field('formatacao_nosso_numero', MODULE_PAYMENT_BOLETOPHP_NNUMERO, '') .
                                                                   //zen_draw_hidden_field('carteira', MODULE_PAYMENT_BOLETOPHP_CARTEIRA, '') .
                                                                   //zen_draw_hidden_field('cpf_cnpj', MODULE_PAYMENT_BOLETOPHP_CNPJ, '') .
                                                                   //zen_draw_hidden_field('endereco', MODULE_PAYMENT_BOLETOPHP_ENDERECO, '') .
                                                                   //zen_draw_hidden_field('cidade', MODULE_PAYMENT_BOLETOPHP_CIDADE, '') .
                                                                   //zen_draw_hidden_field('cedente', MODULE_PAYMENT_BOLETOPHP_CEDENTE, '') .
                                                                   //zen_draw_hidden_field('demonstrativo', MODULE_PAYMENT_BOLETOPHP_DEMONSTRATIVO, '') .
                                                                   //zen_draw_hidden_field('instrucoes', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES, '') .
                                                                   //zen_draw_hidden_field('instrucoes1', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES1, '') .
                                                                   //zen_draw_hidden_field('instrucoes2', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES2, '') .
                                                                   //zen_draw_hidden_field('instrucoes3', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES3, '') .
                                                                   //zen_draw_hidden_field('instrucoes4', MODULE_PAYMENT_BOLETOPHP_INSTRUCOES4, '') .
                                                                   //zen_draw_hidden_field('data_vencimento', date("d/m/Y", time()+60*60*24*MODULE_PAYMENT_BOLETOPHP_PRAZOVENCIMENTO), '') .
                                                                   
    zen_draw_hidden_field('valor_boleto'$order->info['total'], '') .
                                           
    zen_draw_hidden_field('sacado_id'session_is_registered('customer_id'), '') .
                                                                   
    zen_draw_hidden_field('sacado'$order->customer['firstname'] . ' ' $order->customer['lastname'], '') .
                                                                   
    zen_draw_hidden_field('endereco_sacado'$order->customer['street_address'] . " - " $order->customer['suburb'] . " / " $order->customer['city'] . "-" $order->customer['state'] . " / " .$order->customer['postcode'], '') .
                                                                   
    zen_draw_input_field('BGB''Exibir Boleto''''submit'true) .
                                                                   
    '</form>')));



          return 
    $confirmation

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Error in my code - please help!

    Quote Originally Posted by beowulf8 View Post
    By the way, the code segment above was ported from OsCommerce...
    Zencart and OsC are now so far apart that OsC code is very, very different.

    What are you trying to achieve with this code, and where is it located?
    20 years a Zencart User

  5. #5
    Join Date
    Feb 2009
    Posts
    12
    Plugin Contributions
    0

    Default Re: Error in my code - please help!

    It is located inside includes/modules/payment and is a payment module. This is the part of the code that is displayed in the checkout screen. It is supposed to display the title of the module and two buttons. Once you press one of the buttons, it will open a new screen (another php file which is working - MODULE_PAYMENT_BOLETOPHP_URL). The other button confirms the order.

    Here is a clean version of the code:
    PHP Code:
     function confirmation() {
          global 
    $order$n_pedido;
          global 
    $db;

    $pedido_query $db->Execute("select orders_id from " TABLE_ORDERS " order by orders_id desc limit 0,1");
    $res_pedido $db->Execute($pedido_query);
    if (
    $res_pedido->fields['orders_id'] < 1) {
    $n_pedido 1;
    }else{
    $n_pedido $res_pedido->fields['orders_id'] + 1;
    }
         

     
    $confirmation = array('title' => $this->title,
                                
    'fields' => array(array('title' => 'Clique no botão "Exibir Boleto" ao lado e após ser exibido o boleto, confirme o Pedido clicando no botão abaixo.',
                                                        
    'field' => zen_draw_form('boleto'MODULE_PAYMENT_BOLETOPHP_URL'post''target=_blank') .
                                                                   
    zen_draw_hidden_field('order_id'$n_pedido'') .
                                       
    zen_draw_hidden_field('valor_boleto'$order->info['total'], '') .
                                           
    zen_draw_hidden_field('sacado_id'session_is_registered('customer_id'), '') .
                                                                   
    zen_draw_hidden_field('sacado'$order->customer['firstname'] . ' ' $order->customer['lastname'], '') .
                                                                   
    zen_draw_hidden_field('endereco_sacado'$order->customer['street_address'] . " - " $order->customer['suburb'] . " / " $order->customer['city'] . "-" $order->customer['state'] . " / " .$order->customer['postcode'], '') .
                                                                   
    zen_draw_input_field('BGB''Exibir Boleto''''submit'true) .
                                                                   
    '</form>')));


          return 
    $confirmation

  6. #6
    Join Date
    Feb 2009
    Posts
    12
    Plugin Contributions
    0

    Default Re: Error in my code - please help!

    I am almost sure that the error is here:

    PHP Code:

    $pedido_query 
    $db->Execute("select orders_id from " TABLE_ORDERS " order by orders_id desc limit 0,1");
    $res_pedido $db->Execute($pedido_query); 
    Please help!!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Error in my code - please help!

    Quote Originally Posted by beowulf8 View Post
    PHP Code:
    $pedido_query $db->Execute("select orders_id from " TABLE_ORDERS " order by orders_id desc limit 0,1");
    $res_pedido $db->Execute($pedido_query); 
    Why are you doing $db->Execute on the actual query directly, and then doing $db->Execute again on the query results immediately afterward?
    .

    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.

 

 

Similar Threads

  1. Please help, code error...
    By ~Carla~ in forum General Questions
    Replies: 0
    Last Post: 17 Mar 2008, 10:59 AM
  2. Self-Inflicted Code Error! Please HELP!?!
    By willandjenny in forum General Questions
    Replies: 0
    Last Post: 8 Dec 2007, 06:59 PM
  3. Please Help, Error in code somewhere
    By stumped in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2006, 11:15 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