Skip to content

Instantly share code, notes, and snippets.

@peppeocchi
peppeocchi / exportConfigurables.php
Last active January 21, 2020 20:57
Magento Export configurable products ready for MAGMI import (columns sku, configurable_attributes, simples_skus)
<?php
/**
* This file should be placed into the `shell` folder
* You should need a table in your database with fields:
* - sku
* - configurable_attributes
* - simples_skus
*
*/
require_once 'abstract.php';
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}