Author Topic: 2.0.26b and a bug Shipto when only BT is added cart.php  (Read 1829 times)

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3506
  • VirtueMart Version: 3.8.9
2.0.26b and a bug Shipto when only BT is added cart.php
« on: January 06, 2014, 23:20:42 pm »
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)

Code: [Select]
<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.9.27
php 7.4

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10334
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Can confirm what you found - discovered this today as well with a fresh install
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3506
  • VirtueMart Version: 3.8.9
Re: 2.0.26b/a bug in display of Shipto when only BT is added cart.php
« Reply #2 on: January 07, 2014, 00:21:29 am »
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

Code: [Select]
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){

Code: [Select]
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.9.27
php 7.4

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3506
  • VirtueMart Version: 3.8.9
Re: 2.0.26b and a bug Shipto when only BT is added cart.php
« Reply #3 on: January 08, 2014, 22:06:56 pm »
Fixed by Max, should be sorted in next release!
Regards
A

Joomla 3.9.27
php 7.4

ocsalb

  • Beginner
  • *
  • Posts: 6
Re: 2.0.26b and a bug Shipto when only BT is added cart.php
« Reply #4 on: April 10, 2014, 16:50:48 pm »
Thanks!