Search Optimisation in Magento 2

Here is the custom Builder Plugin to sort the Search results to get accurate results <?php namespace JJSearchCustomizationPluginModelAdapterIndex; use MagentoFrameworkAppObjectManager; use MagentoFrameworkAppRequestInterface; use MagentoElasticsearchModelAdapterIndexBuilder; class CustomBuilder { public function afterBuild(Builder $subject, $result) { // Use ObjectManager to get request safely in plugin context $request = ObjectManager::getInstance()->get(RequestInterface::class); $searchQuery = trim($request->getParam(‘q’) ?? ”); $inputLength = strlen($searchQuery); if… Continue reading Search Optimisation in Magento 2

pricing mechanisms in Netsuite and Magento

🛒 In Magento 2: Magento offers several pricing mechanisms that can work individually or together depending on the catalog setup. 1. Tier Price Definition: Discounted prices based on quantity breaks. Example: Buy 1–4: $100 Buy 5–9: $90 Buy 10+: $80 Set for: Specific customer groups or all groups. Where Set: Product Edit → Advanced Pricing… Continue reading pricing mechanisms in Netsuite and Magento

Magento Shipment option Fetch

Fetch Shipment Details Using Magento API After an order is placed and processed, you can fetch the shipment details via the Magento REST API. Endpoint: http Copy code GET /rest/V1/shipment/{shipment_id} Example API Call: bash Copy code curl -X GET “https://yourmagento.com/rest/V1/shipment/25” -H “Authorization: Bearer YOUR_ACCESS_TOKEN” -H “Content-Type: application/json” 2. Fetch Shipments for an Order To fetch… Continue reading Magento Shipment option Fetch

Magento 2.4.6 Installation On Windows

Installation Requirements For Magento 2.4.6: Operating systems Distributions of Linux, including RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, macOS, and Windows. Memory requirement Magento2 requires 4 GB or higher RAM.  Composer Composer 2.x will be supported by Magento. Web servers Apache 2.4 Database MySQL 8.0 MariaDB 10.4 PHP Magento 2.4.6 supports PHP 8.2 Elasticsearch As of 2.4.6 Magento, MySQL is no longer available for search purposes. You’re supposed to use Elasticsearch. Elasticsearch 2.x, 5.x, and 6.x are no longer supported by Magento. To get detailed information about system requirements, just visit… Continue reading Magento 2.4.6 Installation On Windows

What is codePool?

Code pool is a concept to pull the code in Magento structured format. It is specified when you register new module in app/etc/modules/Company_Module.xml There are 3 codePools in Magento: core, community and local, which reside at app/code/ directory. CodePools: _community: It is generally used by 3rd party extensions. _core: It is used by Magento core team. _local: Local… Continue reading What is codePool?

Undefined array key “frontend” Issue

Got error ‘PHP message: PHP Warning: Undefined array key “frontend” in /home/977869.cloudwaysapps.com/syqfgmwgpb/public_html/vendor/magento/framework/App/Cache/Frontend/Pool.php Screenshot: Solution: ‘cache’ => [ ‘frontend’ => [ ‘default’ => [ ‘id_prefix’ => ’91c_’ ], ‘page_cache’ => [ ‘id_prefix’ => ’91c_’ ] ], ‘allow_parallel_generation’ => false ],

Proposal for Syncing Financial Tab in NetSuite to Magento

Proposal Summary  This proposal outlines the development of a solution to display finance-related data from the NetSuite customer record to the website instance. The goal is to enhance the website’s ability to display accurate and up-to-date customer’s financial tab information to sales reps.  The estimated time for the completion of the proposal is 92 hours. … Continue reading Proposal for Syncing Financial Tab in NetSuite to Magento

ObjectManager usage directly

Should not use Object manager directly! For instance: MagentoFrameworkAppObjectManager::getInstance(); also if you are working with event observers or plugins, you should never use it directly. You could use it in Factories, but except that you should inject the Object Manager in the Constructor first then you can use its object in your method Preferred to… Continue reading ObjectManager usage directly

How do you create a custom cron job in Magento 2 and ensure it executes only once per cycle?

Here crontab.xml file <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:module:Magento_Cron:etc/crontab.xsd”> <group id=”default”> <job name=”vendor_module_cronjob” instance=”VendorModuleCronCustomJob” method=”execute”> <schedule>* * * * *</schedule> </job> </group> </config> <schedule>0 3 * * *</schedule> 0 – Minute (0th minute, or the beginning of the hour) 3 – Hour (3 AM) * – Day of the month (every day) * – Month (every month) * – Day… Continue reading How do you create a custom cron job in Magento 2 and ensure it executes only once per cycle?