Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

1

I am using docker php-fpm, I destroyed the Container, removed all unused and unrelated dependencies from my Dockerfile then rebuild everything then everything seems works now.


0

Just want to add this one, if you want to validate user input if it is within the range of -10 to 10. <item name="validation" xsi:type="array"> <item name="validate-digits" xsi:type="boolean">true</item> <item name="validate-digits-range" xsi:type="string">-10-10</item> </item> Note: use validate digits ...


0

Hope it's helps <item name="field" xsi:type="array"> <item name="validation" xsi:type="array"> <!-- Classes for data validation: --> <item name="min_text_length" xsi:type="number">1</item> <item name="max_text_length" xsi:type="number">50</item> </item> </item>


2

you just need to add <item name="validate-number" xsi:type="boolean">true</item> in your specific field in ui_component


0

It is good and you followed good approach as per M2 standards. It needs some improvement to make it compatible and error-free in a maximum of cases Exception Handling. $order = $observer->getEvent()->getOrder(); if( !empty($order) ){ // do code here } Naming convention. Do use camel-case for variables. $order_status should be $orderStatus. It is ...


0

There could be multiple reasons behind that... Try to show some log... meanwhile run these command.. php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento indexer:reindex php bin/magento cache:flush then retry...


0

Run this command in Magento directory composer upgrade Magento will start running chears


0

There are two possibilities: 1) Either you declared your helper in the config.xml and you did not create it in the module GT/Speed/Helper/Data.php 2) Either you created it in the module but not in the config.xml or you did it wrong. Solution: You should have this in your config.xml: <global> ... <helpers> <speed> ...


0

There is an extension for this purpose. It searches all the Menu links in admin via Ajax and returns results with information about its parent -> child hierarchy as well. https://marketplace.magento.com/magehelper-menusearch.html


0

You Can Try this way for learning a how extension works,and how to send a mail on form submit. please download this extension and install in your project and learn about it : Extesnion Link


0

replaced this.images.toJson() to JSON.stringify(this.images) , it works fine now


0

In my case, I had accidentally set a store as the default in the control panel: In core_config_data: layout_switcher/general/default_theme was set to 'interiors' Whenever I tried to access the admin area, I got the template for interiors and a 404. To fix I set: layout_switcher/general/default_theme back to 'base' I then ran: php bin/magento cache:...


0

Workaround : you can have product's attribute for storing custom buying url and check if it exist for the product you can remove the link in phtml file. You need to set Manage Stock false for those type of product. And also you can prevent these type of product to be added in cart by following refrences Preventing a product from being added to cart in ...


0

I agree with jamil on many points. You could have the top category clickable on default. However, if someone does chose a category, you could have it showing the top of the page, but not showing the menu, so this also doesn't occur. IOW, when any category is clicked, the next page shows (the category clicked on) but the page scrolls to the top of the ...


1

In order to configure an extension, Go to stores -> configuration -> MAGEPLAZA EXTENSIONS -> Information -> [General Configuration ->Enable Mageplaza Menu -> Yes] -> Save Config and if you're not sure about the menu and the configuration in the sense. Please check the below file understand better. Go to app/code/Mageplaza/Smtp/etc/adminhtml/system.xml ...


0

This would be a great question for https://ux.stackexchange.com/, they provide some really good and often well researched and data-driven answers to this kind of thing. But quickly what comes to mind, depending on how much control you have over the theme: Wait for x seconds after page load to allow the menu to open Wait for some amount of mouse movement ...


0

I got a solution on this. we need to use getData() $bannerCollection->getData();


0

With the provided error, you can try to change this line if ($shipment) { $order->setIsInProcess(true); $order->addStatusHistoryComment('Automatically SHIPPED', false); $transactionSave = $this->_transactionFactory->create(); $transactionSave->addObject($shipment); $transactionSave->addObject($shipment->getOrder()); $...


1

You can override this method in this class : Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory /** * Make select object for date boundary * * @param string $from * @param string $to * @return \Magento\Framework\DB\Select */ protected function _makeBoundarySelect($from, $to) { $connection = $this->getConnection(); $cols =...


0

I was able to find a workaround with setInterval ... the problem is that when I execute my script the table containing jQuery("tr:contains('mychippingmethod')") is still used by Magento so he doesn't allow me to change it until he finishes loading the whole table. So what I did is looking for my appended html tag with id as long as it's not added my code ...


1

You will have to get the objects you need in the constructor of your ShipmentObject using the object manager and pass them as parameter. Your code should look like this from line 175: $shipmentTrackFactory = $objectManager->get('Magento\Sales\Model\Order\Shipment\TrackFactory'); $shipmentFactory = $objectManager->get('Magento\Sales\Model\Order\...


0

This has nothing to loose in a .phtml you have to create a block class and put your PHP there. Always keep the php in template files to a minimum. https://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html


0

I found the issue. Issue is with API it self . some times i am getting rate_breakup and some times i am getting nothing. so i placed below if condition. if(isset($service_types->rate_breakup)){ $html .= ' <td><center>'.$service_types->rate_breakup-&...


0

Try this one : class Sendform extends \Magento\Backend\App\Action { public function execute(){ $data = $this->getRequest()->getPostValue(); $result = $this->_objectManager->create('Shipyaari\Shipping\Model\SearchService')->avilable_service($data); $result=json_decode($result); if($result) { ...


0

Evgeniy Kapelko approach works, but deprecated from Magento 2.1(with certain version I might be mistaken). Below infromation from class, that was used in Evgeniy Kapelko approach, confirm info about deprecation vendor/magento/framework/Model/AbstractModel.php /** * Save object data * * @return $this * @throws \Exception * * @deprecated 100.1.0 ...


0

Change the format of your $arrayOfColumnsName data like this: $arrayOfColumnsName = ['column1', 'column2']


2

Try This :- ->addIndex( $installer->getIdxName( $installer->getTable('table_name'), ['column1','column2'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), ['column1','column2'], ['type' => \Magento\Framework\DB\Adapter\...


0

Solved !! This is how I did it : <?php namespace Mageplaza\Simpleshipping\Model; use Magento\Checkout\Model\ConfigProviderInterface; /** * Class SampleConfigProvider */ class SampleConfigProvider extends \Magento\Framework\App\Helper\AbstractHelper implements ConfigProviderInterface { /** * Retrieve assoc array of checkout configuration ...


0

Your protected code should be equal to the name of your system.xml group configuration. Instead of protected $_code = 'thecode';, It should be: protected $_code = 'my_shipping_methode';


0

it is an issue in Magento I think this commit will solve the problem the issue link here


0

Finally I changed my code in my modal as follows. $requestData->setDestCountryId($request->getDestCountryId()); $requestData->setDestCity($request->getDestCity()); $requestData->setDestRegionId($request->getDestRegionId()); $this->setRawRequest($requestData); Now i can access the City , Region and ...


1

You can try doing this way: $hiddenCategories = array('375','376','377','378','3','379','380','381','382','383','384','385','386','387','388','389'); $categories = $block->getSaleableItem()->getCategoryIds(); Change your condition like this: <?php if (!empty(array_intersect($categories, $hiddenCategories))): ?> You can not use in_array as ...


0

I needed clear my app/etc/env.php. My env.php file: <?php return array ( 'backend' => array ( 'frontName' => 'sacadmin', ), 'crypt' => array ( 'key' => 'ab43d966a6cab0add849980ece1b3fa5', ), 'db' => array ( 'table_prefix' => '', '...


0

I was able to figure this out, you just need to pass the payment_method_nonce and public_hash along with the payment method braintree_cc_vault: ... $quote->getPayment()->importData(array('method' => 'braintree_cc_vault', 'public_hash' => $public_hash, 'payment_method_nonce' => $paymentMethodNonce)); ...


1

Below is your modified .phtml code which will work. you can also use same function which you used in block. the main thing is you need to load category by id to get image URL. <?php use Magento\Catalog\Model\Category\Interceptor; /** @var Interceptor $category */ $category = $this->getCategoryById(63); $objectManager = \Magento\Framework\App\...


0

Ok, I could fix this. If you're interested: create a new file app/code/$yourModule/Catalog/etc/adminhtml/di.xml with the following content <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\...


0

I had same issues and after days of brainstorming i discovered that solution does not require any code writing. Goto your "Mega Menu" Disable any product menu item on the menu list and issue is resolved. See here - https://prnt.sc/n18cq5


Top 50 recent answers are included