Create invoce only for "confirmed" orders

  • Posts: 19
  • Thank you received: 0
11 years 11 months ago #51669

Hello!
Is it possible to create an invoice only after an order becomes confirmed?
I use bank transfer and I'd like to show and assign othe rder number after I receive the payment, so that the order is based on Payment reception and not order creation.

Thank you!

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
11 years 11 months ago #51740

Hi,

The invoice number and the order number are the same number in HikaShop for now.
It's easier to understand for beginners...

It's always possible, but you will have to modify the code at several places in HikaShop... So if you're not a developer, it's not possible.

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

  • Posts: 19
  • Thank you received: 0
11 years 11 months ago #51757

I'm a developer: can you give some advice?
Is it necessarity to "hack" the core or is it possible to create a plugin?

Thank you!

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
11 years 11 months ago #51829

You can do it without any hacks.

First add a custom field of the table "order" via the menu Display->Custom fields (business edition) in order to be able to attached the invoice number to the orders.
Then create a hikashop plugin to generate the invoice number when orders are confirmed. We have some documentation for developers on that:
www.hikashop.com/en/support/documentatio...l#onAfterOrderUpdate
Then, you can override the views of HikaShop via the menu Display>Views and the emails of HikaShop via the System->Emails menu in order to display the invoice number when necessary.

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

  • Posts: 267
  • Thank you received: 5
11 years 7 months ago #65921

hello nicolas,

also need to know just how to make the view "Display>Views>shows" is displayed only in state confirmed order.

Thanks again

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
11 years 7 months ago #66055

I don't understand your question. Can you reformulate please and give more information on what you want ?

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

  • Posts: 267
  • Thank you received: 5
11 years 7 months ago #66518

my question is:
How to make it only to download the bill that is in "Display> Views> shows" only if its state is set to "confirmed".
Hikashop use for a system in a university enrollments. I just want to discharge the bank receipt admitted students in state "confirmed".
Thank you for your quick response. I hope I explained correctly this time.

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
11 years 7 months ago #66642

You can just change the line:
if( $this->config->get('print_invoice_frontend') && !in_array($this->element->order_status,array('refunded','cancelled'))){ ?>

to:
if( $this->config->get('print_invoice_frontend') && !in_array($this->element->order_status,array('created','refunded','cancelled'))){ ?>

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

  • Posts: 267
  • Thank you received: 5
11 years 7 months ago #68122

Hello,

It is possible that in "order / listing.php" only to access the link that shows "order / show.php" only "confirmed oeders".

Regards and thanks

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
11 years 7 months ago #68382

Hi,

Sure, after the line:
$row =& $this->rows[$i];

add the line:
if($row->order_status!='confirmed') continue;

in the order/listing.php file

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

  • Posts: 267
  • Thank you received: 5
11 years 7 months ago #68514

I just want to break the link

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
11 years 7 months ago #68727

Then in that case you should change the code:
<a href="<?php echo hikashop_completeLink('order&task=show&cid='.$row->order_id.$url_itemid); ?>">
<?php echo $row->order_number; ?>
</a>

to:
<?php if($row->order_status!='confirmed') {echo $row->order_number; }else{ ?>
<a href="<?php echo hikashop_completeLink('order&task=show&cid='.$row->order_id.$url_itemid); ?>"><a href="<?php echo hikashop_completeLink('order&task=show&cid='.$row->order_id.$url_itemid); ?>">
<?php echo $row->order_number; ?>
</a>
<?php } ?>

The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
11 years 7 months ago #70420

Thanks Nicholas works perfectly

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

Time to create page: 0.086 seconds
Powered by Kunena Forum