- Posts: 78
- Thank you received: 4
display weight of products in invoice
- designer71
-
Topic Author
- Offline
Less
More
1 month 1 week ago #373388
by designer71
display weight of products in invoice was created by designer71
-- HikaShop version -- : 6.6.0
-- Joomla version -- : 6.1.3
Hi!
How to display weight of products in HikaShop - generate PDF invoice plugin?
thank you
-- Joomla version -- : 6.1.3
Hi!
How to display weight of products in HikaShop - generate PDF invoice plugin?
thank you
Please Log in or Create an account to join the conversation.
1 month 1 week ago #373391
by nicolas
Replied by nicolas on topic display weight of products in invoice
Hi,
The PDF invoice plugin already supports this, through three hidden settings of the HikaShop configuration (they apply to the normal invoice too):
- show_invoice_unit_weight: adds a column with the weight of one unit of each product
- show_invoice_total_weight: adds a column with the weight of each line (unit weight x quantity)
- show_invoice_weight: adds the total weight of the order below the totals
There is no option for them in the configuration page, so you need to add them in your database, with phpMyAdmin for example. Replace xxx_ with the prefix of your tables and only keep the lines you want:
If you use the shipping invoice as well, the same settings exist for it with shipping_ in front of invoice: show_shipping_invoice_unit_weight, show_shipping_invoice_total_weight and show_shipping_invoice_weight.
Note that the weight comes from what was stored in the order when it was created, not from the current product data. So the columns only appear on orders whose products had a weight at that time.
The PDF invoice plugin already supports this, through three hidden settings of the HikaShop configuration (they apply to the normal invoice too):
- show_invoice_unit_weight: adds a column with the weight of one unit of each product
- show_invoice_total_weight: adds a column with the weight of each line (unit weight x quantity)
- show_invoice_weight: adds the total weight of the order below the totals
There is no option for them in the configuration page, so you need to add them in your database, with phpMyAdmin for example. Replace xxx_ with the prefix of your tables and only keep the lines you want:
Code:
INSERT INTO xxx_hikashop_config (config_namekey, config_value, config_default) VALUES
('show_invoice_unit_weight', '1', '1'),
('show_invoice_total_weight', '1', '1'),
('show_invoice_weight', '1', '1')
ON DUPLICATE KEY UPDATE config_value = '1';
If you use the shipping invoice as well, the same settings exist for it with shipping_ in front of invoice: show_shipping_invoice_unit_weight, show_shipping_invoice_total_weight and show_shipping_invoice_weight.
Note that the weight comes from what was stored in the order when it was created, not from the current product data. So the columns only appear on orders whose products had a weight at that time.
Please Log in or Create an account to join the conversation.
- designer71
-
Topic Author
- Offline
Less
More
- Posts: 78
- Thank you received: 4
1 month 1 week ago #373399
by designer71
Replied by designer71 on topic display weight of products in invoice
Hi!
Thank you!
And please, any way to display weight on checkout?
only for info.
Thank you!
And please, any way to display weight on checkout?
only for info.
Please Log in or Create an account to join the conversation.
1 month 1 week ago #373400
by nicolas
Replied by nicolas on topic display weight of products in invoice
Hi,
There is no setting for that on the checkout, but you can add it with a small view override. Go to Display > Views in the HikaShop backend, filter on the checkout view of your front end template and edit show_block_cart. Just after the line </table>, add:
This displays the total weight of the cart below the cart block of the checkout, in the weight unit of your shop, and only when the products have a weight. Note that once a view is overridden, the changes we make to that file in future HikaShop versions are not applied to your copy.
There is no setting for that on the checkout, but you can add it with a small view override. Go to Display > Views in the HikaShop backend, filter on the checkout view of your front end template and edit show_block_cart. Just after the line </table>, add:
Code:
<?php if(!empty($cart->weight) && $cart->weight > 0) { ?>
<p class="hikashop_checkout_cart_weight"><?php echo \Joomla\CMS\Language\Text::_('TOTAL_WEIGHT') . ': ' . rtrim(rtrim(number_format($cart->weight, 3, '.', ''), '0'), '.') . ' ' . $cart->weight_unit; ?></p>
<?php } ?>
This displays the total weight of the cart below the cart block of the checkout, in the weight unit of your shop, and only when the products have a weight. Note that once a view is overridden, the changes we make to that file in future HikaShop versions are not applied to your copy.
Please Log in or Create an account to join the conversation.
- designer71
-
Topic Author
- Offline
Less
More
- Posts: 78
- Thank you received: 4
1 month 1 week ago #373408
by designer71
Replied by designer71 on topic display weight of products in invoice
Great! Thank you!
Please Log in or Create an account to join the conversation.
- designer71
-
Topic Author
- Offline
Less
More
- Posts: 78
- Thank you received: 4
1 month 1 week ago - 1 month 1 week ago #373410
by designer71
Replied by designer71 on topic display weight of products in invoice
Hi Nicolas
small question, please:
Should the PDF invoice be automatically sent to the buyer and seller upon payment confirmation?
I mean the plugin. attach pdf.
thank you for your patience:)
small question, please:
Should the PDF invoice be automatically sent to the buyer and seller upon payment confirmation?
I mean the plugin. attach pdf.
thank you for your patience:)
Last edit: 1 month 1 week ago by designer71.
Please Log in or Create an account to join the conversation.
1 month 1 week ago #373413
by nicolas
Replied by nicolas on topic display weight of products in invoice
Hi,
Yes, the PDF invoice is attached automatically, you don't need to do anything for each order. When the payment confirms the order, HikaShop sends the order status notification email to the buyer, and the plugin attaches the invoice to it. It is the same if the order is created directly with the confirmed status.
For the seller, the admin notification email doesn't get the invoice. Instead, enter your email address in the "Send a copy to" setting of the plugin. You then receive a copy (in BCC) of the email sent to the buyer, with the invoice attached. You can enter several addresses separated by commas.
Two things to check if the invoice doesn't arrive:
- the "Order status notification" email must be published in HikaShop > System > Emails
- by default, the invoice is only attached when the order gets the confirmed status of your configuration. If you want it for other statuses too, list them in the "Statuses for email attachment" setting of the plugin, for example: confirmed,shipped
Yes, the PDF invoice is attached automatically, you don't need to do anything for each order. When the payment confirms the order, HikaShop sends the order status notification email to the buyer, and the plugin attaches the invoice to it. It is the same if the order is created directly with the confirmed status.
For the seller, the admin notification email doesn't get the invoice. Instead, enter your email address in the "Send a copy to" setting of the plugin. You then receive a copy (in BCC) of the email sent to the buyer, with the invoice attached. You can enter several addresses separated by commas.
Two things to check if the invoice doesn't arrive:
- the "Order status notification" email must be published in HikaShop > System > Emails
- by default, the invoice is only attached when the order gets the confirmed status of your configuration. If you want it for other statuses too, list them in the "Statuses for email attachment" setting of the plugin, for example: confirmed,shipped
Please Log in or Create an account to join the conversation.
Time to create page: 0.234 seconds