Disabling "Must agree to Terms of Service on EVERY ORDER?" doesn't work

Started by spacialek, December 30, 2011, 23:50:47 PM

Previous topic - Next topic

spacialek

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

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

spacialek

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

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

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

I do not understand this, because afaik you can edit the customfields, just not in the list.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

coin

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

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
$this->tosAccepted = JRequest::getInt('tosAccepted', $this->tosAccepted);
to
$this->tosAccepted = 1;

Use in your db the adjusted line
UPDATE `jos_virtuemart_userfields` SET `required`=0, `account`=0 WHERE `virtuemart_userfield_id`=4 LIMIT 1;
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

design609

@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



slutsker


Jason Farmer

Quote from: design609 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

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
$checked = ($coreField) ?
'<span class="hasTip" title="'. JText::_('COM_VIRTUEMART_FIELDMANAGER_COREFIELD').'">'. $image .'</span>' :
JHTML::_('grid.id', $i, $row->virtuemart_userfield_id);


with
         $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

[tr][td][/td][td]
Development[/td][td]Production[/td][/tr]
[tr][td]VirtueMart   [/td][td]
2.0.12b
[/td][td]
1.1.3
[/td][/tr]
[tr][td]Joomla!   [/td][td]
2.5.6
[/td][td]
1.5.14
[/td][/tr]
[tr][td]Mysql  [/td][td]
5.5.8
[/td][td]
5.0.51
[/td][/tr]
[tr][td]PhP   [/td][td]
5.3.5
[/td][td]
5.2.4
[/td][/tr]
[/table]

guimplenchik

Still the ToS field couldn't be modified... any plans to fix this? (VM 2.0.14)

rzrz