Skip to content

Instantly share code, notes, and snippets.

View springerin's full-sized avatar
🏠
Working from home

Andra E. Lungu springerin

🏠
Working from home
View GitHub Profile
@elmogallen
elmogallen / BVSingleProductExample.js
Created February 10, 2014 16:04
How to use the Bazaarvoice API to completely handle styling and displaying the star rating and "Read reviews" links. Also shows an accurate number of reviews. Requires loading the bvapi.js first.
// PLACE THIS HTML where you want the star rating and "Read x Reviews" to show up
// <div id="bvReview" data-productid="3898"></div>
// ..................... Javascript for bazaarvoice reviews and ratings for a single product .................................
$(document).ready(function() {
// This part just readies the bvReview DIV to be filled with the star rating and a "Read reviews" link
var bvrrDiv = $('#bvReview');
var productId = bvrrDiv.attr("data-productid");
bvrrDiv.append("<div id='BVRRInlineRating-" + productId + "'>");
@kalenjordan
kalenjordan / Batched Iterator for Magento collections
Last active May 9, 2022 12:25
Batched iterator for Magento collections
// This is how you would use it. Pass in your collection
// along with an individual callback as well as a batch callback
Mage::getSingleton('stcore/resource_iterator_batched')->walk(
$collection,
array($this, 'batchIndividual'),
array($this, 'batchAfter'),
self::BATCH_SIZE
);
public function batchIndividual($model)
@colinmollenhour
colinmollenhour / cleanCache.php
Created May 17, 2012 00:50
Simplified cache cleaning script for production updates.
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* @author Colin Mollenhour
*/
umask(0);
ini_set('memory_limit','512M');