E-commerce Platforms
Install Magento2.4.x using command line
Install Magento2.4.x using command line
You must use the command line to install Magento.
This example assumes that the Magento install directory is named magento2ee
, the db-host
is on the same machine (localhost
), and that the db-name
, db-user
, and db-password
are all magento
:
Edit Magento Local Cache Storage Offline (Magento2)
Edit Magento Local Cache Storage Offline (Magento2)
Sometimes we might need to change something in the Local storage of Magento , the local storage is saved in this key ("mage-cache-storage")
I will put now an example to edit the selected shipping address in the checkout shipping section
Common WordPress Installation Steps
Common WordPress Installation Steps
-
Install WordPress
-
Install the Theme => Create Child theme then activate it
-
Protect the website by Basic Authentication while the website under construction
-
do all your modification
-
you can now change the theme name into any name 'xxx' then modify the child them to put 'xxx' as parent theme
-
Install some important plugins
Open WooCommerce Rest API by the browser
It is very nice to be able to see how we can get the data by the API, in WooCommerce there is a possibility to do that
first we need
- consumer_key
- consumer_secret
once you get those values you can use this link to get the list of products
https://{www.example.com}/wc-api/v3/products/?consumer_key={consumer_key}&consumer_secret={&consumer_secret}
or you can use the new API
Magento 2 search results relevance with elasticsearch?
Magento 2.3 still use "OR" logic for mysql and elasticsearch. Plus "should" conditions (query to ES) are wrong. That's why relevance almost same. But ES significantly improve performance of search and catalog (layered navigation).
you have to set AND operator in your elastic search json queries, Override the module-elasticsearch/SearchAdapter/Query/Builder/Match.php. file in your custom module and then The code you have to edit in the build function in line no 75
Database backup missing table information "inventory_stock_1" #19542
Database backup missing table information "inventory_stock_1"
The CREATE ALGORITHM statement requires elevated MySQL access.
It is likely that the server you are working on does not have this and will halt the import process.
This line needs to come out of the SQL being migrated.
Instead run the following to create the view
Magento2 Configuration values per deafferent scopes
in order to get any value per specific scope you can use the below parameters
First you need to initialize scopeConfig
* @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $_scopeConfig;
in the constrructer of your class
Get total weight of the cart in Magento2
Get total weight of the cart in Magento2
in order to get the total weight of the cart you can use two main methods, we will list them here
First Method
$weight = {getQuote()}
->getShippingAddress()
->getWeight();
Second method
$items = {getQuote()}->getAllItems(); $weight = 0; foreach($items as $item) { $weight += ($item->getWeight() * $item->getQty()) ; } echo $weight;
Inject reCaptcha in phtml file in Magento 2
the easy way to Inject reCaptcha in phtml file in Magento 2 to add PHP code, use this code to add reCaptcha into newsletter form
How to Get Value of Product Custom Option from Cart & Order in Magento 2
If you are wondering how to get the value of product custom option from cart and order in Magento 2, this is the right place for you to learn that. Published by Mageplaza, this topic will point you how to do that with two examples as the following.
Firstly, you can use ObjectManager:
Get custom options of products present in shopping cart