I’m trying to add multi-lists subscription to some of my forms and I would like to have some of the checkboxes checked by default. But when I add the “checked” attribute in the form editor, it is automatically removed when I save the form. Is there I way I can achieve this with this plugin?
]]>I am using a code snippet (PHP code) that adds a checkbox to our WordPress registration form.
The PHP code is working great, but when I activate Query Monitor (plugin) it is displaying the following PHP Warning (backend): “Undefined Variable $checked”
Details: https://prnt.sc/1ruAIrLHBzvJ
The affected PHP code is presented below. Any idea how to fix this? (i.e., how should I define the variable “$checked”?)
Thank you.
__________________
// Add the checkbox to registration form
add_action( 'register_form', 'foo_add_privacy_policy_field' );
function foo_add_privacy_policy_field() {
$checked = isset( $_POST['foo_privacy_policy'] ) ? ' checked="checked"' : ''; ?>
<p>
<input type="checkbox" name="foo_privacy_policy" id="foo_privacy_policy" class="checkbox" value="1" <?php echo $checked; ?> style="margin-top: .2px; height: 1rem; width: 1rem;" />
<label for="foo_privacy_policy" style="display: inline!important;"><?php _e( 'I have read and accept your <a href="/privacy/" rel="noopener noreferrer" target="_blank"><u>Privacy Policy</u></a>.', 'foo' ) ?>
</label>
</p>
<?php
]]>I am using a code snippet (PHP code) that adds a checkbox to our WordPress registration form.
The PHP code is working great, but when I activate Query Monitor (plugin) it is displaying the following PHP Warning (backend): “Undefined Variable $checked”
Details: https://prnt.sc/1ruAIrLHBzvJ
The affected PHP code is presented below. Any idea how to fix this? (i.e., how should I define the variable “$checked”?)
Thank you.
__________________
// Add the checkbox to registration form
add_action( 'register_form', 'foo_add_privacy_policy_field' );
function foo_add_privacy_policy_field() {
$checked = isset( $_POST['foo_privacy_policy'] ) ? ' checked="checked"' : ''; ?>
<p>
<input type="checkbox" name="foo_privacy_policy" id="foo_privacy_policy" class="checkbox" value="1" <?php echo $checked; ?> style="margin-top: .2px; height: 1rem; width: 1rem;" />
<label for="foo_privacy_policy" style="display: inline!important;"><?php _e( 'I have read and accept your <a href="/privacy/" rel="noopener noreferrer" target="_blank"><u>Privacy Policy</u></a>.', 'foo' ) ?>
</label>
</p>
<?php
]]>I try to stylish the radio field like a button (this would be a good thing to do for your devs )
I want the radio “button” have a differente style when it is checked.
But it’s seem impossible. Can you tell me why and how to solved this please?
I have tryed this :
.forminator-radio input:checked .forminator-radio-label {
[ MY STYLES ]
}
I have tryed by JS with no success…
Please help me
Thanks!
]]>Situation:
I have 2 shipping zones. Each zone has a local pickup option. The other option is delivery or shipping (depending on the postal code). Both methods are standard WC (local pickup and flat rate).
If I change the shipping address to another zone, the shipping cost are updated and the selected shipping method has a checked radio button. If I change the shipping method to local pickup shipping cost are updated and the local pickup method has a checked radio button. So far, so good.
When I reload the page, the selected method is still local pickup. However, the radio button for the other method (shipping or delivery) is checked. I have verified the value of $current_shipping_method (= local pickup). The total order amount is based on local pickup as well. When I inspect the HTML element, it becomes even more weird. The local pickup radio button has an attribute checked = “checked”, while the other has not.
In short, the actual shipping method is not visually checked, while the not select method is visually checked.
I have tried to rearrange the order of shipping methods in the settings of Woocommerce, but that did not change anything.
When I proceed to the checkout page, the local pickup method is checked again.
It seems to me this is not caused in the back-end (PHP), but is the result of javascript (and/or the browser).
I know there is little chance that a customer will actually experience this behaviour. After some testing, I’m only able to replicate this behaviour when logged in. On top of that I have only tested Firefox, Chrome and Edge yet. In Edge and Chrome it seems to be working fine. So this will even further reduce the chance, but I’d rather get rid of this flaw.
I’m wondering if anybody else has experienced this behaviour.
]]>My objective is to remove Lazy Load because it is preventing the blocking of all cookies using Cookiebot in the auto-blocking setting. If I unchecked Lazy Load in general settings as seen in the 1st image should I also uncheck under user experience? And which check box should I uncheck one or both or leave it as is because I already unchecked Lazy Load under general settings? Please advise.
I disabled Lazy Load in Settings
https://latinamodelmagazine.com/wp-content/uploads/Screenshot-16.png
But here under User Experience, it looks like it has not been disabled.
https://latinamodelmagazine.com/wp-content/uploads/Screenshot-15.png
Thank you very much for the plugin, it is very good and useful.
]]>