texts: Custom html content for core/email_template

texts:
I'm using Magento's core/email_template model to send an email (as opposed to core/email as I want to add an attachment).

I already have a $html variable which I would like to set as the body. Is there any way I can do so, i.e not have to specify a transaction email ID? Here is the code below:

$mailTemplate->setDesignConfig(array('area'=>'frontend', 'store'=>1))
->sendTransactional(
    $template_id,
    $sender,
    $to_email,
    $to_name
);


texts: not getting QR code after fresh installtion for magento 2.4

texts:
I've installed magneto 2.4 and enabled 2fa following the instructions in this link
https://devdocs.magento.com/guides/v2.4/config-guide/deployment/pipeline/example/cli.html
I don't understand what I should be doing on the third step: magento/tfa/OTP_SHARED_SECRET=
and after logging in using admin account I don't get QR code to scan.
am I missing something here?


texts: Change background-color , below gallery images in magento

texts:
you can see gallery images
below gallery images, you can see pink color background, which has text "white boards"
please help me to change the background-color from pink to black.


texts: Cloudflare causing "Warning: session_start(): Failed to read session data"

texts:
My Redis Configuration (env.php) currently includes the following 3 entries:
    'max_concurrency' => '22',
    'bot_first_lifetime' => '60',
    'bot_lifetime' => '7200',

This worked flawlessly, until switching to Cloudflare. Now, once-twice per day I get a series of the following error:
Warning: session_start(): Failed to read session data

I suspect that Cloudflare is taxing my sessions (for whatever reason). I wonder if Cloudflare is crawling with a Bot that is maxing out my sessions.
So, before experimenting with bot_lifetime, I was wondering if anyone has experienced this issue and could suggest potential new values to trial.


texts: When is an address saved to the customer during checkout?

texts:
During onepage checkout, a customer has the option to enter a new shipping address and save this address to their profile.  This functionality is broken (probably due to custom code) and I'm attempting to debug it.

In Mage_Checkout_Model_Type_Onepage::saveShipping, a call is made to $address->setSaveInAddressBook.  It's my understanding that this flag should cause the address to be saved at the final step of checkout.

What block of code actually causes this address to be saved?  I'd like to debug the save point and work backwards to find my bug, but I can't find the point where the shipping address is saved.


texts: How to hide text on mobile view within Static Block

texts:
I'm currently working with a static block on our website. I'm trying to hide certain pieces of texts within this block when viewed on mobile. I've come across some answers which use CSS. However, I don't have access to the CSS file of our website.

Therefore my question is: Is it possible to achieve this without adjusting the actual CSS file within the static block?


texts: Import working halfway? Blank errors in Dataflow

texts:
Running Magento 1.9.2.4 in GoDaddy.

I'm trying to import about 1000+ simple products. The weird thing is that I can't import anything past the 40th-ish product. which is really weird since I had already done another import previously (of about 300 products) with no problem.

I keep getting this error when trying to import through the normal import:

  Product Type is invalid or not supported in rows: 44, 45, 46, 47, 48, 49, 50, 51...

And so on and forth until reaching the 100th error limit, invalidating my file.

(This error stems from the csv containing all products).

I've tried splitting it, but to no avail, it is always after a certain product that I just can't add them, no matter how many times I create a new csv or which configurations I use (I'm sure I've done everything correctly, from encoding in UTF-8, even deactivate BOM and all. I'm using OpenOffice and Notepad++ to edit my files too) which I find weird because the first 40 products don't cause any issue.

Dataflow doesn't help either. It seems to start working correctly, but after a while I start getting some blank errors, and ultimately nothing is added to the database.

Any help?

To clarify, of my 1000-ish products, I've already imported the first 40, but Magento just won't import the rest. I also made another csv containing just the products that are left, Magento tells me that the product type isn't valid, when they all have the same thing (simple) in the column type of the "working" products.


texts: How to migrate only categories data to Magento 2?

texts:
After migration, I notice that I can't save categories in the backend. After all the diagnosis I found no solution.

I want to migrate only the categories data, Is it possible?

( Without clear all the store or running again the entire migration )


texts: Magento2 plugin around method different between callable and Closure paramters on param $proceed

texts:
I have checked magento2 ,There are two types of parameters that can be sent to

around method

\Closure $proceed example aroundSave(\Magento\Catalog\Model\Product $subject, \callable $proceed)
callable $proceed example aroundSave(\Magento\Catalog\Model\Product $subject, \Closure $proceed)

Now my question:

What is different between closure and callable?
Why use we define type two different types for $proceed parameter?
What are use of this two types parameters?

Can any describe it details


texts: Magento 2.2.5 - 2.2.7 excesive cron logging in system.log

texts:
Magento 2.2.5 brings excesive logging to system.log which can grow up to 100 - 150 MB in 1 month.

This will obviously be a problem for many shops.

There is an official response to this on github (https://github.com/magento/magento2/issues/17190) and their "fix" will be introducted in M2.2.8 and M2.3.1, but it really isn't a fix, because it just moves to excesive logging to a different file called cron.log.

Since there is no log "off switch" in admin like there was in M1, I'm wondering if anyone knows of a proper way to disable these logs or to increase the logging level to, for example, warning level.

The only solution which comes to mind, without dwelling deeper into Magento's logging functionality, is to (ironically) create a cron job to delete the excesive cron logging... which is obviously silly.


texts: Email sent to store owner after a new account is created

texts: We need the same email confirmation after a new account is created to be sent to the store owner email.  Emails are sending fine to customer, but not sure if this is default functionality to send that email to store owner as well? If not, please advise how to make this happen.


texts: Magento2: issue with cron run \ privilages

texts:
After upgrade magento to 2.4 I add privilages:
cd <your Magento install dir>

// 644 permission for files
find . -type f -exec chmod 644 {} \;

// 755 permission for directory
find . -type d -exec chmod 755 {} \;

// 777 permission for var folder
find ./var -type d -exec chmod 777 {} \;

find ./pub/media -type d -exec chmod 777 {} \;

find ./pub/static -type d -exec chmod 777 {} \;

chmod 777 ./app/etc

chmod 644 ./app/etc/*.xml

chown -R :<web server group> .

chmod u+x bin/magento

Still cron return error:
2021-01-02 22:39:08] update-cron.ERROR: Cron readiness check failure! Found non-writable paths: /home/user/domains/domian.com/public_html/.travis.yml.sample /home/user/domains/domian.com/public_html/app/functions.php /home/user/domains/domian.com/public_html/dev/tests/functional/.gitignore /home/user/domains/domian.com/public_html/dev/tests/functional/bootstrap.php /home/user/domains/domian.com/public_html/dev/tests/functional/composer.json /home/user/domains/domian.com/public_html/dev/tests/functional/credentials.xml.dist /home/user/domains/domian.com/public_html/dev/tests/functional/etc /home/user/domains/domian.com/public_html/dev/tests/functional/isolation.php /home/user/domains/domian.com/public_html/dev/tests/functional/lib /home/user/domains/domian.com/public_html/dev/tests/functional/phpunit.xml.dist /home/user/domains/domian.com/public_html/dev/tests/functional/tests /home/user/domains/domian.com/public_html/dev/tests/functional/testsuites/Magento /home/user/domains/domian.com/public_html/dev/tests/functional/utils /home/user/domains/domian.com/public_html/dev/travis [] []

Can anyone help?


texts: How to put multiple images on a single product with Magmi?

texts: I just found out Magmi for the import of the products. It is beautiful and perfect when you full of products... But I was wondering how to put multiple images on a single product with Magmi?


texts:
I am using magento 1.7. I would like to have a event before the call of this method Mage_Adminhtml_Sales_Order_CreateController save.

I tried to do it like this  :

Config.xml :

 <adminhtml>
        <events>
            <controller_action_predispatch_sales_order_create_save>
                <observers>
                    <gfi_tnt_add_relay_quotes>
                        <type>singleton</type>
                        <class>Gfi_TNT_Model_Observercontroller</class>
                        <method>addTntRelayQuote</method>
                    </gfi_tnt_add_relay_quotes>
                </observers>
            </controller_action_predispatch_sales_order_create_save>
        </events>
</adminhtml>

app/code/community/Gfi/TNT/Model/Observercontroller.php :

class Gfi_TNT_Model_Observercontroller extends Mage_Adminhtml_Controller_Action
{
    public function addTntRelayQuote() {
     ........
    }
}

What is wrong in my code? Could you help me?


texts: Magento 2.0 with upgraded to php 7.0 Indexer Stuck at processing

texts:
With Apache2.4 mariaDB php7.0.2 everything working correctly with php7 extensions except for my products dont display when searched in magento2 Front-end. After checking for anything that could have changed I updated my Cron jobs to

*/1 * * * * php -c /etc/php/7.0/cli/apache2 /var/www/html/magento2/bin/magento cron:run
*/1 * * * * php -c /etc/php/7.0/cli/apache2 /var/www/html/magento2/update/cron.php
*/1 * * * * php -c /etc/php/7.0/cli/apache2 /var/www/html/magento2/bin/magento setup:cron:run
*/1 * * * * php -c /etc/php/7.0/cli/apache2 /var/www/html/magento2/bin/magento indexer:reindex

Each command runs perfectly manually But when i go to the Admin-Backend this is what I get in the Index section.

After searching for anyone else I seen on here that @Alex Paliarush said you have to run this command to fix stuck at processing.

 update magento.indexer_state set status='invalid' where status ='working'

So i ran this command in SQL via phpmyadmin the sql was successful but it fixed half the problem the Catalog search is still processing. so I stopped cron jobs and ran the sql query again then manually ran Indexer:reindex and got this error.

Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Segmentation fault (core dumped)

So this Fixed my Customer Grid indexer and left me with this.

I believe because the indexer isn't correctly indexing my products its causing them to not show up on the frontend of the site i didn't have this problem on php5.6

I enabled php7.0-cli log to find the error when running indexer here's what i have gotten.

[10-Jan-2016 11:19:36 UTC] PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 140022063078552 bytes) in /var/www/html/magento2/lib/internal/Magento/Framework/Model/AbstractModel.php on line 442

So some how there is a bug thgats trying to use over 140 terabytes.


texts: CAPTCHA is not shown on registration form but shown in other forms magento 1.9

texts:
In my registration form the CAPTCHA doesn't work but in login and forgotten password forms is workin perfect.
Enable CAPTCHA on frontend - Yes.
Select all forms into "Form" box.
I'm using ultimo theme.
Thank you


texts: Modification of Magento 2 database core table

texts:
I am getting this error in UpgradeSchema. I have added one column in these core tables, functionalities are working good. According to coding standard it shows warning message.

 ----------------------------------------------------------------------
     60 | WARNING | Modification of magento database core table
        |         | 'sales_order'
     78 | WARNING | Modification of magento database core table
        |         | 'sales_order_grid'
 ----------------------------------------------------------------------

I have attached my code below

<?php
namespace frontname\modulename\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class UpgradeSchema implements UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
        $customerGroupTable = $setup->getConnection()->describeTable($setup->getTable('customer_group'));
        $customerGroupIdType = $customerGroupTable['customer_group_id']['DATA_TYPE'] == 'int'
            ? \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER : $customerGroupTable['customer_group_id']['DATA_TYPE'];
        $installer->startSetup();
        if (version_compare($context->getVersion(), '2.0.1') < 0) {
            $eavTable = $installer->getTable('sales_order');
            $columns = [
                'is_wallet_quote' => [
                    'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                    'nullable' => false,
                    'comment' => 'Is this quote for wallet?',
                ],
                'holded_quote_id' => [
                    'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                    'nullable' => false,
                    'comment' => 'Holded Quote Id',
                ],

            ];
            $connection = $installer->getConnection();
            foreach ($columns as $name => $definition) {
                $connection->addColumn($eavTable, $name, $definition);
            }
            $eavTable = $installer->getTable('sales_order_grid');
            $columns = [
                'is_wallet_quote' => [
                    'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                    'nullable' => false,
                    'comment' => 'Is this quote for wallet?',
                ],
            ];
            $connection = $installer->getConnection();
            foreach ($columns as $name => $definition) {
                $connection->addColumn($eavTable, $name, $definition);
            }
        }
        $installer->endSetup();
    }
}

Anyone have any idea about this?
Thanks in Advance


texts:
I wanted to know would I be able to install Magento 2.1.4 on Wamp server?
If so, where can I get the correct/compatible PHP version for that?
All the PHP versions available for download are not compatible with Magento CE 2.1.4
Thank you!


texts:
This is my code:

$collection = Mage::getModel('orderhandling/paymentmapper')->getCollection();
$payments = $collection->addFieldToFilter('id', $id);

Sometimes, if the id is not defined, the _data array in $payments is not defined. How can I check if it is not defined? I tried isset, but thats always false, no matter if the array is defined or not.

Thanks!


texts: magento 2 remove root lib/web/ js files from home page

texts:
Magento 2 sends around 300 request on home page so speed is very slow.
Also, bundling create very large file so its taken time to load resources.
I want to remove js from root lib/web from home page.

Is there any way to remove all unnecessary js?

Regards
Hiren Shah


texts: Is it possible to resize catalog image for only one product in magento?

texts:
I want to resize only one catalog product images. Is it possible in magento2?

I already know the command for resizing catalog image:

  php bin/magento catalog:images:resize

but i want to do this for only one product images


texts: Add product to cart programmatically with file type custom options

texts:
I am trying to add products to cart programmatically having custom options of type file. Basically, there is a separate interface for some products in the shop where customer can customize the image being ordered. It's working with some external API which saves the final image on server and returns the path on the basis of which I'm going to add that into the custom option of product.

What I am trying to do is add that image into the custom option of product. Tried several methods but no success. Found this question but no answer there.

This is what I have tried so far, but it keeps giving me error that required options is missing.(That image option is required)

$path = Mage::getBaseDir();
$product_id = 1;
$product = Mage::getModel('catalog/product')->load($product_id);
$cart = Mage::getModel('checkout/cart');
$cart->init();
$params = array(
    'product' => $product_id,
    'qty' => 1,
    'options_1_file_action' => array(
    1 => array(
        'quote_path' => $image,
        'secret_key' => substr(md5(file_get_contents($path . DS . $image)), 0, 20)),
        )
    );
$cart->addProduct($product, $params);
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

Also found this piece somewhere, but it depends upon FILES variable, so can't use it as there is no post from front.

$product_id = 1;
$product = Mage::getModel('catalog/product')->load($product_id);
$cart = Mage::getModel('checkout/cart');
$cart->init();
$params = array(
    'product' => $product_id,
    'qty' => 1,
    'options_1_file_action' => 'save_new',
    'options_1_file' => array(
        'name' => $image,
        'type' => 'application/octet-stream',
        'tmp_name' => $image
    )
);
$cart->addProduct($product, $params);
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);


texts: M2: flushing cache lets page render one time, then blank white page thereafter

texts:
I'm working through Alan Storm's 'No Frills Magento 2 Layout' an internal dev server. He walks the reader through small edit, refresh, another small edit, refresh, see what changes, and so on. There are lots of examples. Then I inserted a typo which I couldn't find, that ended up being whitespace added at the end of 'Magento\Framework\View\Element\Template ' when I copied and paste from the PDF manual.

I then sorted out getting errors enabled, however I managed to get the Magento 2.3.2 install into a bad state where there are white pages on every refresh. Clean the cache and hit F5, the site comes back, but for only one render.

This was a fresh install and I had only executed php bin/magento deploy:mode:set developer as per the install instructions for the module which is part of the book.

I then started an exploration of every command available from the internet in an attempt to be able to hit F5 and just get a page to reload. I issued these two commands:

php bin/magento deploy:mode:set developer
php bin/magento cache:disable

And now the site will refresh with F5 but instead of quickly refreshing, the server grinds for 7 to 10 seconds and then renders Hello World

What mechanism in Magento 2 causes this?
and
What can a person do to get back to how the site was working as expected before all this?

Right now, I believe the solution is to move this M2 and start over by installing a new fresh instance. But that simply is not acceptable; what happens if a live site starts acting like this? Having to clean cache to render one page is not acceptable nor is disabling cache...


texts: How to set collection as content in csv file export

texts:
I am using magento 2.1 version. I am working to built export csv functionality on frontend. I am using below code:

 public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\App\Response\Http\FileFactory $fileFactory,
       \Magento\Framework\Controller\Result\RawFactory $resultRawFactory
    ) {
        $this->resultRawFactory = $resultRawFactory;
        $this->fileFactory           = $fileFactory;
        parent::__construct($context);
    }

    /**
     * Order view page
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {

        $layout = $this->_view->getLayout();
        $block = $layout->createBlock('Vendor\Modulename\Block\Myblock');

         //do your custom stuff here
        $fileName = 'mytest.csv';
        $this->fileFactory->create(
            $fileName,
            null, //content here. it can be null and set later
            DirectoryList::VAR_DIR,
            'application/octet-stream', //content type here
            null
        );
        $resultRaw = $this->resultRawFactory->create();
        $resultRaw->setContents($block->getCollection()); //set content for download file here

    }

How can I set collection to content in export file?


texts: I would like to create a blog using Wordpress and I'd like to have it as a subfolder in Magento domain. Can you let me know how to do it?


texts: Magento Database Repair Tool error mysql_fetch_row

texts:
We want to run the Magento 1 Database Repair Tool, but we are getting some errors.

What am I missing?

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /magento-db-repair-tool-1.2.php on line 386

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /magento-db-repair-tool-1.2.php on line 399

Warning: Invalid argument supplied for foreach() in /magento-db-repair-tool-1.2.php on line 1664


texts: How to remove Magento 2 default mobile menu, so that i can use my own custom menu?

texts:
I would like to know where is the default mobile menu located in magento 2. My problem is i created my own custom responsive menu but it defaults to the mobile menu after 768px. Followed several tutorials and none are working.

Theme in use: Freego Responsive Theme
Magento Vers: Magento 2.3

FYI: Freego theme uses Magento Blank theme as its parent theme if that helps.

10/24/19

Any assistance would be greatly appreciated.


texts: About performance: Is better to use before and after plugin intead around always when possible?

texts:
About use of each kind of interceptor (plugin) was answered here:
Is it better to use solely around function instead of before+after combined?
But in Magento docs says:

Avoid using around method plugins when they are not required because
they increase stack traces and affect performance

With that in mind... I know in some cases we must use it because is the only way, but when it is possible to use before and after instead around should I always do it? Before and after together have better performance than around?
In my case for example, I just want to test if a plugin changed a Object that is not received as parameter, so in beforeMethod I would get its object status and check if was modified in afterMethod. Should I use before+after or around?
Update
Magento docs answer this question somehow:

The only use case for around method plugins is when the execution of
all further plugins and original methods need termination


texts: Magento 2 : add custom JavaScript to CMS page create/edit in admin

texts:
I would like to add some custom JavaScript to the CMS page create/edit pages in Magento 2 admin. So basically when you want to create a new page or edit an existing one, it should load some JavaScript preferably before body closing tag.

How would I go about doing this?
I've already looked at the following posts:

Adding custom CSS to admin backend (thought it might similarly for js)
How to add custom css for adminhtml (same as previous)
http://alanstorm.com/magento_2_and_requirejs/
Magento 2 override amin js file
Unable to run custom js to admin backend

The one by Alan Storm did work, but it loaded my js on all admin pages, but that's not the idea, I just want to load my js for the CMS page create and edit pages.

Does anyone know how to do this?


texts:
I want to change hover effect on mouse over in product list

Which files do I need to edit for the same ?


texts:
I'm doing some performance tuning on the Magento 2 system I manage, and as an example I've created a minified (and custom) version of share.js used in the "addtoany" social media plugin.
The original version is removed, and the new version included in my theme's default_head_blocks.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <!-- Switch to minified / compiled Sharing assets -->
        <remove src="https://static.addtoany.com/menu/page.js"/>
        <script src="js/share.min.js"/>
    </head>
</page>

However, on categories, or page's where I don't need the JS included (such as homepage and some categories) Layout Update XML (Magento 2.3.3) the following markup passes validation, but doesn't remove the JS from the page
<head>
    <remove src="js/share.min.js" />
</head>
<body>
    <referenceBlock name="category.products" remove="true" />
    <referenceBlock name="catalog.leftnav" remove="true" />
</body>

I've also tried moving the JS into a module and then trying:
<remove src="<vendor>_<module>/js/share.min.js" />

With no success


texts:
can you help me? i train make rewrite controller on magento 1.9.2.4 and i'm using php 7, my code like this
Lesson/Test/controllers/CartController.php

<?php
require_once "Mage/Checkout/controllers/CartController.php";
class Lesson_Test_CartController extends Mage_Checkout_CartController
{
    # Rewrite of indexAction
    public function indexAction() {
        die('your method has been rewrited !!');
    }
}

Lesson/Test/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
    <Lesson_Test>
        <version>1.0.0</version>
    </Lesson_Test>
    </modules>
    <frontend>
        <routers>
            <checkout>
                <args>
                    <modules>
                        <Lesson_Test before="Mage_Checkout">Lesson_Test</Lesson_Test>
                    </modules>
                </args>
            </checkout>
        </routers>
    </frontend>
</config>

etc/modules/Lesson_All.xml

<?xml version="1.0"?>
<config>
        <modules>
            <Lesson_Test>
                <active>true</active>
                <codePool>local</codePool>
            </Lesson_Test>
        </modules>
    </config>

but it not work, 404 not found, i acces http://127.0.0.1/magento/magento-tutorial/index.php/lesson
thank you magento :) i'm learn from this


texts: how to change shipping method text from view order and emails in magento2

texts:
how to show shipping method title only rather than carrier title??
like:
how generate this : go to myaccount=>myorders=>order information in magento2 frontend.
currently showing : "Express - Express"
expected result   : "Express"
and in emails also.


texts: Adding an extra text area in product images tab backend

texts:
I would like to add an extra text area in a new column next to the label column in the product images tab:
https://gyazo.com/c3d4333045991aea0a70c242bdfba454

I tried to create a new attribute and assign it, here is what it gives:
https://gyazo.com/bdb76f694b41a3f02df24549adfefb7a

So unfortunately, it doesn't add a new column next to the label one.

How to achieve this ?

Many thanks !


texts:
I'm sending the request

http://10.232.32.64/rest/V1/orders?
   searchCriteria[filter_groups][0][filters][0][field]=status&
   searchCriteria[filter_groups][0][filters][0][value]=pending&
   searchCriteria[filter_groups][0][filters][0][condition_type]=eq

to my Magento installation, and I'm getting the error

{"message":"Internal Error. Details are available in Magento log file.
Report ID: webapi-5c6b179641503"}

When I look at my exception.log, I see the following error

[2019-02-18 20:34:20] main.CRITICAL: Report ID: webapi-5c6b16ccc5482;
Message: Property "FilterGroups" does not have accessor method
"getFilterGroups" in class "Magento\Framework\Api\SearchCriteriaInterface".
{"exception":"[object] (Exception(code: 0): Report ID: webapi-5c6b16ccc5482;
Message: Property \"FilterGroups\" does not have accessor method
\"getFilterGroups\" in class \"Magento\\Framework\\Api\\SearchCriteriaInterface\".
at /var/www/magento2/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php:205,
LogicException(code: 0): Property \"FilterGroups\" does not have accessor method
\"getFilterGroups\" in class \"Magento\\Framework\\Api\\SearchCriteriaInterface\".
at /var/www/magento2/lib/internal/Magento/Framework/Reflection/NameFinder.php:100)"} []


texts: Magento 2 - Add filter or join query in grid collection

texts:
I created an admin grid using reference https://ranasohel.me/2014/04/20/creating-magento2-adminhtml-grid/.

Now I want to apply addFieldToFilter() of my collection in the grid.

How can I do this? Because Magento 2 use ui_component for the grid in XML.


texts: Customising Product review block/tab Text string in magento 1.9

texts:
Within Magento product review tab.
I have searched for the source code file of following string: "You're reviewing: " to write something else than this. Been looking in several files but not able to find it.
In files like:
/app/design/frontend/theme/default/template/review/product_review_info.phtml

and
/app/code/core/Mage/Review/Block/Form.php


texts: How to create an adminhtml grid with custom category attribute?

texts:
I am starting my adventure with Magento 2.2.2, so my question may be considered stupid by most of you.

I'm trying to write a module, which adds custom category attribute and then displays it on custom adminhtml view.

I already managed to add such custom category attribute, but I am having problems with displaying a grid with all categories and my custom attributes on custom admin webpage.

Could anyone point me in a direction I should take to solve my issue?


texts: How can I add an item to an order programmatically? I know the sku and product id of the product that I want to add, as well as the quantity. I also know the order which I want to add it to, and I can get a \Magento\Sales\Api\Data\OrderInterface object, on which I can call setItems to add the item, but I don't know how to create the new \Magento\Sales\Api\Data\OrderItemInterface from only the sku, product id and quantity, since I want other attributes such as the base price, etc. to be populated automatically.


texts:
I am trying to get attribute text, but it only works for simple products.

This is what I am doing:

<?php

    $products = Mage::getModel("catalog/product")->getCollection()
                        ->addAttributeToFilter('type_id', 'configurable')
                        ->setOrder('entity_id', 'DESC');

    foreach($products as $product){
        $attr = 'attribute_name';
        var_dump( $product->getResource()->getAttribute($attr)->getFrontend()->getValue($product) ); // returns NULL or 'no'
    }
 ?>

It returns NULL or 'no'. Which is, I think, weird behaviour.


texts:
I have install magento on my local host and facing problem. There is no link of add new post and change theme option. Only pages section is showing. So some one told me that i have to run command to enable these feature. But when i run following command then an error occurred.

  php bin/magento setup:upgrade

Snapshot of my command.

I have install magento in E drive and here is full path

  E:\XAMPP\htdocs\Magento


texts: Add a new category to navigation called new arrivals

texts:
I am trying to add a "new arrivals" category to my top navigation. Is there a simple way to add this? I have attached a photo for what I m trying to accomplish.

This is what I was thinking but I am not sure if it would work.

I found an extension called "Sort by Date" and I was going to install that
I was going to create a subcategory called "New Arrivals" and make it redirect to a CMS page that would include a product page with products from all the categories and sorted by date.

What do you think? Would this redirect negatively impact SEO?


texts: catalog price rules in magento 2.1.4 and 2.1.5

texts:
I tried to apply catalog price rules from Magento backend, But it did not work out in fronted.
I cleared cache, indexing still its not working.I think this is bug for Magento versions 2.1.4 and 2.1.5.
Please suggest.


texts: Retrieve updated mini cart (cart_sidebar) block - not cached version

texts:
I'm using Magento EE 1.13.2 and use jQuery to add products to the cart:

var url = "/checkout/cart/add?product=" + productId + "&qty=" + qty + "&form_key=" + formKey;
$j.get(url, "", function(data,status){
    if(status == "success") {
        // Retrieve updated cart block
        $j.post('/coreoverrides/checkout_cart/minicart', "", function(data, status) {
            if(status == "success") {
            // use jQuery to update mini cart
        });
    } else {

    }
});

After the item is successfully added to the cart (which works), I attempt to retrieve the mini cart block in a controller I created:

class Derp_CoreOverrides_Checkout_CartController extends Mage_Checkout_CartController
{
    public function minicartAction()
    {
        $response = array();
        $response['status'] = 'SUCCESS';
        $response['message'] = $this->getLayout()->createBlock('checkout/cart_sidebar')->setTemplate('checkout/cart/topcart.phtml')->toHtml();
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
        return;
    }

But the data returned json does not have the added product in there. Am I missing something to invalidate some sort of cache or signal something that a product was added to the cart? In my development environment I have all of the cache disabled and do not use varnish, memcached, etc.

When I go directly to /coreoverrides/checkout_cart/minicart in a browser window I see the updated block.

In my local.xml I have this:

<default>
        <reference name="header">
            <block type="checkout/cart_sidebar" name="topcart_mini" as="topcart" template="checkout/cart/topcart.phtml" />
        </reference>
</default>


texts: Getting Error cannot create symlink Every time

texts:
I'm getting following error from a long time and can't get a permanent solution the error is "cannot create symlink error code 1314 Magento 2". The error like symlink _reset.less. Please find the error attachment.

Please, anyone give a perfect solution?


texts: Magento data migration using two different servers

texts:
My current Magento 1 site hosting on server which is not supported for Magento 2

So for the data migration and delta migration

I need to install my magento 2 on another server then need to remotely connect with Magento 1 database and then perform migration

My question is how to connect remote database with data migration tool ?

Is there any possibility to migrate data when magento 1 and Magento 2 hosted on 2 different servers.


texts:
Good morning,

I would like to know if somebody has worked with less plugins in Magento Environment?

Indeed, I met no difficulties with grunt tools, but when Magento compile all files (through setup:upgrade command by example), it doesn't find plugins defined in less files.

When I try to reach my stylesheet, it output this error

  ParseError: Unexpected input in _functions.less on line 5, column 1

where line 5 give

@plugin "plugins/index";

I do not know if the problem is about js extension, as Magento look for .less file only.

Thank you for your help,

Ilan


texts: problems getting base url (throws exception)

texts:
i'm trying to get the base URL within Enterprise_PageCache_Model_Processor (line 206)-- however, i'm running into the above error. Any work around that doesn't involve hardcoding the url directly?

$homepage = Mage::getBaseUrl();

above is what is causing the error.


texts: Magento 2: \Magento\Sales\Model\OrderRepository is not working in observer

texts:
$orderId = $order->getId();
                     $objectManager = $this->dataHelper->getObjectManager();
                     $order12 = $objectManager->create('\Magento\Sales\Model\OrderRepository')->get($orderId);

This code is not working in the observer. I am sending data through rest API.
Getting issue in the console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Can you please provide the solution?

Thanks


texts: Installing local tar.gz of magento enterprise with n98-magerun tool

texts:
I have this in my .n98-magerun.yaml:

commands:
  N98\Magento\Command\Installer\InstallCommand:
    magento-packages:
      - name: magento-ee-1.14.2.1
        version: 1.14.2.1
        dist:
          url: file:///path/to/enterprise-1.14.2.1.tar.gz
          type: tar

I know that file is read since exception is thrown if yaml is malformed.
Still, for some reason, the command n98-magerun.phar install command still proceeds to download magento-ce-1.9.1.1. Note: my command line user running n98-magerun has full permissions on the tar.gz .

Reference for this configuration:
https://github.com/netz98/n98-magerun/wiki/Magento-installer

Related question:
How do you install the latest enterprise edition with n98-magerun?

Any ideas on why this does not work? I am guessing that something has changed which is not reflected in current documentation(?). Thanks in advance for any help.


texts: does .magento/services.yaml file exists in magento 2 open source?

texts: i am trying to figure out how i can install elasticsearch plugin with magento open source, i foudn this page https://devdocs.magento.com/cloud/project/services-elastic.html#elasticsearch-plugins but i can find .magento/services.yaml only in magento cloud, is there a .magento/services.yaml file in magento open source if yes then what is the path and if not is there a way to install elasticsearch plugins in magento open source? thanks in advance


texts: magento links not working properly while redirecting from product info page to other cms pages

texts:
I am using magento 1.9.2 for my website.

My website address is 127.0.0.1/magento. Before it was adding index.php while visiting any cms pages for example 127.0.0.1/magento/index.php/about-us

so I have made changes like shown in this tutorial

Now its working fine with all cms pages but product category pages and product page 127.0.0.1/magento/index.php/My-category.html for category page
and 127.0.0.1/magento/index.php/my-category/my-product.html for product page

now when I try to redirect from 127.0.0.1/magento/index.php/my-category/my-product this link to any cms page It shows link 127.0.0.1/magento/index.php/my-category/about-us like this...

what will be the problem

my screenshot of system->configuration->general->web


texts: Import with category_ids don't work on Magento

texts:
Thanks for your help,
It's been hours now that I'm trying to upload a csv of products on Magento, everything goes alright, but products are not linked to the category I specify on "category_ids"

This is a sample of data I try to import :

"category_ids","name","url_key","sku","price","special_price","meta_description","meta_keywords","meta_title","weight","quantity","short_description","description","_type","_attribute_set","status","visibility","tax_class_id","manage_stock","use_config_manage_stock","_product_websites","_store"

"895655","High & Low Beam 2014","mp-2014","48465","279,99","139,99","Your search ime Warranty.","s, Yamaps,","Led Kit.com","2","1000","The new and improved technology!","long description","simple","Default","1","4","0","1","1","base","1"

By the way the category ID 895655 exists, and the sample above is copied as it is from the CSV file with notpad++.

Thanks for you advices.


texts: After join the customer name with custom module, i can't filter the grid by customer name

texts:
I create a custom module for product question. I added in my db the customer_id, but in the grid I want to show the name of customer. For that I did a join with customer_entity_varchar and got the full name of customer.

When I want to filter the grid by customer name:

  SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'value' in where clause is ambiguous.

$this->addColumn('customer_name', [
            'header' => $this->__('Customer Name'),
            'align' => 'left',
            'index' => 'customer_name',
            'filter_index' => 'value',
        ]);

$first = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'firstname');
        $last = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'lastname');
        $this->getSelect()->join(['ce1' => 'customer_entity_varchar'], 'ce1.entity_id=main_table.customer_id', ['firstname' => 'value'])
            ->where('ce1.attribute_id='.$first->getAttributeId())
            ->join(['ce2' => 'customer_entity_varchar'], 'ce2.entity_id=main_table.customer_id', ['lastname' => 'value'])
            ->where('ce2.attribute_id='.$last->getAttributeId())
            ->columns(new Zend_Db_Expr("CONCAT(`ce1`.`value`, ' ',`ce2`.`value`) AS customer_name"));

UPDATE:
I changed value with main_table.value

$this->addColumn('customer_name', [
       'header' => $this->__('Customer Name'),
       'align' => 'left',
       'index' => 'customer_name',
       'filter_index' => 'main_table.value',
]);

and receive:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'main_table.value' in 'where clause'


texts: customer login using telephone instead of email

texts: Hi I am new to Magento and I have few questions, is it possible to change the field email address to telephone in the Sign in form, so that the system authenticates the user based on correct value of the telephone and password ? if it is possible how can it be done ?


texts: Magento 2 : Join 2 tables in Existing collection

texts:
I've been trying to join 2 tables with the existing collection of Customers (customer_entity).

I've added like below.

$items->getSelect()->join('customer_entity_text as second', 'main_table.entity_id = second.entity_id');

Above is working fine, But if i add one more table to join with this is that is customer_entity_varchar than its not working.

Below is my code to join 2 tables.

$items->getSelect()->join('customer_entity_text as second',
'main_table.entity_id = second.entity_id')
->join('customer_entity_varchar as third', 'main_table.entity_id = third.entity_id');

Any guide ?

*


texts:
I have new product of eCommerce,
I just want to know should I use Magento 2 or not for this project?
As I seen in many posts people are saying that you can go through magento 1.9 only for now.


texts:
I want to add profile picture for all the customers who register into my magento website.
How to add profile picture for customer in magento 1.7.0.2?


texts: Magento Command for bulk Optimizing existing Product images

texts:
How to optimize existing Product images via commandline, similar to resize command.
php bin/magento catalog:images:resize

https://docs.magento.com/user-guide/catalog/product-image-resizing.html
This is Magento documentation regarding Javascript optimization & Resize options for Product images at Upload time.
My query is how to optimize existing Product images, if I change Javascript optimization in Adminpanel to 90%, so it will only affect, further uploaded images via AdminPanel.
What about existing Images, how to batch process existing images?
Although, there is a resize command in Magento, is there a bulk optimize Magento command?


texts:
While installing magento2.4 using composer with php 7.4 I'm getting below message

Problem 1
- Installation request for magento/product-community-edition 2.4.0 -> satisfiable by magento/product-community-edition[2.4.0].
- magento/product-community-edition 2.4.0 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.

To enable extensions, verify that they are enabled in your .ini files:

- /etc/php/7.4/cli/php.ini
- /etc/php/7.4/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.4/cli/conf.d/10-opcache.ini
- /etc/php/7.4/cli/conf.d/10-pdo.ini
- /etc/php/7.4/cli/conf.d/15-xml.ini
- /etc/php/7.4/cli/conf.d/20-bz2.ini
- /etc/php/7.4/cli/conf.d/20-calendar.ini
- /etc/php/7.4/cli/conf.d/20-ctype.ini
- /etc/php/7.4/cli/conf.d/20-curl.ini
- /etc/php/7.4/cli/conf.d/20-dom.ini
- /etc/php/7.4/cli/conf.d/20-exif.ini
- /etc/php/7.4/cli/conf.d/20-ffi.ini
- /etc/php/7.4/cli/conf.d/20-fileinfo.ini
- /etc/php/7.4/cli/conf.d/20-ftp.ini
- /etc/php/7.4/cli/conf.d/20-gd.ini
- /etc/php/7.4/cli/conf.d/20-gettext.ini
- /etc/php/7.4/cli/conf.d/20-iconv.ini
- /etc/php/7.4/cli/conf.d/20-imagick.ini
- /etc/php/7.4/cli/conf.d/20-imap.ini
- /etc/php/7.4/cli/conf.d/20-intl.ini
- /etc/php/7.4/cli/conf.d/20-json.ini
- /etc/php/7.4/cli/conf.d/20-mbstring.ini
- /etc/php/7.4/cli/conf.d/20-mysqli.ini
- /etc/php/7.4/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.4/cli/conf.d/20-phar.ini
- /etc/php/7.4/cli/conf.d/20-posix.ini
- /etc/php/7.4/cli/conf.d/20-readline.ini
- /etc/php/7.4/cli/conf.d/20-shmop.ini
- /etc/php/7.4/cli/conf.d/20-simplexml.ini
- /etc/php/7.4/cli/conf.d/20-soap.ini
- /etc/php/7.4/cli/conf.d/20-sockets.ini
- /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.4/cli/conf.d/20-sysvsem.ini
- /etc/php/7.4/cli/conf.d/20-sysvshm.ini
- /etc/php/7.4/cli/conf.d/20-tokenizer.ini
- /etc/php/7.4/cli/conf.d/20-xmlreader.ini
- /etc/php/7.4/cli/conf.d/20-xmlrpc.ini
- /etc/php/7.4/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.4/cli/conf.d/20-xsl.ini
- /etc/php/7.4/cli/conf.d/20-zip.ini

You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
How can I solve it.


texts: API call to get a list of products and their attributes in one call

texts:
I am currently using a foreach loop to iterate through the products and then retrieving the attribute I need. This is very slow, because it makes a call for each product to the API and retrieves the attributes values.

Is there a way to get all products along with their attributes in one shot?

Here is my current code:

var session = client.login("xxx", "xxx");
catalogProductEntity[] product = new[] { new catalogProductEntity() };
client.catalogProductList(out product, session, null, null);
Console.WriteLine("Found {0} items", product.Length);

catalogProductRequestAttributes attributes = new catalogProductRequestAttributes();
attributes.additional_attributes = new string[] { "mynewattribute" };

foreach (var catalogProductEntity in product)
{
    catalogProductReturnEntity catalogProductReturnEntity = client.catalogProductInfo(session, catalogProductEntity.product_id, null, attributes, null);
    string attrValue = catalogProductReturnEntity.additional_attributes[0].value;
    Console.WriteLine("attrValue => " + attrValue);
    Console.WriteLine(catalogProductEntity.product_id);
}


texts: Magento 2 Console Error Uncaught TypeError

texts:
I have Update Magento version 2.3.4 to 2.4 and now on the product page these errors are coming.
Uncaught TypeError: Cannot set property 'migrateVersion' of undefined
Uncaught TypeError: Cannot set property 'Color' of undefined
Uncaught TypeError: $ is not a function
Uncaught TypeError: Cannot read property 'fn' of undefined
Uncaught Fotorama requires jQuery 1.8 or later and will not run without it.
Uncaught TypeError: settings.$elementF.fotorama is not a function

These errors are coming from this file.
stripes-custom/fr_FR/jquery/jquery-migrate.js
stripes-custom/fr_FR/jquery/ui-modules/effect.js
stripes-custom/fr_FR/js/lib/sticky-kit.js
stripes-custom/fr_FR/magnifier/magnifier.js
stripes-custom/fr_FR/fotorama/fotorama.js
stripes-custom/fr_FR/mage/gallery/gallery.js

To resolve this error I have tried this solution but not working.
TypeError: settings.$elementF.fotorama is not a function
How to change jQuery version in Magento2

I have tried by changing the theme from vendor to luma and blank but the console error was still remaining.
I have also updated the root lib folder with the latest Magento 2.4 lib folder but not work.
Anyone has a solution to this issue then please provide.
Thank you in advance.


texts: My magento automatically invoices my customers?

texts:
When a customer places an order on my website. My Magento is automatically invoicing my customers.

We are a wholesale company and have various customer options. Some customers we will not invoice until the end of the month.

I am confused as to why this is automatically doing it.

We also have the EasyPDF plugin installed. I am not sure if this is causing the issues.


texts: $category->getChildren(); does not work?

texts:
When I am using $category->getChildren(); and I am getting empty array? I have children categories defined and I can see them via Admin Panel.
Where should I look for the clue?
thanks


texts: Debugging Error while translating phrase “%s” in file %s. in Magento 2.3.5-P1

texts:
I'm currently building a site with Magento 2.3.5-P1 (installed via composer) I've added a theme (Porto) and a small number of 3rd party extensions
I've just noticed that on the product pages there is an error in the console and nothing works (no links are clickable, add to cart not working, attributes missing, additional images missing etc) The console error is:
https://xxx.co.uk/pub/static/version1602316619/frontend/Smartwave/porto/en_GB/js-translation.json HTTP status: 404
When running the command bin/magento setup:static-content:deploy en_GB -f I see the following error:
Error while translating phrase "%s" in file %s.
I presume the 2 are related but I have no idea how to start debugging this? I've tried deactivating the 3rd party extensions but the error is still there? Magento doesn't log anything to even start looking into any code etc...?


texts:
I have created the custom admin module, it showing empty page.

my code is:

//config.xml file

 <admin>
            <routers>
                <web>
                    <use>admin</use>
                    <args>
                        <module>Department_Web</module>
                        <frontName>web</frontName>
                    </args>
                </web>
            </routers>
        </admin>
        <adminhtml>
            <layout>
                <updates>
                    <web>
                        <file>web.xml</file>
                    </web>
                </updates>
            </layout>
        </adminhtml>
 <stores>
        <admin>
            <design>
                <package>
                    <name>default</name>
                </package>
                <theme>
                    <default>Department</default>
                </theme>
            </design>
        </admin>
    </stores>

//adminhtml.xml file

<?xml version="1.0"?>
<config>
    <menu>
        <web module="web" translate="label">
            <title>Web</title>
            <sort_order>71</sort_order>
            <children>
                <dotnet module="web" translate="label">
                    <title>Dot Net</title>
                    <sort_order>0</sort_order>
                    <action>web/adminhtml_index</action>
                </dotnet>
                <php module="web" translate="label">
                    <title>PHP</title>
                    <sort_order>1</sort_order>
                    <action>web/adminhtml_index</action>
                </php>
            </children>
        </web>
    </menu>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <Department_Web>
                        <title>Web Module</title>
                        <sort_order>10</sort_order>
                    </Department_Web>
                </children>
            </admin>
        </resources>
    </acl>
</config>

//controller file

<?php

class Department_Web_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
{
    protected function _initAction()
    {
        $this->loadLayout()->_setActiveMenu('web/set_time')->_addBreadcrumb('Web Manager','Web Manager');
        return $this;
    }

    public function indexAction()
    {
        Mage::log('c2');
        $this->_initAction();
        $this->renderLayout();
    }
}

//layout file
adminhtml->defalt->Department->layout

<?xml version="1.0"?>
<layout version="0.1.0">
    <web_adminhtml_index_index>
        <reference name="content">
            <block type="web/adminhtml_grid" name="adminhtml_web"></block>
        </reference>
    </web_adminhtml_index_index>
</layout>

looking for solution?

Thanks in advance.


texts: What should we use instead of the Magento\Checkout\Model\Cart model?

texts:
The Magento\Checkout\Model\Cart class was marked as deprecated a long time ago (since 2.1 ver.). What should I use instead of it to work with a customers cart?

I know that I can work directly with a Quote model, but maybe exists some interface which replaced the Cart model functional?

PS: I read the answer given here about "Why it is deprecated?", but I need the information about "What should I use instead?".


texts:
I know how to do this in a general sense, except for whatever reason, I can't get it to work properly on a second website. My second website is merely a subdomain of my main, so https://second.mywebsite.com. I'm using a different layout/theme for when I need to make custom changes to just the second site, so I've switched the layout and template package to second under Config > General > Design

I have attempted to remove the original Register link through customer.xml, in order to add a new one that points to my main site's registration page.

What I have:

<action method="removeLinkByUrl" translate="label title" module="customer">
    <label>Register</label>
    <url helper="customer/getRegisterUrl"/>
    <title>Register</title>
    <prepare/>
    <urlParams/>
    <position>99</position>
</action>

Now, this works on every single page for my second website, except for the homepage.  I cannot figure out why only the homepage is forcing the original Register link to show up.


texts:
I have created a custom module that exports the products in a text file
If I call the method from a view (visiting the browser page) the file is created correctly but if I call method from a custom cron the file is created empty

Here is the function in Altravista\CustomModule\Block;

public function getCsvFeed()
{
    $csv_handler = fopen ('feeds/feed.txt','w');

    $csv = array();

    foreach ($this->helper->getProductCollection() as $product) {
        $productId = $product->getId();
        //Name
        $csv = array($this->helper->getProductName($product));

        ... MY CODE ...

        fputcsv ($csv_handler,$csv,$this->helper->getCsvDelimiter());
            //$csv[] = '';

    } //end foreach

    fclose ($csv_handler);

    $this->_logger->debug('Running Cron from Altravista');
    return $this;
}

}

The cron run correctly and print log


texts: How to show custom Attribute in items invoiced below the SKU in magento2.2.0?

texts:
I want to show Custom Attribute in items invoiced below the SKU in
  magento2.2.0?

Please refer below screenshot.


texts:
Does anyone have any experience of a working multi vendor extension. I've looked at a few and they simply don't work well.

Could someone recommend please as been looking for months without success.

I would have thought there would be a de-facto available.

Appreciate a answer from someone who has had some success in this area.

I would consider Magento 1 and Magento 2.


texts: How to filter product collection by matching string like search in Magento 2?

texts:
We have loaded product collection based on category ID, we are further trying to filter the product collection result with query string.

We have tried :

Query string set and get is working fine with below code.

$query = $this->_queryFactory->create();
$query->setQueryText('Joust');
$query->getQueryText();

Add search filter is not working to my product collection.

use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection;

$collection->addSearchFilter($query->getQueryText());

Can any one help me on this query.


texts: Running php files for dev and test purposes

texts: When people are making changes to or adding new php files such as helpers what is the standard way of testing these. Should they be ran like a shell script first or through a browser.


texts:
We use a email template with the following code.
We want to extend this with the product image, but that does not seem to work.

<?php foreach ($this->getOutOfStockItems()->getData() as $item): ?>
<?php echo $item['name'] ?>
<?php endforeach ?>

I already tried <?php echo $item['image'] ?> But that does not seem to work.

How can I get the product image?


texts:
I think I've found magento bug and I just want to know if I'm right here:

Order:
subtotal(without tax)   € 35,72

discount    - € 0,71

Shipping cost:  € 6,00

Subtotal excldued tax      € 41,05 (should be 41.01)

VAT 6.0% (6%)   € 2,10

VAT 21.0% (21%) € 1,26

VAT TOTAL:  € 3,36

GRAND TOTAL     € 44,41 (should be 44.37)

41.05 had 4 cents added extra...
those 4 cents is the difference between tax value
2,14euro (before discount)
2,10euro (after discount).


texts: magento keeps redirecting to my production website and not my staging website

texts:
I uploaded all the files from my production website to my staging website which is hosted on a server.

I then uploaded my entire production DB to my staging server. Additionally, I changed the local xml to reflect the new connection strings.

I changed the secure and unsecure urls in the core_config_data table to reflect my staging website URL.

It's still redirecting to my main website. My staging website is a subdomain, I've never ran into this problem before. Does it have anything to do with it being a subdomain?

stage.mywebsite.com

mywebsite.com

Could it be something in my htaccess file or other config files?

Any help would be greatly appreciated. Thank you.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '23181' for key 'PRIMARY'

Trace:
#0 /home/stage555/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/stage555/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/stage555/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/stage555/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
#4 /home/stage555/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
#5 /home/stage555/public_html/lib/Zend/Db/Adapter/Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
#6 /home/stage555/public_html/app/code/core/Mage/Log/Model/Resource/Visitor.php(174): Zend_Db_Adapter_Abstract->insert('log_visitor_inf...', Array)
#7 /home/stage555/public_html/app/code/core/Mage/Log/Model/Resource/Visitor.php(108): Mage_Log_Model_Resource_Visitor->_saveVisitorInfo(Object(Mage_Log_Model_Visitor))
#8 /home/stage555/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(463): Mage_Log_Model_Resource_Visitor->_afterSave(Object(Mage_Log_Model_Visitor))
#9 /home/stage555/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor))
#10 /home/stage555/public_html/app/code/core/Mage/Log/Model/Visitor.php(168): Mage_Core_Model_Abstract->save()
#11 /home/stage555/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#12 /home/stage555/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Log_Model_Visitor), 'initByRequest', Object(Varien_Event_Observer))
#13 /home/stage555/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#14 /home/stage555/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
#15 /home/stage555/public_html/app/code/core/Mage/Core/Controller/Front/Action.php(64): Mage_Core_Controller_Varien_Action->preDispatch()
#16 /home/stage555/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Core_Controller_Front_Action->preDispatch()
#17 /home/stage555/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#18 /home/stage555/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/stage555/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/stage555/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/stage555/public_html/index.php(87): Mage::run('', 'store')
#22 {main}


texts:
I have a file that's auto generated by my theme. It's called design_storename.css
There are a few changes that weren't updating on my site, so I deleted that file, changed another setting and it regenerated. The old file is still the one loading, and I can't figure out why.
I've cleaned and flushed the caches, regenerated the file a half dozen times, ran setup:di:compile, reindexed, ran redis-cli flushall, cleared the Varnish cache, disabled the varnish cache, and that stubborn file keeps loading.
What can I do to make it go away and be replaced with the new one?
Thanks


texts: How to change the review tab title in magento2

texts:
I have attempted to create a module that would allow me to change the review tab title on the product page, the change isn't taking effect so I must be missing something. Any help is appreciated.

  Custom/Review/etc/module.xml

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

  Custom/Review/Block/Product/Review.php

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Custom\Review\Block\Product;

use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\View\Element\Template;

/**
 * Product Review Tab
 *
 * @author     Magento Core Team <core@magentocommerce.com>
 */
class Review extends Template implements IdentityInterface
{
    /**
     * Core registry
     *
     * @var \Magento\Framework\Registry
     */
    protected $_coreRegistry;

    /**
     * Review resource model
     *
     * @var \Magento\Review\Model\ResourceModel\Review\CollectionFactory
     */
    protected $_reviewsColFactory;

    /**
     * @param \Magento\Framework\View\Element\Template\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param \Magento\Review\Model\ResourceModel\Review\CollectionFactory $collectionFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Review\Model\ResourceModel\Review\CollectionFactory $collectionFactory,
        array $data = []
    ) {
        $this->_coreRegistry = $registry;
        $this->_reviewsColFactory = $collectionFactory;
        parent::__construct($context, $data);

        $this->setTabTitle();
    }

    /**
     * Get current product id
     *
     * @return null|int
     */
    public function getProductId()
    {
        $product = $this->_coreRegistry->registry('product');
        return $product ? $product->getId() : null;
    }

    /**
     * Get URL for ajax call
     *
     * @return string
     */
    public function getProductReviewUrl()
    {
        return $this->getUrl(
            'review/product/listAjax',
            [
                '_secure' => $this->getRequest()->isSecure(),
                'id' => $this->getProductId(),
            ]
        );
    }

    /**
     * Set tab title
     *
     * @return void
     */
    public function setTabTitle()
    {
        $title = $this->getCollectionSize()
            ? __('The Reviews %1', '' . $this->getCollectionSize() . '')
            : __('The Reviews');
        $this->setTitle($title);
    }

    /**
     * Get size of reviews collection
     *
     * @return int
     */
    public function getCollectionSize()
    {
        $collection = $this->_reviewsColFactory->create()->addStoreFilter(
            $this->_storeManager->getStore()->getId()
        )->addStatusFilter(
            \Magento\Review\Model\Review::STATUS_APPROVED
        )->addEntityFilter(
            'product',
            $this->getProductId()
        );

        return $collection->getSize();
    }

    /**
     * Return unique ID(s) for each object in system
     *
     * @return array
     */
    public function getIdentities()
    {
        return [\Magento\Review\Model\Review::CACHE_TAG];
    }
}


texts: Magento 2: limit staging emails to dev only

texts:
Just realized that our staging environment is sending out emails to customers, which is not good.

How can I limit the emails to developers only? Ideally I would like to:

provide a list of allowed emails
provide a default email to which all emails not in "allowed" list would be
routed to

Already did a google search and didn't come up with anything useful.


texts: Admin Panel Grid - filter without column

texts:
Does it possible to create filter on grid without related column in grid? Now I'm using code like this:
<column name="name" sortOrder="30">
       <settings>
           <filter>text</filter>
           <label translate="true">Name</label>
       </settings>
</column>

Does Magento allow to this?


texts: how to properly add inner join condition to layered filter query?

texts:
I need to add inner join condition in layered navigation filter basic query line this:

    SELECT `e`.*,
           `cat_index`.`position` AS `cat_index_position`,
           `price_index`.`price`,
           `price_index`.`tax_class_id`,
           `price_index`.`final_price`,
           IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`,
           `price_index`.`min_price`,
           `price_index`.`max_price`,
           `price_index`.`tier_price`
    FROM `catalog_product_entity` AS `e`
    INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id
    AND cat_index.store_id=3
    AND cat_index.visibility IN (2,
                                 4)
    AND cat_index.category_id = '3'
    INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id
    AND price_index.website_id = '1'
    AND price_index.customer_group_id = '4';

It is required to get only products which are exist in custom_translation in field product_id table for certain language_id, but when i add these inner join statement to query to as above like this :

    "query_as_above" INNER JOIN `custom_translation` as `t` ON t.product_id=e.entity_id
    AND t.language_id = 35;

I get empty results, althrought I have correspoding

    mysql> select language_id, product_id, name from custom_translation limit 1;
    +-------------+------------+-----------------------------------+
    | language_id | product_id | name                              |
    +-------------+------------+-----------------------------------+
    |          35 |         55 | German product virtual            |
    +-------------+------------+-----------------------------------+

and

    mysql> select * from catalog_product_entity where entity_id=55;
    +-----------+----------------+------------------+---------+----------------------------------+-------------+------------------+---------------------+---------------------+
    | entity_id | entity_type_id | attribute_set_id | type_id | sku                              | has_options | required_options | created_at          | updated_at          |
    +-----------+----------------+------------------+---------+----------------------------------+-------------+------------------+---------------------+---------------------+
    |        55 |              4 |                4 | virtual | 5a310fed97af665e5576796e69a58f8d |           1 |                0 | 2016-02-17 13:59:31 | 2016-02-18 23:36:40 |
    +-----------+----------------+------------------+---------+----------------------------------+-------------+------------------+---------------------+---------------------+

Why my statment fails and How to craft the inner join condition properly ?
In result I would love the have something like:

    "layered_filter_query" INNER JOIN `custom_translation` as `t` ON t.product_id=e.entity_id
    AND t.language_id  IN (25, 36, 55);

To get all products for which there are entries in table custom_translation for certain language_id's

Thanks !


texts: How to extend store credit functionality in Magento 2 Enterprise Edition

texts:
I want to add amount as store credit by:

-> API

-> Using Payment Method

By default store credit is added when we redeem gift card. But my requirement is to add store credit directly by customer using some payment method and also amount could be recharged using API.

The other important requirement is all amounts have Expiry Date.

For Example:

On 10 July Customer added 20$ as store credit.
Then on July 20 same customer added 40$,

So now total balance will be 60$.

The expiry date should be different for 20$ and different for 40$ w.r t their creation dates.

Also when customer buys some thing the amount should be deducted from the one, which is expiring first.

The below image of table explains the logic more, I populated table as an example, using static values in Model.

My Findings:

If we go to STORES->SALES->GIFT Cards ->Gift Card General Settings: here 'Generate Gift Card Account when Order Item is'

These are two observers that create Gift Card Account, in vendor at:

  Magento\GiftCard\etc\events.xml

I want to understand store credit flow and get full control on store credit transactions to add amount using API or payment method with custom feature of expiry date.

Edit 1: I figured class which is responsible for applying store credit:

Magento\CustomerBalance\etc\di.xml

<preference for="Magento\CustomerBalance\Api\BalanceManagementInterface" type="Magento\CustomerBalance\Model\BalanceManagement" />

In class Magento\CustomerBalance\Model\BalanceManagement, I am trying by making plugin of apply() methhod as afterApply():

namespace Vendor\Module\Plugin;

use \Magento\CustomerBalance\Api\BalanceManagementInterface;

class WalletPlugin
{
    /**
     * @var \Magento\Quote\Api\CartRepositoryInterface
     */
    protected $cartRepository;

    /**
     * @param \Magento\Quote\Api\CartRepositoryInterface $cartRepository
     */
   public function __construct(
        \Magento\Quote\Api\CartRepositoryInterface $cartRepository
    ) {
        $this->cartRepository = $cartRepository;
    }
    /**
     * {@inheritdoc}
     */
    public function afterApply(Magento\CustomerBalance\Model\BalanceManagement $subject, $result)
    {
        /** @var \Magento\Quote\Api\Data\CartInterface $quote */
        echo "I am here";
        exit;

    }
}

Edit 2:
This is the class which redeems gift card

  Magento\GiftCardAccount\Model\Redeemer

But no luck yet.


texts: Magento 1 - Patch SUPEE-10415 is not applied

texts:
I have tried to apply path SUPEE-10415 to magento 1.9.1.0, but its won't succedeed.

Please find the report below.
Checking if patch can be applied/reverted successfully.

ERROR: Patch can't be applied/reverted successfully.

  checking file app/Mage.php checking file
  app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php checking
  file app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php
  checking file app/code/core/Mage/Adminhtml/Block/Review/Add.php
  checking file app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php
  checking file app/code/core/Mage/Adminhtml/Controller/Action.php Hunk
   #1 FAILED at 186. 1 out of 1 hunk FAILED checking file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php Hunk #1
  FAILED at 142. 1 out of 1 hunk FAILED checking file
  app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php
  checking file app/code/core/Mage/Api/Helper/Data.php checking file
  app/code/core/Mage/Api/Model/Server/Adapter/Soap.php checking file
  app/code/core/Mage/Api/Model/Wsdl/Config.php checking file
  app/code/core/Mage/Api/Model/Wsdl/Config/Base.php checking file
  app/code/core/Mage/Core/Helper/String.php checking file
  app/code/core/Mage/Core/Model/File/Validator/Image.php Hunk #1 FAILED
  at 90. 1 out of 1 hunk FAILED checking file
  app/code/core/Mage/Core/etc/config.xml Hunk #1 FAILED at 456. 1 out of
  1 hunk FAILED checking file app/code/core/Mage/Core/etc/system.xml
  Hunk #1 succeeded at 650 (offset -1 lines). Hunk #2 succeeded at 660
  (offset -1 lines). checking file
  app/code/core/Mage/Customer/Model/Customer.php checking file
  app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php
  checking file app/code/core/Mage/Log/Helper/Data.php checking file
  app/code/core/Mage/Rule/Model/Abstract.php checking file
  app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
  checking file app/code/core/Zend/Form/Decorator/Form.php checking file
  app/design/adminhtml/default/default/template/backup/dialogs.phtml
  Hunk #1 FAILED at 132. 1 out of 1 hunk FAILED checking file
  app/design/adminhtml/default/default/template/sales/billing/agreement/view/tab/info.phtml
  checking file
  app/design/adminhtml/default/default/template/xmlconnect/edit/tab/content.phtml
  checking file
  app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/image_edit.phtml
  checking file app/locale/en_US/Mage_Adminhtml.csv checking file
  app/locale/en_US/Mage_Customer.csv checking file
  js/mage/adminhtml/backup.js checking file
  lib/Varien/Filter/FormElementName.php


texts: display email in different row in contact form

texts:
in contact us page name and email are displaying in same row.

what changes i have to do to display email ,below name in demo site.


texts: 'Is home page' condition with different store views in magento not working

texts:
I want to show banner only on home page. I am using $this->getIsHomePage() in header.phtml from my theme.
I have also created store views for multiple languages.
But when i change store view on home page $this->getIsHomePage() condition returns false.
I think its due to change in url like this.
/magento/?___store=french&___from_store=default
How to resolve this issue?


texts: build custom shipping method like cod with some extra fields

texts:
i want to create custom shippinng filed to cash on deliver .may be like cod comment a simple text box that will showwhen user selects cod.

How can i do it via module or is there any module or plugin for that , pls guide uf for the same


texts:
I am starting over on a busy Magento store. New fresh installation with no additions installed so only the bits that are required are installed, keeping everything lean and clean.

Once this site is developed and ready for launch, how do I go about importing all of the existing data that we need to keep - i.e. Products, Customers, Orders, etc.

Keeping the existing database (and upgrading it) isn't an option because there is too much stuff in there that is not needed, and it is easier to start with a fresh database. Also, the new site stores lots of settings and contents in the database, and I don't want to go losing all that development work by dumping the new database and replacing it with an upgraded old database.

Any help and pointers greatly appreciated!


texts: Increase display time of exception message in magento 2

texts:
I am using Magento 2.1.3 and I need to display an error message in the shipping information page. Currently I'm using this code:

throw new StateException(__('Shipping is not available on the provided zipcode'));

but the issue is that the error message is just showing 2 or 3 seconds. I need to show this message up to refresh the page.

<?php

namespace Sem\Shipment\Plugin\Checkout\Model;
use Magento\Framework\Exception\StateException;
use Magento\Checkout\Model\Session;
use Magento\Framework\View\Element\Messages;
use Magento\Framework\Message\ManagerInterface;
use Magento\Framework\UrlInterface $urlInterface;

class ShippingInformationManagement
{

    protected $_messageManager;
    protected $jsonResultFactory;
    protected $_checkout;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory,
        \Magento\Framework\Message\ManagerInterface $messageManager,
        \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
        \Magento\Checkout\Model\Session $session,
        \Magento\Framework\UrlInterface $urlInterface

    ) {
        $this->_messageManager = $messageManager;
        $this->jsonResultFactory = $jsonResultFactory;
        $this->_session = $session;
        $this->_urlInterface = $urlInterface;
    }

    public function beforeSaveAddressInformation(
        \Magento\Checkout\Model\ShippingInformationManagement $subject,
        $cartId,
        \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation

    )
    {
        $objectManager =   \Magento\Framework\App\ObjectManager::getInstance();
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $items = $this->_session->getQuote()->getAllVisibleItems();
        $address = $addressInformation->getShippingAddress();
        $postcode = $address->getData('postcode');
        $result = $this->jsonResultFactory->create();
        $pid='';
        if (count($items) > 0){
            foreach ($items as $item)
            {
                $pname= $item->getName();
                $pid=$item['product_id'];
                $carttotal=$item['grand_total'];
                $weight=$item['weight'];
                $sql ="SELECT ca.postcode FROM
                       mgcb_marketplace_product mp
                       JOIN mgcb_marketplace_userdata mu ON mp.seller_id = mu.seller_id
                       JOIN mgcb_customer_entity ce ON mu.seller_id = ce.entity_id
                       JOIN mgcb_customer_address_entity ca ON ce.entity_id = ca.parent_id
                       WHERE(mp.mageproduct_id = '$pid')";
                $qryresult = $connection->fetchAll($sql);
                foreach ($qryresult as $qryresult)
                {
                    $pikup=$qryresult['postcode'];
                }

                foreach($result as $object) {
                    $stat = "NO SERVICE AVAILABLE";
                }
                //print_r($object);
                if($stat=="NO SERVICE AVAILABLE")
                {

                    $msg = "Shipping is not available on the provided zipcode For the following product: <em>" . $item->getName() . "</em>
                            Currently Added Product : " . $linkUrl;
                    $this->_messageManager->addError(__("errorr"));
                    throw new StateException(__($msg));
                }

            }
        }
    }
}


texts: How to create a Grid View Slider. Magento 2

texts:
I'm trying to create View Slider in my custom grid like

for that I've followed This and This but in the both cases when I click on my custom link or button it gives me an error in console

Now I dont know why this is happening in both of the cases.. any help would be really appreciated


texts: How to use collections or joins in Magento 2

texts:
I'm trying to filter by order_item to get a list of orders.

Get all orders where an order item has a price greater than 5.

How would this be done? Collections? Joins?


texts: Trying to upload images via CSV and getting an error

texts:
I'm trying to upload 1800 products using Magento import. I'm not running into any issues aside from the images. When I try to upload them I get an error:

  Imported resource (image) could not be downloaded from external resource due to >timeout or access permissions in row(s)

I searched this error and found it asked before but only in regards to images imported internally from media/import and not from external links. I've narrowed down the issue to images coming from an https URL rather than http. When I import an image using http it doesn't seem to have the same problem. The issue I face is that these images are coming from our ERP system and thus are only available using https.

Anyone have suggestions?


texts: Magento 2 How to disable Postal/Zip code validation from admin while edit customer?

texts:
I am facing a strange issue while adding Customer, I had filled all the fields in the customer form including Zipcode but still, I am getting error

  "Zip/Postal Code" is a required value.

In my form all fields are field. I tried to remove this error by making postal code field optional from Magento configuration:

  Store -> General -> Zip/Postal Code is Optional for

but no luck.

Please help me!


texts: Custom JS is not merged into merged JS file

texts:
I added a custom JS file, that is located under the following:

/skin/frontend/theme/theme/js/frontend.js

But when I run a speedtest, that file is not compressed and loaded into the Magento merged JS file.
It is just loaded outside the merged file.

How can I add this file, so that it will be added to the merged JS?


texts: Simple local extension model extend problem

texts:
I wan't to extend local extension model with this existing config.xml:

<config>
    <modules>
        <Smartwave_All>
            <version>1.0.0</version>
        </Smartwave_All>
    </modules>
    <global>
        ...
        <models>
            <core>
                <rewrite>
                    <layout>Smartwave_All_Model_Core_Layout</layout>
                </rewrite>
            </core>
            <all>
                <class>Smartwave_All_Model</class>
            </all>
        </models>
        ...
    </global>
</config>

This is the file which I wan't to extend with my public function (app/code/local/Smartwave/All/Model/Core/Layout.php):

<?php
class Smartwave_All_Model_Core_Layout extends Mage_Core_Model_Layout
{ ...

Ok, now here are my extension files(app/etc/modules/SampleCompany_Test.xml):

<?xml version="1.0"?>
<config>
    <modules>
        <SampleCompany_Test>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Smartwave_All/>
            </depends>
        </SampleCompany_Test>
    </modules>
</config>

And my config.xml (app/code/local/SampleCompany/Test/etc/config.xml):

<?xml version="1.0"?>
<config>
    <modules>
        <SampleCompany_Test>
            <version>0.1</version>
        </SampleCompany_Test>
    </modules>
    <global>
        <models>
            <smartwave_all>
                <rewrite>
                    <core_layout>SampleCompany_Test_Model_Layout</core_layout>
                </rewrite>
            </smartwave_all>
        </models>
    </global>
</config>

And of course my Layout.php (app/code/local/SampleCompany/Test/Model/Layout.php):

class SampleCompany_Test_Model_Layout extends Smartwave_All_Model_Core_Layout
{
    public function myNewFunction()
    {
        ...
    }
}

I can't get this to work. Main problem is because Smartwave All is rewriting Mage/Core/Model/Layout.php core file and it is in conflict with my other extension which do the same (rewrites Layout.php). Now I wan't to extend Smartwave All instead of core Layout.php.

Thanks for any suggestions on this.


texts: Magento 2: Get rendered block from external script

texts:
I would like to get the html of a particular block from an external script and include it somewhere else.

In magento 1.x I would do something like this:

<?php
include_once "app/Mage.php";
umask(0);
Mage::app()->loadArea('frontend');

$layout = Mage::getSingleton('core/layout');

//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();

//get the loaded head and header blocks and output
$headBlock = $layout->getBlock('head');
$headerBlock = $layout->getBlock('header');
echo $headBlock->toHtml() . $headerBlock->toHtml();

https://magento.stackexchange.com/a/5080/23559

I would like to ask you, which is the correct way to achieve this with Magento 2?

Thank you!


texts:
I am using Magento 1.7.x i had signup account for UPS, i had config correctly and working fine
and i am getting the estimate shipping rate on cart page, and i can select best from there.

after choosing when i follow up after shipping address there comes a new shipping fixed Rate.
how can i get rid of that, and update with the shipping price i select earlier.
if Fixed Rate Enable is set to be NO i am not able to continue the shopping process.

Please help me.


texts: I have enabled Advanced reporting in my Admin according to http://docs.magento.com/m2/ce/user_guide/reports/advanced-reporting.html but where do I check the subscription status if it is still "pending" ?


texts: how to share wishlist on Whatsapp in Magento 2

texts:
I want to add whatsapp sharing button on wishlist share page. If any user wants to share his wishlist with anyone then he can share.
Want to share my wishlist on whatsapp. How can I do?


texts: Magento : Unprotected development files? patch

texts:
How to apply "Unprotected development files?" patch in magento EE 1.14.2.3.In my mage report it shows Unprotected development files? as medium so i want to apply this.Please explain
I found need to give permissions to dev folder and .htaccess file.How to do it please


texts: Magento 1.9 strange links in layerer navigation

texts:
I am having this problem in my magento site.
Sometimes in layered navigation when I hit a link of a category or filter I get the right link but in the end I get this:

?gclid=EAIaIQobChMIxJfLq9zm2QIVqArTCh34hwpwEAMYAyAAEgIR8fD_BwE

I have this only is some links and not all the time. Sometimes it just disappears. I check and found that it has something to do with google.
I have enabled auto tagging in my adwords account.
Also if you hit the link without this at the end it still works fine.
Can anyone help me? What is this thing and why I see it?


texts: Magento 2 override the product collection(Magento\Catalog\Model\ResourceModel\Product\Collection.php)

texts:
We want to override the product collection model class(Magento\Catalog\Model\ResourceModel\Product\Collection.php)

We flow the below process to override the addAttributeToSort method but not working.

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\Model\ResourceModel\Product\Collection" type="MyModule\SortByQty\Model\ResourceModel\Product\Collection" />
</config>

Collection.php

<?php
/**
 * Copyright Â© 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

namespace MyModule\SortByQty\Model\ResourceModel\Product;

class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
{
    public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
    {
        if ($attribute == 'position') {
            if (isset($this->_joinFields[$attribute])) {
                $this->getSelect()->order($this->_getAttributeFieldName($attribute) . ' ' . $dir);
                return $this;
            }
            if ($this->isEnabledFlat()) {
                $this->getSelect()->order("cat_index_position {$dir}");
            }
            // optimize if using cat index
            $filters = $this->_productLimitationFilters;
            if (isset($filters['category_id']) || isset($filters['visibility'])) {
              $this->getSelect()->joinLeft(
            array('_inventory_table'=>'cataloginventory_stock_item'),
            "_inventory_table.product_id = e.entity_id ",
            array('qty')
        )->order(array('_inventory_table.qty DESC'));
            } else {
                $this->getSelect()->order('e.entity_id ' . $dir);
            }

            return $this;
        } elseif ($attribute == 'is_saleable') {
            $this->getSelect()->order("is_saleable " . $dir);
            return $this;
        }

        $storeId = $this->getStoreId();
        if ($attribute == 'price' && $storeId != 0) {
            $this->addPriceData();
            if ($this->_productLimitationFilters->isUsingPriceIndex()) {
                $this->getSelect()->order("price_index.min_price {$dir}");
                return $this;
            }
        }

        if ($this->isEnabledFlat()) {
            $column = $this->getEntity()->getAttributeSortColumn($attribute);

            if ($column) {
                $this->getSelect()->order("e.{$column} {$dir}");
            } elseif (isset($this->_joinFields[$attribute])) {
                $this->getSelect()->order($this->_getAttributeFieldName($attribute) . ' ' . $dir);
            }

            return $this;
        } else {
            $attrInstance = $this->getEntity()->getAttribute($attribute);
            if ($attrInstance && $attrInstance->usesSource()) {
                $attrInstance->getSource()->addValueSortToCollection($this, $dir);
                return $this;
            }
        }

        return parent::addAttributeToSort($attribute, $dir);
    }
}

Please, can you help on above issue? any references and suggestion are highly appreciated.


texts:
I have a US based website when customer placed order, in their order "Placed from IP" showing my ip in each order also, I have few custom module for tracking order and user activity in these modules ip is showing mine. it's strange.I am not found the issue.Also when i'm printing ip from root folder then it's working fine.

My module code :

function getUserIP()
    {
        $client  = @$_SERVER['HTTP_CLIENT_IP'];
        $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
        $remote  = $_SERVER['REMOTE_ADDR'];

        if(filter_var($client, FILTER_VALIDATE_IP))
        {
            $ip = $client;
        }
        elseif(filter_var($forward, FILTER_VALIDATE_IP))
        {
            $ip = $forward;
        }
        else
        {
            $ip = $remote;
        }
        return $ip;
    }

But my concern is Magento default sales/order code should be run fine.


texts:
I have installed Magento 2.3 and then installed custom paid theme.After this when i open my contact page the page shows 404 error. i have check the controller URL and other things to debug but i don't found any solution.

so my question is , do i need to create a CMS page for contact?
I have enabled the page from Back-end but still 404 Error.
I disabled all the module and changed the theme to Luma but still 404 error.

  http://prntscr.com/nw35ty

Any one tell me how i can debug this?


texts: Magento: Display Configurable Product Image to Match Filter Selection

texts:
Example: I have a configurable product, it has 2 colour options - green yellow and white blue. It is located in t-shirts category.

When I navigate to t-shirts category on my website I see my products thumbnail, which is an image I have manually selected as thumbnail when I created the configurable product (green yellow as this is more popular colour).

Now I select colour white blue in the magento layered filter on left hand side of the screen and as you would suspect only products containing white blue should remain, my product has a white blue option (one of the configurable product variations), but thumbnail hasn't changed, its still what I have manually selected previously. I would like the image that I have attached to white blue option of this product to be displayed. Anyone know, how to get this thumbnail to change according to filter selection?

Image uploaded


texts: Magento or Headless Magento (React with Magento pwa or Magento 2 default is better)

texts: I am new in Magento and I am preparing to start learning the cms. I'd like to know which has lower learning curve, just Magento or React+Magento. (I already know reactjs)


texts: Magento2: How to keep website online/in the air when working on Magento like command line

texts:
When you do things like deploy compile website, having it in developer mode things like that

You get your website for example in:

  http error 500.

How to keep everything working, online in the air, so the visitors always see your website online?


texts: Live upgrade attempt and I get a table error 'coupon_aggregated_updated' doesn't exist

texts:
I was able to upgrade on my local no problem, but now I am trying on the server and I get this error? I looked at the ugpraded db and I don't have that table.

Error in file: "app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php" - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'coupon_aggregated_updated' doesn't exist

Magento EE 1.12


texts: Magento 2 : How to display custom values under product on cart page?

texts:
I have manually added one combo box on product view page. Now when customer add that product to the cart, I want to display selected combo box value on cart page.

Please refer my below screen shot to get a better idea.


texts: How to send invoice after shipment e-mail?

texts:
I am looking to set up the transactional e-mails in a way that goes order confirmation (after checkout), shipment (manually) the invoice after shipment.

This is so that I can check stock before invoicing the customer.

At the moment invoices send automatically after the order along with the order confirmation e-mail.

Is there a way to change this so that invoices can be sent manually?

The site is running on Magento Community Edition v1.8.1


texts:
If i update 10K products and re-indexed it first time it will re-indexed all.
But if i update 10 more product so it will require re-index so my question is is it re-index all the products from starting and re-index 10k products or it will only re-index 10 products.
Like wen i it re-index query and check my SQL sow processlist it will run from 1 or it will only re-index after 10k products.


texts: How can I reload shipping methods when custom checkbox address attribute clicked?

texts:
Is there a way to update the shipping methods when clicked on my custom checkbox attribute?
When I change the city or the postal code the shipping method reloads but not with my custom checkbox.

Thanks!


texts: Magento 1.9: Check Cart contains only selected category of products

texts:
My observer condition based on Cart products, how to check Cart contains only selected category of products?

What event do I need to use?


texts: Upgrade from 1.9.2.4 to 1.9.3.1 results in no results on search Collection.php issue

texts:
I'm using the default Collection.php for search.

With the new 1.9.3.1 the search bar for typing the search shows the search terms so it is clear it has results but then the results page says "Your search returns no results."

I replaced the /app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php file with the old 1.9.2.4 and now I get results.

Yes, this works but this is not a good solution.
Since others are not having this issue, what might be wrong with my configuration causing the new version to fail.

Did not include the code since it should be standard:

-rw-rw-rw- 1 bitnami bitnami 2791 Feb 24  2016 Collection.php
-rw-rw-rw- 1 bitnami bitnami 6789 Nov 30 15:29 Collection.php-new-2016-12-14

Notice the big difference in file length between the new version and the old. Assume some major changes and one of them must have a conflict with some other setting or maybe customization I'm not aware of.


texts: update magento products details through new "attribute value" by uploading in excel sheet

texts:
we uploaded some 200 products, we created "attribute" = "size" and we have to update the value of

"size" for all 200 products. we are planning to update through excel sheet in .csv format.

what is the method we have to follow in excel sheet.


texts: I am working on Magento cron jobs issue. We have 50+ cron jobs in system which are scheduled and runs 24/7. But, there are some cron jobs like aoescheduler_heartbeat, aoecachecleaner, aoequotecleaner and captcha_delete_expired_images not running sometimes(ie with in 24hrs, 3 or 4 times not working). Is this due to configuration problem or memory problem or some other problem. If anyone of You know the solution, please post. Thanks in advance.


texts: Magento is not sending any emails, no confirmation mails, no invoice mails, no shipment mails or anything. I have configured all the settings in admin also. I am working on linux based shared hosting.


texts: Javascript:void(0) error with installed extension

texts: I integrated this extension Free Magento Custom Menu for my top navigation but when I add it and I would like to navigate over the menu I have this error message "javascript:void(0)" for redirection.


texts:
I have created an order and invoice is generated. After creating the invoice, the customer asked to cancel the order.

How to cancel the invoice created order.