[wcj_currency_select_drop_down_list] issue and fix
-
Upgraded from 7.2.3 to 7.5.0 (latest available at booster.io) and the currency switcher shortcode
[wcj_currency_select_drop_down_list]stopped working.The reason is in the form element being stripped from the
submit()code.This is the code in 7.2.3:
<div class="sw-currency">
<span class="sw-label">Preferred Currency</span><br>
<select name="wcj-currency" id="wcj-currency-select" style="" class="" onchange="this.form.submit()">
<option value="EUR">€ : Euro</option>
<option value="USD" selected="selected">$ : US dollar</option>
<option value="GBP">? : Pound sterling</option>
<option value="AUD">A$ : Australian dollar</option>
<option value="CAD">C$ : Canadian dollar</option>
</select>
<input type="hidden" id="wcj-currency-nonce" name="wcj-currency-nonce" value="b9a9e3f79d">
<input type="hidden" name="_wp_http_referer" value="/checkout/">
</div>This is the code in 7.5.0:
<div class="sw-currency">
<span class="sw-label">Preferred Currency</span><br>
<select name="wcj-currency" id="wcj-currency-select" class="">
<option value="EUR">€ : Euro</option>
<option value="USD">$ : US dollar</option>
<option value="GBP" selected="selected">? : Pound sterling</option>
<option value="AUD">A$ : Australian dollar</option>
<option value="CAD">C$ : Canadian dollar</option>
</select>
<input type="hidden" id="wcj-currency-nonce" name="wcj-currency-nonce" value="b9a9e3f79d">
<input type="hidden" name="_wp_http_referer" value="/checkout/">
</div>Note how the
wcj-currency-selectline is being stripped fromonchange="this.form.submit()"The culprit I was able to locate is in
\booster-plus-for-woocommerce\includes\classes\class-wcj-shortcodes.phpline 405:$result = ( is_string( $result ) ? wp_kses_post( $result ) : $result );The
wp_kses_postfunction is being too strong here. Commenting out the line above and the issue gets fixed.
You must be logged in to reply to this topic.