Common ProblemsΒΆ

How to show the category name?

If customers use the similar theme to default or they customized item section in the cart, comment folder Bss/MinMaxQtyOrderPerCate/view and add file into theme (view/frontend/templates/cart/item/default.phtml)

<?php
// get session and show cate
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
$_catename = $customerSession->getCatecheckoutcart();
?>
 
<!-- add category name -->
<?php if (!empty($_catename)): ?>
	<span> Category name: <?php echo $block->escapeHtml($_catename[$product->getSku()])?></span>
<?php endif ?>
<!--  -->

compared to file

Bss/MinMaxQtyOrderPerCate/view/frontend/templates/cart/item/default.phtml to add exactly

edit message Bss/MinMaxQtyOrderPerCate/Observer/MinMaxQty.php

--message Min Qty
if(!empty($_qty['min_qty'])) {
     	.................
     		$message = "The min quantity allowed for purchase at category ".$cate_name." is
				".$qtylimit.' [ Product Name : '.$product_name.' ]';
     	.................
}
--message Max Qty
if(!empty($_qty['max_qty'])) {
     	.................
     		$message = "The max quantity allowed for purchase at category ".$cate_name." is 
				".$qtylimit.' [ Product Name : '.$product_name.' ]';
     	.................
}