Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dublado/6210691 to your computer and use it in GitHub Desktop.
Save dublado/6210691 to your computer and use it in GitHub Desktop.
When upgrading Magento to 1.13.0.0 the TBT_Rewards caused me some issues since I was upgrading from an older version of the module. Latest version of the module that this patch is valid against http://www.sweettoothrewards.com/downloads/magento/tbtrewards-latest.tar.gz In version 1.1.1 of the module a "rules_hash" column is added to the "catalog…
diff -rupN TBT3/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php TBT2/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php
--- TBT3/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php 2013-04-16 19:20:50.000000000 +0100
+++ TBT2/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php 2013-06-03 13:30:13.783568896 +0100
@@ -97,11 +97,13 @@ class TBT_Rewards_Model_Observer_Catalog
$product = $event->getProduct();
}
- if ( $product ) {
+ if ( is_numeric($product) ) {
+ $target_product_id = $product;
+ } elseif( $product ) {
$target_product_id = $product->getEntityId();
if ( ! $target_product_id ) $target_product_id = null;
- }
+ }
if ( $target_product_id ) {
// IF a product ID was fetched, set it into the registry
@@ -337,4 +339,4 @@ class TBT_Rewards_Model_Observer_Catalog
return Mage::getSingleton ( 'rewards/catalogrule_validator' );
}
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment