Showing out of stock WooCommerce products with ‘out of stock’ hidden on the catalog

Is there a method to show out of stock WooCommerce products with a shortcode when you have out of stock items ‘hidden’ on the catalog?

The below snippet works nicely as a shortcode to show out of stock items (credit: BusinessBloomer) but only when the out of stock items are VISIBLE on the catalog setting is on. I want to hide out of stock on the archives/shop, but add them to some blog posts via shortcode.

add_shortcode( 'out_of_stock_products', 'bbloomer_out_of_stock_products_shortcode' );  function bbloomer_out_of_stock_products_shortcode() {     $  args = array(       'post_type' => 'product',       'posts_per_page' => -1,       'post_status' => 'publish',       'meta_query' => array(          array(             'key' => '_stock_status',             'value' => 'outofstock',          )       ),       'fields' => 'ids',    );     $  product_ids = get_posts( $  args );     $  product_ids = implode( ",", $  product_ids );     return do_shortcode("[products ids='$  product_ids']");  }

Can’t seem to figure this out. Please help.

Hello everyone,,
I started a campaign with a new account to do Call Only Ads. Created a campaign with one ad group and a lot of keywords exact match that had pretty good traffic and showed up to good metrics on keyword planner overview. Created some decent ads too.

I ran it for a day, my ads aren't showing. No impressions. When I hover over my keywords, it shows "An ad isn't showing now", says my Ad Rank is low for all keywords.

Called support, they asked me to raise my bids and budget.

I…

Can't seem to figure this out. Please help.

Exception calling “ExecuteQuery” with “0” argument(s): “The operation has timed out.”

I am trying to delete list items, about 130K, from a large list on SharePoint Online using powershell CSOM, i am getting this error

“Exception calling “ExecuteQuery” with “0” argument(s): “The operation has timed out.””

this is my code

    for ($  i=$  allItems.Count-1; $  i-ge0; $  i--)       {           $  allItems[$  i].DeleteObject()         #$  clientContext.ExecuteQuery()        }        $  clientContext.ExecuteQuery()  

When i use the ExecuteQuery() outside the loop, i am getting this error. but it still deletes around 1K items each time i run the script.

But When i use the ExecuteQuery() inside the loop, it doesn’t throw the error and the script completes execution, BUT it takes about 20 times the time taken to delete items when ExecuteQuery() used outside the loop

i also used RequestTimeout property

$ clientContext.RequestTimeout = [System.Threading.Timeout]::Infinite ( or any value)

it doesn’t seem to honor this property.

Could anyone please help me suggest a better way to delete such a large list ( the list is still being used, i can’t delete the list)?

Thanks so much Maria Francis

How to find the “odd one out” in a list of numbers

I have an array of numbers [x1, x2, x3, etc] that is size is over 20 elements and I’m trying to put together an algorithm to sort the elements based on the “oddness” they have relative to the rest of the list.

I’m defining the “oddness” as the distance from the barycenters, given some threshold T1. The barycenters are where the values tend to concentrate, possibly given some second threshold T2.

Example: [20, 20, 21, 31, 24, 20, 70, 21, 31, 24, 20, 20, 21, 31, 24, 20, 20, 21, 31, 24] and T1=10 The barycenter is about 24 and only odd one out is 70

This case is trivial as the familiar “distance from the mean or median” metric will do eg. d(70)=|24-70|=46>10=T1 and d(31)=|24-31|=7<10=T1

I can’t quite figure out how to deal with the more general case of having 2 or more barycenters.

Example 2: [20, 20, 21, 31, 24, 20, 70, 21, 31, 24, 120, 120, 121, 131, 124, 120, 120, 121, 131, 124] Now there are two barycenters d1=24 and d2=124 and the only odd one is still 70

But the previous metric breaks apart. Maybe the hard part is to figure out which are the barycenters.

Note: I’m looking for a fast algorithm rather than an accurate one

Not Rooted Huawei Device, Android 4.4.4, Locked Out. USB debugging not enabled

Thanks for your time. I have a huawei phone which isn’t rooted and USB debugging isn’t enabled. Furthermore, I am locked out. Please suggest any remedy. I have searched out the whole internet but there isn’t any solution, as far as I know. And if there is No possibility please suggest me how to access my data by any mean. Even if it’s post hard-reset recovery. Please Help! Thanks!

SharePoint 2013 Designer workflow – Second identical REST call returns XML and thus errors out. Why is this?

I have a workflow defined on the Workflow Tasks list and I have a simple REST call to that same list and then I repeat the exact same REST call to that list and the first one works like a charm, the second one does not. It Hangs and the error seems to imply the results are coming back via XML and not JSON. Though the Dictionary, I’ve defined have the following structure,

Accept String application/json;odata=verbose

Content-Type String application/json;odata=verbose

My original code actually had the second REST Call to a different List, but to debug, simplify, I used an exact copy. I even put it into a different Stage to see if that made a difference. I even used the exact same variables for the Call and tried using completely different variables.

What is going on here? Why is the second call which now is exactly coded as the first call returning as XML. The message I get while it is hung up is:

RequestorId: 65d32ce8-525e-74ba-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.IO.InvalidDataException: Unable to deserialize HTTP response content. Expected ContentType : ‘application/json’, ‘text/plain’ or ‘text/html’, Received ContentType : ‘application/atom+xml’. Content (truncated) : ‘fd1431e7-4227-46b2-afcf-2f025ef99f7a2019-05-21T16:07:30Z’. ResponseStatusCode : ‘OK’ Request Uri : ‘https://xxx/hc/teams/MES//_api/lists/GetByTitle(‘Workflow Tasks’)/Items?$ select=Title&$ filter=(Project_x0020_ID eq ‘Sample1 23’) and (TaskUID eq ‘0’) and (PercentComplete ne 1)’ at Microsoft.Activities.Messaging.SendHttpRequest.OnReceiveResponse(NativeActivityContext context, Bookmark bookmark, Object value) at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Thank you