Jump to content

Add "conditions to approve"


Kalle Swayze

Recommended Posts

Hi guys,

recently I have installed a PrestaShop 1.7.8.6. In checkout there is a condition which needs to be checked. It says something like "I have read the terms and conditions and agree to them without reservation." (translated from German). At the end of the post you can find a screenshot of what I mean.

 

I found out the condition is coming from this file /themes/classic/templates/checkout/_partials/steps/payment.tpl

 

<ul>
  {foreach from=$conditions_to_approve item="condition" key="condition_name"}
    <li>
      <div class="float-xs-left">
        <span class="custom-checkbox">
          <input  id    = "conditions_to_approve[{$condition_name}]"
                  name  = "conditions_to_approve[{$condition_name}]"
                  required
                  type  = "checkbox"
                  value = "1"
                  class = "ps-shown-by-js"
          >
          <span><i class="material-icons rtl-no-flip checkbox-checked">&#xE5CA;</i></span>
        </span>
      </div>
      <div class="condition-label">
        <label class="js-terms" for="conditions_to_approve[{$condition_name}]">
          {$condition nofilter}
        </label>
      </div>
    </li>
  {/foreach}
</ul>

 

But I can not find where the content is coming from, also Google was not a helper here.

And as I need (or better say want) to add another condition (with a separate checkbox) I need to know where the initial condition is coming from, to add the other one the same way as the first was added.

Thanks a lot for your, appreciate it
Kalle

2022-07-16 23_47_50-KS-Checkout.png

Edited by Kalle Swayze
Styling, Typo, etc. (see edit history)
Link to comment
Share on other sites

It can be disabled from BO > Shop Settings > General

You can enable or disabled the default checkbox and choose the CMS page linked.

You can add new checkboxes with a module hooked on termsAndConditions hooks

https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/classes/checkout/ConditionsToApproveFinder.php

Edited by Janett (see edit history)
Link to comment
Share on other sites

Hi Janett,

thanks a lot for your answer. In my Back Office I can see Shop Parameters > General (but I guess it's the same(?)). Unfortunately I can not find any option related to this here. Attached is a screenshot of all options I have available there.

I will have a look on the module, and see if it does what I need, thanks.

Best regards
Kalle

2022-07-17 11_15_47-KS-Shop-Parameters-General.png

Edited by Kalle Swayze
Changed name (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...