texts:
I am trying to arrange the category listing order in the top navigation on the storefront but every time I drag and drop the category at the required location it doesn't work.

After page refresh, category came back to the previous location.
Example :
Previous order :
category 1
category 2
category 3

Required order:
category 1
category 3
category 2

After page refresh it came back to the previous order as follows :
category 1
category 2
category 3

How I can fix this issue?


texts: Magento How to include shopping cart block like this (picture)

texts:
im looking for a solution for my magento shop how to include a shopping cart block like this one in the header.

When you click on this block it open a information how much products you have in your cart.

Whats the code for this solution. Maybe it is a extensions?


texts:
I've got a custom datetime attribute on a product that allows a date AND time to be selected. The field uses the Magento Date picker with the time fields available.

If I select a date and a time, and save, it stores the selected date and time in the database.  However, on the product grid it shows the time portion an hour out.

This will be because I'm in the BST timezone (GMT+1), which is also what the store is set to.

  Example: I select '2017-07-20 17:00:00' in the datepicker (actually
  its '20/7/2017 17:00' but that gets converted in the back-end model).
  This is then stored in the database as '2017-07-20 17:00:00', which I
  believe is the correct UTC/GMT value. The catalog grid view then shows
  the column with the date '2017-07-20 18:00:00'.

I'm not sure which part of this is at fault, or where to fix it.  Is it:

a) Saving the date in the db is wrong, and I should convert from current timezone to UTC before saving.
b) The datepicker is not using my browser's timezone?
c) The catalogue grid is forcing timezone conversion?

I've tried point a), so that it saves the date as -1 hour, but then the datepicker time is wrong when editing the product.

Suggestions welcome.


texts: Keep default store selected in Store switcher in Admin

texts:
I have created custom grids in Admin and given store switcher by XML file as below.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <title>Products</title>
</head>
<update handle="styles"/>
<body>
    <referenceContainer name="page.main.actions">
        <block class="Magento\Backend\Block\Store\Switcher" name="products.store.switcher" template="Magento_Backend::store/switcher.phtml"/>
    </referenceContainer>
    <referenceContainer name="content">
        <uiComponent name="products_listing"/>
    </referenceContainer>
</body>

How can I keep my default store as selected on the page load?

Also I have 4 websites and each have 1 store. on the grid listing page default store view should be selected and display for example US.

When i go record edit I have to display store switcher there to. And in this store switcher only display website and store which belongs to that product. Currently from list page I select the store and go to any product of that store then it's displaying selected store but in dropdown displaying all the websites and stores even product is only for 2 stores.


texts: Display the drop down values when mouse-over on text instead of textfield

texts:
please visit link

on top left, you can see "currency" with dropdown box. once you mouse-over on that, you can see as below

in same link if you scroll down below you can see filters : Device, Design, Category, Sort by

once you mouse-over on Design, you can see like below image

I need same kind of functionality for "currency" also.

means, i want to remove the textfield.

once we mouse-over on "currency"  text , it should display drop-down values.

code for currency

Script

CSS

select#select-language {
    position: absolute;
    top: 30px;
    z-index: 2;
    margin-top: -2em;
    margin-left: 4em;
padding-right: 2em;
}

option:hover {
    color: white;
    background: #0000FF;
}

</style>

phtml

<?php if(count($this->getStores())>1): ?>

    <?php echo $this->__('Currency:') ?>
    <select id="select-language" title="<?php echo $this->__('Your Language') ?>" onchange="window.location.href=this.value">
    <?php foreach ($this->getStores() as $_lang): ?>
        <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
        <option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->escapeHtml($_lang->getName()) ?></option>
    <?php endforeach; ?>
    </select>

<?php endif; ?>

when i use template path hints , i found this code for filters :

<?php endif; ?>


texts: Magento 2.2.6: i want to add form on banner

texts: I want search form in banner so, how to add form in banner in home page in magento 2.2.6


texts: KO templates are not loading in Magento 2.1 application

texts:
I have an application which is running in cluster environment(2 nodes). Application is working properly in individual nodes but when I try to access it from common url none of the knockout templates are working.
=> Error (knockout.js) :

Uncaught ReferenceError: Unable to process binding "template: function
(){return getTemplate() }" Message: thisXXXXXXXXXXXXX is not defined
Uncaught ReferenceError: thisXXXXXXXXXXXXX is not defined


texts: how to use dependency multiple field in admin edit section magento 2.0

texts:
my code is in below here how can i set 'gateway_title' and 'gateway_title2'
this tow fields depends on 'gateway_is_active' filed both of those two filed have be depended.

$fieldset->addField(
        'gateway_is_active', 'select',
        array(
            'label'  => 'Enable Email Gateway',
            'name'   => 'gateway[is_active]',
            'values' => $options,
            'note'   => 'Converting new emails that come to a gateway mailbox to tickets'
        )
   );
   $fieldset->addField(
        'gateway_title', 'text',
        array(
            'label'    => 'Title',
            'name'     => 'gateway[title]',
            'required' => true,
        )
    );

    $fieldset->addField(
        'gateway_title2', 'text',
        array(
            'label'    => 'Title',
            'name'     => 'gateway[title2]',
            'required' => true,
        )
    );


texts: Magento2 : Check if customer is already exist on customer register form

texts:
While customer filling register form, he should get to know while filling email address field that he is already registerd or not?
If he already registered with existing email address,password field should be appeared and can login from there, like checkout page .


texts: Magento2 constructors with scalar values

texts:
What would be the correct way to instantiate such a class in magento 2?

class MyClass
{
    private $myStringVale;
    private $myIntValue;

    public function __construct($myStringVale, $myIntValue)
    {
        $this->myStringVale = $myStringVale;
        $this->myIntValue = $myIntValue;
    }

    public function doSomething()
    {

    }

}

The 2 values will be taken from query parameters in the current request


texts: How can I add a button in the Adminhtml Reports>>Sales>>Orders


texts: How to remove a payment option from onepage checkout?

texts:
In onepage checkout page , there is a field called "Payment Information".
I want to remove the first option as shown in screenshot "Credit Card / Visa, Mastercard, AMEX, JCB, Diners" .

I've searched all the files in magento folders such as :

app/code/core/Mage/Checkout/Block/Onepage/Payment
app/code/core/Mage/Checkout/Block/Onepage.php
app/design/frontend/base/default/...

But no luck ! I couldn't find any file containing the text I've just mentioned.
I've also searched all of admin configuration pages & didn't find anything.
Could someone please help me on removing this option from onepage checkout page ?


texts: Magento2 Rest api get admin customer details and orders

texts: If I login as an admin user, how can I get details of customer and orders list with payment details using REST API in Magento2


texts: I created a landing page on an external site and I want to be able to add to cart from that external site. Is there any hack I can use to do this? Is there a custom URL I can use? I am using Magento 2.


texts: Magento Newsletter Subscription Confirmation Succesful not sent

texts:
We set the option that a user needs to confirm their subscription to yes.
In System  >  Configuration > Newsletter > Need to confirm **(YES)**

That works good, but when a user did confirm his/her email address, they do not receive the Success Email.

How can we send the Succes Email after they confirmed their email address?


texts: Wysiwyg Insert Image shows blank page in production mode

texts:
After putting my webshop in production mode and try to insert an image in the Wysiwyg editor it gives me a blank popup modal apart from text saying insert image and a close button.
In developer mode everything works fine.

The console gives me a 404 error.

The other Wysiwyg functions all work fine even the video upload function.


texts: Error while updating ece-tools version - Magento 2.2.6

texts:
I am using magento2.2.6 cloud version and while updating ece-tools version and push changes to cloud environment it is displaying below error.

W: Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
W: Generating optimized autoload files
W: File doesn't exist: bin/docker
W: Check "chmod" section in composer.json of magento/ece-tools package.
Could not open input file: ./vendor/bin/ece-tools

However I tried to remove container-interop/container-interop package but still having same error.

I have already followed below documents provided by magento.
https://devdocs.magento.com/cloud/project/ece-tools-upgrade-project.html#remove-deprecated-packages

https://devdocs.magento.com/cloud/project/ece-tools-update.html

Anyone have idea about this error?


texts: Magento2: Enable path-hints for specific IP when site is in production-mode

texts: Basically I have only the admin credentials of the client site and the site is in production mode. The client only provides admin credentials. How to enable path hints?


texts: AJAX cart displaying parent image instead of product image

texts:
I have the same problem as described here: Mini-Cart displaying Parent Product Image instead of Product Image. However, I cannot get the accepted solution to work. The problem is that when I add a product to my cart via AJAX the parent product image is shown. Only when I refresh the page is the correct simple product image shown. What am I missing?!?

Layout

app/design/frontend/mymodule/mytheme/layout/mymodule_ajax.xml

<?xml version="1.0"?>
<layout>
    <ajax_checkout_minicart>
        <block type="checkout/cart_sidebar" name="root" output="toHtml" template="checkout/minicart.phtml">
            <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/minicart/item/default.phtml</template></action>
            <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/minicart/item/default.phtml</template></action>
            <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/minicart/item/default.phtml</template></action>
        </block>
    </ajax_checkout_minicart>
</layout>

Controller

app/code/local/MyModule/Ajax/controllers/CheckoutController.php

class MyModule_Ajax_CheckoutController extends Mage_Core_Controller_Front_Action
{
    public function miniCartAction() {

        $layout = $this->getLayout();
        $update = $layout->getUpdate();
        $update->load('ajax_checkout_minicart'); //load the layout
        $layout->generateXml();
        $layout->generateBlocks();
        $html = $layout->getOutput();
        return $html;
    }
}

Templates

app/design/frontend/mymodule/mytheme/template/checkout/minicart.phtml

<?
$_items = $this->getRecentItems();
$_cartItemsCount = $this->getSummaryCount();
?>

    <? foreach ($_items as $item) : ?>
        <?= $this->getItemHtml($item) ?>
    <? endforeach; ?>

app/design/frontend/mymodule/mytheme/template/checkout/minicart/item/default.phtml

<?
$_templateHelper = Mage::helper('templates');
$_item = $this->getItem();
?>

    <a href="<?= $this->getProductUrl() ?>">
        <img src="<?= $this->getProductThumbnail()->resize(100); ?>">


texts: Magento 1.9 Start Downloading a PDF file after redirect

texts:
In my controller, I have added the functionality to download a generated pdf. But I want it to start the download on a redirected page OR download and redirect to that page and show the success message.
Method 1: this way it redirects to the sales order page but does not download the file
public function generatePdfAction(){

 $this->_getSession()->addSuccess($this->__('Pdf Generated.'));

 $this->_redirect('adminhtml/sales_order/index');

   $this->_prepareDownloadResponse(
                    'filename.pdf', "Hello Text",
                    'application/pdf'
                );
}

Method 2: this way it downloads the file but does not redirect
    public function generatePdfAction(){

     $this->_getSession()->addSuccess($this->__('Pdf Generated.'));

       $this->_prepareDownloadResponse(
                        'filename.pdf', "Hello Text",
                        'application/pdf'
                    );

$this->_redirect('adminhtml/sales_order/index');
    }


texts:
When i am adding product to my cart page this is working fine, also this is showing items on minicart. But when i am clicking on checkout this redirecting me to cart page and showing that no products on cart.

I am not getting what are the problems. Has anyone face this problem?? can you please tell me any solve??

Any help will be highly appreciated!!


texts:
Might this is basic query.
I am using "Pedona magento theme" for my website, now I need very small modification in style.less

/app/design/frontend/pedona/pedona_default/web/css/style.less

do have to run some command or it will automatically compose to style.css?

Magento2+


texts:
I want to get email from customer session login. But i have problem

public function execute()
{
    $resultRedirect = $this->resultRedirectFactory->create();
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $customerSession = $objectManager->get('Magento\Customer\Model\Session');
    $email = $customerSession->getEmail();
    echo $email;exit;

    if(!$customerSession->isLoggedIn()) {
        $resultRedirect->setUrl('/customer/account/login');
        return $resultRedirect;
    }
    $this->_view->loadLayout();
    $this->_view->renderLayout();
}

Please help me!


texts:
I have setup 3 magento websites, one for EN, AU and US. I did it as seperate websites as I want to change the price to a fixed price for each currency.

I have setup the three different currencies and change the price for each store against each product.

The price does change depending on the store, but the currency symbol never changes.

Can anything think of any reason this might be?


texts: Magento 2 - Fatal error: Uncaught Error: Cannot instantiate interface

texts:
When i try to export the products from magento admin panel i got this error
Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\MessageQueue\ConfigInterface in
/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Stack trace: #0
/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) #1
/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...') #2
/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Framewo...') #3
/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...') #4
/vendor/magen in /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121


texts:
when i place order it shows me country time and i have another module purhcase order its shows me server date time

$order_model->setCreatedAt($this->_date->gmtDate());


texts: Disable "Address" fields in Customer Registration Magento 1.9.3.2

texts:
I am using Intenso package.

For registration, under persistent package

By default Country, and address options are removed,

But when I submit Customer registration form,

Magento error comes out as

"Street Address" is a required value.
"Street Address" length must be equal or greater than 1 characters.
"City" is a required value.
"City" length must be equal or greater than 1 characters.
"Country" is a required value.
"Zip/Postal Code" is a required value.
"Telephone" is a required value.
"Telephone" length must be equal or greater than 1 characters.
Please enter the street.
Please enter the city.
Please enter the telephone number.
Please enter the zip/postal code.
Please enter the country.

How to disable these fields,

also these are not present in my register.phtml, still error is coming


texts: Agree and Continue Button is not coming in Magento 2.4 while installing

texts:
I am truing to install Magento 2.4 but problem is agree and continue button is not coming.
For Reference please find the attached image.

Thanks
SomuN


texts: Override Magento\Catalog\Block\Product\AbstractProduct getAddToCartUrl() function

texts:
In Magento 2

I want to override Magento\Catalog\Block\Product\AbstractProduct

I just want to pass my custom add to cart url before passing it to magento.

this function getAddToCartUrl($product, $additional = [])

So far I've done in 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">
  <preference for="Magento\Catalog\Block\Product\AbstractProduct" type="Vendor\Module\Block\Product\AbstractProduct" />
</config>

And in app\code\Vendor\Module\Block\Product\AbstractProduct.php I've following content.

namespace Vendor\Module\Block\Product;

class AbstractProduct extends Magento\Catalog\Block\Product\AbstractProduct
{
    public function getAddToCartUrl($product, $additional = [])
    {
       echo 'test';
       exit;
    }
}

Any suggestions if I want to process something before product is been added to magento cart.


texts: Handle the need to change the @api annotated classes/interfaces

texts:
From what I understood from the official documentation classes, interfaces, methods or constants annotated with @api are going to be backwards compatible and will be announced as @deprecated before being removed.

  We promise to be backward compatible for classes and methods annotated
  with @api within MINOR and PATCH updates to our components. As changes
  are introduced, we will annotate methods with @deprecated. The methods
  will be removed only with the next MAJOR component version. MAJOR
  changes will be scheduled no more than once per year; likely during
  the holiday season when site changes are unlikely.

How should I handle this for my own interfaces?
Let's say I'm building a proper extension that I distribute and I have a Data API interface similar to this one in the code.
But at one point I decide to improve (or fix) something in my extension.
How should I handle these 3 cases?

I need to add some methods to the interface. I assume I can simply add them because the old methods still exist. But what If someone is using my extension and is using his own implementation of my interface?
I need to remove some method.. I could follow the same guidelines as the core team does and mark it first as @deprecated then remove it in a future release. But not sure about this since I don't release major versions once a year because I'm not consistent.
I need to remove the interface completely - Could this mean I made a false promise and my new upgraded extension should a totally different extension?


texts: PDO MYSQL error after moving database from remote server to same server magento is on

texts:
I am having an issue where when I go to my Magento site I get a 500 error and looking at the servers error log I see the blow

Unable to load dynamic library '/usr/lib/php/20151012/pdo_mysql.so'

I am not sure how to fix this. Here is what I did prior to getting this error:

I originally had this magento 2.2.3 based website hosted on
  an apache2,php7.0 based AWS EC2 instance.
  I had the mysql database for . this magento site hosted on an AWS RDS
  instance

To lower my aws cost I decided to move the mysql onto the ec2 instance
  where I had my magento site hosted on. So I ran the command

sudo apt-get install mysql-server

After going through the steps to setup a database (adding a root
  password) I then imported the sql dump of the database into the website.

I then edited the env.php file to use localhost for the database host instead of the aws rds endpoint.

Lastly I cleared magento cache and in my browser went to my website to
  discover the 500 error.


texts: Onepage checkout: Already registered customer login redirects to create an account or login page

texts:
I have recently upgraded to 1.8.1 and am fairly new to magento. All other aspects of my site seems to be working just fine, however when a customer with an existing account adds item to the cart and goes to checkout, and then is presented with the one page section: ‘Already registered? Log in below:’ the login button redirects to the ‘Login or Create an Account’ page. Once logged in through there the customer can then go through the checkout process again and orders can be placed, but it is far more hassle than it needs to be!

Any help would be greatly appreciated!

N.B: Website is https://astuteclothing.co.uk


texts: Configurable Product - Disable and grey out out of stock

texts:
I've seen some posts about this but can't get to a conclusion.
In a configurable product with dropdown all option appears (in stock and out of stock), what I need is to disable the ones out of stock so the client can see they exist but cannot click them.
This because selecting and appearing below the price or adding to cart and then give the info that is out of stock does not sound good enough lacks visual information before you do a bunch of clicks makes lose time and we all know that customers don't like to lose time xD

So in summary, just need to disable all out of stock options and show something like "option name (out of stock)" in the dropdown.

Any good way to do this?

Thanks :D


texts:
I installed PWA studio and Magento 2.3 on my local environment. The installation finished without any errors.

I opened the browser to access the PWA page but all the product images are getting 404 error. And the button filter/sort on category page can't be clickable


texts: Magento2 : How can I add filters to frontend so it should work like a backend filter?

texts:
i'm working on adding custom filter for this custom module

  i want to add filters (Q_ID,Q_STATUS,Q_PRICE) it would work like back
  end filter Magento admin

how i add filter and any idea's??


texts:
so I've already set up a Magento site, it has been running for 1 month now. Now my question is is it still possible to get a performance boost now without losing any data. By that i mean can i upgrade from PHP5.6 -> PHP7 without losing anything or anything going wrong with the site, and can I install varnish with an already setup and running site ?

Thanks!


texts: How to Dispatch catalog_product_collection_load_after zero products in Magento 2.1?

texts:
I noticed that in Magento 2.1 the event catalog_product_collection_load_after is dispatched only when the collection has at least one product. How can I make Magento dispatch it also when the collection is empty?

UPDATE

I thought to dispatch catalog_product_collection_load_after event also when the collection is empty to make some changes to the layout only when the products count is zero, but I noticed that once the collection is loaded the layout has been already rendered, so it is not possible to make any further changes to the layout. This can be done in some other ways?

Thanks.!


texts: Magento 2: Where are the block classes stored?

texts:
I've enabled template hints and block hints. I get this template path /vendor/magento/module-customer/view/frontend/templates/account/dashboard/info.phtml which has this block class Magento\Customer\Block\Account\Dashboard\Info.

Where can I find the code for the block class?


texts: How to add "Allowed Countries" field in custom form

texts:
I need to create a custom module which allows admin to create Zones for different countries. I need to add 'allow country' field (just like in default magento System > Configuration > General > Countries Options) in my form where admin can select the countries for a zone.

I Just need to add a countries multi select field in my custom module admin form.

Can anyone help me how to do this. Thanks..


texts: Removing columns and adding columns in Invoice Admin Grid page

texts: I am looking to remove some columns including Order# and Invoice Date and add the column Payment Method to the page Invoice grid in admin. How does one go about this?


texts: Magento 1.9 small image resizing/compression issues

texts:
All my 'small images' in catalog view appear blurry/poor quality. I've tried various methods like 'setQuality' but nothing ever changes. I feel like I've ran into a brick wall with this.

When clicking into the product however the image is crisp and fine so I'm assuming it's a resize issue for small images/thumbnails and not an overall compression issue?.

For testing purposes to find a solution I'm working on a fresh/new install of Magento 1.9.4.2 with just 1 product using a default theme.


texts: How to set the custom price of product while add selected products for the order int he backend

texts: When I place the order from backend I want to set the custom price of the product while loading the product collection. And that custom price should pass further while click on the add selected product.


texts: Magento 2: How to move Product page Attributes Section from tabs to Bottom of page?

texts:
I saw a similar question for moving reviews tab.
but I want to move the attributes - additional.tab as well outside tabs.
I tried the same code like

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <!-- add this code -->
         <move element="additional.tab" destination="content" after="-"/>
    <!-- end -->
    </body>
</page>

but it's not having any effect.

though if I try reviews.tab it is getting duplicated at the end of page, without moving it.

I am using Magento 2.2.1

Thanks.


texts:
I have a question related to core_config_data. Need some magento experts to clarify this.

For eg:

I have paypal extension disabled by default. When you enable it from the admin interface it enables the extension and creates quite few settings in the core_config_data table.

I want to enable the paypal extension using a data script in a custom extension. I am using the following code to do so

    <?php
     $installer = $this;
     $installer->startSetup();
     $setup = new Mage_Core_Model_Config();
     $setup->saveConfig('payment/paypal_express/active', '1', 'default', 0);
     $installer->endSetup();
    ?>

But when I run this in new environment, it only saves the one setting (payment/paypal_express/active) in the core_config_data table. The rest of the settings are not in the core_config_data. How do I trigger the creation of the remaning settings through my extension.


texts: When try to use bin/magento setup:upgrade Getting Error

texts:
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\Framework\Setup\Declaration\Schema\Diff\SchemaDiff::diff()must be an instance of Magento\Framework\Setup\Declaration\Schema\Dto\Schema, null given, called in /var/www/html/magento/setup/src/Magento/Setup/Model/DeclarationInstaller.php on line 59 and defined in /var/www/html/magento/vendor/magento/framework/Setup/Declaration/Schema/Diff/SchemaDiff.php:90
Stack trace:
#0 /var/www/html/magento/setup/src/Magento/Setup/Model/DeclarationInstaller.php(59): Magento\Framework\Setup\Declaration\Schema\Diff\SchemaDiff->diff(NULL, Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#1 /var/www/html/magento/setup/src/Magento/Setup/Model/Installer.php(809): Magento\Setup\Model\DeclarationInstaller->installSchema(Array)
#2 /var/www/html/magento/setup/src/Magento/Setup/Model/Installer.php(831): Magento\Setup\Model\Installer->declarativeInstallSchema(Array)
#3 /var/www/html/magento/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php(122): Magento\Setup\Model\ in /var/www/html/magento/vendor/magento/framework/Setup/Declaration/Schema/Diff/SchemaDiff.php on line 90


texts: Magento 2 exclude products from catalog price rules

texts:
I'm facing this problem.

I have around 70 products in different categories and different attributes sets, but with the same common attribute (SKU).
I have 3 catalog price rules which applies different discounts. I want to exclude products by SKU from this discount rules. I have used this method and also Is not:

The problem with this method is that it's doing something weird, it excludes the specific sku from the discount succesfully, however other different products are being excluded from the discount rules too. The products that are being excluded are not from the same category or attribute set, I don't know if that is the cause.

I need to keep the discount to all products except for the ones that I will exclude on the discount rules.

Thanks!


texts: Overriding Shipping Charge without creating a new Order

texts:
There is an admin override for a shipping price available in Magento.

The issue is that in order to do this the order is duplicated and the information on shipping address and billing address doesn't translate over to the new order, so it is generally a pain.

Is there a way to provide the custom shipping rate on an order without having to "Edit" it and going through reduced order creation process?


texts: Magento 2.2 : Multiple Image Uploader In Ui Component Form

texts:
In Magento 2.2 the multiple product image up-loader block has been moved from layout to UI component form. To make it compatible with Magento-2.2 I made the required changes in my custom module and it worked for me. But, when I reinstalled the module on (Magento 2.1.8), it does not recognize the block and settings nodes, I got the following errors. Is it not backward compatible? What if we wish to run the same module on both Magento 2.2 and 2.1? Are there any module settings where we can change the format for different versions? How can we place a check or condition because in both version the block is placed at two different locations? How to get rid of these errors, any help would be appreciated.

  The requested component ("settings") is not found. Before using, you
  must add the implementation.

  The requested component ("block") is not found. Before using, you must
  add the implementation.

Here is my UI Form

<htmlContent name="gallery" sortOrder="22">
    <argument name="data" xsi:type="array">
        <item name="wrapper" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Gallery Images</item>
            <item name="collapsible" xsi:type="boolean">true</item>
            <item name="opened" xsi:type="boolean">false</item>
        </item>
    </argument>
    <settings>
        <wrapper>
            <canShow>true</canShow>
            <componentType>fieldset</componentType>
        </wrapper>
    </settings>
    <block name="gallery" class="Vendor\Module\Block\Adminhtml\Media\Helper\Form\Gallery">
        <block class="Vendor\Module\Block\Adminhtml\Media\Helper\Form\Gallery\Image" as="content">
            <arguments>
                <argument name="config" xsi:type="array">
                    <item name="parentComponent" xsi:type="string">events_event_form.events_event_form.block_gallery.block_gallery</item>
                </argument>
            </arguments>
        </block>
    </block>
</htmlContent>


texts: Magento 2.2.0 indexing update on scheduel is not working

texts: Magento 2.2.0 i have set index option update on scheduel. after i ran indexing command but it did not take effect.update on save working fine.


texts: Entering credit-card only once for phone orders (admin screen)

texts:
We like to take phone orders using the admin interface.

Unfortunately it can be a real pain because we have to re-enter the credit card information everytime the customer decides to change the order.  This happens frequently with phone sales.

Ideally, we would like to enter the payment information once, and only once, for an order.   Then, if the customer wants something different or changes their mind, we can just recalculate the total without re-entering the credit card.

The particular credit card gateway extension we are using says "that is just how Magento works" but the usability is terrible, and results in a poor customer experience.

Anyone figure out how to enter the credit card information only once for an order and be able to continue to


texts: Uncaught exception 'TypeError': ImageBuilder::setProduct() must be an instance of Magento\Catalog\Model\Product

texts:
I'm seeing the following error log in New Relic. This error logs very rarely, and comes from adding a product to the cart:

  TypeError: Uncaught exception 'TypeError' with message 'Argument 1 passed to Magento\Catalog\Block\Product\ImageBuilder::setProduct() must be an instance of Magento\Catalog\Model\Product, null given, called in /srv/public_html/vendor/author/name/Block/Confirm.php on line 417' in /srv/public_html/vendor/magento/module-catalog/Block/Product/ImageBuilder.php:55

I'm not sure why this error is logging, this is the block of code in question (Confirm.php, Lines 415 - 421):

 public function getImage($product, $imageId, $attributes = [])
 {
    return $this->imageBuilder->setProduct($product)
        ->setImageId($imageId)
        ->setAttributes($attributes)
        ->create();
 }

Does anyone see anything out of the ordinary here, that would cause such an error?

Cheers,
Max


texts: Magento2 Which table store category ascending order or descending order store category

texts:
My project category and sub category I have set ascending order or descending order store category via script or sql query.

Magento2 Which table store category & sub category ascending order or descending order store category.

Please help me.

Thank You


texts: Remove Stock Status if Price = 0 in Magento 2.3

texts: Is there a way to hide the Out Of Stock message for products with $0 as a price only? I realize that the saleable quantity can be hidden in Go to Stores > Configuration > Catalog > Inventory > Stock Options but I believe this needs to be done at the code level. I am not sure where to start.


texts: How can I display store currency instead of base currency in multiple website installation in Magento transactional emails?

texts:
I have a multiple website set up (USD and NRP, NPR being Nepalese Rupees).My client wants to display the store currency in  Grand Total instead of Base currency.The current display is as follows:

How can I achieve this in the simplest way possible?
Thanks in advance!


texts: API: How to add the prefix field to shipping and billing address?

texts:
On Magento 1.9, I need to add the field prefix to the shipping_address and billing_address nodes in the response of salesOrderInfo (soap-api-v2). I tried by adding the following:

  app/code/core/Mage/Sales/etc/wsi.xml:

<xsd:element name="prefix" type="xsd:string" minOccurs="0" /> (line 275)

  app/code/core/Mage/Sales/etc/wsdl.xml:

<element name="prefix" type="xsd:string" minOccurs="0" /> (line 274)

The prefix field contains a value (I can verify it with debug breakpoints in Mage_Sales_Model_Order_Api::info()) However, the SOAP response still does not contain the field. I even tried to set a ini_set("soap.wsdl_cache_enabled", 0); in the index.php to disable the wsdl cache, flushed the regular cache, restarted the Apache server, but with no success.

Does anybody have an idea how to make this work?


texts: setElementsRelation method in VarienForm

texts:
There's a setElementsRelation in VarienForm JS class. The idea of this method is quite interesting but all calls in template files are commented out.

Does anyone have any idea if it is just a sort of legacy, unfinished functionality or working code?

Same for this.elementFocus, this.elementBlur and this.highlightClass properties and elementOnFocus and elementOnBlur methods. They are just used to set a highlight class for <fieldset/> (!?) element of the form but it is not used anywhere.


texts: How to create a page that show all brands magento 2

texts:
I download module Ves_Brand ; i want to create a page that show all brands some ideas please! i know that i have to create a module and controller to show page but what i have to do inside that. Anyone can help i am a beginner in learning magento 2.
what is the difference between a simple page and a CMS page ? can anyone explain that to me ?
Thank You for all
Marki


texts: Product long description, additional info not showing for configurable product

texts:
Kindly help me out, I am not able to figure it out why the description tab nor additional info tab is showing for configurable product while it is working fine for simple product. I am using pagayo theme 003.

Thanking in advance.....


texts: Use transactional e-mail templates from local language package

texts:
How can I force Magento to use E-Mail templates from the local language package  in app/locale/.../template/email/ instead from the database?

I opened one template in the backend in System -> Transactional E-Mail and made some changes which already worked but the content was saved into database in the table core_email_template. I would like to modify the html file instead.


texts: I have a custom module with a grid. Now I need to add a multi-select filter in this grid, I am using XML code not UI code, how can I do this with XML code can anyone help this


texts: Magento 2.3 - LEMP Localhost - How to configure Nginx for Multi-Website store on Localhost (Centos 7)

texts:
Where is an error in my following steps for creating Multi Website Store ::
Steps :-

Main website Path : usr/share/nginx/html/giri

Contains all magento files
Configuration in nginx.conf.sample for Multi-Website
nginx.conf.sample ->  https://justpaste.it/97yki  (code)

Multi-Website Path : usr/share/nginx/html/giri/grocery

Created subfolder inside the root folder along with symbollice linksof app, lib, pub, var and copy index.php & .htaccess from root folder to subfolder

Inside the subfolder Symbolic Liks:

app,
lib,
pub,
var
index.php ->  https://justpaste.it/8a9r5  (code)
.htaccess ->  https://justpaste.it/1louh   (code)

Nginx Setup (Not sure right)

etc/nginx/con.d/magento.conf
https://justpaste.it/3xcn8 (code)

Site-Available setup (Not sure right)

etc/site-available/magento.txt
https://justpaste.it/1ozsu (code)

Url : http://192.168.1.64:8087/grocery (or) http://192.168.1.64:8087/gomart/grocery 404 error.


texts: Where can i see the the coupon code the customer entered when placing an order? And why doesn't lexware get the discount? When i'm getting the invoices, there is no coupon code or discount.


texts:
I´m having the issue that if I click "View all" products in my toolbar then what I get back is a category page with the limit of 3 products instead of all.

I have checked and I think I know where the issue is but I can´t resolve it.
If i set the pager to all (in total 500 products)

$_collectionSize = $_productCollection->getSize(); // returns 500
$_collectionSize = $_productCollection->count(); //returns 3

If I set the pager to 200

$_collectionSize = $_productCollection->getSize(); // returns 200
$_collectionSize = $_productCollection->count(); //returns 200

What could be the issue?

Update

I have

$_collectionSize = $_productCollection->count();
echo $_productCollection->getSelect()->__toString();

And for every numerical limit set in the frontend of the category page I get an SQL query back

SELECT `e`.*, `cat_index`.`position` AS `cat_index_position'.......
ORDER BY `publishingdate` desc LIMIT 6

Limit changes all the time depending on the Limit I set in the Pager Toolbar
but if I click on 'All' then I get this

ORDER BY `publishingdate` desc LIMIT 3

Update
I have not changed the function or anything for the limit, I just add the limits in the backend. So the function to set the limit etc. would be as usual

        <?php if($this->getLastPageNum()>1): ?>
            <?php echo $this->__('Books %s-%s of %s', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
        <?php else: ?>
            <?php echo $this->__('%s Book(s)', $this->getTotalNum()) ?>
        <?php endif; ?>

        <?php echo $this->__('Show') ?>
        <select onchange="setLocation(this.value)">
        <?php foreach ($this->getAvailableLimit() as  $_key=>$_limit): ?>
            <option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
                <?php echo $_limit ?>
            </option>
        <?php endforeach; ?>
        </select> <?php echo $this->__('per page') ?>

    <?php echo $this->getPagerHtml() ?>

And then the function

  protected function _getAvailableLimit($mode)
        {
            if (isset($this->_availableLimit[$mode])) {
                return $this->_availableLimit[$mode];
            }
            $perPageConfigKey = 'catalog/frontend/' . $mode . '_per_page_values';
            $perPageValues = (string)Mage::getStoreConfig($perPageConfigKey);
            $perPageValues = explode(',', $perPageValues);
            $perPageValues = array_combine($perPageValues, $perPageValues);
            if (Mage::getStoreConfigFlag('catalog/frontend/list_allow_all')) {
                return ($perPageValues + array('all'=>$this->__('All')));
            } else {
                return $perPageValues;
            }
        }


texts: Magento 2: Override Price Model with plugin

texts:
I need to override Price.php Model with plugin.
I've created PricePlugin inside Plugin folder.

<vendor>/<module>/Plugin/Product/View/Options/PricePlugin.php

PricePlugin.php :

<?php
namespace <vendor>\<module>\Plugin\Product\View\Options;

use \Magento\Catalog\Model\Config\Source\Product\Options\Price;

/**
 * Class AbstractOptions
 * @package <vendor>\<module>\Plugin\Product\View\Options
 */
class PricePlugin
{
    const VALUE_FIXED = 'fixed';
    const VALUE_PERCENT = 'percent';

    /**
     * @param Price $price
     * @return array
     */
    public function toOptionArray(Price $price)
    {
        return [
            ['value' => self::VALUE_FIXED, 'label' => __('Fixed')],
            ['value' => self::VALUE_FIXED, 'label' => __('Per Character')],
            ['value' => self::VALUE_PERCENT, 'label' => __('Percent')],
        ];
    }
}

di.xml

<type name="Magento\Catalog\Model\Config\Source\Product\Options\Price">
    <plugin name="VENDOR_MODULE_Model_Price" type="<Vendor>\<Module>\Plugin\Product\View\Options\PricePlugin" sortOrder="1" />
</type>


texts: Ajax form submit validation not working in magento2?

texts:
I'm trying to submit the form on ajax call. Before submit the form, I'm trying to validate it.

   $('#customerqa-form').on("click", "#customerqa-submit", function (event) {
                    event.preventDefault();
                   if ($("#customerqa-form").valid()) {
                        self.formSubmit();
                    }
                });

It's throws

  Uncaught TypeError: Cannot read property 'call' of undefined

error.

If anything I want to change it.

Thanks.


texts:
I am trying to get the customers Access Token while they are logged in to our Magento 2.1.8 site while using a custom module I am developing.

I have been following the official Magento 2 tutorials to do this and it says that to get the token I must send the user's username and password to the appropriate API endpoint. When the Access Token is required, the user is already signed in.

How do I get the logged in users Customers Access Token without using their Username and Password?

Magento 2 Tutorial:
http://devdocs.magento.com/guides/v2.1/get-started/order-tutorial/order-create-customer.html


texts: I have two stores English and Arabic. I am using SAR(Saudi Riyal) currency symbol. Right now the price is shown like SAR 1250 but for Arabic Store I want to translate SAR into ريـال and the price show like 699.00 ريـال.


texts: Adding a product attribute with values and mark one value as default

texts:
I know how I can add a product attribute from an installer script, but how do I tell Magento to use one of the values as default value? (or more values in case it's a multiselect attribute).
I use this code in an installer script to add an attribute with options:

$installer->addAttribute('catalog_product', "some_code_here", array(
    'type'       => 'int', //or varchar if it's multiselect
    'input'      => 'select', //or multiselect
    'label'      => 'Attribute label here',
    'sort_order' => 1000,
    'required'   => false,
    'global'     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'backend'    => 'eav/entity_attribute_backend_array',
    'option'     => array (
        'values' => array(
            0 => 'Value 1',
            1 => 'Value 2',
            2 => 'Value 3',
        )
    ),

));

So I need to make the Value 2 be the default value.  Or Value 2 and Value 3 in case I create a multiselect attribute


texts: Magento2 - Search synonyms doesn't work after changing search to AND from OR

texts:
I have changed the search AND and OR logic by following the link:
[How do I change Magento 2 search from OR logic to AND?
but now the search synonyms are not working.

If I add synonyms: read,rid
then searching read or rid comes up with no result.

Please help.!

How do I change Magento 2 search from OR logic to AND?


texts: Magento 2 - Configurable products not pairing with simple products?

texts:
When I import my .csv - with my simple and configurable products inside, the document is imported correctly with no validation errors. The issue I'm having is the configurable products aren't paired with their simple counterparts.

Overall, I have 2k configurable products, and 4k simple. One of my configurable products has been successfully paired with it's simple counterpart, out of 6000 products.

I've researched online, and have ensured the following:

Magento 2 Developer Mode enabled
All products are enabled
All products have a quantity above 0, and all are in stock
Reindex once products have been added
Magento multistore disabled
Pack size (Configurable product attribute) set to "global", "enabled at storefront", "Dropdown", "filterable (with results)", "visible at storefront", "used in product listing"
My CSV is formatted correctly, using "configurable_variations" to list the simple products which will be paired with the configurable product.


texts:
My intention is to create something close to rwd from 1.9 but I'm on 1.8.1 and it's difficult to update as there have been so many changes on this magento.
I've successfully added something from the minicart copying some text from mini_cart_top.phtml.

<?php

$prova = new Mage_Checkout_Block_Cart_Sidebar();
$_items = $prova->getRecentItems() ?>
    <?php if(count($_items)): ?>

<?php echo $prova->__('Producto(s) a&ntilde;adido(s)') ?>

                <?php foreach($_items as $_item): ?>
                    <?php echo $prova->getItemHtml($_item) ?>
                <?php endforeach; ?>

                    <?php echo $prova->__('Total + iva:') ?>
                    <?php if ($prova->canApplyMsrp()): ?>
                        <?php echo $prova->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?>
                    <?php else: ?>
                        <?php echo Mage::helper('checkout')->formatPrice($prova->getSubtotal()) ?>
                        <?php if ($_subtotalInclTax = $prova->getSubtotalInclTax()): ?>
                            <?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>
                        <?php endif; ?>
                    <?php endif; ?>

                <button type="button" title="<?php echo $prova->__('Ver presupuesto') ?>" class="button btn-view" onclick="window.location='<?php echo $prova->getUrl('checkout/cart')?>';"><?php echo $prova->__('Ver presupuesto') ?></button>
                <button type="button" title="<?php echo $prova->__('Solicitar presupuesto') ?>" class="button btn-checkout" onclick="window.location='<?php echo $prova->getUrl('checkout/onepage')?>';"><?php echo $prova->__('Solicitar presupuesto') ?></button>

    <?php else: ?>

<?php echo $prova->__('No hay ning&uacute;n art&iacute;culo seleccionado.') ?>

    <?php endif ?>

But <?php echo $prova->getItemHtml($_item) ?> gives me error:

  Fatal error: Call to a member function createBlock() on a non-object in C:\wamp\www\ravanetto\app\code\core\Mage\Checkout\Block\Cart\Abstract.php on line 107

Why am I missing?

Edit:
That's how I call it through xml.

<default>
    <reference name="header">
        <block type="core/template" name="rwdtopCart" as="rwdtopCart" template="rwdmenu/rwdtopcart.phtml"/>
    <reference/>
<default/>

And I add this somewhere in header.phtml.

    <?php echo $this->getChildHtml('rwdtopCart') ?>


texts: How to integrate Constant Contact in Magento 2.3?

texts:
I need to integrate Constant Contact in Magento 2.3.

Is there any free extension available for this ?


texts: How to make auto select first child product of configurable product in magento2?

texts:
I am trying to make auto select first child product from the configurable product in product detail page.

Is this possible?


texts: Getting Wrong Product URL on Product Listing Page

texts:
If a product has assigned in multiple categories.on product listing page, product
URL remains the same for each category.

e.g- Suppose a product "A" has assigned in category "B","C" & D where B,C,D already have parent category "view-all-category".

then whenever I visited the product "A" from all of these categories(B,C,D) each
time I'm getting a unique product URL.

Example:-

When visiting "A" from category "B" =>

This is right-> http://localhost/view-all-category/B/A.html

When visiting "A" from category "C" =>

Currently getting-> http://localhost/view-all-category/B/A.html

Expected URL:-  http://localhost/view-all-category/C/A.html

When visiting "A" from category "D" =>

Currently getting-> http://localhost/view-all-category/B/A.html

Expected URL:- http://localhost/view-all-category/D/A.html

Note:- I've migrated from Magento 1 to Magento 2 using Magento Data Migration Tool & also using a custom theme.

Waiting forward the response.


texts:
I am trying to override the Paypal Standard Model using the following files:

app/code/local/Me/Paypal/etc/Config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <me_paypal>
            <version>0.1</version>
        </me_paypal>
    </modules>
    <global>
       <models>
          <paypal>
              <rewrite>
                  <standard>Me_Paypal_Model_Standard</standard>
              </rewrite>
          </paypal>
       </models>
    </global>
</config>

app/code/local/Me/Paypal/Model/Standard.php

class Me_Paypal_Model_Standard extends Mage_Payment_Model_Method_Abstract{

        //my changed code here

}

The problem is that the changes I make to the Standard models code do not seem to be getting applied.  Have I missed something?


texts: Plugin for aroundSavePaymentInformationAndPlaceOrder Throwing Error

texts:
I have a plugin that i want to intercept aroundSavePaymentInformationAndPlaceOrder, but it is giving me an error. Here is how it is set up:

Vendor/Module/etc/di.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
      <virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid" type="Magento\Sales\Model\ResourceModel\Grid">
          <arguments>
              <argument name="columns">
                  <item name="veratad_action" xsi:type="string">sales_order.veratad_action</item>
              </argument>
          </arguments>
      </virtualType>
      <type name="Magento\Checkout\Model\GuestPaymentInformationManagement">
              <plugin name="veratad_ageverification_before_order" type="Veratad\AgeVerification\Plugin\Ageverification" sortOrder="10" disabled="false"/>
        </type>
    </config>

Vendor/Module/Plugin/Ageverification.php

    namespace Veratad\AgeVerification\Plugin;

    use Magento\Checkout\Model\PaymentInformationManagement as CheckoutPaymentInformationManagement;

    class Ageverification
    {

      public function aroundSavePaymentInformationAndPlaceOrder(CheckoutGuestPaymentInformationManagement $subject){

        return ($subject);

   }

}

I am getting the following error:

    PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Veratad\AgeVerification\Plugin\Ageverification::aroundSavePaymentInformationAndPlaceOrder() must be an instance of Veratad\AgeVerification\Plugin\CheckoutGuestPaymentInformationManagement, instance of Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor given, called in /home/z3hjb5ti7gx1/public_html/magento/vendor/magento/framework/Interception/Interceptor.php on line 135 and defined in /home/z3hjb5ti7gx1/public_html/magento/app/code/Veratad/AgeVerification/Plugin/Ageverification.php:10
    Stack trace:
    #0 /home/z3hjb5ti7gx1/public_html/magento/vendor/magento/framework/Interception/Interceptor.php(135): Veratad\AgeVerification\Plugin\Ageverification->aroundSavePaymentInformationAndPlaceOrder(Object(Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor), Object(Closure), 'f2c487019bcfd1b...', 'tcanfarotta2@v....', Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address))
    #1 /home/z3hjb5ti7gx1/public_html/magento/ve in /home/z3hjb5ti7gx1/public_html/magento/app/code/Veratad/AgeVerification/Plugin/Ageverification.php on line 10

Can someone help me understand what I am doing wrong?

New Plugin Code:

      namespace Veratad\AgeVerification\Plugin;

      use Magento\Framework\Exception\CouldNotSaveException;

      class Ageverification {

          public function aroundSavePaymentInformationAndPlaceOrder(
          \Magento\Checkout\Model\PaymentInformationManagement $subject,
          callable $proceed,
          \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
          \Magento\Quote\Api\Data\AddressInterface $billingAddress = null) {
              $action = "FAIL";
              if($action == "FAIL"){
                      throw new CouldNotSaveException(__('You have not been age verified.'));
                      return false;
              }else{
                  $proceed($paymentMethod,$billingAddress);
          }
      }
    }


texts: how to add shipping cost calculator on Delivery and returns page in magento 2?

texts: i would like to show the shipping costs for selected country on the cms page. Does anybody know an extension or solution therefore?


texts: Nested email template variables - var order.increment_id not working

texts:
I've created a link that should look like this:

www.mystore.com/yourorder?order_id=12345678&email=youremail@example.com

The user will be taken to an order tracking page.

But the url ends up looking like this:

http://www.mystore.com/yourorder?order_id=%7b%7bvar%20order.increment_id/&email=youremail%40hotmail.com%27%7d%7d

The template code looks like this:

here

The {{var order.increment_id}} is getting mangled there, but works fine in the email subject and elsewhere in the body. But the email address is turning out sort of ok (except for those trailing strange characters).

I had double quotes around the url value at first and thought single quotes inside might help with parsing, but single quotes made no difference.

Solution:

Fixed unnecessary nesting of variables. (Thanks to Peter O'Callaghan's answer)
Changed {{store url='yourorder'}} to {{config path='web/secure/base_url'}}. Otherwise, http redirected to https and (for some reason) lost the url parameters I was trying to pass.

here


texts:
My crons are not working on my magento2.3 site.
What can be the issue? I tried installing a new cron also, still, the same issue exists. I want to enable the cron for index management. The indexing is kept as Update on schedule". If I run php bin/magento cron:run command I am getting this error https://prnt.sc/olyag4


texts: How to remove city filed from checkout page magento 2?

texts:
I want to remove city field from the shipping and billing form on the checkout page. I have checked in checkout_index_index.xml in my theme or vendor but I didn't find the city field.

Give me suggestion to remove City field.


texts: escapeshellarg() has been disabled - cronjob - Magento 2

texts:
I get this error after installing Magento 2 and enabling the cronjob.
The error appears in the email/logfile of the following cronjob:

/usr/local/bin/php -f /home/craftweb/domains/craftseurope.eu/public_html/bin/magento cron:run

*[Exception]
  Warning: escapeshellarg() has been disabled for security reasons in /home/craftweb/domains/craftseurope.eu/public_html/vendor/magento/framework/Shell/CommandRenderer.php on line 19

cron:run [--group="..."] [--bootstrap="..."]*

Can I deny this one or is there a fix? I don't know if it now works correctly.
Maybe someone can give me those insights.


texts: Varian File Uplaoder in loop not working

texts:
I am trying to upload multiple files in a loop using Varien_File_Uploader

for($i=0;$i<count;$i++){
 $uploader = new Varien_File_Uploader(
        array(
    'name' => $_FILES['my_image_'.$i]['name'][$key],
    'type' => $_FILES['my_image_'.$i]['type'][$key],
    'tmp_name' => $_FILES['my_image_'.$i]['tmp_name'][$key],
    'error' => $_FILES['my_image_'.$i]['error'][$key],
    'size' => $_FILES['my_image_'.$i]['size'][$key]
        )
  );
}

My first file uplaoding successfully but in loop for second one i am getting error as "File was not uploaded"

I find out that this error comes when tmp_name is not set.

I checked out it's correct. For the first entry tmp_name is set but not for second entry.

I am not getting why tmp_name is setting only for the first one & not for others.
Anyone can please help.


texts: "Invalid template file" error in Magento 2 with a custom module

texts:
I'm having issues with Magento 2 missing out my header and footer, which are custom modules setup in my custom theme. They display correctly locally, on a MAMP set-up. However, on my staging server, I get the following error:
Invalid template file: 'magicheader.phtml' in module: 'MagicPack_Magicheader' block's name: 'MagicPack_magicheader'

This is coming from my default.xml file:
<block class="MagicPack\Magicheader\Block\Magicheader" name="MagicPack_magicheader" template="magicheader.phtml">

And my class is declared in:
app/code/MagicPack/Magicheader/Block/Magicheader.php

Where I declare it as:
<?php
namespace MagicPack\Magicheader\Block;

class Magicheader extends \Magento\Framework\View\Element\Template
{
    public function _prepareLayout()
    {
        return parent::_prepareLayout();
    }
}

The file itself is in:
app/code/MagicPack/Magicheader/View/frontend/templates/magicheader.phtml

I'm going a little crosseyed trying to work out why this is deemed invalid on the server and not locally. We're running 5.6 on both environments. Any assistance will be greatly appreciated.
Let me know if more info is needed.
Edited based on suggestions to map the correct cases to class names.
Could someone confirm my naming conventions are correct here?


texts: How to link between two categories in different root catalog?

texts:
I'm a newbie to Magento.

I've 2 root categories and sub-categories as follow.

Root Catalog Site1
- Sub-category 1.1
- Sub-category 1.2
- Sub-category 1.3
- Featured

Root Catalog Site 2
- Sub-category 2.1
- Sub-category 2.2
- Sub-category 2.3

I created 2 sites as mainstore.example.com and store2.example.com
I created some products for each of categories. When I create some products of Sub-category 2.1, 2.2 and 2.3, I'll marke as featured products at Featured category of Root Catalog Site1.

And I want to display same Featured products at every stores of the example.com.

How can I link between two categories in different root catalog?


texts: How to convert custom queries to magento query structures

texts:
How can I use custom queries.I have a query for my custom module

 $query = "SELECT  * FROM  `XYZ_Productrequest` WHERE  product_sku = '$psku' and email = '$email' ";

I want to customize it as per the magento guideines.Help!


texts: Configure Magento 2.3.5 on second dev machine after installation

texts:
My issue is that I work on two machines (laptop & desktop), I installed Magento 2.3.5-p1 successfully on the laptop and pushed my code to git repository. Now on the desktop if I just pull the same repository and use the same database, and if I run the project in the browser, it runs the Magento installation setup again.

I think its because lots of files e.g /app/etc/env.php
and some other setup/configuration files are in .gitignore in the Magento code already.
I just wanna be able to work from two machines on the same project where I would share code using git and occasionally will share the database (manually) too if I make major changes.
What am i doing worng ?
Please Helps me.


texts:
We have problems regarding our meta titles on our Magento multi store.

Website: goo.gl/9W9hjQ

The multi store is running on one platform for both language.

We started the languages in sub-categories as following:

.com/en/

.com/da/

But we decided to change it for TLDs, so our 2 language is now running on following TLDs (3-4 months ago):

.co.uk

.dk

We have 301 redirected the old .com domain 1to1 to the .dk domain.

The meta titles is changed on the .dk domain as you can see in the browser. But Google is using the old meta titles from the .com domain.

Google is sometimes switching between the old and the new meta title in the SERP. The old meta titles is active 90% of time in the SERP. We are not able to see any problems with dmoz etc..

So is Google simply just confused, because of the .com redirect and will Google solve it over time?

Or is it a CMS/ Magento configuration?


texts: Get Attribute Customer in Magento2 with GraphQL

texts:
I created new attributes for customer but I want to insert them into a structure in graphql.
Where there is an array called Garage with the new attributes.
It is already being displayed normally in the structure when I use static data but now I need to make it dynamic through the database according to the customer id.
Seeing a model of the customer himself I saw that a command is executed to bring but I would like to bring item by item and put it in the array.
CustomerGarage.php
    <?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace ObjectEdge\GraphQL\Model\Resolver;

use Magento\CustomerGraphQl\Model\Customer\GetCustomer;
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\CustomerGraphQl\Model\Customer\ExtractCustomerData;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\GraphQl\Model\Query\ContextInterface;

/**
 * Customers field resolver, used for GraphQL request processing.
 */
class CustomerGarage implements ResolverInterface
{
    /**
     * @var GetCustomer
     */
    private $getCustomer;

    /**
     * @var ExtractCustomerData
     */
    private $extractCustomerData;

    /**
     * @param GetCustomer $getCustomer
     * @param ExtractCustomerData $extractCustomerData
     */
    public function __construct(
        GetCustomer $getCustomer,
        ExtractCustomerData $extractCustomerData
    ) {
        $this->getCustomer = $getCustomer;
        $this->extractCustomerData = $extractCustomerData;
    }

    /**
     * @inheritdoc
     */
    public function resolve(
        Field $field,
        $context,
        ResolveInfo $info,
        array $value = null,
        array $args = null
    ) {
        /** @var ContextInterface $context */
        if (false === $context->getExtensionAttributes()->getIsCustomer()) {
            throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
        }

        $customer = $this->getCustomer->execute($context);

        $model[] = array(
            "make" => "Teste",
            "model" => $this->extractCustomerData->execute($customer),
            "specification" => "1.0",
            "year" => 2020,
            "isDefault" => "Teste"
        );

        return $model;
    }
}

Schema.graphql
type Customer {
    garage: [CustomerGarage] @doc(description: "An array containing the customer's shipping and billing addresses") @resolver(class: "ObjectEdge\\GraphQL\\Model\\Resolver\\CustomerGarage")
}

type CustomerGarage {
    make: String @doc(description: "The customer's ZIP or postal code")
    model: String @doc(description: "The customer's ZIP or postal code")
    specification: String @doc(description: "The customer's ZIP or postal code")
    year: Int
    isDefault: String @doc(description: "The customer's ZIP or postal code")
}
type Cart {
    vehicle: String
    isPickup: Boolean
    scheduledDate: String
}

requireGraphQL
{
  customer {
    firstname
    lastname
    garage{
      make
      model
    }
  }

ResponseGraphQL
{
  "errors": [
    {
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 5,
          "column": 5
        }
      ],
      "path": [
        "customer",
        "garage"
      ]
    }
  ],
  "data": {
    "customer": {
      "firstname": "Carlo",
      "lastname": "Sanchez",
      "garage": null
    }
  }
}
    }


texts: How to load category products in batches? Enable "Allow All Products per Page" without compromising performance

texts:
TLTR: How to load category products in batches?
I want to show ALL products for a category and remove the pagination. However, that poses a huge performance concern that I need to address.
Let's assume that a category has 96 products. I would like to load first 24 products (at this point the site would become usable and customer can start interacting with the store), then load another batch of 24 products in the background (customer won't even realise that the page is still loading products in the background), then load another batch and so on until all the products in the category are loaded. The next batch of products should start loading as soon as the previous one has completed loading.
This is something similar to a LazyLoad approach, however, the pagination is completely removed, customer doesn't have to scroll down to the bottom to load more products (or trigger anything on scroll) and there would be no pages added to the URLs (as "Allow All Products per Page" would be enabled in the admin and enforced on all category pages).
To conclude:

Load 24 products -- Customer is able to interact with the store at this stage
Load next batch of 24 products -- Happens automatically as soon as the first batch is loaded
Load the next batch of 24 products -- Again, start loading as soon as the previous batch is loaded
Load the last batch

If there is an extension available to facilitate this functionality, please do not hesitate to share.


texts: Magento 2: How to Set custom product attribute value on product save

texts:
i have created an observer, event on before product save to set custom product attribute value, here is my code.

etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_save_before">
        <observer name="product_save_before" instance="Learning\HelloPage\Observer\Productsavebefore" />
    </event>
</config>

Learning/HelloPage/Observer/Productsavebefore.php

<?php

namespace Learning\HelloPage\Observer;

use Magento\Framework\Event\ObserverInterface;

class Productsavebefore implements ObserverInterface
{
    protected $authSession;

    public function execute(\Magento\Framework\Event\Observer $observer,
        \Magento\Backend\Model\Auth\Session $authSession)
    {
        $this->authSession = $authSession;
        $admin_user_id = $this->authSession->getUser()->getId();

        $_product = $observer->getProduct();  // get product object
        //set the the attribute vale
        $_product->setAttribute(admin_user_id, $admin_user_id) ?? what to do here?
    }
}


texts: How to use SSA256 hashing algorithm by default instead of Argon2ID13 in Magento 2.3.x?

texts:
From the official docs

Magento supports multiple algorithms like MD5, SHA256, or Argon 2ID13.
If the Sodium extension is installed (installed by default in PHP
7.3), then Argon 2ID13 will be chosen as the default hashing algorithm. Otherwise, SHA256 will be as default. Magento can use the
native PHP password_hash function with Argon 2i algorithm support.

I found this class Magento\Framework\Encryption\Encryptor is responsible for generating passwords. Without rewriting this class, Is there any setting/configuration or workaround where I can use SHA256 always?


texts: Why getSize() function is not working when apply filter

texts:
I want to get count after the collection filter by attributes.Actually i want filter order collections by non canceled ,non fraud' and use getSize() function to get count but it is given count result as  when any filters not applied.

Please suggest what i do in this caseto get proper result of count.I have order 630  and when i use count() function on collection filter it give proper result.

$orderCollection = Mage::getModel('sales/order')->getCollection();

echo $orderCollection->getSize().'---'; // Result 630
                //$orderCollection->addFieldToFilter('customer_id',$customer->getId());
$orderCollection->addFieldToFilter('state', array('nin' => array('pending_payment', 'canceled', 'fraud', 'payment_review', 'pending', 'pending_paypal', 'closed')));

echo $orderCollection->size(); // result give 630

echo $orderCollection->count(); // given 305  proper result.

I guess that  may load() function is working for getCount() that why it is ok.
 I have check the link Difference between getSize() and count() on collection

My question, is  my concept is right?


texts: AddAttribute set default date as current date

texts:
$installer->addAttribute("customer", "creation_date",  array(
  "type"          => "varchar",
  "backend"       => "eav/entity_attribute_backend_array",
  "label"         => "",
  "input"         => "date",
  "source"        => "module/attribute_source_customerproducts",
  "visible"       => false,
  "required"      => false,
  "default"       => "",
  "frontend"      => "",
  "unique"        => false,
  "note"          => ""
));

How can I set the default date to the current date? if I would set it in the "default" it would always be the date when the attribute was created.


texts: How to get customer address as they sign up

texts: Is there any way to add the address form to the registration form or any free addon to add an extra field to the registration form so that I can get the customer location as they sign up?


texts: Default to 100 orders in sales order admin page

texts:
Could someone help me with this,

I need to change the default number orders being showed in the Admin panel/Sales/Order view page. Currently it starts from 20 per page. I want to maintain that but still by default load the page by 100 orders.

I found the code for this view in app/design/adminhtml/default/template/widget/grid.phtml

   <?php echo $this->__('of %s pages', $this->getCollection()->getLastPageNumber()) ?>
                        |
                        <?php echo $this->__('View') ?>
                        <select name="<?php echo $this->getVarNameLimit() ?>" onchange="<?php echo $this->getJsObjectName() ?>.loadByElement(this)">
                            <option value="20"<?php if($this->getCollection()->getPageSize()==20): ?> selected="selected"<?php endif; ?>>20</option>
                            <option value="30"<?php if($this->getCollection()->getPageSize()==30): ?> selected="selected"<?php endif; ?>>30</option>
                            <option value="50"<?php if($this->getCollection()->getPageSize()==50): ?> selected="selected"<?php endif; ?>>50</option>
                            <option value="100" selected<?php if($this->getCollection()->getPageSize()==100): ?> selected="selected"<?php endif; ?>>100</option>
                            <option value="200"<?php if($this->getCollection()->getPageSize()==200): ?> selected="selected"<?php endif; ?>>200</option>
                        </select>
                        <?php echo $this->__('per page') ?>|

  <?php echo $this->__('Total %d records found', $this->getCollection()->getSize()) ?>

I do not want to change the core grid.phtml. How can I do it.

Thanks


texts: Load a model with not autoincremental id

texts:
I have created a model that uses unique string as ID field, no issue for saving it after setting  protected  $_isPkAutoIncrement = false; in Mysql4 resource however I'm facing an issue when I try to load it:

->load('mystrinid') return me this error:

Invalid method MY_MODULE_Model_Mymodel::load(Array
(
    [0] => mystrinid
)

UPDATE:

this is working


texts: update the database query with ON DUPLICATE KEY UPDATE

texts:
i am following this link :

Find entity_id & attribute_id of an attribute

I used this sql query :

INSERT INTO catalog_product_entity_varchar ( entity_type_id, attribute_id, store_id, entity_id, value)
SELECT 10, 1021, 1, entity_id, value
FROM catalog_product_entity_int
WHERE attribute_id = 1021;

but i got error in the image :

@Marius suggested to use "ON DUPLICATE KEY UPDATE" . I have no idea about this. when i googled it, i got some solution, but that did't worked.

please give me the updated query using ON DUPLICATE KEY UPDATE


texts:
How do you hide a default magento 2 config section in the backend (Admin Panel)? For example I want to hide the "Mail Sending Settings" section located in Stores->Configuration->Advanced->System

This is what I tried so far but it's not working:

composer.json

{
"name": "vendor/module_name",
"description": "SMTP Extension for Magento 2 to help the configuration of the SMTP (Simple Mail Transfer Protocol) server.",
"type": "magento2-module",
"version": "1.0.0",
"require": {
    "php": "~5.6.5|7.0.2|7.0.4|~7.0.6",
    "magento/framework": "100.1.*",
    "magento/magento-config": "100.1.*"
},
"license": [
    "proprietary"
],
"minimum-stability": "stable",
"autoload": {
    "psr-4": {
        "Vendor\\Module_Name\\": ""
    },
    "files": [
        "registration.php"
        ]
    }
}

registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'vendor_module_name',
    __DIR__
);

etc/system.xml

<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="system">
            <group id="smtp" showInDefault="0" showInWebsite="0" showInStore="0">
            </group>
        </section>
    </system>
</config>

etc/module.xml

<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="vendor_module_name" setup_version="1.0.0">
    </module>
</config>

PS: My cache is disabled and my Magento 2 installation is in developer mode.


texts: Guest user showing in customer list Magento 1.9

texts:
In Magento 1.9, i checkout as a guest and after place order that guest user is logged-in. Also have entry in admin customer list.
Please anybody can tell me how can i solve this.
Thank you


texts: Save input fileds data in magento 2 custom table

texts: I have to make one form and save input data in a custom table


texts: Automatically redirect to a store view based on the browser language ERROR

texts:
I'm trying to automatically redirect people to a store view based on their browser language.

Situation: 5 store views (en, de, it, fr, nl) Magento 1.9.1

I used this piece of code in index.php:

require_once 'app/Mage.php';
/* Determine correct language store based on browser */
function getStoreForLanguage()
{
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
    foreach (explode(",", strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])) as $accept) {
        if (preg_match("!([a-z-]+)(;q=([0-9.]+))?!", trim($accept), $found)) {
            $langs[] = $found[1];
            $quality[] = (isset($found[3]) ? (float) $found[3] : 1.0);
        }
    }
    // Order the codes by quality
    array_multisort($quality, SORT_NUMERIC, SORT_DESC, $langs);
    // get list of stores and use the store code for the key
    $stores = Mage::app()->getStores(false, true);
    // iterate through languages found in the accept-language header
    foreach ($langs as $lang) {
        $lang = substr($lang,0,2);
        if (isset($stores[$lang]) && $stores[$lang]->getIsActive()) return $stores[$lang];
    }
}
return Mage::app()->getStore();
}
/* Auto redirect to language store view if request is for root */
if ($_SERVER['REQUEST_URI'] === '/') {
    header('Location: '.getStoreForLanguage()->getBaseUrl());
    exit;
}

#Varien_Profiler::enable();

#Mage::setIsDeveloperMode(true);

#ini_set('display_errors', 1);

umask(0);
Mage::run();

It seems like the browser wants to redirect because if i type in: domain.com it goes for a second to domain.com/nl but after a second an error appears:

"There has been an error processing your request. Exception printing is disabled by default for security reasons."

If i look at the error in the log file i see this:

a:4:{i:0;s:53:"Mage registry key "application_params" already exists";i:1;s:349:"#0 /var/www/webroot/ROOT/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /var/www/webroot/ROOT/app/code/core/Mage/Core/Model/App.php(338): Mage::register('application_par...', Array)
#2 /var/www/webroot/ROOT/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#3 /var/www/webroot/ROOT/index.php(129): Mage::run('', 'store')
#4 {main}";s:3:"url";s:4:"/nl/";s:11:"script_name";s:10:"/index.php";}


texts:
User redirected to homepage after deleting a product in "view cart". When I add the item to cart it remains in same page, but when I remove the item from cart it redirects to home page. How to fix this issue?
My remove function look like below:

     public function removeAction()

     {

    $cart   = $this->_getCart();

    $params = $this->getRequest()->getParams();

    try {
        if (isset($params['qty'])) {
            $filter = new Zend_Filter_LocalizedToNormalized(
                array('locale' => Mage::app()->getLocale()->getLocaleCode())
            );
            $params['qty'] = $filter->filter($params['qty']);
        }

        $product = $this->_initProduct();
        $related = $this->getRequest()->getParam('related_product');

        /**
         * Check product availability
         */

        $id = (int) $this->getRequest()->getParam('id');

        $items = $cart->getItems();
        foreach ($items as $item) {
            if ($item->getProduct()->getId() == $id) {
            if( $item->getQty() == 1 ){
                $cart->removeItem($item->getItemId())->save();
            }
            else if($item->getQty() > 1){
                $item->setQty($item->getQty() - 1);
                $cart->save();
            }
            break;
            }
        }

        $this->_getSession()->setCartWasUpdated(true);

        /**
         * @todo remove wishlist observer processAddToCart
         */
        Mage::dispatchEvent('checkout_cart_add_product_complete',
            array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
        );

        if (!$this->_getSession()->getNoCartRedirect(true)) {
            if (!$cart->getQuote()->getHasError()){
                //$message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
                //$this->_getSession()->addSuccess($message);
            }
           $this->_goBack();
        }
    } catch (Mage_Core_Exception $e) {
        if ($this->_getSession()->getUseNotice(true)) {
            $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage()));
        } else {
            $messages = array_unique(explode("\n", $e->getMessage()));
            foreach ($messages as $message) {
                $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message));
            }
        }

        $url = $this->_getSession()->getRedirectUrl(true);
        if ($url) {
            $this->getResponse()->setRedirect($url);
        } else {
            $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());
        }
    } catch (Exception $e) {
        $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
        Mage::logException($e);
        $this->_goBack();
    }
}


texts: How to get Top 5 ordered products details of specific Categories in Magento 2

texts:
I want to get Top 5 ordered products details of specific Categories in Magento 2. How Can I do that?

Here is My Code:

$cateinstance = $objectManager->create('Magento\Catalog\Model\CategoryFactory');
$cateid = 3;
$productCount=5;
$storeId =1;

$allcategoryproduct = $cateinstance->create()->load($cateid)->getProductCollection()->addAttributeToSelect('*')
->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
->setOrder('ordered_qty', 'desc')
->setPageSize($productCount)->setStoreId($storeId)->addStoreFilter($storeId);
$allcategoryproduct_count=$allcategoryproduct->getSize();
$allcategoryproduct_data=$allcategoryproduct->getData();

Here I'm Getting lot of information about products. But I want only the Product IDs in a array.


texts: Need to change pdf name as invoice_00000 in magento 2

texts: I need to change name of the file generated from admin for PDF generated with ID of invoice.


texts: Can bundled products be put in an order through the admin

texts: I have bundled products with dynamic skus and would like to be able to add them to orders through the admin. The bundled base products do not show when using the Add Product search. Is this possible on a newer version or should it be possible on CE 1.4.


texts: Custom sort order for loaded collection?

texts:
I have a product collection created by Magento for the category product list.

I then pass some information about this collection to an external method that returns the entity IDs in a specific sort order.

Now I'd like to re-order the product collection according to the order of the entity IDs, which is completely random and does not follow any conceivable logic.

What would the best approach be?


texts:
How to give condition in xml file for showing different block in different pages. Like I place a block name "Footer Block" in default xml file, and I want different footer for different pages.

    <referenceContainer name="footer">
        <block class="Magento\Cms\Block\Block" name="footer_links_block">
            <arguments>
                <argument name="block_id" xsi:type="string">footer_links_block</argument>
            </arguments>
        </block>
    </referenceContainer>

I want this that this footer only will show in home page and I want to different footer block for other pages. How I can do it in Magento 2.2.5

Thank You


texts:
Is thery any way to join other tables to SearchCriteriaInterface, while building it, before calling any getList method of any repository? I mean it should work more or less like joining tables on collections. I haven't found anything like this so far.

Joining fields on search result when its implemented by collection is not a way to go, of course.


texts: Magento 2: Can I response with a redirect on REST API?

texts:
I have an API endpoint that expects a GET request.
On some scenarios, I want to be able to perform a redirect instead of responding with a result.

e.g., If you'll open the API endpoint URL in a browser, you'll be redirected to a specific page.

I KNOW that I can use a controller for that instead of REST API, but this is the current situation & I need to solve it without changing the endpoint URL.
I tried to use Magento\Framework\Controller\ResultFactory & return a TYPE_REDIRECT response from the API method, but it just returns an empty array & not redirecting.

Any idea?


texts: Magento 2 Add a block to a layout programatically?

texts:
public function __construct(
    Context $context,
    array $data = []
) {
    parent::__construct($context, $data);
    $block  =  $this->getLayout()
        ->createBlock('Magento\Framework\View\Element\Template')
        ->setTemplate('MyWidgets_ProductTile::widget/test.phtml');

    $this->getLayout()->addBlock($block, 'popup', 'popup.container');
}

This is my default.xml file

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <move element="header.switchers" destination="footer.panel.container" after="-"/>
    <!-- add new popup container-->
    <referenceContainer name="page.wrapper">
        <container name="popup.container" as="popup_container" label="PopupContainer" htmlTag="div" htmlClass="popup-container" before="main.content"/>
    </referenceContainer>
</page>

I get the following error:

Failed to filter the template: elements with an ID of "popup" are already defined


texts: How to verify patches installed properly on Magento locally

texts: I have upgraded my magento site from 1.7 to 1.9.2.On Magento site this version shows have patches included ( Includes patches: SUPEE-5344, SUPEE-5994, SUPEE-6237, SUPEE-6285, SUPEE-6482, SUPEE-6788 ).I have done this work on local machine.I am trying to know that how can i verify that it have these patches  as i can see the message on admin side.I check the app/etc but didn't find any patches list file there.Can anyone suggest how can i know that its have these patches .I also install Philwinklw_Appliedpatches module but that did't show anything on admin side.


texts: Magento 2 api rest update product per store id. Ot working

texts:
I did all the changes that user Emizen-tech https://stackoverflow.com/users/6333615/emizen-tech recomend:

https://stackoverflow.com/questions/37744874/magento2-rest-api-save-product-detail-per-store-view-not-working

but when I send my PUT request for changing a price it does not work:

http://www.myshop.com/index.php/rest/V1/products/mysku/storeID=0

The result is:

{ "message": "Invalid product data: %1" "parameters": [1]

    0: "Invalid attribute set entity type"

}

The issue is how I pass the parameter Store Id in the URL.
How can I separate the sku from the parameter Store Id??


texts: json_decode is not working properly in magento 2.4.0

texts:
I am trying to decode the JSON in normal string and print that in the info log in Magento 2.4.0 but I am getting nothing in the info log. Adding the code below anyone please suggest a solution for this.
Code I am using
public function execute()
{
    $result = $this->resultJsonFactory->create();
    $isSuccess = $this->tracking->createApi();
    $jsonresponse = json_decode($isSuccess); // decoding here
    $this->logger->info(var_dump($jsonresponse)); // trying to print in info log
    return $result->setData(['success' => $isSuccess]);
}

$isSuccess - this variable has the below JSON data
Coveolog.INFO: {"sourceType":"PUSH","id":"dsspartnersorggrc3y48w-uk7awlmkozpufpe6pwaeoycmpy","name":"DSS-Coveo_M2-Integration-B2C-product-en_US","sourceVisibility":"SHARED","customParameters":{},"information":{"sourceStatus":{"type":"CREATING","timestamp":1617776580670,"allowedOperations":["DELETE"]},"numberOfDocuments":0,"documentsTotalSize":0},"pushEnabled":true,"onPremisesEnabled":false,"streamEnabled":false,"logicalIndex":"default","preConversionExtensions":[],"postConversionExtensions":[],"permissions":{"permissionLevels":[{"name":"Source Specified Permissions","permissionSets":[{"name":"Shared","permissions":[{"allowed":true,"identityType":"GROUP","identity":"@","securityProvider":"Email Security Provider"}]}]}]},"urlFilters":[{"filter":"*","includeFilter":true,"filterType":"WILDCARD"}],"ocrFileTypes":[],"resourceId":"dsspartnersorggrc3y48w-uk7awlmkozpufpe6pwaeoycmpy"} [] []


texts: Magento 2.1.2 : how to trigger UI Component onUpdate() on load

texts:
I currently have a UI Component (which extends the default select-component), and I want to do something when the select changes it's value. So I use the onUpdate()-method to hook into this:

define([
  'underscore',
  'Magento_Ui/js/form/element/select'
], function (_, SelectComponent) {
  "use strict";

  /**
   * Manipulate the default select component
   */
  return SelectComponent.extend({
    /**
     * Method fired when a different option is picked
     */
    onUpdate: function () {
      this._super();

      // do stuff here

      }
    }
  });
});

Now, when creating new entities the onUpdate() is triggered. When I change values the onUpdate() is triggered. But as soon as I have an already existing entity the onUpdate()-method is not triggered on page load.

Anyone knows what might be causing this?


texts: On the products view page, some content of details are displaying on the top bar below body

texts:
After installing magento 2.0.4, I have migrated my data from old to new version. But when I view product a small amount of text is appearing at the top of the page. This is not on every product page on few it is showing like that. I checked on the product page from back end everything is proper. I am not getting why is it like that can anyone help me in this.
thank you.


texts: Update shipping address programmatically in magento 2?

texts:
Basically the store have 4 currency and when user change currency the default shipping country should be updated.
Example

USD - shipping country USA
GBP - shipping country UK
EUR - shipping country Ireland
INR - shipping country India

how can i programmatically update shipping country in user quote.


texts: Integrity constraint error referring to quote_item table while adding product to cart

texts:
I am getting the following error while trying to add product to cart in Magento 2.2.3.

  [2018-05-02 09:52:43] report.CRITICAL: SQLSTATE[23000]: Integrity
  constraint violation: 1452 Cannot add or update a child row: a foreign
  key constraint fails (magento2.quote_item, CONSTRAINT
  QUOTE_ITEM_QUOTE_ID_QUOTE_ENTITY_ID FOREIGN KEY (quote_id)
  REFERENCES quote (entity_id) ON DELETE CASCADE), query was: INSERT
  INTO quote_item (product_id, store_id, is_virtual, sku,
  name, is_qty_decimal, weight, qty, product_type,
  base_cost, subscription_frequency) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
  ?, ?, ?) {"exception":"[object] (Zend_Db_Statement_Exception(code:
  23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot
  add or update a child row: a foreign key constraint fails
  (magento2.quote_item, CONSTRAINT
  QUOTE_ITEM_QUOTE_ID_QUOTE_ENTITY_ID FOREIGN KEY (quote_id)
  REFERENCES quote (entity_id) ON DELETE CASCADE), query was: INSERT
  INTO quote_item (product_id, store_id, is_virtual, sku,
  name, is_qty_decimal, weight, qty, product_type,
  base_cost, subscription_frequency) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
  ?, ?, ?) at
  C:\xampp\htdocs\mage2\vendor\magento\zendframework1\library\Zend\Db\Statement\Pdo.php:235,
  PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint
  violation: 1452 Cannot add or update a child row: a foreign key
  constraint fails (magento2.quote_item, CONSTRAINT
  QUOTE_ITEM_QUOTE_ID_QUOTE_ENTITY_ID FOREIGN KEY (quote_id)
  REFERENCES quote (entity_id) ON DELETE CASCADE) at
  C:\xampp\htdocs\mage2\vendor\magento\zendframework1\library\Zend\Db\Statement\Pdo.php:228)"}
  []

I have added a custom column in quote_item table. Not sure if this is the issue. Kindly help resolve it. TIA

EDIT:

I'm updating my custom using event - checkout_cart_product_add_after . Below is my observer update code.

<?php

namespace Addon\Recur\Observer;
use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;

class CheckoutCartProductAddAfterObserver implements ObserverInterface
{
    /**
     * @var \Magento\Framework\View\LayoutInterface
     */
    protected $_layout;
    /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    protected $_storeManager;
    protected $_request;

    /**
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param \Magento\Framework\View\LayoutInterface $layout
     */
    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\View\LayoutInterface $layout,
        \Magento\Framework\App\RequestInterface $request
     )
    {
        $this->_layout = $layout;
        $this->_storeManager = $storeManager;
        $this->_request = $request;
    }

    /**
     * Add order information into GA block to render on checkout success pages
     *
     * @param EventObserver $observer
     * @return void
     */
   public function execute(\Magento\Framework\Event\Observer $observer) {

        /* @var \Magento\Quote\Model\Quote\Item $item */
        $item = $observer->getQuoteItem();
        $post = $this->_request->getParam('frequency');
        $item->setSubscriptionFrequency($post);
        $item->save();

        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info($post);
   }
}


texts: Where in default Magento installation can I find the file of {{var firstname}} and similar variables?


texts: Swagger UI not working in Magento2: json schema not found

texts:
I'm trying to view the cool interactive Swagger UI on my own running Magento 2.1 instance.

When I go to https://example.com/swagger it shows the swagger header, but under it is an error message:

Can't read swagger JSON from https://example.com/index.php/rest/default/schema?services=all

When I query that URI myself with

curl -X GET "https://example.com/rest/default/schema" -H "Authorization: Bearer mytoken"

I get a 404 response with message {"message":"Request does not match any route","trace":null}

Do I need to do anything to generate the swagger json? Where is the controller that's supposed to process this request so that I can debug it? Why is this not working? Any ideas?


texts:
I'm getting the following vulnerability issue when using the Magento Security Scan:

  We have determined that your Magento installation's configuration file(s) are publicly accessible over HTTP.

'.user.ini'

I see the .user.ini file in the root of my Magento install, but not sure what it's for or how to pass the vulnerability scan.

Any ideas?


texts: Urgent help - Place Order button is not working on click. Nothing happens and no errors logged for Magento 2.4.0

texts:
I am getting complaints from few users that when they go to Checkout and click on "Place Order" button nothing happens.
I tried adding lots of debug and system logs but no errors or issues logged.
I tried testing from my end using testers across devices and it's working from them, so I am not able to replicate the issue.
Has anyone faced this? What could be the issue? How to fix this?
Please urgent help needed


texts:
I'm a newbie with Magento 2 so please bear with me.

I've been trying to make the cron run. First, I tried to Create a Password File. I was able to create the directory, but whenever I ran the command to create the password it says:

  htpasswd command not found

As a workaround, I manually created the password file with the help of this site.

Question A: Why can't it find htpasswd command?

Question B: Is it the same if I used the manual method?

Question C: What should be the file name/extension? .htpasswd or just password?

--

Second, I modified the .htaccess file inside pub folder with the code below so I can run the pub/cron.php file on browser but it's not working.

<Files cron.php>
 AuthType Basic
 AuthName "Cron Authentication"
 AuthUserFile /home/floweraddict123/public_html/fa-private/password/.htpasswd
 Require valid-user
</Files>

Question D: What's wrong with my .htaccess code?

Since it wasn't working, I removed the .htaccess restriction first, then run that file again on browser (twice as suggested on Magento user guide) and I got a blank page both times. I looked in my database and there was a cron_schedule table with the values of today's date, so I guess it worked. I already put back the restriction, but I think the cron is still not properly setup. I guess if I get the answers above then I can try this part again.

Question E: Is it just supposed to be blank?

--

Lastly, I tried to check my existing crontab with this code:

crontab -u <Magento file system owner name> -l

Question F: Is the file system owner (a user with root privileges) name same as my cPanel username?

We're hosted on GoDaddy, if that helps.

Apologies for the loads of questions, but looking forward to the replies.

Thank you!