Author Topic: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work  (Read 16837 times)

spacialek

  • Jr. Member
  • **
  • Posts: 56
    • Xaomé - Intégration Joomla
I don't need (and don't want) to have the Terms of Service displayed anywhere in my store, so I disabled the function, but it keep showing in the cart and user info form, and cannot checkout until I check it

Tried it on a Joomla 1.5 + VM 2.0 clean version.



[attachment cleanup by admin]

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10017
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #1 on: December 31, 2011, 14:03:09 pm »
The option must agree on every order is meant for countries like France, where it is not allowed to use an already given agreement.

Just disable the agree field in the shopperfields and remove with templating the TOS checkbox. This should work already.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

spacialek

  • Jr. Member
  • **
  • Posts: 56
    • Xaomé - Intégration Joomla
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #2 on: December 31, 2011, 19:42:45 pm »
I use the cart as a way for the customer to request a quote with selected products (an later on will use it as a real shopping cart), so I don't think the TOS is required for the moment, and have nothing to write inside!
I tried disabling it in the shopper fields, but it's locked, how do I unlock it?

spacialek

  • Jr. Member
  • **
  • Posts: 56
    • Xaomé - Intégration Joomla
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #3 on: December 31, 2011, 20:19:44 pm »
I found a way to unlock the shopper fields, without having to hack the core system, but it's unlocking all the core fields.
I have made an administrator template override of the userfields/default.php file. And commented out the following line:
Quote
//$coreField = (in_array($row->name, $this->lists['coreFields']));

How can I just remove the 'agreed' value from the array instead of commenting out every fields?

Thanks!

design609

  • Jr. Member
  • **
  • Posts: 68
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #4 on: January 28, 2012, 17:06:01 pm »
What I did...
following you great idea about doing a template override:
Was just to turn of what I needed on the shopperfield "Agreed"
(after the template override of /administrator/templates/khepri/html/com_virtuemart/userfields/default.php)

When finished doing my setting (which I only could from the list of shopperfields clicking the icons - not from inside the field itself)
I just reverted the override file again - then the core fields again was locked and my "agreed" field kept its settings.

* Anyway I still think this "Agreed" field should not be in the core fields - It must be up to the shop owners to check their legal of their country/state and make their setting accordingly instead other shipowners are forced to have this present on checkout

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10017
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #5 on: January 29, 2012, 02:16:56 am »
I do not understand this, because afaik you can edit the customfields, just not in the list.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

coin

  • Beginner
  • *
  • Posts: 5
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #6 on: January 29, 2012, 11:47:53 am »
Milbo, please could you explain how to edit locked userfileds. Even when I go to the edit page from the list, I cannot disabled it because radiobuttons for it are readonly.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10017
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #7 on: January 29, 2012, 15:59:46 pm »
ahhh, there is it. Yes but in fact I should add a nice option. The agreed field is a bit more tricky then the others. Because we handle it two times. But we cant change it atm. But for the while.

Take a look on the FE/helpers/cart.php and search there for tosAccepted. Set this field in the constructor to 1. and in the function checkoutData change line 748
Code: [Select]
$this->tosAccepted = JRequest::getInt('tosAccepted', $this->tosAccepted); to
Code: [Select]
$this->tosAccepted = 1;
Use in your db the adjusted line
Code: [Select]
UPDATE `jos_virtuemart_userfields` SET `required`=0, `account`=0 WHERE `virtuemart_userfield_id`=4 LIMIT 1;
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

design609

  • Jr. Member
  • **
  • Posts: 68
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #8 on: January 31, 2012, 11:02:52 am »
@Coin
look at the solution of spacialek's post
Much easier - and you can edit it from the overview list of all fields (with the checkmarks) just not from within the field screen for only "Agreed" with radiobuttons.


rustle

  • Jr. Member
  • **
  • Posts: 83
  • Mad love for the VM project
    • Independent Development
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #9 on: February 09, 2012, 16:47:41 pm »
Milbo's solution work perfectly

I highly recommend  :D

nflmerch

  • Jr. Member
  • **
  • Posts: 114
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #10 on: February 10, 2012, 01:00:21 am »
Yup, Milbo's awesome.

slutsker

  • Beginner
  • *
  • Posts: 39
    • Audio Adapters
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #11 on: April 03, 2012, 10:46:01 am »
but what will happen after update to new version ?

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #12 on: August 30, 2012, 14:02:01 pm »
What I did...
following you great idea about doing a template override:
Was just to turn of what I needed on the shopperfield "Agreed"
(after the template override of /administrator/templates/khepri/html/com_virtuemart/userfields/default.php)

When finished doing my setting (which I only could from the list of shopperfields clicking the icons - not from inside the field itself)

I just reverted the override file again - then the core fields again was locked and my "agreed" field kept its settings.

* Anyway I still think this "Agreed" field should not be in the core fields - It must be up to the shop owners to check their legal of their country/state and make their setting accordingly instead other shipowners are forced to have this present on checkout

This still isn't working in 2.0.10

great tip - and it also meant that I found out how powerful template overrides can be...

rather than commenting out the line I just added a checkbox to the core fields ...
replacing
Code: [Select]
$checked = ($coreField) ?
'<span class="hasTip" title="'. JText::_('COM_VIRTUEMART_FIELDMANAGER_COREFIELD').'">'. $image .'</span>' :
JHTML::_('grid.id', $i, $row->virtuemart_userfield_id);

with
         
Code: [Select]
$checked = ($coreField) ?
'<span class="hasTip" title="'. JText::_('COM_VIRTUEMART_FIELDMANAGER_COREFIELD').'">'. $image .'</span>'.JHTML::_('grid.id', $i, $row->virtuemart_userfield_id) :
JHTML::_('grid.id', $i, $row->virtuemart_userfield_id);

changing and saving a new order then works ... fantastic ... changing it in each individual edit screen for each field was just not an option for me... too many fields that are all over the shop (sic)

Also saw a nice sql tip about renumbering items in the list
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

guimplenchik

  • Beginner
  • *
  • Posts: 26
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #13 on: December 13, 2012, 17:24:43 pm »
Still the ToS field couldn't be modified... any plans to fix this? (VM 2.0.14)

rzrz

  • Jr. Member
  • **
  • Posts: 65
Re: Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work
« Reply #14 on: January 30, 2013, 13:29:36 pm »
Still the ToS field couldn't be modified... any plans to fix this? (VM 2.0.14)

ditto