New answers tagged

0

To solve this I checked the Knockout flow and found a problem with one of the conditions we have in the Order Summary section. The file that I override with our theme is Magento_Checkout/web/js/view/summary/abstract-total.js The function that was creating a problem for us was isFullMode(). This function was returning false that's why the summary is not ...


0

The index.php is main access point of any magento page, so all troubles inside the Magento. If you want to find a real issue you must enable the built-in magento profiler, and check on any slow page what exactly cause an long loading. Here is an exploration about "How to enable and use Magento built-in profiler" and here is a corresponding DevDocs.


0

this is just for help this is how i acheived this <?php require_once 'app/Mage.php'; Mage::app(); Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); /** @var Mage_Sales_Model_Resource_Order_Collection $orderCollection */ $orderCollection = Mage::getModel('sales/order')->getCollection(); $orders = []; $orders[] = [ 'ID', ...


1

Try the following way: $file = Mage::getBaseDir('media'). DS .'file.csv'; $csv = new Varien_File_Csv(); $csv->setLineLength(20480); $csv->saveData($file, $csvdata); $csvdata should be mutli arary. Ex. $csvdata = [ [ 'a', 'b' ], [ 'c', 'd' ] ] [Update] <?php require_once 'app/Mage.php'; Mage::app(); Mage:...


0

What was your solution to this?


1

You can use a simple plugin: app/code/MageWorx/DisableFreeShipping/etc/di.xml <?xml version="1.0"?> <!-- /** * Copyright © 2018 MageWorx. All rights reserved. * See LICENSE.txt for license details. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/...


1

According to your question you need to hide free shipping method if 2nd value of postcode is 0, you can achieve it using below. app/code/VENDOR/MODULE/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <...


0

Try this. shell in go to your magento folder. sudo rm -rf var/view_preprocessed/* sudo rm -rf pub/static/*


1

An Explode should do the trick here: $value = explode("<hr />", $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block, $block->getProduct()->getTechData(), 'tech_data')); $value = reset($value); $attr = explode("|",$value); The explode splits the string into a number of array items (depending on the number of HRs). The ...


0

The issue was just a typo error. I was calling backgorundColor when it should be backgroundColor I hope it helps someone else.


1

in you layout.xml try this <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom"> <head> <script src="https://cdn....


0

Try this way... First in your block file private $dataHelper; public function __construct( ..... \Vendor\Module\Helper\Data $dataHelper, .... ) { ..... $this->dataHelper = $dataHelper; ..... } public function getFileSize($attachment) { $attachmentPath = \Vendor\Module\Helper\Data::MEDIA_PATH.$attachment; $...


0

UPDATE catalog_product_entity SET sku='' WHERE sku IS NULL; worked for me, thanks Sohel.


0

Good afternoon and thank you very much for your corrections. Finally I get to an answer. The line "echo "Servidor de servicios web SOAP funcionando.;" was responsible for the error. I remove it and it works almost perfectly. The "restar" function doesn't work correctly but it was a logic mistake. function restar($n1, $n2){ return $n1+$n2; } instead ...


0

You're trying to run filesize() on a remote asset, which may not worked based off of the settings in your php.ini. The way you might want to do it is like so: First, extend the block Create your own block class for this template extending the original: (I make an assumption about the class used here, confirm your own) class MyBlock extends \Magento\...


0

This is a known issue in Mmagento 2.3 I think. It seems to be fixed in 2.4 version Refer https://github.com/magento/magento2/issues/26231


0

This error coming when configuration missing from admin. When migrate magento. we are missing set the configuration. Go to admin: stores->Configuration->Catalog->Inventory: Checked here Minimum Qty Allowed in Shopping Cart for customer group is empty please added minimum one. then refresh your page. this error removed. I was getting same error. After I have ...


0

//WHERE BGG_IMAGE IS A LINK TO A REMOTE IMG $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $directory = $objectManager->get('\Magento\Framework\Filesystem\DirectoryList'); $import_path = $directory->getRoot() . '/pub/media/import'; //the above will find the absolute path of the import folder $arr = explode('/', $bgg_image); $...


0

For Magento 2 the file to load on the front end (i.e. mywebsite.com/phpinfo.php), the php file needs to go in the pub folder of the magento install. Simple as this.


2

Make sure Gtin attribute set as use in product sorting to Yes in Store > Attribute add edit Gtin attribute and check this change Store > Configuration > Catalog > Storefront > Product Listing Sort By to Gtin also got to Catalog > Manage Category and edit the category in which you want to change sorting and make sure here Default ...


0

You first need to upgrade PHP to PHP version 7.1.3 then upgrade your Magento version following the document guide of Magento: https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html If you can't do it by yourself, you can hire a Magento migration expert who helps you to complete your project even in the local.


3

Create di.xml in Vendor/Module/etc folder, <?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\Quote\Api\ShipmentEstimationInterface"> <plugin name="specific_shipping_method" type="Vendor\...


1

Turns out they were being set for the scope of my store view, not the scope of all stores. If one wants to set scope for all stores, they should set store view to 0, set the image, and then set the store scope back again.


0

add a PHP file named as "info.php" an at root directory with phpinfo() open it through browser www.yourdomain.com/info.php Here, search by $_ENV['PHPRC'] or PHPRC and get the value of it, in my case it was php:/opt/alt/php72/usr/bin/php-cgi so my final command to clear cache would be /opt/alt/php72/usr/bin/php bin/magento C:C


0

Make sure your theme contains the updated files which have form_key defined


2

Please check below code <?php require_once('app/Mage.php'); umask(0); Mage::app(); $order = Mage::getModel('sales/order')->load(10); $statusHistory = $order->getStatusHistoryCollection()->getData(); echo "<pre>"; print_r($statusHistory); ?> To show only status,created_at, entity_name Please check below ...


1

<?php require_once('app/Mage.php'); umask(0); Mage::app(); function prepareHistoryItem($label, $notified, $created, $comment = '') { return array( 'title' => $label, 'notified' => $notified, 'comment' => $comment, 'created_at' => $created ); } try{ $history = array(); $order = ...


1

Just came across my answer thanks to this post: https://magento.stackexchange.com/a/126874/35364 Basically just needed to inject: protected $encryptor; public function __construct( ... \Magento\Framework\Encryption\EncryptorInterface $encryptor, ... ){ $this->encryptor = $encryptor; } And then save my data with the following: $this-&...


1

As you've already implemented extension_attributes here's how you can save it. You need to observe controller_action_inventory_populate_source_with_data and get value of your field as below: $request = $observer->getEvent()->getRequest(); $requestData = $request->getParam('general', []); $type = $requestData['type']; ...


0

correct way installing to localhost is: add your domain to hosts file: 192.168.1.64 myshop.com change magento base url as: php bin/magento setup:store-config:set --base-url="http://myshop.com/" php bin/magento setup:store-config:set --base-url-secure="https://myshop.com/" php bin/magento cache:flush add domain name to nginx config: listen 8091; ...


0

You should reset file magento_new/app/bootstrap.php and all the Magento core files.


Top 50 recent answers are included