News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Product Weight Retrieval for Shipping

Started by CGLaidlaw, March 03, 2015, 22:09:22 PM

Previous topic - Next topic

CGLaidlaw

I am currently working on implementing the FedEx Plugin for VM 3.0.4 shipping methods. However, as I have been working with the plugin that I am using for FedEx, it does not support multi-package or Fright LTL shipping. So I am taking it upon myself to expand the functionality of this plugin to allow shipping of carts that exceed 150 LBS via multi-packaging and allowing shipping items of individual weight that exceeds 150 LBS for Freight LTL. In order for me to do this I need to access the individual weights of the individual items within the cart to calculate the packages/freight shipping costs. Where would I find the calculation for the cart? (Assuming the total cart weight is calculated in the code from the individual weights)

The only reference that I have been able to find is at: http://forum.virtuemart.net/index.php?topic=115233.0
Where they mention the use of vmShipmentMethod::get_weight($product["virtuemart_product_id"]) * $product->quantity'];
yet I do not see this method anywhere in the cart.php file within the virtuemart component.

GJC Web Design

something like?  (un-tested)


$product_weights = array();
foreach ($cart->products as $product) {
$product_weights[$product->virtuemart_product_id] = $product->product_weight*$product->quantity;
}

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

CGLaidlaw

I will try it out and let you know, thank you!!