Version Notes
Quantity Selector for Product page bundles
Download this release
Release Info
Developer | Increasingly |
Extension | increasingly_key |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.5
- app/code/community/Increasingly/Analytics/Helper/Data.php +1 -1
- app/code/community/Increasingly/Analytics/controllers/AddbundletocartController.php +23 -3
- app/code/community/Increasingly/Analytics/etc/config.xml +1 -1
- app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.5.php +29 -0
- app/design/frontend/base/default/template/increasingly/track.phtml +2 -2
- package.xml +5 -9
app/code/community/Increasingly/Analytics/Helper/Data.php
CHANGED
@@ -279,7 +279,7 @@ class Increasingly_Analytics_Helper_Data extends Mage_Core_Helper_Abstract
|
|
279 |
ksort($data);
|
280 |
$encodedData = base64_encode(Mage::helper('core')->jsonEncode($data));
|
281 |
$signature = md5($encodedData.$api_secret);
|
282 |
-
$url = 'http://
|
283 |
$client = new Varien_Http_Client($url);
|
284 |
|
285 |
$postData = array(
|
279 |
ksort($data);
|
280 |
$encodedData = base64_encode(Mage::helper('core')->jsonEncode($data));
|
281 |
$signature = md5($encodedData.$api_secret);
|
282 |
+
$url = 'http://localhost:8087/ImportData';
|
283 |
$client = new Varien_Http_Client($url);
|
284 |
|
285 |
$postData = array(
|
app/code/community/Increasingly/Analytics/controllers/AddbundletocartController.php
CHANGED
@@ -188,6 +188,7 @@ class Increasingly_Analytics_AddbundletocartController extends Mage_Core_Control
|
|
188 |
$this->cart= Mage::getSingleton('checkout/cart');
|
189 |
|
190 |
if($data[0]["bundle_id"] != null || $data[0]["bundle_id"] || ""){
|
|
|
191 |
$bundle_id = $data[0]["bundle_id"];
|
192 |
$productIds = [];
|
193 |
$discountPrice = $data[0]["discountPrice"];
|
@@ -196,9 +197,18 @@ class Increasingly_Analytics_AddbundletocartController extends Mage_Core_Control
|
|
196 |
$outOfStockProducts = [];
|
197 |
$productErrorStr = "";
|
198 |
$productSuccessStr = "";
|
|
|
|
|
199 |
for ($x = 0; $x < count($data[0]["params"]); $x++) {
|
200 |
$productIds[$x] = trim($data[0]["params"][$x]["product_id"]);
|
201 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
//Push the products into instock and out of stock arrays to handle the success and error messages at cart page
|
203 |
foreach ($productIds as $productId) {
|
204 |
$product = Mage::getModel('catalog/product');
|
@@ -213,21 +223,27 @@ class Increasingly_Analytics_AddbundletocartController extends Mage_Core_Control
|
|
213 |
$productErrorStr .= $product->getName().", ";
|
214 |
}
|
215 |
}
|
|
|
216 |
//Add all the instock products to the cart and prepare the success message
|
217 |
foreach ($inStockProducts as $product_id) {
|
218 |
$product = Mage::getModel('catalog/product');
|
219 |
$product->load($product_id);
|
220 |
-
$this->cart->addProduct($product,array('qty' =>
|
221 |
$productSuccessStr .= $product->getName().", ";
|
222 |
}
|
|
|
223 |
//Trim the success message
|
224 |
$productSuccessStr = rtrim(trim($productSuccessStr),',');
|
|
|
225 |
//Trim the error message
|
226 |
$productErrorStr = rtrim(trim($productErrorStr),',');
|
|
|
227 |
//Save all the products added to the cart
|
228 |
$this->cart->save();
|
|
|
229 |
//Add the bundles to the database if all the products are in stock
|
230 |
-
if(count($outOfStockProducts) == 0){
|
|
|
231 |
$productIdsStr = implode(',',$productIds);
|
232 |
$cookieValue = Mage::getModel('core/cookie')->get('ivid');
|
233 |
$userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()
|
@@ -244,19 +260,23 @@ class Increasingly_Analytics_AddbundletocartController extends Mage_Core_Control
|
|
244 |
$userBundle->setTotalPrice($totalPrice);
|
245 |
$userBundle->save();
|
246 |
}
|
|
|
247 |
//Set cart was updated flag
|
248 |
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
|
249 |
|
250 |
}
|
|
|
251 |
if($productSuccessStr != "")
|
252 |
Mage::getSingleton('core/session')->addSuccess($productSuccessStr.' added to your shopping cart');
|
|
|
253 |
//Error message for the out of stock products
|
254 |
if($productErrorStr != "")
|
255 |
Mage::getSingleton('core/session')->addNotice($productErrorStr.' is out of stock');
|
|
|
256 |
//Redirect to the cart
|
257 |
$this->_redirect('checkout/cart');
|
258 |
|
259 |
-
}
|
260 |
}
|
261 |
catch(Exception $e)
|
262 |
{
|
188 |
$this->cart= Mage::getSingleton('checkout/cart');
|
189 |
|
190 |
if($data[0]["bundle_id"] != null || $data[0]["bundle_id"] || ""){
|
191 |
+
|
192 |
$bundle_id = $data[0]["bundle_id"];
|
193 |
$productIds = [];
|
194 |
$discountPrice = $data[0]["discountPrice"];
|
197 |
$outOfStockProducts = [];
|
198 |
$productErrorStr = "";
|
199 |
$productSuccessStr = "";
|
200 |
+
$quantity = 1;
|
201 |
+
|
202 |
for ($x = 0; $x < count($data[0]["params"]); $x++) {
|
203 |
$productIds[$x] = trim($data[0]["params"][$x]["product_id"]);
|
204 |
}
|
205 |
+
|
206 |
+
if(count($productIds) == 1 && $bundle_id == 0){
|
207 |
+
|
208 |
+
$quantity = $data[0]["params"][0]["qty"];
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
//Push the products into instock and out of stock arrays to handle the success and error messages at cart page
|
213 |
foreach ($productIds as $productId) {
|
214 |
$product = Mage::getModel('catalog/product');
|
223 |
$productErrorStr .= $product->getName().", ";
|
224 |
}
|
225 |
}
|
226 |
+
|
227 |
//Add all the instock products to the cart and prepare the success message
|
228 |
foreach ($inStockProducts as $product_id) {
|
229 |
$product = Mage::getModel('catalog/product');
|
230 |
$product->load($product_id);
|
231 |
+
$this->cart->addProduct($product,array('qty' => $quantity));
|
232 |
$productSuccessStr .= $product->getName().", ";
|
233 |
}
|
234 |
+
|
235 |
//Trim the success message
|
236 |
$productSuccessStr = rtrim(trim($productSuccessStr),',');
|
237 |
+
|
238 |
//Trim the error message
|
239 |
$productErrorStr = rtrim(trim($productErrorStr),',');
|
240 |
+
|
241 |
//Save all the products added to the cart
|
242 |
$this->cart->save();
|
243 |
+
|
244 |
//Add the bundles to the database if all the products are in stock
|
245 |
+
if(count($outOfStockProducts) == 0 && count($productIds) > 1 && $bundle_id > 0){
|
246 |
+
|
247 |
$productIdsStr = implode(',',$productIds);
|
248 |
$cookieValue = Mage::getModel('core/cookie')->get('ivid');
|
249 |
$userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()
|
260 |
$userBundle->setTotalPrice($totalPrice);
|
261 |
$userBundle->save();
|
262 |
}
|
263 |
+
|
264 |
//Set cart was updated flag
|
265 |
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
|
266 |
|
267 |
}
|
268 |
+
|
269 |
if($productSuccessStr != "")
|
270 |
Mage::getSingleton('core/session')->addSuccess($productSuccessStr.' added to your shopping cart');
|
271 |
+
|
272 |
//Error message for the out of stock products
|
273 |
if($productErrorStr != "")
|
274 |
Mage::getSingleton('core/session')->addNotice($productErrorStr.' is out of stock');
|
275 |
+
|
276 |
//Redirect to the cart
|
277 |
$this->_redirect('checkout/cart');
|
278 |
|
279 |
+
}
|
280 |
}
|
281 |
catch(Exception $e)
|
282 |
{
|
app/code/community/Increasingly/Analytics/etc/config.xml
CHANGED
@@ -32,7 +32,7 @@
|
|
32 |
<config>
|
33 |
<modules>
|
34 |
<Increasingly_Analytics>
|
35 |
-
<version>1.0.
|
36 |
</Increasingly_Analytics>
|
37 |
</modules>
|
38 |
<global>
|
32 |
<config>
|
33 |
<modules>
|
34 |
<Increasingly_Analytics>
|
35 |
+
<version>1.0.5</version>
|
36 |
</Increasingly_Analytics>
|
37 |
</modules>
|
38 |
<global>
|
app/code/community/Increasingly/Analytics/sql/increasingly_analytics_setup/mysql4-install-1.0.5.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
CREATE TABLE IF NOT EXISTS {$this->getTable('increasingly_analytics_bundle')} (
|
10 |
+
|
11 |
+
`id` int NOT NULL auto_increment,
|
12 |
+
|
13 |
+
`bundle_id` int NOT NULL default 0,
|
14 |
+
|
15 |
+
`product_ids` varchar(100) NOT NULL,
|
16 |
+
|
17 |
+
`increasingly_visitor_id` varchar(100) NOT NULL,
|
18 |
+
|
19 |
+
`discount_price` decimal(12,4) NULL,
|
20 |
+
|
21 |
+
`total_price` decimal(12,4) NOT NULL,
|
22 |
+
|
23 |
+
PRIMARY KEY (`id`)
|
24 |
+
|
25 |
+
);
|
26 |
+
|
27 |
+
");
|
28 |
+
|
29 |
+
$installer->endSetup();
|
app/design/frontend/base/default/template/increasingly/track.phtml
CHANGED
@@ -40,10 +40,10 @@
|
|
40 |
}
|
41 |
|
42 |
window.increasingly.load=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
43 |
-
r.type="text/javascript";r.async=true;r.src="http://
|
44 |
|
45 |
window.increasingly.loadJs=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
46 |
-
r.type="text/javascript";r.async=true;r.src="http://
|
47 |
|
48 |
increasingly.load();
|
49 |
increasingly.loadJs();
|
40 |
}
|
41 |
|
42 |
window.increasingly.load=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
43 |
+
r.type="text/javascript";r.async=true;r.src="http://127.0.0.1/magento/js/track.js";n.parentNode.insertBefore(r,n);};
|
44 |
|
45 |
window.increasingly.loadJs=function(){var t=document;var n=t.getElementsByTagName("script")[0];var r=t.createElement("script");
|
46 |
+
r.type="text/javascript";r.async=true;r.src="http://127.0.0.1/magento/js/increasingly.js";n.parentNode.insertBefore(r,n);};
|
47 |
|
48 |
increasingly.load();
|
49 |
increasingly.loadJs();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>increasingly_key</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -44,15 +44,11 @@ It's free to try & we have a 14-day trial where you can test it for no-risk
|
|
44 |

|
45 |
We have a dashboard which provides you with in depth analytics and insights on what's sells together & allows you to administer and manage your bundles.
|
46 |
</description>
|
47 |
-
<notes>
|
48 |
-
Configuring bundles for the Store
|
49 |
-
Enhancements in Product description in Increasingly bundles
|
50 |
-
Cart Page bundle fixes
|
51 |
-
Support for multiple layouts of the bundle display for Product page,Category Page,Cart page</notes>
|
52 |
<authors><author><name>Increasingly</name><user>Increasingly</user><email>renu@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>shree@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>satish@increasingly.co</email></author></authors>
|
53 |
-
<date>2016-
|
54 |
-
<time>
|
55 |
-
<contents><target name="magecommunity"><dir name="Increasingly"><dir name="Analytics"><dir name="Block"><file name="Addtocart.php" hash="3429b60b501c7681a3c79fd46138b787"/><dir name="Adminhtml"><file name="DataIntegration.php" hash="b7c543b33f563ef458d403df94c62a4c"/></dir><file name="Cart.php" hash="56c9f503b7c55d835cbd93c675dcc338"/><file name="Category.php" hash="3b87f305e0957dd1fdace455c1f0fa7c"/><file name="Element.php" hash="8d533705e7a3c1ada7d775a6d9282f43"/><file name="Embed.php" hash="5ba08a6642ed22d8bb1a84ab0501f8dc"/><file name="Pagetype.php" hash="f670440a3f90bfa9a48b406fc37d538c"/><file name="Product.php" hash="2da759eb9bd2bf13e5a8a92087981206"/><file name="Track.php" hash="aa6a9d870f14c4e3721675658dfb276e"/></dir><dir name="Helper"><file name="Data.php" hash="
|
56 |
<compatible/>
|
57 |
<dependencies><required><php><min>5.2.0</min><max>7.0.7</max></php></required></dependencies>
|
58 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>increasingly_key</name>
|
4 |
+
<version>1.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
44 |

|
45 |
We have a dashboard which provides you with in depth analytics and insights on what's sells together & allows you to administer and manage your bundles.
|
46 |
</description>
|
47 |
+
<notes>Quantity Selector for Product page bundles</notes>
|
|
|
|
|
|
|
|
|
48 |
<authors><author><name>Increasingly</name><user>Increasingly</user><email>renu@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>shree@increasingly.co</email></author><author><name>Increasingly</name><user>Increasingly</user><email>satish@increasingly.co</email></author></authors>
|
49 |
+
<date>2016-08-02</date>
|
50 |
+
<time>08:45:26</time>
|
51 |
+
<contents><target name="magecommunity"><dir name="Increasingly"><dir name="Analytics"><dir name="Block"><file name="Addtocart.php" hash="3429b60b501c7681a3c79fd46138b787"/><dir name="Adminhtml"><file name="DataIntegration.php" hash="b7c543b33f563ef458d403df94c62a4c"/></dir><file name="Cart.php" hash="56c9f503b7c55d835cbd93c675dcc338"/><file name="Category.php" hash="3b87f305e0957dd1fdace455c1f0fa7c"/><file name="Element.php" hash="8d533705e7a3c1ada7d775a6d9282f43"/><file name="Embed.php" hash="5ba08a6642ed22d8bb1a84ab0501f8dc"/><file name="Pagetype.php" hash="f670440a3f90bfa9a48b406fc37d538c"/><file name="Product.php" hash="2da759eb9bd2bf13e5a8a92087981206"/><file name="Track.php" hash="aa6a9d870f14c4e3721675658dfb276e"/></dir><dir name="Helper"><file name="Data.php" hash="ce3191677cc5b10a5b919b6e78d6498b"/><file name="DateFormatter.php" hash="d8f963bd1f9fe390e038a2065fd5c4c4"/><file name="PriceFormatter.php" hash="9bc46d3afb4612131a29b9a1c2b82fad"/><file name="ProductFormatter.php" hash="4bb2579b007700a808cdcea4fdb978c8"/></dir><dir name="Model"><file name="Base.php" hash="957cc5bb083e9b49b5468c986a1e846a"/><file name="Bundle.php" hash="767a26eaefaed893d163737d64930933"/><file name="DataIntegration.php" hash="ff9dc202ea17e49ceaba09c6190492cd"/><dir name="Meta"><file name="Product.php" hash="6a037e5325193fae3147fc1a9891606c"/></dir><dir name="Mysql4"><dir name="Bundle"><file name="Collection.php" hash="021c49a92767b78e238477a3dc8da783"/></dir><file name="Bundle.php" hash="83ad548248f3ebcfc73158ab672cb683"/><file name="Setup.php" hash="664019080c6c0ebdbc50b889eac1e1e0"/></dir><file name="Observer.php" hash="f069d141e1bdae7c18a711b04aafa996"/><file name="Product.php" hash="f473c25a470a2509b00a4a15ed8b857f"/></dir><dir name="controllers"><file name="AddbundletocartController.php" hash="9777f0286661922ad977cb443a15a463"/><dir name="Adminhtml"><file name="DataIntegrationController.php" hash="0758d4716d337002a8c49f843e06cec2"/></dir><file name="ProductsApiController.php" hash="3c5d188b650fe9f1d435e9ba9ffbd35d"/></dir><dir name="etc"><file name="config.xml" hash="3fdf51eba039dcf4a3b5a05552531a47"/></dir><dir name="sql"><dir name="increasingly_analytics_setup"><file name="mysql-install-1.0.0.php" hash="bddf4e67e7b69c5604b448e3b1fa27a0"/><file name="mysql4-install-1.0.3.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.4.php" hash="e857df177cfbb887cece6de0ff5498b6"/><file name="mysql4-install-1.0.5.php" hash="e857df177cfbb887cece6de0ff5498b6"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="increasingly"><file name="dataintegration.phtml" hash="8a730e566c21b2155d6f3e4ca73a1b6d"/></dir></dir><dir name="layout"><file name="increasingly_analytics.xml" hash="d859a26dba5142f02e514f28f507891c"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="increasingly"><file name="addtocart.phtml" hash="e3af2445ac014887b3072cf85dd81d4f"/><file name="cart.phtml" hash="1c5ee986109cfb4600d3e15057263d36"/><file name="category.phtml" hash="75e77b9d1cbbd1e0129c0c10737461e6"/><file name="element.phtml" hash="c5f1cbbc02801009247409890172ca4e"/><file name="embed.phtml" hash="52cde76a239e3084ce3a1254b004a742"/><file name="pagetype.phtml" hash="fe1a7f313c82f355f14d5f13c284cb28"/><file name="product.phtml" hash="14d24b0ced5abc85619aa3538b21f2f7"/><file name="track.phtml" hash="173419fb9f1f8a4352c502c67876ad89"/></dir></dir><dir name="layout"><file name="increasingly_analytics.xml" hash="78766218deed3d60d4ab0fdee7729b91"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Increasingly_Analytics.xml" hash="d285a9ae62b5b0624b727e341fe8e005"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="increasingly"><file name="loader.gif" hash="a51c5608d01acf32df728f299767f82b"/></dir></dir></dir></dir></target></contents>
|
52 |
<compatible/>
|
53 |
<dependencies><required><php><min>5.2.0</min><max>7.0.7</max></php></required></dependencies>
|
54 |
</package>
|