Home Forums WoodMart support forum WoodMart’s Ajax Search Results from a Custom Field

WoodMart’s Ajax Search Results from a Custom Field

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #667933

    BrandaLAB
    Participant

    Hello,

    our client wanted to have 2 product SKU’s because they had an old ERP and a new one. They have a lot of customers using their old Product Catalogues and those catalogues have printed on the old product codes. So, using the snippet below we’ve managed to create a secondary SKU:

    // Add secondary SKU field
    add_action('woocommerce_product_options_sku', 'add_secondary_sku_field');
    function add_secondary_sku_field() {
        woocommerce_wp_text_input(array(
            'id' => 'secondary_sku',
            'label' => __('Κωδικός Entersoft', 'woocommerce'),
            'desc_tip' => true,
            'description' => __('Enter the secondary SKU code.', 'woocommerce'),
        ));
    }
    
    // Save the secondary SKU
    add_action('woocommerce_process_product_meta', 'save_secondary_sku_field');
    function save_secondary_sku_field($post_id) {
        $secondary_sku = isset($_POST['secondary_sku']) ? sanitize_text_field($_POST['secondary_sku']) : '';
        update_post_meta($post_id, 'secondary_sku', $secondary_sku);
    }

    How can we make the ajax search bar to also include that custom field within the search results?

    Thank you once again, you are amazing!

    #667953

    Hello,

    Such modification requires complicated code customization which is not covered by our support. Our support doesn’t cover any issues caused by changes in the theme code.

    Best Regards,

    #667982

    BrandaLAB
    Participant

    I understand, thank you very much!

    #668082

    Hello,

    You’re very welcome! If you need anything else, feel free to reach out!

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards,

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘WoodMart’s Ajax Search Results from a Custom Field’ is closed to new replies.