Version Notes
Add support for different LayoutBuddy accounts on a Magento website level
Fix weight calculation based on quantities
Download this release
Release Info
Developer | LayoutBuddy Software GmbH |
Extension | LayoutBuddy_Layoutable |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- app/code/community/LayoutBuddy/Layoutable/Block/Catalog/Product/View/Embed.php +1 -8
- app/code/community/LayoutBuddy/Layoutable/Model/Api.php +20 -2
- app/code/community/LayoutBuddy/Layoutable/Model/Observer.php +14 -0
- app/code/community/LayoutBuddy/Layoutable/Model/System/Configid.php +31 -8
- app/code/community/LayoutBuddy/Layoutable/etc/config.xml +12 -1
- package.xml +6 -6
app/code/community/LayoutBuddy/Layoutable/Block/Catalog/Product/View/Embed.php
CHANGED
@@ -28,14 +28,7 @@ class LayoutBuddy_Layoutable_Block_Catalog_Product_View_Embed extends Mage_Catal
|
|
28 |
if ($id = (int)$this->getRequest()->getParam('id')) {
|
29 |
$cart = Mage::getSingleton('checkout/cart');
|
30 |
$quoteItem = $cart->getQuote()->getItemById($id);
|
31 |
-
$
|
32 |
-
$additionalOptions = (array)unserialize($options->getValue());
|
33 |
-
foreach ($additionalOptions as $key => $value) {
|
34 |
-
if ($value['label'] == 'ID') {
|
35 |
-
$initWidthId = $value['value'];
|
36 |
-
break;
|
37 |
-
}
|
38 |
-
}
|
39 |
}
|
40 |
|
41 |
// check if should be edited from wishlist
|
28 |
if ($id = (int)$this->getRequest()->getParam('id')) {
|
29 |
$cart = Mage::getSingleton('checkout/cart');
|
30 |
$quoteItem = $cart->getQuote()->getItemById($id);
|
31 |
+
$initWidthId = Mage::helper('layoutable')->getLayoutId($quoteItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
// check if should be edited from wishlist
|
app/code/community/LayoutBuddy/Layoutable/Model/Api.php
CHANGED
@@ -3,6 +3,19 @@
|
|
3 |
class LayoutBuddy_Layoutable_Model_Api
|
4 |
{
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
public function buildSignedParamArray($method, $params, $publicKey, $privateKey)
|
7 |
{
|
8 |
// make UTC timestamp
|
@@ -29,8 +42,13 @@ class LayoutBuddy_Layoutable_Model_Api
|
|
29 |
{
|
30 |
$client = new Zend_Http_Client(LayoutBuddy_Layoutable_Model_Config::getApiUrl() . $method);
|
31 |
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
// If authentication required, prepare signed request
|
36 |
if ($auth) {
|
3 |
class LayoutBuddy_Layoutable_Model_Api
|
4 |
{
|
5 |
|
6 |
+
protected $_website = null;
|
7 |
+
|
8 |
+
public function setWebsite($website)
|
9 |
+
{
|
10 |
+
$this->_website = $website;
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function getWebsite()
|
15 |
+
{
|
16 |
+
return $this->_website;
|
17 |
+
}
|
18 |
+
|
19 |
public function buildSignedParamArray($method, $params, $publicKey, $privateKey)
|
20 |
{
|
21 |
// make UTC timestamp
|
42 |
{
|
43 |
$client = new Zend_Http_Client(LayoutBuddy_Layoutable_Model_Config::getApiUrl() . $method);
|
44 |
|
45 |
+
if ($this->getWebsite()) {
|
46 |
+
$privateKey = $this->_website->getConfig('layoutable/account/private_key');
|
47 |
+
$publicKey = $this->_website->getConfig('layoutable/account/public_key');
|
48 |
+
} else {
|
49 |
+
$privateKey = Mage::getStoreConfig('layoutable/account/private_key');
|
50 |
+
$publicKey = Mage::getStoreConfig('layoutable/account/public_key');
|
51 |
+
}
|
52 |
|
53 |
// If authentication required, prepare signed request
|
54 |
if ($auth) {
|
app/code/community/LayoutBuddy/Layoutable/Model/Observer.php
CHANGED
@@ -23,6 +23,9 @@ class LayoutBuddy_Layoutable_Model_Observer extends Mage_Bundle_Model_Observer
|
|
23 |
// Set price
|
24 |
$item->setCustomPrice($customPrice);
|
25 |
$item->setOriginalCustomPrice($customPrice);
|
|
|
|
|
|
|
26 |
|
27 |
$showOptions = Mage::getStoreConfig('layoutable/display/show_options');
|
28 |
$showOptionSize = Mage::getStoreConfig('layoutable/display/show_option_size');
|
@@ -130,5 +133,16 @@ class LayoutBuddy_Layoutable_Model_Observer extends Mage_Bundle_Model_Observer
|
|
130 |
}
|
131 |
return $this;
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
}
|
23 |
// Set price
|
24 |
$item->setCustomPrice($customPrice);
|
25 |
$item->setOriginalCustomPrice($customPrice);
|
26 |
+
|
27 |
+
// Set quantity
|
28 |
+
$item->setAdditionalData(json_encode(array('layoutbuddy_qty' => $result['quantity'])));
|
29 |
|
30 |
$showOptions = Mage::getStoreConfig('layoutable/display/show_options');
|
31 |
$showOptionSize = Mage::getStoreConfig('layoutable/display/show_option_size');
|
133 |
}
|
134 |
return $this;
|
135 |
}
|
136 |
+
|
137 |
+
public function salesQuoteItemSetProduct($observer)
|
138 |
+
{
|
139 |
+
$quoteItem = $observer->getQuoteItem();
|
140 |
+
if ($data = $quoteItem->getAdditionalData()) {
|
141 |
+
$data = json_decode($quoteItem->getAdditionalData(), true);
|
142 |
+
if (isset($data['layoutbuddy_qty']) && ($quantity = $data['layoutbuddy_qty'])) {
|
143 |
+
$quoteItem->setWeight($observer->getProduct()->getWeight() * $quantity);
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
|
148 |
}
|
app/code/community/LayoutBuddy/Layoutable/Model/System/Configid.php
CHANGED
@@ -3,10 +3,10 @@
|
|
3 |
class LayoutBuddy_Layoutable_Model_System_Configid extends Varien_Object
|
4 |
{
|
5 |
|
6 |
-
static public function getOptionArray()
|
7 |
{
|
8 |
try {
|
9 |
-
$configs = Mage::getModel('layoutable/api')->jsonRequest('listConfigs', array(), true);
|
10 |
$result = array();
|
11 |
foreach ($configs as $config) {
|
12 |
$result[$config['id']] = $config['id'] . ': ' . $config['name'] . ' (' . $config['base'] . ')';
|
@@ -20,12 +20,35 @@ class LayoutBuddy_Layoutable_Model_System_Configid extends Varien_Object
|
|
20 |
static public function getAllOptions()
|
21 |
{
|
22 |
$res = array();
|
23 |
-
$res[] = array('value' => '', 'label'=> Mage::helper('catalog')->__('-- Please Select --'));
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
return $res;
|
31 |
}
|
3 |
class LayoutBuddy_Layoutable_Model_System_Configid extends Varien_Object
|
4 |
{
|
5 |
|
6 |
+
static public function getOptionArray($website = null)
|
7 |
{
|
8 |
try {
|
9 |
+
$configs = Mage::getModel('layoutable/api')->setWebsite($website)->jsonRequest('listConfigs', array(), true, null, $website);
|
10 |
$result = array();
|
11 |
foreach ($configs as $config) {
|
12 |
$result[$config['id']] = $config['id'] . ': ' . $config['name'] . ' (' . $config['base'] . ')';
|
20 |
static public function getAllOptions()
|
21 |
{
|
22 |
$res = array();
|
23 |
+
$res[] = array('value' => '', 'label' => Mage::helper('catalog')->__('-- Please Select --'));
|
24 |
+
|
25 |
+
$publicKeys = array();
|
26 |
+
foreach (Mage::app()->getWebsites() as $website) {
|
27 |
+
$publicKeys[] = $website->getConfig('layoutable/account/public_key');
|
28 |
+
}
|
29 |
+
if (count(array_unique($publicKeys)) === 1) {
|
30 |
+
// only one account, get result for default keys
|
31 |
+
foreach (self::getOptionArray() as $index => $value) {
|
32 |
+
$res[] = array(
|
33 |
+
'value' => $index,
|
34 |
+
'label' => $value
|
35 |
+
);
|
36 |
+
}
|
37 |
+
} else {
|
38 |
+
// multiple accounts, get results for all keys
|
39 |
+
foreach (Mage::app()->getWebsites() as $website) {
|
40 |
+
$configIds = array();
|
41 |
+
foreach (self::getOptionArray($website) as $index => $value) {
|
42 |
+
$configIds[] = array(
|
43 |
+
'value' => $index,
|
44 |
+
'label' => $value
|
45 |
+
);
|
46 |
+
}
|
47 |
+
$res[] = array(
|
48 |
+
'value' => $configIds,
|
49 |
+
'label' => $website->getName()
|
50 |
+
);
|
51 |
+
}
|
52 |
}
|
53 |
return $res;
|
54 |
}
|
app/code/community/LayoutBuddy/Layoutable/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
|
4 |
<modules>
|
5 |
<LayoutBuddy_Layoutable>
|
6 |
-
<version>1.1.
|
7 |
</LayoutBuddy_Layoutable>
|
8 |
</modules>
|
9 |
|
@@ -70,6 +70,17 @@
|
|
70 |
|
71 |
<frontend>
|
72 |
<events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
<checkout_cart_product_add_after>
|
74 |
<observers>
|
75 |
<layoutable_observer>
|
3 |
|
4 |
<modules>
|
5 |
<LayoutBuddy_Layoutable>
|
6 |
+
<version>1.1.1</version>
|
7 |
</LayoutBuddy_Layoutable>
|
8 |
</modules>
|
9 |
|
70 |
|
71 |
<frontend>
|
72 |
<events>
|
73 |
+
|
74 |
+
<sales_quote_item_set_product>
|
75 |
+
<observers>
|
76 |
+
<layoutable_observer>
|
77 |
+
<type>singleton</type>
|
78 |
+
<class>layoutable/observer</class>
|
79 |
+
<method>salesQuoteItemSetProduct</method>
|
80 |
+
</layoutable_observer>
|
81 |
+
</observers>
|
82 |
+
</sales_quote_item_set_product>
|
83 |
+
|
84 |
<checkout_cart_product_add_after>
|
85 |
<observers>
|
86 |
<layoutable_observer>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>LayoutBuddy_Layoutable</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -15,12 +15,12 @@
|
|
15 |
- Specially developed online shop solution for print service providers especially in Large Format Printing and supplier of signage products
|
16 |
- Print service provider/Shop Admin configures a variety of different product offers (posters, banners, displays, wallpapers, canvas, stickers etc.) in the backend
|
17 |
- Customer/Print Buyer designs the final artwork quickly with the easy to use online editor in the frontend, without requiring any graphic design skills</description>
|
18 |
-
<notes>
|
19 |
-
|
20 |
<authors><author><name>LayoutBuddy Software GmbH</name><user>layoutbuddy</user><email>admin@layoutbuddy.com</email></author></authors>
|
21 |
-
<date>
|
22 |
-
<time>
|
23 |
-
<contents><target name="magecommunity"><dir name="LayoutBuddy"><dir name="Layoutable"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Items"><file name="Grid.php" hash="5b1880f492b02254209ef8acb417483e"/></dir></dir><dir name="Popup"><file name="Embed.php" hash="3ffedc259119229c955bc065e693b7a2"/></dir></dir></dir></dir><dir name="Catalog"><dir name="Product"><dir name="View"><file name="Embed.php" hash="
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>Core</name><min></min><max></max></extension></required></dependencies>
|
26 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>LayoutBuddy_Layoutable</name>
|
4 |
+
<version>1.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
15 |
- Specially developed online shop solution for print service providers especially in Large Format Printing and supplier of signage products
|
16 |
- Print service provider/Shop Admin configures a variety of different product offers (posters, banners, displays, wallpapers, canvas, stickers etc.) in the backend
|
17 |
- Customer/Print Buyer designs the final artwork quickly with the easy to use online editor in the frontend, without requiring any graphic design skills</description>
|
18 |
+
<notes>Add support for different LayoutBuddy accounts on a Magento website level
|
19 |
+
Fix weight calculation based on quantities</notes>
|
20 |
<authors><author><name>LayoutBuddy Software GmbH</name><user>layoutbuddy</user><email>admin@layoutbuddy.com</email></author></authors>
|
21 |
+
<date>2015-02-13</date>
|
22 |
+
<time>10:50:23</time>
|
23 |
+
<contents><target name="magecommunity"><dir name="LayoutBuddy"><dir name="Layoutable"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Items"><file name="Grid.php" hash="5b1880f492b02254209ef8acb417483e"/></dir></dir><dir name="Popup"><file name="Embed.php" hash="3ffedc259119229c955bc065e693b7a2"/></dir></dir></dir></dir><dir name="Catalog"><dir name="Product"><dir name="View"><file name="Embed.php" hash="82f46452200ecd64a29b154122078826"/></dir></dir></dir><dir name="Checkout"><dir name="Cart"><dir name="Item"><file name="Configure.php" hash="9d448fb32ff98d4af355c4aaa8759481"/><file name="Renderer.php" hash="0760afa28b67e06b1567500454fa450a"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="d03344b03644314754a0b134f6827a7d"/><file name="Image.php" hash="02363224b2be78c1d6c64d41d6245023"/></dir><dir name="Model"><file name="Api.php" hash="4fd2a1ed5e13e735b71adbaa5e9c442b"/><file name="Config.php" hash="cda2fe5a08dcf22e53f87293b12c91a9"/><file name="Observer.php" hash="096c3f0224895d873b1e0338062aaac1"/><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="4ba26fa891ffdf1a2a1bd224eecba100"/></dir></dir></dir><dir name="System"><file name="Configid.php" hash="335955b6dc7ad4b025ea9fd87db82477"/><file name="Environment.php" hash="98f570428f694e0f5554dedfa86bf655"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="EditController.php" hash="f0973c48213a7a7f6a9951c736149e39"/><file name="PopupController.php" hash="3ca1e1b35601c0814005f1d6e7d2a993"/></dir></dir></dir><dir name="Checkout"><file name="CartController.php" hash="895e0af623ef3dab64edace7f2452086"/></dir></dir><dir name="etc"><file name="config.xml" hash="44ea58a3643fe28427a77d825993f171"/><file name="system.xml" hash="58b1cbd0ed76416e2566a301169c61fa"/></dir><dir name="sql"><dir name="layoutable_setup"><file name="mysql4-install-0.1.3.php" hash="ec58846c5e43764b3740dd6918874b24"/><file name="mysql4-upgrade-0.2.9-0.3.1.php" hash="ec58846c5e43764b3740dd6918874b24"/><file name="mysql4-upgrade-0.3.1-1.0.0.php" hash="f7e55c06bdaf5bb8a5e77c472ad13b7f"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="d81376b837b788ca7ef0323eb0331557"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="LayoutBuddy_Layoutable.xml" hash="d80f8ec230fd40559d4fccdd5148ebf9"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="layoutable.xml" hash="e054e9beba3d6d87c6c0a4c6dc0cadac"/></dir><dir name="template"><dir name="layoutable"><dir name="sales"><dir name="items"><dir name="column"><file name="name.phtml" hash="c46eb4c3cd9b253f435cd94ef87a655a"/></dir></dir><file name="js.phtml" hash="f637aed342309d40e74a0b15b7888932"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="layoutable.xml" hash="6eade9089e0299ebfd7f3f057078c9b0"/></dir><dir name="template"><dir name="layoutable"><dir name="adminhtml"><file name="sales_order_popup_embed.phtml" hash="6347f2aae8cfa7b7525bdcb63933c9f7"/></dir><dir name="catalog"><dir name="product"><dir name="view"><file name="addtocart.phtml" hash="069a844eeb213a2ea6f3aaa2b42a9321"/><file name="embedpopup.phtml" hash="30a9d93581afb547672334d7837f42e1"/></dir></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><dir name="configure"><file name="updatecart.phtml" hash="d0f982813c410d221d72fd2d346ddd7d"/></dir></dir><file name="preview.phtml" hash="3d156366951f387a99163794c0c0dee2"/></dir></dir><dir name="page"><file name="head.phtml" hash="81b94e668c7334f230c1fd6373fed653"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="LayoutBuddy_Layoutable.csv" hash="4024ed98c5a0398e25f6a6d12ee394fb"/></dir></dir></target><target name="mageweb"><dir name="js"><dir name="layoutbuddy"><dir name="fancybox"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancybox_loading.gif" hash="328cc0f6c78211485058d460e80f4fa8"/><file name="fancybox_loading@2x.gif" hash="f92938639fa894a0e8ded1c3368abe98"/><file name="fancybox_overlay.png" hash="77aeaa52715b898b73c74d68c630330e"/><file name="fancybox_sprite.png" hash="783d4031fe50c3d83c960911e1fbc705"/><file name="fancybox_sprite@2x.png" hash="ed9970ce22242421e66ff150aa97fe5f"/><dir name="helpers"><file name="fancybox_buttons.png" hash="b448080f8615e664b7788c7003803b59"/><file name="jquery.fancybox-buttons.css" hash="cac75538c2e3ddfadef839feaca8e356"/><file name="jquery.fancybox-buttons.js" hash="f53c246661fb995a3f12e67fa38e0fa0"/><file name="jquery.fancybox-media.js" hash="c017067f48d97ec4a077ccdf056e6a2e"/><file name="jquery.fancybox-thumbs.css" hash="52ddd84a9f42c1d4cd86d518a7f7e8bc"/><file name="jquery.fancybox-thumbs.js" hash="cf1fc1df534eede4cb460c5cbd71aba6"/></dir><file name="jquery.fancybox.css" hash="6c55951ce1e3115711f63f99b7501f3a"/><file name="jquery.fancybox.js" hash="921e9cb04ad6e2559869ec845c5be39b"/><file name="jquery.fancybox.pack.js" hash="cc9e759f24ba773aeef8a131889d3728"/></dir><file name="jquery.1.10.1.min.js" hash="2c348a8a373a2e0dc0f8d9cf2c87dfe1"/><dir name="swf"><file name="beeper.swf" hash="28a933130a183e28a80d7633a2d5503c"/></dir><file name="swfobject.js" hash="892a543f3abb54e8ec1ada55be3b0649"/></dir></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>Core</name><min></min><max></max></extension></required></dependencies>
|
26 |
</package>
|