Shipping weight in checkout

LiteCart Fan
Frá Sweden
Meðlimur síðan maí 2022

Hello
Does anyone know how to make the weight of the shopping cart appear under the shipping method in the checkout?

LiteCart Fan
Frá Thailand
Meðlimur síðan ágú. 2017

Hello,
It should appear in the shipment area in the checkout page. Of course if when create the products you gave a weight to each product.
See attachment.
Doesn't your work the same?

LiteCart Fan
Frá Sweden
Meðlimur síðan maí 2022

Hello 

No not working in my shop

LiteCart Fan
Frá Thailand
Meðlimur síðan ágú. 2017

Did you give weight to each product?

LiteCart Fan
Frá Sweden
Meðlimur síðan maí 2022

Yes all product have weight

LiteCart Fan
Frá Thailand
Meðlimur síðan ágú. 2017

Strange, what I can do is attach the configuration of the shipping module here:

  • Be sure the geozone is active and comprehensive of the country where you are testing the weight on checkout
  • Be sure there is at least one Weight Rate Table
  • Check the weight unit
LiteCart Fan
Frá Sweden
Meðlimur síðan maí 2022

Yes i have do that and thats was ok

LiteCart Fan
Frá Sweden
Meðlimur síðan maí 2022

but thats not working

LiteCart Fan
Frá Thailand
Meðlimur síðan ágú. 2017

So I think we have to wait for Mr. Tim or somebody that experienced this issued already to enter this thread.
Is this error present in the online demo?

tim
Founder
Frá Sweden
Meðlimur síðan maí 2013
tim

https://wiki.litecart.net/how_to_create_a_shipping_module

In the options() method you would need to determine the total weight

      $total_weight = 0;
      foreach ($items as $item) {
        $total_weight += weight::convert($item['quantity'] * $item['weight'], $item['weight_class'], $this->settings['weight_class']);
      }

Then output it in the options description:
        'description' => weight::format($total_weight, $this->settings['weight_class']),

Moderator
Frá United States
Meðlimur síðan okt. 2019

And if you want a separate field for finer control when showing it at checkout, you'll need to add:
'total_weight' => (float)$option['total_weight'],
to the [b]$this->data['options'][$module->id]['options'][$option['id']][/b] array on /includes/modules/mod_shipping.inc.php

Plus, add [b]'total_weight' => $total_weight,[/b] to the $options array in your shipping module.

Then you can call it on box_checkout_shipping like this:
<?php if (!empty($option['total_weight'])) { ?><div class="total_weight text-left"><?php echo '<p></p>Product Weight: '. $option['total_weight'] . ' lbs.'; ?></div><?php } ?>

LiteCart Fan
Frá Sweden
Meðlimur síðan maí 2022

I have try this and for me not working the customer dont se the weight in the checkout

Þú
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.