2.0.26b and a bug Shipto when only BT is added cart.php

Started by AH, January 06, 2014, 23:20:42 PM

Previous topic - Next topic

AH

In vm 2.0.26a  fine in 2.0.26

default_pricelist.php and helpers/cart.php

Using OPC checkout configuration.

The template modifies the shipping address message based on their being ST data populates, allowing any added ST address to be ignored (nice function!)

However I noticed that in 2.0.26a , after completing the billing address and refreshing the page, the checkout displays the message and tick box as though I had completed a different ST address.

"Tick to ignore this Shipping address" and the tick box.


On closer inspection I can see that on completion of the BT address $this->cart->STaddress['fields'] is populated with the BT fields,

This causes the test for a different ST to BT address to trigger on page refresh (e.g.  selecting and saving a shipping or payment method)


<div class="output-shipto">
<?php
if (empty($this->cart->STaddress['fields'])) {
echo JText::sprintf ('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_EXPLAIN'JText::('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL'));
} else {
if (!class_exists ('VmHtml')) {
require(JPATH_VM_ADMINISTRATOR DS 'helpers' DS 'html.php');
}



IN addition

When the user tries to enter a different shipping address the fields are already populated with the BT data

Looks like the cause of this is some small changes to helpers/cart.php


Regards
A

Joomla 3.10.11
php 8.0

GJC Web Design

Can confirm what you found - discovered this today as well with a fresh install
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

AH

Using kdiff3 to identify the changes from 2.0.26 to 2.0.26a/b

There are a couple of tiny change to the code one of which is around line 881 in helpers/cart.php

if($this->STsameAsBT!==0){
if($validUserDataBT!==-1){
$this->ST = $this->BT;
} else {
$this->ST = 0;
}



IN 2.0.26  (which did not have this issue:-)

if($validUserDataBT!=-1){

if($this->STsameAsBT!==0){
if($validUserDataBT!=-1){
$this->ST = $this->BT;
} else {
$this->ST = 0;
}



If I change the code it works fine and the ST address data is not populated with the BT details

However there area couple of times where the test has changed from !=-1  to !==-1

Milbo or Alatak?
Regards
A

Joomla 3.10.11
php 8.0

AH

Regards
A

Joomla 3.10.11
php 8.0