Blog
PhpStorm doesn’t give me any error for this function block /** * @param array $foo * @return string */ public function test(array $foo): string { return (string)$foo; } Despite casting array to string will result in a notice. Similarly, there’s no error for this /** * @param array|string $foo * […]
I am looking to see if there is a way to pull down all the options that are available for a user. My goal is to create a drop down list so a user can pick a formatted URI that they need to accomplish their task? so for example a […]
I have a function to get the customer group ID and in my phtml file if it equals the customer group id I show content. The issue is that when I test it in a production environment the content doesn’t seem to show but on a development environment it does. […]
Magento 2.3.3 fails to open a specific products on Admin Panel. When clicked to open the products it throws below error after stucking for at least 5 minutes. Any idea how to resolve this issue? OUTPUT: 1 exception(s): Exception #0 (Exception): Warning: session_start(): Failed to decode session object. Session has […]
I wrote a simple sql upgrade script to add a custom attribute to the customer table. My script : < ?php $installer = $this; $installer->startSetup(); $installer->addAttribute('customer', 'whatsapp_active', array( 'type' => 'static', 'input' => 'boolean', 'label' => 'Is Customer Active', 'default' => '1', 'visible' => true, 'required' => false, 'user_defined' => […]
I need to send data from controller to Block, I have used many ways but it does not work. I’m trying this way: Controller.php public function execute() { $order_id = $this->getRequest()->getParam("order_id"); $order = $this->orderInterface->loadByIncrementId($order_id); $pakkeShipment = $order->getPakkeShipment(); $resultPage = $this->resultPageFactory->create(); $resultPage->getConfig()->getTitle()->prepend(__(' heading ')); $block = $resultPage->getLayout() ->createBlock('VendorPakkeBlockTrackInfoTrackingInfo') ->setTemplate('Vendor_Pakke::track_info.phtml') ->setTrackingInfo($pakkeShipment) ->toHtml(); […]