- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019
11:02 PM
08-15-2019
11:02 PM
<?php require_once('app/Mage.php'); //Path to Magento umask(0); Mage::app(); $methods = Mage::getSingleton('shipping/config')->getActiveCarriers(); $shipMethods = array(); foreach ($methods as $shippigCode=>$shippingModel) { $shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title'); $shipMethods[$shippigCode] = $shippingTitle; } echo "<pre>"; print_r($shipMethods); ?>
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019
11:21 PM
08-15-2019
11:21 PM
Hi @Aveeva,
You need to set store id instead of website id.
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$defaultStoreId = Mage::app()
->getWebsite(2)
->getDefaultGroup()
->getDefaultStoreId();
Mage::app()->setCurrentStore($defaultStoreId);
I hope it will help you!
You need to set store id instead of website id.
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$defaultStoreId = Mage::app()
->getWebsite(2)
->getDefaultGroup()
->getDefaultStoreId();
Mage::app()->setCurrentStore($defaultStoreId);
I hope it will help you!
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019
11:21 PM
08-15-2019
11:21 PM
Hi @Aveeva,
You need to set store id instead of website id.
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$defaultStoreId = Mage::app()
->getWebsite(2)
->getDefaultGroup()
->getDefaultStoreId();
Mage::app()->setCurrentStore($defaultStoreId);
I hope it will help you!
You need to set store id instead of website id.
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$defaultStoreId = Mage::app()
->getWebsite(2)
->getDefaultGroup()
->getDefaultStoreId();
Mage::app()->setCurrentStore($defaultStoreId);
I hope it will help you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019
11:34 PM
08-15-2019
11:34 PM
Re: How to set website = 2 in below code
@Vimal Kumar May i know what is the difference
$website_id = Mage::app()->getWebsite(2); vs
$website_id = Mage::app()->getWebsite(2)->getDefaultGroup()->getDefaultStoreId();
in my prior case i just use only $website_id = Mage::app()->getWebsite(2),
eg :
$website_id = Mage::app()->getWebsite()->getId(); if($website_id=="1") { //some code }
but here $website_id = Mage::app()->getWebsite(2)->getDefaultGroup()->getDefaultStoreId(); only working, may i know what is the difference between these two concept?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2019
11:37 PM
08-15-2019
11:37 PM
Re: How to set website = 2 in below code
$website_id = Mage::app()->getWebsite(2);
It will return the website id 2 only.
vs
$website_id = Mage::app()->getWebsite(2)->getDefaultGroup()->getDefaultStoreId();
It will return the default storeid of the website which have website id =2
It will return the website id 2 only.
vs
$website_id = Mage::app()->getWebsite(2)->getDefaultGroup()->getDefaultStoreId();
It will return the default storeid of the website which have website id =2