How to block free shipping method in frontend only in magento - magento

I am in a tensed situation. I am behind this for more than 1 day. Is there anyway to block showing free shipping method in checkout page, but showing it on admin panel page.
For eg: i purchased a product paying shipping charges for shipping method. But it is not delivered , In that case, through admin Panel, admin may able to reorder the same quote, free of cost and shipping charges, so free shipping method should show in admin panel. But When I enable that, this is shown on frontend also, so how can I block free shipping in frontend(customer checkout), but keeping it enable in admin panel.
I am sorry for poor English. I think, the example that i provided you make the question clear.
Thanks in advance.

Sure it is , just edit the shipping methods template and make a if condition by shipping method code or extend the shipping method and set the isActive method to distinct front and backend

Related

Magento 2 (v2.3) - Cart Page - Is it possible to get mage-cache-storage stored shipping amount in custom module plugin?

Is it possible to take the quote shipping amount in a custom module plugin when the user (tested with Guest User) is on the cart page? This should be possible for both guests and registered users.
I tried to get the quote shipping amount from the below class objects but the shipping amount is 0.
1. \Magento\Checkout\Model\Session
2. \Magento\Quote\Model\Cart\CartTotalRepository
3. \Magento\Quote\Model\QuoteFactory
It seems to be in this stage the shipping amount (selected/estimated shipping amount) is not stored in the quote table or checkout session but it is stored in the browser localStorage['mage-cache-storage']. I can see the shipping amount in browser localStorage['mage-cache-storage'] when I ran
JSON.parse(localStorage['mage-cache-storage']);
in-browser console terminal.
Any suggestions or thoughts will be appreciated.
Thanks :)
Yes, you can access the mage cache storage via knockout. You can find a usage of knockout to access mage-cache-storage from the below file. You can use this as a reference.
/vendor/magento/module-theme/view/frontend/templates/html/header.phtml

Change position of Billing address in Magento 2

I have to changed default billing address position which is coming under the payment information i need it after shipping method select , no after click on payment method.
I have tried lot of google and magneto docs but no luck with that.
Can any one please help me ?
Thanks.
Please note that it might not be technically possible (or at least not very easy) to have a customer enter it's address after the payment / shipping methods. This is because Magento loads it's payment- and shipping methods according to the address the customer has chosen.
Also, manipulating the (default) checkout page in Magento 2 is a very comprehensive task on itself and requires deep knowledge on how the theming and layout of Magento 2 works.

Different checkout pages based on product category in Magento

I am new to Magento .So please forgive me if I am asking something silly.
I am working on a Magento shop where I have a requirement that when I select some product in certain category say X, then I am redirected to one page checkout where I have default shipping method and do not want any payment method. i.e. Skip shipping and payment method step in chekout.
Whereas if I click some other categories then I get redirected to onepage checkout with shipping and payment option.
So basically what I need in form of code is -
if(category==X)
then Checkout without Shipping and payment method
else
Checkout with Shipping and Payment options.
As far as I have explored the magento structure , it is far too complex then other CMS. I am not able to even find files where i have to make changes in code. Anybody out there who can guide me for right approach toward the solution? Or is there any extension which fulfills such requirement?
Thanks in advance.
First, create the new payment method for the category (and shipping method if you need that too).
http://www.magentocommerce.com/wiki/5_-_modules_and_development/payment/create-payment-method-module
http://www.magentocommerce.com/wiki/5_-_modules_and_development/shipping/create-shipping-method-module
Then I would probably extend the controller, though you probably could also use an observer.
Extend magento core controller (Checkout/OnepageController)
Keep in mind that the customer may have products from another category in their cart, and what to do in that case.

magento How do I? manual order (backend) free shipping, actually pickup

magento How do I? manual order (backend) free shipping, actually pickup
Hi we want to be able to enter order in the adminhtml backend (we enter for customer).
Our problems are
1) the customer pays us cash. How do we enable this only for the backend (now we have to select credit card,- the option availbale on checkout)
2) The customer wants to pickup. But we dont want to offer this option to all customers via checkout. So this option is only available for us in the backend
Has anyone run into this before?
You can allow cash payment in the Model:
public function isAvailable($quote = null)
{
return (parent::isAvailable($quote) && Mage::app()->getStore()->isAdmin());
}
This will enable you payment method only in Admin.
For free shipping at backend, I suggest trying this free module. It gives you a option of adding a custom shipping rate while creating order at the backend, that you can always set to zero according to your needs.
http://www.magentocommerce.com/magento-connect/admin-custom-shipping-rate.html
As far as pay by cash is concerned, you can use the check/moneyorder payment method, and just hide the phtml code for this method on the frontend.

Magento custom save order

We have a custom discount option other than magento default discount/coupon option. In that customer can choose the full amount to be paid from their balance amount with the account.
So if they choose to pay the total amount then i want to skip the magento payment tab. In the custom action i have to save the order and redirect the checkout page customer to checkout success page. How can i do that. When i call order->save(), it throws error like " Should select a payment option."
Please help me to skip the payment option on checkout page
Rather than skipping that option entirely, creating a new payment type to pay from the account would probably be clearer to the customer. You could preselect that option for the customer, and keep the rest of the system intact.
Hope that helps!
Thanks,
Joe

Resources