Blog
- Oct 23 2022
What is PWA
Categories: PWADonec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. - Categories: How to
Create the Block:
Inside the
Block
directory, create a Directory Add and PHP file namedAdd.php
.View this link for form validation method and this
Include form action from block
return $this->getUrl('training/post/addpost');
Add form key for security
<?php echo $block->getBlockHtml('formkey'); ?>
Add valition
data-mage-init='{"validation": {}}'
- Categories: How to<td><a href="<?= $escaper->escapeUrl($block->getUrl('blog/manage/edit', ['id'=>$escaper->escapeHtml($blog->getId())]))?>"><?= __('Edit') ?></a><
- Apr 09 2024
Rich snippets and Structured Data for Magento 2
Categories: SEOhttps://developers.google.com/search/docs/appearance/structured-data/image-license-metadata
https://search.google.com/test/rich-results
Install this module to show rich snippets on google search page
https://github.com/outeredge/magento-structured-data-module
https://developers.google.com/search/docs/appearance/structured-data
What are Rich Snippets?
Here’s an example:
- Apr 08 2024
How to create a new router in Magento 2?
<type name="Magento\Framework\App\RouterList">
<arguments>
<argument name="routerList" xsi:type="array">
<item name="routingExample" xsi:type="array">
<item name="class" xsi:type="string">ExampleCorp\RoutingExample\Controller\Router</item>
<item name="disable" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="string">40</item>
</item>
</argument>
</arguments>
</type>Creating the controller that will handle the
routing
- Categories: How to
We will create Blog.php under Model Folder
- Mar 06 2024
Magento 2 Setup
Categories: How toA step by step guide for Magento 2 setup on hosting or ubuntu.
- Mar 19 2024
Magento 2 Forms
Categories: How toLearn Magento 2 form Validation
https://www.thecoachsmb.com/a-complete-guide-on-magento-2-form-validation/
and
https://magecomp.com/blog/create-custom-form-in-magento-2-frontend/
Here is simple form example that make an ajax call
<?php
/** @var \Mageleap\Customform\Block\Index\Index $block */
?>
<div class="row"></div>
<form id="your-form-id" method="post" action="test.php" data-hasrequired="<?= $escaper->escapeHtmlAttr(__('* Required Fields')) ?>">
<div class="row">
<div class="col-md-6">
<div class="field city required">
<label class="label" - Apr 02 2024
Magento2: Create list with pager in frontend
Categories: How tohttps://webkul.com/blog/magento2-create-list-with-pager-in-frontend/
So first you have to check where you are getting collection. Most of time its coming from block and this blog also share how to do it when collection is coming from block.
Now go to your block file and add a _prepareLayout() function. This function render the layout of page as its visible from its name like we can set page title and other things also this function runs automatically.
See below function.
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->pageConfig->getTitle()->set(__('My Reward History'));
// Assuming $macAddress is available, get records for the given MAC address
$blockss_c = $this->getLayout()->createBlock('\Motoris\Vehiclelookup\Block\Cookie');
$macAddress = $blockss_c->get('customer_veh');
$records