Author Topic: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled  (Read 22343 times)

terp

  • Beginner
  • *
  • Posts: 45
...perhaps related to a workout you guys did in the cart.php file:

/* The problem here is that we use a form for the quantity boxes and so we cant let the form start here,
 * because we would have then a form in a form.
 *
 * But we cant make an extra form here, because then pressing the above checkout button would not send the
 * user notices for exampel. The solution is to write a javascript which checks and unchecks both tos checkboxes simultan
 * The upper checkout button should than just fire the form below.


Code: [Select]
<input class="terms-of-service" id="tosAccepted" type="checkbox" name="tosAccepted" value="1">




[attachment cleanup by admin]

terp

  • Beginner
  • *
  • Posts: 45
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #1 on: April 24, 2012, 17:37:33 pm »
Everyone else just lives with it or should I just strip it out using an override?

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #2 on: April 24, 2012, 17:52:11 pm »
At components/com_virtuemart/views/cart/tmpl/default.php line 127 - 132

Code: [Select]

   <?php
if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php');
echo VmHtml::checkbox('tosAccepted',$this->cart->tosAccepted,1,0,'class="terms-of-service"');

if(VmConfig::get('oncheckout_show_legal_info',1)){
?>



The if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php');
            echo VmHtml::checkbox('tosAccepted',$this->cart->tosAccepted,1,0,'class="terms-of-service"');

must be below the if(VmConfig::get('oncheckout_show_legal_info',1)){

like this

Code: [Select]
  <?php


if(VmConfig::get('oncheckout_show_legal_info',1)){
if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php');
echo VmHtml::checkbox('tosAccepted',$this->cart->tosAccepted,1,0,'class="terms-of-service"');
?>



I am talking about the default template of virtuemart 2.0.6 . I think you will be ok with this modification.

zebrafilm

  • Jr. Member
  • **
  • Posts: 58
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #3 on: April 24, 2012, 21:02:00 pm »
Thanks, but it removes the checkbox but it keeps asking/warning to check it.

Bastiaan

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #4 on: April 24, 2012, 21:20:42 pm »
Are you sure that the option Must agree to Terms of Service on EVERY ORDER? is unchecked at configuration->checkout( tab ) ?

terp

  • Beginner
  • *
  • Posts: 45
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #5 on: April 25, 2012, 20:07:25 pm »
It's forcing people to check the box, whether the backened params related to the Terms-of-Service are checked or not...cart compiles with the checkbox and forces the check...clearly a bug.


katalystsol

  • Beginner
  • *
  • Posts: 6
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #6 on: April 26, 2012, 00:21:55 am »
I have the same issue with a clean install of 2.0.6 on J1.5.26

For me, it outputs two fields with the same name attribute:

Code: [Select]
<input type="hidden" name="tosAccepted" value="0"><input class="terms-of-service" id="tosAccepted" type="checkbox" name="tosAccepted" value="1" checked="checked" />


teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #7 on: April 26, 2012, 15:13:52 pm »
At components/com_virtuemart/helpers/cart.php

Below is setting the agree to terms var
Code: [Select]
if((!empty($user->agreed) || !empty($this->BT['agreed'])) && !VmConfig::get('agree_to_tos_onorder',0) ){
$this->tosAccepted = 1;
}



Try to modify it to
Code: [Select]
$this->tosAccepted = 1;

if((!empty($user->agreed) || !empty($this->BT['agreed'])) && !VmConfig::get('agree_to_tos_onorder',0) ){
$this->tosAccepted = 1;
}


But this is not a correct solution just a quick fix .

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #8 on: April 26, 2012, 15:20:16 pm »
Quote
For me, it outputs two fields with the same name attribute

I don't have this output with joomla 1.5.26 vm 2.0.6 (vm template default) (joomla template default)
Try to check your vm template in case you have made an override.

zebrafilm

  • Jr. Member
  • **
  • Posts: 58
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #9 on: April 26, 2012, 21:31:37 pm »
Adding $this->tosAccepted = 1; makes the checkbox checked by default.

That helps already. :-)

Lets hope it will be fixed in the next version.

Bastiaan

terp

  • Beginner
  • *
  • Posts: 45
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #10 on: April 27, 2012, 05:07:30 am »
Adding $this->tosAccepted = 1; makes the checkbox checked by default.

That helps already. :-)

Lets hope it will be fixed in the next version.

Bastiaan

Yea, that's what I ended up doing, then just hide the field in the CSS ( .checkout-button-top input.terms-of-service ).


terp

  • Beginner
  • *
  • Posts: 45
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #11 on: May 01, 2012, 15:35:41 pm »
Do reported bugs often get overlooked here in VM world? Are we supposed to log them somewhere else?

zebrafilm

  • Jr. Member
  • **
  • Posts: 58
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #12 on: May 01, 2012, 16:14:52 pm »
exactly my feeling....


murenti

  • Beginner
  • *
  • Posts: 19
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #13 on: May 02, 2012, 04:09:25 am »
I am very grateful for Virtuemart and the people behind it. 

Its easy to sling criticism from the side lines but is it helpful???

You are enjoying the benefits of VirtueMart and the help of volunteers to solve your issues YET you are ready to make rude remarks at the first chance.  Instead of picking and criticizing why dont you offer something constructive to VirtueMart and the Human race by thinking of others instead of yourself.


terp

  • Beginner
  • *
  • Posts: 45
Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
« Reply #14 on: May 02, 2012, 04:58:46 am »
I am very grateful for Virtuemart and the people behind it. 

Its easy to sling criticism from the side lines but is it helpful???

You are enjoying the benefits of VirtueMart and the help of volunteers to solve your issues YET you are ready to make rude remarks at the first chance.  Instead of picking and criticizing why dont you offer something constructive to VirtueMart and the Human race by thinking of others instead of yourself.

You talking to me? Show me one instance where I made "rude remarks." Don't you have an Occupy Wallstreet march to attend, Mr. Cosmopolitan? (was that rude?)