• Log in or Create an account
  • How to return JSON response from Magento 2 controller?

    When writing custom code for Magento, if there is data involved, more often than not, a controller needs to be created. The controller handles the request and returns an appropriate response. The response could be several different things, but if the request is an ajax request, then we can be pretty certain that the response returned is most often in the JSON format.

    So how do we return response from the controller in a specific format?...

    When I initially started developing for Magento 2, I thought returning an array would suffice and Magento will take care of the rest. But I was wrong. Although Magento 2 can handle several different types of requests, they need to be returned in a certain way for the controller to send the response in the format needed....

  • Magento 2 - load model by custom field

    This is a simple tutorial showing how to load a model using a custom field rather than loading by the primary key. There are several situations the primary key isn’t the only unique field and we may have other fields in the table which are unique and are used more often to load the model. To name a few, Customer entity has email as the unique field and the Product entity has SKU. These fields are used quite often to load a single database row into the model....

    This tutorial will show you how to do that for an existing or custom model....

  • Add a custom block in Magento 2 on the product page after add to cart button

    Product page plays a very important role in Magento 2 and showing the right information at the right spot could decide whether you get a sale or not.

    Recently, I came across a situation where I was requested to add a custom block right after the add to cart button on the product page. Although this is not a difficult task for a Magento 2 developer, I thought it would be best to write this article so that anyone struggling to find a solution would find it helpful....

    The easiest solution would be to either use an existing widget or create a custom widget to add the custom block to one of the many pre-defined spots on the product page. However, what I am going to show here is not a widget. I will be showing you how to add a custom block using the layout.xml....

  • Hungersoft's Black Friday and Cyber Monday Sale 2019 - 40% off

    Hungersoft.com is happy to present

    Black Friday & Cyber Monday Sale - 2019

    As we enter the last and most festive part of year 2019, we thought it would be fun to celebrate it with all our loyal customers and visitors.

    As part of these celebrations, we will be offering 40% discount on our entire catalog.

    Yes you read that right! You will get a discount of 40% on all our products.

    No rules, no hidden conditions! Buy any of our product(s) and pay 40% lesser....

    We will be offering these discounted prices from 25th November (Monday) to 2nd December (Monday)....

  • Enable DB logging in Magento 2

    We work on several Magento 2 projects on daily basis and that means constantly having to deal with code, database, errors etc. and one thing that comes in handy more often than we’d care to admit are the logs.

    Logs when used correctly allow you to understand how your application works, what data is being passed, the errors, where they originate etc. This makes finding the issues and fixing them simpler if not easy....

    In this article, I will explain how to enable database logging, which comes in handy especially when the data you expect to be read or written isn’t as you expected it to be. This happens quite often and can be really frustrating to debug....

  • Magento 2: How to add reindex option to Index Management grid?

    Several times during the development and testing phase of your store you may have wanted to reindex your store for the your products, their prices, promotion rules etc. to show up correctly in the frontend. But Magento does not allow you to reindex direclty from the admin. You either have to wait for the cron to run or, you need to run command php bin/magento indexer:reindex to manually reindex. This can be a tedious task, once that sucks the life out of you when you have to do it over and over again, especially when you don’t know how to run a command in your CLI (Command line interface) and you have to wait for the cron job to run....

  • How to add custom validations before place order in Magento 2

    There are several cases where you might want to or need to add custom validations before place order so that the action is completed smoothly. These validations should happen before the actual place order action is dispatched.

    This article will explain how you can add your custom validations to Magento 2 that run on place order button click but before the button action is dispatched. The button action will be dispatched only when all the validations return true....

    First of all, we will create a validator. For your custom module to work correctly, it is best if your module depends on Magento_Checkout module....

  • Free Magento 2 extensions by Hungersoft

    Magento is one of the biggest Ecommerce platform out there and one of the main reasons for its success is the thriving community that uses and supports it. The knowledge and resources get exchanged freely between community members from all levels. Be it business owners, non-technical users, amateur developers or very experienced programmers, everybody contributes to the community.

    We too believe in providing our contribution towards growth of this platform. As developers of premium quality Magento 1 and 2 extensions, we always strive to create useful extensions that make Magento easy, fun and effective....

  • New Improved Base Price extension for M2: Coming soon

    Many businesses sell commodities in standard units, and their customers order always in bulk. I.e. many webshops sell products in big/bulk packs and these packs contain multiple units of that product.

    For example, one of our esteemed client has a B2B webshop which sells candies by boxes. They display product price as the price of the entire box (which contains specific number/weight of candies). This is the standard and expected way of displaying product prices, but since it is a B2B webshop, their customers also want to know price of 100 grams or 1 Kilograms of that candy. They want the product detail page to also the price of candy per Kg or per 100 grams....

  • SECURITY PATCH SUPEE-11086 RELEASED FOR MAGENTO CE 1.X

    Magento is retiring its Community Edition ver. 1.X .You can read more about that in our previous post.

    To show their dedication and support towards the flourishing and vibrant community, Magento has promised to keep providing security updates till 2020.

    As a part of that promise, Magento has yet again released a new security patch (SUPEE-11086) on 26th March, 2019!

    This new security patch contains security enhancements that protect your webshop from vulnerabilities like remote code execution (RCE), cross-site request forgery (CSRF) and cross-site scripting (XSS). You can read more about it in detail from here....

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

Copyright © Hungersoft 2019

· Terms & Conditions · Privacy policy