Skip to main content

Weight on checkout

More
15 years 1 week ago #25597 by nicoinca
Weight on checkout was created by nicoinca
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.

More
15 years 1 week ago #25619 by nicolas
Replied by nicolas on topic Re: Weight on checkout
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.

More
14 years 9 months ago #31624 by afrttoh
Replied by afrttoh on topic Re: Weight on checkout
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.

More
14 years 9 months ago #31645 by nicolas
Replied by nicolas on topic Re: Weight on checkout
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.

More
14 years 9 months ago - 14 years 9 months ago #31662 by afrttoh
Replied by afrttoh on topic Re: Weight on checkout
Thanks, how to make it display next to the weight KG or G for example 2.00 KG
Last edit: 14 years 9 months ago by afrttoh.

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

More
14 years 9 months ago #31676 by nicolas
Replied by nicolas on topic Re: Weight on checkout
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.

More
14 years 9 months ago - 14 years 9 months ago #31677 by afrttoh
Replied by afrttoh on topic Re: Weight on checkout
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.
Last edit: 14 years 9 months ago by afrttoh.

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

Time to create page: 0.456 seconds
Powered by Kunena Forum