Skip to content

Instantly share code, notes, and snippets.

@antoinekociuba
antoinekociuba / observer.php
Last active Aug 29, 2015
Display out of stock options of Configurable products, depending on 'Show out of stock' system configuration setting.
View observer.php
<?php
/**
* Check if out of stock options of configurable products should be displayed
*/
public function checkDisplayOutOfStockOptions()
{
$currentProduct = Mage::registry('current_product');
if ($currentProduct && $currentProduct->isConfigurable()) {
if (Mage::getStoreConfigFlag(Mage_CatalogInventory_Helper_Data::XML_PATH_SHOW_OUT_OF_STOCK)) {
@ncla
ncla / dob.phtml
Last active Jul 14, 2018
Magento Date of Birth drop down boxes
View dob.phtml
<?php
/**
* @author iamncla @ github.com
* @see Mage_Customer_Block_Widget_Dob
*/
?>
<label for="<?php echo $this->getFieldId('month')?>"<?php if ($this->isRequired()) { echo ' class="required"'; } ?>><?php echo $this->__('Birthday') ?></label>
<div class="customer-dob">
<div class="dob-month">
<select name="<?php echo $this->getFieldName('month'); ?>" id="<?php echo $this->getFieldId('month'); ?>">
@jlong
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
You can’t perform that action at this time.