:::: MENU ::::

Magento Tutorial | Magento Blog | Learn Magento 2

Cookies Consent Popup

I Found Solution for it and i hope its work for you. placeholder comes from : vendor/magento/module-catalog/Helper/Product.php i try to save my images directly in my theme on below path and it works.
app/design/frontend/Your/Theme/Magento_Catalog/web/images/product/placeholder
and put your images with below name in jpg format.
  • image.jpg
  • small_image.jpg
  • thumbnail.jpg
    Dont forget to do upvote if its work for you. cheers !!
Sometime we just need to use simple jQuery on checkout page but checkout element bind with knockout js so our jQuery not work smoothly so below is a way to call your jQuery after bind perticular element.

Use below code in your jquery and it will load after binding your element in page.

function waitForElement(query, callback){
    var poops = setInterval(function(){
        if(document.querySelector(query)){    
            clearInterval(poops);
            callback();
        }
    }, 100);
}

waitForElement(".class", function(){
    alert("element is loaded.. do stuff");
});
Put below code in anywhere in magento2 :- $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/custom.log');$logger = new \Zend\Log\Logger();$logger->addWriter($writer);$logger->info("Product Info ". $product->getSku() . "----- Id  ". $product->getId() );
Or you can try this : file_put_contents(BP . '/var/log/events.log', "$eventName\n", FILE_APPEND);