Skip to content

Instantly share code, notes, and snippets.

@devjosh12
devjosh12 / addtocart-popup
Created February 1, 2015 20:49
add to cart from product list page and popup image and description
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@devjosh12
devjosh12 / zipvalidation
Created February 3, 2015 20:11
zipcode validation here free
http://connect20.magentocommerce.com/community/webskills_shippingrestriction
Copy Above URL in Below URL and Have Fun :...
http://freegento.com/ddl-magento-extension.php
@devjosh12
devjosh12 / unusedimages
Created February 10, 2015 10:00
delete unused product images from server
<?php
require_once 'app/Mage.php';
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
Mage::app();
$mageFilename = 'app/Mage.php';
if (!file_exists($mageFilename)) {
echo "not exist";
@devjosh12
devjosh12 / togglewithoutjs
Created February 12, 2015 16:25
toggle tabs without jQuery and javascript
<script type="text/javascript">
function toggleRow(id){
if(id === "link1"){
document.getElementById('link1').style.display = 'block';
document.getElementById('link2').style.display = 'none';
document.getElementById('link3').style.display = 'none';
}
else if(id === "link2"){
document.getElementById('link1').style.display = 'none';
@devjosh12
devjosh12 / loadproductswithajaxbycatid
Created February 16, 2015 19:25
load products with ajax by catid
$catid=Mage::registry('category_id');
$pageno = Mage::registry('page_no');
$catagory_model = Mage::getModel('catalog/category')->load($catid);
$_productCollection = Mage::getResourceModel('catalog/product_collection');
$_productCollection->addCategoryFilter($catagory_model);
$_productCollection->addAttributeToSelect('*');
$_productCollection->addAttributeToSelect('name');
$_productCollection->setPage($pageno, 3);
$_productCollection->load();
@devjosh12
devjosh12 / subcatgeoryinleftside
Created February 23, 2015 08:30
subcatgeory in left side
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@devjosh12
devjosh12 / neweditthumb
Created March 18, 2015 10:52
neweditthumb
<?php
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Edit Product</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.form.js"></script>
<style>
@devjosh12
devjosh12 / addpro
Last active August 29, 2015 14:17
addpro
<?php
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Add Product</title>
<!-- scripts -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
@devjosh12
devjosh12 / products
Created March 20, 2015 09:36
Products
<?php include('config.php'); ?>
<html>
<head>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="custom-script.js"></script>
<style>
#container {
border: 1px solid #000;
margin: 2% auto 0;
width: 100%;
@devjosh12
devjosh12 / checked
Created March 20, 2015 10:16
custom js checked
$(function () {
$('.btnGetAll').live("click",function () {
if ($('.chkNumber:checked').length) {
var chkId = '';
$('.chkNumber:checked').each(function () {
chkId += $(this).val() + ",";
});
chkId = chkId.slice(0, -1);
//alert(chkId);
$.ajax({