for adding breadcrumbs to each page , each page needs an action for the link. here is an example adding breadcrumbs to customer account pages sign in and sign up pages. For that we have to add the code into customer_account_create.xml inside Magento_Customer module it can also added using an external module : https://github.com/karliuka/m2.Breadcrumbs Refer… Continue reading Adding Breadcrumbs to Magento My account Page.
Category: Magento
RequireJS in Magento
requirejs-config.js uses for creating the JavaScript resources mapping. We can find all require configs under: pub/static/_requirejs. As far as I know, the correct way to load our custom script via Require Js: using template to call our script. We will create new template with Magento\Framework\View\Element\Template its block class. If we want to load js files on all pages and don’t… Continue reading RequireJS in Magento
How to Get Attribute Code using Attribute Id in Magento 2
Method 1 (Construct Method): Method 2 (Object Manager):
How to expose a custom field from the sales_order table to the rest api?
Suppose you have a custom field delivery_type in the sales_order table. You are accessing order using rest Api but this field is not present in the response. Requested API: http://localhost/default/rest/default/V1/orders/{order_id} You can get it working for individual orders. Though if you want to show this attribute in order collection as well you have to modify getList the method also. You have to create… Continue reading How to expose a custom field from the sales_order table to the rest api?
How to use Customer Account sidebar menu on custom page
Step 1: Create a file in your theme Before making any customization, the first thing you would have to do is create a customer_account.xml in your theme. Follow this: Step 2: Add Custom Link In this step, the only thing that you would have to do is adding this code to your layout xml file: and it… Continue reading How to use Customer Account sidebar menu on custom page
Adding Stripe and Eway Payment method to magento 2
You will need a Magento Marketplace account, you can then link the account to your Magento 2 store and add the free eWAY and Stripe Magento 2 extension to your account. After that we use composer to install both these modules. In the Magento 2 directory, run the command (note, please ensure you are using… Continue reading Adding Stripe and Eway Payment method to magento 2
For the previously purchased customer needs to show the same price he is purchased on all the time on the website
If a customer purchased a product at the price 100 and then the price of that product has been changed to 200. But whenever the customer visits the website, for them it needs to display the price as same they purchased previous time. For this requirement, we need to set product prices based on the… Continue reading For the previously purchased customer needs to show the same price he is purchased on all the time on the website
Access denied for user ‘root’@’localhost’ (using password: NO) – what’s wrong?
Change the file my.cnf (in my Ubuntu-system he is placed at /etc/mysql/my.cnf). In the end add this code: That’s helps enter in condole as anyone user without pass. Restart the server: sudo service mysql restart Enter in the mysql-console: Change the password for user root: exit the console: Remove (or use commentary) for that in… Continue reading Access denied for user ‘root’@’localhost’ (using password: NO) – what’s wrong?
Trigger the share functionality in local browsers on smartphones via HTML or JavaScript
Adding css to a new overridden module in the design folder
Create a web folder inside the module folder and create the css file inside the folder like Vendor_Module/web/css. After that link the css in the layout file of the current module it may be in the default.xml or name_index_index.xml file. the following code will be pasted in the head area of the xml file