Code Monkey home page Code Monkey logo

magento1-giftbox's Introduction

Okaeli_Giftbox


@category   Okaeli  
@package    Okaeli_Giftbox  
@author     Julien Loizelet <[email protected]>  
@copyright  Copyright (c)  2017 Julien Loizelet  
@license    GNU GENERAL PUBLIC LICENSE Version 3
  

Description

Okaeli_Giftbox is a Magento 1 extension that allowS you to add an sku (of a single product) in the cart. It can be usefull when the logistic needs an sku for a "giftbox" instead of the native gift wrap feature.

Warning

This extension is not a "plug and play" extension : you will need to do some css and probably other developments in order to satisfy your needs. As explain in the 'Installation' paragraph, you have to modify your source code too.

Installation

This extension can be installed with modman or composer.

Requirements

  • Magento >= 1.6 (probably much earlier, but I didn't test)

Modman

Run modman link /path/to/your/clone/of/this/repo at root of your Magento Project.

Composer

In your composer.json file, add

 {
"type": "vcs",
"url": "https://github.com/julienloizelet/magento1-giftbox"
 }

in the repositories part and

"okaeli/magento1-giftbox":"dev-master"

in the require part.

Usage

Configuration

This extension comes with some configurations : System Config > Okaeli > Okaeli Giftbox

  1. Enable / Disable Feature
  2. Define sku of the "Giftbox" (must be a single product sku)

How to use it ?

  • Add <?php echo $this->getChildHtml('okaeli.giftbox.form'); ?> somewhere in your '{your_theme}/template/checkout/cart.phtml' in order to call the Giftbox form.
  • Add <?php $_additional = unserialize($_item->getOptionByCode('info_buyRequest')->getValue());?> at the top of your '{your_theme}/template/checkout/cart/item/default.phtml'. With this, you will be able to manage a different design for the giftbox by testing with : <?php if(isset($_additional['giftbox'])):?>
  • For example : if you do not want to display the giftbox in the list of the item, you can wrap the full html of '{your_theme}/template/checkout/cart/item/default.phtml' with <?php if(!isset($_additional['giftbox'])):?>.

Technical Notes

No rewrite. Events driven development.

This extension is 0 rewrite guaranteed. The following event is listened:

  • sales_quote_remove_item : used to remove giftbox if there is no other product in cart.

Coding Standards

This extension has been checked with the Magento Extension Quality Program Coding Standard. You can find the output of the command phpcs /path/to/Okaeli/Giftbox/sources --standard=MEQP1 in this file.

Support

If you encounter any problems or bugs, please create an issue on GitHub.

Contribution

Any contribution is highly welcome. The best possibility to provide any code is to open a pull request on GitHub.

License

GNU General Public License, version 3 (GPLv3)

magento1-giftbox's People

Contributors

julienloizelet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.