Hot answers tagged

19

Let's say that you have the order id 10000015: So $orderId = '10000015'; $order = Mage::getModel('sales/order')->loadByIncrementId($orderId); $billingAddress = $order->getBillingAddress(); $shippingAddress = $order->getShippingAddress();


10

Use array_diff. $order = $invoice->getOrder(); $billing = $order->getBillingAddress()->getData(); $shipping = $order->getShippingAddress()->getData(); $diff = array_diff($billing,$shipping); ref: http://us3.php.net/array_diff you may have to strip out some of the data of each array, before the diff. I am sure you can work it out ;)


7

Even though there is already an accepted answer, I'd like to share this solution I saw (similar) once in a 3rd party module: function serializeAddress(Mage_Sales_Model_Quote_Address $address) { return serialize( array( 'firstname' => $address->getFirstname(), 'lastname' => $address->...


6

Go to Configuration -> General -> Country Options Select only a single country (your default country) Select all country for the field Postal Code is Optional for the following countries. Update eav_attribute table and set is_required = 0 if attribute_code = 'postcode' You can remove the Zip/Postal Code fields on templates. Replace Country fields with this: ...


5

Okay, so here's my attempt following ProxiBlue's suggestion: $excludeKeys = array('entity_id', 'customer_address_id', 'quote_address_id', 'region_id', 'customer_id', 'address_type'); $oBillingAddress = $order->getBillingAddress()->getData(); $oShippingAddress = $order->getShippingAddress()->getData(); $oBillingAddressFiltered = array_diff_key($...


4

Get shipping details by order id $order_id = 2314; //use your own order id $order = Mage::getModel("sales/order")->load($order_id); //load order by order id $shipping_address = $order->getShippingAddress(); echo $shipping_address->getTelephone(); echo $shipping_address->getPostcode(); //use print_r($shipping_address->getData()); to ...


4

The easiest way is definitely renaming Fax field into Mobile. To do so create (or edit if exists) locale/en_US/translate.csv file of your theme and add the following line: "Fax","Mobile" If you have different locale then English you have to create a directory with your locale code instead of en_US.


4

You are missing the inline javascript code that defines the billing variable. Compare the billing.phtml files in your current theme against the ones in: app\design\frontend\base\default\template\checkout\onepage\billing.phtml app\design\frontend\base\default\template\persistent\checkout\onepage\billing.phtml You should see similar to below: <...


4

Welcome to Magento.SE! I have thoroughly reviewed the codebase and the demo store at http://enterprise-demo.user.magentotrial.com/checkout/onepage/ and could not find evidence of a 'Define Order Date' field at all in Magento 1.9CE/1.14EE, or any prior version. Some troubleshooting tips: Disable all local modules by editing the app/etc/local.xml file and ...


3

You need to get the quote using $order = $invoice->getOrder(); $quote = Mage::getModel('sales/quote')->load($order->getQuoteId()); Then you can get the shipping address from the quote and check if it is marked as being the same as the billing address: if($quote->getShippingAddress()->getSameAsBilling()){ // do stuff }


3

I got the answer, Thanks Pradeepsanku, jQuery('#billing\\:country_id').val('CA'); // CA stands for the Canada jQuery('#billing\\:country_id').prop('disabled','disabled'); jQuery('#billing\\:region_id').val(76); // 76 stands for the Quebec jQuery('#billing\\:region_id').prop('disabled','disabled'); I changed the code form jQuery('#billing\\:region_id')....


3

After looking at the tutorial my guess is that this attribute is set as required when creating the attribute in the setup script. 'is_required' => 1, In Magento an address is simply an address if it is a shipping or billing magento does not really care on the customer address level, so if this attribute is required you would need to add it to both ...


3

Try clearing the checkout session. Mage::getSingleton('checkout/session')->clear();


3

I've managed to add extra lines in PayPal Standard cart using the paypal_prepare_line_items event. In your module's config.xml: <config> <global> <events> <paypal_prepare_line_items> <observers> <paypal_prepare_line_items> <class>...


2

The billing address is saved in the quote. If you look inside Mage_Checkout_Block_Onepage_Billing you will see how some of the magic happens inside of billing.phtml. Look specifically for the method getAddress() as it will show you what and how the class Mage_Sales_Model_Quote_Address is returned. I hope this helps.


2

Because I'm not sure what the use case is hopefully the following will help you. Add this to your billing.phtml file in your theme: <script> document.getElementById('billing:country_id').addEventListener('change',fireCustomController(this), false); function fireCustomController(elem){ new Ajax.Request('/your/custom/controller/country_id/'+elem....


2

Perhaps try $customer->loadByEmail($email); $session = Mage::getSingleton("customer/session"); $session->loginById($customer->getId()); $session->setCustomerAsLoggedIn($customer); Login into magento from outside of magento without ruining $_SESSION


2

Payflow Pro does not support Billing Agreements out of the box. We released an extension last year which adds a number of features to the list of things Magento can do with PayPal. Among other things the module enhances the out-of-the-box functionality to include support for credit card tokenization and using Billing agreements with Payflow Pro. Since it ...


2

The email field is made display:none in your OPC. That is the reason you can't go past billing address. Please check the screenshot This may be either you have applied display:none in CSS or maybe some third party module Jquery is conflicting due to which display:none is being applied.


2

a real easy fix will be doing it by css select.your_class_or_id_of_the_select_element option[value=""] { display :none; }


2

This should be enough as this is what happens when the form is submitted. submit : function(url){ if(this.validator && this.validator.validate()){ this.form.submit(); } return false; }, I would suggest that the validation is either set-up on items outside of the form or the validation is actually passing.


2

I think you are looking for a recurring profile, something already present in Magento. See this post for some more info and maybe delete this post later.


2

There is no in build function to list the customer address as div You have get the customer address by following code use the below code after this <?php echo $this->getAddressesHtmlSelect('billing') ?> and hide the address select box (i.e., Display:none) <?php $customerId = Mage::getSingleton('customer/session')->getCustomer();?> &...


2

By default magento system does not have region list for Portugal So that,you have seen this field as text area. Basically at directory_country_region table m agento save regions details respectively country.You need to insert Portugal regions details that table. For this case,you can flow the links as reference How add indian State? adding-county-...


2

You can achieve this from admin panel. There is no need of writing any code. Go to Admin Panel : Stores->Configuration->Sales->tax->Default Tax Destination Calculation. There you can select whatever countries or state you want to be showed.


2

That won't work with the existing endpoint. The webapi validates the request based on the phpdocs defined for the method in the service class. for Magento\Checkout\Api\ShippingInformationManagementInterface::saveAddressInformation the request/response requirements are: /** * @param int $cartId * @param \Magento\Checkout\Api\Data\...


2

I tracked down where the info is passed from php , I started at your file - Magento_Customer/js/model/address-list define([ 'ko', './customer-addresses' ], function (ko, defaultProvider) { 'use strict'; return ko.observableArray(defaultProvider.getAddressItems()); }); the defaultProvider here is /vendor/magento/module-customer/view/...


1

Hi instead of using sales_quote_save_after use sales_quote_address_save_after or sales_quote_address_save_before and youobserver code is wroong public function saveQuoteAfter($observer){ /* change here */ $addressObject=$observer->getEvent()->getQuoteAddress(); $quote = $observer->getEvent()->getQuoteAddress()->getQuote(); /...


1

No, this is not possible. And because you can't buy recurring items and normal items together, you can't either implement something which adds the simple item as recurring starting next month...


1

you can use the following code jQuery('#billing\\:country_id').val('CA'); // CA stands for the Canada jQuery('#billing\\:country_id').prop('disabled','disabled'); jQuery('#billing\\:region_id').val(76); // 76 stands for the Quebec jQuery('#billing\\:region_id').prop('disabled','disabled');


Only top voted, non community-wiki answers of a minimum length are eligible