VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Topic started by: terp on April 18, 2012, 23:29:21 pm

Title: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp on April 18, 2012, 23:29:21 pm
...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]
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp on April 24, 2012, 17:37:33 pm
Everyone else just lives with it or should I just strip it out using an override?
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: teobgeno 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.
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: zebrafilm on April 24, 2012, 21:02:00 pm
Thanks, but it removes the checkbox but it keeps asking/warning to check it.

Bastiaan
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: teobgeno 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 ) ?
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp 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.

Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: katalystsol 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" />

Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: teobgeno 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 .
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: teobgeno 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.
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: zebrafilm 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
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp 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 ).

Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp 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?
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: zebrafilm on May 01, 2012, 16:14:52 pm
exactly my feeling....

Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: murenti 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.

Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp 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?)
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: zebrafilm on May 02, 2012, 07:28:51 am
Hey guys, don't lets get off the subject and stay nice.

I am sure everybody here appreciates all efforts and is aware of it. But this is the 'developers' thread so I think it is legitimate to do suggestions for a better workflow or signal problems.

As a webbuilder I choose VM2 for most of my work but it is not easy to deal with te problems that are not solved for a long time, wile new things keep coming up.
How do I explain it to my clients?

The request for a central place to make a list of the current bugs and problems is a good request in my opinion. If you see how many 'issues' are submitted everyday here, it is easy to loose the overview.

Submitting problems (with all details) is also an effort to help and yes I wish I could also do some helpful coding but that is just a step to far at the moment so I am relying on the VM team.
Because of client complains about 'none solved issues I have to move to other components and that hurts.
That should really not be necessary.

Bastiaan


Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: Milbo on May 03, 2012, 02:41:22 am
I just did not noticed this issue. I wanted to fix it today and found out that we connected the agree of joomla with the agree to the tos which is just wrong. In most cases it is the same, but not in all cases. Agreeing to register is not the same as agreeing to tos. For example the text for a joomla forum register process is not the same as in the shop. So maybe the best solution is to add a new tos field. Because this problem is also connected that there is no link to the TOS in the address field. Also it seems atm not to store anylonger when I already agreed to the tos. I will take a look on this soon.
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: murenti on May 03, 2012, 02:47:28 am
I have misunderstood the context of what was said, sorry.

All to often I see many in forums like these direct abuse to people who are offering their services and I don't think it is fair.  I really did not want to start a major issue and perhaps my wording could have been better as well.  I was only trying to make others aware that checking how they relay their message is important to the receiver, but perhaps I should have listened to my own advice and checked my own wording first!

I understand your position now, thanks
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: murenti on May 03, 2012, 02:48:51 am
Terp, I think you may have been angry, sorry but you still made me laugh with your comment.

 ;D
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp on May 03, 2012, 03:29:25 am
I just did not noticed this issue. I wanted to fix it today and found out that we connected the agree of joomla with the agree to the tos which is just wrong. In most cases it is the same, but not in all cases. Agreeing to register is not the same as agreeing to tos. For example the text for a joomla forum register process is not the same as in the shop. So maybe the best solution is to add a new tos field. Because this problem is also connected that there is no link to the TOS in the address field. Also it seems atm not to store anylonger when I already agreed to the tos. I will take a look on this soon.

Thanks, sir.  I was just unsure of how we get real bugs on the radar...
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: zebrafilm on May 03, 2012, 07:35:48 am
off topic:
Bugs should be listed here:
http://dev.virtuemart.net/projects/virtuemart/issues
But can't be added by the public.. Luckily most them are solved before the next release but to prevent duplicate postings it might be good to keep that list a bit more active?
Milbo also wrote an explanation about the tracker: http://forum.virtuemart.net/index.php?topic=78322.0

On topic:
It would be great if the TOS issue is solved. It really 'hinders' the checkout at the moment. Got lots of complaints from different peoples/sites. Changing the structure might effect other things like the "One page checkout" systems.

Bastiaan
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp on May 03, 2012, 15:54:45 pm
off topic:
Bugs should be listed here:
http://dev.virtuemart.net/projects/virtuemart/issues
But can't be added by the public.. Luckily most them are solved before the next release but to prevent duplicate postings it might be good to keep that list a bit more active?
Milbo also wrote an explanation about the tracker: http://forum.virtuemart.net/index.php?topic=78322.0


Exactly what I was looking for; many thanks.
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: terp on June 08, 2012, 22:57:46 pm
I don't see this on the tracker after two months...what's everyone doing? I am rolling up my sleeves, gutting out all ToS crap, and then just moving on...
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: Margriet on July 01, 2012, 10:31:09 am
Just updated to 2.0.8 and the problem still exists, sorry..........
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: teran on October 30, 2012, 17:46:57 pm
Hello, i have the latest virtuemart version to date and this is still an issue for me, i fixed it thanks to the two overrides quoted below, but now i can't update anymore :(

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.
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 .
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: cr33 on November 20, 2012, 02:20:11 am
This worked for me:

Code: [Select]

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

But turning on user registration at checkout brought the checkbox back, even though I had disabled it in the Joomla user profile plugin.

I had to edit edit_address_userfields.php and add this just after the delimiter check:
Code: [Select]
if ($_field['name'] == 'agreed'){
continue;
}

I normally wouldn't just hack on core files like this, but I see no alternative.
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: jasmithartist on February 08, 2013, 19:21:56 pm
I know this is a late response, but I found how to fix this. I'm using VM 2.0.18/Joomla 2.5.8.

Under Configuration -> Checkout, I made sure both of the following were unchecked -
-Must agree to Terms of Service on EVERY ORDER?
and    
-Show Terms of Service on the cart/checkout?

After unchecking these, while the text disappeared at checkout, the checkbox was still there. To get rid of the checkbox, I went to Configuration -> Shopper Fields and selected the checkbox next to "Agreed" and at the top of the page clicked "not required." That fixed it for me.
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: jelly on February 25, 2013, 12:42:47 pm
jasmithartist, thank you for your quick and simple solution!

My <<Configuration -> Shopper Fields and selected the checkbox next to "Agreed">> is locked, it says: Userfield of the Joomlacore. But clicking on the word Agreed, allowed me to make some changes and it helped.

THANX!
Title: Re: [Bug] Terms-of-Service Checkbox Field Showing With ToS Disabled
Post by: RCheesley on August 23, 2013, 12:11:48 pm
Fixed it for me too - the shopper field being set to being on - I just turned it off and it seems to have resolved the problem.  Thank you :)