diff --git a/DEVELOPER-README.md b/DEVELOPER-README.md
index 4f5a855..9d20117 100644
--- a/DEVELOPER-README.md
+++ b/DEVELOPER-README.md
@@ -21,7 +21,6 @@ This project uses semantic versioning. When updating the extension, bump the
version in the following locations:
1. extension/app/code/community/Affirm/Affirm/etc/config.xml
-1. extension/app/code/community/Affirm/AffirmPromo/etc/config.xml
1. build/affirm_tar_to_connect_config.php
To avoid drift, validate by executing `make validate_version`
diff --git a/Makefile b/Makefile
index ba8fcbe..e5f9fc5 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ dependencies:
package: validate_version
mkdir -p ./var/
- cd ./extension && tar -cvf ../var/Affirm_Affirm-3.4.0.tgz *
+ cd ./extension && tar -cvf ../var/Affirm_Affirm-3.5.0.tgz *
cd ./build && ./magento-tar-to-connect.phar affirm_tar_to_connect_config.php
clean:
diff --git a/build/affirm_tar_to_connect_config.php b/build/affirm_tar_to_connect_config.php
index f5436ed..1b2a5a5 100644
--- a/build/affirm_tar_to_connect_config.php
+++ b/build/affirm_tar_to_connect_config.php
@@ -1,11 +1,11 @@
realpath('../var/'),
-'archive_files' => 'Affirm_Affirm-3.4.1.tgz',
+'archive_files' => 'Affirm_Affirm-3.5.0.tgz',
'extension_name' => 'Affirm_Magento',
'skip_version_compare' => true,
-'extension_version' => '3.4.1',
-'archive_connect' => 'Affirm_Affirm-3.4.1.tgz',
+'extension_version' => '3.5.0',
+'archive_connect' => 'Affirm_Affirm-3.5.0.tgz',
'path_output' => realpath('../var/'),
'stability' => 'stable',
diff --git a/extension/app/code/community/Affirm/Affirm/Block/Product/List.php b/extension/app/code/community/Affirm/Affirm/Block/Product/List.php
index c3bdfac..5fdbf9f 100644
--- a/extension/app/code/community/Affirm/Affirm/Block/Product/List.php
+++ b/extension/app/code/community/Affirm/Affirm/Block/Product/List.php
@@ -43,6 +43,11 @@ public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix =
$mpp = $this->_getMinMPP();
$price = $product->getFinalPrice();
+ if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
+ $price = Mage::getModel('bundle/product_price')->getTotalPrices($product,'min',1);
+ } else if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED) {
+ $price = $product->getMinimalPrice();
+ }
if ($price > $mpp) {
$categoryIds = $product->getCategoryIds();
diff --git a/extension/app/code/community/Affirm/Affirm/Block/Promo/AsLowAs/Product.php b/extension/app/code/community/Affirm/Affirm/Block/Promo/AsLowAs/Product.php
index 1d8e007..0c5f90c 100644
--- a/extension/app/code/community/Affirm/Affirm/Block/Promo/AsLowAs/Product.php
+++ b/extension/app/code/community/Affirm/Affirm/Block/Promo/AsLowAs/Product.php
@@ -34,11 +34,10 @@ protected function _toHtml()
$mpp = $this->helper('affirm/promo_asLowAs')->getMinMPP();
if (!empty($mpp)) {
- if ($this->getProduct()->getFinalPrice() < $mpp) {
+ if ($this->getFinalPrice() < $mpp) {
return "";
}
}
-
return parent::_toHtml();
}
@@ -52,6 +51,16 @@ public function getProduct()
return $this->helper('catalog')->getProduct();
}
+ /**
+ * Get product id on PDP
+ *
+ * @return Mage_Catalog_Model_Product|null
+ */
+ public function getProductId()
+ {
+ return $this->helper('catalog')->getProduct()->getId();
+ }
+
/**
* Get final price
*
@@ -59,8 +68,50 @@ public function getProduct()
*/
public function getFinalPrice()
{
- $price = $this->getProduct()->getFinalPrice();
- return $this->helper('affirm/util')->formatCents($price);
+ $product = $this->getProduct();
+ if($product->getFinalPrice()) {
+ return $this->helper('affirm/util')->formatCents($product->getFinalPrice());
+ } else if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED) {
+ $grouped_product_model = Mage::getModel('catalog/product_type_grouped');
+ $groupedParentId = $grouped_product_model->getParentIdsByChild($product->getId());
+ $_associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
+
+ foreach($_associatedProducts as $_associatedProduct) {
+ if($price = $_associatedProduct->getPrice()) {
+ $price = $_associatedProduct->getPrice();
+ }
+ }
+
+ $price = number_format((float)$price, 2, '.', '');
+ return $this->helper('affirm/util')->formatCents($price);
+ } else if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
+ $optionCol= $product->getTypeInstance(true)
+ ->getOptionsCollection($product);
+ $selectionCol= $product->getTypeInstance(true)
+ ->getSelectionsCollection(
+ $product->getTypeInstance(true)->getOptionsIds($product),
+ $product
+ );
+ $optionCol->appendSelections($selectionCol);
+ $price = $product->getPrice();
+
+ foreach ($optionCol as $option) {
+ if($option->required) {
+ $selections = $option->getSelections();
+ $minPrice = min(array_map(function ($s) {
+ return $s->price;
+ }, $selections));
+ if($product->getSpecialPrice() > 0) {
+ $minPrice *= $product->getSpecialPrice()/100;
+ }
+
+ $price += round($minPrice,2);
+ }
+ }
+ return $this->helper('affirm/util')->formatCents($price);
+ } else {
+ return "";
+ }
}
/**
diff --git a/extension/app/code/community/Affirm/Affirm/Block/Promo/Promo.php b/extension/app/code/community/Affirm/Affirm/Block/Promo/Promo.php
index 344fe84..ff7ea26 100644
--- a/extension/app/code/community/Affirm/Affirm/Block/Promo/Promo.php
+++ b/extension/app/code/community/Affirm/Affirm/Block/Promo/Promo.php
@@ -34,28 +34,139 @@ protected function _construct()
}
/**
- * Get snippet code
+ * Get product on PDP
+ *
+ * @return Mage_Catalog_Model_Product|null
+ */
+ public function getProduct()
+ {
+ return $this->helper('catalog')->getProduct();
+ }
+
+ /**
+ * Get MFP value
+ *
+ * @return string
+ */
+ public function getMFPValue()
+ {
+ $currentController = Mage::app()->getFrontController()->getRequest()->getControllerName();
+ $mfpHelper = Mage::helper('affirm/mfp');
+ switch($currentController) {
+ case 'product':
+ return $this->getProductMFPValue();
+ break;
+ case 'category':
+ $categoryId = Mage::registry('current_category')->getId();
+ $categoryIds = array();
+ $categoryIds[] = $categoryId;
+ return $this->helper('affirm/promo_asLowAs')->getAffirmMFPValue(array(), $categoryIds);
+ break;
+ case 'cart':
+ return $this->getCheckoutMFPValue();
+ break;
+ default:
+ if ($mfpHelper->isMFPValidCurrentDateALS()) {
+ return $mfpHelper->getPromoIdDateRange();
+ } else {
+ return $mfpHelper->getPromoIdDefault();
+ }
+ break;
+ }
+ }
+
+ /**
+ * Get Product MFP value
*
* @return string
*/
+ public function getProductMFPValue()
+ {
+ $product = $this->getProduct();
+
+ $categoryIds = $product->getCategoryIds();
+
+ $start_date = $product->getAffirmProductMfpStartDate();
+ $end_date = $product->getAffirmProductMfpEndDate();
+ if(empty($start_date) || empty($end_date)) {
+ $mfpValue = $product->getAffirmProductPromoId();
+ } else {
+ if(Mage::app()->getLocale()->isStoreDateInInterval(null, $start_date, $end_date)) {
+ $mfpValue = $product->getAffirmProductPromoId();
+ } else {
+ $mfpValue = "";
+ }
+ }
+
+ $productItemMFP = array(
+ 'value' => $mfpValue,
+ 'type' => $product->getAffirmProductMfpType(),
+ 'priority' => $product->getAffirmProductMfpPriority() ?
+ $product->getAffirmProductMfpPriority() : 0
+ );
+
+ return $this->helper('affirm/promo_asLowAs')->getAffirmMFPValue(array($productItemMFP), $categoryIds);
+ }
+
/**
- * Get html code for promo snippet
+ * Get Cart MFP value
*
* @return string
*/
- public function getSnippetCode()
+ public function getCheckoutMFPValue()
{
- if (!$this->_helper->isPromoActive() || !$this->_helper->getSectionConfig()->getDisplay()) {
- return '';
+ $cart = Mage::getModel('checkout/cart')->getQuote();
+ $productIds = array();
+ $productItemMFP = array();
+ $categoryItemsIds = array();
+ $categoryIds = array();
+ foreach ($cart->getAllVisibleItems() as $item) {
+ $productIds[] = $item->getProduct()->getId();
}
+ if($productIds) {
+ $products = Mage::getModel('catalog/product')->getCollection()
+ ->addAttributeToSelect(
+ array('affirm_product_promo_id', 'affirm_product_mfp_type', 'affirm_product_mfp_priority')
+ )
+ ->addAttributeToFilter('entity_id', array('in' => $productIds));
+ $productItems = $products->getItems();
+
+ foreach ($cart->getAllVisibleItems() as $item) {
+ $product = $productItems[$item->getProduct()->getId()];
+ if (Mage::helper('affirm')->isPreOrder() && $item->getProduct()->getParentItem() &&
+ ($item->getProduct()->getParentItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE)
+ ) {
+ continue;
+ }
- $sectionConfig = $this->_helper->getSectionConfig();
- $container = $sectionConfig->getContainer();
- $snippet = $this->getChildHtml('affirmpromo_snippet');
+ $start_date = $product->getAffirmProductMfpStartDate();
+ $end_date = $product->getAffirmProductMfpEndDate();
+ if (empty($start_date) || empty($end_date)) {
+ $mfpValue = $product->getAffirmProductPromoId();
+ } else {
+ if (Mage::app()->getLocale()->isStoreDateInInterval(null, $start_date, $end_date)) {
+ $mfpValue = $product->getAffirmProductPromoId();
+ } else {
+ $mfpValue = "";
+ }
+ }
- if (!empty($container)) {
- $snippet = str_replace('{container}', $snippet, $container);
+ $productItemMFP[] = array(
+ 'value' => $mfpValue,
+ 'type' => $product->getAffirmProductMfpType(),
+ 'priority' => $product->getAffirmProductMfpPriority() ?
+ $product->getAffirmProductMfpPriority() : 0
+ );
+
+ $categoryIds = $product->getCategoryIds();
+ if (!empty($categoryIds)) {
+ $categoryItemsIds = array_merge($categoryItemsIds, $categoryIds);
+ }
+ }
+
+ $categoryIds = $product->getCategoryIds();
}
- return $snippet;
+
+ return Mage::helper('affirm/promo_asLowAs')->getAffirmMFPValue($productItemMFP, $categoryIds, $this->helper('checkout/cart')->getQuote()->getGrandTotal());
}
}
diff --git a/extension/app/code/community/Affirm/Affirm/Helper/Data.php b/extension/app/code/community/Affirm/Affirm/Helper/Data.php
index 0825e7a..56422d6 100644
--- a/extension/app/code/community/Affirm/Affirm/Helper/Data.php
+++ b/extension/app/code/community/Affirm/Affirm/Helper/Data.php
@@ -95,6 +95,9 @@ public function getExtensionVersion()
*/
public function isDisableForBackOrderedItems($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getStoreConfigFlag(self::PAYMENT_AFFIRM_DISABLE_BACK_ORDERED_ITEMS, $store);
}
@@ -106,6 +109,9 @@ public function isDisableForBackOrderedItems($store = null)
*/
public function isPlainTextEnabled($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getStoreConfigFlag(self::AFFIRM_PLAIN_TEXT_ENABLED, $store);
}
@@ -143,6 +149,9 @@ public function isDisableModuleFunctionality()
*/
public function getLabelHtmlAfter($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getStoreConfig(self::LABEL_HTML_CUSTOM, $store);
}
@@ -175,6 +184,9 @@ public function getApiUrl()
*/
public function getApiKey($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getSingleton('affirm/credential')->getApiKey($store);
}
@@ -186,20 +198,12 @@ public function getApiKey($store = null)
*/
public function getSecretKey($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getSingleton('affirm/credential')->getSecretKey($store);
}
- /**
- * Get financial product key
- *
- * @param Mage_Core_Model_Store $store
- * @return string
- */
- public function getFinancialProductKey($store = null)
- {
- return Mage::getSingleton('affirm/credential')->getFinancialProductKey($store);
- }
-
/**
* Get detect xhr checkout
*
@@ -208,6 +212,9 @@ public function getFinancialProductKey($store = null)
*/
public function getDetectXHRCheckout($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getStoreConfig(self::PAYMENT_AFFIRM_XHR_CHECKOUT, $store);
}
@@ -219,6 +226,9 @@ public function getDetectXHRCheckout($store = null)
*/
public function getMinOrderThreshold($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getStoreConfig(self::PAYMENT_AFFIRM_MIN_ORDER_TOTAL, $store);
}
@@ -230,6 +240,9 @@ public function getMinOrderThreshold($store = null)
*/
public function getMaxOrderThreshold($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getStoreConfig(self::PAYMENT_AFFIRM_MAX_ORDER_TOTAL, $store);
}
@@ -241,6 +254,9 @@ public function getMaxOrderThreshold($store = null)
*/
public function isPreOrder($store = null)
{
+ if($store == null) {
+ $store = Mage::app()->getStore()->getStoreId();
+ }
return Mage::getStoreConfig(self::PAYMENT_AFFIRM_PRE_ORDER, $store);
}
@@ -328,8 +344,8 @@ public function getAffirmPaymentMethod()
{
$payments = Mage::getSingleton('payment/config')->getActiveMethods();
$method = isset($payments[Affirm_Affirm_Model_Payment::METHOD_CODE])
- ? $payments[Affirm_Affirm_Model_Payment::METHOD_CODE]
- : null;
+ ? $payments[Affirm_Affirm_Model_Payment::METHOD_CODE]
+ : null;
return $method;
}
@@ -453,4 +469,18 @@ public function getConfigurableBackOrderedInfo()
}
return Mage::helper('core')->jsonEncode($result);
}
+
+ /**
+ * Get assets url
+ *
+ * @param Mage_Core_Model_Store $store
+ * @return string
+ */
+ public function getAffirmAssetsUrl()
+ {
+ $prefix = "cdn-assets";
+ $domain = "affirm.com";
+ $assetPath = "images/banners";
+ return 'https://' . $prefix . '.' . $domain . '/' . $assetPath ;
+ }
}
diff --git a/extension/app/code/community/Affirm/Affirm/Model/Credential.php b/extension/app/code/community/Affirm/Affirm/Model/Credential.php
index 8e530bb..c608943 100644
--- a/extension/app/code/community/Affirm/Affirm/Model/Credential.php
+++ b/extension/app/code/community/Affirm/Affirm/Model/Credential.php
@@ -114,15 +114,4 @@ public function getSecretKey($store = null)
{
return $this->_getCredentialModel($store)->getSecretKey($store);
}
-
- /**
- * Get secret key
- *
- * @param Mage_Core_Model_Store $store
- * @return string
- */
- public function getFinancialProductKey($store = null)
- {
- return $this->_getCredentialModel($store)->getFinancialProductKey($store);
- }
}
diff --git a/extension/app/code/community/Affirm/Affirm/Model/Credential/Abstract.php b/extension/app/code/community/Affirm/Affirm/Model/Credential/Abstract.php
index 3742835..c25cc12 100644
--- a/extension/app/code/community/Affirm/Affirm/Model/Credential/Abstract.php
+++ b/extension/app/code/community/Affirm/Affirm/Model/Credential/Abstract.php
@@ -41,11 +41,4 @@ abstract public function getApiKey();
* @return string
*/
abstract public function getSecretKey();
-
- /**
- * Get financial product key
- *
- * @return string
- */
- abstract public function getFinancialProductKey();
}
diff --git a/extension/app/code/community/Affirm/Affirm/Model/Credential/Production.php b/extension/app/code/community/Affirm/Affirm/Model/Credential/Production.php
index f57b7c9..6a8fa38 100644
--- a/extension/app/code/community/Affirm/Affirm/Model/Credential/Production.php
+++ b/extension/app/code/community/Affirm/Affirm/Model/Credential/Production.php
@@ -36,11 +36,6 @@ class Affirm_Affirm_Model_Credential_Production extends Affirm_Affirm_Model_Cred
*/
const PAYMENT_AFFIRM_SECRET_KEY = 'payment/affirm/secret_key_production';
- /**
- * Payment affirm financial product key
- */
- const PAYMENT_AFFIRM_FINANCIAL_PRODUCT_KEY = 'payment/affirm/financial_product_key_production';
-
/**
* Get api url
*
@@ -72,15 +67,4 @@ public function getSecretKey($store = null)
{
return Mage::getStoreConfig(self::PAYMENT_AFFIRM_SECRET_KEY, $store);
}
-
- /**
- * Get secret key
- *
- * @param Mage_Core_Model_Store $store
- * @return string
- */
- public function getFinancialProductKey($store = null)
- {
- return Mage::getStoreConfig(self::PAYMENT_AFFIRM_FINANCIAL_PRODUCT_KEY, $store);
- }
}
diff --git a/extension/app/code/community/Affirm/Affirm/Model/Credential/Sandbox.php b/extension/app/code/community/Affirm/Affirm/Model/Credential/Sandbox.php
index dd32052..b29c4ba 100644
--- a/extension/app/code/community/Affirm/Affirm/Model/Credential/Sandbox.php
+++ b/extension/app/code/community/Affirm/Affirm/Model/Credential/Sandbox.php
@@ -36,11 +36,6 @@ class Affirm_Affirm_Model_Credential_Sandbox extends Affirm_Affirm_Model_Credent
*/
const PAYMENT_AFFIRM_SECRET_KEY = 'payment/affirm/secret_key_sandbox';
- /**
- * Payment affirm financial product key
- */
- const PAYMENT_AFFIRM_FINANCIAL_PRODUCT_KEY = 'payment/affirm/financial_product_key_sandbox';
-
/**
* Get api url
*
@@ -72,15 +67,4 @@ public function getSecretKey($store = null)
{
return Mage::getStoreConfig(self::PAYMENT_AFFIRM_SECRET_KEY, $store);
}
-
- /**
- * Get secret key
- *
- * @param Mage_Core_Model_Store $store
- * @return string
- */
- public function getFinancialProductKey($store = null)
- {
- return Mage::getStoreConfig(self::PAYMENT_AFFIRM_FINANCIAL_PRODUCT_KEY, $store);
- }
}
diff --git a/extension/app/code/community/Affirm/Affirm/Model/Payment.php b/extension/app/code/community/Affirm/Affirm/Model/Payment.php
index e09f0c8..609b9c4 100644
--- a/extension/app/code/community/Affirm/Affirm/Model/Payment.php
+++ b/extension/app/code/community/Affirm/Affirm/Model/Payment.php
@@ -581,12 +581,16 @@ public function getCheckoutObject($order)
if ($shipping) {
$checkout['shipping'] = $shipping;
}
- $checkout['financial_product_key'] = Mage::helper('affirm')->getFinancialProductKey();
$checkout['total'] = Mage::helper('affirm/util')->formatCents(self::_affirmTotal($order));
+ if (method_exists('Mage', 'getEdition')){
+ $platform_edition = Mage::getEdition();
+ }
+ $platform_version = Mage::getVersion();
+ $platform_version_edition = isset($platform_edition) ? $platform_version.' '.$platform_edition : $platform_version;
$checkout['metadata'] = array(
'shipping_type' => $order->getShippingDescription(),
'platform_type' => 'Magento',
- 'platform_version' => Mage::getVersion(),
+ 'platform_version' => $platform_version_edition,
'platform_affirm' => Mage::helper('affirm')->getExtensionVersion()
);
$affirmMFPValue = Mage::helper('affirm/mfp')->getAffirmMFPValue($productItemsMFP, $categoryItemsIds, $order->getBaseGrandTotal());
diff --git a/extension/app/code/community/Affirm/Affirm/Model/Promo/Observer.php b/extension/app/code/community/Affirm/Affirm/Model/Promo/Observer.php
index 06d874d..18c9a47 100644
--- a/extension/app/code/community/Affirm/Affirm/Model/Promo/Observer.php
+++ b/extension/app/code/community/Affirm/Affirm/Model/Promo/Observer.php
@@ -57,9 +57,6 @@ public function layoutGenerateBlocksBefore(Varien_Event_Observer $observer)
'
-
-
');
}
diff --git a/extension/app/code/community/Affirm/Affirm/controllers/PaymentController.php b/extension/app/code/community/Affirm/Affirm/controllers/PaymentController.php
index 1dfd17f..bddc2fb 100644
--- a/extension/app/code/community/Affirm/Affirm/controllers/PaymentController.php
+++ b/extension/app/code/community/Affirm/Affirm/controllers/PaymentController.php
@@ -178,6 +178,6 @@ protected function _processConfWithoutSaveOrder($checkoutToken)
public function setPaymentFlagAndCheckoutAction()
{
Mage::helper('affirm')->getCheckoutSession()->setAffirmPaymentFlag(true);
- $this->_redirect('checkout/onepage');
+ $this->_redirectUrl(Mage::helper('checkout/url')->getCheckoutUrl());
}
}
diff --git a/extension/app/code/community/Affirm/Affirm/etc/config.xml b/extension/app/code/community/Affirm/Affirm/etc/config.xml
index 42f5e8a..31897b3 100644
--- a/extension/app/code/community/Affirm/Affirm/etc/config.xml
+++ b/extension/app/code/community/Affirm/Affirm/etc/config.xml
@@ -2,7 +2,7 @@
- 3.4.1
+ 3.5.0
@@ -190,7 +190,7 @@
1
USD
0.01
- 100000
+ 50000
0
0
1
diff --git a/extension/app/code/community/Affirm/Affirm/etc/system.xml b/extension/app/code/community/Affirm/Affirm/etc/system.xml
index 56a4ab5..8d7dc79 100644
--- a/extension/app/code/community/Affirm/Affirm/etc/system.xml
+++ b/extension/app/code/community/Affirm/Affirm/etc/system.xml
@@ -65,17 +65,6 @@
sandbox
-
-
- text
- 25
- 1
- 1
- 0
-
- sandbox
-
-
text
@@ -99,17 +88,6 @@
production
-
-
- text
- 25
- 1
- 1
- 0
-
- production
-
-
select
diff --git a/extension/app/design/frontend/base/default/template/affirm/promo/aslowas/product.phtml b/extension/app/design/frontend/base/default/template/affirm/promo/aslowas/product.phtml
index 051247f..0576861 100644
--- a/extension/app/design/frontend/base/default/template/affirm/promo/aslowas/product.phtml
+++ b/extension/app/design/frontend/base/default/template/affirm/promo/aslowas/product.phtml
@@ -1,8 +1,9 @@
getMFPValue();
+ $productId = $this->getProductId();
?>
- getFinalPrice() .'">
'; ?>
+ getFinalPrice() .'">'; ?>
-
+
\ No newline at end of file
diff --git a/extension/app/design/frontend/base/default/template/affirm/promo/promo.phtml b/extension/app/design/frontend/base/default/template/affirm/promo/promo.phtml
index a881bde..e2437d0 100644
--- a/extension/app/design/frontend/base/default/template/affirm/promo/promo.phtml
+++ b/extension/app/design/frontend/base/default/template/affirm/promo/promo.phtml
@@ -1,4 +1,45 @@
-getSnippetCode(); ?>
+
+helper('affirm/promo_data')->getSectionConfig()->getSize();
+ list($width, $height) = explode('x',$size);
+ $apiKey = $this->helper('affirm')->getApiKey();
+ $affirmJsUrl = $this->helper('affirm')->getAffirmJsUrl();
+ $mfpValue = $this->getMFPValue();
+ $affirmAssetsUrl = $this->helper('affirm')->getAffirmAssetsUrl();
+?>
+
+
+
+
+ ';
+?>
+
\ No newline at end of file
diff --git a/extension/app/design/frontend/base/default/template/affirm/promo/snippet.phtml b/extension/app/design/frontend/base/default/template/affirm/promo/snippet.phtml
deleted file mode 100644
index 3f11f34..0000000
--- a/extension/app/design/frontend/base/default/template/affirm/promo/snippet.phtml
+++ /dev/null
@@ -1,22 +0,0 @@
-helper('affirm/promo_data')->getSectionConfig()->getSize();
- $promoKey = $this->helper('affirm/promo_data')->getPromoKey();
- $apiKey = $this->helper('affirm')->getApiKey();
- $affirmJsUrl = $this->helper('affirm')->getAffirmJsUrl();
-?>
-
-
diff --git a/modman b/modman
index da09885..8611040 100644
--- a/modman
+++ b/modman
@@ -1,6 +1,8 @@
-extension/app/code/community/Affirm/Affirm app/code/community/Affirm/Affirm
-extension/app/etc/modules/Affirm_Affirm.xml app/etc/modules/Affirm_Affirm.xml
-
-extension/app/code/community/Affirm/AffirmPromo app/code/community/Affirm/AffirmPromo
-extension/app/design/frontend/base/default/template/affirmpromo app/design/frontend/base/default/template/affirmpromo
-extension/app/etc/modules/Affirm_AffirmPromo.xml app/etc/modules/Affirm_AffirmPromo.xml
+extension/app/code/community/Affirm/Affirm app/code/community/Affirm/Affirm
+extension/app/design/adminhtml/default/default/layout/affirm app/design/adminhtml/default/default/layout/affirm
+extension/app/design/adminhtml/default/default/template/affirm app/design/adminhtml/default/default/template/affirm
+extension/app/design/frontend/base/default/layout/affirm app/design/frontend/base/default/layout/affirm
+extension/app/design/frontend/base/default/template/affirm app/design/frontend/base/default/template/affirm
+extension/app/etc/modules/Affirm_Affirm.xml app/etc/modules/Affirm_Affirm.xml
+extension/skin/adminhtml/default/default/js/affirm skin/adminhtml/default/default/js/affirm
+extension/skin/frontend/base/default/js/affirm skin/frontend/base/default/js/affirm
\ No newline at end of file
diff --git a/util/validate-version.py b/util/validate-version.py
index 00b80a3..2336b4a 100644
--- a/util/validate-version.py
+++ b/util/validate-version.py
@@ -17,14 +17,6 @@ def version(namespace, module):
config = tree.getroot()
return config.find("modules").find(x).find("version").text
-if version("Affirm", "Affirm") != version("Affirm", "AffirmPromo"):
- print ""
- print "ERROR: version mismatch"
- print "Affirm_Affirm {0}".format(version("Affirm", "Affirm"))
- print "Affirm_AffirmPromo {0}".format(version("Affirm", "AffirmPromo"))
- print ""
- exit(1)
-
if version("Affirm", "Affirm") != version_in_tarball_config("build/affirm_tar_to_connect_config.php"):
print ""
print "ERROR: version mismatch"