Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NIF (VAT NUMBER) in customer email confirmation


driven22

Recommended Posts

How to pull invoice information from the database that is in (table-orders-YOUR_NEW_BOX) to customer e-mail confirmation in Phoenix version? Data saved in the field Orders - YOUR_NEW_BOX are displayed without any problems in the admin side, they are remembered when typing in checkout_payment but are invisible in the e-mail.

file tpl_n_checkout.php:

<?php
/*
  $Id$

  CE Phoenix, E-Commerce made Easy
  https://phoenixcart.org

  Copyright (c) 2021 Phoenix Cart

  Released under the GNU General Public License
*/

// let's start with the email confirmation
  echo STORE_NAME . "\n"
     . MODULE_NOTIFICATIONS_CHECKOUT_SEPARATOR . "\n"
     . MODULE_NOTIFICATIONS_CHECKOUT_TEXT_ORDER_NUMBER . ' ' . $order->get_id() . "\n"
     . MODULE_NOTIFICATIONS_CHECKOUT_TEXT_INVOICE_URL . ' '
     . tep_href_link('account_history_info.php', 'order_id=' . $order->get_id(), 'SSL', false) . "\n"
     . MODULE_NOTIFICATIONS_CHECKOUT_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"
     . EMAIL_TEXT_CUSTOMER_NAME . ' ' . $order->customer['firstname'] . ' ' . $order->customer['lastname']  . "\n"
     . EMAIL_TEXT_CUSTOMER_EMAIL_ADDRESS .' '. $order->customer['email_address'] . "\n"
      . MODULE_CUSTOMER_DATA_TELEPHONE . ' '.$order->customer['telephone']. "\n\n";

if (!empty($order->info['comments'])) {
    echo tep_db_output($order->info['comments']) . "\n";
  }

  //not working
//if (!empty($order->info['YOUR_NEW_BOX'])) {
//echo tep_db_output($order->info['YOUR_NEW_BOX']) . "\n";
//}


  echo MODULE_NOTIFICATIONS_CHECKOUT_TEXT_PRODUCTS . "\n"
     . MODULE_NOTIFICATIONS_CHECKOUT_SEPARATOR . "\n";
  foreach ($order->products as $product) {
    echo "\n" . $product['qty']
       . ' x ' . $product['name']
       . (empty($product['model']) ? '' : ' (' . $product['model'] . ')')
       . ' = ' . $GLOBALS['currencies']->display_price($product['final_price'], $product['tax'], $product['qty']);

//------insert customer chosen option to order--------
    foreach (($product['attributes'] ?? []) as $attribute) {
      echo "\n\t" . $attribute['option'] . ' ' . $attribute['value'];
    }
//------insert customer chosen option eof ----
  }
  echo "\n" . MODULE_NOTIFICATIONS_CHECKOUT_SEPARATOR . "\n";

  foreach ($order->totals as $order_total) {
    echo strip_tags($order_total['title']) . ' ' . strip_tags($order_total['text']) . "\n";
  }

  if ($order->content_type != 'virtual') {
    echo "\n" . MODULE_NOTIFICATIONS_CHECKOUT_TEXT_DELIVERY_ADDRESS . "\n"
       . MODULE_NOTIFICATIONS_CHECKOUT_SEPARATOR . "\n"
       . $customer->make_address_label($order->delivery, 0, '', "\n") . "\n";
  }

  echo "\n" . MODULE_NOTIFICATIONS_CHECKOUT_TEXT_BILLING_ADDRESS . "\n"
     . MODULE_NOTIFICATIONS_CHECKOUT_SEPARATOR . "\n"
     . $customer->make_address_label($order->billing, 0, '', "\n") . "\n\n";

  $payment = $GLOBALS[$_SESSION['payment']];
  if (is_object($payment)) {
    echo MODULE_NOTIFICATIONS_CHECKOUT_TEXT_PAYMENT_METHOD . "\n"
       . MODULE_NOTIFICATIONS_CHECKOUT_SEPARATOR . "\n";
    echo $order->info['payment_method'] . "\n\n";
    if (isset($payment->email_footer)) {
      echo $payment->email_footer . "\n\n";
    }
  }
?>

 

Link to comment
Share on other sites

Unfortunately, it's hard to get any help there :( 
I have had all versions of oscommerce for over a dozen years and it was always possible to solve some problems together on the forum. Now that has changed a little

 

Link to comment
Share on other sites

1 minute ago, driven22 said:

Unfortunately, it's hard to get any help there :( 

I have had all versions of oscommerce for over a dozen years and it was always possible to solve some problems together on the forum. Now that has changed a little

 

So then stop using that software, unless you enjoy being taken for a ride.

I recommend you to try W3 osCommerce, its osCommerce the way it was 10 years ago (working software), and the majority of addons will be adaptable to it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...