Version Notes
- First release
- Supporting configuration of the module in the settings administration
- Supporting visualization of the BubblitPlugin in the product details page
Download this release
Release Info
| Developer | Terje Lindstad |
| Extension | Bubbleyes_BubblitPlugin |
| Version | 1.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0
- app/code/community/Bubbleyes/BubblitPlugin/Block/Button.php +33 -0
- app/code/community/Bubbleyes/BubblitPlugin/Helper/Data.php +74 -0
- app/code/community/Bubbleyes/BubblitPlugin/Model/Config/Source/Bubbllayout.php +22 -0
- app/code/community/Bubbleyes/BubblitPlugin/Model/Config/Source/Helpinfo/Comment.php +40 -0
- app/code/community/Bubbleyes/BubblitPlugin/Model/Observer.php +119 -0
- app/code/community/Bubbleyes/BubblitPlugin/etc/config.xml +105 -0
- app/code/community/Bubbleyes/BubblitPlugin/etc/system.xml +94 -0
- app/design/frontend/Bubbleyes/default/etc/theme.xml +4 -0
- app/design/frontend/Bubbleyes/default/layout/local.xml +16 -0
- app/design/frontend/Bubbleyes/default/template/catalog/product/view/sharing.phtml +52 -0
- app/design/frontend/base/default/layout/Bubbleyes_BubblitPlugin.xml +9 -0
- app/design/frontend/base/default/template/BubblitPlugin/button.phtml +1 -0
- app/etc/modules/Bubbleyes_BubblitPlugin.xml +14 -0
- package.xml +21 -0
app/code/community/Bubbleyes/BubblitPlugin/Block/Button.php
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Bubbleyes_BubblitPlugin_Block_Button
|
| 3 |
+
extends Mage_Catalog_Block_Product_View
|
| 4 |
+
{
|
| 5 |
+
protected $_helper;
|
| 6 |
+
|
| 7 |
+
public function __construct()
|
| 8 |
+
{
|
| 9 |
+
$this->_helper = Mage::helper("Bubbleyes_BubblitPlugin");
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
public function getProductScript()
|
| 13 |
+
{
|
| 14 |
+
try{
|
| 15 |
+
if($this->_helper->isBubblEnabledInDetails())
|
| 16 |
+
{
|
| 17 |
+
$productSKU = $this -> getProduct() -> sku;
|
| 18 |
+
|
| 19 |
+
$productData = array(
|
| 20 |
+
'SKU' => $productSKU
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
$settings = array(
|
| 24 |
+
'Type' => $this->_helper->getBubblLayout()
|
| 25 |
+
);
|
| 26 |
+
|
| 27 |
+
return $this->_helper->CallAPIWithResponse('getProductScript', array('Product' => $productData, 'Settings' => $settings))["Script"];
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
catch (Exception $ex) { }
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
?>
|
app/code/community/Bubbleyes/BubblitPlugin/Helper/Data.php
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Bubbleyes_BubblitPlugin_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
+
{
|
| 4 |
+
static $APIAddress = "http://api.bubbleyes.com/client/";
|
| 5 |
+
static $ProductsPortionSize = 100;
|
| 6 |
+
|
| 7 |
+
public static function getProductPortionSize() {
|
| 8 |
+
return self::$ProductsPortionSize;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
public static function getAPIMethod($method) {
|
| 12 |
+
return self::$APIAddress . $method;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
public static function getAPIKey($storeId = null) {
|
| 16 |
+
return Mage::getStoreConfig('BubbleyesBubblitPluginOptions/api_access/api_key', $storeId);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
public static function isBubblEnabledInDetails($storeId = null) {
|
| 20 |
+
return Mage::getStoreConfig('BubbleyesBubblitPluginOptions/bubbl_layout/bubblenabled', $storeId);
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
public static function getBubblLayout($storeId = null) {
|
| 24 |
+
return Mage::getStoreConfig('BubbleyesBubblitPluginOptions/bubbl_layout/bubbllayout', $storeId);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
public static function CallAPI($method, $params) {
|
| 28 |
+
$data = json_encode($params);
|
| 29 |
+
|
| 30 |
+
$response = null;
|
| 31 |
+
|
| 32 |
+
if ($curl = curl_init()) {
|
| 33 |
+
curl_setopt($curl, CURLOPT_URL, self::getAPIMethod($method));
|
| 34 |
+
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
|
| 35 |
+
'Authorization: Basic ' . self::getAPIKey(),
|
| 36 |
+
'Content-Type: application/json',
|
| 37 |
+
'Content-Length: ' . strlen($data)));
|
| 38 |
+
curl_setopt($curl, CURLOPT_POST, true);
|
| 39 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
| 40 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
|
| 41 |
+
curl_setopt($curl, CURLOPT_NOSIGNAL, 1);
|
| 42 |
+
curl_setopt($curl, CURLOPT_TIMEOUT , 250);
|
| 43 |
+
|
| 44 |
+
curl_exec($curl);
|
| 45 |
+
|
| 46 |
+
curl_close ($curl);
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
public static function CallAPIWithResponse($method, $params) {
|
| 51 |
+
$data = json_encode($params);
|
| 52 |
+
|
| 53 |
+
$response = null;
|
| 54 |
+
|
| 55 |
+
if ($curl = curl_init()) {
|
| 56 |
+
curl_setopt($curl, CURLOPT_URL, self::getAPIMethod($method));
|
| 57 |
+
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
|
| 58 |
+
'Authorization: Basic ' . self::getAPIKey(),
|
| 59 |
+
'Content-Type: application/json',
|
| 60 |
+
'Content-Length: ' . strlen($data)));
|
| 61 |
+
curl_setopt($curl, CURLOPT_POST, true);
|
| 62 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
| 63 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
| 64 |
+
curl_setopt($curl, CURLOPT_NOSIGNAL, 1);
|
| 65 |
+
|
| 66 |
+
$response = curl_exec($curl);
|
| 67 |
+
|
| 68 |
+
curl_close ($curl);
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
return (array)json_decode($response, true);
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
?>
|
app/code/community/Bubbleyes/BubblitPlugin/Model/Config/Source/Bubbllayout.php
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Bubbleyes_BubblitPlugin_Model_Config_Source_Bubbllayout
|
| 4 |
+
{
|
| 5 |
+
public function toOptionArray()
|
| 6 |
+
{
|
| 7 |
+
return array(
|
| 8 |
+
array('value' => 'long', 'label' => 'extended'),
|
| 9 |
+
array('value' => 'short', 'label' => 'compact'),
|
| 10 |
+
);
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
public function toArray()
|
| 14 |
+
{
|
| 15 |
+
return array(
|
| 16 |
+
'long' => 'extended',
|
| 17 |
+
'short' => 'compact'
|
| 18 |
+
);
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
?>
|
app/code/community/Bubbleyes/BubblitPlugin/Model/Config/Source/Helpinfo/Comment.php
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Bubbleyes_BubblitPlugin_Model_Config_Source_Helpinfo_Comment extends Mage_Core_Model_Config_Data
|
| 4 |
+
{
|
| 5 |
+
public function getCommentText(Mage_Core_Model_Config_Element $element, $currentValue)
|
| 6 |
+
{
|
| 7 |
+
$supportedCurrencies = Mage::helper("Bubbleyes_BubblitPlugin")->CallAPIWithResponse('listSupportedCurrencies', array());
|
| 8 |
+
|
| 9 |
+
$result = '
|
| 10 |
+
<ul style="font-size:11px">
|
| 11 |
+
<li>1. Register to the Bubbleyes.com platform <br/>(at <a href="http://bubbleyes.com/" target="_blank">http://bubbleyes.com/</a>).
|
| 12 |
+
<br/> Upon registration you will be able to log in to the Bubbleyes Client Platform (at <a href="http://admin.bubbleyes.com/" target="_blank">http://admin.bubbleyes.com/</a>). In your profile there you can access the API key needed in the plugin configuration.
|
| 13 |
+
</li>
|
| 14 |
+
|
| 15 |
+
<li>
|
| 16 |
+
<br/>
|
| 17 |
+
2. Once the plugin is configured all products data will be automatically synchronized between your Magento installation and your Bubbleyes installation.
|
| 18 |
+
<br/> This includes automatically making changes when products are created or edited or deleted.
|
| 19 |
+
</li>
|
| 20 |
+
|
| 21 |
+
<li>
|
| 22 |
+
<br/>
|
| 23 |
+
3. The supoorted currencies are: '
|
| 24 |
+
. implode(", ", $supportedCurrencies)
|
| 25 |
+
. '<br/> If you currency is not in the supported list, your data will not be synchonized.
|
| 26 |
+
</li>
|
| 27 |
+
|
| 28 |
+
<li>
|
| 29 |
+
<br />
|
| 30 |
+
4. If you want the plugin setup to insert automatically the Bubbl button in the product details, please set "Bubbl Button Enabled In Details" = yes.
|
| 31 |
+
To insert manually the Bubbl button in your theme, please use as reference the Bubbleyes theme, which is created with the plugin installation.
|
| 32 |
+
</li>
|
| 33 |
+
</ul>
|
| 34 |
+
';
|
| 35 |
+
|
| 36 |
+
return $result;
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
?>
|
app/code/community/Bubbleyes/BubblitPlugin/Model/Observer.php
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Bubbleyes_BubblitPlugin_Model_Observer
|
| 4 |
+
{
|
| 5 |
+
protected $_helper;
|
| 6 |
+
|
| 7 |
+
public function __construct()
|
| 8 |
+
{
|
| 9 |
+
$this->_helper = Mage::helper("Bubbleyes_BubblitPlugin");
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
public function HandleProductUpdate(Varien_Event_Observer $observer)
|
| 13 |
+
{
|
| 14 |
+
try{
|
| 15 |
+
// Retrieve the product being updated from the event observer
|
| 16 |
+
$product = $observer->getEvent()->getProduct();
|
| 17 |
+
|
| 18 |
+
if($product->sku != null)
|
| 19 |
+
{
|
| 20 |
+
$categories = $product -> getCategoryCollection() -> addAttributeToSelect(array('name'));
|
| 21 |
+
$productCategory = null;
|
| 22 |
+
if(count($categories) > 0)
|
| 23 |
+
{
|
| 24 |
+
$productCategory = $categories -> getFirstItem() -> getName();
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
$productData = array(
|
| 28 |
+
'SKU' => $product->sku,
|
| 29 |
+
'Name' => $product->name,
|
| 30 |
+
'ShopUrl' => $product-> getProductUrl(),
|
| 31 |
+
'Description' => $product->short_description,
|
| 32 |
+
'Currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
| 33 |
+
'Price' => number_format($product->price, 2, '.', ''),
|
| 34 |
+
'DiscountedPrice' => $product-> special_price == null ? null : number_format($product-> special_price, 2, '.', ''),
|
| 35 |
+
'IsActive' => ($product -> status) == 1 ? "true" : "false",
|
| 36 |
+
'Image' => $product -> getImage() != 'no_selection' ? $product -> getImageUrl() : null,
|
| 37 |
+
'Category' => $productCategory
|
| 38 |
+
);
|
| 39 |
+
|
| 40 |
+
$this->_helper->CallAPI('createOrEditProduct', array('Product' => $productData));
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
catch (Exception $ex) { }
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
public function HandleProductDelete(Varien_Event_Observer $observer)
|
| 47 |
+
{
|
| 48 |
+
try{
|
| 49 |
+
$product = $observer->getEvent()->getProduct();
|
| 50 |
+
$productData = array(
|
| 51 |
+
'SKU' => $product->sku
|
| 52 |
+
);
|
| 53 |
+
|
| 54 |
+
$this->_helper->CallAPI('deleteProduct', array('Product' => $productData));
|
| 55 |
+
}
|
| 56 |
+
catch (Exception $ex) { }
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
public function HandleSettingsChanged(Varien_Event_Observer $observer)
|
| 60 |
+
{
|
| 61 |
+
try{
|
| 62 |
+
$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect(array('name', 'short_description', 'price', 'special_price', 'currency', 'status', 'image'));
|
| 63 |
+
|
| 64 |
+
//do in portions
|
| 65 |
+
foreach($products as $product)
|
| 66 |
+
{
|
| 67 |
+
$productsPortion = array();
|
| 68 |
+
|
| 69 |
+
$itt = 0;
|
| 70 |
+
while($itt < $this->_helper->getProductPortionSize())
|
| 71 |
+
{
|
| 72 |
+
|
| 73 |
+
array_push($productsPortion, $product);
|
| 74 |
+
$itt++;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
$this->_helper->CallAPI('importProducts', array('ProductsXML' => self::BuildProductsXML($productsPortion)));
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
catch (Exception $ex) { }
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
public static function BuildProductsXML($products) {
|
| 84 |
+
$productsXML = new SimpleXMLElement('<products/>');
|
| 85 |
+
|
| 86 |
+
foreach ($products as $product)
|
| 87 |
+
{
|
| 88 |
+
$productXML = $productsXML -> addChild("product");
|
| 89 |
+
|
| 90 |
+
$productXML -> addAttribute("sku", $product->sku);
|
| 91 |
+
|
| 92 |
+
$productXML -> addChild("shopurl", $product-> getProductUrl());
|
| 93 |
+
|
| 94 |
+
$productXML -> addChild("name", $product->name);
|
| 95 |
+
$productXML -> addChild("description", $product->short_description);
|
| 96 |
+
$productXML -> addChild("currency", Mage::app()->getStore()->getCurrentCurrencyCode());
|
| 97 |
+
$productXML -> addChild("price", number_format($product->price, 2, '.', ''));
|
| 98 |
+
|
| 99 |
+
$discountedPrice = $product-> special_price;
|
| 100 |
+
if($discountedPrice != null) {
|
| 101 |
+
$productXML -> addChild("discountedprice", number_format($discountedPrice, 2, '.', ''));
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
$productXML -> addChild("active", ($product -> status) == 1 ? "true" : "false");
|
| 105 |
+
|
| 106 |
+
$categories = $product -> getCategoryCollection() -> addAttributeToSelect(array('name'));
|
| 107 |
+
if(count($categories) > 0)
|
| 108 |
+
{
|
| 109 |
+
$productXML -> addChild("category", $categories -> getFirstItem() -> getName());
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
$productXML -> addChild("image", $product -> getImage() != 'no_selection' ? $product -> getImageUrl() : null);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
return $productsXML->asXML();
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
?>
|
app/code/community/Bubbleyes/BubblitPlugin/etc/config.xml
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
|
| 3 |
+
<!-- The root node for Magento module configuration -->
|
| 4 |
+
<config>
|
| 5 |
+
<modules>
|
| 6 |
+
|
| 7 |
+
<Bubbleyes_BubblitPlugin>
|
| 8 |
+
<version>1.0.0</version>
|
| 9 |
+
</Bubbleyes_BubblitPlugin>
|
| 10 |
+
|
| 11 |
+
</modules>
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
<!-- Configure our module's behavior in the global scope -->
|
| 15 |
+
<global>
|
| 16 |
+
|
| 17 |
+
<!-- Defining models -->
|
| 18 |
+
<models>
|
| 19 |
+
<bubbleyes_bubblitplugin>
|
| 20 |
+
<class>Bubbleyes_BubblitPlugin_Model</class>
|
| 21 |
+
</bubbleyes_bubblitplugin>
|
| 22 |
+
</models>
|
| 23 |
+
|
| 24 |
+
<!-- Defining an event observer -->
|
| 25 |
+
<events>
|
| 26 |
+
<!-- The code of the events we want to observe -->
|
| 27 |
+
<catalog_product_save_after>
|
| 28 |
+
<observers>
|
| 29 |
+
<bubbleyes_bubblitplugin>
|
| 30 |
+
<type>singleton</type>
|
| 31 |
+
<class>bubbleyes_bubblitplugin/observer</class>
|
| 32 |
+
<method>HandleProductUpdate</method>
|
| 33 |
+
</bubbleyes_bubblitplugin>
|
| 34 |
+
</observers>
|
| 35 |
+
</catalog_product_save_after>
|
| 36 |
+
|
| 37 |
+
<catalog_product_delete_after>
|
| 38 |
+
<observers>
|
| 39 |
+
<bubbleyes_bubblitplugin>
|
| 40 |
+
<type>singleton</type>
|
| 41 |
+
<class>bubbleyes_bubblitplugin/observer</class>
|
| 42 |
+
<method>HandleProductDelete</method>
|
| 43 |
+
</bubbleyes_bubblitplugin>
|
| 44 |
+
</observers>
|
| 45 |
+
</catalog_product_delete_after>
|
| 46 |
+
|
| 47 |
+
<admin_system_config_changed_section_BubbleyesBubblitPluginOptions>
|
| 48 |
+
<observers>
|
| 49 |
+
<bubbleyes_bubblitplugin>
|
| 50 |
+
<type>singleton</type>
|
| 51 |
+
<class>bubbleyes_bubblitplugin/observer</class>
|
| 52 |
+
<method>HandleSettingsChanged</method>
|
| 53 |
+
</bubbleyes_bubblitplugin>
|
| 54 |
+
</observers>
|
| 55 |
+
</admin_system_config_changed_section_BubbleyesBubblitPluginOptions>
|
| 56 |
+
</events>
|
| 57 |
+
|
| 58 |
+
<helpers>
|
| 59 |
+
<Bubbleyes_BubblitPlugin>
|
| 60 |
+
<class>Bubbleyes_BubblitPlugin_Helper</class>
|
| 61 |
+
</Bubbleyes_BubblitPlugin>
|
| 62 |
+
</helpers>
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
<blocks>
|
| 66 |
+
<BubblitPlugin>
|
| 67 |
+
<class>Bubbleyes_BubblitPlugin_Block</class>
|
| 68 |
+
</BubblitPlugin>
|
| 69 |
+
</blocks>
|
| 70 |
+
</global>
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
<!-- we are making changes to the frontend -->
|
| 74 |
+
<frontend>
|
| 75 |
+
<layout>
|
| 76 |
+
<updates>
|
| 77 |
+
<Bubbleyes_BubblitPlugin module="Bubbleyes_BubblitPlugin">
|
| 78 |
+
<file>Bubbleyes_BubblitPlugin.xml</file>
|
| 79 |
+
</Bubbleyes_BubblitPlugin>
|
| 80 |
+
</updates>
|
| 81 |
+
</layout>
|
| 82 |
+
</frontend>
|
| 83 |
+
|
| 84 |
+
<adminhtml>
|
| 85 |
+
<acl>
|
| 86 |
+
<resources>
|
| 87 |
+
<admin>
|
| 88 |
+
<children>
|
| 89 |
+
<system>
|
| 90 |
+
<children>
|
| 91 |
+
<config>
|
| 92 |
+
<children>
|
| 93 |
+
<BubbleyesBubblitPluginOptions>
|
| 94 |
+
<title>Bubbleyes BubblitPlugin Module Section</title>
|
| 95 |
+
</BubbleyesBubblitPluginOptions>
|
| 96 |
+
</children>
|
| 97 |
+
</config>
|
| 98 |
+
</children>
|
| 99 |
+
</system>
|
| 100 |
+
</children>
|
| 101 |
+
</admin>
|
| 102 |
+
</resources>
|
| 103 |
+
</acl>
|
| 104 |
+
</adminhtml>
|
| 105 |
+
</config>
|
app/code/community/Bubbleyes/BubblitPlugin/etc/system.xml
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<config>
|
| 2 |
+
<tabs>
|
| 3 |
+
<Bubbleyes translate="label">
|
| 4 |
+
<label>Bubbleyes Extensions</label>
|
| 5 |
+
<sort_order>150</sort_order>
|
| 6 |
+
</Bubbleyes>
|
| 7 |
+
</tabs>
|
| 8 |
+
|
| 9 |
+
<sections>
|
| 10 |
+
<BubbleyesBubblitPluginOptions translate="label" module="Bubbleyes_BubblitPlugin">
|
| 11 |
+
<class>separator-top</class>
|
| 12 |
+
<label>Bubblit Plugin</label>
|
| 13 |
+
<tab>Bubbleyes</tab>
|
| 14 |
+
<sort_order>1</sort_order>
|
| 15 |
+
<show_in_default>1</show_in_default>
|
| 16 |
+
<show_in_website>0</show_in_website>
|
| 17 |
+
<show_in_store>0</show_in_store>
|
| 18 |
+
<groups>
|
| 19 |
+
<api_access translate="label">
|
| 20 |
+
<label>API Access</label>
|
| 21 |
+
<frontend_type>text</frontend_type>
|
| 22 |
+
<sort_order>1</sort_order>
|
| 23 |
+
<show_in_default>1</show_in_default>
|
| 24 |
+
<show_in_website>0</show_in_website>
|
| 25 |
+
<show_in_store>0</show_in_store>
|
| 26 |
+
<expanded>1</expanded>
|
| 27 |
+
<fields>
|
| 28 |
+
<api_key translate="label comment">
|
| 29 |
+
<label>API key</label>
|
| 30 |
+
<comment><![CDATA[API key providing access to the Bubbleyes API.]]></comment>
|
| 31 |
+
<frontend_type>text</frontend_type>
|
| 32 |
+
<sort_order>1</sort_order>
|
| 33 |
+
<show_in_default>1</show_in_default>
|
| 34 |
+
<show_in_website>0</show_in_website>
|
| 35 |
+
<show_in_store>0</show_in_store>
|
| 36 |
+
</api_key>
|
| 37 |
+
</fields>
|
| 38 |
+
</api_access>
|
| 39 |
+
<bubbl_layout translate="label">
|
| 40 |
+
<label>Bubbl Button</label>
|
| 41 |
+
<sort_order>2</sort_order>
|
| 42 |
+
<show_in_default>1</show_in_default>
|
| 43 |
+
<show_in_website>0</show_in_website>
|
| 44 |
+
<show_in_store>0</show_in_store>
|
| 45 |
+
<expanded>1</expanded>
|
| 46 |
+
<fields>
|
| 47 |
+
<bubblenabled translate="label comment">
|
| 48 |
+
<label>Bubbl Button Enabled In Details</label>
|
| 49 |
+
<comment><![CDATA[Enable the button visualization in the product view page.]]></comment>
|
| 50 |
+
<frontend_type>select</frontend_type>
|
| 51 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 52 |
+
<sort_order>2</sort_order>
|
| 53 |
+
<show_in_default>1</show_in_default>
|
| 54 |
+
<show_in_website>0</show_in_website>
|
| 55 |
+
<show_in_store>0</show_in_store>
|
| 56 |
+
</bubblenabled>
|
| 57 |
+
<bubbllayout translate="label comment">
|
| 58 |
+
<label>Bubbl Button Layout</label>
|
| 59 |
+
<comment><![CDATA[Choose the layout for your taste - extended or compact.]]></comment>
|
| 60 |
+
<frontend_type>select</frontend_type>
|
| 61 |
+
<source_model>bubbleyes_bubblitplugin/config_source_bubbllayout</source_model>
|
| 62 |
+
<sort_order>3</sort_order>
|
| 63 |
+
<show_in_default>1</show_in_default>
|
| 64 |
+
<show_in_website>0</show_in_website>
|
| 65 |
+
<show_in_store>0</show_in_store>
|
| 66 |
+
</bubbllayout>
|
| 67 |
+
</fields>
|
| 68 |
+
</bubbl_layout>
|
| 69 |
+
<help translate="label">
|
| 70 |
+
<label>Help</label>
|
| 71 |
+
<sort_order>3</sort_order>
|
| 72 |
+
<show_in_default>1</show_in_default>
|
| 73 |
+
<show_in_website>0</show_in_website>
|
| 74 |
+
<show_in_store>0</show_in_store>
|
| 75 |
+
<expanded>1</expanded>
|
| 76 |
+
<fields>
|
| 77 |
+
<helpinfo translate="label comment">
|
| 78 |
+
<label>Configuration Info</label>
|
| 79 |
+
<comment>
|
| 80 |
+
<model>bubbleyes_bubblitplugin/config_source_helpinfo_comment</model>
|
| 81 |
+
</comment>
|
| 82 |
+
<frontend_type>note</frontend_type>
|
| 83 |
+
<sort_order>1</sort_order>
|
| 84 |
+
<show_in_default>1</show_in_default>
|
| 85 |
+
<show_in_website>0</show_in_website>
|
| 86 |
+
<show_in_store>0</show_in_store>
|
| 87 |
+
</helpinfo>
|
| 88 |
+
</fields>
|
| 89 |
+
</help>
|
| 90 |
+
</groups>
|
| 91 |
+
|
| 92 |
+
</BubbleyesBubblitPluginOptions>
|
| 93 |
+
</sections>
|
| 94 |
+
</config>
|
app/design/frontend/Bubbleyes/default/etc/theme.xml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
| 2 |
+
<theme>
|
| 3 |
+
<parent>rwd/default</parent>
|
| 4 |
+
</theme>
|
app/design/frontend/Bubbleyes/default/layout/local.xml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8" ?>
|
| 2 |
+
<layout>
|
| 3 |
+
|
| 4 |
+
<catalog_product_view>
|
| 5 |
+
|
| 6 |
+
<block name="product.info.sharing">
|
| 7 |
+
<action method="append"><name>BubblitPlugin.button</name></action>
|
| 8 |
+
</block>
|
| 9 |
+
|
| 10 |
+
<reference name="content">
|
| 11 |
+
<action method="unsetChild"><name>BubblitPlugin.button</name></action>
|
| 12 |
+
</reference>
|
| 13 |
+
|
| 14 |
+
</catalog_product_view>
|
| 15 |
+
|
| 16 |
+
</layout>
|
app/design/frontend/Bubbleyes/default/template/catalog/product/view/sharing.phtml
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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@magentocommerce.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.magentocommerce.com for more information.
|
| 20 |
+
*
|
| 21 |
+
* @category design
|
| 22 |
+
* @package rwd_default
|
| 23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
| 24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
?>
|
| 27 |
+
|
| 28 |
+
<?php $_product = $this->getProduct(); ?>
|
| 29 |
+
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>
|
| 30 |
+
|
| 31 |
+
<ul class="sharing-links">
|
| 32 |
+
<?php if ($this->canEmailToFriend()): ?>
|
| 33 |
+
<li><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>" class="link-email-friend" title="<?php echo $this->__('Email to a Friend') ?>"><?php echo $this->__('Email to a Friend') ?></a></li>
|
| 34 |
+
<?php endif; ?>
|
| 35 |
+
|
| 36 |
+
<?php $_helper = $this->helper('catalog/output'); ?>
|
| 37 |
+
<?php $_productName = urlencode(trim($_helper->productAttribute($_product, $_product->getName(), 'name')))?>
|
| 38 |
+
<?php $_productImageUrl = urlencode(trim($this->helper('catalog/image')->init($_product, 'image')))?>
|
| 39 |
+
<?php $_productUrl = urlencode(trim($_product->getProductUrl()))?>
|
| 40 |
+
<li>
|
| 41 |
+
<?php $_u = 'p[url]=' . $_productUrl . '&p[images][0]=' . $_productImageUrl . '&p[title]=' . $_productName . '&p[summary]=' . urlencode(trim($_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description'))); ?>
|
| 42 |
+
<a href="<?php echo 'http://www.facebook.com/sharer.php?s=100&' . $_u; ?>" target="_blank" title="<?php echo $this->__('Share on Facebook') ?>" class="link-facebook">
|
| 43 |
+
<?php echo $this->__('Share Facebook') ?>
|
| 44 |
+
</a>
|
| 45 |
+
</li>
|
| 46 |
+
<li>
|
| 47 |
+
<a href="<?php echo 'http://twitter.com/home?status=' . $_productName . '+' . $_productUrl; ?>" target="_blank" title="<?php echo $this->__('Share on Twitter') ?>" class="link-twitter"><?php echo $this->__('Share on Twitter') ?></a>
|
| 48 |
+
</li>
|
| 49 |
+
</ul>
|
| 50 |
+
|
| 51 |
+
<?php echo $this->getChildHtml('', true, true) ?>
|
| 52 |
+
|
app/design/frontend/base/default/layout/Bubbleyes_BubblitPlugin.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<layout>
|
| 2 |
+
<catalog_product_view>
|
| 3 |
+
<reference name="content">
|
| 4 |
+
<block type="BubblitPlugin/button"
|
| 5 |
+
name="BubblitPlugin.button"
|
| 6 |
+
template="BubblitPlugin/button.phtml" />
|
| 7 |
+
</reference>
|
| 8 |
+
</catalog_product_view>
|
| 9 |
+
</layout>
|
app/design/frontend/base/default/template/BubblitPlugin/button.phtml
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
<?php echo $this->getProductScript() ?>
|
app/etc/modules/Bubbleyes_BubblitPlugin.xml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Bubbleyes_BubblitPlugin>
|
| 5 |
+
|
| 6 |
+
<!-- Whether our module is active: true or false -->
|
| 7 |
+
<active>true</active>
|
| 8 |
+
|
| 9 |
+
<!-- Which code pool to use: core, community or local -->
|
| 10 |
+
<codePool>community</codePool>
|
| 11 |
+
|
| 12 |
+
</Bubbleyes_BubblitPlugin>
|
| 13 |
+
</modules>
|
| 14 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>Bubbleyes_BubblitPlugin</name>
|
| 4 |
+
<version>1.0.0</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="http://opensource.org/licenses/bsd-license.php">BSDL</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Connect customers and web stores
|
| 10 |
+
in a unique and dynamic way: Bubbl!</summary>
|
| 11 |
+
<description>It's simple. End-consumers from all over the world surf the Internet, finding products which interest them- but the prices are slightly higher than they are willing to pay. With a simple click, these products are stored in a single convenient collection.</description>
|
| 12 |
+
<notes>- First release
|
| 13 |
+
- Supporting configuration of the module in the settings administration
|
| 14 |
+
- Supporting visualization of the BubblitPlugin in the product details page</notes>
|
| 15 |
+
<authors><author><name>Terje Lindstad</name><user>tlindstad</user><email>terjelindstad@bubbleyes.com</email></author></authors>
|
| 16 |
+
<date>2014-11-04</date>
|
| 17 |
+
<time>17:53:07</time>
|
| 18 |
+
<contents><target name="magecommunity"><dir><dir name="Bubbleyes"><dir name="BubblitPlugin"><dir name="Block"><file name="Button.php" hash="d67f8f5d61b489598765d35de3afd8ee"/></dir><dir name="Helper"><file name="Data.php" hash="659200e78571aadb5abca0b573953100"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Bubbllayout.php" hash="ea03544f51545df9803dc3fb0d69ce30"/><dir name="Helpinfo"><file name="Comment.php" hash="eaa644af07bf619a06805184e1daffbd"/></dir></dir></dir><file name="Observer.php" hash="93ab085ee6bfee42c019c07bbef2b19b"/></dir><dir name="etc"><file name="config.xml" hash="042fd5e76f03266d2f22e4e7025d06b1"/><file name="system.xml" hash="3b8dde9a695682f52559ee57df8258c2"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Bubbleyes_BubblitPlugin.xml" hash="0691ad097f8ca937d80ad4936607fea5"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="Bubbleyes_BubblitPlugin.xml" hash="2b172171473b55f2c4596f1eacee7e63"/></dir><dir name="template"><dir name="BubblitPlugin"><file name="button.phtml" hash="18199c13f81a042985363824986156c0"/></dir></dir></dir></dir><dir name="Bubbleyes"><dir name="default"><dir name="etc"><file name="theme.xml" hash="5c4fce4eb634014e556a22cec2a76d20"/></dir><dir name="layout"><file name="local.xml" hash="01c78642851f6e17d1057882f893d3c1"/></dir><dir name="template"><dir name="catalog"><dir name="product"><dir name="view"><file name="sharing.phtml" hash="5be2544566332d003f3bb16579a96498"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
| 19 |
+
<compatible/>
|
| 20 |
+
<dependencies><required><php><min>4.5.0</min><max>10.0.0</max></php></required></dependencies>
|
| 21 |
+
</package>
|
