-
Re: quantity deicimals
And the two Tare Rate settings?
I have not used this shipping module but your shipping quotes do not appear to be able to manage the weight and settings that you are using ...
NOTE: from the post of your Configuration ... Shipping/Packaging ... I cannot tell what are your actual settings and what is the display text
As to the decimal issue, edit the class:
/includes/modules/shopping_cart.php
and around line 1241, what happens if you add the code in RED:
Code:
if (false && $new_qty == (int)$new_qty) {
$new_qty = (int)$new_qty;
}
NOTE: you may still get the message, but see if you can now get to checkout_shipping ...
-
Re: quantity deicimals
Then to manage the error message, test this, I am not done testing this idea, but see how it works for you ...
Edit the file:
/includes/classes/shopping_cart.php
and add the code in RED:
Code:
// Check Quantity Units if not already an error on Quantity Minimum
if ($fix_once == 0) {
$check_units = $products->fields['products_quantity_order_units'];
// if ( fmod_round($check_quantity,$check_units) != 0 ) {
if ( fmod_round($check_quantity,$check_units) != $check_units && fmod_round($check_quantity,$check_units) != 0) {
$_SESSION['valid_to_checkout'] = false;
$_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . ERROR_PRODUCT_QUANTITY_ORDERED . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display((int)$prid, false, true) . '</span> ' . '<br />';
}
}
// Verify Valid Attributes
-
Re: quantity deicimals
Check the IF as I had an error in it that I just fixed ...
-
Re: quantity deicimals
-
Re: quantity deicimals
That isn't a valid setting ... if you want to add 1lb to all your quotes, us:
0:1
-
Re: quantity deicimals
I'll change it, but it does show 1 lb was added in cart
-
Re: quantity deicimals
You might read through the file:
/includes/classes/shipping.php
and see how Tare Rates are calculated ... you would get some strange logic trying to use * as a value in the calculations ...
-
Re: quantity deicimals
i Dont have A shopping_cart.php in that location.
did a search in catalog for that file and this is what was returned.
/var/www/clients/client1/web4/web/includes/auto_loaders/config.core.php
Line #25 : * require(DIR_WS_CLASSES . 'shopping_cart.php');
Line #63 : 'loadFile'=>'shopping_cart.php');
/var/www/clients/client1/web4/web/includes/auto_loaders/paypal_ipn.core.php
Line #34 : 'loadFile'=>'shopping_cart.php');
/var/www/clients/client1/web4/web/includes/init_includes/auto_loaders/config.core.php
Line #25 : * require(DIR_WS_CLASSES . 'shopping_cart.php');
Line #63 : 'loadFile'=>'shopping_cart.php');
/var/www/clients/client1/web4/web/includes/init_includes/auto_loaders/paypal_ipn.core.php
Line #34 : 'loadFile'=>'shopping_cart.php');
/var/www/clients/client1/web4/web/includes/languages/english.php
Line #104 : // shopping_cart box text in sideboxes/shopping_cart.php
/var/www/clients/client1/web4/web/includes/languages/english/info_shopping_cart.php
Line #19 : // $Id: info_shopping_cart.php 1969 2005-09-13 06:57:21Z drbyte $
/var/www/clients/client1/web4/web/includes/languages/english/shopping_cart.php
Line #6 : * @version $Id: shopping_cart.php 3183 2006-03-14 07:58:59Z birdbrain $
/var/www/clients/client1/web4/web/includes/languages/sheffield_blue/english.php
Line #104 : // shopping_cart box text in sideboxes/shopping_cart.php
/var/www/clients/client1/web4/web/includes/modules/quick_checkout_process/sideboxes/shopping_cart.php
Line #8 : * @version $Id: shopping_cart.php 7437 2007-11-16 21:33:16Z drbyte $
Line #33 : require($template->get_template_dir('tpl_shopping_cart.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_shopping_cart.php');
/var/www/clients/client1/web4/web/includes/modules/sideboxes/shopping_cart.php
Line #8 : * @version $Id: shopping_cart.php 7437 2007-11-16 21:33:16Z drbyte $
Line #33 : require($template->get_template_dir('tpl_shopping_cart.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_shopping_cart.php');
/var/www/clients/client1/web4/web/includes/templates/sheffield_blue/sideboxes/tpl_shopping_cart.php
Line #9 : * @version $Id: tpl_shopping_cart.php 7192 2007-10-06 13:30:46Z drbyte $
/var/www/clients/client1/web4/web/includes/templates/template_default/sideboxes/tpl_shopping_cart.php
Line #9 : * @version $Id: tpl_shopping_cart.php 7192 2007-10-06 13:30:46Z drbyte $
-
Re: quantity deicimals
Do this ... forget the shopping_cart.php class file you cannot find ...
Change the file:
/includes/functions/functions_general.php
and replace the function fmod_round with this new code:
Code:
// replacement for fmod to manage values < 1
function fmod_round($x, $y) {
$x = strval($x);
$y = strval($y);
$zc_round = ($x*1000)/($y*1000);
$zc_round_ceil = round($zc_round,0);
$multiplier = $zc_round_ceil * $y;
$results = abs(round($x - $multiplier, 6));
return $results;
}
-
Re: quantity deicimals
that worked, now is there a way to round up the weight to a whole number
517.8 ft = 899.998536, Would like it to be 900 lbs