Open madesimplemedia opened 4 years ago
You could try something like
$product = $item->getProductObject();
if ($product) {
$locationPages = $product->getLocationPages();
foreach ($locationPages as $location) {
if ($location) {
$locationpage = Page::getByID($location->getCollectionID());
if ($locationpage) {
echo $locationpage->getCollectionName(); // or do whatever you want with the category page
}
}
}
}
Thanks that's great, got it working nicely.
Hi,
On the checkout complete page I am using functions like $item->getSKU(), $item->getProductName() etc. to populate Google Analytics with data when someone completes a purchase.
Is there a way of getting the categories that a product is under?
Thanks Dave