display weight of products in invoice

  • Posts: 67
  • Thank you received: 3
  • Hikamarket Multivendor Hikashop Business
3 days 12 hours ago #373388

-- 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

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

  • Posts: 86179
  • Thank you received: 14216
  • MODERATOR
3 days 9 hours ago #373391

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:

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.

  • Posts: 67
  • Thank you received: 3
  • Hikamarket Multivendor Hikashop Business
3 days 4 hours ago #373399

Hi!
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.

  • Posts: 86179
  • Thank you received: 14216
  • MODERATOR
3 days 1 hour ago #373400

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:

<?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.

  • Posts: 67
  • Thank you received: 3
  • Hikamarket Multivendor Hikashop Business
2 days 17 hours ago #373408

Great! Thank you!

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

  • Posts: 67
  • Thank you received: 3
  • Hikamarket Multivendor Hikashop Business
2 days 17 hours ago #373410

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:)

Last edit: 2 days 17 hours ago by designer71.

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

  • Posts: 86179
  • Thank you received: 14216
  • MODERATOR
2 days 14 hours ago #373413

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

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

Time to create page: 0.058 seconds
Powered by Kunena Forum