quantity deicimals

Views: 13,398

Results 21 to 40 of 49
11 Nov 2014, 2:38 PM
#21
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

        if ([B]false && [/B]$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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 3:49 PM
#22
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

          // Check Quantity Units if not already an error on Quantity Minimum
          if ($fix_once == 0) {
            $check_units = $products->fields['products_quantity_order_units'];
[B]//[/B]            if ( fmod_round($check_quantity,$check_units) != 0 ) {
[B]            if ( fmod_round($check_quantity,$check_units) != $check_units && fmod_round($check_quantity,$check_units) != 0) {
[/B]              $_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

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 4:00 PM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: quantity deicimals

Check the IF as I had an error in it that I just fixed ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 4:17 PM
#24
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

tare settings *:1.00

11 Nov 2014, 4:28 PM
#25
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: quantity deicimals

That isn't a valid setting ... if you want to add 1lb to all your quotes, us:
0:1

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 4:33 PM
#26
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

I'll change it, but it does show 1 lb was added in cart

11 Nov 2014, 5:19 PM
#27
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 8:41 PM
#28
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

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 $

11 Nov 2014, 8:44 PM
#29
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

  // 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;
  }

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 9:05 PM
#30
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

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

11 Nov 2014, 9:11 PM
#31
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: quantity deicimals

I do not think this is a whole number issue ...

Try, for example to only add quantity 17.26 ... which is a weight of:
Weight: 29.9999512lbs

The while you do not see the shipping quote on your shopping_cart page, click to go to checkout_shipping ... and you will see a quote for shipping ...

The issue, I believe is the weight and trying to get a quote for:
Weight: 899.998536lbs

I think it is a total weight issue exceeding some limit in either your code or while freightquote.com not being able to provide you a quote for that excessive weight ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 9:27 PM
#33
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

you should see a quote from freightquote .com
not in standard or express shipping options Those are Advanced shipper by ceon

11 Nov 2014, 9:48 PM
#34
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: quantity deicimals

mc12345678:

Looks like also have some sort of bulk purchase discount module.tried using 5178 units, and the price per unit went down...

jimmie:

if you put this in cart at 501 sq ft it is 1002 pounds and works as it should
http://floorz-n-more.com/index.php?main_page=product_info&products_id=3993

Still not sure how it plays in the total process, but as was discovered with another product that was provided for an example, some of the values appear to get modified at certain cut-off points and possibly have problems at those points. The previous example was with enforcing units where the quantity of product was 30 times the units value and did not perform well. Could this also be related here where the cut-off point is met and causing an unknown result?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

11 Nov 2014, 10:04 PM
#35
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: quantity deicimals

I am not following how your shipping works ...

Why wouldn't you see that same shipping quotes under the shopping_cart that you would in the checkout_shipping?

With the 501 sq ft it is 1002 pounds I see a shipping quote on the checkout_shipping but not the shopping_cart ...

As a customer, that is rather confusing ...

Is the quote in the checkout_shipping not valid?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Nov 2014, 10:13 PM
#36
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

i have noticed that to, sometimes it is there and sometimes it isn't, it is always there when not logged in

11 Nov 2014, 10:18 PM
#37
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

i have changed it to a button
Freightquote.com only shows when logged in

11 Nov 2014, 10:19 PM
#38
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

how do i change background in shipping estimator, hard to read text

12 Nov 2014, 2:01 AM
#39
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

i fixed estimator now shows

15 Nov 2014, 2:10 AM
#40
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: quantity deicimals

further inspection on freightquote module it is failing on the product quantity, what i need to figure out is to round the quantity.
i found this in the file. 'Weight' => ceil($product['quantity'] * (int)$product['weight']), and this 'PieceCount' => $product['quantity'], they dont seem to work.