@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | if (InstantAnalytics::$commercePlugin) { |
| 99 | 99 | if ($productVariant) { |
| 100 | - InstantAnalytics::$plugin->commerce->addCommerceProductDetailView($this, $productVariant); |
|
| 100 | + InstantAnalytics::$plugin->commerce->addCommerceProductDetailView($this, $productVariant); |
|
| 101 | 101 | } |
| 102 | 102 | } else { |
| 103 | 103 | Craft::warning( |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | if (InstantAnalytics::$commercePlugin) { |
| 123 | 123 | if ($orderModel) { |
| 124 | - InstantAnalytics::$plugin->commerce->addCommerceCheckoutStep($this, $orderModel, $step, $option); |
|
| 124 | + InstantAnalytics::$plugin->commerce->addCommerceCheckoutStep($this, $orderModel, $step, $option); |
|
| 125 | 125 | } |
| 126 | 126 | } else { |
| 127 | 127 | Craft::warning( |
@@ -126,17 +126,17 @@ |
||
| 126 | 126 | $commerceFields = []; |
| 127 | 127 | |
| 128 | 128 | if (self::$commercePlugin) { |
| 129 | - $productTypes = Commerce::getInstance()->getProductTypes()->getAllProductTypes(); |
|
| 129 | + $productTypes = Commerce::getInstance()->getProductTypes()->getAllProductTypes(); |
|
| 130 | 130 | |
| 131 | - foreach ($productTypes as $productType) { |
|
| 132 | - $productFields = $this->_getPullFieldsFromLayoutId($productType->fieldLayoutId); |
|
| 133 | - $commerceFields = array_merge($commerceFields, $productFields); |
|
| 131 | + foreach ($productTypes as $productType) { |
|
| 132 | + $productFields = $this->_getPullFieldsFromLayoutId($productType->fieldLayoutId); |
|
| 133 | + $commerceFields = array_merge($commerceFields, $productFields); |
|
| 134 | 134 | |
| 135 | - if ($productType->hasVariants) { |
|
| 136 | - $variantFields = $this->_getPullFieldsFromLayoutId($productType->variantFieldLayoutId); |
|
| 137 | - $commerceFields = array_merge($commerceFields, $variantFields); |
|
| 138 | - } |
|
| 139 | - } |
|
| 135 | + if ($productType->hasVariants) { |
|
| 136 | + $variantFields = $this->_getPullFieldsFromLayoutId($productType->variantFieldLayoutId); |
|
| 137 | + $commerceFields = array_merge($commerceFields, $variantFields); |
|
| 138 | + } |
|
| 139 | + } |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // Rend the settings template |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $analytics->setProductActionToPurchase(); |
| 54 | 54 | $analytics->sendEvent(); |
| 55 | 55 | |
| 56 | - Craft::info(Craft::t('instant-analytics', 'orderComplete for `Commerce` - `Purchase` - `{number}` - `{price}`', [ 'number' => $order->number, 'price' => $order->totalPrice ]), __METHOD__); |
|
| 56 | + Craft::info(Craft::t('instant-analytics', 'orderComplete for `Commerce` - `Purchase` - `{number}` - `{price}`', ['number' => $order->number, 'price' => $order->totalPrice]), __METHOD__); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $analytics->setProductActionToAdd(); |
| 78 | 78 | $analytics->sendEvent(); |
| 79 | 79 | |
| 80 | - Craft::info(Craft::t('instant-analytics', 'addToCart for `Commerce` - `Add to Cart` - `{title}` - `{quantity}`', [ 'title' => $title, 'quantity' => $quantity ]), __METHOD__); |
|
| 80 | + Craft::info(Craft::t('instant-analytics', 'addToCart for `Commerce` - `Add to Cart` - `{title}` - `{quantity}`', ['title' => $title, 'quantity' => $quantity]), __METHOD__); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $analytics->setProductActionToRemove(); |
| 100 | 100 | $analytics->sendEvent(); |
| 101 | 101 | |
| 102 | - Craft::info(Craft::t('instant-analytics', 'removeFromCart for `Commerce` - `Remove to Cart` - `{title}` - `{quantity}`', [ 'title' => $title, 'quantity' => $quantity ]), __METHOD__); |
|
| 102 | + Craft::info(Craft::t('instant-analytics', 'removeFromCart for `Commerce` - `Remove to Cart` - `{title}` - `{quantity}`', ['title' => $title, 'quantity' => $quantity]), __METHOD__); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | //Add the product to the hit to be sent |
| 224 | 224 | $analytics->addProductImpression($productData, $listIndex); |
| 225 | 225 | |
| 226 | - Craft::info(Craft::t('instant-analytics', "addCommerceProductImpression for `{sku}` - `{name}` - `{name}` - `{index}`", [ 'sku' => $productData['sku'], 'name' => $productData['name'], 'index' => $index ]), __METHOD__); |
|
| 226 | + Craft::info(Craft::t('instant-analytics', "addCommerceProductImpression for `{sku}` - `{name}` - `{name}` - `{index}`", ['sku' => $productData['sku'], 'name' => $productData['name'], 'index' => $index]), __METHOD__); |
|
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | //Add the product to the hit to be sent |
| 244 | 244 | $analytics->addProduct($productData); |
| 245 | 245 | |
| 246 | - Craft::info(Craft::t('instant-analytics', "addCommerceProductDetailView for `{sku}` - `{name} - `{name}`", [ 'sku' => $productData['sku'], 'name' => $productData['name'] ]), __METHOD__); |
|
| 246 | + Craft::info(Craft::t('instant-analytics', "addCommerceProductDetailView for `{sku}` - `{name} - `{name}`", ['sku' => $productData['sku'], 'name' => $productData['name']]), __METHOD__); |
|
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | // Don't forget to set the product action, in this case to CHECKOUT |
| 276 | 276 | $analytics->setProductActionToCheckout(); |
| 277 | 277 | |
| 278 | - Craft::info(Craft::t('instant-analytics', "addCommerceCheckoutStep step: `{step}` with option: `{option}`", [ 'step' => $step, 'option' => $option ]), __METHOD__); |
|
| 278 | + Craft::info(Craft::t('instant-analytics', "addCommerceCheckoutStep step: `{step}` with option: `{option}`", ['step' => $step, 'option' => $option]), __METHOD__); |
|
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | $name = $cat->title; |
| 419 | 419 | |
| 420 | 420 | while ($cat = $cat->parent) { |
| 421 | - $name = $cat->title . "/" . $name; |
|
| 421 | + $name = $cat->title."/".$name; |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | $cats[] = $name; |