Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2010
    Posts
    21
    Plugin Contributions
    0

    Default How to show weight without decimals?

    I want to display the weight without decimals in the shipping estimator en on the checkout page in the shippingoption. I use table / weight for the shipping way.

    Hope someone can help which files I have to modify.

    Thanks in advance!

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: How to show weight without decimals?

    I found a convenient "starting point" to use the developers tool kit found in the admin->tools section to be a bit helpful, though I hadn't chased down to the exact location to make the change that seems to be asked about.

    Anyways, searching on $products_weight gave some useful information. There currently doesn't appear to be any rounding or truncation done store side for the weight. So depending on your goal (affect display or calculation) you might be able to add a rounding operation to display 0 decimals if that is your goal.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Mar 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: How to show weight without decimals?

    Thanks for your reply, mc12345678. I've searched everywhere and tried so many changes only to make them undone cause it does not give the wanted effect.

    I managed to change the weight decimals in product info page, product_listing page and and the show totals line above the shoppingcart with help of showthread.php?80092-Decimal-places-in-shipping-weight.

    In the developers tool I searched for the appropiate files using every possible word which can lead me to the files where I can change the decimals for weight in the shipping estimator and shipping option without succes.

    All I want is that it displays as 17 gram instead of 17,00 gram.

    Any hint in the right direction is very welcome!
    Last edited by jolion; 18 Nov 2017 at 12:24 PM.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: How to show weight without decimals?

    Not sure which files you have edited, so I'm going to point out a few that relate to display of the shipping_weight as found when working through the files associated with the shopping_cart page. The shopping_cart page is typically where the shipping estimator is first displayed.

    includes/modules/YOUR_TEMPLATE/shipping_info.php ($totalsDisplay)
    includes/modules/page/shopping_cart/header_php.php ($totalsDisplay)

    Does that address the areas in question?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Mar 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: How to show weight without decimals?

    Quote Originally Posted by mc12345678 View Post
    includes/modules/YOUR_TEMPLATE/shipping_info.php ($totalsDisplay)
    includes/modules/page/shopping_cart/header_php.php ($totalsDisplay)
    The first file I can't find it, even in the original installation files I can't find it. Maybe you mean shipping_estimator.php?
    If so, I have modified this one, without succes. But it is possible that I modified it in the wrong way. Help with that is also very welcome

    The second one I have already modified with succes except for the shipping estimator and payment options in checkout.

 

 

Similar Threads

  1. How set up 2 shipping rates by weight without them conflicting at checkout
    By Annie_zaz in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 7 Mar 2013, 02:56 PM
  2. How to show weight TAB in admin?
    By QQ1980 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 8 Aug 2009, 05:52 PM
  3. Error item price without decimals in Invoice and Orders
    By apcpx in forum Managing Customers and Orders
    Replies: 0
    Last Post: 30 Oct 2008, 02:32 PM
  4. Easy or Hard? Adding Weight attribute without Quantity affecting the weight
    By dharma in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 11 Mar 2007, 06:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR