New answers tagged

1

learn about system.xml click here link-1 and Link-2 I follow Magento Default way to send email. app\code\VendorName\RequestForQuote\etc\adminhtml system.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system&...


0

I done this, in a simple method. set the value as ini_set('session.cookie_lifetime', 60 * 60 * 24); ini_set('session.gc_maxlifetime', 60 * 60 * 24); otherwise set value as 86400 in your php.ini /etc/php/7.1/apache2/php.ini


0

I can't "add a comment" under the @Padhiyar Gaurang comment yet, but your answer works for me on Magento 2.2.9 except that there is an error on your step 4 : create a file unit.phtml at app\design\frontend\My_constructor\My_theme\Magento_Weee\templates\cart\item\price It's : create a file unit.phtml at app\design\frontend\My_constructor\My_theme\...


1

Go to Admin->Store->Configuration->Sales->Checkout->Shopping Cart And set the Parent Product Thumbnail as Grouped Product Image Check the below screenshot Clear the cache and check.


-1

Magento2 doen't support it by default, you have to do customization for this , You can create 1 custom column in quote_item table where you can save group product id for the item so when you add product from group product detail page so you have to insert its group id as well. then on item list page you can check if it has group product id then you can ...


0

You can create your custom cronjob, please see my answer below. 1. crontab.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="remove_cart_items" instance="Your\Module\Cron\...


0

You need to create a Custom module & Set Cron which will run after a certain interval of time. In that you can use below code <?php namespace Company\Custom\Cron; class Custom { /** * @var \Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory */ protected $itemCollectionFactory; /** * @var \Magento\Quote\Model\...


0

Since no answer is accepted, Around plugins (used in Mohit's answer) are advised against by Magento and Jigs' answer seems excessive and might not work if other extensions are hooking into the same observer, I figured I'd share my own answer. I'm assuming you know how to build a module's basics (registration.php, module.xml, etc.) This module redirects ...


0

Assume the $activeQuoteId is the id of current activeQuote $inActiveQuoteId is the id of current inactiveQuote And 2 quotes must belong to customer, You should active which quote do you want for customer, then set to current checkout session. /** @var $activeQuote \Magento\Quote\Model\Quote */ $activeQuote = $this->quoteRepository-&...


1

Checkout and cart pages should never be cached in Varnish. Look at the default.vcl config that M2 creates. Note this line. # Bypass shopping cart, checkout and search requests if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") { return (pass); } That means that the checkout and the search should never be cached in varnish. Did ...


0

Yes, we can activate the quote if you know the quote_id. You can use the query to active the inactive quotes update quote set is_active=1 where entity_id = 'YOUR QUOTE ID GOES HERE'


0

In magento 1.9.3 you can try something like this: <?php echo Mage::helper('checkout/cart')->getAddUrl($_product) ?> It will give you an add url with form key, which you don't have. Then you can add for example: ?super_attribute[150]=177&qty=1


0

Please try to run the command: php bin/magento setup:static-content:deploy please comment if it works!


0

I agree, this feature is needed to remove multiple items at once. Seems odd to remove it.


0

@alexcr, that file should be extended in app/design/CUSTOM/THEME/Magento_Checkout/templates/messages/AddCartSuccessMessage.phtml


1

You can make your block non-cacheable by adding cacheable="false" attribute to it in the layout xml: <block class="Magento\Framework\View\Element\Template" name="custom_header" as="custom_header" template="Magento_Theme::html/custom_header.phtml" before="-" cacheable="false"> get the item count from javascript localStorage. Here's a quick and easy ...


0

Keep the backend validation code. We should implement some logic on Frontend. Mixins catalog-add-to-cart.js app/code/Vendor/Catalog/view/frontend/requirejs-config.js var config = { config: { mixins: { 'Magento_Catalog/js/catalog-add-to-cart': { 'Vendor_Catalog/js/catalog-add-to-cart-mixins': true } ...


0

Try using this observer instead namespace Vendor\AddtoCartRedirction\Observer; class ForceCustomerLoginObserver implements \Magento\Framework\Event\ObserverInterface { public function execute(\Magento\Framework\Event\Observer $observer) { # check if user is logged in $objectManager = \Magento\Framework\App\ObjectManager::...


0

Use this for particular rule $rule = Mage::getModel('catalogrule/rule')->load(1); $rule->save(); //save the rule $rule->applyAll(); //apply all the rules And for all rules $rule = Mage::getModel('catalogrule/rule'); $rule->save(); //save the rule $rule->applyAll(); //apply all the rules


0

To format the price you can put below code into your block file. public function __construct(\Magento\Framework\Pricing\Helper\Data $pricingHelper) { $this->pricingHelper = $pricingHelper; } public function getCustomFormatedPrice($myprice) { return $this->pricingHelper->currency($myprice,true,false); } Now you can call it from your phtml ...


0

you can change order in admin site Admin -> Stores -> Settings -> Configuration -> Sales -> Sales -> Checkout Totals Sort Order but can't change Order Total Excl. Tax and Order Total Incl. Tax if you won't change it order to Order Total Incl. Tax and Order Total Excl. Tax please overide Magento_Tax module web/template/checkout/summary/grand-total.html ...


1

You can add the same validation in the Action tab section for SKU check


0

You don't need to set shipping module to Online Shipping module, cause You don't need to get (API or etc) rates. Also, your module does not provide a tracking number. It's simply Offline shipping. The Magento_OfflineShipping module implements the shipping methods which do not involve a direct interaction with shipping carriers, so called offline ...


Top 50 recent answers are included