UpsellAjax::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Richdynamix\PersonalisedProducts\Controller\Products;
4
5
use Magento\Review\Controller\Product as ProductController;
6
use Magento\Framework\Controller\ResultFactory;
7
8
/**
9
 * Class UpsellAjax
10
 *
11
 * @category  Richdynamix
12
 * @package   PersonalisedProducts
13
 * @author    Steven Richardson ([email protected]) @mage_gizmo
14
 */
15
class UpsellAjax extends ProductController
16
{
17
    public function execute()
18
    {
19
        $productId = (int) $this->getRequest()->getParam('id');
20
        $product = $this->loadProduct($productId);
21
        if (!$product) {
22
            return false;
23
        }
24
        /** @var \Magento\Framework\View\Result\Layout $resultLayout */
25
        $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
26
        return $resultLayout;
27
    }
28
}