Friday, July 17, 2015

Oli

Oli

'Oli' is a good looking launching soon template suited for any digital agency and only costs $6. The HTML template comes in two layout options - intro text slider and countdown timer. 'Oli' actually caters for a lot of information and would be sufficient for any service industry business.

by Rob Hope via One Page Love

Easy Digital Downloads: Email Settings, Part 2

This week's JavaScript news, issue 241

This week's JavaScript news
Read this e-mail on the Web
JavaScript Weekly
Issue 241 — July 17, 2015
A GitHub-hosted online book about functional programming and related concepts in general, but leaning on JavaScript to make all of its points. One for the weekend.
Brian Lonsdorf

If you want to upgrade, it’s time to test. 3.0 introduces many changes, particularly in how show() and hide() work. Animations now use requestAnimationFrame, error cases no longer silently fail, jQuery.Deferred is now Promises/A+ compatible, and more.
Official jQuery Blog

As the beta version of Angular 2.0 approaches a transition plan for your current Angular 1.x efforts is essential. Our blog and webinar answer critical questions to ensure your apps are written to minimize effort and risk when migrating to Angular 2.
Rangle.io   Sponsored
Rangle.io

Google has released Polymer 1.0 but it’s incompatible with 0.5, so if you want to upgrade an existing app, you need to take care.
SitePoint

It’s renderer agnostic with the same API able to draw against multiple contexts: SVG, Canvas or WebGL.
jonobr1

A quick tour through the world of for-of vs for-in, laziness, infinite iteration, and generators.
Alex Gorbatchev

Jobs

  • Traction Software Engineer, Pixar Animation Studio (Emeryville, CA)Pixar Animation Studio’s Production Software team is looking for an experienced (3+ years) front-end Web developer open to working on the back-end too. Bring your JavaScript experiences to movie-making!
    Pixar
  • N4JS Software Engineer Hybrid Apps at NumberFour (Berlin, Germany)Challenge yourself. Use our statically-typed JavaScript dialect along with your web skills to help build a large-scale application platform. Come join our international team in Berlin.
    NumberFour AG
  • Senior Frontend DeveloperHi, we are moviepilot.com, the world’s largest community for fans to talk about pop culture. We are looking for a nice person who happens to be a Frontend Dev and enjoys building things using tools like React & Node.
    moviepilot.com

In brief

Curated by Peter Cooper and published by Cooper Press.

Stop getting JavaScript Weekly : Change email address : Read this issue on the Web

© Cooper Press Ltd. Office 30, Lincoln Way, Louth, LN11 0LS, UK


by via JavaScript Weekly

Understand Overriding in Magento: Models

In this series, we're exploring overriding features available in the Magento eCommerce system. In the previous article, we discussed how to override core block files using a custom module. Today, I'll extend it and demonstrate how you can override core model files using an XML-based configuration file.

Why Overriding Models?

In Magento, models play an important role as they implement most of the business logic of the core features. There are times when you need to change the flow or business logic in models to implement your custom features. 

It's tempting to go ahead and change the core files directly, which seems an easy and straightforward solution. Having said that, it's a bad practice, as it makes upgrading Magento really difficult. The more core files you modify directly, the more difficult it becomes for you to keep track of your changes and apply them during every version upgrade!

In this tutorial, we'll make a custom module to understand how model overriding works in Magento. In this custom module, we'll see how to override a category model class of the core "Catalog" module. Overriding works by setting up certain XML tags as per the conventions of Magento.

I assume that you're familiar with the basic module creation process in Magento. If not, here's a good article explaining the basics of custom module creation. Let's jump right in to the course of this tutorial!

A Glance at the Setup

Here's the list of files required for the desired setup:

  • app/etc/modules/Envato_All.xml: It's a file used to enable our custom module.
  • app/code/local/Envato/Catalog/etc/config.xml: It's a module configuration file in which we'll set up model class overriding using certain tags as per the Magento conventions.
  • app/code/local/Envato/Catalog/Model/Category.php: It's a model class of our custom module which will override the base model class.

Creating Files and Folders: Custom Module

First, we need to create a module enabler file. Create a file "app/etc/modules/Envato_All.xml" and paste the following contents in that file. We've used Envato as our module namespace and Catalog as our module name. It'll enable our "Catalog" module by default.

Next, we need to create a module configuration file. Create "app/code/local/Envato/Catalog/etc/config.xml" and paste the following contents in that file.

First, we've defined a module version number using the <version> tag. After that, the <catalog> and <rewrite> tags are used to inform the Magento overriding system that we're going to override a "model" of the "Catalog" core module.

Next, the <category> tag is used to define a model identity which will be overridden by the Envato_Catalog_Model_Category class. It's mapped to a model file "Category.php" under the "Model" directory of the Catalog module. An important thing to notice here is that we're following a directory structure similar to the core module. Although that's not strictly necessary, it's better than using a different directory structure, because it helps to maintain readability.

Finally, the only remaining thing is to define a model class Envato_Catalog_Model_Category. Let's create a model file "app/code/local/Envato/Catalog/Model/Category.php" and paste the following contents in that file.

We've defined an Envato_Catalog_Model_Category class which extends the core Mage_Catalog_Model_Category model class of the "Catalog" module. Thus, you can override every method of the base class and create new methods if necessary.

In the above example, the getProductCollection method is overridden so it'll be called instead of the method defined in the core model class! You can modify the model code as per your requirements. 

When you override any methods in models, you should make sure that the data type of the return value of that method matches with the data type of the base class method. Since model methods are called from several core modules, we should make sure that it doesn't break other features!

Although this is a very basic example, it serves the purpose of overriding the core model, and you can extend it as per your custom requirements.

Conclusion

In this tutorial, we learned how to override core model files in Magento using a custom module. In the next and last part of this overriding series, we'll see how to override core controller files. Don't hesitate to leave your comments below!


by Sajal Soni via Tuts+ Code

Absolut by Oak

Absolut by Oak

Impressive parallax scrolling landing page promoting the new 'Oak' range of vodka by Absolut. Thanks for the great build notes.

by Rob Hope via One Page Love

Free Icons: Web Development Icon Set

There are 200 beautiful icons in this icon set. The icons come in these file formats: PNG, SVG and EPS. Icons for GitHub and Stack Overflow, keyboards, computer monitors, mobile devices, I/O symbols and more are included in this versatile icon set.

This icon set is by Icons8.

Free Icons: Web Development Icon Set

Download

License

These icons are licensed under the very liberal and flexible Good Boy License.

Related Content

Icons8 is an icon search app. The Icons8 team is a small squad of designers and developers who are passionate about icons. Connect with Icons8 on Twitter, Facebook and GitHub.

The post Free Icons: Web Development Icon Set appeared first on Six Revisions.


by Jacob Gube via Six Revisions

Sharing: The Art and Science of Social Sharing

Do you create content for your business? Want to encourage people to share it? To explore the art and science of social sharing, I interview Bryan Kramer. More About This Show The Social Media Marketing podcast is an on-demand talk radio show from Social Media Examiner. It’s designed to help busy marketers and business owners […]

This post Sharing: The Art and Science of Social Sharing first appeared on Social Media Examiner.
Social Media Examiner - Your Guide to the Social Media Jungle


by Michael Stelzner via Social Media Examiner