Skip to content

Instantly share code, notes, and snippets.

@jclecas
jclecas / customers_export_data.php
Created March 27, 2018 15:46
Magento 1 Export customers data and customers address
<?php
require_once 'log_tools.php';
/**
* Customers Export Data
*/
class Caudalie_Shell_Customers_Export_Data extends Caudalie_Shell_Log_Tools
{
protected $totalPages = null;
@jclecas
jclecas / GetMagento2ConfigValue.php
Last active March 22, 2018 16:06
Magento 2 // Get Config Value
<?php
use Magento\Framework\App\DeploymentConfig;
use Psr\Log\LoggerInterface;
class Config
{
const MAGENTO_CLOUD_VARIABLES_KEY = 'MAGENTO_CLOUD_VARIABLES';
const DEPLOYMENT_CONFIG_VARIABLES_KEY = 'caudalie';
@jclecas
jclecas / Config.php
Last active January 29, 2018 13:59
Magento 2 / Setup websites, stores, views with ID predefined
<?php
/**
* This file is part of Namespace\Websites\Helper for Magento 2.
*
* @license JC Lecas
* @author JC Lecas <jclecas@yahoo.fr>
* @category Namespace\Websites\Helper
*/
namespace Namespace\Websites\Helper;
@jclecas
jclecas / catalog-toolbar-move.js
Last active December 7, 2016 16:22
Move properly the toolbar in the right section in fonction of window size
if (jQuery(window).width() > 720) {
jQuery('.category-toolbar-left').prepend(jQuery('.toolbar'));
} else {
jQuery('.product-listing-container').prepend(jQuery('.toolbar'));
}
@jclecas
jclecas / customer_collection_join_attribute_table.php
Last active November 9, 2016 19:21
Magento Collection // Join on attribute table
<?php
/** @var Mage_Customer_Model_Resource_Customer_Collection $collection */
$collection = Mage::getModel('customer/customer')->getCollection();
$collection = $collection->joinAttribute(
'my_attribute',
'customer/my_attribute',
'entity_id',
null,
'left'
@jclecas
jclecas / Jcl_Catalog_Helper
Last active November 29, 2016 14:43
Magento Catalog Helper
// Magento Catalog Helpers
// Amasty, Data, Product