New answers tagged

0 votes

Media url returns nothing in Magento 2

Try below code. If you need to return a product URL it should look like this: //todo get product object $product $productImageAttr = $_product->getCustomAttribute( 'technologies' ); $objectManager ...
user avatar
  • 3,247
0 votes

Media url returns nothing in Magento 2

You can try setting the image as follows: $productImageAttr = $_product->getCustomAttribute( 'technologies' ); $productImage = $this->helper('Magento\Catalog\Helper\Image') ->init($...
user avatar
0 votes

Magento 2 How to change media base url programatically

Please, use interfaces for interacting with Magento. If you are developing a custom module, you can use Magento\Framework\App\Config\Storage\WriterInterface to write configuration, and Magento\...
user avatar
0 votes

Magento 2 How to change media base url programatically

In Magento 2, we need to use Dependency Injection to get an instance of Magento\Config\Model\ResourceModel\Config, which can then be used to save the config programmatically. The base_media_url needs ...
user avatar
  • 1,111

Top 50 recent answers are included