Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
16 .vagrant/bin/mageinstall.sh
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
# /usr/local/bin/mageinstall
#
@@ -15,6 +15,13 @@ echo "Usage: `basename $0` magentoversion --with-sample-data"
rm versionlist.txt
exit ${ebadargs}
fi
+
+if [ -d /usr/local/src/magento/tmp ];
+then
+echo [-] tmp directory exists
+else
+mkdir /usr/local/src/magento/tmp
+fi
cd /usr/local/src/magento/tmp;
if [ -f ${1}.tgz ];
@@ -53,12 +60,6 @@ dbroot="vagrant"
dbhost="localhost"
dbname=${1}
dbuser=${1}
-
-if [[ "$dbuser" == magento-enterprise* ]]
-then
- dbuser=`echo me${dbuser//magento\-enterprise/}`
-fi
-
dbpass="vagrant1"
url="http://localhost:8080/${entity}"
version=${1}
@@ -126,6 +127,7 @@ $mysql -uroot -p${dbroot} -e "${sql}"
if [ ${sampleData} = "true" ]
then
echo [+] extracting Sample-Data
+sudo wget --output-document ${versionspath}/magento-sample-data-1.2.0.tar.gz http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz
sudo tar -zxf ${versionspath}/magento-sample-data-1.2.0.tar.gz -C /var/www/${version}/
sudo mv /var/www/${version}/magento-sample-data-1.2.0/media/* /var/www/${version}/media/
View
50 src/app/code/community/Flagbit/FactFinder/Block/Campaign/Product/Advisory.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Flagbit_FactFinder
+ *
+ * @category Mage
+ * @package Flagbit_FactFinder
+ * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
+ */
+
+/**
+ * Provides advisory hints to the product view page
+ *
+ * @category Mage
+ * @package Flagbit_FactFinder
+ * @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
+ * @author Mike Becker <mike.becker@flagbit.de>
+ * @version $Id$
+ */
+class Flagbit_FactFinder_Block_Campaign_Product_Advisory extends Mage_Core_Block_Template
+{
+ /**
+ * get Campaign Text
+ *
+ * @return string
+ */
+ public function getActiveQuestions()
+ {
+ $questions = array();
+
+ $productCampaignAdapter = Mage::getModel('factfinder/adapter')->getProductCampaignAdapter();
+ // set current productid
+ $productCampaignAdapter->setProductIds(array(Mage::registry('current_product')->getId()));
+ $productCampaignAdapter->makeProductCampaign();
+
+ if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
+ $_campaigns = Mage::getSingleton('factfinder/adapter')->getProductCampaigns();
+ $_campaigns = $productCampaignAdapter->getCampaigns();
+ Zend_Debug::dump(array(
+ 'class' => __CLASS__,
+ 'method' => __FUNCTION__,
+ 'campaigns' => $_campaigns
+ ));
+ if($_campaigns && $_campaigns->hasActiveQuestions()){
+ $questions = $_campaigns->getActiveQuestions();
+ }
+ }
+
+ return $questions;
+ }
+}
View
25 src/app/code/community/Flagbit/FactFinder/Model/Adapter.php
@@ -63,10 +63,15 @@ class Flagbit_FactFinder_Model_Adapter
* FACT-Finder Recommendation Adapter
* @var FACTFinder_Abstract_RecommendationAdapter
*/
-
protected $_recommendationAdapter = null;
/**
+ * FACT-Finder Product Campaign Adapter
+ * @var FACTFinder_Abstract_ProductCampaignAdapter
+ */
+ protected $_productCampaignAdapter = null;
+
+ /**
* FACT-Finder TagCloudadapter
* @var FACTFinder_Abstract_TagCloudAdapter
*/
@@ -413,6 +418,24 @@ public function getRecommendationAdapter()
}
return $this->_recommendationAdapter;
}
+
+ /**
+ * get Product Campaign Adapter
+ *
+ * @return FACTFinder_Abstract_ProductCampaignAdapter
+ */
+ public function getProductCampaignAdapter()
+ {
+ if ($this->_productCampaignAdapter == null) {
+ $config = $this->_getConfiguration();
+ $encodingHandler = FF::getSingleton('encodingHandler', $config);
+ $params = $this->_getParamsParser()->getServerRequestParams();
+ $dataProvider = $this->_getDataProvider();
+ $dataProvider->setParam('idsOnly', 'true');
+ $this->_productCampaignAdapter = FF::getSingleton('xml67/productCampaignAdapter', $dataProvider, $this->_getParamsParser(), $encodingHandler);
+ }
+ return $this->_productCampaignAdapter;
+ }
/**
* get Search Result Count
View
5 src/app/code/community/Flagbit/FactFinder/Model/Observer.php
@@ -221,6 +221,11 @@ public function addActivationLayoutHandles($observer)
$update = $layout->getUpdate();
$update->addHandle('factfinder_suggest_enabled');
}
+ if (Mage::helper('factfinder/search')->getIsEnabled(false, 'advisory')) {
+ $layout = $observer->getLayout();
+ $update = $layout->getUpdate();
+ $update->addHandle('factfinder_advisory_enabled');
+ }
$request = Mage::app()->getRequest();
//catalogsearch_result_index
if (Mage::helper('factfinder/search')->getIsEnabled(false, 'clicktracking')
View
6 src/app/design/frontend/base/default/layout/factfinder.xml
@@ -42,6 +42,12 @@
</reference>
</catalogsearch_result_index>
+ <catalog_product_view>
+ <reference name="content">
+ <block type="factfinder/campaign_product_advisory" before="product.info" template="factfinder/campaign/product/advisory.phtml" />
+ </reference>
+ </catalog_product_view>
+
<factfinder_clicktracking_enabled>
<reference name="head">
<action method="addJs"><script>factfinder/scic.js</script></action>
View
11 src/app/design/frontend/base/default/template/factfinder/campaign/product/advisory.phtml
@@ -0,0 +1,11 @@
+<?php if ($questions = $this->getActiveQuestions()): ?>
+ <dl class="factfinder-advisory">
+ <?php foreach ($questions as $question): ?>
+ <dt class="factfinder-advisory-question"><?php echo $question->getText() ?></dt>
+ <?php foreach ($question->getAnswers() as $answer): ?>
+ <dd class="factfinder-advisory-answer"><a href="<?php echo $answer->getParams() ?>"><?php echo $answer->getText() ?></a></dd>
+ <?php endforeach; ?>
+
+ <?php endforeach; ?>
+ </dl>
+<?php endif; ?>

No commit comments for this range

Something went wrong with that request. Please try again.