magento2.3 – Magento2 Grid: Select all disabled with two dropdown filters

A client running a magento 2.3.2. store noted that he can not use the Select All when two Filters are enabled. This pertains to the Magento Grid with orders on the Sales page. The filters the client is using are Status & Storeview.

I tested this behavior and can confirm that when he uses 2 Dropdown filters, the Select All functionality gets disabled. The disabling works through adding a ‘disabled’ attribute to both the input & button element. Other combinations of filters do not seem to have this behavior. When I manually remove the attributes (devtools) the functionality seems to work properly.

My questions.

  1. Is there a good reason why the ‘Select All’ gets disabled on selecting 2 dropdown filters? The disabling seems intentional, so I figure it is not a bug?

  2. If there is no reason, I might want to adjust this behavior. Could you point me in the right direction to where this behavior is set?

I appreciate any helpful input.

woocommerce – Using custom post type to feed a dropdown (Woo order-id into wpforms)

Using the plugin wpForms, I can auto-populate a dropdown with Custom Post Types (they call it “Dynamic Post Type Source”). Say I wanted to use this functionality to auto-populate a dropdown with order-ids from WooCommerce, so a logged-in-user can choose between the users orders.

I’ve written the code for getting a logged-in-user order-id’s, so how would I make a CPT that would not really create new posts, but instead be populated with a logged-in-users order-ids at run time (while the user is at a page with the form dropdown on it)?

Already asked wpForms for support, they did not want to help.

Code for getting the User Order-ids:

function woo_get_orderids_per_user( $content) {

$userID = get_current_user_id();

if( $userID > 0 ) {

        $orders= wc_get_orders(array(
            'customer_id' => $userID,
            'return' => 'ids',
        )); 

        foreach ($orders as $oids) {

            $order = wc_get_order( $oids );
            $items = $order->get_items();

            foreach ( $items as $item ) {
                $product = wc_get_product( $item('product_id') );
                $productname = $product->get_name();
                echo('<br> Product name: ');
                print_r($productname . ' (ordrenummer: ' . $oids . ')');
            }
        }

$content = str_replace( '{woo_orderid}', $productname . ' (Ordre ID: ' . $oids . ')', $content );

return $content;
}

else {
    return;
}

}

html – meu dropdown bootstrap não está abrindo, alguem sabe o erro?

Pagina com bootstrap

 <nav class="navbar navbar-expand-lg navbar-light" aria-haspopup="true" aria-expanded="false">
     <a class="navbar-brand" href="#">
         <img src="https://pt.stackoverflow.com/img/Pictures-icon.png" width="70px">
    </a>

    <div class="collapse navbar-collapse">
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" href="#conheça-nos">conheça-nos</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#atendimento">atendimento</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">parceiros</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  Dropdown
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                  <a class="dropdown-item" href="#">Ação</a>
                  <a class="dropdown-item" href="#">Outra ação</a>
                  <div class="dropdown-divider"></div>
                  <a class="dropdown-item" href="#">Algo mais aqui</a>
                </div>
              </li>
              <li class="nav-item">
                <a class="nav-link disabled" href="#">Desativado</a>
              </li>
        </ul>
    </div> 
 </nav>

javascript – Custom react dropdown

Last night I had to build dropdown for the menu on the website that I’m working on. As I’m still React newbie I first looked if there is some package for what I’m trying to achieve but there wasn’t, so I had to try to build it on my own.

So the menu has its menu items, whichever is hovered it should show its content and so on. The one thing I’m concered about is that I used too much code for the dropdown and I’m sure this can be built with less code. So I only want you to tell me what should be changed in a code and which approach isn’t good from my side.

Object:

const options = (
  {
    index: '1',
    label: 'Title 1',
    links: (
      'demo link',
      'demo link',
      'demo link',
      'demo link',
    ),
    image: 'imageURL',
  },
  {
    index: '2',
    label: 'Title 2',
    links: (
      'demo link',
      'demo link',
      'demo link',
      'demo link',
    ),
    image: 'imageURL',
  },
  {
    index: '3',
    label: 'Title 3',
    image: 'imageURL',
  },
);

Code:

import React, { Component } from 'react';
import classNames from 'classnames';
import css from './demo.css';

const list = options => {
  return options.map(option => ({
    index: option.index,
    label: option.label,
    links: option.links,
  }));
};

class SecondaryNav extends Component {
  constructor(props) {
    super(props);
    this.onMouseEnter = this.onMouseEnter.bind(this);
    this.onMouseLeave = this.onMouseLeave.bind(this);

    this.state = {
      hideDropdown: true,
      dropdownIndex: null,
      activeLabel: null,
      columns: null,
    };
  }

  onMouseEnter(index, label, links) {
    if (links != null) {
      this.setState({
        hideDropdown: false,
        dropdownIndex: index,
        activeLabel: label,
        columns: links.length,
      });
    } else {
      this.setState({
        hideDropdown: true,
        dropdownIndex: null,
        activeLabel: null,
        columns: null,
      });
    }
  }

  onMouseLeave() {
    this.setState({
      hideDropdown: true,
      dropdownIndex: null,
      activeLabel: null,
      columns: null,
    });
  }

  render() {
    // Form object array and return navigation items
    const items = list(options);
    const navItems = items.map(item => {
      const index = item.index;
      const label = item.label;
      const links = item.links;
      const isActive = item.index === this.state.dropdownIndex ? css.active : null;
      return (
        <li
          className={isActive}
          onMouseOver={() => this.onMouseEnter(index, label, links)}
          key={item.index}
        >
          {item.label}
        </li>
      );
    });

    // Form array of navigation items that have links
    const selected = options
      .filter(option => option.index === this.state.dropdownIndex)
      .map(selected => selected.links);
    const dropdownLinks = selected(0);

    // Define active content in dropdown
    const activeContent =
      this.state.dropdownIndex != null &&
      dropdownLinks.map((label, key) => <li key={key}>{label}</li>);

    // Define list label for the first dropdown
    const listLabel =
      this.state.dropdownIndex === '1' ? classNames(css.dropdown, css.listLabel) : css.dropdown;

    // Put content in two rows
    const columns = this.state.columns >= 8 ? css.twoColumns : null;

    // Define dropdown image
    const dropdownImage = options
      .filter(image => image.index === this.state.dropdownIndex)
      .map((single, key) => {
        return <img src={single.image} key={key} alt={this.state.activeLabel} />;
      });

    // Form dropdown container
    const dropdown = !this.state.hideDropdown ? (
      <div className={css.dropdownContainer}>
        <h2 className={css.dropdownLabel}>{this.state.activeLabel}</h2>
        <div className={css.dropdownContent}>
          <ul className={classNames(listLabel, columns)}>{activeContent}</ul>
          <div className={css.dropdownImage}>{dropdownImage}</div>
        </div>
      </div>
    ) : null;

    return (
      <div className={css.secondaryNav} onMouseLeave={this.onMouseLeave}>
        <div className={css.navContainer}>
          <ul className={css.secondNav}>{navItems}</ul>
        </div>
        {dropdown}
      </div>
    );
  }
}

export default SecondaryNav;

So everything works as I wanted and as I said I’m just concered that I haven’t used good aproaches as I’m still a newbie. So any suggestion will mean a lot.

How can I transfer data from Google Sheets to the Google Forms drop-down list?

Thanks for the spell check. Unfortunately, this is a direct copy and paste of the developer.google.com codes. You will probably have to correct your website.

Yes, it's possible

This can be done via the Google app script .setChoiceValues(values)

The full script can be found here https://developers.google.com/apps-script/reference/forms/list-item#setchoicevaluesvalues

Sample code:

var item = form.addListItem();
item.setTitle('Do you prefer cats or dogs?')
    .setChoices((
        item.createChoice('Cats'),
        item.createChoice('Dogs')

Instead of entering the actual choices as in the code example above (cats) in this parenthesized part of the script, instead use a range of cells and columns (4,3) that points to the data area on the sheet in which your dynamic dropdown is located – Choices are located As shown here, this code points to an active sheet. However, you can change the code to get ranges of cells by referring to the Sheet ID> instead

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()(0);

var range = sheet.getRange("B2:D4");

// The row and column here are relative to the range
// getCell(1,1) in this code returns the cell at B2, B2
var cell = range.getCell(1, 1);
Logger.log(cell.getValue());

You can choose which drop-down list items to choose by referencing the range of Google Sheet cells to which the form is linked, or another sheet by referring to the Google Sheet ID and sheet name where yours are located Dropdown selection. You can get the sheet ID by looking at the web link of your Google sheet in your browser. It's the long string and number, or how to get the leaf ID from the code> https://developers.google.com/apps-script/reference/. Spreadsheet / Spreadsheet # getid

Done once. To update the form automatically, use leaf or form triggers to call this update list script so that the form is updated with new options after reloading.

I recently did something similar – automatically filling out and automatically updating a Google form with data values ​​from the Google sheet after a response has been sent. Here is the working live example form: https://support.google.com/docs/thread/ 48344518? Hl = en

magento2 – How to prevent dropdown menu from closing when moving between top level items?

We’re using a dropdown menu modified from snowdog and magento, and our top level items have 6 options. It’s a pretty standard menu; when hovering over the top level items it drops down and shows the subnav items. However, when moving in between the main items, the menu briefly closes before reopening with the options for the next item. My initial thought was to write some javascript to detect when the menu is already open, and if so, prevent the event from bubbling up the DOM, but I have a feeling the answer is probably more simple than this solution. Maybe using a transition delay to make the hovering more forgiving?

If I were to try adding a transition delay, would this be done in our navigation.less file? I inherited this code base and things are a little messy, so I’m not positive how to start going about this.

How to dynamically populate a dropdown

I am tasked with creating a subnav in the body of our custom-built pages. The nav’s last item is supposed to be a clickable dropdown (a “more” button) that can dynamically populate if extra pages are added via the dashboard. I’m trying to figure out how to code this in PHP and JS without a plug-in. Any sort of point in the right direction is greatly appreciated!

drop down list – Automatically opening the dropdown for guiding users

We have a page that lets our users analyze their data. In order to analyze the data, they need to select the data-set via a dropdown first and without selecting the data-set, the page is almost useless. Here is how it looks like:

empty page

We’re planning to open the dropdown automatically when the user opens the page, here is how it will look like if we implement it:

enter image description here

The idea is that we open the dropdown automatically on behalf of the user in order to be able to guide them in a better way. Otherwise, 30% of the users leave this page without selecting the model. On the other hand, dropdowns are usually user-controlled components so we’re not sure if it’s a good practice.