Hello all together,

in my checkout I have configured three extra panes with the enabled checkbox "Enable this pane as Terms of Service".
and in all extra panes the same text is shown:
"I agree with the Terms of Service *"

But what I need are three extra panes with different check box descriptions:

1. extra pane: "I confirm that I..."
2. extra pane: "I agree with the Terms of USE"
3. extra pane: "I agree with the Terms of Service *"

Is there a possibility to change the description of the check box manually?

Or if someone could add an input field for the check box description next to the check box "Enable this pane as Terms of Service" it would be even easier.

Thanx for your help.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

design.er’s picture

German online shops has new rules for "terms of service agreements" -> 2 checkboxes are needed:

  • I agree with the terms of service.
  • I have read the right of revocation.

Is it possible to alter the commerce_extra_panes_termsofservice_form_alter() function with if-statements to manipulate the links/output for each extra pane manually?
It would be a great approach in conjunction with #1830712: Possibility to have separate page for "I agree" to the Terms of Service.

vantastic’s picture

I second the OP's request for this feature.

There is little use in having the ability to add multiple extra TOS panes if they all display the same standard "I agree with the Terms of Service" message next to the checkbox.

For now, here is a CSS work-around, using the fact that each TOS [checkbox + label] are wrapped in a DIV with a unique class identifier, generated by the module. The unique DIV class is simply named after the content node that contains the relevant TOS text. The naming convention is: form-item-extra-pane--node--XX-termsofservice, where XX is the ID number of the content node.

So using this, in /modules/system/system.theme.css, or another loaded CSS if you prefer, we add:

div.form-item-extra-pane--node--XX-termsofservice label.option{
	visibility:hidden;
	}

Where XX is of course still the relevant node number. This will remove the original label text. Then we add:

div.form-item-extra-pane--node--XX-termsofservice label.option:before{
	content:'I agree to this*';
	visibility:visible;
	}

Where XX is of course still the relevant node number. This will place the desired unique text in front of the (now invisible) original text with whatever you put in the CSS content attribute.

Not ideal, but it does the job for now without having to touch the module code. You will likely need to customse the css a little more to ensure flawless integration in your theme, especially if you want the * to be displayed correctly.

pcambra’s picture

Category: support » feature

Patches are welcome for adding this, but please, no CSS content fixes.

rikki_iki’s picture

Status: Active » Needs review
FileSize
4.38 KB

My first proper patch so apologies for any issues.

This makes an editable checkbox label for unlinked version, as well as making the linked text the node title and makes the link prefix editable.
Should cover the majority of use cases.

haggins’s picture

Status: Needs review » Needs work

Thanks rikki. Unfortunately this does not work for every language.

In english you can say: "I agree with the %tile".
In german it's: "Ich stimme den %title zu".

So you need a placeholder for the link instead just appending it to the label.

rikki_iki’s picture

Status: Needs work » Needs review
FileSize
5.31 KB

Of course, thanks for pointing that out @haggins
I've added a placeholder for %title.

haggins’s picture

Great!
I rerolled your patch against current dev.

pvdjay’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Tested. Works beautifully against current 1.x-dev.

howdytom’s picture

We also need 2 checkboxes with different descriptions.

Sounds great. How can I get the latest release including your recent changes? As far as I see 7.x-1.x-dev doesn’t contain those changes. I don’t want to hack core.

pvdjay’s picture

fugazi’s picture

Unfortunately, the translation of the string does not work.

fugazi’s picture

I have now tried everything. The string is displayed in the Translation. But in the cart, it will not be translated. See the screenshot. Maybe someone has a tip?

(Ich stimme der %title zu) typo in translation corrected but unfortunately does not go well

fugazi’s picture

I have tried the patch from https://www.drupal.org/node/2007352, and here the translation works.

fugazi’s picture

I sorry that I have to please churned everything here. I have found the error. We have attached a patch