How to Call CMS Block Page in PHTML File in Magento 2

In this block, I am showing you how to call the cms block page inside Magento 2.

Whenever we customize the theme or create a new website, at that time we often need to show the content of the block page inside our p file.

Often we call CMS static block to display better data on the frontend.

Many times through CMS block we add slider image, banner image, or sometimes some special product, sales promotions, return policies, etc., and to call it in many places, we call that block in phtml file.

I am telling you step by step method how you can show data by calling the block page in a PHTML file.

Call CMS Block Page in PHTML

Before You Call Block Page in Magento 2 website you must have that block page.

To create a new block page, you can create a new blog by going inside the admin content.

Then you can decide its identifier yourself if you want and you can use that identifier wherever you want to call it.

 

Create Static Block Page in Magento 2

Login to Magento 2

Admin > Content > Block > Add New Block

Enable Block: When you enable the block, then the content is visible; if you disable it, the content is disabled

Block Title: The title of the block decides what purpose it is made for and what it should be known as.

Identifier: The identifier is basically to call that block. There can never be two blocks of a bean identifier. The identifier is always unique.

Store View: Select the store views to show the static block in.

Block Content: Whatever content you want to add inside the block like Image, Text, Title, Heading, Table, Product, etc. then these are all content when you call block anywhere then this content will appear

When you save the block, it appears as a content grid, then if you want to edit it in HTML format, then you can edit anything in it by clicking on the so as HTML.

Magento 2 CMS Block Page

 

Read more: Add Multiple Product Attribute Using InstallData in Magento2

 

How to Call CMS Block Page in PHTML File in Magento 2

Now below are the steps to call the CMS static block page in phtml file.

<?php
echo $this->getLayout()
->createBlock('Magento\Cms\Block\Block')
->setBlockId('your_block_identifier')
->toHtml();
?>

or

<?php echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('your_block_identifier_name')->toHtml();?>

 

Call Block Identifier in CMS Page

By using this below method you can display CMS static block content in any cms block page or any static block page.

{{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}}

 

How to Get CMS Static Block In XML

Code to display the CMS Static Block in the “Content.

If you want to call static block inside XML file then you can follow the below method for that.

In the XML file, you can mention either the identifier or the ID of the block and through that, you can call the block.

<referenceContainer name="content"> 
<block class="Magento\Cms\Block\Block" name="block_identifier"> 
<arguments> 
<argument name="block_id" xsi:type="string">block_identifier</argument> 
</arguments> 
</block> 
</referenceContainer>

You can call the CMS static block by adopting any of these methods.

Wherever you want to show data, whether it is a slider, whether it is a product, whether it is a promotion or any kind of block content, you can easily call it in any phtml file and show it on the frontend.

If you face any kind of problem in this then you can feel free to call us, talk or mail, we will be there 24*7 to assist you.

 

Similar Posts:

Add Custom Class on Checkout Form Field in Magento 2

Magento 2.4 Installation Guide: How to Install Magento 2.4.2

Shopping Store: How to Start Shopping Website in India

In today's digital world running an online shopping store is much easier than an offline shop.

As the name suggests, any consumer goods are bought and sold electronically.

When its purchase and sale is done online, it requires a strong website with a good user experience. We call this website an online shopping website.

For example, many leading e-commerce sites are present in different names like Flipkart.com, Amazon.in, Snapdeal.com, Myntra.com, etc.

Competition is also very high in all this, but today there are many options available for a good businessman.

Through this post, I will explain to you the steps from how to start an online shopping website to launching a website.

 

Why Online Shopping Website

If you want to take your business to a big level, if you want to take your offline store online, then an online e-commerce website is very important for you.

Through an online e-commerce website, you can easily bring millions of customers to your website.

But offline your customer stays to a limited extent.

The scaling of the business depends on you, you can scale it at a very high level, it depends on you how many levels you want to take your business.

That is, you can expand your business from one locality to the whole country and the world.

It is also possible to earn crores of rupees daily through online shopping website but In offline stores, it becomes very difficult.

Budgeting offline is also quite a lot, whereas, in online budgeting, a business can be done on a very large level with very little expenses.

In offline you need to have a physical store whereas online you do not need to have a physical store.

You open a digital store where all your products are available in digital form.

As soon as the customer places the order. You can buy, manufacture, or arrange and deliver that product any way you want.

That is, online you do not need to store all the products at once, whereas offline there is a need to store all these products.

An offline shopping website occupies more space, but there is no requirement of space for an online e-commerce website.

You need a digital space to host and store your website data.

How to Create Shopping Store in 2022

 

Read more: Clothing Stores Business Websites & Development in 2022

 

Steps to Create an Online Shopping Website

In the easiest way to launch an online shopping website, I am telling you a step-by-step idea, following which you can easily launch an e-commerce website.

If you need any help with this, then you can also contact us for that.

Step1: Book a Domin Name

Step 2: Choose Hosting Plan as per Your Requirement

Step 3: Plan Your Budget

Step 4: Create Your Design for Website

Step 5: Contact Developers to Create Website

Step 6: Integrate Payment Gateway

Step 7: Launch Website

The first plan to create an online shopping website is to book your domain name.

Then choose to host plans according to the requirement of your business, as if you have less product then you will not need much space, for this you can also take shared hosting.

But if you have a large number of products, then you will need a dedicated server for that you will have to buy a dedicated hosting service plan.

Now in the next step, you have to create your design. Then hire a developer according to your design and get him to customize your website as per your design.

Payment gateway will need to be integrated into the next step through which you can collect payment from your customer or refund the amount in return for the product.

When your website is ready, launch it

 

Scope and Future of Shopping Store

In the coming times, the transaction of an online shopping platform in India is going to cross $100 billion.

This estimated transaction has exceeded $70 billion in 2022.

In the coming 5 to 10 years, it is going to be about three or four times.

That is, about two hundred fifty billion dollars of transactions are going to happen every year.

In today's run-of-the-mill life, people have very little time that they cannot even go to the shop to shop for small things.

They simply open a computer or open mobile and they see thousands of options in it.

This also saves their time and money.

The future of online eCommerce websites is very bright.

Those who are looking for employment can make their career in it and in the coming time, they can provide employment options to many people by using it.

 

How to make a shopping website at a cheap price?

By the way, you will find many companies who agree to make you a website at a low price.

But when it comes to maintenance and support, there are very few companies that provide you maintenance and support for free.

Those companies charge a lot in the name of maintenance and support, due to which the maintenance and technical support of a commerce website become very difficult.

In such a situation, it becomes a question of a lot of headache for a small businessman whose budget is less.

We help you in such a situation, we make online shopping store at very low rates and provide you the facility of maintenance and support for free for 1 whole year.

You can also extend this free maintenance and support facility after one year at very low rates.

 

eCommerce Framework: Magento 2 eCommerce Developers in India

 

How to Create Shopping Store in 2022

There are many frameworks available to create an online shopping website at affordable prices in 2022.

By using all those frameworks, we can create an online shopping store at the lowest cost.

The most popular shopping frameworks are Shopify and Magento.

If you want to keep fewer products then Shopify is the best option for that but if you have a lot of products then I like Magento as the best option for that.

The Magento Shopping Framework provides the facility to manage millions of Products very easily.

The Magento shopping framework can be easily customized and customized as per your preferences.

It is an open-source platform and it also comes with premium plans.

From its Community Edition to Enterprise Edition, it is available in the market, you can choose the edition at your convenience.

 

Conclusion

Creating a shopping website is very easy, in just one click you can create a shopping website.

It depends on you what is your requirement and to what level you want to take your business.

According to your need, you can choose the framework and you can create your favorite website in a few hours to a few months and you can earn millions of crores daily.

 

Recommended Posts:

PayPal Account: How to Create New PayPal Account, Transfer

Get Category Page Detail Using Category Page REST API

While creating a mobile application we need to get the data of the list page through the Magento 2 category page rest API.

In this sequence, I am telling you the steps here, using which you can get the information of the category page through Magento 2 API.

If you are searching Magento 2 REST API to get all categories where the is_active attribute is true in that case also you can use the below api.

You can also get the data of the enabled category of any store through the default REST API of Magento 2 given below

This Magento API behaves in such a way that you can get only the data of the active category, then you can use this API.

If a category is disabled, its attribute will not be active

 

Category Collection REST API Magento 2

This Magento 2 REST api of the category page lets you get category collection through store view code.

Through this, you can get the collection of entire store category collection details.

Endpoint:

https://www.wishusucess.com/rest/default/V1/categories

Method: GET

Header

  • Content-type: application/json
  • Authorization: Bearer Admin Token

Authorization: Not required

Category Page REST API in Magento 2

 

Response:

{
"id": 2,
"parent_id": 1,
"name": "Default Category",
"is_active": true,
"position": 1,
"level": 1,
"product_count": 1181,
"children_data": [
{
"id": 38,
"parent_id": 2,
"name": "What's New",
"is_active": true,
"position": 1,
"level": 2,
"product_count": 0,
"children_data": []
},


{
"id": 29,
"parent_id": 2,
"name": "Promotions",
"is_active": false,
"position": 6,
"level": 2,
"product_count": 0,
"children_data": [
{
"id": 30,
"parent_id": 29,
"name": "Women Sale",
"is_active": true,
"position": 1,
"level": 3,
"product_count": 224,
"children_data": []
},
{
"id": 31,
"parent_id": 29,
"name": "Men Sale",
"is_active": true,
"position": 2,
"level": 3,
"product_count": 39,
"children_data": []
},
{
"id": 32,
"parent_id": 29,
"name": "Pants",
"is_active": true,
"position": 3,
"level": 3,
"product_count": 247,
"children_data": []
},
{
"id": 33,
"parent_id": 29,
"name": "Tees",
"is_active": true,
"position": 4,
"level": 3,
"product_count": 192,
"children_data": []
}
]
},
{
"id": 37,
"parent_id": 2,
"name": "Sale",
"is_active": true,
"position": 6,
"level": 2,
"product_count": 0,
"children_data": []
}
]
}

 

Read more: Get Product Image URL Via Magento 2 REST API

 

Get All Category Page Data Via API in Magento 2

There is not much difference between the first and this API, but through this API you can get the complete category data of any Magento  2 website.

Using this REST API of Magento, you can easily get any categories and their subcategories across the store

Endpoint:

https://www.wishusucess.com/index.php/rest/V1/categories/

Method: GET

Header

  • Content-type: application/json
  • Authorization: Bearer Admin Token

Authorization: Not required

Category Collection REST API

 

Response:

{
"id": 2,
"parent_id": 1,
"name": "Default Category",
"is_active": true,
"position": 1,
"level": 1,
"product_count": 1181,
"children_data": [
{
"id": 38,
"parent_id": 2,
"name": "What's New",
"is_active": true,
"position": 1,
"level": 2,
"product_count": 0,
"children_data": []
},
{
"id": 29,
"parent_id": 2,
"name": "Promotions",
"is_active": false,
"position": 6,
"level": 2,
"product_count": 0,
"children_data": [
{
"id": 30,
"parent_id": 29,
"name": "Women Sale",
"is_active": true,
"position": 1,
"level": 3,
"product_count": 224,
"children_data": []
},
{
"id": 31,
"parent_id": 29,
"name": "Men Sale",
"is_active": true,
"position": 2,
"level": 3,
"product_count": 39,
"children_data": []
},
{
"id": 32,
"parent_id": 29,
"name": "Pants",
"is_active": true,
"position": 3,
"level": 3,
"product_count": 247,
"children_data": []
},
{
"id": 33,
"parent_id": 29,
"name": "Tees",
"is_active": true,
"position": 4,
"level": 3,
"product_count": 192,
"children_data": []
}
]
},
{
"id": 37,
"parent_id": 2,
"name": "Sale",
"is_active": true,
"position": 6,
"level": 2,
"product_count": 0,
"children_data": []
}
]
}

 

 

REST API for All Category Details With Image File

In this API, you can also get the image URL of each category simultaneously.

Rest of the details will remain the same as before API.

Magento 2 API, with the help of which all the category data of any store along with the image of each category is also available

Endpoint:

https://wishusucess.com/index.php/rest/V1/categories/list?searchCriteria[filterGroups][0][filters][0][field]=parent_id&searchCriteria[filterGroups][0][filters][0][value]=2

Method: GET

Header

  • Content-type: application/json
  • Authorization: Bearer Admin Token

Authorization: Not required

All Category Details Using Image File

 

Response

{
"items": [
{
"id": 3,
"parent_id": 2,
"name": "Gear",
"is_active": true,
"position": 4,
"level": 2,
"children": "4,5,6",
"created_at": "2022-01-20 14:12:16",
"updated_at": "2022-01-20 14:12:17",
"path": "1/2/3",
"available_sort_by": [],
"include_in_menu": true,
"custom_attributes": [
{
"attribute_code": "display_mode",
"value": "PAGE"
},
{
"attribute_code": "is_anchor",
"value": "0"
},
{
"attribute_code": "path",
"value": "1/2/3"
},
{
"attribute_code": "children_count",
"value": "3"
},
{
"attribute_code": "url_key",
"value": "gear"
},
{
"attribute_code": "url_path",
"value": "gear"
}
]
},
{
"id": 37,
"parent_id": 2,
"name": "Sale",
"is_active": true,
"position": 6,
"level": 2,
"children": "",
"created_at": "2022-01-20 14:15:55",
"updated_at": "2022-01-20 14:15:55",
"path": "1/2/37",
"available_sort_by": [],
"include_in_menu": true,
"custom_attributes": [
{
"attribute_code": "display_mode",
"value": "PAGE"
},
{
"attribute_code": "is_anchor",
"value": "0"
},
{
"attribute_code": "path",
"value": "1/2/37"
},
{
"attribute_code": "children_count",
"value": "0"
},
{
"attribute_code": "url_key",
"value": "sale"
},
{
"attribute_code": "url_path",
"value": "sale"
}
]
},
{
"id": 38,
"parent_id": 2,
"name": "What's New",
"is_active": true,
"position": 1,
"level": 2,
"children": "",
"created_at": "2022-01-20 14:15:55",
"updated_at": "2022-01-20 14:15:55",
"path": "1/2/38",
"available_sort_by": [],
"include_in_menu": true,
"custom_attributes": [
{
"attribute_code": "display_mode",
"value": "PAGE"
},
{
"attribute_code": "is_anchor",
"value": "0"
},
{
"attribute_code": "path",
"value": "1/2/38"
},
{
"attribute_code": "children_count",
"value": "0"
},
{
"attribute_code": "url_key",
"value": "what-is-new"
},
{
"attribute_code": "url_path",
"value": "what-is-new"
}
]
}
],
"search_criteria": {
"filter_groups": [
{
"filters": [
{
"field": "parent_id",
"value": "2",
"condition_type": "eq"
}
]
}
]
},
"total_count": 3
}

 

Similar Posts:

How to Get New Arrival Product REST API in Magento 2

Create Account REST API : How to Create an Account of Customer, Admin

 

Suggested Post:

BMLT Course in Hindi: Scope and Future Career in BMLT, Eligibility

Add Custom Class on Checkout Form Field in Magento 2

When we work on the checkout page of Magento 2 sometimes we need to add custom class on checkout form field.

The checkout page gets a bit complicated as it is made of Knockout js.

We can implement a plugin to add custom classes to any field in the customer shipping form on the checkout page in an easy way.

Through custom plugins, customers can add class to any field of the form.

Add Custom Class on Checkout Form Fields

In order to add a custom class on the checkout customer shipping form field, we will develop a custom plugin and through that will inject a class into any form field.

 

Step 1: Add Custom Class on Checkout Form Field Module Registration

For this first, we have to create a registration file so that we can register our custom plugin.

Wishusucess/CustomClass/registration.php
<?php 
/*
* Developer: Hemant Singh Magento 2 Professional
* Website: http://www.wishusucess.com/
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Wishusucess_CustomClass',
__DIR__
);

 

Read more: How to Earn Money Digitally By Blog Writing And Other Way

 

Step 2: Module File for Custom Class Plugin

In this step, we have to create a model file.

As we all know that this is a basic file that holds the basic information details of any model or plugin.

Wishusucess/CustomClass/etc/module.xml
<?xml version="1.0"?>
<!--
/**
* Developer: Hemant Kumar Singh Magento Developer
* Website: http://www.wishusucess.com/
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Wishusucess_CustomClass" setup_version="1.0.0" active="true"></module>
</config>

 

Step 3: Add Dependency Injection File for Custom Class

Here we will tell Magento through a dependency injection file that we are going to make changes to its core functionality through the plugin.

That's why both the file type and name of that plugin will be mentioned in this file.

Wishusucess/CustomClass/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/ObjectManager/etc/config.xsd"> 
<type name="\Magento\Checkout\Block\Checkout\AttributeMerger">
<plugin name="customAttributeMerger" type="\Wishusucess\CustomClass\Model\Plugin\AttributeMergerPlugin"/>
</type>
</config>

 

Step 4: Plugin to Add Custom Class in Form Field

Via this plugin class, we will do some merge in behavior in the checkout form field.

As the checkout form field is loaded, a class will be automatically added.

Through this class, you can decide in which field you have to add the class name.

Wishusucess/CustomClass/Model/Plugin/AttributeMergerPlugin

<?php
/**
* Developer: Hemant Kumar Singh Magento Developer
* Website: http://www.wishusucess.com/
*/
namespace Wishusucess\CustomClass\Model\Plugin;

class AttributeMergerPlugin
{
public function afterMerge(\Magento\Checkout\Block\Checkout\AttributeMerger $subject, $result)
{
if (array_key_exists('telephone', $result)) {
$result['telephone']['additionalClasses'] = 'teliphone_number';
}

return $result;
}
}

Here is an example, I have added a custom class in the Magento default telephone number form field named telephone_number.

You can make any changes you want by using this class.

Because of creating a plugin, you will not need to add anything to any other file.

 

Step 5: Run Below Command

Now you have to run the command given below, then clear the cache, now you will see the class name.

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy -f

php bin/magento c:c

Custom Class on Customer Field

Here you can see that the custom class telephone number has been added.

In this way, you can add a custom class to any of the customer form fields as per your wish.

The easiest way to add a class is through a plugin

 

Download This Plugin

 

Similar Posts:

Configure PayPal in Magento 2 : How to Integrate PayPal

PayPal Account: How to Create New PayPal Account, Transfer

Affiliate Marketing: Options to Make Money For Bloggers

In this post, I am going to explain to you about Affiliate Marketing in complete detail and how you can earn money by using these offers.

Some big companies like Amazon, Flipkart, Snapdeal, Paytm, etc. promote and market their website in every way.

Affiliate program is one of those marketing methods that means a type of performance-based marketing that depends on the efforts of affiliates.

Where companies come to sell their product, then these companies give the options to the sellers to sell the products, and when they sell those products

companies shares some percent of their profit with sellers.
In this way both get profit.

Because affiliate program works on the basis of promotion and dissemination.

That's why it's shared with contributors along with part of it to make it workable

In this, sellers do not need to list any of their products.

Any sellers can sell the product they want to sell by creating their accounts on this shopping website.

The sales of those companies increased by using this method and when the sales are more than if the profit margin will be less even then the company will make more profit because the sales are increasing.

 

Read more: Blog Website Setup: How to Setup a WordPress Website

 

Affiliate Marketing work?

Based on the products sold by you in an affiliate program, the company supports its marketer by paying some percent commission.

To make this method more useful, many types of parties work such as:

  • Seller and product manufacturer.
  • Affiliate or advertiser.
  • Consumer.

Let us understand these three points in detail of affiliated marketing methods.

It is the responsibility of the manufacturer and the seller of the product that how the product will be made and how it will be listed on the website.

Marketing people come in the second step, in this step also comes affiliate marketing.

You have to get a link to any product and promote it.

As soon as a customer orders a product from the link shared by you, you will get money as its commission.

 

 

How to Get Passive Income in 2022

If you have any kind of good social network or traffic source then you can convert that traffic source into passive income by providing good value to your customers using the affiliates marketing methods.

Through Affiliate Marketing, you can earn money in 2022 by selling someone else's product without listing any product.

This method gives an option for any person to earn up to a certain percentage of money as commission on the sale of each product without creating his own product.

 

Read more: How to Earn Money Digitally By Blog Writing And Other Way

 

How to Start Affiliate Marketing Work?

If you are looking for new ways to earn money as passive income in 2022, then Affiliate program will help you, let us know what is the step by step way to start affiliated marketing.

 

Step 1: Join an Affiliate Program

In the first step, you should choose what kind of traffic source you have, then according to that you join the programs and do the marketing of the product.

You can choose programs of Affiliate-Programs-Amazon.com, affiliate.flipkart.com, ebay.com, alibaba.com, etc.

Affiliate marketing of Amazon

You have to complete your account by filling in all the details, as soon as the account is complete, you will see the option to create the URL of any product.

 

Step 2: Choose Offers and Promote

Now comes the step to selecting the offer and so then you can promote it easily.

 

Step 3: Get The Affiliate Link

Now you have to get the unique link of every product, for that, you have to create a link.

 

Step 4: Promotion of Link

The more you promote the link, the more your chances of getting sales will increase.

So for that, you can use the different social media platforms to share those links on your blog, social media platforms, or website.

 

Step 5: Collect Your Commissions

Now in this step, you can get your commission and transfer it to your bank account.

Whenever a product is sold, its commission will be added to your account.

Once you get the commission, you can transfer it to your bank account.

 

 

What is Important in Affiliate Marketing?

The most important thing in marketing is whether your target audience is able to connect with your product.

It is very important for sales that the customer should be relevant and targeted who likes your product.

In such a situation, you should choose the same product as your customer base.

Never miss-match the product like if your website is related to the technical blog, then it is necessary that you should promote the product related to software only.

 

 

Product Best For Affiliate Program in 2022?

By the way, the correct answer is that what kind of customer base you have, according to that you should choose the product.

Another way is that you can choose the product by observing the market.

  • Software Products
  • Wellness and Healthcare Products
  • Computer Accessories and Mobile
  • Jim Equipments etc.

 

Conclusion:

Affiliate program depends a lot on your marketing and traffic.

The more you connect with your users, the more your customer's trust in you will increase and you can use that trust to increase sales.

Blog Website Setup: How to Setup a WordPress Website

In this article, I am going to explain to you the blog website setup so anyone can easily book a domain and create a custom website using WordPress.

In today's digital age, blogging has increased a lot because it has become a very famous way to earn money.

Any person who does not have any technical knowledge can also create a blogging website using WordPress.

 

 

WordPress Blog Website Setup in 2022

 

However, when we choose WordPress for blogging only, then we do not need much storage.

But still, do not forget to check the following features while making your selection:

 

Book Free Domain Name - Blog Website Setup

There are many such web hosting service provider companies that provide you a free domain name booking service for one year, such as Hostinger.

You can take advantage of this while booking a domain

 

Suitable Storage

You have to decide whether you are going to make a website just for blogging or will make more facilities available to your customer.

Accordingly, you should choose the storage capacity, otherwise, the speed of the website also slows down due to less storage capacity.

 

Bandwidth

When the traffic on the website starts increasing, then its consumption of bandwidth also starts increasing.

For this also you have to spend money. Otherwise, the website will not be able to handle the traffic and the site will be down.

 

Read more: Magento Store: Best 36 Magento Websites Example in The World

 

What are CFSS Features in Web Hosting

CFSS Features Mean Cost, Features, Security, and Support in website hosting.

Whenever we book a domain, it is important to take care of these features.

Some of the web hosting companies taking higher costs for this.

Also check how good its customer service is, along with automatic backups and an SSL certificate.

Is the company always present for its customers or not?

WordPress Website Creation Steps

 

I am giving you step by step guide which you can follow and create a WordPress website easily.

The Wishusucess is one of the most customer-friendly companies in 2022 that is always available to support their customer for any kind of technical and development help.

We develop and provide WordPress websites to our customers at the lowest cost all over the world.

If you want to make a website for blogging, then we give you the best facility at the lowest cost as compared to any company in the world.

Step 1: Download WordPress Framework

 

First of all, you have to download the latest WordPress from the official website of WordPress, unzip it, and then follow the steps given below step by step.

Now paste in your domain URL and then enter.

If you are installing it on your localhost then the URL for you will be

http://localhost/wordpress

 

Blog Website Setup Using WordPress

 

Step 2: Fill DataBase Details

As you will hit the URL you will see a screen like the below image.

Now, you have to fill all the fields related to the database correctly and then click on the continue button.

Blogging Website Creation

 

Step 2: Check Communication with Database

 

Now if all the details entered by you are correct then you will see a screen that WordPress can interact with the database.

Blog Website Setup in WordPress

 

Step 4: Fill The Website Title and Admin User Details

In this step, you have to enter your website title and username, password and email, etc. and then you have to continue.

You can change all these details even after installation.

Final Step to Decide the Username

 

Step 5: Success Message of WordPress Installation

On successful completion of WordPress installation, you will see a successful message.

Here the username you set at the time of installation will also be visible on your screen.

WordPress Installation Successful

 

WordPress Dashboard - Blog Website Setup

 

Now as soon as you people click on these, you will open the admin login details of WordPress, there you will be redirected to the dashboard if you fill in the login details

You can write and publish a new post by going to the new post section on your dashboard.

Dashboard of WordPress After Fresh Installation

 

 

Install WordPress Theme - Blog Website Setup

 

Now you can easily choose the theme of your blogging website.
If you want, you can use a free theme or if you want, you can also buy a good theme.

You can also install the plugin as per your requirement.

Blog Website Setup - Free Theme

If you want to develop the theme for your blogging website according to you, then you can contact me.

I can customize your website according to your needs and prepare it at a very low cost.

 

Install WordPress Plugin - Blog Website Setup

 

You can also check which are the essential plugins for any new website which must be installed from the point of view of security.

Blog Website Setup - Plugin

Always install the plugin according to your needs, it also affects the performance of your website.

Install the plugin you are using after thoroughly investigating it because there are many such plugins that steal all the information of your website and share it with someone else.

There is also a security risk on your website due to not using the right plugin.

 

 

What is the Minimum Cost for a Blogging Website in 2022

 

The cost of any website depends on its utility, but still, you want to create a simple blogging website whose validity is for two years, then its full cost will be about 1000 dollars or 10,000 Rs. rupees.

Including domain costs for two years, bandwidth costs, storage costs, and technical support.

You can contact me, I also provide free maintenance and support for two years.

In between these two years, if you need any kind of website-related help, I am always available.

I do not charge anything extra for that support

 

 

Conclusion:

 

Blogging is one of the most popular ways to earn money online today.

To create a blogging website, you can use the most commonly used framework WordPress, which is also the most economical and can be easily managed by any less technically knowledgeable person.

How to Get New Arrival Product REST API in Magento 2

In this article, we will learn how to filter the products of a Magento 2 store using the REST API and we will also know how to get new arrival products REST API.

By the way, Magento 2 Provides a facility for the REST API that is well known as Swagger Module which contains all list of REST APIs resources:

Using this model, you can get the product by visualizing and testing it through REST API.

When you hit the URL of your store by typing swagger you will get the list details of all the APIs.

Like I have taken an example below, according to this example you enter your URL and hit it, then you will get the API.

Endpoint:

http://www.wishusucess.com/swagger

Here we are filtering the product on the basis of attribute and the name of that attribute is a new product.

So while filtering the product through Rest API, we will get the newly added product by filtering

 

 

Get New Arrival Products REST API

 

To filter a new product, what should be its search criteria and which method will be used, what access token will be used, the details of all these are given below.

Endpoint

https://www.wishusucess.com/rest/V1/products?searchCriteria[sortOrders][0][field]=created_at&searchCriteria[pageSize]=10

Method: GET

Header: 

  • Authorization: Bearer <admin token>
  • Content Type: application/json

Body: none

New Arrival Products REST API

Search Parameter for New Arrivals in REST API

 

Created At New Arrivals

Response:

{
"items": [
{
"id": 2007,
"sku": "WSH08-31-Purple",
"name": "Sybil Running Short-31-Purple",
"attribute_set_id": 10,
"price": 44,
"status": 1,
"visibility": 1,
"type_id": "simple",
"created_at": "2021-12-23 09:40:40",
"updated_at": "2021-12-23 09:40:40",
"weight": 1,
"extension_attributes": {
"website_ids": [
1
],
"category_links": [
{
"position": 0,
"category_id": "28"
},
{
"position": 0,
"category_id": "35"
},
{
"position": 0,
"category_id": "2"
}
]
},
"product_links": [],
"options": [],
"media_gallery_entries": [
{
"id": 3353,
"media_type": "image",
"label": "",
"position": 1,
"disabled": false,
"types": [
"image",
"small_image",
"thumbnail"
],
"file": "/w/s/wsh08-purple_main_1.jpg"
},
{
"id": 3354,
"media_type": "image",
"label": "",
"position": 2,
"disabled": false,
"types": [],
"file": "/w/s/wsh08-purple_back_1.jpg"
}
],
"tier_prices": [],
"custom_attributes": [
{
"attribute_code": "image",
"value": "/w/s/wsh08-purple_main_1.jpg"
},
{
"attribute_code": "small_image",
"value": "/w/s/wsh08-purple_main_1.jpg"
},
{
"attribute_code": "thumbnail",
"value": "/w/s/wsh08-purple_main_1.jpg"
},
{
"attribute_code": "options_container",
"value": "container2"
},
{
"attribute_code": "msrp_display_actual_price_type",
"value": "0"
},
{
"attribute_code": "url_key",
"value": "sybil-running-short-31-purple"
},
{
"attribute_code": "required_options",
"value": "0"
},
{
"attribute_code": "has_options",
"value": "0"
},
{
"attribute_code": "tax_class_id",
"value": "2"
},
{
"attribute_code": "category_ids",
"value": [
"28",
"35",
"2"
]
},
{
"attribute_code": "description",
"value": "<p>Fortunately, it's okay to look cute while you're working out. The Sybil Running Short combines a fun, color-blocked design with breathable mesh fabric for sporty-fun style.</p>\n<p>&bull; Blue running shorts with green waist.<br />&bull; Drawstring-adjustable waist.<br />&bull; 4\" inseam. Machine wash/line dry.</p>"
},
{
"attribute_code": "size",
"value": "174"
},
{
"attribute_code": "color",
"value": "57"
}
]
}
],
"search_criteria": {
"filter_groups": [],
"sort_orders": [
{
"field": "created_at",
"direction": null
}
],
"page_size": 1
},
"total_count": 2046
}

 

Similar Posts:

Create Account REST API : How to Create an Account of Customer, Admin

Magento 2 Login REST API: How to Login Customer, Admin

Wishusucess on GitHub

Create Account REST API : How to Create an Account of Customer, Admin

In this article, I am going to explain to you how to use create account rest api in Magento 2. In this, I will also explain to you how to create customer and admin accounts using REST API.

Whenever you order a product inside the Magento store, there are three ways to do it.

By creating a customer account, we can order the product, which we call registered users or they are also called logged-in customers.

Another way is that customers can order products without registering an account, whom we know as guest users.

The third way is that the guest customer is registered only at the time of ordering.

As a guest user who logs in or creates an account when ordering
Through this article, I am going to explain how to register a client through the REST endpoint.

 

 

Admin Create Account REST API

Now if you are looking for the REST API endpoint to create Magento 2 admin users s you can follow the below steps.

 

Endpoint:

The below details are the basic structure of REST APIs to call in Magento 2.

<HTTP verb> http://<host>/rest/<scope>/<endpoint>

HTTP headers:

Through this section, we send the required authentication details and tell the Magento store that we are the authentic user who can access the requested data.

Payload:

Through this section, we send necessary valid details along with the endpoint.

POST <host>/rest/<store_code>/V1/tfa/provider/google/authenticate
{
"username": "admin",
"password": "<admin-password>",
"otp": "<otp-value>"
}

There is no API to create a Magento admin user you can get the access token of the admin user by using the rest API.

But you can create an admin account from the Magento 2 store in the admin.

Admin Panel > System > Permissions > All User > New User.

 

Response:

When you use the Magento admin rest API to get the access token that returns the admin’s access token in the following format.

4r2jdjdr11j6gmau8990hcj6qk5unh3i

Now, whenever you need to access the backend details or any other details then you have to use this token in the header for the authorization in every call and that header token validate then allows you to access the store details.

 

 

Customer REST API to Create Account

 

To create a customer, we can send all the details in the payload, in the first step I have only added four fields to create a customer in a short way.

But when you create a customer through rest API, all the other fields are optional, that's why you don't need to add all the fields in order to create customer accounts. You can create a customer by sending only four details in the payload in the Rest API.

 

Method 1: REST API to Create Customer in Magento 2

Endpoint:

POST <host>/rest/<store_code>/V1/customers
http://www.wishusucess.com/rest/V1/customers

Method: POST

Authorization: Not required

Body: raw: JSON

Headers: Content-Type: application/json

{
"customer": {
"email": "cs.hemantsingh@gmail.com",
"firstname": "Hemant",
"lastname": "Singh"
},
"password": "aaAdm378in@#123"
}

Create Account REST API in Magento 2

 

Response:

{
"id": 4,
"group_id": 1,
"created_at": "2022-01-14 18:38:21",
"updated_at": "2022-01-14 18:38:21",
"created_in": "Default Store View",
"email": "cs.hemantsingh@gmail.com",
"firstname": "Hemant",
"lastname": "Singh",
"store_id": 1,
"website_id": 1,
"addresses": [],
"disable_auto_group_change": 0,
"extension_attributes": {
"is_subscribed": false
}
}

 

Method 2: Create Customer REST API

In this step I am adding full customer details in payload else other details will be the same as the first methiod.

create customer rest api in detail

Response:

{
"id": 5,
"group_id": 1,
"default_billing": "3",
"default_shipping": "3",
"created_at": "2022-01-14 19:02:46",
"updated_at": "2022-01-14 19:02:47",
"created_in": "Default Store View",
"email": "cs.hemants@gmail.com",
"firstname": "Hemant",
"lastname": "Singh",
"store_id": 1,
"website_id": 1,
"addresses": [
{
"id": 3,
"customer_id": 5,
"region": {
"region_code": "UP",
"region": "Uttar Pradesh",
"region_id": 566
},
"region_id": 566,
"country_id": "IN",
"street": [
"Noida"
],
"telephone": "7992293862",
"postcode": "201301",
"city": "Noida",
"firstname": "Hemant",
"lastname": "Singh",
"default_shipping": true,
"default_billing": true
}
],
"disable_auto_group_change": 0,
"extension_attributes": {
"is_subscribed": false
}
}

 

If you log in to your Magento 2 store with any of the username and password details that you have given while creating the account using REST API, then it will log in successfully.

Or if you go to All Customers in the admin of the store, then your new account that has been created will appear.

Now if you want to implement login functionality using Magento rest api then you can use login rest API.

 

Read more: Magento 2 Login REST API: How to Login Customer, Admin

 

Other Post:

PayPal Account: How to Create New PayPal Account, Transfer

Wishusucess on GitHub

Magento 2 Login REST API: How to Login Customer, Admin

I am going to explain the Magento 2 login REST API for mobile applications so by using those REST APIs you can develop the application using the Magento 2 e-commerce framework.

So these APIs are basically used for the login system for the customers and admin users. You can take help of these proper rest ways to implement the login functionality.

 

 

Magento 2 Login REST API

 

To access the data of any store of your magento, first of all, you have to define yourself that you are the genuine person accessing that data.

Authentication means you have to prove as a genuine user of customer it admin that allows Magento e-commerce store to identify the access rights. It means you have the right to access (administrator, integration, client, or guest) resources of the API call.

Now if you just want to check some things as a front-end customer then you have to log in customer and for that, you have to get a customer access token.

But if you want to access internal details of the store then for that you must have to authenticate your identity and get an access token of admin details.

 

 

Magento 2 Login Rest API Customer

 

Step 1: You must have a customer account in order to get access tokens of customers. If you don't have a user account then you can create a customer account first.

Step 2: Now you have to send the customer user details like username and password in the payload with the POST method.

Step 3: Get customer access token in response.

 

API URL: {baseurl}/rest/V1/integration/customer/token

Endpoint:

https://wishusucess.com/rest/V1/integration/customer/token

Method: POST

Authorization: Not required

Body:

{
   "username":"cs.hemantsingh@gmail.com",
   "password":"Admin@#44123"
}

Magento 2 Login REST API

Response:

l2l6ccj0hwvm6pvj7uy7oflr7k7uvabv

 

 

Admin Login REST API in Magento 2

 

If any mobile application is developed using Magento eCommerce then at that time we need to login to Magento admin through rest API.

Let us know what is the complete step of admin login via REST API, by following which we can get this access token.

Step 1: You need a Magento store admin account in order to get access tokens of your stores via rest API.

Step 2: Now by hitting the below details you can get the admin access token. Along with the rest API URL you have to send the admin username and password in the payload with the POST method.

Step 3: Get admin access token in response.

 

API URL: {baseurl}/rest/V1/integration/admin/token

Endpoint: 

https://wishusucess.com/rest/V1/integration/admin/token

Method: POST

Header: Not required

Body:

{
    "username":"admin32",
    "password":"Admin555@#123"
}

Magento 2 Login REST API

Response:

9nnv93lsivrfvzyzt1cgdw8f3xnij05v

 

Read more: Magento 2.4 Installation Guide: How to Install Magento 2.4.2

 

Similar Post:

How to Make Payment Using PayPal REST API in Magento 2

Configure PayPal in Magento 2 : How to Integrate PayPal

How to Make Payment Using PayPal REST API in Magento 2

I am going to explain to you how to make payments using the PayPal REST API call to create orders through PayPal in Magento 2 e-commerce platform.

Here I am using the PayPal payment method to create an order for which I will pay through PayPal REST API and complete the order.

So it is important to have the right API calls as well as the right payload to fulfill the order.

When we hit the Paypal API, other details like basic authorization and header details must also be correct, otherwise, the payment will not be completed.

 

Read more: Configure PayPal in Magento 2 : How to Integrate PayPal

 

Now the correct point is what is the correct API call and payload to complete the order using PayPal express payment method to process checkout payment get it done the order.

So let's start steps one by one in order to complete the product order via Paypal rest API.

 

 

Step 1: Get an Access Token PayPal Sandbox App

 

First of all, we have to do the configuration of Magento admin, for that you can follow this step of Paypal Integration in Magento 2.

When your account is created and all its details are received then you reach this step to get access token using Paypal rest API.

You can proceed to the next step only after getting the required sandbox account details from the PayPal Developer Dashboard, for this you can complete those steps of the development environment to get OAuth 2.0 client ID and secret credentials for the sandbox accounts.

The access token you received authorizes you to access the PayPal REST API server by using those tokens.

 

Endpoint:

https://api-m.sandbox.paypal.com/v1/oauth2/token

Method: POST

Authorization: Basic Auth

Username: My app and credentials(client_id)

Password: Client secret

Body: x-www-form-urlencoded

grant_type = client_credentials

Get PayPal Access Token For Apps

 

Step 2: Create Order Using PayPal REST API

 

Now by using the below payload details you can create an order and complete the payment by using Paypal REST Apis call.

Endpoint:

https://api-m.sandbox.paypal.com/v1/payments/payment

Method: POST

Header:

Content-type: application/json

Authorization: <access-token>

Authorization: Basic Auth

Username: my app and credentials(client_id)

Password: Client secret

{
"intent": "authorize",
"experience_profile_id": "XP-T8WE-L7SC-RN4L-QJAS",
"payer": {
"payment_method": "paypal"
},
"transactions": [{
"amount": {
"currency": "USD",
"total": "1.25",
"details": {
"shipping": "0.1",
"subtotal": "1",
"tax": "0.15"
}
},
"payee": {
"email": "cs.hemantsingh@gmail.com"
},
"description": "Test paypal payment done on 13th Jan 2022",
"item_list": {
"items": [{
"name": "acessories belt monolog",
"quantity": "1",
"price": "1",
"sku": "test1",
"currency": "USD"
}],
"shipping_address": {
"recipient_name": "Hemant Singh",
"line1": "New test",
"city": "Saratoga",
"country_code": "US",
"postal_code": "95070",
"phone": "0116519999164",
"state": "CA"
}
}
}],
"redirect_urls": {
"return_url": "https://wishusucess.com/",
"cancel_url": "https://wishusucess.com/"
}
}

Create Order Using PayPal REST API

 

Response: Order Created Using PayPal Payment Method

{
"id": "PAYID-MHL4VTA69N500857X1559800",
"intent": "authorize",
"state": "created",
"payer": {
"payment_method": "paypal"
},
"transactions": [
{
"amount": {
"total": "1.25",
"currency": "USD",
"details": {
"subtotal": "1.00",
"tax": "0.15",
"shipping": "0.10"
}
},
"payee": {
"email": "cs.hemantsingh@gmail.com"
},
"description": "Test paypal payment done on 13th Jan 2022",
"item_list": {
"items": [
{
"name": "acessories belt monolog",
"sku": "acessoriebelt321",
"price": "1.00",
"currency": "USD",
"quantity": 1
}
],
"shipping_address": {
"recipient_name": "Hemant Singh",
"line1": "New test",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US",
"phone": "0116519999164"
}
},
"related_resources": []
}
],
"experience_profile_id": "XP-T8WE-L7SC-RN4L-QJAS",
"create_time": "2022-01-07T05:08:28Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAYID-MHL4VTA69N500857X1559800",
"rel": "self",
"method": "GET"
},
{
"href": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-47V04030JC5984021",
"rel": "approval_url",
"method": "REDIRECT"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAYID-MHL4VTA69N500857X1559800/execute",
"rel": "execute",
"method": "POST"
}
]
}

 

 

Approval PayPal REST API Payments

 

Paypal Login Details: Enter your Paypal username

Password: Enter your Paypal password details

 

"href": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-50C051037E557641M",
"rel": "approval_url",

"method": "REDIRECT"

 

Now you have to hit the approval URL in your response body and proceed as a guest for the testing purpose and it will redirect to the website to review the order.

PayPal REST API for Payment

As soon as you do this complete step, then your order will be completed and it will automatically go to your website.