Mage::getModel('customer/address') broke the systemOnepage Checkout, unable to save billing address getting Prototype.js error after 1.9.4.1 upgrade

Spoken encryption

What is the max number of outlets on a GFCI circuit?

Is it legal to use cash pulled from a credit card to pay the monthly payment on that credit card?

Why no ";" after "do" in sh loops?

Character is called by their first initial. How do I write it?

Timing/Stack question about abilities triggered during combat

What is a leading question?

What should I say when a company asks you why someone (a friend) who was fired left?

What do I do when a student working in my lab "ghosts" me?

Inadvertently nuked my disk permission structure - why?

Why are off grid solar setups only 12, 24, 48 VDC?

Invert Some Switches on a Switchboard

Send a single HTML email from Thunderbird, overriding the default "plain text" setting

Is there a reason why I should not use the HaveIBeenPwned API to warn users about exposed passwords?

Is it legal for private citizens to "impound" e-scooters?

Automatic Habit of Meditation

What exactly makes a General Products hull nearly indestructible?

Knights fighting a steam locomotive they believe is a dragon

How do professional electronic musicians/sound engineers combat listening fatigue?

kids pooling money for Lego League and taxes

Reduce column width of table while also aligning values at decimal point

Trapped in an ocean Temple in Minecraft?

Iterate over non-const variables in C++

How can I receive packages while in France?



Mage::getModel('customer/address') broke the system


Onepage Checkout, unable to save billing address getting Prototype.js error after 1.9.4.1 upgrade






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I was developing a custom shipping module using




Mage::getModel('customer/address')->getCollection()->setCustomerFilter($sellerIDVar)




Using this code broke the page or module. Could you please anybody find the problem ?



I'm using Magento 1.9.4.1



EDIT




I wanted the default billing or default shipping address set of the customer. So when i get the collection with entity_type_id filtered, theres no address !!!



And when i use the Load method, i get all addresses of the customer. So im in trouble with both methods.



helps solicited dears.










share|improve this question
























  • is there any error in log Or page ?

    – Pawan
    Jul 17 at 1:34











  • @Pawan, no i dont have any log as my system has some error with logging.

    – Bineesh Kumar
    Jul 17 at 1:59











  • You can enable error reporting from index.php to see exact error.

    – Pawan
    Jul 17 at 2:12











  • dont use setCustomerFilter, just use ->addFieldToFilter('parent_id',$customer_id)

    – leo
    Jul 17 at 2:35











  • @leo you are right, I suggest you add this in answer instead of comments

    – Shoaib Munir
    Jul 17 at 5:07

















-1















I was developing a custom shipping module using




Mage::getModel('customer/address')->getCollection()->setCustomerFilter($sellerIDVar)




Using this code broke the page or module. Could you please anybody find the problem ?



I'm using Magento 1.9.4.1



EDIT




I wanted the default billing or default shipping address set of the customer. So when i get the collection with entity_type_id filtered, theres no address !!!



And when i use the Load method, i get all addresses of the customer. So im in trouble with both methods.



helps solicited dears.










share|improve this question
























  • is there any error in log Or page ?

    – Pawan
    Jul 17 at 1:34











  • @Pawan, no i dont have any log as my system has some error with logging.

    – Bineesh Kumar
    Jul 17 at 1:59











  • You can enable error reporting from index.php to see exact error.

    – Pawan
    Jul 17 at 2:12











  • dont use setCustomerFilter, just use ->addFieldToFilter('parent_id',$customer_id)

    – leo
    Jul 17 at 2:35











  • @leo you are right, I suggest you add this in answer instead of comments

    – Shoaib Munir
    Jul 17 at 5:07













-1












-1








-1








I was developing a custom shipping module using




Mage::getModel('customer/address')->getCollection()->setCustomerFilter($sellerIDVar)




Using this code broke the page or module. Could you please anybody find the problem ?



I'm using Magento 1.9.4.1



EDIT




I wanted the default billing or default shipping address set of the customer. So when i get the collection with entity_type_id filtered, theres no address !!!



And when i use the Load method, i get all addresses of the customer. So im in trouble with both methods.



helps solicited dears.










share|improve this question
















I was developing a custom shipping module using




Mage::getModel('customer/address')->getCollection()->setCustomerFilter($sellerIDVar)




Using this code broke the page or module. Could you please anybody find the problem ?



I'm using Magento 1.9.4.1



EDIT




I wanted the default billing or default shipping address set of the customer. So when i get the collection with entity_type_id filtered, theres no address !!!



And when i use the Load method, i get all addresses of the customer. So im in trouble with both methods.



helps solicited dears.







magento-1.9.4.1






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 17 at 18:12







Bineesh Kumar

















asked Jul 16 at 23:35









Bineesh KumarBineesh Kumar

32 bronze badges




32 bronze badges












  • is there any error in log Or page ?

    – Pawan
    Jul 17 at 1:34











  • @Pawan, no i dont have any log as my system has some error with logging.

    – Bineesh Kumar
    Jul 17 at 1:59











  • You can enable error reporting from index.php to see exact error.

    – Pawan
    Jul 17 at 2:12











  • dont use setCustomerFilter, just use ->addFieldToFilter('parent_id',$customer_id)

    – leo
    Jul 17 at 2:35











  • @leo you are right, I suggest you add this in answer instead of comments

    – Shoaib Munir
    Jul 17 at 5:07

















  • is there any error in log Or page ?

    – Pawan
    Jul 17 at 1:34











  • @Pawan, no i dont have any log as my system has some error with logging.

    – Bineesh Kumar
    Jul 17 at 1:59











  • You can enable error reporting from index.php to see exact error.

    – Pawan
    Jul 17 at 2:12











  • dont use setCustomerFilter, just use ->addFieldToFilter('parent_id',$customer_id)

    – leo
    Jul 17 at 2:35











  • @leo you are right, I suggest you add this in answer instead of comments

    – Shoaib Munir
    Jul 17 at 5:07
















is there any error in log Or page ?

– Pawan
Jul 17 at 1:34





is there any error in log Or page ?

– Pawan
Jul 17 at 1:34













@Pawan, no i dont have any log as my system has some error with logging.

– Bineesh Kumar
Jul 17 at 1:59





@Pawan, no i dont have any log as my system has some error with logging.

– Bineesh Kumar
Jul 17 at 1:59













You can enable error reporting from index.php to see exact error.

– Pawan
Jul 17 at 2:12





You can enable error reporting from index.php to see exact error.

– Pawan
Jul 17 at 2:12













dont use setCustomerFilter, just use ->addFieldToFilter('parent_id',$customer_id)

– leo
Jul 17 at 2:35





dont use setCustomerFilter, just use ->addFieldToFilter('parent_id',$customer_id)

– leo
Jul 17 at 2:35













@leo you are right, I suggest you add this in answer instead of comments

– Shoaib Munir
Jul 17 at 5:07





@leo you are right, I suggest you add this in answer instead of comments

– Shoaib Munir
Jul 17 at 5:07










1 Answer
1






active

oldest

votes


















0














Use below code instead of your code, if you want to use same line of statement then @leo comment is right. you should use addFieldToFilter('parent_id',$sellerIDVar). I prefer you follow below code in order to fetch customer address info.



The address information is stored within the Mage_Customer_Model_Customer so you should be able to create an instance of it with the customer id.



$customer = Mage::getModel('customer/customer')->load($sellerIDVar);


Then depending on the type of address that you are looking for you should be able to call one of the following functions.




Primary Billing Address:




$customer->getPrimaryBillingAddress(); 



Primary Shipping Address:




$customer->getPrimaryShippingAddress(); 



General Address Selection:




$customer->getAddressItemById();


I hope this will help






share|improve this answer

























  • Thank you, but this returns all address of the customer.

    – Bineesh Kumar
    Jul 17 at 17:55











  • this didnt help atall. sorry.

    – Bineesh Kumar
    Jul 17 at 20:56











  • You declare the $sellerIDVar variable. So I assume $sellerIDVar containing customer Id. You pass the correct customer Id to $customer = Mage::getModel('customer/customer')->load($sellerIDVar); it will return specific customer

    – Muhammad Hasham
    Jul 18 at 5:25













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282296%2fmagegetmodelcustomer-address-broke-the-system%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Use below code instead of your code, if you want to use same line of statement then @leo comment is right. you should use addFieldToFilter('parent_id',$sellerIDVar). I prefer you follow below code in order to fetch customer address info.



The address information is stored within the Mage_Customer_Model_Customer so you should be able to create an instance of it with the customer id.



$customer = Mage::getModel('customer/customer')->load($sellerIDVar);


Then depending on the type of address that you are looking for you should be able to call one of the following functions.




Primary Billing Address:




$customer->getPrimaryBillingAddress(); 



Primary Shipping Address:




$customer->getPrimaryShippingAddress(); 



General Address Selection:




$customer->getAddressItemById();


I hope this will help






share|improve this answer

























  • Thank you, but this returns all address of the customer.

    – Bineesh Kumar
    Jul 17 at 17:55











  • this didnt help atall. sorry.

    – Bineesh Kumar
    Jul 17 at 20:56











  • You declare the $sellerIDVar variable. So I assume $sellerIDVar containing customer Id. You pass the correct customer Id to $customer = Mage::getModel('customer/customer')->load($sellerIDVar); it will return specific customer

    – Muhammad Hasham
    Jul 18 at 5:25















0














Use below code instead of your code, if you want to use same line of statement then @leo comment is right. you should use addFieldToFilter('parent_id',$sellerIDVar). I prefer you follow below code in order to fetch customer address info.



The address information is stored within the Mage_Customer_Model_Customer so you should be able to create an instance of it with the customer id.



$customer = Mage::getModel('customer/customer')->load($sellerIDVar);


Then depending on the type of address that you are looking for you should be able to call one of the following functions.




Primary Billing Address:




$customer->getPrimaryBillingAddress(); 



Primary Shipping Address:




$customer->getPrimaryShippingAddress(); 



General Address Selection:




$customer->getAddressItemById();


I hope this will help






share|improve this answer

























  • Thank you, but this returns all address of the customer.

    – Bineesh Kumar
    Jul 17 at 17:55











  • this didnt help atall. sorry.

    – Bineesh Kumar
    Jul 17 at 20:56











  • You declare the $sellerIDVar variable. So I assume $sellerIDVar containing customer Id. You pass the correct customer Id to $customer = Mage::getModel('customer/customer')->load($sellerIDVar); it will return specific customer

    – Muhammad Hasham
    Jul 18 at 5:25













0












0








0







Use below code instead of your code, if you want to use same line of statement then @leo comment is right. you should use addFieldToFilter('parent_id',$sellerIDVar). I prefer you follow below code in order to fetch customer address info.



The address information is stored within the Mage_Customer_Model_Customer so you should be able to create an instance of it with the customer id.



$customer = Mage::getModel('customer/customer')->load($sellerIDVar);


Then depending on the type of address that you are looking for you should be able to call one of the following functions.




Primary Billing Address:




$customer->getPrimaryBillingAddress(); 



Primary Shipping Address:




$customer->getPrimaryShippingAddress(); 



General Address Selection:




$customer->getAddressItemById();


I hope this will help






share|improve this answer















Use below code instead of your code, if you want to use same line of statement then @leo comment is right. you should use addFieldToFilter('parent_id',$sellerIDVar). I prefer you follow below code in order to fetch customer address info.



The address information is stored within the Mage_Customer_Model_Customer so you should be able to create an instance of it with the customer id.



$customer = Mage::getModel('customer/customer')->load($sellerIDVar);


Then depending on the type of address that you are looking for you should be able to call one of the following functions.




Primary Billing Address:




$customer->getPrimaryBillingAddress(); 



Primary Shipping Address:




$customer->getPrimaryShippingAddress(); 



General Address Selection:




$customer->getAddressItemById();


I hope this will help







share|improve this answer














share|improve this answer



share|improve this answer








edited Jul 18 at 5:26

























answered Jul 17 at 5:27









Muhammad HashamMuhammad Hasham

5,72610 gold badges31 silver badges80 bronze badges




5,72610 gold badges31 silver badges80 bronze badges












  • Thank you, but this returns all address of the customer.

    – Bineesh Kumar
    Jul 17 at 17:55











  • this didnt help atall. sorry.

    – Bineesh Kumar
    Jul 17 at 20:56











  • You declare the $sellerIDVar variable. So I assume $sellerIDVar containing customer Id. You pass the correct customer Id to $customer = Mage::getModel('customer/customer')->load($sellerIDVar); it will return specific customer

    – Muhammad Hasham
    Jul 18 at 5:25

















  • Thank you, but this returns all address of the customer.

    – Bineesh Kumar
    Jul 17 at 17:55











  • this didnt help atall. sorry.

    – Bineesh Kumar
    Jul 17 at 20:56











  • You declare the $sellerIDVar variable. So I assume $sellerIDVar containing customer Id. You pass the correct customer Id to $customer = Mage::getModel('customer/customer')->load($sellerIDVar); it will return specific customer

    – Muhammad Hasham
    Jul 18 at 5:25
















Thank you, but this returns all address of the customer.

– Bineesh Kumar
Jul 17 at 17:55





Thank you, but this returns all address of the customer.

– Bineesh Kumar
Jul 17 at 17:55













this didnt help atall. sorry.

– Bineesh Kumar
Jul 17 at 20:56





this didnt help atall. sorry.

– Bineesh Kumar
Jul 17 at 20:56













You declare the $sellerIDVar variable. So I assume $sellerIDVar containing customer Id. You pass the correct customer Id to $customer = Mage::getModel('customer/customer')->load($sellerIDVar); it will return specific customer

– Muhammad Hasham
Jul 18 at 5:25





You declare the $sellerIDVar variable. So I assume $sellerIDVar containing customer Id. You pass the correct customer Id to $customer = Mage::getModel('customer/customer')->load($sellerIDVar); it will return specific customer

– Muhammad Hasham
Jul 18 at 5:25

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282296%2fmagegetmodelcustomer-address-broke-the-system%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form