List just subcategory and products of active category page in Woocommerce

Working on a category page – taxonomy-product_cat.php – I want to list all the subcategories of that category page, with all its products. I would think it is simple enough but I cant get it to work.

I can list all categories of the shop with all subcategories and all products – So for example bags would list all products of the whole shop.

Or I can list the subcategories of just the category page – but without the products listed.

How can I list just the subcategories of the category page with their products?

The code I am using that works great, but loops all the categories in the shop, and not just the active category is:

$  args = array('taxonomy' => 'product_cat' ); $  all_categories = get_categories( $  args );  foreach ($  all_categories as $  cat) {     $  category_id = $  cat->term_id;     $  args2 = array('taxonomy' => $  taxonomy,'parent' => $  category_id,'hierarchical' => $  hierarchical, 'orderby' => $  orderby, 'order' => $  order,'hide_empty' => $  empty); $  categories = get_categories( $  args2 );   $  sub_cats = get_categories( $  args2 );             if($  sub_cats) {                 foreach($  sub_cats as $  sub_category) {                     echo "<h2>".$  sub_category->cat_name."</h2>";                      $  args = array( 'post_type' => 'product','product_cat' => $  sub_category->slug, 'orderby' => $  orderby, 'order' => $  order);                             $  loop = new WP_Query( $  args );                                while ( $  loop->have_posts() ) : $  loop->the_post(); global $  product; ?>                               <!--HTML HERE-->                               <?php endwhile;  wp_reset_query();  }}} ?> 

Does a Pact of the Blade Warlock have their weapon proficiency list increased while their Pact weapon is active?

According to the Warlock class, the Pact of the Blade Boon allows a Warlock to

use your action to create a pact weapon in your empty hand. You can choose the form that this melee weapon takes each time you create it. You are proficient with it while you wield it.

Ordinarily, this would be very simple and straight forward. However, two weapon fighting makes thing interesting. The Players Handbook says

When you take the Attack action and attack with a light melee weapon that you’re holding in one hand, you can use a bonus action to attack with a different light melee weapon that you’re holding in the other hand.

With the goal of using the two weapon fighting rule above, let’s use a short sword as an example. Short swords are martial melee weapons with the light and finesse properties. As such, they can be used for two weapon fighting and Warlocks are not proficient with them.

Now, perhaps I’m over-complicating things a bit…but it seems to me that there are two ways of reading that last sentence in the Pact of the Blade quote from above.

It could mean that because the Warlock has created a short sword as their Pact weapon, that they are proficient with all short swords while they have their Pact weapon in hand. This would, in effect, temporarily add short swords to their weapon proficiency list and allow the Warlock to make a proficient short sword bonus action attack from two weapon fighting.

OR

It could mean that the warlock ONLY has proficiency with their Pact weapon, and if they wanted to make a proficient bonus action attack, they’d have to use a simple weapon in their off-hand.

So, does a Pact of the Blade Warlock have their weapon proficiency list increased while their Pact weapon is active?

How do you choose active effects when two instances of the same spell/feature overlap?

There are two slightly different rules when it comes to overlapping game features, one from the PHB (post-errata) and one from the DMG (post-errata):

PHB:

The effects of different spells add together while the durations of those spells overlap. The effects of the same spell cast multiple times don’t combine, however. Instead, the most potent effect – such as the highest bonus – from those castings applies while their durations overlap, or the most recent effect applies if the castings are equally potent and their durations overlap.

DMG:

Different game features can affect a target at the same time. But when two or more game features have the same name, only the effects of one of them—the most potent one—apply while the durations of the effects overlap.

The current answer to my question “Do the Stone Golem's Slow feature and the Slow spell combine?” states the following:

[…] Backed by the PHB’s mention of effect-based potency, I compare each individual effect two features of the same name have and then pick the strongest for each. That also constitutes that the unique parts of one feature are compared against “nothing”, meaning by virtue of existing they’d trump the lack of any counterpart in their twin […]

And goes on to apply this method to blindness/deafness allowing both effects to persist simultaneously in direct contrast to the current answer to the following: “If you cast Blindness/Deafness on the same creature twice, what conditions are applied?”

Which method of comparing two features is correct:

  1. One feature/spell is determined to be “more potent” and all effects of the other feature/spell are ignored.

  2. The effects are compared one-by-one, thus different parts of each feature/spell can be active at once.

Active or Disabled action button in a mobile form?

I have a “change password” screen where the user’s password has expired and he/she has to change it. it’s a standard screen with “New password” and “Re-type new password” fields, with an inline validation that checks whether the password guidelines are met (while the user is typing): 8 characters, 1 digit, 1 number, 1 special character.

we have an argument whether the main “change password” action button should be disabled until all the validations are clear, or to keep it active and provide an error message if needed.

what do you think is better?

ECMA script for checking active workflows for an list item

Hi i am having more than 1 workflow associated with the list if there is any workflow that is active for an item then i need to prevent starting another workflow for the same item. I am using the following code to achieve the same. Can anyone please provide me the ECMA client script object model equivalent for achieving the same.

//Check for any active workflows for the document     private void CheckForActiveWorkflows()     {         // Parameters 'List' and 'ID' will be null for site workflows.         if (!String.IsNullOrEmpty(Request.Params["List"]) && !String.IsNullOrEmpty(Request.Params["ID"]))         {             this.workflowList = this.Web.Lists[new Guid(Request.Params["List"])];             this.workflowListItem = this.workflowList.GetItemById(Convert.ToInt32(Request.Params["ID"]));          }         SPWorkflowManager manager = this.Site.WorkflowManager;         SPWorkflowCollection workflowCollection = manager.GetItemActiveWorkflows(this.workflowListItem);         if (workflowCollection.Count > 0)             SPUtility.TransferToErrorPage("An workflow is already running for the document. Kindly complete it before starting a new workflow");     } 

Get data from Active Directory when a field in custom list is changed in SharePoint 2013

I’m having a list with the following columns that have relation in the Active Directory: employee name, employee charge, department, extension number, employee’s boss, and other text columns.

I’m trying to do 2 different things:

  1. Get in the employee’s name column a list of employee from the Active Directoy, and with that selected employee name, automatically fill the fields charge, department, extension number, employee’s boss, with the data registered in the Active Directory.

Or

  1. Fill the column fields charge, department, extension number, employee’s boss using the “Created by” column, getting the information from the Active Directory of the user who is creating the ítem.

Thanks

Exploiting Weak Permissions on OU in Active Directory?

I created an environment, where I allowed a user named demop with these four permissions

CreateChild
ListChildren
ReadProperty
GenericWrite

on an OU named VulnerableOU? And, I have Meterpreter access to the user’s PC, so how can I exploit this behavior? Or in other words how this can be exploitable in real scenarios?

By these permissions it looks like we can create an object inside an OU but How? What tool should I use or maybe what PowerShell cmdlet should I use?