This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Show SKU in the results list

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Show SKU in the results list

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15357
    TarnTarn
    Participant

    Would you be able to tell me how to add custom fields into the results list. Specifically I am using this as a product search (WooCommerce) and I want to include the SKU in the results.

    Thanks!

    #15360
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    You are looking for the Advanced content field on the Advanced Options -> Content options panel: https://i.imgur.com/UOegjef.png
    This documentation part will clarify almost everything about it’s usage: Advanced title and Description fields

    Long story short, the product SKU is stored within the _sku custom field, and the advanced description field allows displaying custom fields content as well. In your case it would be something like this:

    [html]{descriptionfield}<p>{_sku}</p>[/html]

    ..or if you want the SKU text to be bold:

    [html]{descriptionfield}<p><strong>{_sku}</strong></p>[/html]

    .. if the SKU field is not set on every product, then using the conditional brackets will make sure that the paragraph is only displayed is the _sku is set:

    [html]{descriptionfield}[<p><strong>{_sku}</strong></p>][/html]

    I hope this helps!

    #15376
    TarnTarn
    Participant

    That worked – Thanks!

    #15379
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.