Totally Zenned
- Join Date:
- Jan 2013
- Location:
- New Port Richey, Florida
- Posts:
- 971
- Plugin Contributions:
- 0
Hide module from certain state
Anyone using this module for freight quotes in zencart-version 1.51
How is it working for you.
Totally Zenned
Anyone using this module for freight quotes in zencart-version 1.51
How is it working for you.
Totally Zenned
i believe this module is the same one that is in the downloads and was written for version 1.37, I downloaded from Frieghtquote.com
i am running zen-cart version 1.51 and have installed this module. It is working however there are a few issues with it.
Totally Zenned
Totally Zenned
i need to change this code
$shipping_form .= '<select name="freightquote_delivery_location" onchange="window.location.href=\'' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'freightquote_delivery_location=') . '\'+this.value">';
i have a default choose selected,when they go to shopping cart it shows my default selection (Residence). Right now when a customer chooses another selection (Commercial) it redirects them to FILENAME_CHECKOUT_SHIPPING with (Residence) still selectedand will not change.
i changed the code to this
$shipping_form .= '<select name="freightquote_delivery_location" onchange="window.location.href=\'' . zen_href_link(FILENAME_SHOPPING_CART, 'freightquote_delivery_location=') . '\'+this.value">';
and when on shopping page it works as expected.but checkout shipping still doesnt work goes back to FILENAME_SHOPPING_CART, need the proper name to go in here so it works on both pages
Totally Zenned
i need to hide FLORIDA from showing, but show to everyone else.(i use another module to handle Florida)
i added this because i dont want it to show if under 150 to anyone
if (!IS_ADMIN_FLAG) {
global $cart;
if ($_SESSION['cart']->weight < 150 ) {
$this->enabled = false;
} }
thankyou
jimmie
Oba-san
Could you give more details?
What are you trying to hide from FLORIDA?
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Totally Zenned
Don't want shipping module to show when customer wants it shipped to Florida or show if under 150 lbs.
Oba-san
You could try this, for example if you were customizing the Zone Rate zones shipping module you would add the code in RED:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
}
[B] global $total_weight, $order;
//echo 'zones total_weight: ' . $total_weight . ' Zone: ' . $order->delivery['zone_id'] . '<br>';
if ($order->delivery['zone_id'] == 18 || $total_weight >= 150) {
$this->enabled = false;
}
[/B]
Where 18 is the zone_id for Florida ...
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Totally Zenned
At work try it later, but does it disable under 150 everywhere else.
thankyou
Oba-san
Change that to < vs >= as I wrote that backwards ...
The limit for weight is to block it for everyone ...
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Totally Zenned
thank you that works.
can you help me with a couple more?
Like this One
if ($data->fields['products_freightquote_enable'] == '1') {
$product_list[] = array(
'Class' => (zen_not_null($data->fields['products_freightquote_class']) ? $data->fields['products_freightquote_class'] : '50'),
'ProductDescription' => $product['name'],
'Weight' => ceil($product['quantity'] * (int)$product['weight']),
'Length' => ceil($data->fields['products_freightquote_length']),
'Width' => ceil($data->fields['products_freightquote_width']),
'Height' => ceil($data->fields['products_freightquote_height']),
'PackageType' => (zen_not_null($data->fields['products_freightquote_package_type']) ? $data->fields['products_freightquote_package_type'] : 'Boxes'),
'DeclaredValue' => round($product['price']),
'CommodityType' => (zen_not_null($data->fields['products_freightquote_commodity_type']) ? $data->fields['products_freightquote_commodity_type'] : 'GeneralMerchandise'),
'ContentType' => (zen_not_null($data->fields['products_freightquote_content_type']) ? $data->fields['products_freightquote_content_type'] : 'NewCommercialGoods'),
'IsHazardousMaterial' => $data->fields['products_freightquote_hzmt'],
'NMFC' => $data->fields['products_freightquote_nmfc'],
'PieceCount' => ceil$product['quantity'], Added ceil here
'ItemNumber' => $counter
);
The 'Weight' code in red does not round or mutiply, is there another way to write this to round product quantity and product weight, then mutiply?
'Piececount' also in red, i just need to add round or ceil to the front.
Oba-san
You have in there:
'Weight' => ceil($product['quantity'] * (int)$product['weight']),
The (int)$product['weight'] means take:
5.75 = 5
6.25 = 6
3.10 = 3
6.99 = 6
This is coded wrong:
'PieceCount' => ceil$product['quantity'], Added ceil here
What is the goal for:
'Weight' =>
and for:
'PieceCount' =>
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Totally Zenned
the goal for weight is to determine the products weight and not the weight of the cart
Piececount = how many pieces
Totally Zenned
this is the way i edited it in the file
'PieceCount' => round($product['quantity']),
Oba-san
Humor me for a minute ...
What do you expect the results of:
(int)5.99 =
ceil(100 * (int)5.99) =
What kinds of Product Weight do you use, give 7 examples ...
What kinds of Product Quantities do you get on orders, give 7 examples ...
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Totally Zenned
i did not write this freightquote, thought that because it was written for v1.37 might have to make changes to work. as it stands this module does not work with sq ft. without some modifications. Have spoken with freightquote.com and he agrees that their api does not do decimals. i sell some products by the sq. ft. and have set min-max up. there is 18.94 sq ft. in carton. that carton weighs 30 lbs, i cant put 30 as weight. 30 x 18.94. so i divided 18.94 into 30=1.583949313621964 lbs per foot. that is what i enter as weight.
p. s. every freightquote module written for other carts is the same
Totally Zenned
a person could order 1200 ft of laminate add couple rolls of underlayment add some moldings. there is 1200+ quantity
Totally Zenned
if i use this than whole cart is weighed, i drop ship and if they have other than flooring it will be wrong weight
'Weight' => ceil($_SESSION['cart']->weight),
Oba-san
So if you have:
Quantity 1200 and Weight 1.583949313621964
What do you want it to equal?
1200 * 1.583949313621964 = 1900.7391763464
-- or --
ceil(1200 * (int)1.583949313621964) = 1200
-- or --
ceil(1200 * 1.583949313621964) = 1901
Linda McGrath
If you have to think ... you haven't been zenned ...
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!
Totally Zenned
you be wondering why i dont switch over to sell by the carton. Well because most customers understand sq ft. When they measure they get sq ft. Easier to know
Tell staff why this post should be reviewed.