Version Notes
Bug fixing release
Download this release
Release Info
| Developer | Futurenext |
| Extension | Futurenext_Zakeke |
| Version | 1.0.0.8 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.0.7 to 1.0.0.8
- app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php +0 -36
- app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +0 -168
- app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +0 -302
- app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +0 -210
- app/code/community/Futurenext/Zakeke/Block/Adminhtml/Sales/Items/Column/Zakeke/Name.php +16 -20
- app/code/community/Futurenext/Zakeke/Block/CartItemRenderer.php +10 -25
- app/code/community/Futurenext/Zakeke/Block/CheckoutItemRenderer.php +14 -22
- app/code/community/Futurenext/Zakeke/Block/Sales/Order/Email/Items/Order/Default.php +0 -37
- app/code/community/Futurenext/Zakeke/Block/SalesItemRenderer.php +9 -16
- app/code/community/Futurenext/Zakeke/Block/View.php +3 -11
- app/code/community/Futurenext/Zakeke/Helper/Data.php +23 -7
- app/code/community/Futurenext/Zakeke/Helper/ZakekeApi.php +340 -457
- app/code/community/Futurenext/Zakeke/Model/Observer.php +78 -137
- app/code/community/Futurenext/Zakeke/controllers/CustomizeController.php +6 -11
- app/code/community/Futurenext/Zakeke/etc/config.xml +11 -6
- app/code/community/Futurenext/Zakeke/etc/system.xml +2 -12
- app/design/adminhtml/default/default/template/zakeke/sales/items/column/zakeke/name.phtml +1 -1
- app/design/adminhtml/default/default/template/zakeke/sales/order/invoice/create/items/renderer/zakeke.phtml +0 -26
- app/design/adminhtml/default/default/template/zakeke/sales/order/invoice/view/items/renderer/zakeke.phtml +0 -26
- app/design/frontend/base/default/layout/zakeke.xml +0 -41
- app/design/frontend/base/default/template/zakeke/checkout/onepage/review/item.phtml +0 -237
- app/design/frontend/base/default/template/zakeke/sales/order/items/renderer/zakeke.phtml +0 -349
- app/locale/it_IT/Futurenext_Zakeke.csv +2 -1
- package.xml +4 -4
- skin/frontend/base/default/css/zakeke/productview.css +0 -0
- skin/frontend/base/default/js/zakeke/preview.js +0 -45
app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php
DELETED
|
@@ -1,36 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* DISCLAIMER
|
| 16 |
-
*
|
| 17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
-
* versions in the future. If you wish to customize Magento for your
|
| 19 |
-
* needs please refer to http://www.magento.com for more information.
|
| 20 |
-
*
|
| 21 |
-
* @category Mage
|
| 22 |
-
* @package Mage_Downloadable
|
| 23 |
-
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
| 24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 25 |
-
*/
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Adminhtml block for fieldset of downloadable product
|
| 29 |
-
*
|
| 30 |
-
* @category Mage
|
| 31 |
-
* @package Mage_Adminhtml
|
| 32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
| 33 |
-
*/
|
| 34 |
-
class Mage_Downloadable_Block_Adminhtml_Catalog_Product_Composite_Fieldset_Downloadable extends Mage_Downloadable_Block_Catalog_Product_Links
|
| 35 |
-
{
|
| 36 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php
DELETED
|
@@ -1,168 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* DISCLAIMER
|
| 16 |
-
*
|
| 17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
-
* versions in the future. If you wish to customize Magento for your
|
| 19 |
-
* needs please refer to http://www.magento.com for more information.
|
| 20 |
-
*
|
| 21 |
-
* @category Mage
|
| 22 |
-
* @package Mage_Downloadable
|
| 23 |
-
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
| 24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 25 |
-
*/
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Adminhtml catalog product downloadable items tab and form
|
| 29 |
-
*
|
| 30 |
-
* @category Mage
|
| 31 |
-
* @package Mage_Downloadable
|
| 32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
| 33 |
-
*/
|
| 34 |
-
class Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable
|
| 35 |
-
extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface
|
| 36 |
-
{
|
| 37 |
-
|
| 38 |
-
/**
|
| 39 |
-
* Reference to product objects that is being edited
|
| 40 |
-
*
|
| 41 |
-
* @var Mage_Catalog_Model_Product
|
| 42 |
-
*/
|
| 43 |
-
protected $_product = null;
|
| 44 |
-
|
| 45 |
-
protected $_config = null;
|
| 46 |
-
|
| 47 |
-
/**
|
| 48 |
-
* Class constructor
|
| 49 |
-
*
|
| 50 |
-
*/
|
| 51 |
-
public function __construct()
|
| 52 |
-
{
|
| 53 |
-
parent::__construct();
|
| 54 |
-
// $this->setSkipGenerateContent(true);
|
| 55 |
-
$this->setTemplate('downloadable/product/edit/downloadable.phtml');
|
| 56 |
-
}
|
| 57 |
-
|
| 58 |
-
/**
|
| 59 |
-
* Get tab URL
|
| 60 |
-
*
|
| 61 |
-
* @return string
|
| 62 |
-
*/
|
| 63 |
-
// public function getTabUrl()
|
| 64 |
-
// {
|
| 65 |
-
// return $this->getUrl('downloadable/product_edit/form', array('_current' => true));
|
| 66 |
-
// }
|
| 67 |
-
|
| 68 |
-
/**
|
| 69 |
-
* Get tab class
|
| 70 |
-
*
|
| 71 |
-
* @return string
|
| 72 |
-
*/
|
| 73 |
-
// public function getTabClass()
|
| 74 |
-
// {
|
| 75 |
-
// return 'ajax';
|
| 76 |
-
// }
|
| 77 |
-
|
| 78 |
-
/**
|
| 79 |
-
* Check is readonly block
|
| 80 |
-
*
|
| 81 |
-
* @return boolean
|
| 82 |
-
*/
|
| 83 |
-
public function isReadonly()
|
| 84 |
-
{
|
| 85 |
-
return $this->getProduct()->getDownloadableReadonly();
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
/**
|
| 89 |
-
* Retrieve product
|
| 90 |
-
*
|
| 91 |
-
* @return Mage_Catalog_Model_Product
|
| 92 |
-
*/
|
| 93 |
-
public function getProduct()
|
| 94 |
-
{
|
| 95 |
-
return Mage::registry('current_product');
|
| 96 |
-
}
|
| 97 |
-
|
| 98 |
-
/**
|
| 99 |
-
* Get tab label
|
| 100 |
-
*
|
| 101 |
-
* @return string
|
| 102 |
-
*/
|
| 103 |
-
public function getTabLabel()
|
| 104 |
-
{
|
| 105 |
-
return Mage::helper('downloadable')->__('Downloadable Information');
|
| 106 |
-
}
|
| 107 |
-
|
| 108 |
-
/**
|
| 109 |
-
* Get tab title
|
| 110 |
-
*
|
| 111 |
-
* @return string
|
| 112 |
-
*/
|
| 113 |
-
public function getTabTitle()
|
| 114 |
-
{
|
| 115 |
-
return Mage::helper('downloadable')->__('Downloadable Information');
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
/**
|
| 119 |
-
* Check if tab can be displayed
|
| 120 |
-
*
|
| 121 |
-
* @return boolean
|
| 122 |
-
*/
|
| 123 |
-
public function canShowTab()
|
| 124 |
-
{
|
| 125 |
-
return true;
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
-
/**
|
| 129 |
-
* Check if tab is hidden
|
| 130 |
-
*
|
| 131 |
-
* @return boolean
|
| 132 |
-
*/
|
| 133 |
-
public function isHidden()
|
| 134 |
-
{
|
| 135 |
-
return false;
|
| 136 |
-
}
|
| 137 |
-
|
| 138 |
-
/**
|
| 139 |
-
* Render block HTML
|
| 140 |
-
*
|
| 141 |
-
* @return string
|
| 142 |
-
*/
|
| 143 |
-
protected function _toHtml()
|
| 144 |
-
{
|
| 145 |
-
$accordion = $this->getLayout()->createBlock('adminhtml/widget_accordion')
|
| 146 |
-
->setId('downloadableInfo');
|
| 147 |
-
|
| 148 |
-
$accordion->addItem('samples', array(
|
| 149 |
-
'title' => Mage::helper('adminhtml')->__('Samples'),
|
| 150 |
-
'content' => $this->getLayout()
|
| 151 |
-
->createBlock('downloadable/adminhtml_catalog_product_edit_tab_downloadable_samples')->toHtml(),
|
| 152 |
-
'open' => false,
|
| 153 |
-
));
|
| 154 |
-
|
| 155 |
-
$accordion->addItem('links', array(
|
| 156 |
-
'title' => Mage::helper('adminhtml')->__('Links'),
|
| 157 |
-
'content' => $this->getLayout()->createBlock(
|
| 158 |
-
'downloadable/adminhtml_catalog_product_edit_tab_downloadable_links',
|
| 159 |
-
'catalog.product.edit.tab.downloadable.links')->toHtml(),
|
| 160 |
-
'open' => true,
|
| 161 |
-
));
|
| 162 |
-
|
| 163 |
-
$this->setChild('accordion', $accordion);
|
| 164 |
-
|
| 165 |
-
return parent::_toHtml();
|
| 166 |
-
}
|
| 167 |
-
|
| 168 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php
DELETED
|
@@ -1,302 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* DISCLAIMER
|
| 16 |
-
*
|
| 17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
-
* versions in the future. If you wish to customize Magento for your
|
| 19 |
-
* needs please refer to http://www.magento.com for more information.
|
| 20 |
-
*
|
| 21 |
-
* @category Mage
|
| 22 |
-
* @package Mage_Downloadable
|
| 23 |
-
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
| 24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 25 |
-
*/
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Adminhtml catalog product downloadable items tab links section
|
| 29 |
-
*
|
| 30 |
-
* @category Mage
|
| 31 |
-
* @package Mage_Downloadable
|
| 32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
| 33 |
-
*/
|
| 34 |
-
class Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Links
|
| 35 |
-
extends Mage_Adminhtml_Block_Template
|
| 36 |
-
{
|
| 37 |
-
/**
|
| 38 |
-
* Purchased Separately Attribute cache
|
| 39 |
-
*
|
| 40 |
-
* @var Mage_Catalog_Model_Resource_Eav_Attribute
|
| 41 |
-
*/
|
| 42 |
-
protected $_purchasedSeparatelyAttribute = null;
|
| 43 |
-
|
| 44 |
-
/**
|
| 45 |
-
* Class constructor
|
| 46 |
-
*
|
| 47 |
-
*/
|
| 48 |
-
public function __construct()
|
| 49 |
-
{
|
| 50 |
-
parent::__construct();
|
| 51 |
-
$this->setTemplate('downloadable/product/edit/downloadable/links.phtml');
|
| 52 |
-
$this->setCanEditPrice(true);
|
| 53 |
-
$this->setCanReadPrice(true);
|
| 54 |
-
}
|
| 55 |
-
|
| 56 |
-
/**
|
| 57 |
-
* Get product that is being edited
|
| 58 |
-
*
|
| 59 |
-
* @return Mage_Catalog_Model_Product
|
| 60 |
-
*/
|
| 61 |
-
public function getProduct()
|
| 62 |
-
{
|
| 63 |
-
return Mage::registry('product');
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
/**
|
| 67 |
-
* Retrieve Purchased Separately Attribute object
|
| 68 |
-
*
|
| 69 |
-
* @return Mage_Catalog_Model_Resource_Eav_Attribute
|
| 70 |
-
*/
|
| 71 |
-
public function getPurchasedSeparatelyAttribute()
|
| 72 |
-
{
|
| 73 |
-
if (is_null($this->_purchasedSeparatelyAttribute)) {
|
| 74 |
-
$_attributeCode = 'links_purchased_separately';
|
| 75 |
-
|
| 76 |
-
$this->_purchasedSeparatelyAttribute = Mage::getModel('eav/entity_attribute')
|
| 77 |
-
->loadByCode(Mage_Catalog_Model_Product::ENTITY, $_attributeCode);
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
return $this->_purchasedSeparatelyAttribute;
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
/**
|
| 84 |
-
* Retrieve Purchased Separately HTML select
|
| 85 |
-
*
|
| 86 |
-
* @return string
|
| 87 |
-
*/
|
| 88 |
-
public function getPurchasedSeparatelySelect()
|
| 89 |
-
{
|
| 90 |
-
$select = $this->getLayout()->createBlock('adminhtml/html_select')
|
| 91 |
-
->setName('product[links_purchased_separately]')
|
| 92 |
-
->setId('downloadable_link_purchase_type')
|
| 93 |
-
->setOptions(Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray())
|
| 94 |
-
->setValue($this->getProduct()->getLinksPurchasedSeparately());
|
| 95 |
-
|
| 96 |
-
return $select->getHtml();
|
| 97 |
-
}
|
| 98 |
-
|
| 99 |
-
/**
|
| 100 |
-
* Retrieve Add button HTML
|
| 101 |
-
*
|
| 102 |
-
* @return string
|
| 103 |
-
*/
|
| 104 |
-
public function getAddButtonHtml()
|
| 105 |
-
{
|
| 106 |
-
$addButton = $this->getLayout()->createBlock('adminhtml/widget_button')
|
| 107 |
-
->setData(array(
|
| 108 |
-
'label' => Mage::helper('downloadable')->__('Add New Row'),
|
| 109 |
-
'id' => 'add_link_item',
|
| 110 |
-
'class' => 'add'
|
| 111 |
-
));
|
| 112 |
-
return $addButton->toHtml();
|
| 113 |
-
}
|
| 114 |
-
|
| 115 |
-
/**
|
| 116 |
-
* Retrieve default links title
|
| 117 |
-
*
|
| 118 |
-
* @return string
|
| 119 |
-
*/
|
| 120 |
-
public function getLinksTitle()
|
| 121 |
-
{
|
| 122 |
-
return Mage::getStoreConfig(Mage_Downloadable_Model_Link::XML_PATH_LINKS_TITLE);
|
| 123 |
-
}
|
| 124 |
-
|
| 125 |
-
/**
|
| 126 |
-
* Check exists defined links title
|
| 127 |
-
*
|
| 128 |
-
* @return bool
|
| 129 |
-
*/
|
| 130 |
-
public function getUsedDefault()
|
| 131 |
-
{
|
| 132 |
-
return $this->getProduct()->getAttributeDefaultValue('links_title') === false;
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
/**
|
| 136 |
-
* Return true if price in website scope
|
| 137 |
-
*
|
| 138 |
-
* @deprecated since 1.14.2.0
|
| 139 |
-
* @return bool
|
| 140 |
-
*/
|
| 141 |
-
public function getIsPriceWebsiteScope()
|
| 142 |
-
{
|
| 143 |
-
return Mage::helper('downloadable')->getIsPriceWebsiteScope();
|
| 144 |
-
}
|
| 145 |
-
|
| 146 |
-
/**
|
| 147 |
-
* Return array of links
|
| 148 |
-
*
|
| 149 |
-
* @return array
|
| 150 |
-
*/
|
| 151 |
-
public function getLinkData()
|
| 152 |
-
{
|
| 153 |
-
$linkArr = array();
|
| 154 |
-
$links = $this->getProduct()->getTypeInstance(true)->getLinks($this->getProduct());
|
| 155 |
-
$priceWebsiteScope = Mage::helper('downloadable')->getIsPriceWebsiteScope();
|
| 156 |
-
foreach ($links as $item) {
|
| 157 |
-
$tmpLinkItem = array(
|
| 158 |
-
'link_id' => $item->getId(),
|
| 159 |
-
'title' => $this->escapeHtml($item->getTitle()),
|
| 160 |
-
'price' => $this->getCanReadPrice() ? $this->getPriceValue($item->getPrice()) : '',
|
| 161 |
-
'number_of_downloads' => $item->getNumberOfDownloads(),
|
| 162 |
-
'is_shareable' => $item->getIsShareable(),
|
| 163 |
-
'link_url' => $item->getLinkUrl(),
|
| 164 |
-
'link_type' => $item->getLinkType(),
|
| 165 |
-
'sample_file' => $item->getSampleFile(),
|
| 166 |
-
'sample_url' => $item->getSampleUrl(),
|
| 167 |
-
'sample_type' => $item->getSampleType(),
|
| 168 |
-
'sort_order' => $item->getSortOrder(),
|
| 169 |
-
);
|
| 170 |
-
$file = Mage::helper('downloadable/file')->getFilePath(
|
| 171 |
-
Mage_Downloadable_Model_Link::getBasePath(), $item->getLinkFile()
|
| 172 |
-
);
|
| 173 |
-
|
| 174 |
-
if ($item->getLinkFile() && !is_file($file)) {
|
| 175 |
-
Mage::helper('core/file_storage_database')->saveFileToFilesystem($file);
|
| 176 |
-
}
|
| 177 |
-
|
| 178 |
-
if ($item->getLinkFile() && is_file($file)) {
|
| 179 |
-
$name = '<a href="'
|
| 180 |
-
. $this->getUrl('*/downloadable_product_edit/link', array(
|
| 181 |
-
'id' => $item->getId(),
|
| 182 |
-
'_secure' => true
|
| 183 |
-
)) . '">' . Mage::helper('downloadable/file')->getFileFromPathFile($item->getLinkFile()) . '</a>';
|
| 184 |
-
$tmpLinkItem['file_save'] = array(
|
| 185 |
-
array(
|
| 186 |
-
'file' => $item->getLinkFile(),
|
| 187 |
-
'name' => $name,
|
| 188 |
-
'size' => filesize($file),
|
| 189 |
-
'status' => 'old'
|
| 190 |
-
));
|
| 191 |
-
}
|
| 192 |
-
$sampleFile = Mage::helper('downloadable/file')->getFilePath(
|
| 193 |
-
Mage_Downloadable_Model_Link::getBaseSamplePath(), $item->getSampleFile()
|
| 194 |
-
);
|
| 195 |
-
if ($item->getSampleFile() && is_file($sampleFile)) {
|
| 196 |
-
$tmpLinkItem['sample_file_save'] = array(
|
| 197 |
-
array(
|
| 198 |
-
'file' => $item->getSampleFile(),
|
| 199 |
-
'name' => Mage::helper('downloadable/file')->getFileFromPathFile($item->getSampleFile()),
|
| 200 |
-
'size' => filesize($sampleFile),
|
| 201 |
-
'status' => 'old'
|
| 202 |
-
));
|
| 203 |
-
}
|
| 204 |
-
if ($item->getNumberOfDownloads() == '0') {
|
| 205 |
-
$tmpLinkItem['is_unlimited'] = ' checked="checked"';
|
| 206 |
-
}
|
| 207 |
-
if ($this->getProduct()->getStoreId() && $item->getStoreTitle()) {
|
| 208 |
-
$tmpLinkItem['store_title'] = $item->getStoreTitle();
|
| 209 |
-
}
|
| 210 |
-
if ($this->getProduct()->getStoreId() && $priceWebsiteScope) {
|
| 211 |
-
$tmpLinkItem['website_price'] = $item->getWebsitePrice();
|
| 212 |
-
}
|
| 213 |
-
$linkArr[] = new Varien_Object($tmpLinkItem);
|
| 214 |
-
}
|
| 215 |
-
return $linkArr;
|
| 216 |
-
}
|
| 217 |
-
|
| 218 |
-
/**
|
| 219 |
-
* Return formated price with two digits after decimal point
|
| 220 |
-
*
|
| 221 |
-
* @param decimal $value
|
| 222 |
-
* @return decimal
|
| 223 |
-
*/
|
| 224 |
-
public function getPriceValue($value)
|
| 225 |
-
{
|
| 226 |
-
return number_format($value, 2, null, '');
|
| 227 |
-
}
|
| 228 |
-
|
| 229 |
-
/**
|
| 230 |
-
* Retrieve max downloads value from config
|
| 231 |
-
*
|
| 232 |
-
* @return int
|
| 233 |
-
*/
|
| 234 |
-
public function getConfigMaxDownloads()
|
| 235 |
-
{
|
| 236 |
-
return Mage::getStoreConfig(Mage_Downloadable_Model_Link::XML_PATH_DEFAULT_DOWNLOADS_NUMBER);
|
| 237 |
-
}
|
| 238 |
-
|
| 239 |
-
/**
|
| 240 |
-
* Prepare block Layout
|
| 241 |
-
*
|
| 242 |
-
*/
|
| 243 |
-
protected function _prepareLayout()
|
| 244 |
-
{
|
| 245 |
-
$this->setChild(
|
| 246 |
-
'upload_button',
|
| 247 |
-
$this->getLayout()->createBlock('adminhtml/widget_button')->addData(array(
|
| 248 |
-
'id' => '',
|
| 249 |
-
'label' => Mage::helper('adminhtml')->__('Upload Files'),
|
| 250 |
-
'type' => 'button',
|
| 251 |
-
'onclick' => 'Downloadable.massUploadByType(\'links\');Downloadable.massUploadByType(\'linkssample\')'
|
| 252 |
-
))
|
| 253 |
-
);
|
| 254 |
-
}
|
| 255 |
-
|
| 256 |
-
/**
|
| 257 |
-
* Retrieve Upload button HTML
|
| 258 |
-
*
|
| 259 |
-
* @return string
|
| 260 |
-
*/
|
| 261 |
-
public function getUploadButtonHtml()
|
| 262 |
-
{
|
| 263 |
-
return $this->getChild('upload_button')->toHtml();
|
| 264 |
-
}
|
| 265 |
-
|
| 266 |
-
/**
|
| 267 |
-
* Retrive config json
|
| 268 |
-
*
|
| 269 |
-
* @return string
|
| 270 |
-
*/
|
| 271 |
-
public function getConfigJson($type='links')
|
| 272 |
-
{
|
| 273 |
-
$this->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()
|
| 274 |
-
->getUrl('*/downloadable_file/upload', array('type' => $type, '_secure' => true)));
|
| 275 |
-
$this->getConfig()->setParams(array('form_key' => $this->getFormKey()));
|
| 276 |
-
$this->getConfig()->setFileField($type);
|
| 277 |
-
$this->getConfig()->setFilters(array(
|
| 278 |
-
'all' => array(
|
| 279 |
-
'label' => Mage::helper('adminhtml')->__('All Files'),
|
| 280 |
-
'files' => array('*.*')
|
| 281 |
-
)
|
| 282 |
-
));
|
| 283 |
-
$this->getConfig()->setReplaceBrowseWithRemove(true);
|
| 284 |
-
$this->getConfig()->setWidth('32');
|
| 285 |
-
$this->getConfig()->setHideUploadButton(true);
|
| 286 |
-
return Mage::helper('core')->jsonEncode($this->getConfig()->getData());
|
| 287 |
-
}
|
| 288 |
-
|
| 289 |
-
/**
|
| 290 |
-
* Retrive config object
|
| 291 |
-
*
|
| 292 |
-
* @return Varien_Config
|
| 293 |
-
*/
|
| 294 |
-
public function getConfig()
|
| 295 |
-
{
|
| 296 |
-
if(is_null($this->_config)) {
|
| 297 |
-
$this->_config = new Varien_Object();
|
| 298 |
-
}
|
| 299 |
-
|
| 300 |
-
return $this->_config;
|
| 301 |
-
}
|
| 302 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Futurenext/Zakeke/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php
DELETED
|
@@ -1,210 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* DISCLAIMER
|
| 16 |
-
*
|
| 17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
-
* versions in the future. If you wish to customize Magento for your
|
| 19 |
-
* needs please refer to http://www.magento.com for more information.
|
| 20 |
-
*
|
| 21 |
-
* @category Mage
|
| 22 |
-
* @package Mage_Downloadable
|
| 23 |
-
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
| 24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 25 |
-
*/
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Adminhtml catalog product downloadable items tab links section
|
| 29 |
-
*
|
| 30 |
-
* @category Mage
|
| 31 |
-
* @package Mage_Downloadable
|
| 32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
| 33 |
-
*/
|
| 34 |
-
class Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Samples
|
| 35 |
-
extends Mage_Adminhtml_Block_Widget
|
| 36 |
-
{
|
| 37 |
-
/**
|
| 38 |
-
* Class constructor
|
| 39 |
-
*
|
| 40 |
-
*/
|
| 41 |
-
public function __construct()
|
| 42 |
-
{
|
| 43 |
-
parent::__construct();
|
| 44 |
-
$this->setTemplate('downloadable/product/edit/downloadable/samples.phtml');
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
/**
|
| 48 |
-
* Get model of the product that is being edited
|
| 49 |
-
*
|
| 50 |
-
* @return Mage_Catalog_Model_Product
|
| 51 |
-
*/
|
| 52 |
-
public function getProduct()
|
| 53 |
-
{
|
| 54 |
-
return Mage::registry('current_product');
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
/**
|
| 58 |
-
* Check block is readonly
|
| 59 |
-
*
|
| 60 |
-
* @return boolean
|
| 61 |
-
*/
|
| 62 |
-
public function isReadonly()
|
| 63 |
-
{
|
| 64 |
-
return $this->getProduct()->getDownloadableReadonly();
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
/**
|
| 69 |
-
* Retrieve Add Button HTML
|
| 70 |
-
*
|
| 71 |
-
* @return string
|
| 72 |
-
*/
|
| 73 |
-
public function getAddButtonHtml()
|
| 74 |
-
{
|
| 75 |
-
$addButton = $this->getLayout()->createBlock('adminhtml/widget_button')
|
| 76 |
-
->setData(array(
|
| 77 |
-
'label' => Mage::helper('downloadable')->__('Add New Row'),
|
| 78 |
-
'id' => 'add_sample_item',
|
| 79 |
-
'class' => 'add',
|
| 80 |
-
));
|
| 81 |
-
return $addButton->toHtml();
|
| 82 |
-
}
|
| 83 |
-
|
| 84 |
-
/**
|
| 85 |
-
* Retrieve samples array
|
| 86 |
-
*
|
| 87 |
-
* @return array
|
| 88 |
-
*/
|
| 89 |
-
public function getSampleData()
|
| 90 |
-
{
|
| 91 |
-
$samplesArr = array();
|
| 92 |
-
$samples = $this->getProduct()->getTypeInstance(true)->getSamples($this->getProduct());
|
| 93 |
-
foreach ($samples as $item) {
|
| 94 |
-
$tmpSampleItem = array(
|
| 95 |
-
'sample_id' => $item->getId(),
|
| 96 |
-
'title' => $this->escapeHtml($item->getTitle()),
|
| 97 |
-
'sample_url' => $item->getSampleUrl(),
|
| 98 |
-
'sample_type' => $item->getSampleType(),
|
| 99 |
-
'sort_order' => $item->getSortOrder(),
|
| 100 |
-
);
|
| 101 |
-
$file = Mage::helper('downloadable/file')->getFilePath(
|
| 102 |
-
Mage_Downloadable_Model_Sample::getBasePath(), $item->getSampleFile()
|
| 103 |
-
);
|
| 104 |
-
if ($item->getSampleFile() && !is_file($file)) {
|
| 105 |
-
Mage::helper('core/file_storage_database')->saveFileToFilesystem($file);
|
| 106 |
-
}
|
| 107 |
-
if ($item->getSampleFile() && is_file($file)) {
|
| 108 |
-
$tmpSampleItem['file_save'] = array(
|
| 109 |
-
array(
|
| 110 |
-
'file' => $item->getSampleFile(),
|
| 111 |
-
'name' => Mage::helper('downloadable/file')->getFileFromPathFile($item->getSampleFile()),
|
| 112 |
-
'size' => filesize($file),
|
| 113 |
-
'status' => 'old'
|
| 114 |
-
));
|
| 115 |
-
}
|
| 116 |
-
if ($this->getProduct() && $item->getStoreTitle()) {
|
| 117 |
-
$tmpSampleItem['store_title'] = $item->getStoreTitle();
|
| 118 |
-
}
|
| 119 |
-
$samplesArr[] = new Varien_Object($tmpSampleItem);
|
| 120 |
-
}
|
| 121 |
-
|
| 122 |
-
return $samplesArr;
|
| 123 |
-
}
|
| 124 |
-
|
| 125 |
-
/**
|
| 126 |
-
* Check exists defined samples title
|
| 127 |
-
*
|
| 128 |
-
* @return bool
|
| 129 |
-
*/
|
| 130 |
-
public function getUsedDefault()
|
| 131 |
-
{
|
| 132 |
-
return $this->getProduct()->getAttributeDefaultValue('samples_title') === false;
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
/**
|
| 136 |
-
* Retrieve Default samples title
|
| 137 |
-
*
|
| 138 |
-
* @return string
|
| 139 |
-
*/
|
| 140 |
-
public function getSamplesTitle()
|
| 141 |
-
{
|
| 142 |
-
return Mage::getStoreConfig(Mage_Downloadable_Model_Sample::XML_PATH_SAMPLES_TITLE);
|
| 143 |
-
}
|
| 144 |
-
|
| 145 |
-
/**
|
| 146 |
-
* Prepare layout
|
| 147 |
-
*
|
| 148 |
-
*/
|
| 149 |
-
protected function _prepareLayout()
|
| 150 |
-
{
|
| 151 |
-
$this->setChild(
|
| 152 |
-
'upload_button',
|
| 153 |
-
$this->getLayout()->createBlock('adminhtml/widget_button')
|
| 154 |
-
->addData(array(
|
| 155 |
-
'id' => '',
|
| 156 |
-
'label' => Mage::helper('adminhtml')->__('Upload Files'),
|
| 157 |
-
'type' => 'button',
|
| 158 |
-
'onclick' => 'Downloadable.massUploadByType(\'samples\')'
|
| 159 |
-
))
|
| 160 |
-
);
|
| 161 |
-
}
|
| 162 |
-
|
| 163 |
-
/**
|
| 164 |
-
* Retrieve Upload button HTML
|
| 165 |
-
*
|
| 166 |
-
* @return string
|
| 167 |
-
*/
|
| 168 |
-
public function getUploadButtonHtml()
|
| 169 |
-
{
|
| 170 |
-
return $this->getChild('upload_button')->toHtml();
|
| 171 |
-
}
|
| 172 |
-
|
| 173 |
-
/**
|
| 174 |
-
* Retrive config json
|
| 175 |
-
*
|
| 176 |
-
* @return string
|
| 177 |
-
*/
|
| 178 |
-
public function getConfigJson()
|
| 179 |
-
{
|
| 180 |
-
$this->getConfig()->setUrl(Mage::getModel('adminhtml/url')
|
| 181 |
-
->addSessionParam()
|
| 182 |
-
->getUrl('*/downloadable_file/upload', array('type' => 'samples', '_secure' => true)));
|
| 183 |
-
$this->getConfig()->setParams(array('form_key' => $this->getFormKey()));
|
| 184 |
-
$this->getConfig()->setFileField('samples');
|
| 185 |
-
$this->getConfig()->setFilters(array(
|
| 186 |
-
'all' => array(
|
| 187 |
-
'label' => Mage::helper('adminhtml')->__('All Files'),
|
| 188 |
-
'files' => array('*.*')
|
| 189 |
-
)
|
| 190 |
-
));
|
| 191 |
-
$this->getConfig()->setReplaceBrowseWithRemove(true);
|
| 192 |
-
$this->getConfig()->setWidth('32');
|
| 193 |
-
$this->getConfig()->setHideUploadButton(true);
|
| 194 |
-
return Mage::helper('core')->jsonEncode($this->getConfig()->getData());
|
| 195 |
-
}
|
| 196 |
-
|
| 197 |
-
/**
|
| 198 |
-
* Retrive config object
|
| 199 |
-
*
|
| 200 |
-
* @return Varien_Config
|
| 201 |
-
*/
|
| 202 |
-
public function getConfig()
|
| 203 |
-
{
|
| 204 |
-
if(is_null($this->_config)) {
|
| 205 |
-
$this->_config = new Varien_Object();
|
| 206 |
-
}
|
| 207 |
-
|
| 208 |
-
return $this->_config;
|
| 209 |
-
}
|
| 210 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Futurenext/Zakeke/Block/Adminhtml/Sales/Items/Column/Zakeke/Name.php
CHANGED
|
@@ -26,20 +26,11 @@ class Futurenext_Zakeke_Block_Adminhtml_Sales_Items_Column_Zakeke_Name extends M
|
|
| 26 |
* @throws Exception
|
| 27 |
*/
|
| 28 |
try {
|
| 29 |
-
$
|
| 30 |
-
if (!$
|
| 31 |
return false;
|
| 32 |
}
|
| 33 |
-
|
| 34 |
-
foreach ($additionalOptions as $option) {
|
| 35 |
-
if (!isset($option['is_zakeke'])) {
|
| 36 |
-
continue;
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
return $option;
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
return false;
|
| 43 |
} catch (Exception $e) {
|
| 44 |
Mage::logException($e);
|
| 45 |
throw $e;
|
|
@@ -94,15 +85,16 @@ class Futurenext_Zakeke_Block_Adminhtml_Sales_Items_Column_Zakeke_Name extends M
|
|
| 94 |
return false;
|
| 95 |
}
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
|
|
|
| 99 |
$zakekeOption = $this->getZakekeOption();
|
| 100 |
if (isset($zakekeOption['previews'])) {
|
| 101 |
-
|
| 102 |
}
|
| 103 |
-
}
|
| 104 |
|
| 105 |
-
|
|
|
|
| 106 |
} catch (Exception $e) {
|
| 107 |
Mage::logException($e);
|
| 108 |
throw $e;
|
|
@@ -112,7 +104,7 @@ class Futurenext_Zakeke_Block_Adminhtml_Sales_Items_Column_Zakeke_Name extends M
|
|
| 112 |
/**
|
| 113 |
* Get the Zakeke design output zip url
|
| 114 |
*
|
| 115 |
-
* @return
|
| 116 |
* @throws Exception
|
| 117 |
*/
|
| 118 |
public function getZakekeOutputZip()
|
|
@@ -125,8 +117,12 @@ class Futurenext_Zakeke_Block_Adminhtml_Sales_Items_Column_Zakeke_Name extends M
|
|
| 125 |
if (!$zakekeDesignId) {
|
| 126 |
return false;
|
| 127 |
}
|
| 128 |
-
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
} catch (Exception $e) {
|
| 131 |
Mage::logException($e);
|
| 132 |
throw $e;
|
| 26 |
* @throws Exception
|
| 27 |
*/
|
| 28 |
try {
|
| 29 |
+
$options = $this->getItem()->getProductOptionByCode('additional_options');
|
| 30 |
+
if (!$options) {
|
| 31 |
return false;
|
| 32 |
}
|
| 33 |
+
return Futurenext_Zakeke_Helper_Data::getZakekeOption($options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
} catch (Exception $e) {
|
| 35 |
Mage::logException($e);
|
| 36 |
throw $e;
|
| 85 |
return false;
|
| 86 |
}
|
| 87 |
|
| 88 |
+
try {
|
| 89 |
+
return $zakekeApi->getPreview($zakekeDesignId);
|
| 90 |
+
} catch (Exception $e) {
|
| 91 |
$zakekeOption = $this->getZakekeOption();
|
| 92 |
if (isset($zakekeOption['previews'])) {
|
| 93 |
+
return $zakekeOption['previews'];
|
| 94 |
}
|
|
|
|
| 95 |
|
| 96 |
+
return false;
|
| 97 |
+
}
|
| 98 |
} catch (Exception $e) {
|
| 99 |
Mage::logException($e);
|
| 100 |
throw $e;
|
| 104 |
/**
|
| 105 |
* Get the Zakeke design output zip url
|
| 106 |
*
|
| 107 |
+
* @return string|false
|
| 108 |
* @throws Exception
|
| 109 |
*/
|
| 110 |
public function getZakekeOutputZip()
|
| 117 |
if (!$zakekeDesignId) {
|
| 118 |
return false;
|
| 119 |
}
|
| 120 |
+
try {
|
| 121 |
+
$zipUrl = $zakekeApi->getZakekeOutputZip($zakekeDesignId);
|
| 122 |
+
return $zipUrl;
|
| 123 |
+
} catch (Exception $e) {
|
| 124 |
+
return false;
|
| 125 |
+
}
|
| 126 |
} catch (Exception $e) {
|
| 127 |
Mage::logException($e);
|
| 128 |
throw $e;
|
app/code/community/Futurenext/Zakeke/Block/CartItemRenderer.php
CHANGED
|
@@ -17,23 +17,11 @@
|
|
| 17 |
*/
|
| 18 |
class Futurenext_Zakeke_Block_CartItemRenderer extends Mage_Checkout_Block_Cart_Item_Renderer
|
| 19 |
{
|
| 20 |
-
/**
|
| 21 |
-
* Get access to the Zakeke API
|
| 22 |
-
*
|
| 23 |
-
* @return Futurenext_Zakeke_Helper_ZakekeApi
|
| 24 |
-
*/
|
| 25 |
-
protected function getZakekeApi()
|
| 26 |
-
{
|
| 27 |
-
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 28 |
-
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 29 |
-
return $zakekeApi;
|
| 30 |
-
}
|
| 31 |
-
|
| 32 |
/**
|
| 33 |
* Get the Zakeke design previews
|
| 34 |
*
|
| 35 |
-
* @return array|false
|
| 36 |
* @throws Exception
|
|
|
|
| 37 |
*/
|
| 38 |
public function getZakekePreviews()
|
| 39 |
{
|
|
@@ -45,24 +33,21 @@ class Futurenext_Zakeke_Block_CartItemRenderer extends Mage_Checkout_Block_Cart_
|
|
| 45 |
return false;
|
| 46 |
}
|
| 47 |
|
| 48 |
-
$
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
}
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
}
|
| 59 |
-
return $previews;
|
| 60 |
}
|
|
|
|
| 61 |
} catch (Exception $e) {
|
| 62 |
Mage::logException($e);
|
| 63 |
throw $e;
|
| 64 |
}
|
| 65 |
-
return false;
|
| 66 |
}
|
| 67 |
|
| 68 |
/**
|
| 17 |
*/
|
| 18 |
class Futurenext_Zakeke_Block_CartItemRenderer extends Mage_Checkout_Block_Cart_Item_Renderer
|
| 19 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
/**
|
| 21 |
* Get the Zakeke design previews
|
| 22 |
*
|
|
|
|
| 23 |
* @throws Exception
|
| 24 |
+
* @return array|false
|
| 25 |
*/
|
| 26 |
public function getZakekePreviews()
|
| 27 |
{
|
| 33 |
return false;
|
| 34 |
}
|
| 35 |
|
| 36 |
+
$options = (array)unserialize($additionalOption->getValue());
|
| 37 |
+
$option = Futurenext_Zakeke_Helper_Data::getZakekeOption($options);
|
| 38 |
+
if (!$option) {
|
| 39 |
+
return false;
|
| 40 |
+
}
|
|
|
|
| 41 |
|
| 42 |
+
$previews = array();
|
| 43 |
+
if (isset($option['previews'])) {
|
| 44 |
+
$previews = $option['previews'];
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
+
return $previews;
|
| 47 |
} catch (Exception $e) {
|
| 48 |
Mage::logException($e);
|
| 49 |
throw $e;
|
| 50 |
}
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
/**
|
app/code/community/Futurenext/Zakeke/Block/CheckoutItemRenderer.php
CHANGED
|
@@ -42,8 +42,8 @@ class Futurenext_Zakeke_Block_CheckoutItemRenderer extends Mage_Checkout_Block_C
|
|
| 42 |
/**
|
| 43 |
* Get the Zakeke design preview files
|
| 44 |
*
|
| 45 |
-
* @return int|false
|
| 46 |
* @throws Exception
|
|
|
|
| 47 |
*/
|
| 48 |
public function getZakekeDesignId()
|
| 49 |
{
|
|
@@ -54,16 +54,12 @@ class Futurenext_Zakeke_Block_CheckoutItemRenderer extends Mage_Checkout_Block_C
|
|
| 54 |
}
|
| 55 |
|
| 56 |
$options = (array)unserialize($additionalOptions->getValue());
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
continue;
|
| 61 |
-
}
|
| 62 |
-
|
| 63 |
-
return $option['design'];
|
| 64 |
}
|
| 65 |
|
| 66 |
-
return
|
| 67 |
} catch (Exception $e) {
|
| 68 |
Mage::logException($e);
|
| 69 |
throw $e;
|
|
@@ -73,8 +69,8 @@ class Futurenext_Zakeke_Block_CheckoutItemRenderer extends Mage_Checkout_Block_C
|
|
| 73 |
/**
|
| 74 |
* Get the Zakeke design preview files
|
| 75 |
*
|
| 76 |
-
* @return array|false
|
| 77 |
* @throws Exception
|
|
|
|
| 78 |
*/
|
| 79 |
public function getZakekePreviews()
|
| 80 |
{
|
|
@@ -85,20 +81,16 @@ class Futurenext_Zakeke_Block_CheckoutItemRenderer extends Mage_Checkout_Block_C
|
|
| 85 |
}
|
| 86 |
|
| 87 |
$options = (array)unserialize($additionalOptions->getValue());
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
continue;
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
$previews = array();
|
| 95 |
-
if (isset($option['previews'])) {
|
| 96 |
-
$previews = $option['previews'];
|
| 97 |
-
}
|
| 98 |
-
return $previews;
|
| 99 |
}
|
| 100 |
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
} catch (Exception $e) {
|
| 103 |
Mage::logException($e);
|
| 104 |
throw $e;
|
| 42 |
/**
|
| 43 |
* Get the Zakeke design preview files
|
| 44 |
*
|
|
|
|
| 45 |
* @throws Exception
|
| 46 |
+
* @return int|false
|
| 47 |
*/
|
| 48 |
public function getZakekeDesignId()
|
| 49 |
{
|
| 54 |
}
|
| 55 |
|
| 56 |
$options = (array)unserialize($additionalOptions->getValue());
|
| 57 |
+
$option = Futurenext_Zakeke_Helper_Data::getZakekeOption($options);
|
| 58 |
+
if ($option === false) {
|
| 59 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
}
|
| 61 |
|
| 62 |
+
return $option['design'];
|
| 63 |
} catch (Exception $e) {
|
| 64 |
Mage::logException($e);
|
| 65 |
throw $e;
|
| 69 |
/**
|
| 70 |
* Get the Zakeke design preview files
|
| 71 |
*
|
|
|
|
| 72 |
* @throws Exception
|
| 73 |
+
* @return array|false
|
| 74 |
*/
|
| 75 |
public function getZakekePreviews()
|
| 76 |
{
|
| 81 |
}
|
| 82 |
|
| 83 |
$options = (array)unserialize($additionalOptions->getValue());
|
| 84 |
+
$option = Futurenext_Zakeke_Helper_Data::getZakekeOption($options);
|
| 85 |
+
if ($option === false) {
|
| 86 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
|
| 89 |
+
$previews = array();
|
| 90 |
+
if (isset($option['previews'])) {
|
| 91 |
+
$previews = $option['previews'];
|
| 92 |
+
}
|
| 93 |
+
return $previews;
|
| 94 |
} catch (Exception $e) {
|
| 95 |
Mage::logException($e);
|
| 96 |
throw $e;
|
app/code/community/Futurenext/Zakeke/Block/Sales/Order/Email/Items/Order/Default.php
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/*******************************************************
|
| 3 |
-
* Copyright (C) 2016 FutureNext SRL
|
| 4 |
-
*
|
| 5 |
-
* This file is part of Zakeke.
|
| 6 |
-
*
|
| 7 |
-
* Zakeke can not be copied and/or distributed without the express
|
| 8 |
-
* permission of FutureNext SRL
|
| 9 |
-
*******************************************************/
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
/**
|
| 13 |
-
* Zakeke rewrite for sales email
|
| 14 |
-
*
|
| 15 |
-
* @category Futurenext
|
| 16 |
-
* @package Futurenext_Zakeke
|
| 17 |
-
*/
|
| 18 |
-
class Futurenext_Zakeke_Block_Sales_Order_Email_Items_Order_Default extends Mage_Sales_Block_Order_Email_Items_Order_Default
|
| 19 |
-
{
|
| 20 |
-
public function getItemOptions()
|
| 21 |
-
{
|
| 22 |
-
$result = parent::getItemOptions();
|
| 23 |
-
foreach ($result as $key => $value) {
|
| 24 |
-
if (!isset($value['is_zakeke'])) {
|
| 25 |
-
continue;
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
/** @var Futurenext_Zakeke_Helper_Data $zakekeData */
|
| 29 |
-
$zakekeData = Mage::helper('futurenext_zakeke');
|
| 30 |
-
|
| 31 |
-
$result[$key]['value'] = $zakekeData->emailHtmlView($value['previews']);
|
| 32 |
-
break;
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
return $result;
|
| 36 |
-
}
|
| 37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Futurenext/Zakeke/Block/SalesItemRenderer.php
CHANGED
|
@@ -20,8 +20,8 @@ class Futurenext_Zakeke_Block_SalesItemRenderer extends Mage_Sales_Block_Order_I
|
|
| 20 |
/**
|
| 21 |
* Get the Zakeke design preview files
|
| 22 |
*
|
| 23 |
-
* @return int|false
|
| 24 |
* @throws Exception
|
|
|
|
| 25 |
*/
|
| 26 |
public function getZakekeDesignId()
|
| 27 |
{
|
|
@@ -47,31 +47,24 @@ class Futurenext_Zakeke_Block_SalesItemRenderer extends Mage_Sales_Block_Order_I
|
|
| 47 |
/**
|
| 48 |
* Get the Zakeke design preview files
|
| 49 |
*
|
| 50 |
-
* @return array|false
|
| 51 |
* @throws Exception
|
|
|
|
| 52 |
*/
|
| 53 |
public function getZakekePreviews()
|
| 54 |
{
|
| 55 |
try {
|
|
|
|
| 56 |
/** @var array $options */
|
| 57 |
$options = $this->getItem()->getProductOptions();
|
| 58 |
-
if (
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
foreach ($additionalOptions as $additionalOption) {
|
| 65 |
-
if (!isset($additionalOption['is_zakeke'])) {
|
| 66 |
-
continue;
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
if (isset($additionalOption['previews'])) {
|
| 70 |
-
return $additionalOption['previews'];
|
| 71 |
}
|
| 72 |
}
|
| 73 |
|
| 74 |
-
return
|
| 75 |
} catch (Exception $e) {
|
| 76 |
Mage::logException($e);
|
| 77 |
throw $e;
|
| 20 |
/**
|
| 21 |
* Get the Zakeke design preview files
|
| 22 |
*
|
|
|
|
| 23 |
* @throws Exception
|
| 24 |
+
* @return int|false
|
| 25 |
*/
|
| 26 |
public function getZakekeDesignId()
|
| 27 |
{
|
| 47 |
/**
|
| 48 |
* Get the Zakeke design preview files
|
| 49 |
*
|
|
|
|
| 50 |
* @throws Exception
|
| 51 |
+
* @return array
|
| 52 |
*/
|
| 53 |
public function getZakekePreviews()
|
| 54 |
{
|
| 55 |
try {
|
| 56 |
+
$previews = [];
|
| 57 |
/** @var array $options */
|
| 58 |
$options = $this->getItem()->getProductOptions();
|
| 59 |
+
if ($options && isset($options['additional_options'])) {
|
| 60 |
+
$options = $options['additional_options'];
|
| 61 |
+
$option = Futurenext_Zakeke_Helper_Data::getZakekeOption($options);
|
| 62 |
+
if ($option !== false || isset($option['previews'])) {
|
| 63 |
+
$previews = $option['previews'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
}
|
| 65 |
}
|
| 66 |
|
| 67 |
+
return $previews;
|
| 68 |
} catch (Exception $e) {
|
| 69 |
Mage::logException($e);
|
| 70 |
throw $e;
|
app/code/community/Futurenext/Zakeke/Block/View.php
CHANGED
|
@@ -36,18 +36,10 @@ class Futurenext_Zakeke_Block_View extends Mage_Core_Block_Template
|
|
| 36 |
public function isProductCustomizable()
|
| 37 |
{
|
| 38 |
$product = $this->getProduct();
|
| 39 |
-
$sku = null;
|
| 40 |
-
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
|
| 41 |
-
$sku = $product->getData('sku');
|
| 42 |
-
} else {
|
| 43 |
-
$sku = $product->getSku();
|
| 44 |
-
}
|
| 45 |
|
| 46 |
-
/** @var
|
| 47 |
-
$
|
| 48 |
-
|
| 49 |
-
Mage::log('Zakeke product with the sku ' . $sku . ' has $zakekeEnabledId ' . $zakekeEnabledId);
|
| 50 |
-
return (bool) $zakekeEnabledId;
|
| 51 |
}
|
| 52 |
|
| 53 |
/**
|
| 36 |
public function isProductCustomizable()
|
| 37 |
{
|
| 38 |
$product = $this->getProduct();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
/** @var Futurenext_Zakeke_Helper_Data $zakekeHelper */
|
| 41 |
+
$zakekeHelper = Mage::helper('futurenext_zakeke');
|
| 42 |
+
return $zakekeHelper->isProductCustomizable($product);
|
|
|
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
/**
|
app/code/community/Futurenext/Zakeke/Helper/Data.php
CHANGED
|
@@ -52,32 +52,48 @@ class Futurenext_Zakeke_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 52 |
return (bool) $zakekeEnabledId;
|
| 53 |
}
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
/**
|
| 56 |
* Get the HTML view for the option
|
| 57 |
*
|
| 58 |
* @param array $previews
|
| 59 |
* @return string
|
| 60 |
*/
|
| 61 |
-
public function
|
| 62 |
{
|
| 63 |
$output = '<div class="zakeke-preview"><div style="display: flex">';
|
| 64 |
foreach ($previews as $preview) {
|
| 65 |
-
$output .= '<div onclick="zakekeShowPreview(this)" data-zakeke-label="' . $this->quoteEscape($preview->label)
|
| 66 |
}
|
| 67 |
-
|
| 68 |
$output .= '</div></div>';
|
| 69 |
return $output;
|
| 70 |
}
|
| 71 |
|
| 72 |
/**
|
| 73 |
-
* Get the HTML view for the option
|
| 74 |
*
|
| 75 |
* @param array $previews
|
| 76 |
* @return string
|
| 77 |
*/
|
| 78 |
-
public function
|
| 79 |
{
|
| 80 |
-
|
| 81 |
-
return $output;
|
| 82 |
}
|
| 83 |
}
|
| 52 |
return (bool) $zakekeEnabledId;
|
| 53 |
}
|
| 54 |
|
| 55 |
+
/**
|
| 56 |
+
* Get the Zakeke option or false if the product is not customized
|
| 57 |
+
*
|
| 58 |
+
* @param array $options
|
| 59 |
+
* @return array|false
|
| 60 |
+
*/
|
| 61 |
+
public static function getZakekeOption($options) {
|
| 62 |
+
foreach ($options as $option) {
|
| 63 |
+
if (!isset($option['is_zakeke'])) {
|
| 64 |
+
continue;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
return $option;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
return false;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
/**
|
| 74 |
* Get the HTML view for the option
|
| 75 |
*
|
| 76 |
* @param array $previews
|
| 77 |
* @return string
|
| 78 |
*/
|
| 79 |
+
public function adminhtmlView($previews)
|
| 80 |
{
|
| 81 |
$output = '<div class="zakeke-preview"><div style="display: flex">';
|
| 82 |
foreach ($previews as $preview) {
|
| 83 |
+
$output .= '<div onclick="zakekeShowPreview(this)" data-zakeke-label="' . $this->quoteEscape($preview->label). '" style="position: relative; cursor: pointer; margin: 0;"><img src="' . $this->quoteEscape($preview->url) . '" style="width: 80px"></div>';
|
| 84 |
}
|
|
|
|
| 85 |
$output .= '</div></div>';
|
| 86 |
return $output;
|
| 87 |
}
|
| 88 |
|
| 89 |
/**
|
| 90 |
+
* Get the HTML view for the option that is also email friendly.
|
| 91 |
*
|
| 92 |
* @param array $previews
|
| 93 |
* @return string
|
| 94 |
*/
|
| 95 |
+
public function htmlView($previews)
|
| 96 |
{
|
| 97 |
+
return '<img src="' . $this->quoteEscape($previews[0]->url) . '" width="150" height="150" />';
|
|
|
|
| 98 |
}
|
| 99 |
}
|
app/code/community/Futurenext/Zakeke/Helper/ZakekeApi.php
CHANGED
|
@@ -15,461 +15,344 @@
|
|
| 15 |
* @category Futurenext
|
| 16 |
* @package Futurenext_Zakeke
|
| 17 |
*/
|
| 18 |
-
class Futurenext_Zakeke_Helper_ZakekeApi extends Mage_Core_Helper_Abstract
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
'X-Auth-Token: ' . $token,
|
| 359 |
-
'Connection: Keep-Alive',
|
| 360 |
-
'Keep-Alive: 300'
|
| 361 |
-
) );
|
| 362 |
-
|
| 363 |
-
$placeOrderData = array(
|
| 364 |
-
'orderCode' => $data['orderCode'],
|
| 365 |
-
'sessionID' => $data['sessionID'],
|
| 366 |
-
'total' => $data['total'],
|
| 367 |
-
'orderStatusID' => $data['orderStatusID'],
|
| 368 |
-
'details' => $data['details'],
|
| 369 |
-
'marketplaceID' => '1'
|
| 370 |
-
);
|
| 371 |
-
$encodedData = http_build_query( $placeOrderData );
|
| 372 |
-
|
| 373 |
-
$url = Futurenext_Zakeke_Helper_Data::ZAKEKE_API_URL . '/api/orderdocs';
|
| 374 |
-
curl_setopt( $ch, CURLOPT_URL, $url );
|
| 375 |
-
curl_setopt( $ch, CURLOPT_POST, 1 );
|
| 376 |
-
curl_setopt( $ch, CURLOPT_POSTFIELDS, $encodedData );
|
| 377 |
-
$res = curl_exec( $ch );
|
| 378 |
-
|
| 379 |
-
if ( $res === false ) {
|
| 380 |
-
Mage::log(
|
| 381 |
-
'Zakeke: failed to get ' . $url . ' ' . curl_error( $ch ) . ' ' . $res,
|
| 382 |
-
Zend_Log::ERR
|
| 383 |
-
);
|
| 384 |
-
|
| 385 |
-
return false;
|
| 386 |
-
}
|
| 387 |
-
|
| 388 |
-
return true;
|
| 389 |
-
}
|
| 390 |
-
|
| 391 |
-
/**
|
| 392 |
-
* Cancel an order containing Zakeke customized products placed.
|
| 393 |
-
*
|
| 394 |
-
* @param string $orderId
|
| 395 |
-
*
|
| 396 |
-
* @return void
|
| 397 |
-
*/
|
| 398 |
-
public function cancelOrder( $orderId ) {
|
| 399 |
-
}
|
| 400 |
-
|
| 401 |
-
/**
|
| 402 |
-
* Return an array of incompatible modules with hints how to solve the problem
|
| 403 |
-
*
|
| 404 |
-
* @param array $moduleList
|
| 405 |
-
*
|
| 406 |
-
* @return array|false
|
| 407 |
-
*/
|
| 408 |
-
public function moduleChecker( $moduleList ) {
|
| 409 |
-
$incompatibleModules = array();
|
| 410 |
-
|
| 411 |
-
$json = $this->getRawRequest( '/api/IncompatiblePlugins' );
|
| 412 |
-
if ( $json === false ) {
|
| 413 |
-
return false;
|
| 414 |
-
}
|
| 415 |
-
|
| 416 |
-
foreach ( $moduleList as $module ) {
|
| 417 |
-
foreach ( $json as $incompatibleModule ) {
|
| 418 |
-
if ( $module['name'] !== $incompatibleModule->name ) {
|
| 419 |
-
continue;
|
| 420 |
-
}
|
| 421 |
-
|
| 422 |
-
if ( $module['setup_version'] >= $incompatibleModule->fromVersion
|
| 423 |
-
|| $module['setup_version'] <= $incompatibleModule->toVersion
|
| 424 |
-
) {
|
| 425 |
-
$moduleInfo = new Varien_Object();
|
| 426 |
-
$moduleInfo->setName( $module['name'] );
|
| 427 |
-
$moduleInfo->setSetupVersion( $module['setup_version'] );
|
| 428 |
-
$moduleInfo->setHowToFixHtml( $incompatibleModule->fix );
|
| 429 |
-
|
| 430 |
-
$incompatibleModules[] = $moduleInfo;
|
| 431 |
-
}
|
| 432 |
-
}
|
| 433 |
-
}
|
| 434 |
-
|
| 435 |
-
return $incompatibleModules;
|
| 436 |
-
}
|
| 437 |
-
|
| 438 |
-
/**
|
| 439 |
-
* Check if Zakeke is reachable from the shop server
|
| 440 |
-
*
|
| 441 |
-
* @return bool
|
| 442 |
-
*/
|
| 443 |
-
public function isReachable() {
|
| 444 |
-
$ch = curl_init( Futurenext_Zakeke_Helper_Data::ZAKEKE_BASE_URL );
|
| 445 |
-
curl_setopt( $ch, CURLOPT_NOBODY, true );
|
| 446 |
-
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
|
| 447 |
-
curl_setopt( $ch, CURLOPT_TIMEOUT, 5 );
|
| 448 |
-
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
|
| 449 |
-
curl_setopt( $ch, CURLOPT_VERBOSE, false );
|
| 450 |
-
curl_exec( $ch );
|
| 451 |
-
$httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
|
| 452 |
-
curl_close( $ch );
|
| 453 |
-
|
| 454 |
-
return $httpCode >= 200 && $httpCode < 300;
|
| 455 |
-
}
|
| 456 |
-
|
| 457 |
-
/**
|
| 458 |
-
* Log event to Zakeke server
|
| 459 |
-
*
|
| 460 |
-
* @param string $message
|
| 461 |
-
* @param int $level
|
| 462 |
-
*
|
| 463 |
-
* @return void
|
| 464 |
-
*/
|
| 465 |
-
public function log( $message, $level = null ) {
|
| 466 |
-
$level = is_null( $level ) ? Zend_Log::DEBUG : $level;
|
| 467 |
-
|
| 468 |
-
Mage::log(
|
| 469 |
-
$message,
|
| 470 |
-
$level,
|
| 471 |
-
Futurenext_Zakeke_Helper_Data::ZAKEKE_LOG_FILE,
|
| 472 |
-
true
|
| 473 |
-
);
|
| 474 |
-
}
|
| 475 |
}
|
| 15 |
* @category Futurenext
|
| 16 |
* @package Futurenext_Zakeke
|
| 17 |
*/
|
| 18 |
+
class Futurenext_Zakeke_Helper_ZakekeApi extends Mage_Core_Helper_Abstract
|
| 19 |
+
{
|
| 20 |
+
/**
|
| 21 |
+
* Get the needed data for adding a product to the cart
|
| 22 |
+
*
|
| 23 |
+
* @param int $designId
|
| 24 |
+
* @throws Exception
|
| 25 |
+
* @return object
|
| 26 |
+
*/
|
| 27 |
+
public function getCartInfo($designId)
|
| 28 |
+
{
|
| 29 |
+
$data = $this->getMinimalData();
|
| 30 |
+
$url = '/api/designdocs/' . $designId . '/cartinfo'
|
| 31 |
+
. '?' . http_build_query($data);
|
| 32 |
+
$json = $this->getRawRequest($url, null);
|
| 33 |
+
|
| 34 |
+
$res = new stdClass();
|
| 35 |
+
|
| 36 |
+
$res->pricing = $json['pricing'];
|
| 37 |
+
|
| 38 |
+
$preview = new stdClass();
|
| 39 |
+
$preview->url = $json['tempPreviewUrl'];
|
| 40 |
+
$preview->label = '';
|
| 41 |
+
|
| 42 |
+
$res->previews = array($preview);
|
| 43 |
+
|
| 44 |
+
return $res;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* Get the Zakeke authentication token
|
| 49 |
+
*
|
| 50 |
+
* @param array $data - Data to pass as query string.
|
| 51 |
+
* @throws Exception
|
| 52 |
+
* @return string
|
| 53 |
+
*/
|
| 54 |
+
public function getToken($data)
|
| 55 |
+
{
|
| 56 |
+
$registryKey = Futurenext_Zakeke_Helper_Data::ZAKEKE_REGISTRY_TOKEN . http_build_query($data);
|
| 57 |
+
$token = Mage::registry($registryKey);
|
| 58 |
+
if ($token !== null) {
|
| 59 |
+
return $token;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
$data = array_merge($data, $this->getMinimalData());
|
| 63 |
+
|
| 64 |
+
$query = http_build_query($data);
|
| 65 |
+
$url = Futurenext_Zakeke_Helper_Data::ZAKEKE_API_URL . '/api/Login?' . $query;
|
| 66 |
+
|
| 67 |
+
$httpClient = new Varien_Http_Client($url);
|
| 68 |
+
$request = $httpClient->request(Varien_Http_Client::GET);
|
| 69 |
+
$res = $request->getBody();
|
| 70 |
+
if ($request->getStatus() !== 200) {
|
| 71 |
+
$this->doError($url, $request->getStatus(), $res);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/** @var Mage_Core_Helper_Data $helper */
|
| 75 |
+
$helper = Mage::helper('core');
|
| 76 |
+
/** @var array $json */
|
| 77 |
+
$json = $helper->jsonDecode($res);
|
| 78 |
+
|
| 79 |
+
if (!isset($json['token'])) {
|
| 80 |
+
$this->doError($url, $request->getStatus(), $res);
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
Mage::register($registryKey, $json['token']);
|
| 84 |
+
return $json['token'];
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
/**
|
| 88 |
+
* Get the minimal data required to get an authentication token
|
| 89 |
+
*
|
| 90 |
+
* @return array
|
| 91 |
+
*/
|
| 92 |
+
protected function getMinimalData()
|
| 93 |
+
{
|
| 94 |
+
$zakekeUsername = Mage::getStoreConfig('futurenext_zakeke/settings/zakekeUsername');
|
| 95 |
+
$zakekePassword = Mage::helper('core')->decrypt(
|
| 96 |
+
Mage::getStoreConfig('futurenext_zakeke/settings/zakekePassword')
|
| 97 |
+
);
|
| 98 |
+
|
| 99 |
+
return array(
|
| 100 |
+
'user' => $zakekeUsername,
|
| 101 |
+
'pwd' => $zakekePassword
|
| 102 |
+
);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
/**
|
| 106 |
+
* GET request to a Zakeke resource.
|
| 107 |
+
*
|
| 108 |
+
* @param string $url
|
| 109 |
+
* @param array $authData - Authentication credentials.
|
| 110 |
+
* @throws Exception
|
| 111 |
+
* @return array
|
| 112 |
+
*/
|
| 113 |
+
protected function getRawRequest($url, $authData)
|
| 114 |
+
{
|
| 115 |
+
$url = Futurenext_Zakeke_Helper_Data::ZAKEKE_API_URL . $url;
|
| 116 |
+
|
| 117 |
+
$httpClient = new Varien_Http_Client($url);
|
| 118 |
+
if ($authData !== null) {
|
| 119 |
+
$token = $this->getToken($authData);
|
| 120 |
+
$httpClient->setHeaders(array(
|
| 121 |
+
'X-Auth-Token' => $token
|
| 122 |
+
));
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
$request = $httpClient->request(Varien_Http_Client::GET);
|
| 126 |
+
$res = $request->getBody();
|
| 127 |
+
if ($request->getStatus() !== 200) {
|
| 128 |
+
$this->doError($url, $request->getStatus(), $res);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/** @var Mage_Core_Helper_Data $helper */
|
| 132 |
+
$helper = Mage::helper('core');
|
| 133 |
+
return $helper->jsonDecode($res);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
/**
|
| 137 |
+
* POST request to a Zakeke resource.
|
| 138 |
+
*
|
| 139 |
+
* @param string $url
|
| 140 |
+
* @param array $postData
|
| 141 |
+
* @param array $authData - Authentication credentials.
|
| 142 |
+
* @throws Exception
|
| 143 |
+
* @return array
|
| 144 |
+
*/
|
| 145 |
+
protected function postRequest($url, $postData, $authData)
|
| 146 |
+
{
|
| 147 |
+
$url = Futurenext_Zakeke_Helper_Data::ZAKEKE_API_URL . $url;
|
| 148 |
+
|
| 149 |
+
$httpClient = new Varien_Http_Client($url);
|
| 150 |
+
|
| 151 |
+
if ($authData !== null) {
|
| 152 |
+
$token = $this->getToken($authData);
|
| 153 |
+
$httpClient->setHeaders('X-Auth-Token', $token);
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
/** @var Mage_Core_Helper_Data $helper */
|
| 157 |
+
$helper = Mage::helper('core');
|
| 158 |
+
|
| 159 |
+
$jsonData = $helper->jsonEncode($postData);
|
| 160 |
+
$httpClient->setHeaders('Content-type', 'application/json');
|
| 161 |
+
$httpClient->setRawData($jsonData);
|
| 162 |
+
$request = $httpClient->request(Varien_Http_Client::POST);
|
| 163 |
+
$res = $request->getBody();
|
| 164 |
+
if ($request->getStatus() !== 200) {
|
| 165 |
+
$this->doError($url, $request->getStatus(), $res);
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
return $helper->jsonDecode($res);
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
/**
|
| 172 |
+
* Get the Zakeke design price
|
| 173 |
+
*
|
| 174 |
+
* @param string $designId - Zakeke design identifier
|
| 175 |
+
* @throws Exception
|
| 176 |
+
* @return array
|
| 177 |
+
*/
|
| 178 |
+
public function getDesignPricing($designId)
|
| 179 |
+
{
|
| 180 |
+
return $this->getRawRequest('/api/designs/' . $designId . '/pricing', $this->getMinimalData());
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
/**
|
| 184 |
+
* Get the Zakeke design preview files
|
| 185 |
+
*
|
| 186 |
+
* @param string $designId - Zakeke design identifier
|
| 187 |
+
* @throws Exception
|
| 188 |
+
* @return array
|
| 189 |
+
*/
|
| 190 |
+
public function getPreview($designId)
|
| 191 |
+
{
|
| 192 |
+
$data = array(
|
| 193 |
+
'docid' => $designId
|
| 194 |
+
);
|
| 195 |
+
$json = $this->getRawRequest('/api/designs/0/previewfiles?' . http_build_query($data),
|
| 196 |
+
$this->getMinimalData());
|
| 197 |
+
|
| 198 |
+
$previews = array();
|
| 199 |
+
/** @var array $preview */
|
| 200 |
+
foreach ($json as $preview) {
|
| 201 |
+
if ($preview['format'] == 'SVG') {
|
| 202 |
+
continue;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
$previewObj = new stdClass();
|
| 206 |
+
$previewObj->url = $preview['url'];
|
| 207 |
+
$previewObj->label = $preview['sideName'];
|
| 208 |
+
$previews[] = $previewObj;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
return $previews;
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
/**
|
| 215 |
+
* Get the Zakeke design output zip
|
| 216 |
+
*
|
| 217 |
+
* @param string $designId - Zakeke design identifier
|
| 218 |
+
* @throws Exception
|
| 219 |
+
* @return string
|
| 220 |
+
*/
|
| 221 |
+
public function getZakekeOutputZip($designId)
|
| 222 |
+
{
|
| 223 |
+
$data = array(
|
| 224 |
+
'docid' => $designId
|
| 225 |
+
);
|
| 226 |
+
$json = $this->getRawRequest('/api/designs/0/outputfiles/zip?' . http_build_query($data),
|
| 227 |
+
$this->getMinimalData());
|
| 228 |
+
return $json['url'];
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
/**
|
| 232 |
+
* Associate the guest with a customer
|
| 233 |
+
*
|
| 234 |
+
* @param string $guestCode - Guest identifier
|
| 235 |
+
* @param string $customerId - Customer identifier
|
| 236 |
+
* @throws Exception
|
| 237 |
+
* @return void
|
| 238 |
+
*/
|
| 239 |
+
public function associateGuest($guestCode, $customerId)
|
| 240 |
+
{
|
| 241 |
+
$data = $this->getMinimalData();
|
| 242 |
+
$data['vc'] = $guestCode;
|
| 243 |
+
$data['cc'] = $customerId;
|
| 244 |
+
|
| 245 |
+
$this->getToken($data);
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
/**
|
| 249 |
+
* Order containing Zakeke customized products placed
|
| 250 |
+
*
|
| 251 |
+
* @param array $data - data of the order
|
| 252 |
+
* @throws Exception
|
| 253 |
+
* @return void
|
| 254 |
+
*/
|
| 255 |
+
public function placeOrder($data)
|
| 256 |
+
{
|
| 257 |
+
$authData = $this->getMinimalData();
|
| 258 |
+
if (isset($data['customerID'])) {
|
| 259 |
+
$authData['cc'] = $data['customerID'];
|
| 260 |
+
} elseif (isset($data['visitorID'])) {
|
| 261 |
+
$authData['vc'] = $data['visitorID'];
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
$orderData = array(
|
| 265 |
+
'orderCode' => $data['orderCode'],
|
| 266 |
+
'sessionID' => $data['sessionID'],
|
| 267 |
+
'total' => $data['total'],
|
| 268 |
+
'orderStatusID' => $data['orderStatusID'],
|
| 269 |
+
'details' => $data['details'],
|
| 270 |
+
'marketplaceID' => '1'
|
| 271 |
+
);
|
| 272 |
+
$this->postRequest('/api/orderdocs', $orderData, $authData);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
/**
|
| 276 |
+
* Return an array of incompatible modules with hints how to solve the problem
|
| 277 |
+
*
|
| 278 |
+
* @param array $moduleList
|
| 279 |
+
* @throws Exception
|
| 280 |
+
* @return array
|
| 281 |
+
*/
|
| 282 |
+
public function moduleChecker($moduleList)
|
| 283 |
+
{
|
| 284 |
+
$incompatibleModules = array();
|
| 285 |
+
|
| 286 |
+
$json = $this->getRawRequest('/api/IncompatiblePlugins', $this->getMinimalData());
|
| 287 |
+
|
| 288 |
+
foreach ($moduleList as $module) {
|
| 289 |
+
/** @var array $incompatibleModule */
|
| 290 |
+
foreach ($json as $incompatibleModule) {
|
| 291 |
+
if ($module['name'] !== $incompatibleModule['name']) {
|
| 292 |
+
continue;
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
if ($module['setup_version'] >= $incompatibleModule['fromVersion']
|
| 296 |
+
|| $module['setup_version'] <= $incompatibleModule['toVersion']
|
| 297 |
+
) {
|
| 298 |
+
$moduleInfo = new Varien_Object();
|
| 299 |
+
$moduleInfo->setName($module['name']);
|
| 300 |
+
$moduleInfo->setSetupVersion($module['setup_version']);
|
| 301 |
+
$moduleInfo->setHowToFixHtml($incompatibleModule['fix']);
|
| 302 |
+
|
| 303 |
+
$incompatibleModules[] = $moduleInfo;
|
| 304 |
+
}
|
| 305 |
+
}
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
return $incompatibleModules;
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
/**
|
| 312 |
+
* Check if Zakeke is reachable from the shop server
|
| 313 |
+
*
|
| 314 |
+
* @return bool
|
| 315 |
+
*/
|
| 316 |
+
public function isReachable()
|
| 317 |
+
{
|
| 318 |
+
try {
|
| 319 |
+
$httpClient = new Varien_Http_Client(Futurenext_Zakeke_Helper_Data::ZAKEKE_BASE_URL);
|
| 320 |
+
$request = $httpClient->request(Varien_Http_Client::GET);
|
| 321 |
+
return $request->getStatus() >= 200 && $request->getStatus() < 400;
|
| 322 |
+
} catch (Exception $e) {
|
| 323 |
+
return false;
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
/**
|
| 328 |
+
* @param string $url
|
| 329 |
+
* @param int $status
|
| 330 |
+
* @param string $body
|
| 331 |
+
* @throws \Exception
|
| 332 |
+
*/
|
| 333 |
+
protected function doError($url, $status, $body) {
|
| 334 |
+
$msg = 'Failed to get ' . $url . ' ' . $status . ' ' . $body;
|
| 335 |
+
$this->log($msg, Zend_Log::ERR);
|
| 336 |
+
throw new Exception($msg);
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
/**
|
| 340 |
+
* Log event to Zakeke server
|
| 341 |
+
*
|
| 342 |
+
* @param string $message
|
| 343 |
+
* @param int $level
|
| 344 |
+
*
|
| 345 |
+
* @return void
|
| 346 |
+
*/
|
| 347 |
+
public function log($message, $level = null)
|
| 348 |
+
{
|
| 349 |
+
$level = $level === null ? Zend_Log::DEBUG : $level;
|
| 350 |
+
|
| 351 |
+
Mage::log(
|
| 352 |
+
$message,
|
| 353 |
+
$level,
|
| 354 |
+
Futurenext_Zakeke_Helper_Data::ZAKEKE_LOG_FILE,
|
| 355 |
+
true
|
| 356 |
+
);
|
| 357 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 358 |
}
|
app/code/community/Futurenext/Zakeke/Model/Observer.php
CHANGED
|
@@ -26,13 +26,16 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 26 |
*/
|
| 27 |
public function productLoadAfterCartAdd($observer)
|
| 28 |
{
|
|
|
|
|
|
|
|
|
|
| 29 |
try {
|
| 30 |
$action = Mage::app()->getFrontController()->getAction();
|
| 31 |
if (!$action) {
|
| 32 |
return $this;
|
| 33 |
}
|
| 34 |
$actionName = $action->getFullActionName();
|
| 35 |
-
if ($actionName
|
| 36 |
return $this;
|
| 37 |
}
|
| 38 |
|
|
@@ -73,26 +76,17 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 73 |
return $this;
|
| 74 |
}
|
| 75 |
|
| 76 |
-
$
|
| 77 |
$additionalOption = $product->getCustomOption('additional_options');
|
| 78 |
if ($additionalOption) {
|
| 79 |
-
$
|
| 80 |
}
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
return $this;
|
| 85 |
-
}
|
| 86 |
}
|
| 87 |
|
| 88 |
-
$
|
| 89 |
-
$zakekeCartData = Mage::registry($registryKey);
|
| 90 |
-
if (is_null($zakekeCartData)) {
|
| 91 |
-
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 92 |
-
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 93 |
-
$zakekeCartData = $zakekeApi->getCartInfo($design);
|
| 94 |
-
Mage::register($registryKey, $zakekeCartData);
|
| 95 |
-
}
|
| 96 |
|
| 97 |
/** @var Mage_Core_Helper_Data $coreHelper */
|
| 98 |
$coreHelper = Mage::helper('core');
|
|
@@ -100,15 +94,16 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 100 |
$originalFinalPrice = $product->getFinalPrice($qty);
|
| 101 |
|
| 102 |
$zakekePrice = 0.0;
|
| 103 |
-
if ($zakekeCartData->pricing
|
| 104 |
-
$zakekePrice += $originalFinalPrice * ($zakekeCartData->pricing
|
| 105 |
} else {
|
| 106 |
-
$zakekePrice += (float)$zakekeCartData->pricing
|
| 107 |
}
|
| 108 |
-
$zakekePrice += (float)$zakekeCartData->pricing
|
| 109 |
|
| 110 |
$zakekeOption = array(
|
| 111 |
'label' => $coreHelper->__('Customization'),
|
|
|
|
| 112 |
'value' => $zakekeHelper->htmlView($zakekeCartData->previews),
|
| 113 |
'print_value' => '#' . $design,
|
| 114 |
'custom_view' => true,
|
|
@@ -121,7 +116,7 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 121 |
'is_zakeke' => true
|
| 122 |
);
|
| 123 |
|
| 124 |
-
$
|
| 125 |
|
| 126 |
if ($zakekePrice) {
|
| 127 |
$zakekeFinalPrice = $coreHelper->currency($zakekePrice, true, false);
|
|
@@ -129,12 +124,13 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 129 |
'label' => $coreHelper->__('Customization Price'),
|
| 130 |
'value' => $zakekeFinalPrice
|
| 131 |
];
|
| 132 |
-
$
|
| 133 |
}
|
| 134 |
|
| 135 |
-
$product->addCustomOption('additional_options', serialize($
|
| 136 |
} catch (Exception $e) {
|
| 137 |
Mage::logException($e);
|
|
|
|
| 138 |
throw $e;
|
| 139 |
}
|
| 140 |
return $this;
|
|
@@ -149,13 +145,16 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 149 |
*/
|
| 150 |
public function reorder($observer)
|
| 151 |
{
|
|
|
|
|
|
|
|
|
|
| 152 |
try {
|
| 153 |
$action = Mage::app()->getFrontController()->getAction();
|
| 154 |
if ($action === null) {
|
| 155 |
return $this;
|
| 156 |
}
|
| 157 |
$actionName = $action->getFullActionName();
|
| 158 |
-
if ($actionName
|
| 159 |
return $this;
|
| 160 |
}
|
| 161 |
|
|
@@ -199,22 +198,21 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 199 |
/** @var Mage_Core_Helper_Data $coreHelper */
|
| 200 |
$coreHelper = Mage::helper('core');
|
| 201 |
|
| 202 |
-
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 203 |
-
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 204 |
$zakekeCartData = $zakekeApi->getCartInfo($design);
|
| 205 |
|
| 206 |
$originalFinalPrice = $product->getFinalPrice($qty);
|
| 207 |
|
| 208 |
$zakekePrice = 0.0;
|
| 209 |
-
if ($zakekeCartData->pricing
|
| 210 |
-
$zakekePrice += $originalFinalPrice * ($zakekeCartData->pricing
|
| 211 |
} else {
|
| 212 |
-
$zakekePrice += (float)$zakekeCartData->pricing
|
| 213 |
}
|
| 214 |
-
$zakekePrice += (float)$zakekeCartData->pricing
|
| 215 |
|
| 216 |
$zakekeOption = array(
|
| 217 |
'label' => $coreHelper->__('Customization'),
|
|
|
|
| 218 |
'value' => $zakekeHelper->htmlView($zakekeCartData->previews),
|
| 219 |
'print_value' => '#' . $design,
|
| 220 |
'custom_view' => true,
|
|
@@ -228,11 +226,6 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 228 |
);
|
| 229 |
$additionalOptions[] = $zakekeOption;
|
| 230 |
|
| 231 |
-
$simpleProductOption = $item->getOptionByCode('simple_product');
|
| 232 |
-
if ($simpleProductOption !== null) {
|
| 233 |
-
$product = $simpleProductOption->getProduct();
|
| 234 |
-
}
|
| 235 |
-
|
| 236 |
if ($zakekePrice) {
|
| 237 |
$zakekeFinalPrice = $coreHelper->currency($zakekePrice);
|
| 238 |
|
|
@@ -258,6 +251,7 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 258 |
));
|
| 259 |
} catch (Exception $e) {
|
| 260 |
Mage::logException($e);
|
|
|
|
| 261 |
throw $e;
|
| 262 |
}
|
| 263 |
return $this;
|
|
@@ -272,6 +266,9 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 272 |
*/
|
| 273 |
public function salesConvertQuoteItemToOrderItem(Varien_Event_Observer $observer)
|
| 274 |
{
|
|
|
|
|
|
|
|
|
|
| 275 |
try {
|
| 276 |
/** @var Mage_Sales_Model_Quote_Item $quoteItem */
|
| 277 |
$quoteItem = $observer->getItem();
|
|
@@ -287,6 +284,7 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 287 |
}
|
| 288 |
} catch (Exception $e) {
|
| 289 |
Mage::logException($e);
|
|
|
|
| 290 |
throw $e;
|
| 291 |
}
|
| 292 |
return $this;
|
|
@@ -301,18 +299,13 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 301 |
*/
|
| 302 |
public function cartAdd($observer)
|
| 303 |
{
|
| 304 |
-
|
| 305 |
-
|
| 306 |
|
| 307 |
try {
|
| 308 |
-
$zakekeApi->log('Observer cartAdd called');
|
| 309 |
-
|
| 310 |
/** @var Mage_Catalog_Model_Product $product */
|
| 311 |
$product = $observer->getProduct();
|
| 312 |
|
| 313 |
-
$found = false;
|
| 314 |
-
$zakekePrice = 0.0;
|
| 315 |
-
|
| 316 |
$action = Mage::app()->getFrontController()->getAction();
|
| 317 |
$request = $action->getRequest();
|
| 318 |
$qty = $request->getParam('qty');
|
|
@@ -325,55 +318,53 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 325 |
|
| 326 |
/** @var Mage_Catalog_Model_Product_Option $additionalOption */
|
| 327 |
$additionalOption = $product->getCustomOption('additional_options');
|
| 328 |
-
if (
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 345 |
}
|
|
|
|
|
|
|
| 346 |
}
|
| 347 |
-
}
|
| 348 |
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
->
|
| 359 |
-
->
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
| 366 |
-
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 367 |
-
|
| 368 |
-
$baseFinalPrice = $product->getFinalPrice($quoteItem->getQty()) + $zakekePrice;
|
| 369 |
-
$finalPrice = $directoryHelper->currencyConvert($baseFinalPrice, $baseCurrencyCode, $currentCurrencyCode);
|
| 370 |
-
|
| 371 |
-
$quoteItem->setCustomPrice($finalPrice);
|
| 372 |
-
$quoteItem->setOriginalCustomPrice($finalPrice);
|
| 373 |
-
$product->setIsSuperMode(true);
|
| 374 |
} catch (Exception $e) {
|
| 375 |
Mage::logException($e);
|
| 376 |
-
|
| 377 |
throw $e;
|
| 378 |
}
|
| 379 |
return $this;
|
|
@@ -397,16 +388,6 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 397 |
/** @var Mage_Sales_Model_Order $order */
|
| 398 |
$order = $observer->getOrder();
|
| 399 |
|
| 400 |
-
$action = Mage::app()->getFrontController()->getAction();
|
| 401 |
-
$request = $action->getRequest();
|
| 402 |
-
$qty = $request->getParam('qty');
|
| 403 |
-
if (isset($qty)) {
|
| 404 |
-
$filter = new Zend_Filter_LocalizedToNormalized(
|
| 405 |
-
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
| 406 |
-
);
|
| 407 |
-
$qty = $filter->filter($qty);
|
| 408 |
-
}
|
| 409 |
-
|
| 410 |
/** @var Mage_Customer_Model_Session $session */
|
| 411 |
$session = Mage::getSingleton('customer/session');
|
| 412 |
|
|
@@ -443,12 +424,8 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 443 |
continue;
|
| 444 |
}
|
| 445 |
|
| 446 |
-
$
|
| 447 |
-
|
| 448 |
-
if (!isset($option['is_zakeke'])) {
|
| 449 |
-
continue;
|
| 450 |
-
}
|
| 451 |
-
|
| 452 |
$zakekePrice = 0.0;
|
| 453 |
if (isset($option['price'])) {
|
| 454 |
$zakekePrice = $option['price'];
|
|
@@ -490,13 +467,10 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 490 |
);
|
| 491 |
|
| 492 |
$data['details'][] = $itemData;
|
| 493 |
-
break;
|
| 494 |
}
|
| 495 |
}
|
| 496 |
-
|
| 497 |
-
$zakekeApi->log('Observer orderSave order data ' . json_encode($data));
|
| 498 |
-
|
| 499 |
if (count($data['details']) > 0) {
|
|
|
|
| 500 |
$zakekeApi->placeOrder($data);
|
| 501 |
}
|
| 502 |
} catch (Exception $e) {
|
|
@@ -507,39 +481,6 @@ class Futurenext_Zakeke_Model_Observer
|
|
| 507 |
return $this;
|
| 508 |
}
|
| 509 |
|
| 510 |
-
/**
|
| 511 |
-
* Notify Zakeke that an order containing some Zakeke customized product is begin cancelled
|
| 512 |
-
*
|
| 513 |
-
* @param Varien_Event_Observer $observer
|
| 514 |
-
* @return $this
|
| 515 |
-
* @throws Exception
|
| 516 |
-
*/
|
| 517 |
-
public function orderCancel($observer)
|
| 518 |
-
{
|
| 519 |
-
try {
|
| 520 |
-
/** @var Mage_Sales_Model_Order $order */
|
| 521 |
-
$order = $observer->getOrder();
|
| 522 |
-
|
| 523 |
-
if ($order->getStatus() != 'canceled') {
|
| 524 |
-
return $this;
|
| 525 |
-
}
|
| 526 |
-
|
| 527 |
-
/** @var Mage_Sales_Model_Order_Item $item */
|
| 528 |
-
foreach ($order->getAllVisibleItems() as $item) {
|
| 529 |
-
if ($item->getProductType() == Futurenext_Zakeke_Helper_Data::ZAKEKE_PRODUCT_TYPE) {
|
| 530 |
-
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 531 |
-
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 532 |
-
$zakekeApi->cancelOrder($order->getId());
|
| 533 |
-
return $this;
|
| 534 |
-
}
|
| 535 |
-
}
|
| 536 |
-
} catch (Exception $e) {
|
| 537 |
-
Mage::logException($e);
|
| 538 |
-
throw $e;
|
| 539 |
-
}
|
| 540 |
-
return $this;
|
| 541 |
-
}
|
| 542 |
-
|
| 543 |
/**
|
| 544 |
* Notify Zakeke if a guest is also a Zakeke user that now she is registered
|
| 545 |
*
|
| 26 |
*/
|
| 27 |
public function productLoadAfterCartAdd($observer)
|
| 28 |
{
|
| 29 |
+
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 30 |
+
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 31 |
+
|
| 32 |
try {
|
| 33 |
$action = Mage::app()->getFrontController()->getAction();
|
| 34 |
if (!$action) {
|
| 35 |
return $this;
|
| 36 |
}
|
| 37 |
$actionName = $action->getFullActionName();
|
| 38 |
+
if ($actionName !== 'checkout_cart_add' && $actionName !== 'checkout_cart_updateItemOptions') {
|
| 39 |
return $this;
|
| 40 |
}
|
| 41 |
|
| 76 |
return $this;
|
| 77 |
}
|
| 78 |
|
| 79 |
+
$options = array();
|
| 80 |
$additionalOption = $product->getCustomOption('additional_options');
|
| 81 |
if ($additionalOption) {
|
| 82 |
+
$options = (array)unserialize($additionalOption->getValue());
|
| 83 |
}
|
| 84 |
|
| 85 |
+
if (Futurenext_Zakeke_Helper_Data::getZakekeOption($options)) {
|
| 86 |
+
return $this;
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
|
| 89 |
+
$zakekeCartData = $zakekeApi->getCartInfo($design);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
/** @var Mage_Core_Helper_Data $coreHelper */
|
| 92 |
$coreHelper = Mage::helper('core');
|
| 94 |
$originalFinalPrice = $product->getFinalPrice($qty);
|
| 95 |
|
| 96 |
$zakekePrice = 0.0;
|
| 97 |
+
if ($zakekeCartData->pricing['modelPriceDeltaPerc']) {
|
| 98 |
+
$zakekePrice += $originalFinalPrice * ($zakekeCartData->pricing['modelPriceDeltaPerc'] / 100);
|
| 99 |
} else {
|
| 100 |
+
$zakekePrice += (float)$zakekeCartData->pricing['modelPriceDeltaValue'];
|
| 101 |
}
|
| 102 |
+
$zakekePrice += (float)$zakekeCartData->pricing['designPrice'];
|
| 103 |
|
| 104 |
$zakekeOption = array(
|
| 105 |
'label' => $coreHelper->__('Customization'),
|
| 106 |
+
'option_id' => 'zakeke',
|
| 107 |
'value' => $zakekeHelper->htmlView($zakekeCartData->previews),
|
| 108 |
'print_value' => '#' . $design,
|
| 109 |
'custom_view' => true,
|
| 116 |
'is_zakeke' => true
|
| 117 |
);
|
| 118 |
|
| 119 |
+
$options[] = $zakekeOption;
|
| 120 |
|
| 121 |
if ($zakekePrice) {
|
| 122 |
$zakekeFinalPrice = $coreHelper->currency($zakekePrice, true, false);
|
| 124 |
'label' => $coreHelper->__('Customization Price'),
|
| 125 |
'value' => $zakekeFinalPrice
|
| 126 |
];
|
| 127 |
+
$options[] = $zakekePricingOption;
|
| 128 |
}
|
| 129 |
|
| 130 |
+
$product->addCustomOption('additional_options', serialize($options));
|
| 131 |
} catch (Exception $e) {
|
| 132 |
Mage::logException($e);
|
| 133 |
+
$zakekeApi->log('Observer productLoadAfterCartAdd exception ' . $e);
|
| 134 |
throw $e;
|
| 135 |
}
|
| 136 |
return $this;
|
| 145 |
*/
|
| 146 |
public function reorder($observer)
|
| 147 |
{
|
| 148 |
+
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 149 |
+
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 150 |
+
|
| 151 |
try {
|
| 152 |
$action = Mage::app()->getFrontController()->getAction();
|
| 153 |
if ($action === null) {
|
| 154 |
return $this;
|
| 155 |
}
|
| 156 |
$actionName = $action->getFullActionName();
|
| 157 |
+
if ($actionName !== 'sales_order_reorder') {
|
| 158 |
return $this;
|
| 159 |
}
|
| 160 |
|
| 198 |
/** @var Mage_Core_Helper_Data $coreHelper */
|
| 199 |
$coreHelper = Mage::helper('core');
|
| 200 |
|
|
|
|
|
|
|
| 201 |
$zakekeCartData = $zakekeApi->getCartInfo($design);
|
| 202 |
|
| 203 |
$originalFinalPrice = $product->getFinalPrice($qty);
|
| 204 |
|
| 205 |
$zakekePrice = 0.0;
|
| 206 |
+
if ($zakekeCartData->pricing['modelPriceDeltaPerc']) {
|
| 207 |
+
$zakekePrice += $originalFinalPrice * ($zakekeCartData->pricing['modelPriceDeltaPerc'] / 100);
|
| 208 |
} else {
|
| 209 |
+
$zakekePrice += (float)$zakekeCartData->pricing['modelPriceDeltaValue'];
|
| 210 |
}
|
| 211 |
+
$zakekePrice += (float)$zakekeCartData->pricing['designPrice'];
|
| 212 |
|
| 213 |
$zakekeOption = array(
|
| 214 |
'label' => $coreHelper->__('Customization'),
|
| 215 |
+
'option_id' => 'zakeke',
|
| 216 |
'value' => $zakekeHelper->htmlView($zakekeCartData->previews),
|
| 217 |
'print_value' => '#' . $design,
|
| 218 |
'custom_view' => true,
|
| 226 |
);
|
| 227 |
$additionalOptions[] = $zakekeOption;
|
| 228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
if ($zakekePrice) {
|
| 230 |
$zakekeFinalPrice = $coreHelper->currency($zakekePrice);
|
| 231 |
|
| 251 |
));
|
| 252 |
} catch (Exception $e) {
|
| 253 |
Mage::logException($e);
|
| 254 |
+
$zakekeApi->log('Observer reorder exception ' . $e);
|
| 255 |
throw $e;
|
| 256 |
}
|
| 257 |
return $this;
|
| 266 |
*/
|
| 267 |
public function salesConvertQuoteItemToOrderItem(Varien_Event_Observer $observer)
|
| 268 |
{
|
| 269 |
+
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 270 |
+
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 271 |
+
|
| 272 |
try {
|
| 273 |
/** @var Mage_Sales_Model_Quote_Item $quoteItem */
|
| 274 |
$quoteItem = $observer->getItem();
|
| 284 |
}
|
| 285 |
} catch (Exception $e) {
|
| 286 |
Mage::logException($e);
|
| 287 |
+
$zakekeApi->log('Observer salesConvertQuoteItemToOrderItem exception ' . $e);
|
| 288 |
throw $e;
|
| 289 |
}
|
| 290 |
return $this;
|
| 299 |
*/
|
| 300 |
public function cartAdd($observer)
|
| 301 |
{
|
| 302 |
+
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 303 |
+
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 304 |
|
| 305 |
try {
|
|
|
|
|
|
|
| 306 |
/** @var Mage_Catalog_Model_Product $product */
|
| 307 |
$product = $observer->getProduct();
|
| 308 |
|
|
|
|
|
|
|
|
|
|
| 309 |
$action = Mage::app()->getFrontController()->getAction();
|
| 310 |
$request = $action->getRequest();
|
| 311 |
$qty = $request->getParam('qty');
|
| 318 |
|
| 319 |
/** @var Mage_Catalog_Model_Product_Option $additionalOption */
|
| 320 |
$additionalOption = $product->getCustomOption('additional_options');
|
| 321 |
+
if (!$additionalOption) {
|
| 322 |
+
return $this;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
$options = (array)unserialize($additionalOption->getValue());
|
| 326 |
+
if ($option = Futurenext_Zakeke_Helper_Data::getZakekeOption($options)) {
|
| 327 |
+
/** @var Mage_Sales_Model_Quote_Item $quoteItem */
|
| 328 |
+
$quoteItem = $observer->getQuoteItem();
|
| 329 |
+
/** @var Mage_Sales_Model_Quote_Item_Option $option */
|
| 330 |
+
$option = Mage::getModel('sales/quote_item_option');
|
| 331 |
+
$option->setProductId($product->getId())
|
| 332 |
+
->setCode('product_type')
|
| 333 |
+
->setProduct($product)
|
| 334 |
+
->setValue(Futurenext_Zakeke_Helper_Data::ZAKEKE_PRODUCT_TYPE);
|
| 335 |
+
$quoteItem->addOption($option);
|
| 336 |
+
|
| 337 |
+
$zakekePrice = 0.0;
|
| 338 |
+
if (isset($option['pricing'])) {
|
| 339 |
+
$pricing = $option['pricing'];
|
| 340 |
+
if ($pricing['modelPriceDeltaPerc']) {
|
| 341 |
+
$zakekePrice += $product->getFinalPrice($qty) * ($pricing['modelPriceDeltaPerc'] / 100);
|
| 342 |
+
} else {
|
| 343 |
+
$zakekePrice += (float)$pricing['modelPriceDeltaValue'];
|
| 344 |
}
|
| 345 |
+
|
| 346 |
+
$zakekePrice += (float)$pricing['designPrice'];
|
| 347 |
}
|
|
|
|
| 348 |
|
| 349 |
+
if (!$zakekePrice) {
|
| 350 |
+
return $this;
|
| 351 |
+
}
|
| 352 |
|
| 353 |
+
/** @var Mage_Directory_Helper_Data $directoryHelper */
|
| 354 |
+
$directoryHelper = Mage::helper('directory');
|
| 355 |
+
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
| 356 |
+
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 357 |
+
|
| 358 |
+
$baseFinalPrice = $product->getFinalPrice($quoteItem->getQty()) + $zakekePrice;
|
| 359 |
+
$finalPrice = $directoryHelper->currencyConvert($baseFinalPrice, $baseCurrencyCode, $currentCurrencyCode);
|
| 360 |
+
|
| 361 |
+
$quoteItem->setCustomPrice($finalPrice);
|
| 362 |
+
$quoteItem->setOriginalCustomPrice($finalPrice);
|
| 363 |
+
$product->setIsSuperMode(true);
|
| 364 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 365 |
} catch (Exception $e) {
|
| 366 |
Mage::logException($e);
|
| 367 |
+
$zakekeApi->log('Observer cartAdd exception ' . $e);
|
| 368 |
throw $e;
|
| 369 |
}
|
| 370 |
return $this;
|
| 388 |
/** @var Mage_Sales_Model_Order $order */
|
| 389 |
$order = $observer->getOrder();
|
| 390 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
/** @var Mage_Customer_Model_Session $session */
|
| 392 |
$session = Mage::getSingleton('customer/session');
|
| 393 |
|
| 424 |
continue;
|
| 425 |
}
|
| 426 |
|
| 427 |
+
$options = $productOptions['additional_options'];
|
| 428 |
+
if ($option = Futurenext_Zakeke_Helper_Data::getZakekeOption($options)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
$zakekePrice = 0.0;
|
| 430 |
if (isset($option['price'])) {
|
| 431 |
$zakekePrice = $option['price'];
|
| 467 |
);
|
| 468 |
|
| 469 |
$data['details'][] = $itemData;
|
|
|
|
| 470 |
}
|
| 471 |
}
|
|
|
|
|
|
|
|
|
|
| 472 |
if (count($data['details']) > 0) {
|
| 473 |
+
$zakekeApi->log('Observer orderSave order with such info ' . json_encode($data));
|
| 474 |
$zakekeApi->placeOrder($data);
|
| 475 |
}
|
| 476 |
} catch (Exception $e) {
|
| 481 |
return $this;
|
| 482 |
}
|
| 483 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 484 |
/**
|
| 485 |
* Notify Zakeke if a guest is also a Zakeke user that now she is registered
|
| 486 |
*
|
app/code/community/Futurenext/Zakeke/controllers/CustomizeController.php
CHANGED
|
@@ -99,10 +99,13 @@ class Futurenext_Zakeke_CustomizeController extends Mage_Core_Controller_Front_A
|
|
| 99 |
try {
|
| 100 |
$product = $this->_initProduct();
|
| 101 |
|
|
|
|
|
|
|
|
|
|
| 102 |
/**
|
| 103 |
* Check product availability
|
| 104 |
*/
|
| 105 |
-
if (
|
| 106 |
Mage::log('Zakeke CustomizeController: ' . self::NOT_FOUND_MESSAGE);
|
| 107 |
$this->getResponse()->setHeader('HTTP/1.1', '404', true);
|
| 108 |
$data = array('error' => self::NOT_FOUND_MESSAGE);
|
|
@@ -252,9 +255,6 @@ class Futurenext_Zakeke_CustomizeController extends Mage_Core_Controller_Front_A
|
|
| 252 |
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 253 |
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 254 |
$token = $zakekeApi->getToken($data);
|
| 255 |
-
if (!$token) {
|
| 256 |
-
throw new Exception($this->__('Failed to get the Zakeke authentication token.'));
|
| 257 |
-
}
|
| 258 |
|
| 259 |
// Register current data
|
| 260 |
Mage::register('current_product', $product);
|
|
@@ -265,8 +265,7 @@ class Futurenext_Zakeke_CustomizeController extends Mage_Core_Controller_Front_A
|
|
| 265 |
);
|
| 266 |
|
| 267 |
$this->loadLayout();
|
| 268 |
-
$
|
| 269 |
-
$this->getLayout()->getBlock('head')->setTitle($title);
|
| 270 |
$this->renderLayout();
|
| 271 |
} catch (Exception $e) {
|
| 272 |
Mage::logException($e);
|
|
@@ -323,9 +322,6 @@ class Futurenext_Zakeke_CustomizeController extends Mage_Core_Controller_Front_A
|
|
| 323 |
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 324 |
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 325 |
$token = $zakekeApi->getToken($data);
|
| 326 |
-
if (!$token) {
|
| 327 |
-
throw new Exception($this->__('Failed to get the Zakeke authentication token.'));
|
| 328 |
-
}
|
| 329 |
|
| 330 |
// Register current data
|
| 331 |
Mage::register('current_product', $product);
|
|
@@ -336,8 +332,7 @@ class Futurenext_Zakeke_CustomizeController extends Mage_Core_Controller_Front_A
|
|
| 336 |
);
|
| 337 |
|
| 338 |
$this->loadLayout();
|
| 339 |
-
$
|
| 340 |
-
$this->getLayout()->getBlock('head')->setTitle($title);
|
| 341 |
$this->renderLayout();
|
| 342 |
} catch (Exception $e) {
|
| 343 |
Mage::logException($e);
|
| 99 |
try {
|
| 100 |
$product = $this->_initProduct();
|
| 101 |
|
| 102 |
+
/** @var Futurenext_Zakeke_Helper_Data $zakekeHelper */
|
| 103 |
+
$zakekeHelper = Mage::helper('futurenext_zakeke');
|
| 104 |
+
|
| 105 |
/**
|
| 106 |
* Check product availability
|
| 107 |
*/
|
| 108 |
+
if (!($product && $zakekeHelper->isProductCustomizable($product))) {
|
| 109 |
Mage::log('Zakeke CustomizeController: ' . self::NOT_FOUND_MESSAGE);
|
| 110 |
$this->getResponse()->setHeader('HTTP/1.1', '404', true);
|
| 111 |
$data = array('error' => self::NOT_FOUND_MESSAGE);
|
| 255 |
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 256 |
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 257 |
$token = $zakekeApi->getToken($data);
|
|
|
|
|
|
|
|
|
|
| 258 |
|
| 259 |
// Register current data
|
| 260 |
Mage::register('current_product', $product);
|
| 265 |
);
|
| 266 |
|
| 267 |
$this->loadLayout();
|
| 268 |
+
$this->getLayout()->getBlock('head')->setTitle($product->getName());
|
|
|
|
| 269 |
$this->renderLayout();
|
| 270 |
} catch (Exception $e) {
|
| 271 |
Mage::logException($e);
|
| 322 |
/** @var Futurenext_Zakeke_Helper_ZakekeApi $zakekeApi */
|
| 323 |
$zakekeApi = Mage::helper('futurenext_zakeke/zakekeApi');
|
| 324 |
$token = $zakekeApi->getToken($data);
|
|
|
|
|
|
|
|
|
|
| 325 |
|
| 326 |
// Register current data
|
| 327 |
Mage::register('current_product', $product);
|
| 332 |
);
|
| 333 |
|
| 334 |
$this->loadLayout();
|
| 335 |
+
$this->getLayout()->getBlock('head')->setTitle($product->getName());
|
|
|
|
| 336 |
$this->renderLayout();
|
| 337 |
} catch (Exception $e) {
|
| 338 |
Mage::logException($e);
|
app/code/community/Futurenext/Zakeke/etc/config.xml
CHANGED
|
@@ -12,7 +12,7 @@
|
|
| 12 |
<config>
|
| 13 |
<modules>
|
| 14 |
<Futurenext_Zakeke>
|
| 15 |
-
<version>1.0.0.
|
| 16 |
</Futurenext_Zakeke>
|
| 17 |
</modules>
|
| 18 |
|
|
@@ -21,11 +21,6 @@
|
|
| 21 |
<futurenext_zakeke>
|
| 22 |
<class>Futurenext_Zakeke_Block</class>
|
| 23 |
</futurenext_zakeke>
|
| 24 |
-
<sales>
|
| 25 |
-
<rewrite>
|
| 26 |
-
<order_email_items_order_default>Futurenext_Zakeke_Block_Sales_Order_Email_Items_Order_Default</order_email_items_order_default>
|
| 27 |
-
</rewrite>
|
| 28 |
-
</sales>
|
| 29 |
</blocks>
|
| 30 |
|
| 31 |
<models>
|
|
@@ -145,6 +140,16 @@
|
|
| 145 |
</futurenext_zakeke>
|
| 146 |
</updates>
|
| 147 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
</adminhtml>
|
| 149 |
|
| 150 |
<frontend>
|
| 12 |
<config>
|
| 13 |
<modules>
|
| 14 |
<Futurenext_Zakeke>
|
| 15 |
+
<version>1.0.0.8</version>
|
| 16 |
</Futurenext_Zakeke>
|
| 17 |
</modules>
|
| 18 |
|
| 21 |
<futurenext_zakeke>
|
| 22 |
<class>Futurenext_Zakeke_Block</class>
|
| 23 |
</futurenext_zakeke>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
</blocks>
|
| 25 |
|
| 26 |
<models>
|
| 140 |
</futurenext_zakeke>
|
| 141 |
</updates>
|
| 142 |
</layout>
|
| 143 |
+
|
| 144 |
+
<translate>
|
| 145 |
+
<modules>
|
| 146 |
+
<Futurenext_Zakeke>
|
| 147 |
+
<files>
|
| 148 |
+
<default>Futurenext_Zakeke.csv</default>
|
| 149 |
+
</files>
|
| 150 |
+
</Futurenext_Zakeke>
|
| 151 |
+
</modules>
|
| 152 |
+
</translate>
|
| 153 |
</adminhtml>
|
| 154 |
|
| 155 |
<frontend>
|
app/code/community/Futurenext/Zakeke/etc/system.xml
CHANGED
|
@@ -34,19 +34,9 @@
|
|
| 34 |
<show_in_website>1</show_in_website>
|
| 35 |
<show_in_store>1</show_in_store>
|
| 36 |
<fields>
|
| 37 |
-
<zakekeActive translate="label">
|
| 38 |
-
<label>Enabled</label>
|
| 39 |
-
<sort_order>1</sort_order>
|
| 40 |
-
<show_in_default>1</show_in_default>
|
| 41 |
-
<show_in_website>1</show_in_website>
|
| 42 |
-
<show_in_store>1</show_in_store>
|
| 43 |
-
<frontend_type>select</frontend_type>
|
| 44 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 45 |
-
</zakekeActive>
|
| 46 |
-
|
| 47 |
<zakekeUsername translate="label comment">
|
| 48 |
<label>Zakeke username</label>
|
| 49 |
-
<sort_order>
|
| 50 |
<show_in_default>1</show_in_default>
|
| 51 |
<show_in_website>1</show_in_website>
|
| 52 |
<show_in_store>1</show_in_store>
|
|
@@ -56,7 +46,7 @@
|
|
| 56 |
|
| 57 |
<zakekePassword translate="label">
|
| 58 |
<label>Zakeke password</label>
|
| 59 |
-
<sort_order>
|
| 60 |
<show_in_default>1</show_in_default>
|
| 61 |
<show_in_website>1</show_in_website>
|
| 62 |
<show_in_store>1</show_in_store>
|
| 34 |
<show_in_website>1</show_in_website>
|
| 35 |
<show_in_store>1</show_in_store>
|
| 36 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
<zakekeUsername translate="label comment">
|
| 38 |
<label>Zakeke username</label>
|
| 39 |
+
<sort_order>1</sort_order>
|
| 40 |
<show_in_default>1</show_in_default>
|
| 41 |
<show_in_website>1</show_in_website>
|
| 42 |
<show_in_store>1</show_in_store>
|
| 46 |
|
| 47 |
<zakekePassword translate="label">
|
| 48 |
<label>Zakeke password</label>
|
| 49 |
+
<sort_order>2</sort_order>
|
| 50 |
<show_in_default>1</show_in_default>
|
| 51 |
<show_in_website>1</show_in_website>
|
| 52 |
<show_in_store>1</show_in_store>
|
app/design/adminhtml/default/default/template/zakeke/sales/items/column/zakeke/name.phtml
CHANGED
|
@@ -7,7 +7,7 @@ $_zakekeDownload = $this->getZakekeOutputZip();
|
|
| 7 |
<div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($this->getSku()))); ?></div>
|
| 8 |
|
| 9 |
<?php if ($_zakekePreviews) : ?>
|
| 10 |
-
<?php echo $this->helper('futurenext_zakeke')->
|
| 11 |
<?php endif; ?>
|
| 12 |
<?php if ($_zakekeDownload) : ?>
|
| 13 |
<a href="<?php echo $this->quoteEscape($_zakekeDownload) ?>" download>
|
| 7 |
<div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->escapeHtml($this->getSku()))); ?></div>
|
| 8 |
|
| 9 |
<?php if ($_zakekePreviews) : ?>
|
| 10 |
+
<?php echo $this->helper('futurenext_zakeke')->adminhtmlView($_zakekePreviews) ?>
|
| 11 |
<?php endif; ?>
|
| 12 |
<?php if ($_zakekeDownload) : ?>
|
| 13 |
<a href="<?php echo $this->quoteEscape($_zakekeDownload) ?>" download>
|
app/design/adminhtml/default/default/template/zakeke/sales/order/invoice/create/items/renderer/zakeke.phtml
CHANGED
|
@@ -1,29 +1,3 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* DISCLAIMER
|
| 16 |
-
*
|
| 17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
-
* versions in the future. If you wish to customize Magento for your
|
| 19 |
-
* needs please refer to http://www.magento.com for more information.
|
| 20 |
-
*
|
| 21 |
-
* @category design
|
| 22 |
-
* @package default_default
|
| 23 |
-
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
| 24 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
-
*/
|
| 26 |
-
?>
|
| 27 |
<?php $_item = $this->getItem() ?>
|
| 28 |
<?php $this->setPriceDataObject($_item) ?>
|
| 29 |
<tr class="border">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<?php $_item = $this->getItem() ?>
|
| 2 |
<?php $this->setPriceDataObject($_item) ?>
|
| 3 |
<tr class="border">
|
app/design/adminhtml/default/default/template/zakeke/sales/order/invoice/view/items/renderer/zakeke.phtml
CHANGED
|
@@ -1,29 +1,3 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* DISCLAIMER
|
| 16 |
-
*
|
| 17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
-
* versions in the future. If you wish to customize Magento for your
|
| 19 |
-
* needs please refer to http://www.magento.com for more information.
|
| 20 |
-
*
|
| 21 |
-
* @category design
|
| 22 |
-
* @package default_default
|
| 23 |
-
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
|
| 24 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
-
*/
|
| 26 |
-
?>
|
| 27 |
<?php $_item = $this->getItem() ?>
|
| 28 |
<?php $this->setPriceDataObject($_item) ?>
|
| 29 |
<tr class="border">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<?php $_item = $this->getItem() ?>
|
| 2 |
<?php $this->setPriceDataObject($_item) ?>
|
| 3 |
<tr class="border">
|
app/design/frontend/base/default/layout/zakeke.xml
CHANGED
|
@@ -32,24 +32,8 @@
|
|
| 32 |
<template>zakeke/cart/minicart.phtml</template>
|
| 33 |
</action>
|
| 34 |
</reference>
|
| 35 |
-
<reference name="head">
|
| 36 |
-
<action method="addItem">
|
| 37 |
-
<type>skin_js</type>
|
| 38 |
-
<name>js/zakeke/preview.js</name>
|
| 39 |
-
</action>
|
| 40 |
-
</reference>
|
| 41 |
</default>
|
| 42 |
|
| 43 |
-
<customer_account>
|
| 44 |
-
<reference name="cart_sidebar">
|
| 45 |
-
<action method="addItemRender">
|
| 46 |
-
<type>zakeke</type>
|
| 47 |
-
<block>futurenext_zakeke/cartItemRenderer</block>
|
| 48 |
-
<template>zakeke/cart/minicart.phtml</template>
|
| 49 |
-
</action>
|
| 50 |
-
</reference>
|
| 51 |
-
</customer_account>
|
| 52 |
-
|
| 53 |
<checkout_cart_index>
|
| 54 |
<reference name="checkout.cart">
|
| 55 |
<action method="addItemRender">
|
|
@@ -61,12 +45,6 @@
|
|
| 61 |
</checkout_cart_index>
|
| 62 |
|
| 63 |
<catalog_product_view>
|
| 64 |
-
<reference name="head">
|
| 65 |
-
<action method="addItem">
|
| 66 |
-
<type>skin_css</type>
|
| 67 |
-
<name>css/zakeke/productview.css</name>
|
| 68 |
-
</action>
|
| 69 |
-
</reference>
|
| 70 |
<reference name="product.info.addtocart">
|
| 71 |
<block type="futurenext_zakeke/customizeButton"
|
| 72 |
name="zakeke.customize.button"
|
|
@@ -74,25 +52,6 @@
|
|
| 74 |
</reference>
|
| 75 |
</catalog_product_view>
|
| 76 |
|
| 77 |
-
<checkout_onepage_review>
|
| 78 |
-
<reference name="root">
|
| 79 |
-
<action method="addItemRender">
|
| 80 |
-
<type>zakeke</type>
|
| 81 |
-
<block>futurenext_zakeke/checkoutItemRenderer</block>
|
| 82 |
-
<template>zakeke/checkout/onepage/review/item.phtml</template></action>
|
| 83 |
-
</reference>
|
| 84 |
-
</checkout_onepage_review>
|
| 85 |
-
|
| 86 |
-
<sales_order_view>
|
| 87 |
-
<reference name="order_items">
|
| 88 |
-
<action method="addItemRender">
|
| 89 |
-
<type>zakeke</type>
|
| 90 |
-
<block>futurenext_zakeke/salesItemRenderer</block>
|
| 91 |
-
<template>zakeke/sales/order/items/renderer/zakeke.phtml</template>
|
| 92 |
-
</action>
|
| 93 |
-
</reference>
|
| 94 |
-
</sales_order_view>
|
| 95 |
-
|
| 96 |
<futurenext_zakeke_customize_add>
|
| 97 |
<reference name="root">
|
| 98 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
| 32 |
<template>zakeke/cart/minicart.phtml</template>
|
| 33 |
</action>
|
| 34 |
</reference>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
</default>
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
<checkout_cart_index>
|
| 38 |
<reference name="checkout.cart">
|
| 39 |
<action method="addItemRender">
|
| 45 |
</checkout_cart_index>
|
| 46 |
|
| 47 |
<catalog_product_view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
<reference name="product.info.addtocart">
|
| 49 |
<block type="futurenext_zakeke/customizeButton"
|
| 50 |
name="zakeke.customize.button"
|
| 52 |
</reference>
|
| 53 |
</catalog_product_view>
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
<futurenext_zakeke_customize_add>
|
| 56 |
<reference name="root">
|
| 57 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
app/design/frontend/base/default/template/zakeke/checkout/onepage/review/item.phtml
DELETED
|
@@ -1,237 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/*******************************************************
|
| 3 |
-
* Copyright (C) 2016 FutureNext SRL
|
| 4 |
-
*
|
| 5 |
-
* This file is part of Zakeke.
|
| 6 |
-
*
|
| 7 |
-
* Zakeke can not be copied and/or distributed without the express
|
| 8 |
-
* permission of FutureNext SRL
|
| 9 |
-
*******************************************************/
|
| 10 |
-
|
| 11 |
-
$_item = $this->getItem();
|
| 12 |
-
$_zakekePreviews = $this->getZakekePreviews();
|
| 13 |
-
?>
|
| 14 |
-
<tr>
|
| 15 |
-
<td><h3 class="product-name"><?php echo $this->escapeHtml($this->getProductName()) ?></h3>
|
| 16 |
-
<div class="zakeke-preview">
|
| 17 |
-
<div style="display: flex">
|
| 18 |
-
<?php foreach ($_zakekePreviews as $preview): ?>
|
| 19 |
-
<div data-zakeke-label="<?php echo $this->quoteEscape($preview->label) ?>" style="position: relative; width: 180px; height: 180px; overflow: hidden; cursor: pointer; margin: 0px;"
|
| 20 |
-
onclick="zakekeShowPreview(this); return false;">
|
| 21 |
-
<img src="<?php echo $this->quoteEscape($preview->url) ?>" style="width: 180px">
|
| 22 |
-
</div>
|
| 23 |
-
<?php endforeach; ?>
|
| 24 |
-
</div>
|
| 25 |
-
</div>
|
| 26 |
-
<?php if ($_options = $this->getOptionList()):?>
|
| 27 |
-
<dl class="item-options">
|
| 28 |
-
<?php foreach ($_options as $_option) : ?>
|
| 29 |
-
<?php if (isset($_option['is_zakeke'])) continue; ?>
|
| 30 |
-
<?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
|
| 31 |
-
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
|
| 32 |
-
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
|
| 33 |
-
<?php if (isset($_formatedOptionValue['full_view'])): ?>
|
| 34 |
-
<div class="truncated_full_value">
|
| 35 |
-
<dl class="item-options">
|
| 36 |
-
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
|
| 37 |
-
<dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
|
| 38 |
-
</dl>
|
| 39 |
-
</div>
|
| 40 |
-
<?php endif; ?>
|
| 41 |
-
</dd>
|
| 42 |
-
<?php endforeach; ?>
|
| 43 |
-
</dl>
|
| 44 |
-
<?php endif;?>
|
| 45 |
-
<?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
|
| 46 |
-
<?php echo $addtInfoBlock->setItem($_item)->toHtml() ?>
|
| 47 |
-
<?php endif;?>
|
| 48 |
-
</td>
|
| 49 |
-
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
| 50 |
-
<td class="a-right">
|
| 51 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 52 |
-
<span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 53 |
-
<?php else: ?>
|
| 54 |
-
<span class="cart-price">
|
| 55 |
-
<?php endif; ?>
|
| 56 |
-
|
| 57 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 58 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
|
| 59 |
-
<?php else: ?>
|
| 60 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
|
| 61 |
-
<?php endif; ?>
|
| 62 |
-
|
| 63 |
-
</span>
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
| 67 |
-
|
| 68 |
-
<div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
| 69 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 70 |
-
<small>
|
| 71 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 72 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
|
| 73 |
-
<?php endforeach; ?>
|
| 74 |
-
</small>
|
| 75 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 76 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 77 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></small></span><br />
|
| 78 |
-
<?php endforeach; ?>
|
| 79 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 80 |
-
<small>
|
| 81 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 82 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
|
| 83 |
-
<?php endforeach; ?>
|
| 84 |
-
</small>
|
| 85 |
-
<?php endif; ?>
|
| 86 |
-
</div>
|
| 87 |
-
|
| 88 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 89 |
-
<div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 90 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
|
| 91 |
-
</div>
|
| 92 |
-
<?php endif; ?>
|
| 93 |
-
<?php endif; ?>
|
| 94 |
-
</td>
|
| 95 |
-
<?php endif; ?>
|
| 96 |
-
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
| 97 |
-
<td>
|
| 98 |
-
<?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
|
| 99 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 100 |
-
<span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 101 |
-
<?php else: ?>
|
| 102 |
-
<span class="cart-price">
|
| 103 |
-
<?php endif; ?>
|
| 104 |
-
|
| 105 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 106 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
|
| 107 |
-
<?php else: ?>
|
| 108 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
|
| 109 |
-
<?php endif; ?>
|
| 110 |
-
|
| 111 |
-
</span>
|
| 112 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
| 113 |
-
|
| 114 |
-
<div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
| 115 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 116 |
-
<small>
|
| 117 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 118 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
|
| 119 |
-
<?php endforeach; ?>
|
| 120 |
-
</small>
|
| 121 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 122 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 123 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
|
| 124 |
-
<?php endforeach; ?>
|
| 125 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 126 |
-
<small>
|
| 127 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 128 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
|
| 129 |
-
<?php endforeach; ?>
|
| 130 |
-
</small>
|
| 131 |
-
<?php endif; ?>
|
| 132 |
-
</div>
|
| 133 |
-
|
| 134 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 135 |
-
<div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 136 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
|
| 137 |
-
</div>
|
| 138 |
-
<?php endif; ?>
|
| 139 |
-
<?php endif; ?>
|
| 140 |
-
</td>
|
| 141 |
-
<?php endif; ?>
|
| 142 |
-
<td class="a-center"><?php echo $_item->getQty() ?></td>
|
| 143 |
-
<!-- sub total starts here -->
|
| 144 |
-
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
| 145 |
-
<td class="a-right">
|
| 146 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 147 |
-
<span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 148 |
-
<?php else: ?>
|
| 149 |
-
<span class="cart-price">
|
| 150 |
-
<?php endif; ?>
|
| 151 |
-
|
| 152 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 153 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
|
| 154 |
-
<?php else: ?>
|
| 155 |
-
<?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
|
| 156 |
-
<?php endif; ?>
|
| 157 |
-
|
| 158 |
-
</span>
|
| 159 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
| 160 |
-
|
| 161 |
-
<div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
| 162 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 163 |
-
<small>
|
| 164 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 165 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
|
| 166 |
-
<?php endforeach; ?>
|
| 167 |
-
</small>
|
| 168 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 169 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 170 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
|
| 171 |
-
<?php endforeach; ?>
|
| 172 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 173 |
-
<small>
|
| 174 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 175 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
|
| 176 |
-
<?php endforeach; ?>
|
| 177 |
-
</small>
|
| 178 |
-
<?php endif; ?>
|
| 179 |
-
</div>
|
| 180 |
-
|
| 181 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 182 |
-
<div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 183 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
|
| 184 |
-
</div>
|
| 185 |
-
<?php endif; ?>
|
| 186 |
-
<?php endif; ?>
|
| 187 |
-
</td>
|
| 188 |
-
<?php endif; ?>
|
| 189 |
-
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
|
| 190 |
-
<td>
|
| 191 |
-
<?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
|
| 192 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 193 |
-
<span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 194 |
-
<?php else: ?>
|
| 195 |
-
<span class="cart-price">
|
| 196 |
-
<?php endif; ?>
|
| 197 |
-
|
| 198 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 199 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
|
| 200 |
-
<?php else: ?>
|
| 201 |
-
<?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
|
| 202 |
-
<?php endif; ?>
|
| 203 |
-
|
| 204 |
-
</span>
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
<?php if (Mage::helper('weee')->getApplied($_item)): ?>
|
| 208 |
-
|
| 209 |
-
<div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
|
| 210 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 211 |
-
<small>
|
| 212 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 213 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
|
| 214 |
-
<?php endforeach; ?>
|
| 215 |
-
</small>
|
| 216 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 217 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 218 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
|
| 219 |
-
<?php endforeach; ?>
|
| 220 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 221 |
-
<small>
|
| 222 |
-
<?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
|
| 223 |
-
<span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
|
| 224 |
-
<?php endforeach; ?>
|
| 225 |
-
</small>
|
| 226 |
-
<?php endif; ?>
|
| 227 |
-
</div>
|
| 228 |
-
|
| 229 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
|
| 230 |
-
<div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 231 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
|
| 232 |
-
</div>
|
| 233 |
-
<?php endif; ?>
|
| 234 |
-
<?php endif; ?>
|
| 235 |
-
</td>
|
| 236 |
-
<?php endif; ?>
|
| 237 |
-
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/zakeke/sales/order/items/renderer/zakeke.phtml
DELETED
|
@@ -1,349 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/*******************************************************
|
| 3 |
-
* Copyright (C) 2016 FutureNext SRL
|
| 4 |
-
*
|
| 5 |
-
* This file is part of Zakeke.
|
| 6 |
-
*
|
| 7 |
-
* Zakeke can not be copied and/or distributed without the express
|
| 8 |
-
* permission of FutureNext SRL
|
| 9 |
-
*******************************************************/
|
| 10 |
-
|
| 11 |
-
/** @var Futurenext_Zakeke_Block_SalesItemRenderer $this */
|
| 12 |
-
?>
|
| 13 |
-
<?php
|
| 14 |
-
$_item = $this->getItem();
|
| 15 |
-
$_zakekePreviews = $this->getZakekePreviews();
|
| 16 |
-
?>
|
| 17 |
-
<tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
|
| 18 |
-
<td><h3 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h3>
|
| 19 |
-
<div class="zakeke-preview">
|
| 20 |
-
<div style="display: flex">
|
| 21 |
-
<?php foreach ($_zakekePreviews as $preview): ?>
|
| 22 |
-
<div data-zakeke-label="<?php echo $this->quoteEscape($preview->label) ?>" style="position: relative; max-height: 186px; overflow: hidden; cursor: pointer; margin: 0px;"
|
| 23 |
-
onclick="zakekeShowPreview(this); return false;">
|
| 24 |
-
<img src="<?php echo $this->quoteEscape($preview->url) ?>" style="width: 180px">
|
| 25 |
-
</div>
|
| 26 |
-
<?php endforeach; ?>
|
| 27 |
-
</div>
|
| 28 |
-
</div>
|
| 29 |
-
<?php if ($_options = $this->getItemOptions()): ?>
|
| 30 |
-
<dl class="item-options">
|
| 31 |
-
<?php foreach ($_options as $_option) : ?>
|
| 32 |
-
<?php if (isset($_option['is_zakeke'])) continue; ?>
|
| 33 |
-
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
|
| 34 |
-
<?php if (!$this->getPrintStatus()): ?>
|
| 35 |
-
<?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
|
| 36 |
-
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
|
| 37 |
-
<?php echo $_formatedOptionValue['value'] ?>
|
| 38 |
-
<?php if (isset($_formatedOptionValue['full_view'])): ?>
|
| 39 |
-
<div class="truncated_full_value">
|
| 40 |
-
<dl class="item-options">
|
| 41 |
-
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
|
| 42 |
-
<dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
|
| 43 |
-
</dl>
|
| 44 |
-
</div>
|
| 45 |
-
<?php endif; ?>
|
| 46 |
-
</dd>
|
| 47 |
-
<?php else: ?>
|
| 48 |
-
<dd><?php echo $this->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
|
| 49 |
-
<?php endif; ?>
|
| 50 |
-
<?php endforeach; ?>
|
| 51 |
-
</dl>
|
| 52 |
-
<?php endif; ?>
|
| 53 |
-
|
| 54 |
-
<?php echo $this->escapeHtml($_item->getDescription()) ?>
|
| 55 |
-
<?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
|
| 56 |
-
<br/><a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>"
|
| 57 |
-
class="giftmessage-preview-link expand"
|
| 58 |
-
onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
|
| 59 |
-
<?php endif; ?>
|
| 60 |
-
</td>
|
| 61 |
-
<td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
|
| 62 |
-
|
| 63 |
-
<td class="a-right nowrap">
|
| 64 |
-
<?php if ($this->helper('tax')->displayCartBothPrices() || $this->helper('tax')->displayCartPriceExclTax()): ?>
|
| 65 |
-
<span class="price-excl-tax">
|
| 66 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
| 67 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 68 |
-
<span class="cart-price">
|
| 69 |
-
<?php endif; ?>
|
| 70 |
-
<span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
|
| 71 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 72 |
-
</span>
|
| 73 |
-
<?php endif; ?>
|
| 74 |
-
<?php endif; ?>
|
| 75 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 76 |
-
<span class="cart-tax-total"
|
| 77 |
-
onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 78 |
-
<?php else: ?>
|
| 79 |
-
<span class="cart-price">
|
| 80 |
-
<?php endif; ?>
|
| 81 |
-
|
| 82 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 83 |
-
<?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?>
|
| 84 |
-
<?php else: ?>
|
| 85 |
-
<?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
|
| 86 |
-
<?php endif; ?>
|
| 87 |
-
</span>
|
| 88 |
-
|
| 89 |
-
<?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
|
| 90 |
-
|
| 91 |
-
<span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
|
| 92 |
-
style="display:none;">
|
| 93 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 94 |
-
<small>
|
| 95 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 96 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 97 |
-
: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
|
| 98 |
-
<?php endforeach; ?>
|
| 99 |
-
</small>
|
| 100 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 101 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 102 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>
|
| 103 |
-
: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></small></span>
|
| 104 |
-
<?php endforeach; ?>
|
| 105 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 106 |
-
<small>
|
| 107 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 108 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 109 |
-
: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
|
| 110 |
-
<?php endforeach; ?>
|
| 111 |
-
</small>
|
| 112 |
-
<?php endif; ?>
|
| 113 |
-
</span>
|
| 114 |
-
|
| 115 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 116 |
-
<span class="cart-tax-total"
|
| 117 |
-
onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 118 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
|
| 119 |
-
:<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?></span>
|
| 120 |
-
</span>
|
| 121 |
-
<?php endif; ?>
|
| 122 |
-
<?php endif; ?>
|
| 123 |
-
</span>
|
| 124 |
-
<br/>
|
| 125 |
-
<?php endif; ?>
|
| 126 |
-
<?php if ($this->helper('tax')->displayCartBothPrices() || $this->helper('tax')->displayCartPriceInclTax()): ?>
|
| 127 |
-
<span class="price-incl-tax">
|
| 128 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
| 129 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 130 |
-
<span class="cart-price">
|
| 131 |
-
<?php endif; ?>
|
| 132 |
-
<span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
|
| 133 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 134 |
-
</span>
|
| 135 |
-
<?php endif; ?>
|
| 136 |
-
<?php endif; ?>
|
| 137 |
-
<?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
|
| 138 |
-
|
| 139 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 140 |
-
<span class="cart-tax-total"
|
| 141 |
-
onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 142 |
-
<?php else: ?>
|
| 143 |
-
<span class="cart-price">
|
| 144 |
-
<?php endif; ?>
|
| 145 |
-
|
| 146 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 147 |
-
<?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
|
| 148 |
-
<?php else: ?>
|
| 149 |
-
<?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxDisposition()) ?>
|
| 150 |
-
<?php endif; ?>
|
| 151 |
-
|
| 152 |
-
</span>
|
| 153 |
-
|
| 154 |
-
<?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
|
| 155 |
-
|
| 156 |
-
<span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
|
| 157 |
-
style="display:none;">
|
| 158 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 159 |
-
<small>
|
| 160 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 161 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 162 |
-
: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
|
| 163 |
-
<?php endforeach; ?>
|
| 164 |
-
</small>
|
| 165 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 166 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 167 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>
|
| 168 |
-
: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
|
| 169 |
-
<?php endforeach; ?>
|
| 170 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 171 |
-
<small>
|
| 172 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 173 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 174 |
-
: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
|
| 175 |
-
<?php endforeach; ?>
|
| 176 |
-
</small>
|
| 177 |
-
<?php endif; ?>
|
| 178 |
-
</span>
|
| 179 |
-
|
| 180 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 181 |
-
<span class="cart-tax-total"
|
| 182 |
-
onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 183 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
|
| 184 |
-
:<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
|
| 185 |
-
</span>
|
| 186 |
-
<?php endif; ?>
|
| 187 |
-
<?php endif; ?>
|
| 188 |
-
</span>
|
| 189 |
-
<?php endif; ?>
|
| 190 |
-
</td>
|
| 191 |
-
|
| 192 |
-
<td class="a-right nowrap">
|
| 193 |
-
<span class="nobr">
|
| 194 |
-
<?php if ($this->getItem()->getQtyOrdered() > 0): ?>
|
| 195 |
-
<?php echo $this->__('Ordered'); ?>:
|
| 196 |
-
<strong><?php echo $this->getItem()->getQtyOrdered() * 1 ?></strong><br/>
|
| 197 |
-
<?php endif; ?>
|
| 198 |
-
<?php if ($this->getItem()->getQtyShipped() > 0): ?>
|
| 199 |
-
<?php echo $this->__('Shipped'); ?>:
|
| 200 |
-
<strong><?php echo $this->getItem()->getQtyShipped() * 1 ?></strong><br/>
|
| 201 |
-
<?php endif; ?>
|
| 202 |
-
<?php if ($this->getItem()->getQtyCanceled() > 0): ?>
|
| 203 |
-
<?php echo $this->__('Canceled'); ?>:
|
| 204 |
-
<strong><?php echo $this->getItem()->getQtyCanceled() * 1 ?></strong><br/>
|
| 205 |
-
<?php endif; ?>
|
| 206 |
-
<?php if ($this->getItem()->getQtyRefunded() > 0): ?>
|
| 207 |
-
<?php echo $this->__('Refunded'); ?>:
|
| 208 |
-
<strong><?php echo $this->getItem()->getQtyRefunded() * 1 ?></strong><br/>
|
| 209 |
-
<?php endif; ?>
|
| 210 |
-
</span>
|
| 211 |
-
</td>
|
| 212 |
-
<td class="a-right nowrap">
|
| 213 |
-
<?php if ($this->helper('tax')->displayCartBothPrices() || $this->helper('tax')->displayCartPriceExclTax()): ?>
|
| 214 |
-
<span class="price-excl-tax">
|
| 215 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
| 216 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 217 |
-
<span class="cart-price">
|
| 218 |
-
<?php endif; ?>
|
| 219 |
-
<span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
|
| 220 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 221 |
-
</span>
|
| 222 |
-
<?php endif; ?>
|
| 223 |
-
<?php endif; ?>
|
| 224 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 225 |
-
<span class="cart-tax-total"
|
| 226 |
-
onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 227 |
-
<?php else: ?>
|
| 228 |
-
<span class="cart-price">
|
| 229 |
-
<?php endif; ?>
|
| 230 |
-
|
| 231 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 232 |
-
<?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?>
|
| 233 |
-
<?php else: ?>
|
| 234 |
-
<?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
|
| 235 |
-
<?php endif; ?>
|
| 236 |
-
|
| 237 |
-
</span>
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
<?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
|
| 241 |
-
|
| 242 |
-
<span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
|
| 243 |
-
style="display:none;">
|
| 244 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 245 |
-
<small>
|
| 246 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 247 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 248 |
-
: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
|
| 249 |
-
<?php endforeach; ?>
|
| 250 |
-
</small>
|
| 251 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 252 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 253 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>
|
| 254 |
-
: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></small></span>
|
| 255 |
-
<?php endforeach; ?>
|
| 256 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 257 |
-
<small>
|
| 258 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 259 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 260 |
-
: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
|
| 261 |
-
<?php endforeach; ?>
|
| 262 |
-
</small>
|
| 263 |
-
<?php endif; ?>
|
| 264 |
-
</span>
|
| 265 |
-
|
| 266 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 267 |
-
<span class="cart-tax-total"
|
| 268 |
-
onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 269 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
|
| 270 |
-
:<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?></span>
|
| 271 |
-
</span>
|
| 272 |
-
<?php endif; ?>
|
| 273 |
-
<?php endif; ?>
|
| 274 |
-
</span>
|
| 275 |
-
<br/>
|
| 276 |
-
<?php endif; ?>
|
| 277 |
-
<?php if ($this->helper('tax')->displayCartBothPrices() || $this->helper('tax')->displayCartPriceInclTax()): ?>
|
| 278 |
-
<span class="price-incl-tax">
|
| 279 |
-
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
|
| 280 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 281 |
-
<span class="cart-price">
|
| 282 |
-
<?php endif; ?>
|
| 283 |
-
<span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
|
| 284 |
-
<?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 285 |
-
</span>
|
| 286 |
-
<?php endif; ?>
|
| 287 |
-
<?php endif; ?>
|
| 288 |
-
<?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
|
| 289 |
-
|
| 290 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 291 |
-
<span class="cart-tax-total"
|
| 292 |
-
onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 293 |
-
<?php else: ?>
|
| 294 |
-
<span class="cart-price">
|
| 295 |
-
<?php endif; ?>
|
| 296 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 297 |
-
<?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
|
| 298 |
-
<?php else: ?>
|
| 299 |
-
<?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxRowDisposition()) ?>
|
| 300 |
-
<?php endif; ?>
|
| 301 |
-
|
| 302 |
-
</span>
|
| 303 |
-
|
| 304 |
-
<?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
|
| 305 |
-
|
| 306 |
-
<span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
|
| 307 |
-
style="display:none;">
|
| 308 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 309 |
-
<small>
|
| 310 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 311 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 312 |
-
: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
|
| 313 |
-
<?php endforeach; ?>
|
| 314 |
-
</small>
|
| 315 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 316 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 317 |
-
<span class="nobr"><small><?php echo $tax['title']; ?>
|
| 318 |
-
: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
|
| 319 |
-
<?php endforeach; ?>
|
| 320 |
-
<?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 321 |
-
<small>
|
| 322 |
-
<?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
|
| 323 |
-
<span class="nobr"><?php echo $tax['title']; ?>
|
| 324 |
-
: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
|
| 325 |
-
<?php endforeach; ?>
|
| 326 |
-
</small>
|
| 327 |
-
<?php endif; ?>
|
| 328 |
-
</span>
|
| 329 |
-
|
| 330 |
-
<?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
|
| 331 |
-
<span class="cart-tax-total"
|
| 332 |
-
onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
|
| 333 |
-
<span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
|
| 334 |
-
:<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
|
| 335 |
-
</span>
|
| 336 |
-
<?php endif; ?>
|
| 337 |
-
<?php endif; ?>
|
| 338 |
-
</span>
|
| 339 |
-
<?php endif; ?>
|
| 340 |
-
</td>
|
| 341 |
-
<!--
|
| 342 |
-
<?php if ($this->helper('tax')->displayCartBothPrices() || $this->helper('tax')->displayCartPriceExclTax()): ?>
|
| 343 |
-
<th class="nowrap a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
|
| 344 |
-
<?php endif; ?>
|
| 345 |
-
<?php if ($this->helper('tax')->displayCartBothPrices() || $this->helper('tax')->displayCartPriceInclTax()): ?>
|
| 346 |
-
<th class="nowrap a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
|
| 347 |
-
<?php endif; ?>
|
| 348 |
-
-->
|
| 349 |
-
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/locale/it_IT/Futurenext_Zakeke.csv
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
Customize,Personalizza
|
| 2 |
Customization,Personalizzazione
|
| 3 |
-
"Customization Price","Costo personalizzazione"
|
|
|
| 1 |
Customize,Personalizza
|
| 2 |
Customization,Personalizzazione
|
| 3 |
+
"Customization Price","Costo personalizzazione"
|
| 4 |
+
"Download customization files","Scarica file di personalizzazione"
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Futurenext_Zakeke</name>
|
| 4 |
-
<version>1.0.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://www.zakeke.com/Contracts/GeneralConditions">Zakeke license</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -10,9 +10,9 @@
|
|
| 10 |
<description>Zakeke is an innovative cloud platform that allows any Magento store to integrate into the system a 2D and 3D complete customizer of products, giving the possibility to customize "live" products for sale to the end customer.</description>
|
| 11 |
<notes>Bug fixing release</notes>
|
| 12 |
<authors><author><name>Futurenext</name><user>futurenext</user><email>info@zakeke.com</email></author></authors>
|
| 13 |
-
<date>2017-03
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magecommunity"><dir name="Futurenext"><dir name="Zakeke"><dir name="Block"><dir name="Adminhtml"><dir name="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Futurenext_Zakeke</name>
|
| 4 |
+
<version>1.0.0.8</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://www.zakeke.com/Contracts/GeneralConditions">Zakeke license</license>
|
| 7 |
<channel>community</channel>
|
| 10 |
<description>Zakeke is an innovative cloud platform that allows any Magento store to integrate into the system a 2D and 3D complete customizer of products, giving the possibility to customize "live" products for sale to the end customer.</description>
|
| 11 |
<notes>Bug fixing release</notes>
|
| 12 |
<authors><author><name>Futurenext</name><user>futurenext</user><email>info@zakeke.com</email></author></authors>
|
| 13 |
+
<date>2017-05-03</date>
|
| 14 |
+
<time>08:48:55</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Futurenext"><dir name="Zakeke"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Items"><dir name="Column"><dir name="Zakeke"><file name="Name.php" hash="44ee4fa109c9fbf1283cf2a4a4370cab"/></dir></dir></dir></dir></dir><file name="CartItemRenderer.php" hash="9c48c821bdab816c35c4d959e52f1976"/><file name="CheckoutItemRenderer.php" hash="02d4244d1274ac023c7fe997fcedf833"/><dir name="Customize"><file name="Add.php" hash="6d206e080ed91ed1ffbdd7528d89be2f"/><file name="Configure.php" hash="e815ed877af5727bd20289429122107b"/></dir><file name="Customize.php" hash="dcae150aafaa72013f83c0e51746f56d"/><file name="CustomizeButton.php" hash="0289e8754309ed5ba622a4e0ce643d25"/><file name="ModuleChecker.php" hash="8df2615bc87c4e656584ee80a51a9b31"/><file name="SalesItemRenderer.php" hash="2b470077ecef18ec49eab960409914ef"/><file name="View.php" hash="0c5a7231813b3737e069ad1ca3ccf809"/></dir><dir name="Helper"><file name="Data.php" hash="243765672b4e31bbbf945425e544fd5d"/><file name="ZakekeApi.php" hash="9556204f7e6fad0d5917e9dd19819d30"/></dir><dir name="Model"><dir name="Api2"><dir name="Colors"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="0b1ad3d9656fd5b729d1f7a626359e19"/></dir></dir></dir><file name="Colors.php" hash="f9f004c13ef5357bb3d5e798208e7902"/><dir name="ProductAttribute"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="40a6a5def798a5d0e8bcee1ac8c8a4d8"/></dir></dir></dir><file name="ProductAttribute.php" hash="97ea0f12646d9f1f1ab6916ed41f04dc"/><dir name="ProductOptions"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="6c6dd2079f58a654b60c465cc1fbc357"/></dir></dir></dir><file name="ProductOptions.php" hash="5e1234a158723dc5a8e2c3ccf6e152cf"/><dir name="Settings"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="e982e900acb2a4ac267cdda95c87cd35"/></dir></dir></dir><file name="Settings.php" hash="2f7fa711c00e75d3c4afabb007145c49"/><dir name="ZakekeEnabled"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="b107fafe0fa69827bebadfd66c6274d9"/></dir></dir></dir><file name="ZakekeEnabled.php" hash="0f5c210fa296b30283aa41f500c3e3b9"/></dir><file name="ModuleList.php" hash="929479d45eb4252daaff6e4a40733b09"/><file name="Observer.php" hash="06577c15ab93a639c419295d91e90e7c"/><dir name="Resource"><file name="Setup.php" hash="42a7681d56fcd5ad06f75a223ef420f1"/><dir name="ZakekeEnabled"><file name="Collection.php" hash="fdadf3c788c4b5e175e4a20501116027"/></dir><file name="ZakekeEnabled.php" hash="f32fb4b25f1f78287a38c3bd170bdbaa"/></dir><file name="ZakekeEnabled.php" hash="9b31e4606dcf8622092f638ca9f3920c"/></dir><dir name="controllers"><file name="CustomizeController.php" hash="10671c9bfc00cd41c6d983d938fac06a"/><dir name="Zakeke"><file name="ModuleCheckerController.php" hash="b92d1f5b155479a85f358f1356ccdd29"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="22cdf40e6e83327b58f9e97fa17e8f68"/><file name="api2.xml" hash="9af2352582ae62a261d07f58e64d5e77"/><file name="config.xml" hash="1f833aa2e7ed7e42b43a161ee0ea6d12"/><file name="system.xml" hash="daf9c491d17687ab6d464dbf9cacf1f8"/></dir><dir name="sql"><dir name="zakeke_setup"><file name="install-1.0.0.0.php" hash="64a3954b20b3142886446ac432a04b21"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Futurenext_Zakeke.xml" hash="f309795ee4b758943868cb1f7459fb9c"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="zakeke.xml" hash="d296777d398f6af473adfb8a15477b47"/></dir><dir name="template"><dir name="zakeke"><file name="modulechecker.phtml" hash="b3101729cc5030c645770af6a814cd26"/><dir name="sales"><dir name="items"><dir name="column"><dir name="zakeke"><file name="name.phtml" hash="723ecc1f6c0ad17495389b8e012d72e3"/></dir></dir></dir><dir name="order"><dir name="creditmemo"><dir name="create"><dir name="items"><dir name="renderer"><file name="zakeke.phtml" hash="6294158a08ad56639c3a57a4d88c2f81"/></dir></dir></dir><dir name="view"><dir name="items"><dir name="renderer"><file name="zakeke.phtml" hash="4421194ecc884d934f099a256062cfcb"/></dir></dir></dir></dir><dir name="invoice"><dir name="create"><dir name="items"><dir name="renderer"><file name="zakeke.phtml" hash="0da287c2ae4a87e0e768fdad0d0adfd3"/></dir></dir></dir><dir name="view"><dir name="items"><dir name="renderer"><file name="zakeke.phtml" hash="42f0631dd2ce37d9d7289b6d2785b222"/></dir></dir></dir></dir><dir name="view"><dir name="items"><dir name="renderer"><file name="zakeke.phtml" hash="867a37a7072be0cba7dc9f7c03cec0d4"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="zakeke.xml" hash="e64948c6a8cfd391d35b39c139789a6f"/></dir><dir name="template"><dir name="zakeke"><dir name="cart"><dir name="item"><file name="default.phtml" hash="bfb6e4a50c69ccfdfe66ad8c8711afdd"/></dir><file name="minicart.phtml" hash="1e7398e848e024bbeae11ed1550de3c8"/></dir><dir name="customization"><file name="add.phtml" hash="c647328e435fbe6dbe61e325e7a90f89"/></dir><file name="customize.phtml" hash="5b16967774ef9109760873480f2f23c2"/><file name="customizeButton.phtml" hash="78c81b67f8bb3e63c27d36054edaeb35"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="zakeke"><file name="customize.js" hash="efab393e72ffeedae64002dc1b8c002c"/><file name="jquery.js" hash="105112a8a757f683234e01dec3799022"/><file name="preview.js" hash="a22a32209982d2dda7561cff723b49bb"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="zakeke"><file name="modulechecker.css" hash="e7fd6efc953f7e2aae234607a0a379a8"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="it_IT"><file name="Futurenext_Zakeke.csv" hash="0f0a51c0319322d722cd93f43302b0a9"/></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension></required></dependencies>
|
| 18 |
</package>
|
skin/frontend/base/default/css/zakeke/productview.css
DELETED
|
File without changes
|
skin/frontend/base/default/js/zakeke/preview.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
| 1 |
-
/*******************************************************
|
| 2 |
-
* Copyright (C) 2016 FutureNext SRL
|
| 3 |
-
*
|
| 4 |
-
* This file is part of Zakeke.
|
| 5 |
-
*
|
| 6 |
-
* Zakeke can not be copied and/or distributed without the express
|
| 7 |
-
* permission of FutureNext SRL
|
| 8 |
-
*******************************************************/
|
| 9 |
-
|
| 10 |
-
function zakekeShowPreview(preview) {
|
| 11 |
-
var previewUrl = preview.lastElementChild.src,
|
| 12 |
-
previewLabel = preview.dataset.zakekeLabel,
|
| 13 |
-
backdrop = window.document.createElement('DIV'),
|
| 14 |
-
popup = window.document.createElement('DIV'),
|
| 15 |
-
content = window.document.createElement('DIV'),
|
| 16 |
-
label = window.document.createElement('DIV'),
|
| 17 |
-
labelText = window.document.createTextNode(previewLabel),
|
| 18 |
-
image = window.document.createElement('IMG');
|
| 19 |
-
|
| 20 |
-
content.style = 'position: relative';
|
| 21 |
-
|
| 22 |
-
if (previewLabel && previewLabel.length > 0) {
|
| 23 |
-
label.appendChild(labelText);
|
| 24 |
-
label.style.cssText = 'position: absolute; bottom: 0px; left: 0px; width: 100%; padding: 10px; box-sizing: border-box; color: rgb(51, 51, 51); background: rgba(255, 255, 255, 0.87) none repeat scroll 0% 0%; border-top: 1px solid rgb(255, 255, 255); border-bottom: 1px solid rgba(0, 0, 0, 0.25); border-radius: 0px 0px 5px 5px; box-shadow: 0px -2px 4px rgba(0, 0, 0, 0.35); font-weight: bold;';
|
| 25 |
-
|
| 26 |
-
content.appendChild(label);
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
-
image.src = previewUrl;
|
| 30 |
-
|
| 31 |
-
popup.style.cssText = 'align-self: center; background: white';
|
| 32 |
-
content.appendChild(image);
|
| 33 |
-
|
| 34 |
-
popup.appendChild(content);
|
| 35 |
-
|
| 36 |
-
backdrop.appendChild(popup);
|
| 37 |
-
|
| 38 |
-
backdrop.addEventListener('click', function () {
|
| 39 |
-
preview.parentElement.parentElement.removeChild(backdrop);
|
| 40 |
-
});
|
| 41 |
-
|
| 42 |
-
backdrop.style.cssText = 'position: fixed; height: 100%; width: 100%; background: black; left: 0; top: 0; z-index: 9999; display: flex; flex-direction: column; justify-content: center;';
|
| 43 |
-
|
| 44 |
-
preview.parentElement.parentElement.appendChild(backdrop);
|
| 45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
