New answers tagged

0

To fetch value of attribute Use: First load/get your Product and then $this->getProduct()->getAttributeText('attribute_text'); e.g: $this->getProduct()->getAttributeText('country_flag'); Or $product = $this->getProduct(); $store = $this->_storeManager->getStore(); $ressource = $product->getResource(); $ressource->...


1

Yes, You can create new order statuses and alter the existing ones in the Stores > settings > Order Status https://i.stack.imgur.com/9Qyi9.png Now you have to Alter the existing one which says complete. https://i.stack.imgur.com/tIHqa.png You can change the Status Processing to Complete and Complete to Order Paid, You can also change the Status Code ...


1

You will have to create cart to create order in Magento but you can always save the existing cart id in the customer session and set it back as customer's active cart once the customer is done with purchase with gpay.


0

Using Object Manager(Not Recommended) <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product echo $product->getPrice(); ?> Using block <?php namespace Vendor\Module\Block; class BlockClass extends \Magento\...


0

I guess you are struggling with a Bug in Magento 2.4.3 which is discussed in a couple of Magento tickets on GitHub (e.g. https://github.com/magento/magento2/issues/33798 ) Solution would be either a patch as described here: https://github.com/magento/magento2/issues/33856#issuecomment-904606945 To make it work on Magento 2.4.3 without having to switch to ...


1

For magento cloud, the production is in read-only mode. You have to change & push the codechanges from lower environments (staging, integration, etc) into production. Another option is to set the changes in the environment-specific variables in magento.cloud (https://devdocs.magento.com/cloud/env/working-with-variables.html)


0

since it is a public method you can override it using around plugin https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html#around-methods


1

A service class as an alternative option for Registry should be a class that gets needed data from the session and passes it for further/later usage. It must not contain any business logic in there – this should be done in the place where data was requested. The short answer is “from the session”. More exactly from Magento\Framework\Session\SessionManager ...


0

If the URL is indexed successfully, webmasters can view details of the HTTP response and HTML code; also copy, search and validate for specific changes made by them. All HTTP response status codes are majorly separated into five classes or categories: 1xx informational response – the request was received, continuing process 2xx successful – the request was ...


0

.phtml file <a href="<?= /* @escapeNotVerified */ $block->getProductUrl($_item) ?>" class="product photo product-item-photo"> <?= $this->getImage($_item, $image)->toHtml() ?> </a> getImage() Function in Block File <?php namespace Vendor\Module\Block; class file_name extends Template { ...


0

Here, You can find Alternatives for deprecated Registry class – Magento 2.3 Link I am not sure It is working with 2.4.3. Thanks...


0

After a bit of time. customer.php class Customer extends AbstractHelper { const KEY_EMAIL = 'customer-email'; const KEY_FIRSTNAME = 'customer-firstname'; const KEY_LASTNAME = 'customer-lastname'; const KEY_PASSWORD = 'customer-password'; const KEY_WEBSITE = 'website'; const KEY_SENDEMAIL = 'send-email'; const KEY_CITY = 'city'; ...


0

If you want to do that then on __construct() function of your class observer, you must inject two classes. First, \Magento\Framework\App\ResponseFactory which is responsible for redirection, Another class \Magento\Framework\UrlInterface will make a URL for that redirection. Then create object for ResponseFactory, and using setRedirect($YourUrl)->...


0

I also had this problem. I already deleted all the files in the var/cache, var/session and changed the base_url in the table core_config_data to the new URL. But still the site redirected to the old site. I had forgotten to edit the database detail (username, password, and dbname) in config.xml in folder app/etc/: yes, this one helped me, after i deleted the ...


0

yes, this one helped me, after i deleted the cache, it worked for me


0

You can also try like this: <?php ob_start(); ?> <div>HTML conent...</div> <div>More content...</div> <?php $html = ob_get_clean(); ?>


0

You need to replace the inside a single quote with a double quote. can you try with below working code. <?php echo $test = '<div> <form class="form-outofstock-notify" id="product-notify-form" method="post" data-mage-init="{"validation":{}}"> <input name="notify_email" id=&...


0

Magento already supports this functionality and it is working on all versions of Magento.


Top 50 recent answers are included