Add Dropdown with Quantity Products per Page to Shop Page (WooCommerce)

function g9_woo_selectbox() { $per_page = filter_input(INPUT_GET, ‘perpage’, FILTER_SANITIZE_NUMBER_INT); echo ‘ ‘; echo ‘‘; $orderby_options = array( ’12’ => ’12 Items’, ’24’ => ’24 Items’, ’48’ => ’48 Items’, ’96’ => ’96 Items’ ); $shop_page_url = get_permalink(wc_get_page_id(‘shop’)); foreach ($orderby_options as $value…Continue reading

Trigger Variation Image Change After Color Change (WooCommerce)

(function ($) { $(document).ready(function ($) { var variations = JSON.parse( jQuery(“.variations_form”).attr(“data-product_variations”) ); if (variations) { var nthAttributeToSwitchImage = 1; var attributeName = Object.keys( variations[nthAttributeToSwitchImage – 1].attributes )[0]; // jQuery(“[name=” + attributeName + “]”).change(function () { jQuery(“.woocommerce div.product form.cart .variations select”).change(…Continue reading

MemberPress: Generate All Invoices for the Specific Period (e.g. A Year)

function generate_bulk_invoices() { if(isset($_REQUEST[‘generate-invoices’])) { global $wpdb; $query = “SELECT id FROM {$wpdb->prefix}mepr_transactions WHERE created_at > ‘2025-01-01 00:00:00’ AND created_at < '2025-12-31 23:59:59' AND status IN ('complete', 'confirmed', 'refunded')"; $txn_ids = $wpdb->get_results($query); foreach($txn_ids as $txn_id) { $invoices = new MePdfInvoicesCtrl();…Continue reading

MemberPress: Add the Invoice Number to the Transactions Screen

add_filter(‘mepr-admin-transactions-cols’, function ($cols) { $cols[‘col_txn_invoice’] = __(‘Invoice No.’, ‘memberpress-pdf-invoice’); return $cols; }); add_action(‘mepr-admin-transactions-cell’, function ($column_name, $rec, $attributes) { if ($column_name === ‘col_txn_invoice’) { ?>Continue reading

MemberPress: Disable MemberPress Protection On Specific Page

add_filter(‘mepr-pre-run-rule-content’, ‘mepr_override_content_protection’, 11, 3); function mepr_override_content_protection($protect, $post, $uri) { // Unprotect posts with the specified page slug or ID if ( is_page( ‘your-page’ ) || is_page( 123 ) ) { $protect = false; // Disable protection for the specified page…Continue reading

MemberPress: Disable MemberPress Protection Based on Custom Post Type And Tag

add_filter(‘mepr-pre-run-rule-content’, ‘mepr_override_content_protection’, 11, 3); function mepr_override_content_protection($protect, $post, $uri) { // Unprotect posts that belong to a specific custom post type (mpcs-lesson), with the “free” tag if (‘mpcs-lesson’ === get_post_type($post->ID) && has_tag(‘free’, $post)) { $protect = false; // Disable protection for…Continue reading