Completed
Push — master ( 104ef7...ae9661 )
by Lawrence
01:58
created
src/Prestashop.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     private function getAvailableDate($row) {
188 188
         ($row['available_date'] != '0000-00-00') ? $dater = $row['available_date'] : $dater = '';
189 189
         return $dater;
190
-   }
190
+    }
191 191
 
192 192
     /**
193 193
      * @param null|string $id_product_attribute
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
         if (is_array($combo))
214 214
         {
215
-         foreach($combo as $key => $value)
215
+            foreach($combo as $key => $value)
216 216
         {
217 217
             $combo['base_price'] = (float) $this->getOrderPrice($product);
218 218
             $combo['quantity'] = (int) $this->getStockQuantity($product,$id_product_attribute);
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
             $pricing = $this->getAttributePricing($id_product_attribute);
222 222
             foreach($pricing as $ki => $val)
223 223
             {   
224
-              $combo[$ki] = $val;
224
+                $combo[$ki] = $val;
225 225
             }
226 226
         
227 227
         return $combo;
228 228
     }
229 229
 
230 230
     private function getAttributeBase($attribute) {
231
-       $sql = 'SELECT ag.id_attribute_group, ag.is_color_group, agl.name AS group_name, agl.public_name AS public_group_name,
231
+        $sql = 'SELECT ag.id_attribute_group, ag.is_color_group, agl.name AS group_name, agl.public_name AS public_group_name,
232 232
                     a.id_attribute, al.name AS attribute_name, a.color AS attribute_color, ag.group_type, pac.id_product_attribute
233 233
             FROM '._DB_PREFIX_.'product_attribute_combination pac
234 234
             LEFT JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute = pac.id_attribute)
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 
389 389
         if (is_array($result))
390 390
         {
391
-         foreach($result as $key => $value)
391
+            foreach($result as $key => $value)
392 392
         {
393 393
             $result['cat_id'] = $value['id_category_default'];
394 394
             $result['orderprice'] = $this->getOrderPrice($product);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 $choices = array_slice($vars, 1);
68 68
                 $id_product_attribute = $this->getAttribute($product, $choices);
69 69
                 Analog::log("Product combination: $id_product_attribute");
70
-                $combo_groups = $this->getCombination($product,$id_product_attribute);
70
+                $combo_groups = $this->getCombination($product, $id_product_attribute);
71 71
                 if (!empty($combo_groups) && is_array($combo_groups) && $combo_groups) {
72 72
                     foreach ($combo_groups as $k => $row) {
73 73
                         $combinations = $this->buildAttributes($combinations, $id_product_attribute, $row);
@@ -206,20 +206,20 @@  discard block
 block discarded – undo
206 206
     /**
207 207
      * @param null|string $id_product_attribute
208 208
      */
209
-    private function getCombination($product,$id_product_attribute)
209
+    private function getCombination($product, $id_product_attribute)
210 210
     {
211 211
         $combo = $this->getAttributeBase($id_product_attribute);
212 212
 
213 213
         if (is_array($combo))
214 214
         {
215
-         foreach($combo as $key => $value)
215
+         foreach ($combo as $key => $value)
216 216
         {
217 217
             $combo['base_price'] = (float) $this->getOrderPrice($product);
218
-            $combo['quantity'] = (int) $this->getStockQuantity($product,$id_product_attribute);
218
+            $combo['quantity'] = (int) $this->getStockQuantity($product, $id_product_attribute);
219 219
             $combo['id_product'] = (int) $product;
220 220
             $combo['product_name'] = (int) $this->getProductName($product);
221 221
             $pricing = $this->getAttributePricing($id_product_attribute);
222
-            foreach($pricing as $ki => $val)
222
+            foreach ($pricing as $ki => $val)
223 223
             {   
224 224
               $combo[$ki] = $val;
225 225
             }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 
389 389
         if (is_array($result))
390 390
         {
391
-         foreach($result as $key => $value)
391
+         foreach ($result as $key => $value)
392 392
         {
393 393
             $result['cat_id'] = $value['id_category_default'];
394 394
             $result['orderprice'] = $this->getOrderPrice($product);
Please login to merge, or discard this patch.