Sunday, October 21, 2018

Previous and next navigation buttons in magento2

Download official Magento marketplace extension Previous and next navigation buttons for magento2 that is successfully passed in extension quality program.

Please click here to download the extension.

Please check below screenshots to check the functionality of magento2 Previous and next navigation buttons extension:





Overview:



With the help of this extension, customers can easily browse all products one by one from product page without going back to category many times. It enhance store's usability and convenience for the customers and saves a lot of time that will help the store owners to bring more purchases. It allows visitors to easily navigate between product pages with a single click and highly reduces the time consumption.
Store owners can decide to enable/disable this extension and can change background and text color for the previous/next product and back to category also able to wheather to show product thumbnail or not on product pages.

Features:



  • Easy to install and manage.
  • Easy configuration.
  • Ability to enable/disable this extension from the admin configuration.
  • Ability to show a back to category button.
  • Ability to show a pop up for the next/previous product link as well as an image when hovering over the navigation buttons so that the customers could have an idea about what is the next/previous product to browse.
  • Store owners can change the next, previous and back to category button color and background as per website's look and feel.
  • Store owners can change the next, previous and back to category button text as per store's language.
  • Mobile friendly next, previous and back to category buttons.
  • Allow customers not to go back to the category and the product pages many times, which totally saves more time for them and boosts chance of ordering items.
  • No Magento2 core modifications.


Where did you hear about us in checkout and registration extension magento2

Download official Magento marketplace extension where did you hear about us for magento2 that is successfully passed in extension quality program.

Please click here to download the extension.

Please check below screenshots to check the functionality of magento2 where did you hear about us extension:










Overview:

This extension allows customers to select a "Where Did You Hear About Us ?" option during the checkout and registration processes to inform the store owner what lead the customer to come to the website. This information gets saved with the order, as well as with the report. It helps store owners to track a critical piece of information about the customers. It also helps store owners have an idea of how to choose accurate marketing options. One of the best features of this extension is, it provides to view the report of a customer-provided answer for the particular date in the admin panel so on the basis of the report, store owners can choose the best marketing option to promote his/her business that will definitely help to increase conversion rates. Also, store owners can add unlimited questions in the extension's configuration in the admin panel.
Store owners can easily decide to enable/disable this extension and have the ability to show "Where Did You Hear About Us ?" option on the shipping address, shipping method and payment method step of the checkout page.

Features:


  • Easy to install and manage.
  • Easy configuration.
  • It helps store owners to get useful informations about conversion sources.
  • Flexible and user-friendly interface.
  • It must work with all one-step checkout extension.
  • Ability to enable/disable this extension from the admin configuration.
  • Ability to add unlimited questions to the drop down on checkout and registration page.
  • Store owners can decide in which step of checkout page drop down of questions would be displayed.
  • Store owners can display drop down of questions to the shipping address, payment or shipping method steps.
  • Store owners can view the answer from the customers on the order view page in the admin.
  • Store owners have the ability to view a report of customers provided answers in the admin.
  • Store owners have the ability to export customers provided answers report in various formats such as Excel, CSV, and XML.
  • It does not override any kind of core code.

Saturday, March 11, 2017

Magento difference between Mage::getModel() and Mage::getSingleton()

Mage::getModel() will always return a new Object for the given model:

/**
 * Retrieve model object
 *
 * @link    Mage_Core_Model_Config::getModelInstance
 * @param   string $modelClass
 * @param   array|object $arguments
 * @return  Mage_Core_Model_Abstract|false
 */
public static function getModel($modelClass = '', $arguments = array())
{
    return self::getConfig()->getModelInstance($modelClass, $arguments);
}
Mage::getSingleton() will check whether the Object of the given model already exists and return that if it does. If it doesn't exist, it will create a new object of the given model and put in registry that it already exists. Next call will not return a new object but the existing one:

/**
 * Retrieve model object singleton
 *
 * @param   string $modelClass
 * @param   array $arguments
 * @return  Mage_Core_Model_Abstract
 */
public static function getSingleton($modelClass='', array $arguments=array())
{
    $registryKey = '_singleton/'.$modelClass;
    if (!self::registry($registryKey)) {
        self::register($registryKey, self::getModel($modelClass, $arguments));
    }
    return self::registry($registryKey);
}
In your case you always want a completely new Product object/model since every product is unique.

Extending / Overriding Magento controller

We can override any controller using our custom extension, so you will need to create below extension files and folders:-

For ex. here we are overriding checkout cart controller.


  • app/etc/modules/Namespace_YourModuleName.xml: It's a file used to enable our custom module.
  • app/code/local/Namespace/YourModuleName/etc/config.xml: It's a module configuration file in which we'll set up controller class overriding using certain tags as per the Magento conventions.
  • app/code/local/Namespace/YourModuleName/controllers/CartController.php: It's a custom controller class file which we'll use to override the core "Cart" controller class.
In your app/etc/modules/Namespace_YourModuleName.xml file, write below code:

<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Namespace_YourModuleName>
<active>true</active>
<codePool>local</codePool>
</Namespace_YourModuleName>
</modules>
</config>

In your app/code/local/Namespace/YourModuleName/etc/config.xml file, write below code:

<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Namespace_YourModuleName>
<version>0.1.0</version>
</Namespace_YourModuleName>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<Namespace_YourModuleName before="Mage_Checkout">Namespace_YourModuleName</Namespace_YourModuleName>
</modules>
</args>
</checkout>
</routers>
</frontend>
</config>


In your app/code/local/Namespace/YourModuleName/controllers/CartController.php file, write below code:

<?php
require_once 'Mage/Checkout/controllers/CartController.php';
class Namespace_YourModuleName_CartController extends Mage_Checkout_CartController
{
public function addAction()
{
echo 'I successfully Override Cart Controller';
parent::addAction();
}
public function indexAction()
{
echo 'I successfully Override Cart Controller';
parent::addAction();
}
}
?> 



Magento : Get Skin Url, Base Url , Media Url , Store Url , Js Url , and Current Url

Get Skin Url :-

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

Get Base Url :

Mage::getBaseUrl();

Secure Skin Url :

$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));

Unsecure Skin Url :

$this->getSkinUrl('images/imagename.jpg');

Get Media Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

Get Js Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

Get Store Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

Get Current Url

Mage::helper('core/url')->getCurrentUrl();

Get Url in cms pages or static blocks


Get Skin Url :

{{skin url='images/imagename.jpg'}}

Get Base Url :

{{store url=""}}

Get Media Url :

{{media url='/imagename.jpg'}}

Get Store Url :

{{store url='mypage.html'}}

Previous and next navigation buttons in magento2

Download official Magento marketplace extension Previous and next navigation buttons for magento2 that is successfully passed in extension ...