Javascript – addslashes and stripslashes

A Javascript function for add slashes: function addslashes(str) { str=str.replace(/\\/g,’\\\\’); str=str.replace(/\’/g,’\\\”); str=str.replace(/\”/g,’\\”‘); str=str.replace(/\0/g,’\\0’); return str; } A Javascript function for strip slashes: function stripslashes(str) {…

Magento get child products for a configurable product

Magento get products childs for a configurable product // $currentProduct = $this->getProduct(); $configurable_products = Mage::getModel(‘catalog/product_type_configurable’)->setProduct($currentProduct); $products_collection = $configurable_products->getUsedProductCollection()->addAttributeToSelect(‘*’)->addFilterByRequiredOptions(); foreach($products_collection as $_product){ echo $_product->getId() . “:…

Magento – Show Quantity Box in Products List

In file ‘list.phtml’ file change the <button> line near line 108 from this: <?php if($_product->isSaleable()): ?> <button class=”form-button” onclick=”setLocation(‘<?php echo $this->getAddToCartUrl($_product) ?<‘)”>>span> <?php echo $this->__(‘Add…