News:

Support the VirtueMart project and become a member

Main Menu

[SOLVED] Additional (2nd) Order Number

Started by goodcrook, June 25, 2014, 15:38:36 PM

Previous topic - Next topic

goodcrook

Hi,

does anyone know how can i do this?

My company is selling products via online shop and/or "real" :) shop on location.
So we have Internal Order numbers from "real" shop and if something sold through web-site then VM Order numbers.
I've already wrote something in php to import/add them "real" orders into VM so the customers who bought stuff in "real" shop are able to see all their orders in VM frontend ("list orders" menu) but now i need to add that "real" order number into VM backend, bind it with web order so to say. And for that i need additional order number field. See pic below.
Could someone please explain to me how can i do this or give me some pointers to where to start?

Regards,
gc

ps. it's joomla 2.5.20/VM 2.6.4

[attachment cleanup by admin]
[VM 2.6.4][JOOMLA 2.5.20][PHP 5.4.4]

kiki90

I would create my own component, with a table for it containing 3 fields: Primary key, VMOrderNumber, Your order number.

Once it is clicked from the component section the component will add any VM Numbers to the table and have a list view where you can insert your own order number.

Something like:

ID | VM ORDER NUMBER | Shop Order No.

and have a save button to save everything to your table.

Then on the frontend edit the view (overwrite it from your template) and have a query to run to get your shop number.

Easy :)

goodcrook

#2
I was probably to lazy to think about it a bit more :) but after i've done it, here is how i've solved it:

* added column 'office_order_nr' to #_virtuemart_orders table
* changed/added code inside administrator/components/com_virtuemart/views/orders/tmpl/order.php to


       <tr>
    <td class="key"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PO_NUMBER'?> Web</strong></td>
<td><?php echo  $print_link;?></td>
</tr>
<tr>
<td class="key"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PO_NUMBER'?> Office</strong></td>
<td><?php echo  $this->orderbt->office_order_nr;?></td>
</tr>


* i'm using CSVi for some import/export so i've updated available fields and after that i can use the 'office_order_nr' for import/export and on frontend with some php/sql  YAY! ;)
[VM 2.6.4][JOOMLA 2.5.20][PHP 5.4.4]

goodcrook

Quote from: kiki90 on June 26, 2014, 09:18:57 AM
I would create my own component, with a table for it containing 3 fields: Primary key, VMOrderNumber, Your order number ....

was typing my answer when you posted yours
thanks kiki90 for your advice anyway ;)

cheers,
gc
[VM 2.6.4][JOOMLA 2.5.20][PHP 5.4.4]