shortcode_name = $name; $___->shortcode_title = ucfirst(str_replace('_', ' ', $name)); $___->shortcode_icon = 'text'; $___->options = [ // 'post_parent' => [ // 'type' => 'textfield', // 'heading' => 'Parent Id', // ], ]; $___->shortcode_callback = function ($atts, $content = null) use ($name) { extract(shortcode_atts(array( 'class' => '', 'visibility' => '', // 'post_parent' => get_the_ID(), ), $atts)); $classes = [$name]; if (!empty($class)) $classes[] = $class; if (!empty($visibility)) $classes[] = $visibility; ob_start(); echo "
"; print_r($min_price); echo ""; // echo "
"; print_r($max_price); echo ""; // echo "
"; print_r($options); echo ""; // die; $page_shop_id = wc_get_page_id('shop'); $link = get_permalink($page_shop_id); if (!empty($options)) { // Lấy giá trị từ URL $get_min = isset($_GET['min_price']) ? (int)$_GET['min_price'] : null; $get_max = isset($_GET['max_price']) ? (int)$_GET['max_price'] : null; $selected_html = ''; $selected_html .= ''; $hidden_fields = adminz_wc_query_string_form_fields(null, ['paged'], '', true); echo <<
"; print_r($___); echo ""; die; $___->general_element(); } // $('.d2c_prices select').off('change.d2c_prices_search').on('change.d2c_prices_search', function (e) { // e.preventDefault(); // var $select = $(this); // var $form = $select.closest('form'); // var selectedOption = $select.find('option:selected'); // // Lấy giá trị từ thuộc tính // var minPriceVal = selectedOption.attr('min_price') || ''; // var maxPriceVal = selectedOption.attr('max_price') || ''; // // Xóa các input cũ nếu tồn tại // $form.find('input[name="min_price"]').remove(); // $form.find('input[name="max_price"]').remove(); // // Cập nhật giá trị cho input // if(minPriceVal){ // $form.append($('', { // type: 'hidden', // name: 'min_price', // value: minPriceVal // })); // } // if(maxPriceVal){ // $form.append($('', { // type: 'hidden', // name: 'max_price', // value: maxPriceVal // })); // } // return; // });