Page 2 - Magento Tutorial
-
- February 16, 2024
This article shows how to get shopping cart items/products, subtotal and grand total of cart, and shipping and billing address entered while doing checkout in Magento 2.
I will be using both Dependency Injection (DI) and Object Manager in the below example code.
Using Object Manager
– Get products id, name, price, quantity, etc. present in your cart.
– Get number of items in cart and total quantity in cart.
– Get base total price and grand total price of items in cart.
– Get billing and shipping addresses entered during checkout.Get all items information in cart
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $cart = $objectManager->get('\Magento\Checkout\Model\Cart'); // retrieve quote items collection $itemsCollection = $cart->getQuote()->getItemsCollection(); // get array of all items what can be display directly $itemsVisible = $cart->getQuote()->getAllVisibleItems(); // retrieve quote items array $items = $cart->getQuote()->getAllItems(); foreach($items as $item) -
- June 22, 2022
Problem
I am working with Magento 2.3. Recently I've configured the xdebug in my local to identify some process flow. But it does not help me to check the flow.
Then I hit the website in local, I am facing the Uncaught Error: Call to undefined function xdebug_disable() in vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php on line 73
Solution
Open the file
vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.phpFrom :-
if (!(bool)$debugMode && extension_loaded('xdebug')) { xdebug_disable(); }To:-
if (!(bool)$debugMode && extension_loaded('xdebug')) { if (function_exists('xdebug_disable')) { xdebug_disable(); } } -
- May 22, 2021
I tried to install an extension from the Magento market place but I got an incompatibility error...
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on the current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- laminas/laminas-dependency-plugin is locked to version 1.0.3 and an update of this package was not requested.
- laminas/laminas-dependency-plugin 1.0.3 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- magento/magento-composer-installer is locked to version 0.1.13 and an update of this package was not requested.
- magento/magento-composer-installer 0.1.13 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 3
- dealerdirect/phpcodesniffer-composer-installer is locked to version v0.5.0 and
-
- May 18, 2021
I have error when i add module..
Please re-run Magento compile command
so i run below command but also display error that below when run command from root,
php magento setup:di:compile
-
- October 02, 2020
As you know, configuring robot.txt is important to any website that is working on a site’s SEO. Particularly, when you configure the sitemapto allow search engines to index your store, it is necessary to give web crawlers the instructions in the robot.txt file to avoid indexing the disallowed sites. The robot.txt file, that resides in the root of your Magento installation, is directive that search engines such as Google, Yahoo, Bing can recognize and track easily. In this post, I will introduce the guides to configure the robot.txt file so that it works well with your site.
Following steps to Configure robots.txt in Magento 2
- On the Admin panel, click
Stores. In theSettingssection, selectConfiguration. - Select
DesignunderGeneralin the panel on the left - Open the
Search Engine Robotssection, and continue with following:- In
Default Robots, select one of the following:- INDEX, FOLLOW
- NOINDEX, FOLLOW
- INDEX, NOFOLLOW
- NOINDEX, NOFOLLOW
- In the
Edit Custom
- In
- On the Admin panel, click
-
- January 19, 2019
The topic today is one of the popular errors you will meet. As if the error message shows “An error has happened during application run. See exception log for details” in Magento 2 when you have uploaded Magento CE latest version and want to install it on your server, so what should you do? Here is the right solution for you.
How to resolve: “An error has happened during application run. See exception log for details”
Please open the
.htaccessfrom the root and comment out the first line:SetEnv MAGE_MODE developer -
- March 04, 2016
In this post I will show how you can add banner ads to your Ionic apps. I will be doing this on a new app but you can do it to your existing app as well. I have also written a post on adding banner ads to Ionic 2 apps, so if you are looking for Ionic 2 apps You can check that post out as well.
Step 1)
We will first start by creating a new Ionic project by issuing the following command in the command prompt
1ionic start MyNewApp TabsStep 2)
Now we will need to add the platform to out app. So will do the following command
Step 3)
As we will be using the AdMob Pro plugin we will need to download it in our project. We will do that by the following command
you can read more about the plugin in the Admob pro plugin documentation
Step 4)
Now we will need to add the following code to the $ionicPlatform.ready()
-
- February 26, 2016
The error you have received is from NPM (since the Cordova CLI is installed via NPM). This is a tricky issue where using NPM with
sudo, and then not usingsudowill result in weird permission issues.Solution:
sudo chown -R $USER /usr/local/ -
- February 26, 2016
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/arulmanickam/adt-bundle-linux-x86-20131030/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 127Solution :
For me it was that I forgot to install the 32bit dependencies:
sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6sudo apt-get install -y lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev -
- February 26, 2016
i have this error when i am trying to build
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]Solution
You have permission errors. My guess is that you tried to run the script as root rather than sudo. When running the script you have to run it as your user account using sudo.
change owner permission all files & folder to your current login user .
- Your android sdk
- Your ionic or cordova project files
dont run as admin or run using sudo