Shiping costs bug in frontend. Shipping module does not consider weight any more

Started by kratzi, April 26, 2016, 19:25:29 PM

Previous topic - Next topic

kratzi

Hi I have tested the following on different Joomla 3.4.6 -3.5.1 and VM versions 3.0.14-3.0.16 and do not see it working any more even though the feature was good working in J2.5 and VM 2.6

I use product weight to show different shipping cost on the productdetails page. If  I have defined a product with over  30kg the customer gets free shipping and below 25kg I charge shipping.

In the backend there is a feature "Show on productdetails page" which I have active for free shipping (over 30kg). However the module will not consider the weight any more but always show shipping costs to the customer because it seems it does not look for the product weight any more.

Is there alredy a fix for this?

Thank you

kratzi


GJC Web Design

Yes - this is broken

in the weight - countries ship plugin any way.. the function plgVmOnProductDisplayShipment() is called by the view.html.php 

in the weight - countries ship plugin this function tries to call the  if($this->checkConditions($cart,$this->_currentMethod,$prices,$product)){

but func. is  protected function checkConditions ($cart, $method, $cart_prices) - i.e. no $product  - oddly? this is then true

added this which makes it work

protected function checkConditions ($cart, $method, $cart_prices, $product) {

and

//GJC
if(!empty($product->product_weight)){
$orderWeight = $product->product_weight;
}else{
$orderWeight = $this->getOrderWeight ($cart, $method->weight_unit);
}
//GJC


as a quick fix - of course gives warnings of missing 4th argument &

plgVmShipmentWeight_countries::checkConditions() should be compatible with vmPSPlugin::checkConditions($cart, $method, $cart_prices)

but don't know how the function is intended to be or what the final fix will be
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

Milbo

The order weight is taken from the cart, not from the product

$orderWeight = $this->getOrderWeight ($cart, $method->weight_unit);

is in line 250, you should find the reason, why it does not calculate the weight.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

I think the right solution is to use


var $_productAdded = true;


in cart.php helper, line 35.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/