The Stack Overflow podcast is back! Listen to an interview with our new CEO.
12

You can override these templates in your custom theme and edit the html as per your requirement. app/design/frontend/Vendor/themename/Magento_Email/email/header.html app/design/frontend/Vendor/themename/Magento_Email/email/footer.html


7

This way i convert date format protected $timezone; public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone, ...... ) { $this->timezone = $timezone; } $dateTimeZone = $this->timezone->date(new \DateTime($yourdate))->format('Y/m/d H:i:s');


7

After following major tutorials and troubleshooting web pages it turned out the issue lies with my hosting configuration. Varnish Cache seems to be the cause of the menu disappearing. Disabling Varnish causes the menu to not show. The solution is to enable Varnish Cache and the menu appeared again which is kinda bizarre for me and hard to understand. ...


6

Here is the solution... Create new module Vendor/Module/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Vendor_Module" setup_version="2.1.0"> <sequence> <module ...


6

You can override your core header and footer template into your theme folder, vendor/magento/module-email/view/frontend/email/header.html To your theme, app/design/frontend/{Vendorname}/{thememane}/Magento_Email/email/header.html Same Process for Footer.html file. app/design/frontend/{Vendorname}/{thememane}/Magento_Email/email/footer.html Run php ...


6

Finally, I got the solution. By defining event checkout_onepage_controller_success_action and write a below code in observer we can convert the guest user to customer <?php $orderId = $orderIds[0]; $order = $this->_orderFactory->create()->load($orderId); /*Convert guest to customer*/ if ($order->...


5

Can you please try by replacing below public function getProductById($pid) { $product = $this->_productRepository->getById($pid); return $product->getUrlModel()->getUrl($product); } With public function getProductById($pid) { $product = $this->_productRepository->getById($pid); return $product->...


5

You can achieve this task by below 2 option Option - 1 You need to change 'created_at' column in view/adminhtml/ui-component/sales_order_grid.xml Change column <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date"> to <column name="main_table.created_at" class="Magento\Ui\Component\Listing\Columns\Date"> Option -...


5

I've found out how to get list options I was looking for, it's possible to get attributes groups with array with options like so: http://magento2.dev/rest/V1/products/attributes?&searchCriteria[filterGroups][0][filters][0][field]=attribute_group_id&searchCriteria[filterGroups][0][filters][0][value]=31 Where 31 is the attribute_group_id of custom ...


4

In your theme you will get this en_US.csv file at below location app\design\frontend\Infortis\base\i18n\en_US.csv There you can put your custom translations, Like Add to Cart to "Shop now" Keep your cache disabled or clear the cache.


4

To show your Custom Block Navigation , you simply need to create a widget Go to admin > content > widgets > add widget Select type as CMS static Block and choose your theme whichever you are using Fill all the details ( Title / Assign to Store Views / Sort Order to "0" Add layout update > Display on all pages / Container: After page header ...


4

use \Magento\Catalog\Model\Product\Attribute\Repository; protected $productAttributeRepository; public function __construct( ... Repository $productAttributeRepository .... ) { .... $this->productAttributeRepository = $productAttributeRepository; .... } Now you can use this like to get product attribute $yourAttribute=$this->...


4

You have to add mixin for shipping-rates-validation-rules Add mixins in requirejs-config.js app/code/Vendor/ShippingModule/view/frontend/requirejs-config.js var config = { config: { mixins: { 'Magento_Checkout/js/model/shipping-rates-validation-rules': { 'Vendor_ShippingModule/js/model/shipping-rates-validation-...


4

Step 1: Create websites In your Magento backend, go to Stores > Settings > All Stores On the Stores page, click Create Website. Name: Enter a name to identify the website. Code: Enter a unique code; for example, if you have a French store, you can enter french Sort Order: Enter an optional numerical sort order. Click Save Web Site. Repeat these tasks ...


3

Try these command: php -dmemory_limit=1G bin/magento setup:upgrade php -dmemory_limit=1G bin/magento setup:static-content:deploy php -dmemory_limit=1G bin/magento setup:di:compile


3

When you run php -r "echo ini_get('memory_limit').PHP_EOL;" you are not initializing magento at all. It is possible, that your hoster increased memory limit for your webserver, but not for cli (which you are running here).


3

90 is actually a pretty good score for a Magento 1.x or 2.x Desktop site. With the Pagespeed module working correctly it should remove the css rendering problem. Do you know which version of Pagespeed you are using? It is always ironic with Pagespeed that the external Google javascript for analytics etc ends up affecting the rank due to the cache settings ...


3

You can easily change following variable in Magento/Checkout/Block/Cart/Crosssell.php protected $_maxItemCount = 4; Check more detail here NB: Don't modify core file. [Update] Make sure your module depends on 'Magento_Checkout' module in module.xml create Vendor/Module/etc/frontend/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://...


3

You add a custom link to the 'proceed to checkout button' in minicart.js. This can be found under magento/module-checkout/view/frontend/web/js/view In that file you will see 'url':{ 'checkout'


3

If you want to add option in the sort menu then you need to create a plugin as I achieved 1) create di.xml file and the below code <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Model\Config"&...


3

To force shipping method reloading try, define( [ 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/shipping-rate-processor/new-address', 'Magento_Checkout/js/model/shipping-rate-processor/customer-address', 'Magento_Checkout/js/model/shipping-rate-registry' ], function (quote, defaultProcessor, ...


3

You can use help of class Magento\ConfigurableProduct\Model\Product\Type\Configurable refer here Try like this private $productRepository; ... public function __construct( ... \Magento\Catalog\Api\ProductRepositoryInterface $productRepository ... ) { ... $this->productRepository = $productRepository; ... } public function ...


3

Private functions cannot overridden in child class. If you want to change the logic in _validate function you can use below method. Override save function, inside that instead of calling $this->_validate($addressModel) function use your own custom function, like below private function _validateCustom(CustomerAddressModel $customerAddressModel) { //...


3

As requested in comment: CREATE TABLE `design_config_grid_flat` ( `entity_id` int(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT, `store_website_id` int(11), `store_group_id` int(11), `store_id` int(11), `theme_theme_id` varchar(255) ); then the data: INSERT INTO `design_config_grid_flat` ( `store_website_id`, `...


3

Since the 2.2.0 release the customer_group_id field has type INT(10): CREATE TABLE `customer_group` ( `customer_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `customer_group_code` varchar(32) NOT NULL COMMENT 'Customer Group Code', `tax_class_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Tax Class Id', PRIMARY KEY (`customer_group_id`) ) ...


3

Try to use below code <?php /*add **\Magento\Eav\Model\Config** in your construct method*/ protected $eavConfig; public function __construct( \Magento\Eav\Model\Config $eavConfig ){ $this->eavConfig = $eavConfig; } /*Now you can get attribute data using*/ $attribute = $this->eavConfig->getAttribute('catalog_product', ...


3

You can try for start: jQuery('body').trigger('processStart'); OR $('body').trigger('processStart'); And for remove: jQuery('body').trigger('processStop'); OR $('body').trigger('processStop'); See example


3

Go to Stores > Configuration > Sales > Payment Methods there you find 'Sort Order' field corresponding to all payment methods. So, provide greater number to paypal and lesser number to sagepay to rearrange it.


3

you need event sales_order_save_commit_after get Data in observer public function execute(\Magento\Framework\Event\Observer $observer) { $order = $observer->getEvent()->getOrder(); }


3

You don't have to build an extension for this. You can do the following: Create new category in Products -> Categories and set a meta title inside Search Engine Optimization, for example: "News". Go to Marketing -> SEO and sales -> URL Rewrite and change the target path to the desired one. For example: "blog/news". NOTE: If your not allowed to change the ...


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