magento2 – Change the address list to drop-down at checkout

I have this code Magento_NegotiableQuote/web/js/view/shipping-address/list.js


), function (
     ) {
    'use strict';

    var defaultRendererTemplate = {
        parent: '${ $.$data.parentName }',
        name: '${ $.$ }',
        component: 'Magento_NegotiableQuote/js/view/shipping-address/address-renderer/default'
    popUp = null,

    newShippingAddressOption = {
        getAddressInline: function () {
            return $t('New Address');
        customerAddressId: null

    shippingAddressOptions = addressList().filter(function (address) {
        return address.getType() == 'customer-address';


    return ListView.extend({
        defaults: {
            template: 'Magento_NegotiableQuote/shipping-address/list'

        shippingAddressOptions: shippingAddressOptions,
        /** @inheritdoc */
        initChildren: function () {
            if (!checkoutConfig.isAddressInAddressBook && checkoutConfig.quoteShippingAddress) {
                addressList.push(new AddressModel(checkoutConfig.quoteShippingAddress));
                this.visible = true;
            _.each(addressList(), this.createRendererComponent, this);
            return this;
        initialize: function () {
            var self = this;
                selectedShippingAddress: null,
                isShippingAddressFormVisible: !customer.isLoggedIn() || shippingAddressOptions.length == 1
            return this;

         * @param {Object} address
         * @return {*}
        shippingAddressOptionsText: function (address) {
            return address.getAddressInline();

         * @param {Object} address
        onShippingAddressChange: function (address) {
            this.isShippingAddressFormVisible(address == newShippingAddressOption); //eslint-disable-line eqeqeq
         * Create new component that will render given address in the address list.
         * @param {Object} address
         * @param {*} index
        createRendererComponent: function (address, index) {
            var rendererTemplate, templateData, rendererComponent;

            if (index in this.rendererComponents) {
            } else {
                // rendererTemplates are provided via layout
                rendererTemplate = address.getType() !== undefined &&
                this.rendererTemplates(address.getType()) !== undefined ?
                    utils.extend({}, defaultRendererTemplate, this.rendererTemplates(address.getType()))
                    : defaultRendererTemplate;
                templateData = {
                    name: index
                rendererComponent = utils.template(rendererTemplate, templateData);
                utils.extend(rendererComponent, {
                    address: ko.observable(address)
                rendererComponent = utils.template(rendererTemplate, templateData);
                utils.extend(rendererComponent, {
                    address: ko.observable(address)
                this.rendererComponents(index) = rendererComponent;

        updateShippingAddress: function () {
            if (this.selectedShippingAddress() && this.selectedShippingAddress() != newAddressOption) {
                //  this.isShippingMethodFormVisible(true);
            } else {
                this.source.set('params.invalid', false);

                if (!this.source.get('params.invalid')) {
                    var addressData = this.source.get('shippingAddress');
                    // if user clicked the checkbox, its value is true or false. Need to convert.
                    addressData.save_in_address_book = this.saveInAddressBook ? 1 : 0;

                    // New address must be selected as a shipping address
                    var newShippingAddress = createShippingAddress(addressData);
         * Added Select2 to dropdown
                theme: "classic"


Two questions here, why am I getting a mistake that says that
list.js:82 Uncaught TypeError: customer.isLoggedIn is not a function When I have already declared customer model, and how can I have that? selectedShippingAddress Added value to the option value? Many thanks for the help. I have problems with the Magento 2 checkout in recent weeks.

sharepoint online – Invoke a specific URL based on drop-down and check box selections

I have this code, which switches to this URL when users select a specific value. But I only have the HTML part.

For example:

Urgency = high ||
Impact = Location / Department ||
Platform = Unix & Windows

If you click Submit, they will be redirected to a URL based on those selections

It's like High + Site / Dept + Unix & Windows = URL1 …. and so on.

I only have the HTML codes that I found during my research, but I'm not that good at Javascript, so I do not seem to find the logic of how this works.

I also use the Sharepoint Web Part Content Editor

I can not add the code here, so I just put it on the link below

Link for the code

Example conditions:

I hope the following conditions answer your question. But it's a lot, so I gave a few examples

Urgency & impact = show all; Platform = All checked => Homepage

Urgency = high & impact = show all; Platform = All marked => URL1

Urgency = Low & Impact = Show All; Platform = All marked => URL2

Urgency = Show All & Impact = Location / Department; Platform = All marked => URL3

Urgency = Show All & Impact = Multiple Users; Platform = All marked => URL4

Urgency & impact = show all; Platform = Unix & Windows => URL5

Javascript – Dynamic SharePoint master page navigation, but scope problem for navigation dropdown

I have a scope issue and I do not know why. I dynamically create a navigation with dropdown. It is created, but the drop-down menu is not rendered even though the caret is displayed. I think it is a matter of scope. I use the REST API to get data from my list, but I can not populate the global variable. Any help would be appreciated.

                var subList=(); //global scope

                function getInfo(){
              headers: headers,
              success: function success(data) {
              var results;
                if(lName == "Navigation"){
                }else {
                    subList = data.d.results;
                    console.log(subList); //<-------CONTAINS data


                            function buildSubNavBar(subNavID){
                    //More code missing

                var subList = getData("Sub Navigation");
                console.log(subList); //<-------CONTAINS no data

                for (var i=0; i

User – View Multiple Lists and Drop-Down Hierarchy on Page

I think the list of assigned users should come first. Before adding a new person to the list, a user must scan the list of currently assigned people. The two sections should also be more clearly separated, perhaps by a boundary in between, to signify two different tasks.

The term "Available Users" is a bit vague. The user can guess for what. When adding a new user to the assigned list, it could simply be "add new to list" or something more direct and appropriate.

The Save and Cancel buttons can be moved up and pinned to be permanently visible.

If & # 39; context & # 39; is a required field, it must be marked with an asterisk or otherwise as a required field.

Not sure how the Close button in the top right corner helps. That could probably be eliminated.

It will also help increase the price of clickable links.

Taxonomy Term View with Expose Filter Drop-down list of term names

I have a taxonomy view and "not content".
In this view, I want an Expose filter for Term Name. But when I add a term name as a filter for the taxonomy, the text box, not the drop-down list, is displayed.

Can you get a drop-down filter for the term name as an Expose filter in Drupal 8 without using a relationship to the content?

Add a drop-down selection meta field to the custom post type – restAPI seems to be bothering

I have a custom post type, name it topic, It's from BBPress, but this is not a BBPress question.

I also have a post type lessontopic,

I've added a meta-box to BBPress so I can select an appropriate topic topic for the forum topic when I'm in the backend editor for BBPress topics post meta data,

I have done the following:

add_action( 'add_meta_boxes', 'ld_bbpress_display_ldtopic_selector');

function ld_bbpress_display_ldtopic_selector() {
    add_meta_box( 'ld_bbpress_ldtopic_selector', __( 'LearnDash bbPress Settings', 'learndash-bbpress' ), 'ld_bbpress_display_topic_selector_callback', 'topic', 'advanced', 'high' );

function ld_bbpress_display_topic_selector_callback() {
   My call back stuff

add_action( 'save_post_topic', 'ld_save_associated_ldtopic',10,1);
function ld_save_associated_ldtopic($topic_id){
    if ( ! wp_verify_nonce( $_POST('ld_bbpress_nonce_ldtopic'), 'ld_bbpress_meta_box_ldtopic' ) ) {
    my save stuff

Now everything looks fine in the backend. However, if I select a lesson topic from my meta-dropdown list and click "Update" and work through it in my debugger, the update will be executed in


This has to do with the fact that for a custom block that allowed me to select forum topics, I had to enable the display of BBPress topics in restAPI, and the backend editor mysteriously encountered the restAPI update endpoint. I have activated the restAPI over

add_filter( 'bbp_register_topic_post_type', 'enable_restAPI_bbpress_topics', 10,1);
function enable_restAPI_bbpress_topics ($args) {
    $args('show_in_rest') = true;
    $args('supports') = array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' );
    return $args;

But I do not understand, why just checking that a post type for restAPI is visible causes the wordpress backend editor to go into a completely different operating mode? I mean, we're talking about the backend. When I activate restAPI, I can see how headless CMS, etc. should facilitate this, but why does it change as radically as WordPress handles post-processing in the backend?

Somehow this leads to my save hook ld_save_associated_ldtopic not see that $_POST Array and therefore no nonce data.

Really strange. I feel like violating a rule and it bites me, but I'm not sure what to do to make my meta-box work that way.


Many thanks,

Drop-down list – Drop with two columns

That is hard to say. It seems like it might be a good creative solution, but here are some considerations:

It could work…
if There are only two categories in the drop-down list. More than two may affect the usage (multiple scroll areas).
if This pattern must be applied uniformly across locations and applications. In other words, if there are other drop-down lists that contain categories that are NOT formatted this way, introducing this pattern would lead to inconsistencies. That may or may not be a problem.

The best way to find this out is to test it with users. Ask them to choose a car and a motorcycle and see how they work. Offer two options – one vertical drop-down list and one with two side-by-side options that are individually scrolled. Make a note of how long it takes to complete a task and make note of verbal or nonverbal answers. Ask them to rate the task.

Another consideration concerns the printhead. Does it filter both columns at the same time? Is that intuitive? Is it technically feasible? Just something to think about.

Word – populates the drop-down list with values ​​from the table

Is it possible to use values ​​from a column in a table in a Word document to populate a drop-down list?

Example: In a table with the "Version" column, there are the following versions:

That's why I want to get these values ​​and put them in a series of drop-down lists. The table does not have a set number of rows, although I can always create a large number of rows first if necessary. The table is not on the same page as the drop-down lists.