Skip to main content
2 votes

How to create and save a product with global scope set to use default values programmatically in Magento 2.4.6

I worked out the solution. I had to set the current store as ZERO (default/global scope) in the script before anything else, via \Magento\Store\Model\StoreManagerInterface. I found Magento doing ...
Fox's user avatar
  • 211
1 vote

Get customer custom attribute value without loading the customer

You can retrieve customer custom attributes from the customer session; there's no need to load the customer every time in Magento. Please check the code below. protected $sessionFactory; public ...
Msquare's user avatar
  • 9,173
1 vote

How to Display Attribute value in magento 2 using getProducts() Method

Please try following :- To get custom product attribute value. $_product->getProduct()->getAttributeText('weight_spices'); $_product->getResource()->getAttribute('weight_spices')->...
MP Raj's user avatar
  • 569
1 vote

How To Add Custom Attribute (PRICE and SKU) Data To Recently Viewed Products Widget

For that you can override the widget.xml for catalog_recently_viewed widget and add your parameters like below. [Vendor][Module]\etc\widget.xml <?xml version="1.0" encoding="UTF-8&...
Nikhil Ajani's user avatar
1 vote

How To Add Custom Attribute (PRICE and SKU) Data To Recently Viewed Products Widget

Try the below code and I tested it working fine. Create one module for that below is the code. app/code/MageMohit/CustomAttRecentlyViewedWidget/registration.php <?php use Magento\Framework\...
Mohit Patel's user avatar
  • 3,923
1 vote

Sort by A-Z Product List Page in Magento 2?

Hello dear i will share my code that is working so please you check it. /var/www/html/walletmetamask/app/code/Test/Uiform/etc/di.xml add below code. <?xml version="1.0" ?> <config ...
mohit vamja's user avatar
1 vote

Magento 2 update custom column value in sales_order table in a controller file

Looks like some other module is loading the order object and setting some data and then calling save method causing the custom column value to reset. Try saving order object using Magento\Sales\Model\...
Lokesh Naik's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible