Customizing the attach invoice
11 years 9 months ago #182752
by pouce
Customizing the attach invoice was created by pouce
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.9
-- Browser(s) name and version -- : Firefox 33.1
Hi, I want to add some information on the invoice at least on the final confirmation of an order.
I use the plugin 'Attach invoice' and need to add some information as described below :
Reference (4 digits) | Product Information | A code (10 digits) | Unit price | Quantity | Total Price
Product details
(below)
So there is the reference, the product details and the code to add.
If I create some customs fields how can I add those two columns and the detail of the product below on a second line or following the product information to the files plugins/hikashop/attachinvoice/attachinvoice/invoice.php
I know that I have to change the width of the existing columns, I saw it is set in pixels. I will manage the display by myself
Any help will be really appreciated !
Regards,
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.9
-- Browser(s) name and version -- : Firefox 33.1
Hi, I want to add some information on the invoice at least on the final confirmation of an order.
I use the plugin 'Attach invoice' and need to add some information as described below :
Reference (4 digits) | Product Information | A code (10 digits) | Unit price | Quantity | Total Price
Product details
(below)
So there is the reference, the product details and the code to add.
If I create some customs fields how can I add those two columns and the detail of the product below on a second line or following the product information to the files plugins/hikashop/attachinvoice/attachinvoice/invoice.php
I know that I have to change the width of the existing columns, I saw it is set in pixels. I will manage the display by myself
Any help will be really appreciated !
Regards,
Please Log in or Create an account to join the conversation.
11 years 9 months ago #182776
by Xavier
Replied by Xavier on topic Customizing the attach invoice
Hi,
To display the value of the custom fields, you can directly use that kind of code:
To manage the display, change the columns, you just have to use html tags like <td></td>, <tr></tr>
To display the value of the custom fields, you can directly use that kind of code:
Code:
echo $product->CUSTOMFIELD_NAME;
To manage the display, change the columns, you just have to use html tags like <td></td>, <tr></tr>
Please Log in or Create an account to join the conversation.
11 years 9 months ago #182925
by pouce
Replied by pouce on topic Customizing the attach invoice
Thanks for your reply,
I added the custom field to the attachinvoice plugin, it shows well but the cells are empty for past orders.
Is it normal ? or should I already see the changes on past orders.
Maybe I missed something, I had this kind of line
When I've created the custom field, I choose a 'product' type in the field "TABLE" and I called the custom field 'code_ean'
Of course I added information to the custom fields
I added the custom field to the attachinvoice plugin, it shows well but the cells are empty for past orders.
Is it normal ? or should I already see the changes on past orders.
Maybe I missed something, I had this kind of line
Code:
<td>
<?php echo $product->code_ean; ?>
</td>
When I've created the custom field, I choose a 'product' type in the field "TABLE" and I called the custom field 'code_ean'
Of course I added information to the custom fields
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183028
by Xavier
Replied by Xavier on topic Customizing the attach invoice
Hi,
If the products had a value for this custom field in the past orders so when sending a new email with attached pdf the value should be present.
If the products had a value for this custom field in the past orders so when sending a new email with attached pdf the value should be present.
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183029
by pouce
Replied by pouce on topic Customizing the attach invoice
Ok, I recently add the custom fields I will see in the next order and will Tell you
Please Log in or Create an account to join the conversation.
11 years 9 months ago #184772
by pouce
Replied by pouce on topic Customizing the attach invoice
Hi Xavier,
Well no luck, the last two orders don't show the custom fields.
I thought that may be it's because I have set a value for the variants of the main product but not for the main product because I don't need. I just need for the variants.
Do I have to change the code in some way ? to show the custom fields of the variants.
Cheers
Well no luck, the last two orders don't show the custom fields.
I thought that may be it's because I have set a value for the variants of the main product but not for the main product because I don't need. I just need for the variants.
Do I have to change the code in some way ? to show the custom fields of the variants.
Cheers
Please Log in or Create an account to join the conversation.
11 years 9 months ago #184782
by nicolas
Replied by nicolas on topic Customizing the attach invoice
Hi,
It should not be a problem.
Please provide a screenshot of the options of the custom field (just in case), and the code of the invoice (so that we can see where and how you placed your modification).
It should not be a problem.
Please provide a screenshot of the options of the custom field (just in case), and the code of the invoice (so that we can see where and how you placed your modification).
Please Log in or Create an account to join the conversation.
11 years 9 months ago #184813
by pouce
Replied by pouce on topic Customizing the attach invoice
Here are the two screenshots of the custom fields option
I have modified the following line in the attached files :
to insert the name of the fields in the table => line 90-92 and line 96-98
to insert the custom fields in the table => line 120-122 and line 170-172
to set the layout of the table (colspan) => line 231, 276, 288, 297
Fichier modifié : invoice.php
I have modified the following line in the attached files :
to insert the name of the fields in the table => line 90-92 and line 96-98
to insert the custom fields in the table => line 120-122 and line 170-172
to set the layout of the table (colspan) => line 231, 276, 288, 297
Fichier modifié : invoice.php
Please Log in or Create an account to join the conversation.
11 years 9 months ago #184819
by nicolas
Replied by nicolas on topic Customizing the attach invoice
Hi,
I cannot access the file. Could you zip it so that we can download it ?
I cannot access the file. Could you zip it so that we can download it ?
Please Log in or Create an account to join the conversation.
11 years 9 months ago #184867
by pouce
Replied by pouce on topic Customizing the attach invoice
Oh sorry, I didn't test the link before submitting it
Here's a new one
Fichier modifié : invoice.php
Here's a new one
Fichier modifié : invoice.php
Please Log in or Create an account to join the conversation.
11 years 9 months ago #184921
by nicolas
Replied by nicolas on topic Customizing the attach invoice
Hi,
Ok, after the line:
foreach($order->products as $product){
Try to add that code:
$class = hikashop_get('class.product');
$prodData = $class->get($product->product_id);
and then, instead of the code:
<?php echo $product->code_ean; ?>
use that code:
<?php echo $prodData->code_ean; ?>
Ok, after the line:
foreach($order->products as $product){
Try to add that code:
$class = hikashop_get('class.product');
$prodData = $class->get($product->product_id);
and then, instead of the code:
<?php echo $product->code_ean; ?>
use that code:
<?php echo $prodData->code_ean; ?>
Please Log in or Create an account to join the conversation.
11 years 9 months ago - 11 years 9 months ago #184932
by pouce
Replied by pouce on topic Customizing the attach invoice
Hi Nicolas,
It works really fine :woohoo:, It even shows the custom fields in the older order.
thank you very much Nicolas and happy new year and best wishes for 2015 !!
It works really fine :woohoo:, It even shows the custom fields in the older order.
thank you very much Nicolas and happy new year and best wishes for 2015 !!
Last edit: 11 years 9 months ago by pouce. Reason: Tried to mark the post as solved
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.322 seconds