Skip to content

Instantly share code, notes, and snippets.

View acal's full-sized avatar

Adam acal

  • At large
  • Greystones, IR
View GitHub Profile
@acal
acal / handleCreateOrderError_Fix.js
Last active June 4, 2025 09:07
Update to Angelleye Checkout Error Handling
handleCreateOrderError: (error, errorLogId) => {
console.log('create_order_error', error, angelleyeOrder.lastApiResponse);
angelleyeOrder.hideProcessingSpinner();
jQuery(document.body).trigger('angelleye_paypal_onerror');
let errorMessage = '';
// 1. If error is an object with a data.messages array (eg. AJAX response)
if (error && error.data && Array.isArray(error.data.messages) && error.data.messages.length > 0) {
errorMessage = error.data.messages.map(msg => `<li>${msg}</li>`).join('');
}
@acal
acal / gist:5b48e0965ce059424e4d390ffedc398c
Created January 29, 2024 14:36
PMPro Pre-check gift recipient email option and reveal fields
<script>
// Pre-check gift recipient email option and reveal fields
jQuery(document).ready(function($) {
$('#pmprogl_send_recipient_email').prop('checked', true);
$('.pmprogl_checkout_field_div').removeAttr('style');
});
</script>