From 4e1fc6084205dc0c0a0e70efe7f96523ceeb1e37 Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Fri, 10 Oct 2014 16:41:01 -0400
Subject: [PATCH] Extend per column cart support to stack-left and stack-right.

Conflicts:
	themes/bootstrap3/templates/combined/stack-left.phtml
	themes/bootstrap3/templates/combined/stack-right.phtml
---
 themes/bootstrap3/templates/combined/results.phtml           | 2 +-
 themes/bootstrap3/templates/combined/stack-distributed.phtml | 2 +-
 themes/bootstrap3/templates/combined/stack-left.phtml        | 4 ++--
 themes/bootstrap3/templates/combined/stack-right.phtml       | 4 ++--
 themes/bootstrap3/templates/search/results.phtml             | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/themes/bootstrap3/templates/combined/results.phtml b/themes/bootstrap3/templates/combined/results.phtml
index 68f85321dfe..484a045ace9 100644
--- a/themes/bootstrap3/templates/combined/results.phtml
+++ b/themes/bootstrap3/templates/combined/results.phtml
@@ -34,7 +34,7 @@
       $this->escapeHtml($lookfor) . '</li>';
   }
 
-  // Disable cart if appropriate:
+  // Enable cart if appropriate:
   $this->showCartControls = $this->supportsCart && $this->cart()->isActive();
 
   // Load Javascript dependencies into header:
diff --git a/themes/bootstrap3/templates/combined/stack-distributed.phtml b/themes/bootstrap3/templates/combined/stack-distributed.phtml
index d0634162e16..91cb37ec0dd 100644
--- a/themes/bootstrap3/templates/combined/stack-distributed.phtml
+++ b/themes/bootstrap3/templates/combined/stack-distributed.phtml
@@ -16,7 +16,7 @@
         <? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { $columnIndex += $columns; continue; } ?>
           <?
             $viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
-            // Disable cart if appropriate:
+            // Enable cart if appropriate:
             $viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
           ?>
           <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
diff --git a/themes/bootstrap3/templates/combined/stack-left.phtml b/themes/bootstrap3/templates/combined/stack-left.phtml
index 803cd3fc9fc..d7dfd261d49 100644
--- a/themes/bootstrap3/templates/combined/stack-left.phtml
+++ b/themes/bootstrap3/templates/combined/stack-left.phtml
@@ -9,8 +9,8 @@
     <? endif; ?>
     <?
       $viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
-      // Disable cart if appropriate:
-      $viewParams['showCartControls'] = $this->showCartControls;
+      // Enable cart if appropriate:
+      $viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
     ?>
     <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
       <? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
diff --git a/themes/bootstrap3/templates/combined/stack-right.phtml b/themes/bootstrap3/templates/combined/stack-right.phtml
index adeb4ee29e8..d7c30c40ef5 100644
--- a/themes/bootstrap3/templates/combined/stack-right.phtml
+++ b/themes/bootstrap3/templates/combined/stack-right.phtml
@@ -9,8 +9,8 @@
     <? endif; ?>
     <?
       $viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
-      // Disable cart if appropriate:
-      $viewParams['showCartControls'] = $this->showCartControls;
+      // Enable cart if appropriate:
+      $viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
     ?>
     <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
       <? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
diff --git a/themes/bootstrap3/templates/search/results.phtml b/themes/bootstrap3/templates/search/results.phtml
index 318cee83371..7454bdeda5f 100644
--- a/themes/bootstrap3/templates/search/results.phtml
+++ b/themes/bootstrap3/templates/search/results.phtml
@@ -30,7 +30,7 @@
     $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc('Search') . ': ' . $this->escapeHtml($lookfor) . '</li>';
   }
 
-  // Disable cart if appropriate:
+  // Enable cart if appropriate:
   $this->showCartControls = $this->params->getOptions()->supportsCart() && $this->cart()->isActive();
 
   // Load Javascript dependencies into header:
-- 
GitLab