Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to hidden custom-shipping on frontent #1

Open
balack opened this issue Jan 25, 2016 · 3 comments
Open

How to hidden custom-shipping on frontent #1

balack opened this issue Jan 25, 2016 · 3 comments

Comments

@balack
Copy link

balack commented Jan 25, 2016

Thanks a lot for your extension. It works well in my new system. One question I have is that if it's possible just to expose the custom shipping to Admin interface only when making order, not front-end customer interfce?

@MagePsycho
Copy link
Owner

Yes you can. In Magento 1, you can do it simply by replacing the condition with
if (!$this->getConfigFlag('active') || !Mage::app()->getStore()->isAdmin()) {
from
https://github.com/MagePsycho/magento2-custom-shipping/blob/master/Model/Carrier/Customshipping.php#L65

So try to find the Mage::app()->getStore()->isAdmin() equivalent method in Magento 2 and add the same in above line.

@balack
Copy link
Author

balack commented Jan 27, 2016

Thank you!

I'm find equivalent method in Magento 2 and modify code

if (!$this->getConfigFlag('active') || ($this->getAreaCode() != \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE)) {
return false;
}

But it does not work, It's hide both frontend and admin

@MagePsycho
Copy link
Owner

Hi there,

OK, if you need my assistance on this will work on this and update you.
But you have wait for a day or so.

Regards

On Wed, Jan 27, 2016 at 9:01 AM, Balack Huynh [email protected]
wrote:

Thank you!

I'm find equivalent method in Magento 2 and modify code

if (!$this->getConfigFlag('active') ||
!$this->_state->setAreaCode('adminhtml')) {
return false;
}

But it does not work


Reply to this email directly or view it on GitHub
#1 (comment)
.


Thanks
Best Regards
Er. Rajendra K Bhatta

http://www.magentocommerce.com/certification/directory/dev/561/
http://www.zend.com/zce.php?c=ZEND013967&r=236487590

http://www.magentocommerce.com/magento-connect/developer/MagePsycho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants