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;
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
|
show 2 more comments
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
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 enableerror 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
|
show 2 more comments
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
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
magento-1.9.4.1
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 enableerror 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
|
show 2 more comments
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 enableerror 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
|
show 2 more comments
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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