summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commerce_popular_products.module10
1 files changed, 10 insertions, 0 deletions
diff --git a/commerce_popular_products.module b/commerce_popular_products.module
index dadf957..84b9a79 100644
--- a/commerce_popular_products.module
+++ b/commerce_popular_products.module
@@ -123,6 +123,7 @@ function commerce_popular_products_block_info() {
$blocks['popular-product-block'] = array(
'info' => t('Commerce Popular Products display block'),
'weight' => '-50',
+ 'cache' => DRUPAL_NO_CACHE,
);
return $blocks;
}
@@ -258,11 +259,20 @@ function commerce_popular_products_settings_form($form, &$form_state) {
),
'#default_value' => $number,
);
+ $form['#submit'][] = 'commerce_popular_products_settings_form_submit';
return system_settings_form($form);
}
/**
+ * Custom submit handler for settings form.
+ */
+function commerce_popular_products_settings_form_submit($form, &$form_state) {
+ // Update our cache of popular products.
+ commerce_popular_products_get_product();
+}
+
+/**
* A simple query to return all the Commerce product types in the database.
*/
function commerce_popular_products_get_product_types() {