Change content of invoice

  • Posts: 35
  • Thank you received: 0
11 years 6 months ago #98737

Hi all

I have done a quick search but cannot find the right answer to my question (or I didn't understand it!! :( )

I have the free edition of the excellent Hikashop.

What I would like to do is have the ability to alter the text within the invoice to add a greeting or latest news/offers. Plus, how would I go about adding the order number to the invoice as my customers will only have an invoice number once they've paid and the invoice does not include the order number

Thanks in advance for your help

Cheers

LT

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #98771

Hi,

To change the text of the invoice, you can edit the view "order / show".
In this view, you should be able to see that it's used for the order and for the invoice, only some variables are in only one.

So you can use the order number to put it in the invoice part.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
11 years 6 months ago #98942

Hi Xavier, yet again!!

Thanks for the reply. I have found the file you refer to. I'm not good with php, however, I notice a line at the top of the page that refers to the invoice and order number. However, it has an else statement so my understanding is that as it stands, it will show either, not both.

Would you be kind enough to advise how I would go about changing this to show both by default please

<div class="header hikashop_header_title">
    <h1>
      <?php if($this->invoice_type=='order'){
        echo JText::_('HIKASHOP_ORDER').':'.$this->element->order_number;
      }else{
        echo JText::_('INVOICE').':'.$this->element->order_invoice_number;
      } ?>
    </h1>
  </div>

and
<div id="hikashop_order_right_part" class="hikashop_order_right_part">
        <?php echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y ');?><br/>
        <?php if($this->invoice_type=='order'){
            echo JText::_('HIKASHOP_ORDER');
            echo ': '.@$this->element->order_number;
          }else{
            echo JText::_(strtoupper($this->invoice_type));
            echo ': '.@$this->element->order_invoice_number;
          }
        ?>
        </div>

Thanks again Xavier

Last edit: 11 years 6 months ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #99109

Hi,

To always have both, you have to remove the if / else statement like:

<div class="header hikashop_header_title">
<h1>
<?php
echo JText::_('HIKASHOP_ORDER').':'.@$this->element->order_number;
echo JText::_('INVOICE').':'.@$this->element->order_invoice_number;
 ?>
</h1>
</div>
And
<div id="hikashop_order_right_part" class="hikashop_order_right_part">
<?php echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y ');?><br/>
<?php if(isset($this->element->order_number){
echo JText::_('HIKASHOP_ORDER');
echo ': '.@$this->element->order_number;
}elseif(isset($this->element->order_invoice_number)){
echo JText::_(strtoupper($this->invoice_type));
echo ': '.@$this->element->order_invoice_number;
}
?>
</div

Last edit: 11 years 6 months ago by Xavier.
The following user(s) said Thank You: LoonyTune

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
11 years 6 months ago #99276

Thanks again Xavier

Edited the lines as per above in my templates, but when I added a new order, the invoice still only gave me the invoice number.

I don't have to edit the other templates as well do I?

Thanks for all your support over the months, it has been invaluable

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #99366

Hi,

You probably have to edit too the view "order / invoice" to add the order number.
And be sure that you are editing in the good template.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
11 years 6 months ago #99473

Hi Xavier.

Thanks for the reply again

The only invoice files I have are for the back end in the pre-installed templates, not the ones I'm working from.

Cheers

LT

Please Log in or Create an account to join the conversation.

  • Posts: 82760
  • Thank you received: 13347
  • MODERATOR
11 years 6 months ago #99615

It's "order/show" for the frontend template.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
11 years 6 months ago #99853

Cheers nioclas.

That was the file I changed originally, but when I go to view/print an invoice, the order number is not displayed. I copied and pasted the code from above, but this hasn't changed the output

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #99927

Hi,

You have to cut/paste the code:

<div class="header hikashop_header_title">
<h1>
<?php
echo JText::_('HIKASHOP_ORDER').':'.@$this->element->order_number;
echo JText::_('INVOICE').':'.@$this->element->order_invoice_number;
 ?>
</h1>
</div>
Before:
<?php if($this->invoice_type=='order'){?>

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
11 years 6 months ago #100092

I don't know what I'm doing wrong here, but still only invoice number showing in the invoice.

In my frontend template, I have added/edited the following code:

<div id="hikashop_order_main">
<fieldset><div class="header hikashop_header_title">
<h1>
<?php
echo JText::_('HIKASHOP_ORDER').':'.@$this->element->order_number;
echo JText::_('INVOICE').':'.@$this->element->order_invoice_number;
?>
</h1>
</div>
<?php if($this->invoice_type=='order'){?>


and:

<div id="hikashop_order_right_part" class="hikashop_order_right_part">

<?php echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y ');?><br/>
<?php if(isset($this->element->order_number){
echo JText::_('HIKASHOP_ORDER');
echo ': '.@$this->element->order_number;
}elseif(isset($this->element->order_invoice_number)){
echo JText::_(strtoupper($this->invoice_type));
echo ': '.@$this->element->order_invoice_number;
}
?> </div>

to no avail.

Xavier/Nicolas, thanks heaps for the time you've spent with this. Any ideas where I'm going wrong?

Template is A4Joomla-twighlight free, Joomla version is 2.5.9

Cheers

LT

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #100236

Oups my mistake, what you were editing is the page title not the number in the invoir, thanks to edit the code:

				<?php echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y ');?><br/>
				<?php if($this->invoice_type=='order'){
						echo JText::_('HIKASHOP_ORDER');
						echo ': '.@$this->element->order_number;
					}else{
						echo JText::_(strtoupper($this->invoice_type));
						echo ': '.@$this->element->order_invoice_number;
					}
				?>
To:
				<?php echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y ');?><br/>
				<?php if($this->invoice_type=='order'){
						echo JText::_('HIKASHOP_ORDER');
						echo ': '.@$this->element->order_number;
					}else{
						echo JText::_('HIKASHOP_ORDER');
						echo ': '.@$this->element->order_number;
						echo '<br/>';
						echo JText::_('INVOICE');
						echo ': '.@$this->element->order_invoice_number;
					}
				?>

Last edit: 11 years 6 months ago by Xavier.
The following user(s) said Thank You: LoonyTune

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
11 years 6 months ago #100423

Hi Xavier

When the order is created, the order number is the invoice number. However, when the order is shipped, the invoice number is different and the order number is not on the invoice.

I would like the order number to be rather the invoice number as well, or, the order number to appear on the invoice.

Although you have helped a lot, this last edit hasn't worked.

Thanks for all your time

LT

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #100731

Hi,

The code given should do the job, it display the order number on the invoice.
In case of order display, only the order number is present, and if invoice, the both numbers are present.

You can try to edit a little the code to have what you need, it require some php knowledge.
Try to make this modification in the view "order / invoice" (backend template) too.

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum