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
Can confirm what you found - discovered this today as well with a fresh install
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?
Fixed by Max, should be sorted in next release!
Thanks!