Commit 3449719d authored by anthonylindsay's avatar anthonylindsay

Fixed merge conflict.

parents 63807ea9 c9633171
......@@ -21,7 +21,20 @@ module name.
Installation:
Install Views
Install Commerce
Install Commerce (& commerce modules).
Commerce Popular Modules depends on the following Commerce modules:
commerce_ui
commerce_cart
commerce_checkout
commerce_customer
commerce_line_item
commerce_order
commerce_payment
commerce_price
commerce_product
commerce_product_reference
commerce_product_pricing
Install Commerce Popular Products
Place the block wherever you want it
Set up your products & product displays.
......
......@@ -5,3 +5,14 @@ core = "7.x"
package = Commerce (Contrib)
dependencies[] = commerce
dependencies[] = views
dependencies[] = commerce_ui
dependencies[] = commerce_cart
dependencies[] = commerce_checkout
dependencies[] = commerce_customer
dependencies[] = commerce_line_item
dependencies[] = commerce_order
dependencies[] = commerce_payment
dependencies[] = commerce_price
dependencies[] = commerce_product
dependencies[] = commerce_product_reference
dependencies[] = commerce_product_pricing
......@@ -199,12 +199,20 @@ function commerce_popular_products_settings_form($form, &$form_state) {
'#description' => t('The title of the "popular products" block as shown to users.'),
'#default_value' => $title,
);
$form['product_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Product Types.'),
'#description' => t('Product nodes to include in the popularity check.'),
'#default_value' => $products,
);
if (isset($products)) {
$form['product_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Product Types.'),
'#description' => t('Product nodes to include in the popularity check.'),
'#default_value' => $products,
);
}
else {
$form['product_types'] = array(
'#title' => t('Product Types.'),
'#markup' => t('<h4>Product types</h4><p>You have not defined any product types. You need to define some first.</p>'),
);
}
$product_types = commerce_popular_products_get_product_types();
$options = array();
foreach ($product_types as $type) {
......@@ -260,6 +268,7 @@ function commerce_popular_products_settings_form_submit($form, &$form_state) {
* A simple query to return all the Commerce product types in the database.
*/
function commerce_popular_products_get_product_types() {
$names = array();
$products = commerce_product_types();
foreach ($products as $item) {
$names[] = $item['name'];
......
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