skip to Main Content

How to get Magento 2 secure base URL?

I'm using below code to get base url in magento 2. $storeManager = $objectManager->get('MagentoStoreModelStoreManagerInterface'); echo $baseurl = $storeManager->getStore()->getBaseUrl(MagentoFrameworkUrlInterface::URL_TYPE_WEB); Let me know how to get secure base url.

VIEW QUESTION

Magento 2 : Add custom script just after head tag

i want to add custom script just after the start of head tag. like. <head> <script>console.log("I'm loaded!");</script> i tried to add code in default_head_blocks.xml <referenceContainer name="head.additional"> <block class="CustomModuleBlockSuccess" template="Custom_Module::success/head.phtml"/> </referenceContainer> => output : <script>console.log("I'm loaded!");</script> </head> this code are using…

VIEW QUESTION

Assign Related Product In Magento 2 API

I am using magento 2 api for assigning product link like related or crosssell using api /V1/products/{sku}/links Here is My Sample Code <?php error_reporting(E_ALL); define('mag_apiurl',"http://www.mywebsite.com/rest/V1/"); define('tn_webshopKey',"myshowpkey"); $sku1 = "sku1"; $sku2 = "sku2"; $productData = array( "items" => array( "sku" =>…

VIEW QUESTION
Back To Top
Search