1

I have a multisite setup with multiple custom shipping modules. Each store has different settings for free shipping etc.. (based on weight/value)

Everything works great from the front end, however on the backend the modules take the default values and do not recognize that a store has been selected.

I can detect if it is an admin order, but no idea how to detect what store has been selected and how to get the variables for that store

I am using the following

$current_cart_total_inc >=Mage::getStoreConfig('general/custom_values/free_ship_threshold');

How can I detect the store and then get the correct value based on the store ID rather than use the admin one?

1 Answer 1

1

You can get store value with below code: to get store id in adminend

$this->getRequest()->getParam('store_id'); 

for frontend

$store_id = Mage::app()->getStore()->getStoreId();
$current_cart_total_inc = Mage::getStoreConfig('general/custom_values/free_ship_threshold', $store_id);
9
  • There is no orderID as this is a shipping module, the order does not exist yet
    – Darren
    Jul 26, 2016 at 10:55
  • add the code for current store id you can check this Jul 26, 2016 at 10:58
  • That does not work as the storeID is returned as 0 as it is an admin order
    – Darren
    Jul 26, 2016 at 11:51
  • there is no store set for admin if you are creating the order then set the store by yourself. it work for frontend. Jul 26, 2016 at 11:53
  • 1
    Thanks, I fixed it with $store_id = Mage::app()->getRequest()->getParam('store_id'); $current_cart_total_inc = Mage::getStoreConfig('general/custom_values/free_ship_threshold', $store_id); Now the shipping modules work frontend and back
    – Darren
    Jul 27, 2016 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.