Commit 7dbf9fcb authored by anthonylindsay's avatar anthonylindsay

Fixed bug where products cache is not updated on settings save since the move...

Fixed bug where products cache is not updated on settings save since the move to using the settingsform api
parent e1fee126
......@@ -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,10 +259,19 @@ 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.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment