Optimizing Magento for Speed and Performance

We are a web development and outsourcing agency based in Kochi, India.

Optimizing Magento for Speed and Performance

Optimizing Magento for Speed and Performance

Magento is a very good ecommerce solution at the same time as they call it ‘an over engineered’ system which is not very light. But can we rule it out from the list of ecommerce softwares we would consider? Definitely not. Reasons are anything from Magento being open source to the community help and plugins’ availability. We help many of our clients with site speed optimization and performance boosting of their webshops. Here we will share some techniques we generally use. Most of these suggestions you can see from Google pagespeed insights. 1. Image Optimization Make sure all the images used in the site, including banners and product images are saved for web. If...

Beginners guide to customize layout in Magento2

It’s difficult for a beginner to go into Magento developer docs and understand the whole concept of layout handling with xml files. The layout files are .xml files located in the layouts folder of the theme/component. The layout file defines the position, template file, arguments, html attributes, etc. for each block. A template file (with .phtml extension) is the HTML part that is loaded by how the XML is configured. Magento has this feature to turn on template path hints which is an absolute lifesaver for beginners who try to figure out which template is used for a particular section. It also gives the block class name used. Below is an image of Magento showing the path hints.

How to Add a Custom field in Checkout – Magento module

We had a client who wanted to add some selectable options on the checkout review page, asking their customers how they heard about their website. We created a custom module to make it happen, and it was a big hit! The options included Social Media, Blog, Search Engines, and more. This module adds a custom field to the checkout review section, which can be super useful for understanding how customers find your website. If you're a developer, you can easily tweak this module to suit your needs.  Please check the screenshots :

How to Upgrade Magento 2 to the Latest Version

To upgrade your Magento Open Source application, follow these simple steps: Please note that Adobe Commerce 2.4.2 now supports Composer 2. If you're upgrading from a version earlier than 2.4.1, you'll need to first upgrade to a compatible version with Composer 2 (for example, 2.4.2) using Composer 1 before proceeding to upgrade to Composer 2 for versions higher than 2.4.2. Additionally, make sure that you're running a supported version of PHP. To ensure a smooth upgrade process, it is recommended that you switch your store to maintenance mode. This will prevent access to your store while the upgrades are being made. bin/magento maintenance:enable

Estimating Shipping Rate on Product Details Page in Magento

To display the shipping rates on the product view page in Magento 2, you can use a custom block and template. Just follow these simple steps to make it happen: Create a Custom Module: If you don't have a custom module yet, it's a great idea to create one following the best practices for module creation in Magento 2. Create a Block Class: In your custom module, let's create a block class to handle the super cool logic for obtaining shipping rates! <?php // File: app/code/YourVen...

Setting the ‘continue shopping’ URL to last product’s category page in magento

Here is a code snippet for setting the ‘Continue Shopping’ location to the category listing page of the last product added to the cart. Open the template/checkout/cart.phtml file in your active theme. Place the following code in the foreach loop

(ie. after this line of code)

< ?php foreach($this->getItems() as $_item): ?>

that generates the products list in the cart.

< ?php
$_categories = $_item->getProduct()->getCategoryIds();
$_category = Mage::getModel(‘catalog/category’)->load($_categories[0]);
$url = $this->getUrl($_category->getUrlPath());
Mage::getSingleton(‘checkout/session’)->setContinueShoppingUrl($url);

?>

You are done!

Are the product images not appearing in Magento after installation or migration?

This is a common issue that many Magento 2 users face, and there are several possible causes and solutions for it. Here are some of the most common ones: The product images are not in the correct directory or have incorrect permissions.  You should make sure that your product images are located under pub/media/catalog/product/ in your Magento 2 installation, and that they have the correct permissions (755 for directories and 644 for files).  The product images are not resized or regenerated properly. It would help if you run the command bin/magento catalog:images: resize in your Magento 2 root directory to resize and regenerate the product images ...

Why is the new theme not appearing in Magento 2 after installation?

You did a successful Magento installation, the base theme is showing up and you are all good to go. Then you uploaded your theme and updated it from the Magento backend. Still, it’s not showing up. This is a problem that might eat up some of your time. Usually, a straightforward solution will fix it.

Once you’ve created the theme in the right folder, just run these commands: 

php magento cache:clear

php magento setup:upgrade 

php magento setup:di:compile and 

php magento setup:static-content:deploy --theme {vendorName}/myTheme2

That should do it!

How can products be assigned to multiple stores programmatically in Magento 2?

Let’s say you have a Magento multi-website/store installation and you want to assign the products of a particular category to the new store. I wrote a few lines of code to accomplish this. <?php use Magento\Framework\App\Bootstrap; require __DIR__ . '/../app/bootstrap.php'; $bootstrap = Bootstrap::create(BP, $_SERVER); $objectManager = $bootstrap->getObjectManager(); $state = $objectManager->get('Magento\Framework\App\State'); $state->setAreaCode('frontend'); $categoryIds = [41]; // Category IDs whose products you want to assign foreach ($categoryIds as $categoryId) { $category = $objectManager->create('Magento\Catalog\Model\Category')->load($categoryId); $productCollection = $category->getProductCollection(); foreach ...

Best Ecommerce Platform for Furniture Stores in 2024

In the year 2024, the furniture market worldwide is expected to achieve revenues of about US$765.00 billion. Online furniture buyers are on the increase. As a furniture store owner, it is crucial to choose the right ecommerce platform. The process of choosing the right digital storefront for furniture is hard yet important. If you don’t have an online store for furniture means potentially losing a wide customer base and thus not making money.  If you already have an online store, an oversight of critical features that are small yet hit the point, can mean losses in sales and dissatisfaction by customers. Building a strong online presence is what keeps the furniture industry competitive and calls attention to today's...

Page 2 of 41234
2hats Logic HelpBot