Magento 2 rest api
Today we discuss the Magento 2 rest API. API is also called web services. API stands for the Application programming interface Proccess of the prodcut add to cart usign rest API Create customer token Create an empty cart/quote using the token Add to product to the cart Fetch cart details Fetch cart totals Apply coupon […]
Add Product With Custom Options To Cart Graphql in Magento 2
Add product to cart GraphQL Magento 2 Add product to cart GraphQL Magento 2 or Add Simple Product With Custom Options To Cart in Magento2 Method Post AUTHORIZATION Bearer Token BODY graphql mutation { addSimpleProductsToCart( input: { cart_id: “ctxNWM4yYu4udYCUm8TSeXZOdv7VXv72” cart_items: [ { data: { quantity: 1 sku: “test” } customizable_options: { id: 16, value_string: “28” […]
Increase windows speed in 10 steps
Today we tell you to increase window speed in 10 steps Windows is the most used operating system. Please follow below spets carefully to get best performance of the windows. 1. Make your system is up-to-date Find new updates in the window Settings menu ->Windows Update -> Check for updates.If an update is available, you […]
Add color swatches in Shopify
Today we discuss the add color swatches using metafields in Shopify.We will create two metafields one for color code and one for the product.In product, metafield assigns the products and adds colors into the color code metafield.In my case colour_code for the color code and colour_swaches for the products. 1) In Shopify, you can find […]
How to create custom section in shopify
Today we discuss to create a custom section in Shopify.Sometimes we want to display some extra content dynamically. Steps to create section: 1) From Shopify admin, go to Online Store > Themes.2) Find the theme you want to edit and click Actions > Edit code.3) Go to Sections > Add a new section > Enter […]
Top 10 css interview questions
Full form of the CSS if Cascading Style Sheets 1) Types of CSS a. Inlineb. Internal or Embeddedc. External a. Inline This style is specified within the HTML tag using the style attribute.Example <p style=”color:red”>Hello</p> b. Internal or Embedded The CSS placed inside the HTML page.Example <p>Hello</p> <style> p{ color:red } </style> c. External External […]
Top 5 image optimizer tools
Today we share the top 5 image optimizer tools which are used for the reduced size of the images without installing any software.Purpose of the image optimization is to improve the speed of web pages.Image optimization also improves your SEO ranking.Using image optimizer tools get a higher Lighthouse score and increase your visibility.You can reduce […]
Magento 2 product image in new order email
Today we discuss about display product image in new order email.Sometimes you want to add an image of the product in the mail send after a place order. You will need add some code into this file :- File : vendor/magento/module-sales/view/frontend/templates/email/items/order/default.phtml Override 1:- Override above core file into theme app/design/frontend/[VENDOR]/[TEMPLATE]/Magento_Sales/templates/email/items/order/default.phtml Override 2:- Override above core […]
setTimeout() and setInterval in jQuery
Today we will discuss about setTimeout() and setInterval function in jQuery . setTimeout function :- The setTimeout() is executed only once.Use the clearTimeout() method to prevent the function from starting.By calling clearTimeout() you can to stop the execution. var myTimeout = setTimeout(function () { // Your logic }, 2500); // 2500 are milliseconds // to […]
Syntax error unexpected eof in Graphql
Hello, reader today I will tell about syntax error unexpected EOF in graphql Magento 2. Sometimes you get this error message from postman when running a GraphQL query. Error : “Syntax Error: Unexpected <EOF> “ Solution 1 Method to be POST Solution 2 Header field Content-Type to be application/json Solution 3 Check your passing query […]
Magento 2 rtrim() expects parameter 1 to be string
Error : rtrim() expects parameter 1 to be string, bool given#0 ./vendor/magento/framework/Encryption/Adapter/Mcrypt.php(171): rtrim() Solution 1:- I just installed it on my server using apt install php7.4-mcrypt Restert apache server :- service apache2 restart Check php installed extention php -m Solution 2:- Run below command rm -rf var/cache/ generation/ chmod 777 -R var/ pub/ generated/ Related […]
Magento 2 success and error message
Today, we describe success and error messages in Magento 2. messageManagerDisplay success and error messages with the help of the messageManager object . protected messageManager; public function __construct( ——— \Magento\Framework\Message\ManagerInterface $messageManager, ——— ){ $this->messageManager = $messageManager; } public function myFucntion(){ $message =$this->messageManager->addError(__(“Error message”)); $message =$this->messageManager->addWarning(__(“Warning message”)); $message =$this->messageManager->addNotice(__(“Notice message”)); $message =$this->messageManager->addSuccess(__(“Success message”)); return $message; } […]