Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer Section Data not present after redirect? #12673

Closed
SantoDE opened this issue Dec 13, 2017 · 4 comments
Closed

Customer Section Data not present after redirect? #12673

SantoDE opened this issue Dec 13, 2017 · 4 comments
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@SantoDE
Copy link

SantoDE commented Dec 13, 2017

Preconditions

  1. Magento 2.2.2, PHP 7.11, MariaDB-10.2.7 etc

Steps to reproduce

  1. Get a redirect doesnt matter what action (e.g. changing language)

Expected result

  1. Magento_Customer/js/view/customer.customer() should be present

Actual result

  1. It's empty, though its present in the buffer

I have the problem that after a redirect, in my custom.js (see bewlow) I can not access the customer details anymore. They are just undefined. Before the redirect, everything worked out.

  'jquery',
  'uiComponent',
  'Magento_Customer/js/view/customer'
], function($, Component, customerView) {
  "use strict";
  return Component.extend({
    initialize: function () {
      this._super();
      this.originalPrice = "";
      this.finalPrice = "";
      this.isLoggedIn = 0;

      this.observe([
        'originalPrice',
        'finalPrice'
      ]);


      console.log("view");
      console.log(customerView());
      var customer = customerView().customer;

      console.log("customer");
      console.log(customer());

      if(customer().fullname) {
        this.isLoggedIn = customer().fullname.length;
      }

      var productId = this.productId;
      var that = this;
      
      if (productId > 0 && this.isLoggedIn > 0) {
        $.get(this.ajaxUrl, {product: productId})
            .done(function(response) {
              var prices = JSON.parse(response);
              that.originalPrice(prices["original_price"] + " \u20AC");
              that.finalPrice(prices["final_price"] + " \u20AC");
            })
        }
      },
  })
});
@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Dec 13, 2017
@koenner01
Copy link
Contributor

koenner01 commented Mar 1, 2018

We are having a similar problem when logging in; The first you arrive on doesn't contain the customer (eventhough it clearly should as you just logged in), if you refresh the page will then contain the customer correctly

@magento-engcom-team
Copy link
Contributor

@SantoDE , thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation or latest release.

@koenner01
Copy link
Contributor

might be related #13984 ?

@magento-engcom-team
Copy link
Contributor

@SantoDE, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

3 participants