Author Topic: account.order_detail.tpl.php extra fields  (Read 2678 times)

nesomis

  • Beginner
  • *
  • Posts: 6
account.order_detail.tpl.php extra fields
« on: March 03, 2012, 21:12:18 pm »
VM 1.1.9
Joomla 1.5.25

\components\com_virtuemart\themes\default\templates\pages\account.order_detail.tpl.php

I want to extend this template with some form for bank payment. I need full name, address1, ZIP and city. I want to put these 4 or 5 data into one table field.

Unfortunatelly, I dont know how.  :-[

Please help. Really need this.

nesomis

  • Beginner
  • *
  • Posts: 6
Re: account.order_detail.tpl.php extra fields
« Reply #1 on: March 17, 2012, 09:19:32 am »
I Must cut the code because exceeds 20000 characters.

Look at bottom of code.
HERE I NEED ....
HERE I NEED ....
HERE I NEED ....
HERE I NEED ....

Code: [Select]
...
                  <td><?php 
                
$details explode"|"$db->f("ship_method_id"));
                echo $details[1];
                    ?>
&nbsp;
                </td>
                <td><?php 
                echo 
$details[2];
                    ?>

                </td>
                <td><?php 
                     echo 
$CURRENCY_DISPLAY->getFullValue($details[3], ''$db->f('order_currency'));
                    ?>

                </td>
              </tr>
            </table>
          </td>
        </tr>
       
      </table>
    </td>
  </tr><?php
  }

  ?>

  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <!-- Begin Order Items Information -->
  <tr class="sectiontableheader">
    <th align="left" colspan="2"><?php echo $VM_LANG->_('PHPSHOP_ORDER_ITEM'?></th>
  </tr>
  <tr>
    <td colspan="4">
<?php
$dbdl = new ps_DB;
/* Check if the order has been paid for */
if ($db->f("order_status") == ENABLE_DOWNLOAD_STATUS && ENABLE_DOWNLOADS) {

$q "SELECT `download_id` FROM #__{vm}_product_download WHERE";
$q .= " order_id =" .(int)$vars["order_id"];
$dbdl->query($q);

// $q = "SELECT * FROM #__{vm}_product_download WHERE order_id ='" . $db->f("order_id")
// $dbbt->query($q);


// check if download records exist for this purchase order
if ($dbdl->next_record()) {
echo "<b>" $VM_LANG->_('PHPSHOP_DOWNLOADS_CLICK') . "</b><br /><br />";

echo($VM_LANG->_('PHPSHOP_DOWNLOADS_SEND_MSG_3').DOWNLOAD_MAX.". <br />");

$expire = ((DOWNLOAD_EXPIRE 60) / 60) / 24;
echo(str_replace("{expire}"$expire$VM_LANG->_('PHPSHOP_DOWNLOADS_SEND_MSG_4')));

echo "<br /><br />";
}
//else {
//echo "<b>" . $VM_LANG->_('PHPSHOP_DOWNLOADS_EXPIRED') . "</b><br /><br />";
//}
}
?>

    </td>
  </tr>
  <!-- END HACK EUGENE -->
  <tr>
    <td colspan="2">
      <table width="100%" cellspacing="0" cellpadding="2" border="0">
        <tr align="left">
          <th><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_QTY'?></th>
          <th><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_NAME'?></th>
          <th><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_SKU'?></th>
          <th><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_PRICE'?></th>
          <th align="right"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_TOTAL'?>&nbsp;&nbsp;&nbsp;</th>
        </tr>
        <?php
        
$dbcart = new ps_DB;
        $q  "SELECT * FROM #__{vm}_order_item ";
        $q .= "WHERE #__{vm}_order_item.order_id='$order_id' ";
        $dbcart->query($q);
        $subtotal 0;
        $dbi = new ps_DB;
$dbdel = new ps_DB;

        while ($dbcart->next_record()) {

         if ($db->f("order_status") == ENABLE_DOWNLOAD_STATUS && ENABLE_DOWNLOADS) {
         /* search for download record that corresponds to this order item */
         $q "SELECT `download_id`, `file_name`, `download_max`, `end_date` FROM #__{vm}_product_download WHERE";
         $q .= " `order_id`=" intval($vars["order_id"]);
         $q .= " AND `product_id`="intval($dbcart->f("product_id"));
         $dbdl->query($q);

         }
         /* END HACK EUGENE */

         $product_id null;

// ***** Add product_publish to SELECT statement.

         $dbi->query"SELECT product_id, product_publish FROM #__{vm}_product WHERE product_sku='".$dbcart->f("order_item_sku")."'");
         $dbi->next_record();
         $product_id $dbi->f("product_id" );

// ***** Set new flag to guard against the output of the product link by checking existance of product and its published status.

$link_to_product = (!empty( $product_id ) && ($dbi->f('product_publish') == 'Y'));
?>

        <tr align="left">
          <td valign="top"><?php $dbcart->p("product_quantity"); ?></td>
          <td valign="top"><?php
              if (
$dbdl->next_record()) {

// First output a link to the product or just the product name if the product has been removed.

if( $link_to_product) {
echo '<a href="'.$sess->url$mm_action_url."index.php?page=shop.product_details&product_id=$product_id") .'" title="'.$dbcart->f("order_item_name").'">';
}

   echo $dbcart->f("order_item_name");

if( $link_to_product) {
echo "</a>";
}

// ***** This is all new code to output multiple links and download expiration details.

// Now loop through each download and output links to each filename.

do {

$download_id $dbdl->f('download_id');
$download_max = (int)$dbdl->f('download_max');
$end_date = (int)$dbdl->f('end_date');
$time time();

// If the download has maxed out or expired then delete it from the database and don't display it.

if (($download_max 1) || (($end_date != 0) && ($time $end_date))) {
$q ="DELETE FROM #__{vm}_product_download";
$q .=" WHERE download_id = '" $download_id "'";
$dbdel->query($q);
$dbdel->next_record();
} else {

// Hyperlink the downloadable order item direct to the downloadFunction.

// ***** NOTE: URL changed to directly access download file.
// ***** NOTE: May wish to consider adding classname to <p> for easier control of layout and maybe change <p> to <div>.

$url $sess->url$mm_action_url."/index.php?option=com_virtuemart&page=shop.downloads&func=downloadRequest");
echo '<p><a href="'."$url&download_id=".$download_id.'" title="'.$VM_LANG->_('PHPSHOP_DOWNLOADS_LINK').'">'
'<img src="'.VM_THEMEURL.'images/download.png" alt="'.$VM_LANG->_('PHPSHOP_DOWNLOADS_LINK').'" align="left" border="0" />'
$dbdl->f('file_name')
'</a><br/>(';

// Output downloads remaining and expiration date.

// ***** NOTE: May wish to set this up as a configuration option or leave it to the developer as it is in a theme template.

if ($download_max 1)
echo str_replace("{count}"$download_max$VM_LANG->_('PHPSHOP_DOWNLOADS_REMAINING'));
else
echo str_replace("{count}"$download_max$VM_LANG->_('PHPSHOP_DOWNLOAD_REMAINING'));

if ($end_date 0)
echo str_replace("{date}"date('d/m/y'$end_date), $VM_LANG->_('PHPSHOP_DOWNLOAD_VALID_UNTIL'));


echo ')<p>';
}
   } while ($dbdl->next_record());
  }
         else {

// ***** Change guard to use new flag $link_to_product instead of !empty( $product_id )

         if( $link_to_product) {
           echo '<a href="'.$sess->url$mm_action_url."index.php?page=shop.product_details&product_id=$product_id") .'" title="'.$dbcart->f("order_item_name").'">';
           }
           $dbcart->p("order_item_name");
           echo " <div style=\"font-size:smaller;\">" $dbcart->f("product_attribute") . "</div>";

// ***** Change guard to use new flag $link_to_product instead of !empty( $product_id )

           if( $link_to_product) {
           echo "</a>";
           }
         }
?>

          </td>
          <td valign="top"><?php $dbcart->p("order_item_sku"); ?></td>
          <td valign="top"><?php /*
$price = $ps_product->get_price($dbcart->f("product_id"));
$item_price = $price["product_price"]; */
if( $auth["show_price_including_tax"] ){
$item_price $dbcart->f("product_final_price");
}
else {
$item_price $dbcart->f("product_item_price");
}
echo $CURRENCY_DISPLAY->getFullValue($item_price''$db->f('order_currency'));

           ?>
</td>
          <td valign="top" align="right"><?php $total $dbcart->f("product_quantity") * $item_price
          $subtotal += $total;
          echo $CURRENCY_DISPLAY->getFullValue($total''$db->f('order_currency'));
           ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr><?php
        }
?>

        <tr>
          <td colspan="4" align="right">&nbsp;&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_SUBTOTAL'?> :</td>
          <td align="right"><?php echo $CURRENCY_DISPLAY->getFullValue($subtotal''$db->f('order_currency')) ?>&nbsp;&nbsp;&nbsp;</td>
        </tr>
<?php 
/* COUPON DISCOUNT */
$coupon_discount $db->f("coupon_discount");
$order_discount $db->f("order_discount");

if( PAYMENT_DISCOUNT_BEFORE == '1') {
if (($db->f("order_discount") != 0)) {
?>

          <tr>
              <td colspan="4" align="right"><?php 
              if( 
$db->f("order_discount") > 0)
              echo $VM_LANG->_('PHPSHOP_PAYMENT_METHOD_LIST_DISCOUNT');
              else
              echo $VM_LANG->_('PHPSHOP_FEE');
                ?>
:
              </td>
              <td align="right"><?php
              if (
$db->f("order_discount") > ) {
               echo "- ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")), ''$db->f('order_currency'));
              }
              elseif ($db->f("order_discount") < )  {
               echo "+ ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")), ''$db->f('order_currency'));
              } 
              ?>

              &nbsp;&nbsp;&nbsp;</td>
          </tr>
       
        <?php 
}
if( $coupon_discount ) {
?>

        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_('PHPSHOP_COUPON_DISCOUNT'?>:
          </td>
          <td align="right"><?php
            echo 
"- ".$CURRENCY_DISPLAY->getFullValue$coupon_discount''$db->f('order_currency') ); ?>
&nbsp;&nbsp;&nbsp;
          </td>
        </tr>
<?php
}
}
?>
       
        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_SHIPPING'?> :</td>
          <td align="right"><?php 
          
$shipping_total $db->f("order_shipping");
          if ($auth["show_price_including_tax"] == 1)
          $shipping_total += $db->f("order_shipping_tax");
          echo $CURRENCY_DISPLAY->getFullValue($shipping_total''$db->f('order_currency'));

            ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr>
  <?php
  
$tax_total $db->f("order_tax") + $db->f("order_shipping_tax");
  if ($auth["show_price_including_tax"] == 0) {
  ?>

        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_TOTAL_TAX'?> :</td>
          <td align="right"><?php 

          echo $CURRENCY_DISPLAY->getFullValue($tax_total''$db->f('order_currency'));
            ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr>
<?php
  }
  if( PAYMENT_DISCOUNT_BEFORE != '1') {
   if (($db->f("order_discount") != 0)) {
?>

          <tr>
              <td colspan="4" align="right"><?php 
              if( 
$db->f("order_discount") > 0)
              echo $VM_LANG->_('PHPSHOP_PAYMENT_METHOD_LIST_DISCOUNT');
              else
              echo $VM_LANG->_('PHPSHOP_FEE');
                ?>
:
              </td>
              <td align="right"><?php
              if (
$db->f("order_discount") > )
              echo "- ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")), ''$db->f('order_currency'));
              elseif ($db->f("order_discount") < )
                 echo "+ ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")), ''$db->f('order_currency')); ?>

              &nbsp;&nbsp;&nbsp;</td>
          </tr>
       
        <?php 
  
}
   if( $coupon_discount ) {
?>

        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_('PHPSHOP_COUPON_DISCOUNT'?>:
          </td>
          <td align="right"><?php
            echo 
"- ".$CURRENCY_DISPLAY->getFullValue$coupon_discount''$db->f('order_currency') ); ?>
&nbsp;&nbsp;&nbsp;
          </td>
        </tr>
<?php
  
}
  }
?>
      <tr>
          <td colspan="3" align="right">&nbsp;</td>
          <td colspan="2" align="right"><hr/></td>
        </tr>
        <tr>
          <td colspan="4" align="right">
          <strong><?php echo $VM_LANG->_('PHPSHOP_CART_TOTAL') .": "?></strong>
          </td>
         
          <td align="right"><strong><?php  
          
$total $db->f("order_total");
          echo $CURRENCY_DISPLAY->getFullValue($total''$db->f('order_currency'));
          ?>
</strong>&nbsp;&nbsp;&nbsp;</td>
        </tr>
  <?php
  if (
$auth["show_price_including_tax"] == 1) {
  ?>

       
        <tr>
          <td colspan="3" align="right">&nbsp;</td>
          <td colspan="2" align="right"><hr/></td>
        </tr>
        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_TOTAL_TAX'?> :</td>
          <td align="right"><?php 

          echo $CURRENCY_DISPLAY->getFullValue($tax_total''$db->f('order_currency'));
  
            ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr>
<?php
  }
  ?>
    <tr>
          <td colspan="3" align="right">&nbsp;</td>
          <td colspan="2" align="right"><hr/></td>
        </tr>
        <tr>
          <td colspan="3" align="right">&nbsp;</td>
          <td colspan="2" align="right"><?php 
echo ps_checkout::show_tax_details$db->f('order_tax_details'), $db->f('order_currency') );
            ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
  <!-- End Order Items Information -->

<br />

  <!-- Begin Payment Information -->

      <table width="100%">
      <tr class="sectiontableheader">
        <th align="left" colspan="2"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_PAYINFO_LBL'?></th>
      </tr>
      <tr>
        <td width="20%"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_PAYMENT_LBL'?> :</td>
        <td><?php $dbpm->p("payment_method_name"); ?> </td>
      </tr>
  <?php
  require_once(CLASSPATH.'ps_payment_method.php');
  $ps_payment_method = new ps_payment_method;
  $payment $dbpm->f("payment_method_id");

  if ($ps_payment_method->is_creditcard($payment)) {

   // DECODE Account Number
   $dbaccount = new ps_DB;
   $q 'SELECT '.VM_DECRYPT_FUNCTION.'(order_payment_number,\''.ENCODE_KEY.'\') as account_number 
   FROM #__{vm}_order_payment WHERE order_id=\''
.$order_id.'\'';
   $dbaccount->query($q);
        $dbaccount->next_record();
        if( $dbaccount->f("order_payment_name")) {
        ?>
       
      <tr>
        <td width="10%"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_ACCOUNT_NAME'?> :</td>
        <td><?php $dbpm->p("order_payment_name"); ?> </td>
      </tr>
      <?php 
  }
      if( $dbaccount->f("account_number")) {?>

      <tr>
        <td><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_ACCOUNT_NUMBER'?> :</td>
        <td> <?php echo ps_checkout::asterisk_pad($dbaccount->f("account_number"),4);
    ?>
</td>
      </tr>
      <?php 
      }
      if( $dbpm->f("order_payment_expire") ) {
      ?>

      <tr>
        <td><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_EXPIRE_DATE'?> :</td>
        <td><?php echo $dbpm->f("order_payment_expire") ? strftime("%m - %Y"$dbpm->f("order_payment_expire")) : ''?> </td>
      </tr>
  <?php
      } 
   } ?>

      <!-- end payment information -->
      </table>

<?php // }

    /** Print out the customer note **/
    if ( $db->f("customer_note") ) {
    ?>

    <table width="100%">
      <tr>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr class="sectiontableheader">
        <th align="left" colspan="2"><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_CUSTOMER_NOTE'?></th>
      </tr>
      <tr>
        <td colspan="2">
         <?php echo nl2br($db->f("customer_note"))."<br />"?>
       </td>
      </tr>
    </table>
    <?php
    }
}
else {
echo '<h4>'._LOGIN_TEXT .'</h4><br/>';
include(PAGEPATH.'checkout.login_form.php');
echo '<br/><br/>';
}
?>


<div style="width:100%;height:374px;border-top:dashed #000 1px;padding:10px 0px">
  <div class="nalogzauplatu">НАЛОГ ЗА УПЛАТУ</div>
    <div style="width:100%;padding:5px">
<div style="width:48%;float:left;padding:5px">
        <div style="width:100%;height:20px;font:10px">уплатилац</div>
            <div style="width:100%;height:50px;border:solid #000 1px">


HERE I NEED FULL NAME,
HERE I NEED ADDRESS1,
HERE I NEED ZIP AND
HERE I NEED CITY

            </div>
            <div style="width:100%;height:20px;font:10px">сврха уплате</div>
            <div style="width:100%;height:50px;border:solid #000 1px;padding:14px">IPG</div>
            <div style="width:100%;height:20px;font:10px">прималац</div>
            <div style="width:100%;height:50px;border:solid #000 1px; padding:5px 14px"> NESOMIS</div>
            <div style="width:51%;height:30px;border-bottom:solid #000 2px">&nbsp;</div>
            <div style="width:51%;font:10px">печат и потпис уплатиоца</div>           
  </div>
        ...