Expressing intent is important to achieve readable and clear code. Unfortunately, PHP’s array is the very anti-thesis to this, as it can mean anything and nothing. One solution would be to split the array type-hint into list and dict, where an error would be thrown if an array with string […]
Blog
What is the most secure way to encrypt image data at rest in PHP? I have photos that need stored on the server short term (< 1 hour) which will then be unencrypted and viewed, and then destroyed with shred. If time isn’t a factor, meaning 10 seconds open time […]
i need to add text swatch attribute value through script. I’am able to add the attribute but swatch value is not adding. Below is the code i using – $attributeDetails = $objectManager->create('MagentoEavModelConfig')->getAttribute("catalog_product", $attributeCode); //print_r($attributeDetails->getId()); exit(); $attributeId = $attributeDetails->getId(); $languageValues[0]=$label; $languageValues[1]=$label; /* @var $attr MagentoEavModelEntityAttribute */ $attr = $objectManager->create('MagentoEavModelEntityAttribute'); $attr->load($attributeId); $option […]
How do I configure the Magento2 can do below promotion? Free shipping with coupon code: (order >= $50)? I did google some result, some ask to enable free shipping method and set min-order-amount $50. that’s not work. Coz, I don’t want to show free shipping as a shipping method selection. […]
I have been using PayPal Payflow Pro for several months now and it often takes 30 seconds for a payment to be processed. I am running Payment Action as “Sale”, Debug Mode is disabled, PayPal Credit is disabled. No errors in my log (when debug was enabled). Magento 2.3.1 Is […]
As the title says, the X-Magento-Vary cookie isn’t working that well on my website. Sometimes, whenever a customer logs in, the cookie isn’t created and that makes the user lose the session as soon as he enters another page. I use Varnish 5, Magento 2.3.3 and nginx (could microcache be […]
I have an email template that I’m updating using the Magento admin interface. Essentially what I’m trying to do is get the Order ID, hash it, and send it as part of the email. I read that PHP short tags can be used in email templates, but all of them […]
Right now, default space which Windows 10 tells the programs to use it as (My) Documents folder is C:Usershaa_adminOneDriveاسناد. (Documents folder is not shown in File Explorer) This has made problems for some of my old games which use (My) Documents folder as the default space for saving progress. Because […]