Here is the startup file which can be used for the startup file import express from ‘express’ import payload from ‘payload’ import path from ‘path’ import nodemailerSendgrid from ‘nodemailer-sendgrid’ const sendGridAPIKey = process.env.SENDGRIDAPI_KEY require(‘dotenv’).config({ path: path.resolve(__dirname, ‘../.env’), }) const app = express() const PORT = process.env.PORT || 8000 // Redirect root to Admin panel app.get(‘/’,… Continue reading Payload Startup File for the Plesk Panel
Category: Adobe Commerce
Custom and basic RMA table infrastructure
Update API Data { rma_id customer_id: dealer_id: status: order_id: po_number: memo: pdf: items:{ { product_id: qty: }, { product_id: qty: } } Create API Data { customer_id: dealer_id: status: order_id: po_number: memo: pdf: items:{ { product_id: qty: }, { product_id: qty: } } Two tables has bee created jj_rma and jj_rma_items. Main table should contain… Continue reading Custom and basic RMA table infrastructure
Option to delete customers account from the Myaccount
A delete button has been placed on the account custom template on the extension JJ_Account. On the delete a controller action is called on the Ajax method. $(document).on(‘click’,’.delete-contact’, function () { var email = $(this).data(“email”); swal.fire({ title: “Are you sure?”, text: “Do you want to delete?”, icon: “warning”, showCancelButton: true, confirmButtonColor: ‘#9FC33A’, cancelButtonColor: ‘#9FC33A’, confirmButtonText:’Yes’,… Continue reading Option to delete customers account from the Myaccount
Create a custom field on the checkout shipping method page
On the checkout_index_index.xml <item name=”shipping-step” xsi:type=”array”> <item name=”children” xsi:type=”array”> <item name=”shippingAddress” xsi:type=”array”> <item name=”children” xsi:type=”array”> <item name=”shippingAdditional” xsi:type=”array”> <item name=”component” xsi:type=”string”>uiComponent</item> <item name=”displayArea” xsi:type=”string”>shippingAdditional</item> <item name=”children” xsi:type=”array”> <item name=”additional_block” xsi:type=”array”> <item name=”component” xsi:type=”string”>JJ_Checkoutupdate/js/view/custom-field</item> </item> </item> </item> </item> </item> </item> </item> web->template folder (custom-field.html) <div class=”form-shipping-addres”> <div class=”field memo” style=”padding-bottom: 20px; font-size:16px;”> <label class=”label” for=”memo”> <span>Memo</span>… Continue reading Create a custom field on the checkout shipping method page
verifying the component items of a Bundle item is available at any location
$qty = 0; $sortedSource = []; foreach ($items as $item) { $newsku = $item->getSku(); $sourceItemList = $cduObj->getSourceItemBySku($newsku); $sortedSource[$newsku] = 0; foreach ($sourceItemList as $source) { if ($source->getStatus() == 1) { $sortedSource[$newsku] = $sortedSource[$newsku] + $source->getQuantity(); } } if ($sortedSource[$newsku] != 0) { $sortedSource[$newsku] = $sortedSource[$newsku] / $item->getQty(); } } $filteredItems = array_filter($sortedSource, function($value) { return… Continue reading verifying the component items of a Bundle item is available at any location
How to fetch database version through terminal
Connect the mysql server with credentials mysql -u username -p Enter the password Choose the database and run the command. use yourdatabase; Run the query SELECT option_value FROM yourdatabase.wp_options WHERE option_name = ‘db_version’;
How to create a custom field on customer account information section in Adobe commerce
Use the data patch setup on AdobeC Create Setup -> Patch -> Data -> AddCustomAttribute.php <?php namespace JJCustomerNetsuiteFieldSetupPatchData; use MagentoEavSetupEavSetupFactory; use MagentoFrameworkSetupModuleDataSetupInterface; use MagentoFrameworkSetupPatchDataPatchInterface; use MagentoCustomerSetupCustomerSetupFactory; use MagentoCustomerModelCustomer; class AddCustomAttribute implements DataPatchInterface { private $eavSetupFactory; private $customerSetupFactory; private $moduleDataSetup; public function __construct( EavSetupFactory $eavSetupFactory, CustomerSetupFactory $customerSetupFactory, ModuleDataSetupInterface $moduleDataSetup ) { $this->eavSetupFactory = $eavSetupFactory; $this->customerSetupFactory =… Continue reading How to create a custom field on customer account information section in Adobe commerce
How to integrate with Magento
For the standard token based integration. Go to Magento Backend, system -> Integrations Create a new integration setup and generate the key and tokens. Use these for the integration.
Model Checking in Software Testing
Model checking is a powerful formal verification technique used in software testing to ensure the correctness and reliability of systems. It involves systematically exploring all possible states and transitions of a finite-state model to verify whether it satisfies specified properties or requirements. Overview: In software testing, model checking begins with constructing a formal model of… Continue reading Model Checking in Software Testing
The Rise of Ad Blockers and Their Implications
Introduction: In an era dominated by digital content and online advertising, the prevalence of ad blockers has emerged as a significant trend, reshaping the dynamics of online marketing. As consumers increasingly seek ways to enhance their browsing experience and mitigate intrusive advertising, ad blockers have gained traction, presenting both challenges and opportunities for advertisers, publishers,… Continue reading The Rise of Ad Blockers and Their Implications