@category Okaeli
@package Okaeli_Giftbox
@author Julien Loizelet <[email protected]>
@copyright Copyright (c) 2017 Julien Loizelet
@license GNU GENERAL PUBLIC LICENSE Version 3
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.
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.
This extension can be installed with modman
or composer
.
- Magento >= 1.6 (probably much earlier, but I didn't test)
Run modman link /path/to/your/clone/of/this/repo
at root of your Magento Project.
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.
This extension comes with some configurations : System Config > Okaeli > Okaeli Giftbox
- Enable / Disable Feature
- Define sku of the "Giftbox" (must be a single product sku)
- 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'])):?>
.
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.
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.
If you encounter any problems or bugs, please create an issue on GitHub.
Any contribution is highly welcome. The best possibility to provide any code is to open a pull request on GitHub.