Magento and onepage checkout - magento

I am using Magento and I'm trying to fix a small issue I have with the OnePageCheckout.
I have a single Billing Address and a single Shipping Address, which are both fine.
When selecting a New Address under Shipping Information, I'd expect the form to be reset, instead it uses the default Shipping Address
It just seems odd that you add a New Address and it is pre-populated wit an adress already.
if this is something Magento does out of the box and if so, is there a file(s) I'd need to change?
Many thanks

I had to hack a js file and add Field.clear('billing:firstname') etc etc so that these fields would be cleared whenever resetSelectedAddress was called

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

USPS not showing in Magento storefront for some stores

We're using Magento version 1.9.0.1 to house multiple websites/stores (setup via API). Recently, we noticed that some of the newly added stores does not display USPS in the shopping cart even though all of them follow the same configuration. Products have been verified to have the weight value entered. Toggled on/off other shipping methods, e.g. UPS, and they worked fine. Cache had been cleared and deleted as well. Logs do not indicate any issue pertaining to shipping methods.
What else could we check?
USPS Setting:
Found the issue. We have a separate database that contains store information including ship-from address. Affected stores have country set to 'United States of America' while the rest have plain 'US'. Updated the value to 'US' for all stores and that fixed it.

Magento Hooks - Will Magento allow me to do this?

I'm going to be starting a E-Commerce project and the client is interested in using Magento. In this project, when a customer adds something to the cart, I'll need to pull them out of the flow, where they'll proceed through a custom wizard-esque area.
They basically design a document using a drag and drop interface. After they finish, that document will be saved as a PDF, and I want them redirected to checkout
So my questions are
Does Magento have hooks available for after an item is added to the
cart ?
If I pull them away to this other section of the site (Wizard
portion), changes they make will potentially add costs to
their cart. Would I still have access to products, prices, and the
cart so that I can continue to modify their cart until they return
to checkout ?
Magento users Event-Observer pattern, where you can hook into virtually any action which is performed and execute your custom code,
Refer to below links,
http://inchoo.net/category/ecommerce/magento/events-observers/
https://gist.github.com/peterjaap/6973324
http://huztechbuzz.wordpress.com/2014/04/26/complete-list-of-all-events-in-magento/
http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/
So you have to figure out which event you can use and plugin your custom code.
As long as i remember all the cart info ( products/prices ) is stored in the $_SESSION. So you can get all the information from there you need, modify it via your so-called wizzard and udpate the session information after that!
Cheers! :)

Magento fixed shipping address on pickup

I'm in need of help to locate the place, where I can set up an fixed shipping address for pick-ups.. I want our company's adress to be printed on the order confirmation, instead of the customers own adress.
But I cannot seem to locate the right spot to do so, maby a custom deliverymethod is needed?
You can use Javascript on the server side and Observers sales_order_place_before that will check for the payment method and adjust the address based on this

Uncheck/Disable checked "Same as Billing Address" in magento 1.5

Basically, I've been trying to remove the checked box when I go to the following.
Sales > Order > View a completed order > Click Re-Order and then I see the SHIPPING ADDRESS has a checkbox which is already checked SAME AS BILLING ADDRESS. I want to uncheck the box and disable this function.
Please let me know how I can do this is the simplest way possible.
Magento Version 1.5.0.1
I found this and it worked perfect.
http://www.12live.de/de/blog/magento/magento-create-order-in-backend-set-default-value-of-delivery-address-checkbox-same-as-billing-to-unchecked/
If you create an order in the backend by default the delivery method checkbox "Same as billing" is checked.
If the customer has different billing and shipping address this is problematic. In the dop down the shipping address is shown. But due to the checkbox the shown shipping address is ignored and the billing address wil be used for delivery. If you want the checkbox to be unchecked by default the following modification is needed. Recommended is to copy the file from the core to the local code pool and modifiy it there. The file in question is core/Mage/Sales/Model/Quote/adress.php. You need to change line 124 to:
$this->setSameAsBilling(0);

Resources