Post by Kalanaym » Sun Nov 19, 2017 3:44 am

Hi,
I need to add "payment method" after the shipping method in the dispatch note template. I have tried following code,

<b><?php echo $text_payment_method; ?></b> <?php echo $order['payment_method']; ?><br />

after
<?php if ($order['shipping_method']) { ?>
<b><?php echo $text_shipping_method; ?></b> <?php echo $order['shipping_method']; ?><br />
<?php } ?>

But it gives me an error of "undefined variable in the particular line"

I'm on OC 2.3.0.2

Your kind help is very much appreciated.

Thanks
Kalana

Newbie

Posts

Joined
Thu Mar 09, 2017 4:29 pm

Post by straightlight » Sun Nov 19, 2017 3:58 am

Which TPL file are you making these modifications?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Kalanaym » Sun Nov 19, 2017 12:09 pm

Hi straightlight,

Thanks for the reply.

I'm editing order_shipping.tpl in admin/view/template/sale

Regards
Kalana

Newbie

Posts

Joined
Thu Mar 09, 2017 4:29 pm

Post by straightlight » Sun Nov 19, 2017 12:21 pm

In admin/controller/sale/order.php file,

find the 3rd instance of:

Code: Select all

$data['text_shipping_method'] = $this->language->get('text_shipping_method');
add below:

Code: Select all

$data['text_payment_method'] = $this->language->get('text_payment_method');
Then, find the 2nd instance of:

Code: Select all

'shipping_method'  => $order_info['shipping_method'],
add below:

Code: Select all

'payment_method'  => $order_info['payment_method'],
Then, in order_shipping.tpl file,

find:

Code: Select all

<?php if ($order['shipping_method']) { ?>
add above:

Code: Select all

<?php if ($order['payment_method']) { ?>
            <b><?php echo $text_payment_method; ?></b> <?php echo $order['payment_method']; ?><br />
            <?php } ?></td>

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by platypuspuzzles » Sun Nov 19, 2017 8:17 pm

Hi there, thanks for the info

Do you mind telling me how to change the payment address to shipping address on the dispatch note?

Thanks in advance!

Active Member

Posts

Joined
Sun Jan 23, 2011 8:11 pm

Post by straightlight » Sun Nov 19, 2017 11:28 pm

platypuspuzzles wrote:
Sun Nov 19, 2017 8:17 pm
Hi there, thanks for the info

Do you mind telling me how to change the payment address to shipping address on the dispatch note?

Thanks in advance!
Create a new topic request on the subject.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Kalanaym » Mon Nov 20, 2017 2:59 am

Great! works perfectly :D
Appreciate very much for the kind and very clear information.

Regards.
Kalana

Newbie

Posts

Joined
Thu Mar 09, 2017 4:29 pm

Post by platypuspuzzles » Mon Nov 20, 2017 6:10 am

Thanks straightlight, I've created a new post here viewtopic.php?f=182&t=199794&p=703882&h ... te#p703882
straightlight wrote:
Sun Nov 19, 2017 11:28 pm
platypuspuzzles wrote:
Sun Nov 19, 2017 8:17 pm
Hi there, thanks for the info

Do you mind telling me how to change the payment address to shipping address on the dispatch note?

Thanks in advance!
Create a new topic request on the subject.

Active Member

Posts

Joined
Sun Jan 23, 2011 8:11 pm

Post by platypuspuzzles » Mon Nov 20, 2017 7:56 am

I've completed the same steps as outlined here, to add payment method to the dispatch note, but mine has CHANGED the shipping method to payment method, instead of ADDING payment method.

Can you please let me know what I've missed as I can't see it?
straightlight wrote:
Sun Nov 19, 2017 12:21 pm
In admin/controller/sale/order.php file,

find the 3rd instance of:

Code: Select all

$data['text_shipping_method'] = $this->language->get('text_shipping_method');
add below:

Code: Select all

$data['text_payment_method'] = $this->language->get('text_payment_method');
Then, find the 2nd instance of:

Code: Select all

'shipping_method'  => $order_info['shipping_method'],
add below:

Code: Select all

'payment_method'  => $order_info['payment_method'],
Then, in order_shipping.tpl file,

find:

Code: Select all

<?php if ($order['shipping_method']) { ?>
add above:

Code: Select all

<?php if ($order['payment_method']) { ?>
            <b><?php echo $text_payment_method; ?></b> <?php echo $order['payment_method']; ?><br />
            <?php } ?></td>

Active Member

Posts

Joined
Sun Jan 23, 2011 8:11 pm

Post by straightlight » Mon Nov 20, 2017 8:03 am

From the order_shipping.tpl file, the lines that must be added must not be replaced but simply added. Could you post your order_shipping.tpl file with bb code between [ code ] and [ /code ] (without space)?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by platypuspuzzles » Mon Nov 20, 2017 8:13 am

Code: Select all

<!DOCTYPE html>
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<link href="view/javascript/bootstrap/css/bootstrap.css" rel="stylesheet" media="all" />
<script type="text/javascript" src="view/javascript/jquery/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="view/javascript/bootstrap/js/bootstrap.min.js"></script>
<link href="view/javascript/font-awesome/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
<link type="text/css" href="view/stylesheet/stylesheet.css" rel="stylesheet" media="all" />
</head>
<body>
<div class="container">
  <?php foreach ($orders as $order) { ?>
  <div style="page-break-after: always;">
    <h1><?php echo $text_picklist; ?> #<?php echo $order['order_id']; ?></h1>
    <table class="table table-bordered">
      <thead>
        <tr>
          <td colspan="2"><?php echo $text_order_detail; ?></td>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><address>
            <strong><?php echo $order['store_name']; ?></strong><br />
            <?php echo $order['store_address']; ?>
            </address>
            <b><?php echo $text_telephone; ?></b> <?php echo $order['store_telephone']; ?><br />
            <?php if ($order['store_fax']) { ?>
            <b><?php echo $text_fax; ?></b> <?php echo $order['store_fax']; ?><br />
            <?php } ?>
            <b><?php echo $text_email; ?></b> <?php echo $order['store_email']; ?><br />
            <b><?php echo $text_website; ?></b> <a href="<?php echo $order['store_url']; ?>"><?php echo $order['store_url']; ?></a></td>
          <td style="width: 50%;"><b><?php echo $text_date_added; ?></b> <?php echo $order['date_added']; ?><br />
            <?php if ($order['invoice_no']) { ?>
            <b><?php echo $text_invoice_no; ?></b> <?php echo $order['invoice_no']; ?><br />
            <?php } ?>
            <b><?php echo $text_order_id; ?></b> <?php echo $order['order_id']; ?><br />
          <?php if ($order['payment_method']) { ?>
            <b><?php echo $text_payment_method; ?></b> <?php echo $order['payment_method']; ?><br />
            <?php } ?></td>
            
                      <?php if ($order['shipping_method']) { ?>
            
            <b><?php echo $text_shipping_method; ?></b> <?php echo $order['shipping_method']; ?><br />
            <?php } ?></td>
            
        </tr>
      </tbody>
    </table>
    <table class="table table-bordered">
      <thead>
        <tr>
          <td style="width: 50%;"><b><?php echo $text_shipping_address; ?></b></td>
          <td style="width: 50%;"><b><?php echo $text_contact; ?></b></td>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><?php echo $order['shipping_address']; ?>
          <?php echo $order['email']; ?><br/>
            <?php echo $order['telephone']; ?></td>
        </tr>
      </tbody>
    </table>
    <table class="table table-bordered">
      <thead>
        <tr>
          <td><b><?php echo $column_location; ?></b></td>
          <td><b><?php echo $column_reference; ?></b></td>
          <td><b><?php echo $column_product; ?></b></td>
          <td><b><?php echo $column_weight; ?></b></td>
          <td><b><?php echo $column_model; ?></b></td>
          <td class="text-right"><b><?php echo $column_quantity; ?></b></td>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($order['product'] as $product) { ?>
        <tr>
          <td><?php echo $product['location']; ?></td>
          <td><?php if ($product['sku']) { ?>
            <?php echo $text_sku; ?> <?php echo $product['sku']; ?><br />
            <?php } ?>
            <?php if ($product['upc']) { ?>
            <?php echo $text_upc; ?> <?php echo $product['upc']; ?><br />
            <?php } ?>
            <?php if ($product['ean']) { ?>
            <?php echo $text_ean; ?> <?php echo $product['ean']; ?><br />
            <?php } ?>
            <?php if ($product['jan']) { ?>
            <?php echo $text_jan; ?> <?php echo $product['jan']; ?><br />
            <?php } ?>
            <?php if ($product['isbn']) { ?>
            <?php echo $text_isbn; ?> <?php echo $product['isbn']; ?><br />
            <?php } ?>
            <?php if ($product['mpn']) { ?>
            <?php echo $text_mpn; ?><?php echo $product['mpn']; ?><br />
            <?php } ?></td>
          <td><?php echo $product['name']; ?>
            <?php foreach ($product['option'] as $option) { ?>
            <br />
            &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
            <?php } ?></td>
          <td><?php echo $product['weight']; ?></td>
          <td><?php echo $product['model']; ?></td>
          <td class="text-right"><?php echo $product['quantity']; ?></td>
        </tr>
        <?php } ?>
      </tbody>
    </table>
    <?php if ($order['comment']) { ?>
    <table class="table table-bordered">
      <thead>
        <tr>
          <td><b><?php echo $text_comment; ?></b></td>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><?php echo $order['comment']; ?></td>
        </tr>
      </tbody>
    </table>
    <?php } ?>
  </div>
  <?php } ?>
</div>
</body>
</html> 

Active Member

Posts

Joined
Sun Jan 23, 2011 8:11 pm

Post by straightlight » Mon Nov 20, 2017 8:25 am

Are there any orders that may not contain any shipping information but only the payment information or your store forces the issue for physical products to be shipped only?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by platypuspuzzles » Mon Nov 20, 2017 8:29 am

We ship everything, apart from some orders that select local pick up.

Customers sometimes have us send their order to the recipient directly, as a gift, so I need to be able to to see

Shipping address
Payment method
Shipping method
Customer (who placed order) name and contact details

Active Member

Posts

Joined
Sun Jan 23, 2011 8:11 pm

Post by straightlight » Mon Nov 20, 2017 8:38 am

I see. However, the code above does not replace the shipping method with the payment method. If the payment method appears as stand-alone is because the shipping method information could not be found on that particular order. If you try with other orders, you could probably compare the differences.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 51 guests