Weight on checkout

  • Posts: 1
  • Thank you received: 0
13 years 2 months ago #25597

Hello,

How can i do to show the weight on the chekout page ?
Can i display products by category ?

thanks

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 2 months ago #25619

Hi,

If you want to customize the display of the cart on the checkout, you need to edit the file "cart" of the view "checkout" via the menu Display->Views.

The weight can be displayed easily by adding a small piece of code like that: echo $row->product_weight;
For the display of products ordered by categories, that way more complex so I don't have a ready made solution. You would first have to load the categories from the database and order the products by category before displaying them. That's way more than a two liner so you need to have a good grasp of PHP to do it.

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

  • Posts: 12
  • Thank you received: 0
12 years 11 months ago #31624

Hi,
I want to show the weight of each product in the product page and also on the checkout page, right under the image and the discretion of the product.
i have tried pasting this line in many places in views>checkout>cart
echo $row->product weight;
But nothing showed up, do i have to add any brackets it...?
How do I do it exactly and where exactly do I have to put it?
Thanks

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #31645

If you add your code in HTML code, you should do like this:
<?php echo $row->product_weight; ?>

Also don't forget the underscore. Otherwise it won't work properly.

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

  • Posts: 12
  • Thank you received: 0
12 years 11 months ago #31662

Thanks, how to make it display next to the weight KG or G for example 2.00 KG

Last edit: 12 years 11 months ago by afrttoh.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #31676

Then, for the weight unit you should do like that:

<?php echo $row->product_weight.' '.JText::_(strtoupper($row->product_weight_unit)); ?>

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

  • Posts: 12
  • Thank you received: 0
12 years 11 months ago #31677

Thanks, that’s worked for me and this is what I have done:
Somewhere at the top of the document to show the title:
<th id="hikashop_cart_product_weight_title" style="float:left;margin-left: -144px;text-align: left;">
<?php echo JText::_('Weight'); ?>

</th>
At the bottom of the document to show the weight and the unit:

<th id="hikashop_cart_product_weight_title" style="float:left;margin-left: -144px;text-align: left;margin-top: 50px;">
<?php echo $row->product_weight.' '.JText::_(strtoupper($row->product_weight_unit)); ?>
</th>
I have also added some CSS to make it go the correct position.

Attachments:
Last edit: 12 years 11 months ago by afrttoh.

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

Time to create page: 0.080 seconds
Powered by Kunena Forum