Posted
on March 15, 2016, 5:52 pm,
by admin,
under
Magento 1.x.
Step 1: Add the following to your plugin’s app/code/local/Vendorname/Modulename/etc/config.xml file
<?xml version="1.0"?>
<config>
...
...
<crontab>
<jobs>
<hexacode_kleidoo>
<schedule>
<cron_expr>*/5 * * * *</cron_expr>
</schedule>
<run>
<model>vendorname_modulename/observer::mymethod</model>
</run>
</hexacode_kleidoo>
</jobs>
</crontab>
</config> |
Step 2: Create app/code/local/Vendorname/Modulename/Model/Observer.php file. We put it to Observer.php in this example but we could create a new class file for this purpose.
<?php
class Vendorname_Modulename_Model_Observer {
public function notifyorder($observer) {
// put here your business logic
}
} |
Step 3: Add a new entry to your crontab
*/5 * * * * wget -O /dev/null -q http://www.YOURDOMAIN.com/PATH_TO_MAGENTO/cron.php > /dev/null |
Posted
on March 14, 2016, 9:18 am,
by admin,
under
Magento 2.0.
Files involved:
app/code/Mika/CustomListing/etc/module.xml // a file setup module
app/code/Mika/CustomListing/Block/Rewrite/Product/ListingProduct.php // a block file used for rewriting ListingProduct.php |
Posted
on March 14, 2016, 9:16 am,
by admin,
under
Magento 2.0.
Step 1
Create Block File: $MAGENTO_DIR/app/code/Imran/Test/Block/Titles.php
<?php
namespace Imran\Test\Block;
class Titles extends \Magento\Framework\View\Element\Template
{
public function getTitle()
{
return "Mr";
}
} |
Step 2
Create Layout File: $MAGENTO_DIR/app/code/Imran/Test/view/layout/test_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title/>
</head>
<body>
<referenceContainer name="content">
<block class="Imran\Test\Block\Tiles" template="Imran_Test::landingpage.phtml"/>
</referenceContainer>
<referenceBlock name="test-block" remove="true"/>
</body>
</page> |
Step 3
Create Template phtml File: $MAGENTO_DIR/app/code/Imran/Test/view/templates/landingpage.phtml
<?php
echo $this->getTitle();
?> |
Posted
on March 14, 2016, 9:14 am,
by admin,
under
Magento 2.0.
Posted
on March 14, 2016, 9:12 am,
by admin,
under
Magento 2.0.
In this tutorial, you’ll learn how-to create a database driven custom Magento 2.0 widget. It takes you through step by step creation of all necessary php, xml and template files… Read the rest of this entry »