Magento 2.x Relationship Between Block, Template & Layout

Templates:: Templates define the designing look of a page, these are files with the phtml extension, containing html markup. Which a specific Template need to render is determined by the layout file.

Layout:: Layout defines the structure of the page, It is a collection of Containers & columns of page.

There are 5 types of page layout for the frontend & 3 types of page layout for the backend

5 Types of page layout for the frontend

  • Empty
  • 1Column
  • 2Columns-left
  • 2Columns-right
  • 3Columns

3 Types of page layout for the backend

  • Admin-empty
  • Admin-1column
  • Admin-2columns-left

Dynamic Block:: Dynamic module blocks are collection of multiple methods, those are used in templates files, these files are rendered by xml layout file

The XML layout file defines which block and which template file will be called.

You are working on a Magento 2.x store which will be selling in two countries. Each country has its own set of payment methods.

The following below solution for Magento 2.x store which will be selling in two countries. Each country has its own set of payment methods.

Create Two Websites as well as Two Store Views

Alexa.com Going to Retire on May 1, 2022

Alexa.com announced, the company stopped offering new subscriptions on December 8th, 2020 & will shut down the site on May 1st, 2022

Twenty-five years ago, we founded Alexa Internet. After two decades of helping you find, reach, and convert your digital audience, we’ve made the difficult decision to retire Alexa.com on May 1, 2022. Thank you for making us your go-to resource for content research, competitive analysis, keyword research, and so much more.,” wrote Alexa Internet’s official statement.

For more info click below link

https://alexa.com retiring on May 1st, 2022

Magento 2.x Use of Helper File of Module

Magento 2 module helper file used to include common method those are using in multiple places of that module.

Create Helper.php under your module.

Add below content in this file.

File Path=app/code/VendorName/ModuleName/Helper/Data.php

VendorName=Mage2db and ModuleName=John

<?php
namespace  Mage2db\John\Helper;
use Magento\Store\Model\StoreManagerInterface;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
	protected $storeManager; 

	/**
     * @param \Magento\Framework\App\Helper\Context $context
     */
	public function __construct
	(
   \Magento\Framework\App\Helper\Context $context,   StoreManagerInterface $storeManager
	) 
	{
	    $this->storeManager = $storeManager;	
		parent::__construct($context);
	}
	  
	public function getStoreManagerData()
    {
          //return $storeUrl = $this->storeManager->getStore()->getBaseUrl();
         // get Store Url without index.php
        return $storeUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB);
           // get Link Url of store
          // $storeLinkUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_DIRECT_LINK);
         // get media Base Url
        //  $storeMediaUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
      // get Static content Url
      // $storeStaticUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_STATIC);
    }
}

in above Helper/Data.php , we have defined getStoreManagerData()

By using below code, anywhere inside module we can use getStoreManagerData()

$this->helperData->getStoreManagerData();

Finally once all command method defined inside Helper/Data.php, we can use anywhere inside module.

Which Magento 2.x Database Tables Store Cart Price Rules

The following below Database Tables store Cart Price Rules

salesrule

salesrule_coupon

salesrule_coupon_aggregated

salesrule_coupon_aggregated_order

salesrule_coupon_aggregated_updated

salesrule_coupon_usage

salesrule_customer

salesrule_customer_group

salesrule_label

salesrule_product_attribute

salesrule_website

Magento 2 All Database Tables [500 & more Tables]


Which Magento 2 Database Tables Store Sales Order Data


Which Magento 2 Database Tables Store Sales Invoice Order Data


Which Magento 2 Database Tables Store Sales Tax and Its related Data


Which Magento 2 Database Tables Store Catalog Price Rules


Which Magento 2 Database Tables Store Shopping Cart Items


Which Magento 2 Database Table Store Sales Payment Transaction


Which Magento 2 Database Table store Sales Paypal Settlement Report


Which Magento 2 Database Table store Sales Paypal Payment Transaction