How to Get Logged in Customer Data in Magento 2

You can use \Magento\Customer\Model\Session to get the current customer id. First import this class to get the customer session, after this you will be able to get the customer session data. Here is an example how to get the customer id from customer session – Magento 2 Get Current Customer Id Example: <?php namespace Tutorialsplane\HelloWorld\Controller\Index; class Index… Continue reading How to Get Logged in Customer Data in Magento 2

Published
Categorized as Magento

Uploading Digital Certificates

You can store and manage your digital certificates on the Digital Certificates page. To upload a new certificate: 1.Go to Setup > Company > Preferences > Certificates. 2.At the top of the page, click Create New. 3.In the New Certificate window, on the Details tab, enter a descriptive name for this certificate in the Name… Continue reading Uploading Digital Certificates

Downloading a file in PDF format from suitelet page

Requirement We need to download an invoice pdf from the listed invoices when clicking on the link provided against each line of invoices in suitelet page. Solution We can provide a suitelet link as download link. While clicking on the link, that particular invoice is downloaded in pdf format. This can be done by using… Continue reading Downloading a file in PDF format from suitelet page

Add google analytics code in magento2

To add google analytics code in Magento2Log in to Magento Backend On the Admin sidebar, go to Stores > Settings > Configuration. In the left panel, expand Sales and choose Google API. Expand  the Google Analytics section and do the following: Set Enable to Yes. Enter your Google Analytics Account Number. If you want to conduct A/B testing and other performance tests on your content, set Content Experiments to Yes. When complete, click Save Config.

Published
Categorized as Magento

Script for updating Sales Effective date

to customize the customer portal by automating the field named Sales Effective/ Shipping Date in the Sales Order.  When the Sales Rep must approve the SO, the Sales Effective/Shipping Date shall be applied. Depending on the Customer Price Level (e.g. OEM, Distributor, Dealer, Builder) there would be specific number of working days added to the… Continue reading Script for updating Sales Effective date

Issue when suitelet page redirects to Netsuite Login

Issue The suitelet page will redirect to netsuite login page when open by clicking on suitelet URL Solution The suitelet page will open without redirecting to Netsuite Login page when the returnExternalUrl is set to true while calling the suitelet script from any other scripts. Following is the code snippet to set it true.

Adding Images to Excel file

Description The format of the CSV file is as follows There is a client script which contains a function named getBase64Image.Within this function, we have created the HTML canvas element using document.createElement() and storing it inside the canvas variable. Since we want to draw an image on this canvas, which is a two-dimensional image, we… Continue reading Adding Images to Excel file

VAT 100 Report Shows Incorrect Amounts

VAT 100 Report shows incorrect amounts. Scenarios1. Amounts have increased for the period.2. Amounts for the previous periods have changed.3. The VAT 100 report may show net amount as VAT and the gross amount as Net Amount.4. Drill down reports may also show incorrect values. A possible reason for this is if the account is still using the… Continue reading VAT 100 Report Shows Incorrect Amounts