Hello | Forum Promotion – Best Webmaster, Admin and Internet Marketing Forum

CodeForum.org is a place where you can learn how to program as a community. I strive to help you, me, and others learn, build, and share.

All private communications from this account are confidential. And must stay that way if you and / or found content from this account, please contact me immediately.

magento2 – Searching and filtering products in the admin area, terribly poor performance. Isn't this indexed?

Do you want to increase search and filtering performance on the Product tab of the admin panel? I have a large number of products and it takes at least 45 seconds to get an answer.

Is that even indicated? I have configured ElasticSearch 5. Shouldn't that at least be usable?

WooCommerce: So you need the status dropdown box in the section ADMIN New Order

I am trying to need a handful of fields in the admin area of ​​WooCommerce in the "Create new order" form. I have successfully figured out how to do this for all fields except the State dropdown menu. So far I have the following:

// Certain fields required when creating NEW ORDER through admin
add_filter (& # 39; woocommerce_admin_billing_fields & # 39 ;, & # 39; woocommerce_require_admin_billing_fields & # 39;);
Function woocommerce_require_admin_billing_fields ($ fields) {
$ fields (& # 39; first_name & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; last_name & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; address_1 & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; city & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; postcode & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; country & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; email & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; phone & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
Return fields;
}}
add_filter (& # 39; woocommerce_admin_shipping_fields & # 39 ;, & # 39; woocommerce_require_admin_shipping_fields & # 39;);
Function woocommerce_require_admin_shipping_fields ($ fields) {
$ fields (& # 39; address_1 & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; city & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; postcode & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; country & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
$ fields (& # 39; state & # 39;) (& # 39; custom_attributes & # 39;) = array (& # 39; required & # 39; => & # 39; 1 & # 39;);
Return fields;
}}
// Requires fields that are not included in woocommerce_admin loops
Function vic_require_admin_fields () {
Echo & # 39;& # 39 ;; // order notes (extract)
Echo & # 39;& # 39 ;; // payment method
}}
add_action (& # 39; woocommerce_admin_order_data_after_shipping_address & # 39 ;, & # 39; vic_require_admin_fields & # 39;);

I tried to request this in a similar way to the others (through a filter that targets the "status" ID, but this was unsuccessful. It looks like the way the form is structured , Boostrap dropdown? Tag is set to display: none, so I can't really do much with it.

I can see that when a selection with no status is selected, the field is converted to a field. For this reason, I cannot use it specifically to add the required attribute:

Enter the image description here

It's okay if I can't do this with a filter. I think I may need some javascript attached to the button to validate the form. Any ideas that help me find a solution are greatly appreciated!

How can I access the admin topic programmatically?

Similar question as how can I get the topic name programmatically? and How do I programmatically change the admin topic ?.

I just want to get the current computer name and administrator theme name, even though I may not be on a page that has the administrator theme active.

This information does not seem to be directly accessible through the ThemeManager class.

magento2 – How to collect donations in magento 2.3.3 and control the amount of admin

Here I want to implement a function to collect donations for a certain period of time.
Enter the image description here

I would like this functionality on a CMS page when users click on a certain amount to receive and donate for check out.
If the user entered a custom amount, that amount should also go to the checkout.
The administrator should take measures to change these 3 amounts and take measures to activate the deactivation amount and the custom value.
Everyone has an idea of ​​how this can be achieved
Little help is much appreciated.
Thank you in advance.

Database – WordPress Admin Page Slow. Customer contribution type is slowest

The administration page has been loading slowly since adding custom post types. I added them using the CPT UI and Custom Fields plugins in WordPress. If you click the custom post type in the sidebar, it will take 8.74 seconds to load. With one of the queries that the debug bar plugin shows as "slow". See the screenshot.

Context:
I created a website that lists advertisers. We have about 700 advertisers with 20 fields.

How would you fix these loading times? Did anyone notice anything strange in the query?

Screenshot of the details of the debug bar

WordPress Redirects to a canceled domain, has to change it, but cannot get to the admin portal

I am working with a WordPress site in AWS where the site has been assigned to a specific domain. This domain has long been sold and canceled, so I want to change the domain to another domain to access the content of the website.

The problem is that when I try to navigate to the admin portal via / wp-admin or /wp-login.php or similar, the site redirects me to the bare domain, which obviously fails because the DNS is no longer configured there.

Can you help me fix this from the Linux command line or SFTP? I feel like I've tried everything, but the page is still being redirected.

Any information you have would be appreciated, thanks.

woocommerce – Select2 cannot be added to the selection in variable product (admin)

I am trying to add select2 to an input in WooCommerce variable product admin.

I added select2 to a class so it can be reused. However, it seems that it is not working. It works anywhere on the page, but not in the variation meta box.

My initial theory was that the variations load when you click out of the product data container, so I found this event woocommerce_variations_loaded and bound a function here that select2 then applied – but it didn't work.

So I'm back in first place. What am I doing wrong and how can I get it to work?

(function($) {
    "use strict";

    $('.select2').select2();

    $('#woocommerce-product-data').on('woocommerce_variations_loaded', function(event) {
        $('.select2').select2();
    });

})( jQuery );

Any ideas? TIA.

magento2 – Multiple forms in Admin Form Magento 2

I use Magento 2.3.4, I have a database structure like this:

 //event
|event_id | name  |
+---------+-------+
|    1    |  Art  |
|    2    | Expo3 |

// score
| event_id |   judge     |   score  |            comment         | 
+----------+-------------+----------+----------------------------+
|     1    |   Joe       |    5     | hmmmmmmmmmmmmmmmmmmmmmmmmm |
|     1    |   Love      |    4     | gooooooooooooooooooooooodd |
|     1    |   Beck      |  4.5     | wooooooooooooooahhhhhhhhhh |
|     2    |   Candence  |    3     | ouchhhhhhhhhhhhhhhhhhhhhhh |

The point table is linked to the event table

I want to create a form in Admin Magento 2. This form must add / edit the event table and add / edit multiple items for the event. I need to have a multi-point form that I can add / edit as follows:

Enter image description here

How can I achieve something like this for Magento 2 Admin Form?