Chandresh Chauhan
  • Member for 3 years, 1 month
  • Last seen this week
Get Storefront Product URL for Magento 2
0 votes

Try to using this $productId = 1; $productRepository = $objectManager->get('Magento\Catalog\Api\ProductRepositoryInterface'); $product = $productRepository->getById($productId); ...

View answer
magento 2.4 : customer session get destroyed after payment
0 votes

put log in the file vendor\magento\module-checkout\Model\Session\SuccessValidator.php it seems like issue with the set value of last quote id and order id

View answer
How to Inject a new Class to Overridden Class using Preference
Accepted answer
3 votes

you need to call parent constructor also with required parameters public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Sales\Model\ResourceModel\...

View answer
How to add Data to Custom table in database using model in magento 2.3.5
1 votes

it will help you to save data in custom table, please refer this blog

View answer
Message is added to queue, wait to get your coupons soon
Accepted answer
8 votes

try to manually process queue with this command bin/magento queue:consumers:list view a list of all consumers bin/magento queue:consumers:start <queue_name> pass queue_name for process the ...

View answer
Magento 2- How to pre select and load CCAvenue on checkout page
1 votes

can you please check this free extension Auto Select Shipping Payment Method OR check this solution magento-2-how-to-auto-select-and-load-the-first-payment-method

View answer
Want to add multiple column into Magento 2 admin panel left side menu
Accepted answer
1 votes

add menu.xml to your custom module app/code/[Vendor]/[Module]/etc/adminhtml/menu.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...

View answer
Magento 2.3.2 sort collection by stock availability
Accepted answer
0 votes

for category pages its works check this Blog link.

View answer
Magento 1.9 How to sort product in category page by stocks product
0 votes

please check this solution for out of stock product last display : https://stackoverflow.com/questions/15879978/magento-out-of-stock-products-showing-last-in-the-category-page

View answer
Magento 2 How to get quote in collect rates custom shipping
0 votes

to get current quote public function collectRates(RateRequest $request){ // $this->checkoutSession is object of Magento\Checkout\Model\Session $quote = $this->checkoutSession->getQuote(); ...

View answer
convert any date into dateTimestamp in order to compare it
Accepted answer
1 votes

try to this way $date = Mage::app()->getLocale()->date($product->getSpecialToDate(), Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), ...

View answer
Magento2.3 - get product collection in stock only
2 votes

By default magento filters only in stock products in collection // $this->productCollection is object of Magento\Catalog\Model\ResourceModel\Product\Collection $collection = $this->...

View answer
Magento 2.3.3 Adding Custom File Upload button in system configuration not working in local
Accepted answer
1 votes

i got the issue in file Magento\Framework\File\Uploader.php in which new method was added so i just comment that method, in function _setUploadFileId($fileId) found the $this->validateFileId($...

View answer
Magento 2.3.2 call console command in observer
3 votes

You can try this for run OlegKoval command in observer $output = shell_exec('php bin/magento cache:clean'); you can change your command in this, you can try below code in observer file $...

View answer
Magento 2 - Assign product to category on frontend
0 votes

can you try this code it's works for me $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $CategoryLinkRepository = $objectManager->get('\Magento\Catalog\Model\...

View answer
Magento 2 : addAttachment is not working
0 votes

for magento 2.2.8, 2.2.9, 2.3.0, 2.3.1, 2.3.2 versions you can check this solution https://github.com/extait-com/email-attachment for email attachment

View answer
How to override a phtml file from a custom module in magento 2?
2 votes

Customizing the core Magento 2 functionality is a bad coding practice. The solution is to override a phtml file using a custom module in Magento 2. Learn the implementation of both the methods at ...

View answer
Redirect customer login/register success to checkout Magento 2.2
1 votes

I tried the solution at https://meetanshi.com/blog/redirect-customer-login-or-registration-success-to-checkout-in-magento-2/ and it worked fine for me.

View answer
how to add link for advance search in magento 2 home page default theme?
1 votes

Add Following Code in default.xml layout of theme <referenceBlock name="footer_links"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="custom-footer-link"> <...

View answer
Get product attribute measurement in magento2
1 votes

$product->getTsDimensionsLength(); $product->getTsDimensionsWidth(); $product->getTsDimensionsHeight(); or use this $height = $_product->getResource()->getAttribute('...

View answer