X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   display the total weight on the view cart page (https://forum.x-cart.com/showthread.php?t=5315)

dmpinder 04-02-2013 07:48 AM

Re: display the total weight on the view cart page
 
Thanks for the advice drheath, however we want a visual display on the cart which tells them they need to have over 12 in weight in order to continue.

Anyone know how to achieve this mod in 4.5.1?

dmpinder 04-02-2013 08:09 AM

Re: display the total weight on the view cart page
 
Well after about an hour of butting my head against my desk, I've realised why it wasn't working: because I wasn't logged in as a customer. The smarty variable gets assigned once the address is known.

Obviously not all customers will be logged in, so you need to select the "Presume that a not logged in customer is from the default country" checkbox in the general settings in order for this to work.

drheath 04-02-2013 08:31 AM

Re: display the total weight on the view cart page
 
Nice, sometimes the simplest solutions are the best ones. Did you end up having to make any additional changes to the code other than the 2 you mentioned?

Lloyd Hosting 11-23-2014 05:36 AM

Re: display the total weight on the view cart page
 
Trying to figure out how to do this on 4.6.5 but QT decided to move shipping.php from /shipping... trying to find where they've moved it to.

Found it - include/func/func.shipping.php

Interesting, QT have already included this bit for us:
Code:

    $smarty->assign("total_weight_shipping_valid", $total_weight_shipping_valid);
So I added this to /skin/common_files/modules/One_Page_Checkout/Summary/cart_totals.tpl
Code:

    <tr>
      <td class="total-name">Total Weight:</td>
      <td class="total-value">{$total_weight_shipping_valid}g</td>
    </tr>


after
Code:

  {if $cart.display_discounted_subtotal ne $cart.display_subtotal}
    <tr>
      <td class="total-name">{$lng.lbl_discounted_subtotal}:</td>
      <td class="total-value">{currency value=$cart.display_discounted_subtotal}</td>
    </tr>
  {/if}



All times are GMT -8. The time now is 07:09 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.