Which block file calls for My Account page when it loads
I have written some helper functions, which does some database inserts
The problem is I am calling all these functions from my phtml
which gets loaded first time when My account
is loaded for the first time.
Due to this, the changes on databases doesn't reflect on the first go, when I reload my page again then I see those changes.
There must be some block file which loads before My account
phtml file so that I can call my helper function from that block file.
Where can I find those block files/ controller files of My Account
and how can i call my helper function from those
Right now i am calling my helper function from my phtml like this:-
$temp_block = $this->getLayout()->createBlock('YXCatalogBlockOrderHelper');
$customerHelper = $this->helper('YXCustomerHelperCustomerHelper');
if (!($customerHelper->isCustomer())){
$customerID = $customerHelper->getCustomerId();
$orderId = $customerHelper->getOrderId();
$temp_block->guestToCustomer($orderId,$customerID);
}
magento2 blocks controllers customer-account phtml
add a comment |
I have written some helper functions, which does some database inserts
The problem is I am calling all these functions from my phtml
which gets loaded first time when My account
is loaded for the first time.
Due to this, the changes on databases doesn't reflect on the first go, when I reload my page again then I see those changes.
There must be some block file which loads before My account
phtml file so that I can call my helper function from that block file.
Where can I find those block files/ controller files of My Account
and how can i call my helper function from those
Right now i am calling my helper function from my phtml like this:-
$temp_block = $this->getLayout()->createBlock('YXCatalogBlockOrderHelper');
$customerHelper = $this->helper('YXCustomerHelperCustomerHelper');
if (!($customerHelper->isCustomer())){
$customerID = $customerHelper->getCustomerId();
$orderId = $customerHelper->getOrderId();
$temp_block->guestToCustomer($orderId,$customerID);
}
magento2 blocks controllers customer-account phtml
add a comment |
I have written some helper functions, which does some database inserts
The problem is I am calling all these functions from my phtml
which gets loaded first time when My account
is loaded for the first time.
Due to this, the changes on databases doesn't reflect on the first go, when I reload my page again then I see those changes.
There must be some block file which loads before My account
phtml file so that I can call my helper function from that block file.
Where can I find those block files/ controller files of My Account
and how can i call my helper function from those
Right now i am calling my helper function from my phtml like this:-
$temp_block = $this->getLayout()->createBlock('YXCatalogBlockOrderHelper');
$customerHelper = $this->helper('YXCustomerHelperCustomerHelper');
if (!($customerHelper->isCustomer())){
$customerID = $customerHelper->getCustomerId();
$orderId = $customerHelper->getOrderId();
$temp_block->guestToCustomer($orderId,$customerID);
}
magento2 blocks controllers customer-account phtml
I have written some helper functions, which does some database inserts
The problem is I am calling all these functions from my phtml
which gets loaded first time when My account
is loaded for the first time.
Due to this, the changes on databases doesn't reflect on the first go, when I reload my page again then I see those changes.
There must be some block file which loads before My account
phtml file so that I can call my helper function from that block file.
Where can I find those block files/ controller files of My Account
and how can i call my helper function from those
Right now i am calling my helper function from my phtml like this:-
$temp_block = $this->getLayout()->createBlock('YXCatalogBlockOrderHelper');
$customerHelper = $this->helper('YXCustomerHelperCustomerHelper');
if (!($customerHelper->isCustomer())){
$customerID = $customerHelper->getCustomerId();
$orderId = $customerHelper->getOrderId();
$temp_block->guestToCustomer($orderId,$customerID);
}
magento2 blocks controllers customer-account phtml
magento2 blocks controllers customer-account phtml
asked 22 mins ago
summusummu
538
538
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
A page can be single or combination of mutiple templates ie., phtml and each templates represent a block.
And here in this question you were asking for customer account section which contains title, sidebar, customer information and address information etc..,
So each of which is rendering from different templates and obviously different blocks as well.
MagentoThemeBlockHtmlTitle.php - Title
and
MagentoCustomerBlockAccountDashboardInfo.php - Dashboard Info
and for customer address section
MagentoCustomerBlockAccountDashboardAddress.php - Address Book Section
If you want to know the templates and block which loads in a page means, try this option
Login to Admin -> go to Stores->Configuration->Advanced->Developer->on the right side section ->Debug -> Enabled Template Path Hints for Storefront and Add Block Class Type to Hints then refresh then frontend it will display the path hints of files which exist there.
Hope this helps,
Peace :)
add a comment |
If you are talking about the dashboard page, Then please open on the layout filed
vendor/magento/module-customer/view/frontend/layout/customer_account_index.xml
vendor/magento/module-customer/view/frontend/layout/customer_account.xml
Here Magento mention, it is a list of file which is loaded for the customer dashboard page.
Also, I don't understand, what you have tried to achieve. But on the fly update customer data and get that data update on the same execution is not a good idea.
And PHP is server-side language, So the content of the page is not updated yet until next execution of the same page. So suggest to update content using AJAX and Implement the private content.
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%2f262175%2fwhich-block-file-calls-for-my-account-page-when-it-loads%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
A page can be single or combination of mutiple templates ie., phtml and each templates represent a block.
And here in this question you were asking for customer account section which contains title, sidebar, customer information and address information etc..,
So each of which is rendering from different templates and obviously different blocks as well.
MagentoThemeBlockHtmlTitle.php - Title
and
MagentoCustomerBlockAccountDashboardInfo.php - Dashboard Info
and for customer address section
MagentoCustomerBlockAccountDashboardAddress.php - Address Book Section
If you want to know the templates and block which loads in a page means, try this option
Login to Admin -> go to Stores->Configuration->Advanced->Developer->on the right side section ->Debug -> Enabled Template Path Hints for Storefront and Add Block Class Type to Hints then refresh then frontend it will display the path hints of files which exist there.
Hope this helps,
Peace :)
add a comment |
A page can be single or combination of mutiple templates ie., phtml and each templates represent a block.
And here in this question you were asking for customer account section which contains title, sidebar, customer information and address information etc..,
So each of which is rendering from different templates and obviously different blocks as well.
MagentoThemeBlockHtmlTitle.php - Title
and
MagentoCustomerBlockAccountDashboardInfo.php - Dashboard Info
and for customer address section
MagentoCustomerBlockAccountDashboardAddress.php - Address Book Section
If you want to know the templates and block which loads in a page means, try this option
Login to Admin -> go to Stores->Configuration->Advanced->Developer->on the right side section ->Debug -> Enabled Template Path Hints for Storefront and Add Block Class Type to Hints then refresh then frontend it will display the path hints of files which exist there.
Hope this helps,
Peace :)
add a comment |
A page can be single or combination of mutiple templates ie., phtml and each templates represent a block.
And here in this question you were asking for customer account section which contains title, sidebar, customer information and address information etc..,
So each of which is rendering from different templates and obviously different blocks as well.
MagentoThemeBlockHtmlTitle.php - Title
and
MagentoCustomerBlockAccountDashboardInfo.php - Dashboard Info
and for customer address section
MagentoCustomerBlockAccountDashboardAddress.php - Address Book Section
If you want to know the templates and block which loads in a page means, try this option
Login to Admin -> go to Stores->Configuration->Advanced->Developer->on the right side section ->Debug -> Enabled Template Path Hints for Storefront and Add Block Class Type to Hints then refresh then frontend it will display the path hints of files which exist there.
Hope this helps,
Peace :)
A page can be single or combination of mutiple templates ie., phtml and each templates represent a block.
And here in this question you were asking for customer account section which contains title, sidebar, customer information and address information etc..,
So each of which is rendering from different templates and obviously different blocks as well.
MagentoThemeBlockHtmlTitle.php - Title
and
MagentoCustomerBlockAccountDashboardInfo.php - Dashboard Info
and for customer address section
MagentoCustomerBlockAccountDashboardAddress.php - Address Book Section
If you want to know the templates and block which loads in a page means, try this option
Login to Admin -> go to Stores->Configuration->Advanced->Developer->on the right side section ->Debug -> Enabled Template Path Hints for Storefront and Add Block Class Type to Hints then refresh then frontend it will display the path hints of files which exist there.
Hope this helps,
Peace :)
answered 6 mins ago
G PrathapG Prathap
356113
356113
add a comment |
add a comment |
If you are talking about the dashboard page, Then please open on the layout filed
vendor/magento/module-customer/view/frontend/layout/customer_account_index.xml
vendor/magento/module-customer/view/frontend/layout/customer_account.xml
Here Magento mention, it is a list of file which is loaded for the customer dashboard page.
Also, I don't understand, what you have tried to achieve. But on the fly update customer data and get that data update on the same execution is not a good idea.
And PHP is server-side language, So the content of the page is not updated yet until next execution of the same page. So suggest to update content using AJAX and Implement the private content.
add a comment |
If you are talking about the dashboard page, Then please open on the layout filed
vendor/magento/module-customer/view/frontend/layout/customer_account_index.xml
vendor/magento/module-customer/view/frontend/layout/customer_account.xml
Here Magento mention, it is a list of file which is loaded for the customer dashboard page.
Also, I don't understand, what you have tried to achieve. But on the fly update customer data and get that data update on the same execution is not a good idea.
And PHP is server-side language, So the content of the page is not updated yet until next execution of the same page. So suggest to update content using AJAX and Implement the private content.
add a comment |
If you are talking about the dashboard page, Then please open on the layout filed
vendor/magento/module-customer/view/frontend/layout/customer_account_index.xml
vendor/magento/module-customer/view/frontend/layout/customer_account.xml
Here Magento mention, it is a list of file which is loaded for the customer dashboard page.
Also, I don't understand, what you have tried to achieve. But on the fly update customer data and get that data update on the same execution is not a good idea.
And PHP is server-side language, So the content of the page is not updated yet until next execution of the same page. So suggest to update content using AJAX and Implement the private content.
If you are talking about the dashboard page, Then please open on the layout filed
vendor/magento/module-customer/view/frontend/layout/customer_account_index.xml
vendor/magento/module-customer/view/frontend/layout/customer_account.xml
Here Magento mention, it is a list of file which is loaded for the customer dashboard page.
Also, I don't understand, what you have tried to achieve. But on the fly update customer data and get that data update on the same execution is not a good idea.
And PHP is server-side language, So the content of the page is not updated yet until next execution of the same page. So suggest to update content using AJAX and Implement the private content.
answered 6 mins ago
Amit Bera♦Amit Bera
58.2k1475174
58.2k1475174
add a comment |
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%2f262175%2fwhich-block-file-calls-for-my-account-page-when-it-loads%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