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

Cant access Admin controller route – Magento

I'm trying to fire a method on a controller but for some reason is giving me a 404, everything looks ok, but is not working. config.xml: <admin> <routers> <adminhtml> <args> <modules> <cloud_magni before="Mage_Adminhtml">Cloud_Magni_Adminhtml</cloud_magni> </modules> </args> </adminhtml> </routers> </admin> And here…

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