• Resolved cyriljohnston

    (@cyriljohnston)


    Since custom fields can’t be used in URLs for a direct link to a filter, I’ve been trying to make a page using the product-catalogue shortcode, however when I try the following shortcode in a new Page:

    [product-catalogue id='2' excluded_layouts='List,Detail' custom_fields='3=>Hitachi']
    I'm just being given a totally blank catalogue with a search bar on the left but no categories, fields, products, etc. Although I'm still being given the options to view the List and Detail layouts.
    
    By contrast, the working shortcode for the full catalogue is:

    [product-catalogue id=’2′ excluded_layouts=’List,Detail’]

    Thanks for any help you can offer! ??

    https://www.ads-software.com/plugins/ultimate-product-catalogue/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Cyril,

    You cannot include it in the shortcode like this as it is not an accepted attribute for the [product-catalogue] shortcode. Also, there is indeed no built-in option to accomplish this. That being said, it should technically be possible if you use a json encoded array in the URL. But implementing something like that would be beyond the scope of our support.

    Thread Starter cyriljohnston

    (@cyriljohnston)

    Thanks for the response!

    Was this feature of the shortcode removed?
    In this thread from a couple of months ago you mention the custom_fields attribute for the product-catalogue shortcode: https://www.ads-software.com/support/topic/display-products-using-custom-fields-in-shortcode?replies=5

    Plugin Author Rustaurius

    (@rustaurius)

    Hi cyril,

    That attribute still exists, it’s just something that isn’t used much.

    You’re sure that there’s a custom field with ID 3 and products in the catalog that have the value “Hitachi” for that field? The display you’re describing is pretty much what you’d expect if nothing was matched by that attribute.

    Thread Starter cyriljohnston

    (@cyriljohnston)

    Hi,

    I’ve attached screenshots from the products custom field page for the custom field with ID3 and also for that field’s place in one of the products. I’ve checked for blank space characters before and after the word “Hitachi” and can’t find any.

    https://i.imgur.com/Jomt5xf.png

    View post on imgur.com

    Plugin Author Rustaurius

    (@rustaurius)

    Hi Cyril,

    It looks like there’s been a change in the way attributes are extracted from WordPress shortcodes. We’ve put out an update to comply, so in V3.7.8 the attribute should now be:

    custom_fields='3=Hitachi'

    Thread Starter cyriljohnston

    (@cyriljohnston)

    Fantastic! That’s sorted it out, thank you very much!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom field shortcode issues’ is closed to new replies.