{"id":18596,"date":"2019-01-29T14:59:18","date_gmt":"2019-01-29T12:59:18","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=18596"},"modified":"2023-10-31T18:47:07","modified_gmt":"2023-10-31T16:47:07","slug":"how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html","title":{"rendered":"How to Use and Customize Magento 2 Catalog"},"content":{"rendered":"\n<p>This article is dedicated to a rather complex and wide topic from Magento 2 Backend Specialist Certification &ndash;&nbsp;Customizing the Catalog. Here, we will walk over the following four aspects:<\/p>\n<p><!--more--><\/p>\n<p><a href=\"#step_1\">How to use products and product types in Magento 2<br>\n<\/a><a href=\"#step_2\">What is&nbsp;price functionality in Magento 2<br>\n<\/a><a href=\"#step_3\">How to use and customize categories in Magento 2<br>\n<\/a><a href=\"#step_4\">How to determine and manage catalog rules in Magento 2<\/a><\/p>\n<h2 id=\"step_1\"><span style=\"color: #000000\">How to use products and product types in Magento 2<\/span><\/h2>\n<h3><span style=\"color: #000000\">What are the standard product types in Magento 2?<\/span><\/h3>\n<p>There are 6 standard product types in Magento 2:<\/p>\n<p><strong>1.Simple Product<\/strong>. The most basic and widely used product type. One simple product denotes one physical item with its unique SKU (Store Keeping Unit).<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/Simple-product.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy size-full wp-image-18598 aligncenter\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/Simple-product.png\" alt=\"Simple product magento 2\" width=\"684\" height=\"305\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p><strong>2. Virtual Product<\/strong>. This product type is for intangible goods, like services or subscriptions, etc.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/virtual-product-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy size-full wp-image-18599 aligncenter\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/virtual-product-1.png\" alt=\"virtual product magento 2\" width=\"602\" height=\"309\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p><strong>3. Configurable Product<\/strong>. This product type allows to create and show product configurations, like colors, sizes, etc. Each product configuration is a simple product with its unique SKU, allowing you to keep track of your stock amount.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/configurable-product-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy size-full wp-image-18600 aligncenter\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/configurable-product-1.png\" alt=\"configurable product magento 2\" width=\"640\" height=\"344\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p><strong>4. Grouped Product<\/strong>. This product type allows to unite simple and virtual products in sets. Grouped product provide a win-win situation: a merchant promotes goods that are commonly used together and a customer doesn&rsquo;t need to search the shop and can buy the whole set in one place. What is more, each product is added to the cart separately, in the amount, color and size the customer wants.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/grouped-product-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy size-full wp-image-18601 aligncenter\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/grouped-product-1.png\" alt=\"grouped product magento 2\" width=\"622\" height=\"335\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p><strong>5. Bundle Product<\/strong>. This product type provides customers with an opportunity to create a set themselves, forming a bundle from single products.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/bundle-product-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18602\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/bundle-product-1.png\" alt=\"bundle product magento 2\" width=\"627\" height=\"304\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>Before being added, the item needs to be configured (size, color, etc.), and the total price will depend on this configuration.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/bundle-product-parameters.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18603\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/bundle-product-parameters.png\" alt=\"bundle product parameters magento 2\" width=\"617\" height=\"399\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>For bundle product SKU and Weight attributes can be fixed or dynamic; as for price, it can be set at Price Range (from maximum to minimum price) or As Low As (the lowest price). Admin can specify, how the bundle products will be delivered &ndash; together or separately.<\/p>\n<p><strong>6. Downloadable Product<\/strong>. This product type is for virtual items, usually in the form of a file that can be downloaded by the customer after the payment is made.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/yoga-adventure.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18604\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/yoga-adventure.png\" alt=\"Downloadable Product magento 2\" width=\"971\" height=\"513\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>Virtual and Downloadable Products don&rsquo;t have weight, don&rsquo;t need to be delivered by post and don&rsquo;t have In Stock attribute.<\/p>\n<p>To get all products of a certain type, use <em>Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection<\/em> class:<\/p>\n<pre class=\"lang:default decode:true \">$collection-&gt;addFieldToFilter('type_id', 'bundle');<\/pre>\n<p>As the second parameter set the product type name:bundle, configurable, downloadable, grouped, simple or virtual.<\/p>\n<h3>What tools (in general) does a product type model provide?<\/h3>\n<p>Basic product methods for every product type:<\/p>\n<ul>\n<li>getSetAttributes &ndash; gets backs attribute set of a product;<\/li>\n<li>getAttributeById &ndash; gets backs attribute by its ID and product ID;<\/li>\n<li>isVirtual &ndash; determines if the product is virtual;<\/li>\n<li>isSalable &ndash; determines if the product is Salable;<\/li>\n<li>isComposite &ndash; determines if the product is composite;<\/li>\n<li>canConfigure &ndash; determines if the product can be configured;<\/li>\n<li>prepareForCart &ndash; initiates the product for adding to the cart;<\/li>\n<li>checkProductBuyState &ndash; checks whether you can buy a product;<\/li>\n<li>getSku &ndash; backs up product SKU, whether it has product or no;<\/li>\n<li>hasOptions &ndash; checks if the product has options;<\/li>\n<li>hasWeight &ndash; checks if the product has weight;<\/li>\n<li>getRelationInfo &ndash; gets backs information on product relations;<\/li>\n<li>getAssociatedProducts &ndash; gets backs associated products;<\/li>\n<li>getChildrenIds &ndash; gets backs the list of child product id;<\/li>\n<li>getParentIdsByChild &ndash; gets backs the list of parent product id;<\/li>\n<li>assignProductToOption &ndash; assigns options to products.<\/li>\n<\/ul>\n<h3><span style=\"color: #000000\">What additional functionality is available for each of the different product types?<\/span><\/h3>\n<p>Configurable:<\/p>\n<ul>\n<li>getConfigurableAttributes &ndash; gets back the attributes used for subproducts;<\/li>\n<li>getUsedProductIds &ndash; gets back subproducts id;<\/li>\n<li>getProductByAttributes &ndash; gets back products by attributes;<\/li>\n<li>getConfigurableOptions &ndash; gets back list of options;<\/li>\n<li>setImageFromChildProduct &ndash; sets child product picture for parent product if it hasn&rsquo;t been set before.<\/li>\n<\/ul>\n<p>Bundle:<\/p>\n<ul>\n<li>getOptions &ndash; gets back options list;<\/li>\n<li>getSelectionsCollection &ndash; gets back options collection by its id;<\/li>\n<li>getSpecifyOptionMessage &ndash; gets buyer&rsquo;s message back with the request to specify options;<\/li>\n<li>checkIsAllRequiredOptions &ndash; checks if all the required options were selected;<\/li>\n<li>checkSelectionsIsSale &ndash; checks if all options are available for sale.<\/li>\n<\/ul>\n<p>Downloadable:<\/p>\n<ul>\n<li>getLinks &ndash; gets back the links for product download;<\/li>\n<li>hasLinks &ndash; checks if there are links for product download;<\/li>\n<li>getLinkSelectionRequired &ndash; checks if the product can be purchased without selected links;<\/li>\n<li>getSamples &ndash; gets back samples for product download;<\/li>\n<li>hasSamples &ndash; checks if the product has downloadable samples.<\/li>\n<\/ul>\n<p>Keep in mind that the <strong>getRelationInfo<\/strong>,<strong> getAssociatedProducts<\/strong>, <strong>getChildrenIds<\/strong>, <strong>getParentIdsByChild<\/strong>, etc. methods are common to all product types, but return an empty array if applied to not composite types (Simple or Virtual). The logic of these methods is implemented in classes of composite types, taking into account the specifics of this type.<\/p>\n<h2 id=\"step_2\"><span style=\"color: #000000\">What is&nbsp;price functionality in Magento 2<\/span><\/h2>\n<h3><span style=\"color: #000000\">What are&nbsp;the basic concepts of price generation in Magento 2?<\/span><\/h3>\n<p>Each product in Magento 2 usually has several prices: regular, special, final, etc. Each type of price corresponds to its class, which calculates the final sum for this type of price. Some types of prices are available for all products, while others are specific to a particular product type.<\/p>\n<p>Here are the most common types of prices applicable to all types of products:<\/p>\n<ul>\n<li>base_price &ndash; product cost at the default exchange rate;<\/li>\n<li>regular_price &ndash; product cost at the rate of the selected currency;<\/li>\n<li>final_price &ndash; the final cost of the product;<\/li>\n<li>special_price &ndash; product price with a discount;<\/li>\n<li>tier_price &ndash; price depending on quantity of items in the basket;<\/li>\n<li>custom_option_price &ndash; the cost of the option, if the product has them,<\/li>\n<li>configured_price &ndash; product price, including options;<\/li>\n<li>catalog_rule_price &ndash; product price after catalog rules application.<\/li>\n<\/ul>\n<p>The <strong>special_price<\/strong>,<strong> tier_price<\/strong>,<strong> custom_option_price<\/strong> types can be fixed or set in percentages. If necessary, it can be set for specific user groups.<\/p>\n<p>The common classes responsible for implementing different types of prices are in the <em>Magento \\ Catalog \\ Pricing \\ Price<\/em> namespace and extend the<em> Magento \\ Framework \\ Pricing \\ Price \\ AbstractPrice<\/em> class. Different types of products usually override the logic of calculating a particular type of price. In this case, the corresponding classes are in the namespace of the corresponding product type. Also, some types of products add their own price types:<\/p>\n<ul>\n<li>downloadable products: link_price &ndash; the cost of the product when the customer downloads it from a specific link;<\/li>\n<li>bundle products: bundle_option &ndash; product bundle option cost.<\/li>\n<\/ul>\n<p>Each type of price has <strong>getValue ()<\/strong> and <strong>getAmount ()<\/strong> methods. The <strong>getValue ()<\/strong> method returns the price value, and the <strong>getAmount ()<\/strong> method returns the total price value with all sorts of taxes.<\/p>\n<h3><span style=\"color: #000000\">How would you identify what is composing the final price of the product in Magento 2?<\/span><\/h3>\n<p><strong>final_price<\/strong> of the product depends on its type.<\/p>\n<p>For ordinary products (simple, virtual) it corresponds with the lowest value from <strong>regular_price<\/strong>, <strong>catalog_rule_price<\/strong>, <strong>special_price<\/strong>, <strong>tier_price<\/strong>.<\/p>\n<p>For configurable products cost of each option is selected as the minimum value from <strong>base_price<\/strong>, <strong>tier_price<\/strong>, <strong>index_price<\/strong>, <strong>catalog_rule_price<\/strong>. At the same time, when the minimum price is selected, the system checks status of the product&rsquo;s configurable option, its availability for a particular site and its availability. After determining the <strong>final_price<\/strong> of all options, the final price of the configurable product is determined, which will be equal to the lowest cost of its options.<\/p>\n<p>The <strong>final_price<\/strong> of the grouped product is equal to the smallest <strong>final_price<\/strong> of all the products in the group.<\/p>\n<p>For bundle products, the cost is calculated in the same way as for regular products + <strong>bundle_option<\/strong> &ndash; the cost of all the required options multiplied by their quantity.<\/p>\n<h3><span style=\"color: #000000\">How can you customize the price calculation process in Magento 2?<\/span><\/h3>\n<p>There are several ways to change the price calculation process:<\/p>\n<p>1. Create a new price type and add the set of basic types to it. To do this, you need to create your own module with a class that will implement the <em>Magento \\ Framework \\ Pricing \\ Price \\ BasePriceProviderInterface<\/em> interface and extend the <em>Magento \\ Framework \\ Pricing \\ Price \\ AbstractPrice<\/em> class, as well as add the necessary instructions to the module di-file:<\/p>\n<pre class=\"lang:default decode:true \">&lt;virtualType name=\"MyVendor\\MyModule\\Pricing\\Price\\Pool\" type=\"Magento\\Framework\\Pricing\\Price\\Pool\"&gt;\r\n   &lt;arguments&gt;\r\n       &lt;argument name=\"prices\" xsi:type=\"array\"&gt;\r\n           &lt;item name=\"my_price\" xsi:type=\"string\"&gt;MyVendor\\MyModule\\Pricing\\Price\\MyPrice&lt;\/item&gt;\r\n       &lt;\/argument&gt;\r\n       &lt;argument name=\"target\" xsi:type=\"object\"&gt;Magento\\Catalog\\Pricing\\Price\\Pool&lt;\/argument&gt;\r\n   &lt;\/arguments&gt;\r\n&lt;\/virtualType&gt;<\/pre>\n<p>2. Create a plugin for methods of the class of the price type to change the process of its calculation, for example, around the <strong>getValue ()<\/strong> method.<\/p>\n<p>3. Override the class that corresponds to the price type we need, for a specific type of product, using the di-file in its module:<\/p>\n<pre class=\"lang:default decode:true \">&lt;virtualType name=\"MyVendor\\MyModule\\Pricing\\Price\\Pool\" type=\"Magento\\Framework\\Pricing\\Price\\Pool\"&gt;\r\n   &lt;arguments&gt;\r\n       &lt;argument name=\"prices\" xsi:type=\"array\"&gt;\r\n           &lt;item name=\"regular_price\" xsi:type=\"string\"&gt;MyVendor\\MyModule\\Pricing\\Price\\MyRegularPrice&lt;\/item&gt;\r\n       &lt;\/argument&gt;\r\n   &lt;\/arguments&gt;\r\n&lt;\/virtualType&gt;<\/pre>\n<p>4. Completely override price class using the preference instruction in module di-file.<\/p>\n<h3><span style=\"color: #000000\">How is price rendered in Magento 2?<\/span><\/h3>\n<p>Let me demonstrate how the price display is formed taking the formation and display of the final_price of a regular product as an example. Class <em>Magento \\ Catalog \\ Pricing \\ Render \\ FinalPriceBox<\/em> is responsible for price display. The template that is used when displaying the contents of the block is <em>Magento_Catalog :: product \/ price \/ final_price.phtml<\/em>. In case a special price is se for the product, the user will be shown the old and new prices by means of calling the block&rsquo;s <strong>renderAmount ()<\/strong> method. Otherwise, only one final price will be displayed. In this case, the lowest price of all the possible ones will be selected. Then, if the product has options (for example, size), the cost of the cheapest option is displayed in a block.<\/p>\n<h3><span style=\"color: #000000\">How would you render price in a given place on the page, and how would you modify how the price is rendered?<\/span><\/h3>\n<p>In order to display the price in a certain part of the page, you need to add a block of <em>Magento\\Catalog\\Pricing\\Render<\/em> class to your layout and give it <strong>price_type_code<\/strong> parameter as an argument.<\/p>\n<pre class=\"lang:default decode:true \">&lt;block class=\"Magento\\Catalog\\Pricing\\Render\" name=\"product.price.myprice\"&gt;\r\n   &lt;arguments&gt;\r\n       &lt;argument name=\"price_render\" xsi:type=\"string\"&gt;product.price.render.default&lt;\/argument&gt;\r\n       &lt;argument name=\"price_type_code\" xsi:type=\"string\"&gt;final_price&lt;\/argument&gt;\r\n       &lt;argument name=\"zone\" xsi:type=\"string\"&gt;item_view&lt;\/argument&gt;\r\n   &lt;\/arguments&gt;\r\n&lt;\/block&gt;<\/pre>\n<p>Using data-arguments, you can change price box, amount renders &#1080; adjustment renders by editing their <strong>&#1089;ss-classes<\/strong>, <strong>id_suffix<\/strong>, <strong>id_prefix<\/strong>, etc.<\/p>\n<p>In order to change price display template, you can create your own <strong>catalog_product_prices.xml<\/strong>. There you can change the render.product.prices block, giving it the name of the block class and your template name as parameters for a certain price type.<\/p>\n<pre class=\"lang:default decode:true \">&lt;layout xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/layout_generic.xsd\"&gt;\r\n   &lt;referenceBlock name=\"render.product.prices\"&gt;\r\n       &lt;arguments&gt;\r\n           &lt;argument name=\"myprice\" xsi:type=\"array\"&gt;\r\n               &lt;item name=\"prices\" xsi:type=\"array\"&gt;\r\n                   &lt;item name=\"final_price\" xsi:type=\"array\"&gt;\r\n                       &lt;item name=\"render_class\" xsi:type=\"string\"&gt;MyVendor\\MyModule\\Pricing\\Render\\FinalPriceBox&lt;\/item&gt;\r\n                       &lt;item name=\"render_template\" xsi:type=\"string\"&gt;MyVendor_MyModule::product\/price\/final_price.phtml&lt;\/item&gt;\r\n                   &lt;\/item&gt;\r\n               &lt;\/item&gt;\r\n           &lt;\/argument&gt;\r\n       &lt;\/arguments&gt;\r\n   &lt;\/referenceBlock&gt;\r\n&lt;\/layout&gt;\r\n<\/pre>\n<h2 id=\"step_3\"><span style=\"color: #000000\">How to use and customize categories in Magento 2<\/span><\/h2>\n<p>Categories are significant elements of an online shop, for they are literally the roots of your <a href=\"https:\/\/belvg.com\/magento-inventory-management-integration\" target=\"_blank\" rel=\"noopener\">products<\/a> tree. They can and should be used to provide general and introductory information on your products or services to visitors. Therefore, it&rsquo;s very important to know how to manage and organize it correctly.<\/p>\n<h3><span style=\"color: #000000\">Category properties and features in Magento 2<\/span><\/h3>\n<p>To begin working with categories, log into your Magento 2 admin panel and go to <strong>Catalog<\/strong> -&gt; <strong>Categories<\/strong>. Click on any category you wish to configure.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/image3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18606\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/image3.png\" alt=\"magento 2 \" width=\"1788\" height=\"720\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>Each category has the following settings:<\/p>\n<ul>\n<li><strong>Enable Category<\/strong> &mdash; turn the category on or off for customer view.<\/li>\n<li><strong>Include in Menu<\/strong> &mdash; enable or disable the category in the top menu.<\/li>\n<li><strong>Category name<\/strong>.<\/li>\n<li><strong>Content<\/strong> tab with obligatory Category Image and Description fields. You can also include an additional CMS block by choosing it from the drop-down list.<\/li>\n<li><strong>Display settings<\/strong> tab contains rather important fields, so let&rsquo;s dwell on them a little bit longer.<br>\nIn the <strong>Display Mode<\/strong> drop down field you define how are products demonstrated in the category. It contains three options: <strong>Products only<\/strong>, <strong>Static block<\/strong> <strong>only<\/strong> and <strong>Static block and Products<\/strong>.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/display-settings.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18607\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/display-settings.png\" alt=\"display settings magento 2\" width=\"1283\" height=\"701\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<ul>\n<li>By enabling <strong>Anchor<\/strong>, you turn on layered navigation display for this category.<\/li>\n<\/ul>\n<p><strong>Search Engine Optimization<\/strong> tab allows to improve the search engine ranking of the category by filling in URL Key, Meta Title, Keywords and Description.<\/p>\n<p>In <strong>Products in Category<\/strong> tab you fill in the attributes of every product the category should contain: <strong>ID, Name, SKU, Visibility, Status, Price <\/strong>and <strong>Position<\/strong>.<\/p>\n<p><strong>Design<\/strong> tab contains category visual configuration fields, like <strong>Theme, Layout <\/strong>and <strong>Layout Update XML<\/strong>. If you enable <strong>Use Parent Category Settings<\/strong> button, the fields mentioned above will be set up like in the parent category. You can also enable <strong>Apply Design to Products<\/strong> button in order to unify category and product pages style.<\/p>\n<p>Set up in <strong>Schedule Design Update<\/strong> tab for how long the settings will apply to this category.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/schedule-design-update.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18608\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/schedule-design-update.png\" alt=\"schedule design update magento 2\" width=\"1084\" height=\"596\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p><strong>Layout Update Xml<\/strong> is used for adding xml instructions through the administrator interface.<\/p>\n<h3><span style=\"color: #000000\">How to create and manage categories in Magento 2?<\/span><\/h3>\n<p>Go to <strong>Catalog<\/strong> -&gt; <strong>Categories<\/strong> menu.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/categories-magento.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18609\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/categories-magento.png\" alt=\"categories magento 2\" width=\"1188\" height=\"616\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>In the left corner you need to choose the type of category you can create: <strong>Root Category<\/strong> or <strong>Subcategory<\/strong>.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/root-category-and-subcategory.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18610\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/root-category-and-subcategory.png\" alt=\"root category and subcategory\" width=\"1188\" height=\"616\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>The difference between a <strong>Root Category<\/strong> and a <strong>Subcategory<\/strong> is quite obvious &ndash; a root category is one large section of your product catalog, while a subcategory is a subsection of an already existing category (eg. Men&rsquo;s Apparel is a root category with a Men&rsquo;s Trousers subcategory).<\/p>\n<h3><span style=\"color: #000000\">How to implement&nbsp;the category hierarchy tree structure in Magento 2?<\/span><\/h3>\n<p>Magento 2 categories are organized in the form of a tree and can have any nesting.<\/p>\n<p>This picture demonstrates the structure of the catalog_category_entity table, where the data about category structure is stored.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/category-entity.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18611\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/category-entity.png\" alt=\"category entity Magento 2\" width=\"979\" height=\"243\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>The following columns are the main responsible for the category structure:<\/p>\n<ul>\n<li><strong>entity_id<\/strong> is category identification;<\/li>\n<li><strong>parent_id<\/strong> is the parent category id;<\/li>\n<li><strong>path<\/strong> is the category path from category tree in the form of sequential arrangement of entity_id categories, separated by slash (\/).<\/li>\n<\/ul>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/entity-id.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18612\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/entity-id.png\" alt=\"entity id magento 2\" width=\"911\" height=\"79\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>Root Categories are the records with parent_id = 0 value and value of entity_id = 1. The following subcategories tree construction occurs via the parent_id &lt;&mdash;&gt; entity_id relationship.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/root-category-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18613\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/root-category-1.png\" alt=\"root category 1\" width=\"1202\" height=\"203\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/root-category-2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18614\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/root-category-2.png\" alt=\"root category 2\" width=\"664\" height=\"113\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<h3><span style=\"color: #000000\">Which attribute values are required to display a new category in the store?<\/span><\/h3>\n<p>As you create a category, you assign it a certain Category name; based on it, URL Key, or the path leading to the category in the browser, is generated automatically.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/attribute-values-magento-2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18615\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/attribute-values-magento-2.png\" alt=\"attribute values magento 2\" width=\"1774\" height=\"583\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000\">What kind of strategies can you suggest for organizing products into categories?<\/span><\/h3>\n<p>The strategy of organizing products into categories usually depends on the specifics of your online shop, and it&rsquo;s where not only developers, but marketing specialists step into the game.<\/p>\n<p>You can organize items into categories according to target group of buyers (men, women, children, etc.) or their purpose (tourism, fitness, running, etc.) or whichever logic you believe is the most suitable. But please bear in mind that the products should share common attributes, based on which you will create a filter, like shirt size or color.<\/p>\n<h2 id=\"step_4\"><span style=\"color: #000000\">How to determine and manage catalog rules in Magento 2<\/span><\/h2>\n<h3><span style=\"color: #000000\">When would you use catalog price rules in Magento 2?<\/span><\/h3>\n<p>Giving a discount is a great way to attract new customers and retain the existing ones, that is why most online stores announce them &ndash; either seasonal or associated with a special occasion. In Magento 2 ecommerce platform the process of assigning discounts can be automated with the help of catalog price rules.<\/p>\n<h3><span style=\"color: #000000\">How do they impact performance in Magento 2?<\/span><\/h3>\n<p>Catalog price rules have minimum impact on page loading due to the fact that price calculations are performed during reindexing. So the larger the catalog price rule is, the longer reindexing will take.<\/p>\n<p>If you wish to make sure the performance is not overloaded by catalog price rules, take a look at Magento code. In the <em>vendor\\magento\\module-catalog-rule\\etc\\frontend\\events.xml<\/em> file we install the observer for <strong>catalog_product_get_final_price<\/strong> event.<\/p>\n<pre class=\"lang:default decode:true \">&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Event\/etc\/events.xsd\"&gt;\r\n   &lt;event name=\"catalog_product_get_final_price\"&gt;\r\n       &lt;observer name=\"catalogrule\" instance=\"Magento\\CatalogRule\\Observer\\ProcessFrontFinalPriceObserver\" \/&gt;\r\n   &lt;\/event&gt;\r\n   &lt;event name=\"prepare_catalog_product_collection_prices\"&gt;\r\n       &lt;observer name=\"catalogrule\" instance=\"Magento\\CatalogRule\\Observer\\PrepareCatalogProductCollectionPricesObserver\" \/&gt;\r\n   &lt;\/event&gt;\r\n&lt;\/config&gt;<\/pre>\n<p>Then we get the price from <em>magento\\module-catalog-rule\\Observer\\ProcessFrontFinalPriceObserver.php<\/em> file and set it up for the product.<\/p>\n<pre class=\"lang:default decode:true \">public function execute(\\Magento\\Framework\\Event\\Observer $observer)\r\n{\r\n   $product = $observer-&gt;getEvent()-&gt;getProduct();\r\n   $pId = $product-&gt;getId();\r\n   $storeId = $product-&gt;getStoreId();\r\n \r\n   if ($observer-&gt;hasDate()) {\r\n       $date = new \\DateTime($observer-&gt;getEvent()-&gt;getDate());\r\n   } else {\r\n       $date = $this-&gt;localeDate-&gt;scopeDate($storeId);\r\n   }\r\n \r\n   if ($observer-&gt;hasWebsiteId()) {\r\n       $wId = $observer-&gt;getEvent()-&gt;getWebsiteId();\r\n   } else {\r\n       $wId = $this-&gt;storeManager-&gt;getStore($storeId)-&gt;getWebsiteId();\r\n   }\r\n \r\n   if ($observer-&gt;hasCustomerGroupId()) {\r\n       $gId = $observer-&gt;getEvent()-&gt;getCustomerGroupId();\r\n   } elseif ($product-&gt;hasCustomerGroupId()) {\r\n       $gId = $product-&gt;getCustomerGroupId();\r\n   } else {\r\n       $gId = $this-&gt;customerSession-&gt;getCustomerGroupId();\r\n   }\r\n \r\n   $key = \"{$date-&gt;format('Y-m-d H:i:s')}|{$wId}|{$gId}|{$pId}\";\r\n   if (!$this-&gt;rulePricesStorage-&gt;hasRulePrice($key)) {\r\n       $rulePrice = $this-&gt;resourceRuleFactory-&gt;create()-&gt;getRulePrice($date, $wId, $gId, $pId);\r\n       $this-&gt;rulePricesStorage-&gt;setRulePrice($key, $rulePrice);\r\n   }\r\n   if ($this-&gt;rulePricesStorage-&gt;getRulePrice($key) !== false) {\r\n       $finalPrice = min($product-&gt;getData('final_price'), $this-&gt;rulePricesStorage-&gt;getRulePrice($key));\r\n       $product-&gt;setFinalPrice($finalPrice);\r\n   }\r\n   return $this;\r\n}<\/pre>\n<p>Now let&rsquo;s have a look at <strong>getRulePrice()<\/strong> method. Find this method in <em>Z:\\m2.loc\\vendor\\magento\\module-catalog-rule\\Model\\ResourceModel\\Rule.php <\/em>file and find this method here; <strong>getRulePrice()<\/strong> method will call the <strong>getRulePrices()<\/strong> that performs a simple inquiry to the <strong>catalogrule_product_price<\/strong> table from the database. And that is how you get the price.<\/p>\n<pre class=\"lang:default decode:true \">public function getRulePrice($date, $wId, $gId, $pId)\r\n{\r\n   $data = $this-&gt;getRulePrices($date, $wId, $gId, [$pId]);\r\n   if (isset($data[$pId])) {\r\n       return $data[$pId];\r\n   }\r\n \r\n   return false;\r\n}\r\n \r\n \r\npublic function getRulePrices(\\DateTimeInterface $date, $websiteId, $customerGroupId, $productIds)\r\n{\r\n   $connection = $this-&gt;getConnection();\r\n   $select = $connection-&gt;select()\r\n       -&gt;from($this-&gt;getTable('catalogrule_product_price'), ['product_id', 'rule_price'])\r\n       -&gt;where('rule_date = ?', $date-&gt;format('Y-m-d'))\r\n       -&gt;where('website_id = ?', $websiteId)\r\n       -&gt;where('customer_group_id = ?', $customerGroupId)\r\n       -&gt;where('product_id IN(?)', $productIds);\r\n \r\n   return $connection-&gt;fetchPairs($select);\r\n}<\/pre>\n<h3><span style=\"color: #000000\">How would you debug problems with catalog price rules in Magento 2?<\/span><\/h3>\n<p>The first step is to make sure the price rule is active; go to <strong>Marketing<\/strong> -&gt; <strong>Promotions<\/strong> -&gt; <strong>Catalog Price Rule<\/strong> and check if the status is set at active. Press <strong>Apply Rules<\/strong> button.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/catalog-price-rule-magento-2-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18617\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/catalog-price-rule-magento-2-1.png\" alt=\"catalog-price-rule-magento-2\" width=\"1920\" height=\"979\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>After that <strong>Catalog Rule Product<\/strong> indexes and<strong> Product Price<\/strong>, connected with it, is marked invalid.<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/index-management-magento-2-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18618\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/index-management-magento-2-1.png\" alt=\"index-management-magento-2\" width=\"1920\" height=\"979\" title=\"How to Use and Customize Magento 2 Catalog\"><\/a><\/p>\n<p>Meanwhile, in the controller <em>vendor\\magento\\module-catalog-rule\\Controller\\Adminhtml\\Promo\\Catalog\\ApplyRules.php<\/em><br>\nan increment of <em>\\Magento\\CatalogRule\\Model\\Rule\\Job<\/em> class is created; this increment calls the <strong>applyAll()<\/strong> method.<\/p>\n<pre class=\"lang:default decode:true \">public function execute()\r\n{\r\n   $errorMessage = __('We can\\'t apply the rules.');\r\n   try {\r\n       \/** @var Job $ruleJob *\/\r\n       $ruleJob = $this-&gt;_objectManager-&gt;get(\\Magento\\CatalogRule\\Model\\Rule\\Job::class);\r\n       $ruleJob-&gt;applyAll();\r\n \r\n       if ($ruleJob-&gt;hasSuccess()) {\r\n           $this-&gt;messageManager-&gt;addSuccess($ruleJob-&gt;getSuccess());\r\n           $this-&gt;_objectManager-&gt;create(\\Magento\\CatalogRule\\Model\\Flag::class)-&gt;loadSelf()-&gt;setState(0)-&gt;save();\r\n       } elseif ($ruleJob-&gt;hasError()) {\r\n           $this-&gt;messageManager-&gt;addError($errorMessage . ' ' . $ruleJob-&gt;getError());\r\n       }\r\n   } catch (\\Exception $e) {\r\n       $this-&gt;_objectManager-&gt;create(\\Psr\\Log\\LoggerInterface::class)-&gt;critical($e);\r\n       $this-&gt;messageManager-&gt;addError($errorMessage);\r\n   }\r\n \r\n   \/** @var \\Magento\\Backend\\Model\\View\\Result\\Redirect $resultRedirect *\/\r\n   $resultRedirect = $this-&gt;resultFactory-&gt;create(ResultFactory::TYPE_REDIRECT);\r\n   return $resultRedirect-&gt;setPath('catalog_rule\/*');\r\n}<\/pre>\n<p>In this method the index is marked as not valid:<\/p>\n<pre class=\"lang:default decode:true \">public function applyAll()\r\n{\r\n   try {\r\n       $this-&gt;ruleProcessor-&gt;markIndexerAsInvalid();\r\n       $this-&gt;setSuccess(__('Updated rules applied.'));\r\n   } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\r\n       $this-&gt;setError($e-&gt;getMessage());\r\n   }\r\n   return $this;\r\n}<\/pre>\n<p>Then we need to launch reindex and clear the cash.<br>\nbin\/magento indexer:reindex<br>\nbin\/magento cache:flush<\/p>\n<p>Afterwards, the rules will work, if, of course, price rule, its date ranges and conditions are configured correctly (date ranges and conditions).<\/p>\n<p>In case they don&rsquo;t work, you need to go to <strong>catalogrule_product_price<\/strong> table and check the product price there. If you found that the data is incorrect, check the logs or try to disable the third-party modules if you have some; you can also go over the <strong>Catalog Price Rule<\/strong> reindexing with Xdebug extension which will detect the issue.<\/p>\n<p>This is all on the topic of cart rules management in Magento 2. If you have any questions or comments, please leave them down below.<\/p>\n<p>Check our the&nbsp;Tier Prices Extended for Magento 2 that will significantly simplify the process of calculation product prices.<\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/store.belvg.com\/\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2016\/04\/Extensions_for_Magento_2.png\" width=\"120\" height=\"120\" alt=\"Extensions for Magento 2\" class=\"module_image\" title=\"How to Use and Customize Magento 2 Catalog\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Extensions by BelVG<\/h3><p class=\"module_content_text\">Take your online store to the next level <\/p><a href=\"https:\/\/store.belvg.com\/\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Download here<\/span><\/a><\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"This article is dedicated to a rather complex and wide topic from Magento 2 Backend &#8230;","protected":false},"author":82,"featured_media":18620,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,491,389,469,525,524,526],"tags":[],"class_list":["post-18596","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-magento","category-magento-2","category-magento2-development","category-magento2-tutorial","category-magento-seo","category-magento-speed-optimization","category-magento-theme","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Learn how to use and customize Magento 2 catalog, including products, categories and price rules. Discover Magento 2 tutorial written by certified developers.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Andrey Litvin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#article\",\"name\":\"How to Use and Customize Magento 2 Catalog | BelVG Blog\",\"headline\":\"How to Use and Customize Magento 2 Catalog\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/Artboard-1-11.png\",\"width\":1108,\"height\":590,\"caption\":\"How to Use and Customize Magento 2 Catalog: Products and Categories, Price and Price Rules\"},\"datePublished\":\"2019-01-29T14:59:18+02:00\",\"dateModified\":\"2023-10-31T18:47:07+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#webpage\"},\"articleSection\":\"Magento, Magento 2, Magento 2 Development, Magento 2 Tutorial, Magento SEO, Magento Speed Optimization, Magento Theme, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"position\":2,\"name\":\"Magento\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#listItem\",\"name\":\"How to Use and Customize Magento 2 Catalog\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#listItem\",\"position\":3,\"name\":\"How to Use and Customize Magento 2 Catalog\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin\",\"name\":\"Andrey Litvin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Andrey Litvin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html\",\"name\":\"How to Use and Customize Magento 2 Catalog | BelVG Blog\",\"description\":\"Learn how to use and customize Magento 2 catalog, including products, categories and price rules. Discover Magento 2 tutorial written by certified developers.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/Artboard-1-11.png\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html\\\/#mainImage\",\"width\":1108,\"height\":590,\"caption\":\"How to Use and Customize Magento 2 Catalog: Products and Categories, Price and Price Rules\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#mainImage\"},\"datePublished\":\"2019-01-29T14:59:18+02:00\",\"dateModified\":\"2023-10-31T18:47:07+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Use and Customize Magento 2 Catalog | BelVG Blog","description":"Learn how to use and customize Magento 2 catalog, including products, categories and price rules. Discover Magento 2 tutorial written by certified developers.","canonical_url":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#article","name":"How to Use and Customize Magento 2 Catalog | BelVG Blog","headline":"How to Use and Customize Magento 2 Catalog","author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/Artboard-1-11.png","width":1108,"height":590,"caption":"How to Use and Customize Magento 2 Catalog: Products and Categories, Price and Price Rules"},"datePublished":"2019-01-29T14:59:18+02:00","dateModified":"2023-10-31T18:47:07+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#webpage"},"articleSection":"Magento, Magento 2, Magento 2 Development, Magento 2 Tutorial, Magento SEO, Magento Speed Optimization, Magento Theme, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","position":2,"name":"Magento","item":"https:\/\/belvg.com\/blog\/category\/magento","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#listItem","name":"How to Use and Customize Magento 2 Catalog"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#listItem","position":3,"name":"How to Use and Customize Magento 2 Catalog","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author","url":"https:\/\/belvg.com\/blog\/author\/andrey-litvin","name":"Andrey Litvin","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Andrey Litvin"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#webpage","url":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html","name":"How to Use and Customize Magento 2 Catalog | BelVG Blog","description":"Learn how to use and customize Magento 2 catalog, including products, categories and price rules. Discover Magento 2 tutorial written by certified developers.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/Artboard-1-11.png","@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html\/#mainImage","width":1108,"height":590,"caption":"How to Use and Customize Magento 2 Catalog: Products and Categories, Price and Price Rules"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html#mainImage"},"datePublished":"2019-01-29T14:59:18+02:00","dateModified":"2023-10-31T18:47:07+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"18596","title":"How to Use and Customize Magento 2 Catalog | #site_title","description":"Learn how to use and customize Magento 2 catalog, including products, categories and price rules. Discover Magento 2 tutorial written by certified developers.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:36:54","updated":"2026-11-03 18:36:54"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento\" title=\"Magento\">Magento<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Use and Customize Magento 2 Catalog\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento","link":"https:\/\/belvg.com\/blog\/category\/magento"},{"label":"How to Use and Customize Magento 2 Catalog","link":"https:\/\/belvg.com\/blog\/how-to-use-and-customize-magento-2-catalog-products-and-categories-price-and-price-rules.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/18596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=18596"}],"version-history":[{"count":5,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/18596\/revisions"}],"predecessor-version":[{"id":27708,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/18596\/revisions\/27708"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/18620"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=18596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=18596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=18596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}