Home>Support>Additional field in “Build posts query” question

Additional field in “Build posts query” question

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi,
I’m trying to build (rather) complex query to output posts (“product” CPT actually), using “additional” query field, but so far wasn’t able to do it. I have this piece of query args array:

"meta_query" => array( 
	"relation" => "AND",
	array( 
		"key" => "_stock_status", 
		"value"=> "instock", 
	), 
	array( 
		"key" => "_sale_price", 
		"value" => 0, 
		"compare" => ">=", 
	), 
)

to show only “in stock” and sale products. I tried to wrap it in another array(), but no luck …

Any advice on how to do it ?

Big thnx.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 4 months ago Alex S
    Hi, I Work Here

    Hi Micemade

    Unfortunately, the additional field doesn’t currently support arrays. I’m going log this as a feature request. Sorry mate. :()

  2. 8 years, 4 months ago micemade

    I was afraid that’s the case …
    Yeah, that should be a feature request, perhaps a select field before “Additional” field with options like: “Simple URL query” , “Array of arguments”, or conditional with is_array() in base/inc/post-selector.php siteorigin_widget_post_selector_process_query() func.

    Anyhow, thank you for reply.
    Best regards,
    Alen

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More