Skip to content

magento man

Display the coupon code on the product detail page Magento2.4

<?php use MagentoFrameworkApiSearchCriteriaBuilder; use MagentoSalesRuleApiRuleRepositoryInterface; use MagentoCatalogApiProductRepositoryInterface; use MagentoFrameworkRegistry; class CustomRule { protected $ruleRepository; protected $searchCriteriaBuilder; protected $productRepository; protected $product; public function __construct( RuleRepositoryInterface $ruleRepository, SearchCriteriaBuilder $searchCriteriaBuilder, ProductRepositoryInterface $productRepository, Registry $registry ) { $this->ruleRepository = $ruleRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->productRepository… Read More »Display the coupon code on the product detail page Magento2.4

Magento 2 override product list page collection

I am trying to override the product collection of the product list page (category page). (Just for testing locally) I am editing the vendor/magento/module-catalog/Block/Product/ListProduct.php file and the _beforeToHtml() method: protected function _beforeToHtml() { $collection = $this->_getProductCollection(); $collection->addAttributeToSelect(‘*’); $collection->addAttributeToFilter(‘manufacturer’, array(‘eq’ =>… Read More »Magento 2 override product list page collection

Shipment comment

I am trying to update a comment for an existing shipment, but I keep getting err mssg: {“message”: “Could not save the shipment comment.”} API and example I’m using are : Method:POST Request: {{base_url}}/rest/all/V1/shipment/1/comments { “entity”: { “parent_id”: 0, “comment”:… Read More »Shipment comment