magento2.3 – Magento 2.3.x: Show the address field on the registration form?

I am looking for a way to display the address fields on the customer registration form. In previous versions of Magento 2, I could add them using the fragment below in the customer_account_create.xml archive:

true

Since the release of Magento 2.3.1, this fragment does not seem to have any impact, has anyone found how to achieve this now?

magento2.3 – Magento 2: problem with PayPal express payment

I have integrated Paypal Express Checkout into my Magento 2 website. It is redirecting to PayPal after payment. But when I log in to the PayPal account I receive an error message.

We are sorry. This seller does not accept payments in your currency. Return to the seller and choose another form of payment.

Although I have allowed all the currency and the main currency to be USD.

Magento2.3 Add a custom filter as a checkbox

Here is a very special question (I hope everyone understands the request).

  1. I want to add a custom check box filter in an administrator HTML listing grid.

  2. If this check box is checked, I need to order the complete items in another way.
    That is, I need to select all entities in my custom table and make special orders directly using a subselect (first order all items that have a SKU). So, for this, I think I have to build a native query.

  3. I need to add a custom column SKU that only has one value if the Entity only has one SKU.

So, my question is:

1) How can I add a custom check box filter?

2) How can I manipulate the filter query if this check box is configured with a custom native query?

3) How can I just fill out a custom column with my own value? (which are not coming out in the table)

I can't find any solution for this on the Magento DEV pages, so I hope some can tell me the LIST FILTER XML syntax and the classes I have to investigate.

magento2.3 – Changing the url category key is not updating URL Rewrites

I have a category called "Sports Shoes" in Magento. The category has many subcategories and products. Your URL key is "sports shoes."

After changing the category URL key to "sports shoes", the magento URL rewrite is not updated. All redirects are the same and no product category or URL that contains "sports shoes" works.

I tried re-indexing products but that did not solve the problem. I dare not use some type of URL regeneration extension, because my website contains more than 150k products. It would take days to complete that process.

But this is a feature that should work well in magento by default.

How can i fix it?

magento2.3 – AJAX IN MAGENTO2. HOW TO ADD form information IN THE DATABASE?

I want to add and send form information to the database using AJAX. How to do it right? I would appreciate your help! Here is my attempt:

see / frontend / templates / reviews.phtml

<form action = "getBaseUrl (). & # 39; reviews / index / save & # 39 ;; ?> "
method = "post">
                
                
                
                

                    
    
    

Controller / Index / Save.php

_test = $test;
parent::__construct($context);
 }
 public function execute()
{

$data = $this->getRequest()->getParams();
$test = $this->_test->create();
$test->setData($data);
if($test->save()){
    $this->messageManager->addSuccessMessage(__('You saved 
  review'));
  }else{
    $this->messageManager->addErrorMessage(__('Review was not 
saved.'));
}
$resultRedirect = $this->resultRedirectFactory->create();
$resultRedirect->setPath('reviews/index/index');
return $resultRedirect;
}
}

Controller / Index / Index.php

_view->loadLayout();
$this->_view->getLayout()->initMessages();
$this->_view->renderLayout();
  }
}   

magento2.3 – Magento 2.3 – Move the billing address below the shipping address at the end of the purchase

I want to move the billing address form below the shipping address on payment, on the first page.

Therefore, I created a custom module with the following LayoutProcessorPlugin.php.

But now the billing address field is shown above the shipping address instead of below. And the default checkbox & # 39; My billing and shipping address are the same & # 39; It is now disabled by default.

How can I place this field below the submission form and also set the checkbox to redial by default?

LayoutProcessorPlugin.php code;

Magento2.3: get the product collection only in stock

Magento 2 gets the collection of products with filter stock

get alone in stock product in the collection

See the code below

$collection =  $this->_productCollectionFactory->create();
$collection->addStoreFilter($storeId);
$collection->addAttributeToFilter('status',MagentoCatalogModelProductAttributeSourceStatus::STATUS_ENABLED);
$this->_stockFilter->addInStockFilterToCollection($collection);

magento2.3 – Extended order model for use in email templates that no longer work

I have an add-on to add an order function to the order model. This worked before, but now it doesn't work anymore. Maybe a problem with the update to 2.3.3 or 2.3.4.

module.xml




    
        
    


di.xml


    

Model / Sales / Order.php

namespace MymoduleFormalsalutationModelSales;

class Order extends MagentoSalesModelOrder {

    public function getCustomerNameFormal() {
        $customerNameFormal = 'test';

        // removed logic here

        return $customerNameFormal;
    }
}

Use of the email template (order and invoice template):

{{var order.getCustomerNameFormal()}}

When I open an order, load this model. But in emails it doesn't work anymore.
Does anyone have an idea why this happens, was there a change in an update or is it just a mistake?

I saw that other variables don't work either.

 

{{trans 'Placed on %created_at' created_at=$order.getCreatedAtFormatted(2) |raw}}

But some, such as Address and order ID, are correct.

Thank you,
Andreas

magento2.3 – Exit from the magento 2 database

I want to calculate how many times in the column there is a word match "Test" in the column.

I know SQL to do it

SELECT THE COUNT (*) FROM training_reviews WHERE I LIKE the result & # 39; test & # 39 ;;

But how will I do this in Magento2?
I will be grateful for your help!

My attempt:

test.phtml

$collection = $category->getResourceCollection();
$collection->addAttributeToFilter('result', ('like' => 'test'))
       ->load();
$collection->count();

/Model/Reviews.php

 protected function _construct()
 {
    $this->_init('TrainingReviewsModelResourceModelReviews');
 }
}

/Model/ResourceModel/Reviews.php

 _init('training_reviews', 'news_id');
 }
}

Model / ResourceModel / Reviews / Collection.php

_init(
        'TrainingReviewsModelReviews',
        'TrainingReviewsModelResourceModelReviews'
    );
 }

}

Block / Comments

pageConfig->getTitle()->set(__('Users Reviews'));

    return parent::_prepareLayout();
}
}

Magento2.3: How to display the template file on a particular category page?

For that, you just need to create a static block and call it .phtml File as the following example.

{{block class = " Magento Framework View Element Template"
template = "Vendor_Module :: product / category_customdata.phtml"}}

Then you just need to call these blocks in a specific category. See the image below for your reference.

enter the description of the image here

That's.

I hope it helps you.