:::: MENU ::::

PrestaShop get current product information

PrestaShop get current product information

Today we talk about how PrestaShop get current product information. You can use this code in hook related to the product page or controller and any other class. In this example, it will be shown the product name and product link, and other information. So let’s start with our example.

$productId = (int)Tools::getValue('id_product'); // get current product id
$productData = new Product($productId); // get product object with id
$name    = $productData->getProductName(); // get product name
$link    = $productData->getLink(); // get product link
Author: Qaisar Satti
Category: Prestashop
Last Modified: October 12, 2020


Comments are closed.