News:

Support the VirtueMart project and become a member

Main Menu

Weird lines in Cart.php should be removed VM3

Started by virtuemartaustralia, May 06, 2015, 05:30:09 AM

Previous topic - Next topic

virtuemartaustralia

Dear Dev team!
We have encountered a problem costed us 3 hours, we thought it's our post plugin's problem, then suspected cmsmart opc's problem, then finally spotted these lines.

components/com_virtuemart/controllers/cart.php

public function updatecart($html=true){

if(empty($cart->selected_shipto) or $cart->selected_shipto<1){
$cart->STsameAsBT = 1;
$cart->selected_shipto = 0;
} else {
$cart->STsameAsBT = 0;
}

These lines should be removed!!
I suppose it is detecting if any saved Shipto info is chosen, but not every opc plugin has saved shipto list for choosing, for eg: cmsmart opc.
thus while saving the order to database, the variable STsameAsBT was changed to 1 every time, but it's the variable we use to calculate the postage!
It should use the ST zip cuz STsameAsBT was not chosen, but instead it used BT zip cuz u changed this variable in php.
IMHO, u should not change this variable in php.
www.virtuemartoz.com
Shipping: AusPost NZPost
Payment: eWay, SecurePay, merchantwarrior, ematters, paymentexpress
Infinite Scroll,Category Discount,wholesale Discount
Westfield Integration, Make An Offer/Best Offer
We do things others can't do, call Us For A hand of help.

Milbo

Ehrm, read your post again. You may get the error of your proposel yourself.

and btw, your 3 hours are a joke compared to the weeks we worked on that. Go the cmsmart, explain them, that the selected_shipto is actually used since vm2, if not even vm1.1
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

AH

QuoteThese lines should be removed!!


Noooooo!

The cart is working fine

" but it's the variable we use to calculate the postage!"

Then change the way your system works!

3 hours - pah!!!

I spent more hours testing this for free!

I suggest you sort out your own OPC issues
Regards
A

Joomla 3.10.11
php 8.0