texts:
I'm adding some tracking code on my order confirmation page. But I'd like it to change what it reports for items with custom options.

Below is what my PHP code looks like now to get the variables (i stripped out the javascript echoes for simplicity). And this works.

But I've got a bunch of items on the site that have custom options, so they're reporting (for example) as three separate skus 12345-red, 12345-green, 12345-blue.

And we'd prefer to strip off the custom option info, and just have the single parent sku of 12345.

$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());

$items = $order->getAllItems();

foreach($items as $item) {
    $_sku = $item->getSku();
    $_itemprice = $item->getPrice();
    $_itemqty = $item->getQtyOrdered();
}

What call do I make instead of $item->getSku(); to get the sku without the custom-options info attached to it?


texts: Submit a form in Magento 2 custom module?

texts:
I created a custom module. There is a form which user submit. I want to capture the post data. So how to create a post route ?

This is my routes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="standard">
    <route id="contactus" frontName="contactus">
        <module name="My_ContactUs" />
    </route>
</router>

And I have only 1 controller which display the form.


texts: Magento : Fixed Amount Discount on Whole Cart Promo Not Working

texts:
I've created a promo rule for customers who spend $150, I will give $50 discount. Please find attached screenshots for conditions and actions settings.

When cart total is above $150, promo rule isn't getting applied. Promo rule applies, only when subtotal is $150 + ($150 * 10%).

Can anyone help me fix this issue. Thanks


texts: Transactional email invoice Qty column too far left

texts:
Small problem but bugging me. Transactional email invoice quantity column too far left causing pricing not to line up. View in outlook, iphone email & gmail all look off but android email on phone looks fine with columns all lining up.
Driving me crazy.  Thanks  - Update, noticing the blue box/cell with shipping, tax and final total might have to go across whole page which would push over line items. In email order view, that cell/box shows across the invoice bottom.


texts: Why magento shows cart when a product is added to cart

texts:
It is just crazy that magento shows the cart when a product is added to the cart. I didn't do anything it just started acting like this by itself. weird.

How do I unset this? I don't want the items in the cart to be displayed when i add a product to the cart.


texts: getting problem in add custom product attribute in PDF invoice magento1.9

texts:
I am trying to add custom attribute "publisher name" below product name in PDF invoice. Publisher is a custom attribute created by me.

I have copied

app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php

to

app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php

And have added some code in default.php but this is not working properly. It is showing attribute id like 250,251 in the pdf but I want it to show publisher name

I add following code in default.php

$Publisher = $this->getPublisherValue($item);

 $lines[1][] = array(
        'text'  => Mage::helper('core/string')->str_split($Publisher, 35),
        'feed'  => 35
    );

private function getPublisherValue($item)
    {
        $prod = Mage::getModel('catalog/product')->load($item->getProductId());

        if(($return_publisher = $prod->getPublisher()))
            return $return_publisher;
        else
            return 'N/A';
   }


texts:
I just installed php-cuong customer avatar on magento 2.1.8.

My problem is that when I want to upload an image in customer panel it has error and not to upload image. In admin panel, customer tab when I choose a customer and upload image it saves in pub/media but not show avatar and sends error.


texts: Custom Header & footer Footer for checkout pages

texts: How can i add a different header and footer in magento 2 just for the checkout pages


texts: checkboxes on layered navigation in the filter block

texts:
which core files (controller,model and resource files) specifically needs to be edited to add check-boxes on layered navigation in the filter block in Magento.

What I have done till now is that I have added check-boxes and a JavaScript file which extracts ids of the products and then sends them via GET parameter to the controller.

I am not able to proceed beyond this since I am new Developer and do not know how is the controll passed and handled.

so, I want to know which all files do I need to override to make this feature functional?


texts:
guys I am trying to add a button in the Shopping Cart page named "Save Cart" near "Update Cart Button".

I have the following folder structure:

Mustard

-- SavedCart

-------Block

-----------Cart.php

Setup

---InstallSchema.php

etc

--di.xml

--module.xml

view

---frontend

-----layout

---------checkout_cart_index.xml

template

---save_cart_button.phtml

So here are the codes

Cart.php

<?php

namespace Mustard\SavedCart\Block;

use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;

class Cart extends \Magento\Checkout\Block\Cart
{

    public function __construct() {

        parent::__construct();
    }

}

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\Checkout\Block\Cart"
            type="Mustard\SavedCart\Block\Cart"/>
</config>

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="Mustard_SavedCart" setup_version="1.0.0">
</module>
</config>

checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="checkout.cart"
        template="Mustard_SavedCart::save_cart_button.phtml"/>
</body>
</page>

save_cart_button.phtml

<form>
<button type="button" name="saveCart">
        Save Cart
</button>
</form>

now with this configuration in place when in run magento , i get a blank page at localhost/magento21/checkout/cart

Can anyone help me Please ?
I need to add a button in the shopping cart page near the Update Shopping Cart button.


texts: Magento 2.2.0 - __construct() must be an instance of Magento\Framework\View\Result\PageFactory,

texts:
Controller File

<?php

namespace Magento2\HelloWorld\Controller\Index;

use \Magento\Framework\App\Action\Action;
use \Magento\Framework\View\Result\PageFactory;
use \Magento\Framework\View\Result\Page;
use \Magento\Framework\App\Action\Context;
use \Magento\Framework\Exception\LocalizedException;

class Index extends Action
{

    /**
     * @var PageFactory
     */
    protected $resultPageFactory;

    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     *
     * @codeCoverageIgnore
     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
     */
    public function __construct(
        Context $context,
        PageFactory $resultPageFactory
    ) {
        parent::__construct(
            $context
        );
        $this->resultPageFactory = $resultPageFactory;
    }

    public function execute()
    {

        $resultPage = $this->resultPageFactory->create();
        return $resultPage;
    }
}

It throws below exception while trying to run controller, while I have already mentioned use \Magento\Framework\View\Result\PageFactory;

Fatal error: Uncaught TypeError: Argument 2 passed to Magento2\HelloWorld\Controller\Index\Index::__construct() must be an instance of Magento\Framework\View\Result\PageFactory

If I simply use below, it works

<?php

namespace Magento2\HelloWorld\Controller\Index;

use \Magento\Framework\App\Action\Action;
use \Magento\Framework\View\Result\PageFactory;
use \Magento\Framework\View\Result\Page;
use \Magento\Framework\App\Action\Context;
use \Magento\Framework\Exception\LocalizedException;

class Index extends Action
{

    public function execute()
    {

        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();
    }

}

How can I resolve the __construct() error ?


texts: We have magento website which is  in version2. We are developing a website which is in  version to 1.9.3. Can we export product data from admin panel of magento 2 and directly export to 1.9.3 site?


texts: Magento PWA how to add css for static block content

texts:
I am learning PWA on magento 2. I trying to add my static block and custom.css file into home page but it not working. So anybody have solution help me apply all my custom css content into homepage.
Homepage.js
import React from 'react';
import cmsBlock from "@magento/venia-ui/lib/components/CmsBlock";
import defaultClasses from './custom.css';

const HomePage = props => {
    const content = cmsBlock({"identifiers": "sale-block"});
    return (

{content}

    );
};
export default HomePage;

custom.css
.blocks_promo {
    margin-bottom: 16px;
    background: red;
}
.blocks_promo .info{
    display: block;
    color: red;
}
:blobal(.block-promo-wrapper) {
    float: left;
    width: 50%;
}

Now I see class .blocks_promo is affecting but class .block-promo-wrapper is not. Thanks ALl


texts:
I am creating a custom module, everything is working fine but on view page, My phtml file calling first and then header is coming.

I am calling and setting data like this :

IndexController.php

class MagePeople_Mymodule_IndexController extends Mage_Core_Controller_Front_Action
{

    public function indexAction()
     {

          $this->loadLayout();
          $this->renderLayout();
     }

    public function editMeasurementAction()
    {
        $customer = Mage::getSingleton('customer/session')->getCustomer();
        $customerId = $customer->getId();

        $proid = $this->getRequest()->getParam('proid');
        $collection = Mage::getModel('mymodule/usermeasurement')->getCollection();
        $collection->addFieldToFilter( 'product_id', $proid );
        $collection->addFieldToFilter( 'user_id', $customerId );
        $collection->getFirstItem()->getData();

        foreach ($collection as $collect) {
            $response[]     = array(
            'proid'         => $collect->getProductId(),
            'stnd_size'     => $collect->getStndSize()
            );
        }

        $this->loadLayout();
        $this->getResponse()
                    ->setBody($this->getLayout()
                            ->createBlock('mymodule/measurescreen')
                            ->setData('response', $collect)
                            ->toHtml());
        $this->renderLayout();

    }
}

Block file function is below :

    protected function _construct()
    {
        $this->setTemplate('mymodule/measurescreen.phtml');
    }

I am not sure how to call block and set and retrieve data if I follow another approach.
Can someone please tell me what is wrong in this and why it is showing like this.


texts: Fatal error: Call to a member function setData() on boolean

texts:
Having issue with this code.

$table2 = Mage::getModel('tag/tag_properties');
            $table2->setData(array('tag_id'=>$lat,'store_id'=>1,'base_popularity'=>0));
         $table2->save();


texts: Something went wrong with the subscription alert in Magento2

texts:
I have a clean Magento 2.1.0 installation running on my server, and for some reason the newsletter subscription box keeps displaying the following error: "Something went wrong with the subscription." However, the address is successfully stored in the Database.

Has anyone else had this error recently and how did you fix it? I've tried googling it but not much luck as the Magento GitHub states this is a bug that has been fixed in earlier releases.

Thanks.!


texts: Credit Memo "Issue Refund Online" Pulls Payment To Customer from which Payment Source?

texts:
When refunding an order and creating a credit memo on Magento 2.0, will it pull finances through the payment gateway the customer originally purchased through? An example is we had customer that paid for a product through our Paypal Express gateway. We need to cancel and refund the order. If I select "refund online" in credit memo, will it refund the customer through paypal express automatically not authorize.net or any of the other payment options we have available?

I am trying to double check where Magento sends funds through and if it gives me the option to select where they come from. We would like our refunds to come from where the payment option the customer selected and used.

Any pointers or information would be very helpful. Thanks!


texts: Create a custom shipping method based on shipping country and weight from external source

texts:
We are having the problem that we need a custom shipping carrier.

We have a third party vendor that does all the shipping for us, but also determines the shipping costs.

The shipping costs are based on:

weight of a single product
shipping destination

So whenever a customer is trying to checkout I need a custom shipping carrier that either calculates the weight of all products in the quote and also transmitting the desired shipping country to a third party vendor.

This call shall return the final amount for the shipping carrier.

Now the question is:

How can I create a new shipping carrier that checks the weight from the quote and the desired shipping country, sends it on request to another web resource and uses the return value as shipping amount?

The third party vendor does not give us his calculation algorithm, so there is no other way then doing a request each time a customer is trying to checkout.


texts: How to create custom sticky admin system messages?

texts:
In my Magento2 module I want to create admin system messages that are sticky and show up on every page in the adminhtml until the problem is solved. It's something important that the admin needs to address, otherwise the store will be severely impacted. But once the detected problem was solved, the message should go away.

As an example I'm looking at the messages that tell me when indexers or caches need to be refreshed. How can I create messages like that?

I was looking at the core module AdminNotification which seems to be uniquely responsible for this. It looked at the involved templates and blocks to display these messages, and that all makes sense, but where are they created? I can't seem to figure out how to create these notifications.

There is a db table called admin_system_messages which stores something related to that, but I don't understand the content. The field identity just contains a long hex number. I took such a number and searched for it over all code and the entire database to find references, but nothing turned up. How does the module extract "One or more of the Cache Types are invalidated [...]" from this?

To be clear, I have seen the mechanism to add temporary messages which will be shown to the user ONCE, such as the confirmations when you delete or save something and it tells you that it was successful. This is NOT what I'm looking for, I want permanent messages on every page. I know it's obtrusive, but I'm convinced it's necessary in my case.


texts: Subtotal for Free Shipping wrong since SUPEE-8788 patch

texts:
I installed the SUPEE-8788 patch on our Magento installation (it was the latest version before that.)

However since the installation a weird bug pops up, which wasn't there before.

We have some Shopping Cart Price Rules, granting people Free Shipping from a certain subtotal (subtotal is TAX INCLUDED). This worked fine before as expected. Now the subtotal it uses in the calculation does NOT include the tax.

So let's have the example of Belgium, which has a 21% tax rate.

Conditions:
If ALL  of these conditions are TRUE :

Subtotal  equals or greater than  59,95
Shipping Country  is  Belgium

Action:
Free Shipping

However, now since the update, the free shipping isn't granted at the expected 59.95 euros but at 72.54 euro (59.95 price (which actually already includes the tax) + 12.59 tax)

I tried to play around with the calculations settings at the configuration page but that doesn't seem to do much.


texts: How to create multi select attribute for customer using install script?

texts:
I'm following many articles but i'm not able create multi select attribute.
and i'm getting following error.

  a:5:{i:0;s:50:"Source model "" not found for attribute "exinent1"";i:1;s:3008:"#0 C:\wamp\www\magento8\app\code\core.

and my script is:

<?php
$installer = $this;
$installer->startSetup();

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$entityTypeId     = $setup->getEntityTypeId('customer');
$attributeSetId   = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$setup->addAttribute('customer', 'exinent1', array(
    'input'         => 'multiselect',
    'type'          => 'varchar',
    'backend'       => 'eav/entity_attribute_backend_array',
    'label'         => 'exinent1',
    'visible'       => 1,
    'required'      => 0,
    'user_defined'  => 1,
    'option'        => array (
                'value' => array('optionone' => array('First Option'),
                         'optiontwo' => array('Second Option'),
                         'optionthree' => array('Third Option'),
                         )
                        ),

));

$setup->addAttributeToGroup(
 $entityTypeId,
 $attributeSetId,
 $attributeGroupId,
 'exinent1',
 '100'
);

$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'exinent1');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();

$setup->endSetup();

and config.xml is:

<?xml version="1.0"?>
<config>
    <modules>
        <Exinent_Cusatt>
            <version>3.1.5.6</version>
        </Exinent_Cusatt>
    </modules>
    <global>
    <resources>
    <exinent_cusatt_setup>
        <setup>
            <module>Exinent_Cusatt</module>
        </setup>
    </exinent_cusatt_setup>
</resources>
    </global>
</config>


texts: Creating a category programmatically using category factory, category data gets created in DB, but category is not visible in admin

texts:
Pretty much self-explanatory.

I create a category model using category factory and then use the ->save method to save the category. I can see some data created, along with catalog_category_entity, but the category is not visible in admin.
This is the code that I use:

public function createCategory($categoryName="", $categoryDescription="", $parentCategoryId=2, $position=1) {

        /// Add a new sub category under root category
        $categoryTmp = $this->cf->create();
        $categoryTmp->setName($categoryName);
        $categoryTmp->setIsActive(true);
        $categoryTmp->setUrlKey("cat-" . $categoryName);
        $categoryTmp->setData("description", $categoryDescription);
        $categoryTmp->setParentId($parentCategoryId);
        $categoryTmp->setStoreId(0);
        $categoryTmp->setPath("2");

        $categoryTmp->save(); //Using this save method, because the perfion import procedure is not time-demanding
        return $categoryTmp;
    }

What am I missing here?


texts: Is it possible to install magento 2.1 theme in magento 2.2.3?

texts:
Is it possible to install a theme form magento 2.1 to  magento 2.2.3 ?

If possible, how to do that? tell me guys. I need to use the old paid theme in latest magento 2.2.3


texts:
I have some issues regrading migration from ubuntu (Server 1) to windows MySQL (Server 2). First of all, I had installed MySQL migration tools on Server 2, and when i try to migrate the data, Server 1 does not migrate the data. Some of the views stated syntax error and unable to create in the migration.
Then when I try to migrate with MySQL from the migration tab, all tables and views and routines were successfully created, but it will generate errors like MySQL server had gone away. So i double check on those tables, on which it is a big tables with carry lot of data inside.
ntnsap.dtrtbl:Finished copying 55 rows in 0m02s
ntnsap.bgttbl:Copying 17 columns of 280637 rows from table ntnsap.bgttbl
ERROR: ntnsap.bgttbl:Failed copying 30617 rows
ERROR: ntnsap.dptmas:mysql_query(SELECT count() FROM dptmas): MySQL server has gone away
ntnsap.dptmas:Finished copying 0 rows in 0m00s
ERROR: ntnsap.dlrtbl:mysql_query(SELECT count() FROM dlrtbl): MySQL server has gone away
ntnsap.dlrtbl:Finished copying 0 rows in 0m00s
ERROR: ntnsap.tmptrt:mysql_query(SELECT count() FROM tmptrt): MySQL server has gone away
ntnsap.tmptrt:Finished copying 0 rows in 0m00s
ERROR: ntnsap.rbttbl:mysql_query(SELECT count() FROM rbttbl): MySQL server has gone away
ntnsap.rbttbl:Finished copying 0 rows in 0m00s
ERROR: ntnsap.tihfil:mysql_query(SELECT count() FROM tihfil): MySQL server has gone away
ntnsap.tihfil:Finished copying 0 rows in 0m00s
ERROR: ntnsap.lidtbl:mysql_query(SELECT count() FROM lidtbl): MySQL server has gone away
ntnsap.lidtbl:Finished copying 0 rows in 0m00s
So i run some of the scripts like this,
-- SHOW VARIABLES LIKE 'sql_mode'; -- show status on SQL mode
-- set sql_mode=''; -- change the mode to non strict mode as to copy the data without checking the format.
-- select @@sql_mode; -- to show mysql mode status.
-- set global max_allowed_packet=104857600; -- allow maximum packet to 100mb for data transfer.
After applying those scripts, the migration still does not run correctly, it will just lost connection from copying large table to Server 2. I have try to migrate the data from server 1 to my PC and the migration completed without any error.
Server 1 Specification
OS: ubuntu 18.4
MySQL Server Ver: 5.7
Processor: Xeon E3400 Series
RAM: 4GB
Server2 Specification
OS: Windows Server 2012 R2
MySQL Server Ver: 5.7
Processor: Xeon E3400 Series
RAM: 4GB
My PC Specification
OS: Windows 10 Pro 1909
MySQL Server Ver: 5.7
Processor: Corei7 10700 Series
RAM: 16GB
Please Advice.
Thank You


texts: Why can't I inject the ProductRepositoryInterface in Magento 2?

texts:
I have a controller action into which I would like to inject the product-repository

namespace Nosto\Tagging\Controller\Export;

use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Backend\App\Action;
use Magento\Framework\App\Action\Context;

class Test extends Action
{

    private $_productRepository;

    public function __construct(
        Context $context,
        StoreManagerInterface $storeManager,
        ProductRepositoryInterface $productRepository
    ) {
        parent::__construct($context);
        $this->_storeManager = $storeManager;
        $this->_productRepository = $productRepository;
    }

No matter what order I put my constructor arguments, Magento's dependency-injection always injects an invalid class for the productRepository argument leading PHP to throw and argument error. The storeManager getd injected just fine. Clearing the caches haven't helped.

Here is the exception thrown:

Recoverable Error: Argument 3 passed to Nosto\Tagging\Controller\Export\Test::__construct() must implement interface Magento\Catalog\Api\ProductRepositoryInterface, instance of Nosto\Tagging\Helper\Account given.

The class names and argument positions in the error message change but the error definition is always the same. Removing the ProductRepositoryInterface from the constructor makes everything fine again.


texts: Show special Price when swatch color for customer group

texts:
System: Magento 1.9.3.1

What we need: We want to show in the product view if the customer (who is grouped in 10% discount customer group) chooses white or black the special price. In our shopping cart there is the discount price showen but not in the product view.

We have a Customer Group that gets a discount of the color white & black of product a

We setup a catalog price rule like that:

If any of this conditions is true:

Color choose is white Color choose is black

Get 10% off white and black.

And is there a solution to get this for the tier price to?


texts: Move category description from admin panel (Layout Update XML) in Magento 2

texts:
Our customer wanted to show category description after the product list by default, so we added a new container and the following line to the default.xml in out theme:

<move element="category.description" destination="additional-content" />

This works great and moves the category description to the desired end of the page.

However, for a few categories we'd like to show the description before the products again. To do so we added following line to the Layout Update XML under admin panel/catalog/categoreis/category/design:

<move element="category.description" destination="category.view.container" before="-" />

This doesn't seem to have any effect at all.

We already tried adding page- and body-tags, and also do it with a <referenceContainer name="some.parent"> around it. Nothing had any effect.

The only thing we can do with the block right now is deleting it with:

<referenceBlock name="category.description"  remove="true" />

Which means the Layout Update XML itself works but it won't move the block to the desired location

Are there different rules for the xml when using Layout Update XML from admin panel compared to the theme's default.xml? Or anything else we are doing wrong?


texts: How display success message after submit the form

texts:
How display success a message after submit the form.
This is my site a link


texts: magento 2 custom online shipping method not showing in frontend

texts:
Magento 2.3.4 i have developed custom online shipping methods it not showing checkout and cart.
Fallowed https://webkul.com/blog/create-custom-shipping-method-in-magento2/

https://magentocommunity.in/how-create-custom-shipping-method-in-magento2-shipping-methord-however-they-are-not-enough-to-make-you-comfortable-in-order-to-be-proportional-with-your-development-in-the-future-the-customization/

but no luck any one knows pls help me


texts: Magento Enterprise Cloud Edition is region specific?

texts: Hi Guys i am facing problem about Magento Enterprise Cloud Edition question Magento that  Enterprise Cloud Edition is region specific ? and is Magento Enterprise Cloud Edition is Available  US Region  only ?  can anyone explain it.


texts: Magento 2: how to add a block in cart under cart summary?

texts:
It's possible to use a widget to insert a block inside the cart summary (at the bottom).

However I'd like to add a block under the cart summary.

I've already created a custom theme which inherits from Blank theme.


texts: Installing Magento via Platform.sh on Ubuntu Desktop. Receiving error

texts:
Using Ubuntu Desktop, I installed LAMP, installed Composer, installed PHP moduled, installed Platform.sh, downloaded the MySQL DB from Platform.sh into a local DB called Magento, pulled the platform.sh project did a build, and this is where I'm stuck at.

The error reads:

janderson@jUbuntu:~/01$ platform build
Building application testm2 (runtime type: php:7.0)
Found a composer.json file; installing dependencies
  Loading composer repositories with package information
  Installing dependencies (including require-dev) from lock file
  Nothing to install or update
  Package sjparkinson/static-review is abandoned, you should avoid using it. Use phpro/grumphp instead.
  Generating optimized autoload files
      Skipped installation of bin bin/grumphp for package phpro/grumphp: file not found in package
  ocramius/package-versions:  Generating version class...
  ocramius/package-versions: ...done generating version class
Running post-build hooks
[2017-12-26 19:47:58] INFO: Starting build.
[2017-12-26 19:47:58] INFO: Verbosity level is not set
[2017-12-26 19:47:58] INFO: Starting build. (magento/ece-tools version: 2002.0.6, magento/magento2-base version: 2.2.2)
[2017-12-26 19:47:58] INFO: Reconciling installed modules with shared config.
[2017-12-26 19:47:58] INFO: Shared config file is missing module section. Updating with all installed modules.
[2017-12-26 19:47:58] INFO: Command: php bin/magento module:enable --all
[2017-12-26 19:47:58] INFO: Status: 255
[2017-12-26 19:47:58] INFO: Output: array (
  0 => 'PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\\Framework\\Config\\CacheInterface in /home/janderson/01/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50',
  1 => 'Stack trace:',
  2 => '#0 /home/janderson/01/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\\Framework\\ObjectManager\\Factory\\Dynamic\\Developer->create(\'Magento\\\\Framewo...\')',
  3 => '#1 /home/janderson/01/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(144): Magento\\Framework\\ObjectManager\\ObjectManager->get(\'Magento\\\\Framewo...\')',
  4 => '#2 /home/janderson/01/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(230): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->resolveArgument(Array, \'Magento\\\\Framewo...\', NULL, \'cache\', \'Magento\\\\Framewo...\')',
  5 => '#3 /home/janderson/01/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->resolveArgumentsInRuntime(\'Magento\\\\Framewo...\', Array, Array)',
  6 => '#4 /home/janderson/01/vendor/magento/f in /home/janderson/01/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50',
)
[2017-12-26 19:47:58] CRITICAL: Command php bin/magento module:enable --all returned code 255

  [RuntimeException]
  Command php bin/magento module:enable --all returned code 255

build

The hook failed with the exit code: 255

Build complete for application testm2
Web root: /home/janderson/01/_www

Cleaning up.

Any idea how to fix this?


texts: Magento 1.7.0.2 override adminhtml: Invalid block type

texts:
I want to override the standard phtml when you edit a product in magento admin.

  File to override:
  C:\wamp64\www\regimeproteine\app\design\adminhtml\default\default\template\catalog\form\renderer\fieldset\element.phtml

I have created a module:

  File: C:\wamp64\www\regimeproteine\app\etc\modules\Pro10_Adminshopscope.xml

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

  File:
  C:\wamp64\www\regimeproteine\app\code\local\Pro10\Adminshopscope\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Pro10_Adminshopscope>
            <version>1.0</version>
        </Pro10_Adminshopscope>
    </modules>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <catalog_form_renderer_fieldset_element>Pro10_Adminshopscope_Block_Adminhtml_Catalog_Form_Renderer_Fieldset_Element</catalog_form_renderer_fieldset_element>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

> The file that will override the original:

  C:\wamp64\www\regimeproteine\app\code\local\Pro10\Adminshopscope\Block\Adminhtml\Catalog\Form\Renderer\Fieldset\Element.phtml

This result in a blanco page, if I remove or rename the target, the default element.phtml is used.

I changed these files for mor info about the error

  C:\wamp64\www\regimeproteine\app\code\core\Mage\Core\Model\Layout.php
  C:\wamp64\www\regimeproteine\app\code\core\Mage\Core\Model\Config.php

the log files:

  exception 'Mage_Core_Exception' with message 'invalid block type:
  Pro10_Adminshopscope_element' in
  C:\wamp64\www\regimeproteine\app\Mage.php:597


texts: Testing how much resources does particular extension spend

texts:
I want to test performance of particular extension I have installed in Magento store. I was thinking about the following method:

Backup live Magento store with 1000 products and 2000 orders to local wamp server. Disable cache and put at the end of index.php file the following:

memory_get_usage(true)

Install the extension and refresh the page. The extension does all tasks on page refresh. The difference in memory_get_usage will tell me about performance for that extension.

Is that a reliable method, is there any better method?


texts: Magento CE 1.7.0.2: Move Terms and Conditions in Onepage Checkout to Step 4 Payment Information

texts:
because of skipping the Review Page for Paypal Express I want to move the Tems and Conditions to the Payment Information as the customer should accept them after selecting Paypal Express (only available payment method) in the Onepage Checkout process.

I managed everything using this Answers
Terms and condition on checkout page
except making the checkbox mandatory.

As far I understood there needs to be a modification in the

..\app\code\local\Mage\Checkout\controllers\OnepageController.php

The check

    if ($requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds()) {
        $postedAgreements = array_keys($this->getRequest()->getPost('agreement', array()));
        if ($diff = array_diff($requiredAgreements, $postedAgreements)) {
            $result['success'] = false;
            $result['error'] = true;
            $result['error_messages'] = $this->__('Please agree to all the terms and conditions before placing the order.');
            $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
            return;
        }
    }

has to be moved from saveOrderAction() to savePaymentAction()

savePaymentAction() has another structure ... if anybody managed this some help would be appreciated.

Thanks,

Kozure


texts: Strange error when trying to save customer data?

texts:
in the admin when I try to change customer information I get the following error:
    "Warning: Invalid argument supplied for foreach() in
/var/www/html/vendor/magento/module-catalog/Model/Product.php on line 1910"

this is even more strange since it only effects some customers but not all.
Can anyone help with this?
thanks.
Can anyone help? thanks.


texts: how to remove css files from a custom template

texts:
I am using a separate template file only for one category For that i have set up a separate page layout everything is working fine

content from my page.xml

<page_product_view_brand translate="label">
        <label>Product View (left)</label>
        <reference name="root">
            <action method="setTemplate"><template>page/product_view_brand.phtml</template></action>
            <!-- Mark root page block that template is applied -->
            <action method="setIsHandle"><applied>1</applied></action>

        </reference>
        <reference name="head">
            <action method="removeItem"><type>skin_css</type><name>css/screen.css</name></action>
        </reference>
    </page_product_view_brand>

This page is uses totally different css files. So i want to remove all the css that is loading other than my required ones.

But i am not able to remove the css from my document.What am i doing wrong

EDIT:
Two places in page.xml

<block type="page/html_head" name="head" as="head">
 <action method="addCss"><stylesheet>css/screen.css</stylesheet></action>
</block>
.....................
<block type="page/html_customhead" name="customhead" as="customhead">
 <action method="addCss"><stylesheet>css/screen.css</stylesheet></action>
</block>


texts: Set table rate shipping to downloadable products

texts:
I am running magento 1.5.1.0 I have a physical product associated with downloadable product. So, I want magento table rate shipping to be also applied to downloadable product. There is no such option in the admin panel.

I have imported csv file in the configuration->sales->shipping methods. It works fine for physical products.

I have also seen this option "Include Virtual Products in Price Calculation". But this is not enabling table rate shipping to downloadable products. Can I extend the functionality of this option to include downloadable products too? If yes which file is to be modified?

Is there any other alternative to get this feature? Please give solutions as per my magento version. Thanks.


texts:
I am trying to learn about creating modules by looking at the core code to see how the directory structure is formatted. I was looking at the Magento 1.9 sales module.

In the adminhtml.xml file, The mage_sales module has children which each have their own action. These actions contain 'adminhtml/sales_order' or 'sales_invoice' for example. How is this method accessed? I thought because it depends on Mage_Sales, this means in the Mage/Sales directory and then the action implies the directory of where that method that's being called. So i assumed it would be in Mage/Sales/Block/adminhtml/'and be here'.

I just want to understand where these actions are located and how they are being called as I can't find them and I would like to know how Magento structures their modules so I have some guidelines to follow by looking at their code.


texts: How to use region updater in magento 2 custom module?

texts:
I am working on the region updater in magento 2. Region Field needs to change based on the selection of country.
Below is my region updater code:

 var billingRegionUpdater = new RegionUpdater('#country', '#region_id',
 '#region', <?php /* @escapeNotVerified */ echo
 $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>,
 undefined, '#zip');

After updating the above code, I am getting the following error,

  TypeError: this.options.regionJson is undefined
      http://magento-dev.com/pub/static/version1495188452/frontend/Rosetta/mpw/en_US/Magento_Checkout/js/region-updater.js
      Line 233

Can someone help me to rectify this issue?

Thanks!!!


texts: Magento2: Product page changes are reflecting immediately even if FPC is enabled

texts:
If you change related products or any other attribute from Magento2's backend, it reflects immediately on the storefront (even though FPC is enabled).

On closer inspection, it is found that it's calling the cache cleaning method on Magento\Catalog\Model\Product::beforeSave():

$this->_cacheManager->clean('catalog_product_' . $this->getId());

Is this a bug or feature in Magento2?

But I bet this is not what we expected. At least the changes done via backend should not be reflected unless the cache is refreshed.

What you say guys?

== EDIT ==

To disable the cache clear happening from backend, I simply removed the functionality from
Magento\Framework\Cache\Frontend\Decorator\TagScope::clean() as:

public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = [])
{
    $result = true;
    /*if ($mode == \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG) {
        $result = false;
        foreach ($tags as $tag) {
            if (parent::clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$tag, $this->getTag()])) {
                $result = true;
            }
        }
    } else {
        if ($mode == \Zend_Cache::CLEANING_MODE_ALL) {
            $mode = \Zend_Cache::CLEANING_MODE_MATCHING_TAG;
            $tags = [$this->getTag()];
        } else {
            $tags[] = $this->getTag();
        }
        $result = parent::clean($mode, $tags);
    }*/
    return $result;
}


texts: Multiple URLs getting created for single product

texts:
I am an SEO executive and pretty new to Magento. I have got a project in which there are multiple URLs for a single product and all URLs have been indexed on Google. Here is an example of URL structure -
https://www.example.com/product-130565
https://www.example.com/main-category/product-130565
https://www.example.com/main-category/sub-category/product-130565
https://www.example.com/main-category/sub-category/sub-category/product-130565
Also, the canonical URL for every URL is different. I want to understand why Magento is creating so many URLs for a single product. Also, I only want to keep the third URL structure as the main URL and all other URLs should either redirect to that URL or is there a way that the other URLs can be removed.
Any help will be appreciated.


texts: Is there any Magento Best tutorial for backend development from scratch?

texts: I want to know about the backend code development. Is there any good tutorial or videos available to learn? Suggest me about the development.


texts: Magento 2 jQuery Modal Not displaying in center

texts:
I'm new to Magento 2. For homepage popup i have added below code

<div id="popup-modal">
        Test Data
</div>

<script>
        require(['jquery', 'Magento_Ui/js/modal/modal'], function ($, modal) {
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
            };

            var popup = modal(options, $('#popup-modal'));

            $('#popup-modal').modal('openModal');
            $('.modal-footer').hide();
        }
        );
</script>

It's not showing in center, as well how to set height & width of modal. Can we make auto as per content?


texts: Bundled product remove "Price as configured"

texts:
i want to remove product remove "Price as configured" for bundled products how can i do it

i make bundled products in such way that all items are set required and can not be skipped so no need of "Price as configured"

form where it can be removed please guid me


texts: SQLSTATE[42S02]: inventory_stock_sales_channel doesn't exist - Magento 2.3.1

texts:
I have disabled the MSI (inventory) and some products work for me but other products do not and I get this error:
2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magentodb.inventory_stock_sales_channel' doesn't exist, query was: SELECT `inventory_stock_sales_channel`.`stock_id` FROM `inventory_stock_sales_channel` WHERE (code = 'vanzus' and type = "website")
Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magentodb.inventory_stock_sales_channel' doesn't exist

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magentodb.inventory_stock_sales_channel' doesn't exist, query was: SELECT `inventory_stock_sales_channel`.`stock_id` FROM `inventory_stock_sales_channel` WHERE (code = 'vanzus' and type = "website")
<pre>#1 Magento\Framework\DB\Statement\Pdo\Mysql->_execute() called at [vendor/magento/zendframework1/library/Zend/Db/Statement.php:303]

I don't want to use the MSI, how can I solve my problem without using the MSI module?
Thanks! :)


texts: When I click on Invoice/Ship in Magento 2 Backend, It shows like this

texts: Magento 2 backend shows screen like this, all messed up, when I click Invoice or Ship Button.


texts: Attempting to "steal" product collection from category view

texts:
I am attempting to set up an observer that monitors category view. Prior to HTML output I need to "hijack" this collection if it is an ajax request so that I do not have to rebuild the collection query manually (limit, page, filters, etc...).

What I am attempting is below. Is there a straightforward way of to fetch the current collection prior to HTML output?

class MyMod_Sliderview_Model_Observer {

public function catalogCategoryViewPredispatch($observer) {
  if ($this->getParam('ajax') || $this->getParam('isAjax')) {
    $helper = Mage::helper('core');
    $controller = $observer->getEvent()->getControllerAction();
    $request = $controller->getRequest();
    $params = $request->getParams();

    //Show me
    zend_debug::dump(Mage::getModel('catalog/category')->getProductCollection());
    }
  }
}

Edit
The reason I am not filtering is because I am hoping to inherit the product collection from the category view by using the observer. I want the same collection that is sent to list.phtml in the category product list template.

Edit 2: I managed to get the observer to output the collection data I was expecting (based on your guidance) but my problem is that the data isn't being generated until after HTML output has already begun. I've crawled through the other event listeners and from what I can gather the collection isn't built until after HTML is being generated. It looks like I have no choice but to try and imitate the collection request based on parameters (page, limit, filters, etc.)

Thanks, this has me feeling optimistic. I have updated the config to...

        <catalog_product_collection_load_after>
            <observers>
                <mymod_sliderview_model_observer>
                    <type>singleton</type>
                    <class>Mymod_Sliderview_Model_Observer</class>
                    <method>catalogProductCollection</method>
                </mymod_sliderview_model_observer>
            </observers>
        </catalog_product_collection_load_after>

and my model to..

class Mymod_Sliderview_Model_Observer {
    public function catalogProductCollection($observer) {
      $event = $observer->getEvent();
      $collection = $event->getCollection();
      zend_debug::dump($collection);
    }
}


texts: Magento shopping cart front end went to text only with an Error and a Fatal Error on the Admin login page

texts:
I am working on www.5280flowers.com website.

The Base URL and Base Skin Url are set correctly.

    web/unsecure/base_url --> http: //www. 5280flowers.com/
    web/secure/base_url --) https: //www. 5280flowers.com/ web/unsecure/base_skin_url --)

{{unsecure_base_url}}skin/======web/secure/base_skin_url --) {{secure_base_url}}skin/

There has been absolutely no changes done to the shopping cart and it worked fine about 3 hours ago....Now - it only loads text on the front page with the following Error:

There was no 404 CMS page configured or found.

And - when I go to the Admin login page it shows (all text - no images):

Log in to Admin Panel

User Name:

Password:

  Fatal error: Call to a member function getBlockName() on a non-object
  in
  /home/MYownSITE/public_html/app/code/core/Mage/Captcha/Block/Captcha.php
  on line 43

Magento ver. 1.9.1.0


texts: I'm working with 2.3.3 and I can't figure out how to change the order of items. We have a "downloads" page, which uses a "manage downloads" module (via the dashboard). When I add a new download, it seems to be assigned an ID # by default and that number dictates the order in which it is displayed on the site. This seems to be the same for our "manage brand" module as well. I'm assuming, IDs dictate the order in which items are displayed but how can I change the order or change the ID #? The ability to rearrange items in what is basically a list seems basic but I can't figure it out. Can any of this be done via Admin/Dashboard or is this something that has to been done in the developer environment? Any help is appreciated. Thanks.


texts:
I'm trying ti implement a search form, and a bit confused on how to build the results page.

I built my /etc/routes.xml file (updated id and frontName)

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="fitment_results" frontName="fitment_results">
            <module name="EkkoMedia_FitmentSearch"/>
        </route>
    </router>
</config>

And my /Controller/Index.php file

<?php

namespace EkkoMedia\FitmentSearch\Controller;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Element\Messages;
use Magento\Framework\View\Result\PageFactory;

class Result extends Action
{
    /** @var PageFactory $resultPageFactory */
    protected $resultPageFactory;

    /**
     * Result constructor.
     * @param Context $context
     * @param PageFactory $pageFactory
     */
    public function __construct(Context $context, PageFactory $pageFactory)
    {
        $this->resultPageFactory = $pageFactory;
        parent::__construct($context);
    }

    /**
     * The controller action
     *
     * @return \Magento\Framework\View\Result\Page
     */
    public function execute()
    {
        $year = $this->getRequest()->getParam('year');

        $resultPage = $this->resultPageFactory->create();

        /** @var Messages $messageBlock */
        $messageBlock = $resultPage->getLayout()->createBlock(
            'Magento\Framework\View\Element\Messages',
            'answer'
        );
        if (isset($year)) {
            $messageBlock->addSuccess('Year: ' . $year);
        }else{
            $messageBlock->addError('You didn\'t enter a year!');
        }

        $resultPage->getLayout()->setChild(
            'content',
            $messageBlock->getNameInLayout(),
            'answer_alias'
        );

        return $resultPage;
    }
}

And my /view/frontend/layout/fitment_results_index.xml file (updated file name)

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Result</title>
    </head>
</page>

But when I submit my form (action="fitment_results"), I get a 404 error

UPDATE (Added phtml)

<div class="container">
    <form id="productSearch" action="fitment_results" method="get">
        <select name="year" id="select_year" class="ui-selectmenu-button" tabindex="1">
            <option>Year</option>
            <option value="2004">2004</option>
        </select>

        <select name="make" id="select_make" tabindex="2">
            <option value="">Make</option>
            <option value="Ford">Ford</option>
        </select>

        <select name="model" id="select_model" tabindex="3">
            <option value="">Model</option>
            <option value="F-150">F150</option>
        </select>

        <select name="trim" id="select_trim" tabindex="4">
            <option value="">Model</option>
            <option value="FX4">FX4</option>
        </select>

        <input type="submit" id="search_submit" value="Find Products">
     </form>
</div>


texts: Is there a way to use a boilerplate for CSS?

texts:
I have to redesign an existing M2-Shop with a given style guide.
That guide defines structures for headlines, sub-lines, product etc. like a style guide does.

My problem is that there is no given structure in the less structure to change that easily.

Is that even possible to have a let's say boilerplate for CSS?

The styles are spread all over the less files. To say a headline H1 has to have a font size with 24px and a red text color and maybe a given line height that modifications I have also to change in every less file e.g. cms.less, product.less, product-list.less and so on.

Is there a way to simplify that?


texts: Magento 2.3.3 - “the shipping information was unable to be saved” comes for the customers on checkout

texts:
This problem when I add address first at http://mywebsite.com/customer/address/. But when I add an address when checkout dont have a problem. So in debug.log have error
[2021-04-27 04:00:55] main.CRITICAL: Invalid customer address id 771 {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): Invalid customer address id 771 at /var/www/html/mywebsite/vendor/magento/module-quote/Model/QuoteAddressValidator.php:79)"} []
How to fix its?


texts: Magento get product details in order collection

texts:
How to get Orderd Product name,sku,qty etc in order collection Magento

<?php
class MPS_Ordermail_Model_Observer{
    public function Test($event){
        //do something
        Mage::log("Testing success...........",null,'custom.log');
        $ordershippeddays = 7; // number of days you want
        $fromDate = gmdate("Y-m-d H:i:s", gmmktime(0, 0, 0, gmdate("m"), gmdate("d") - $ordershippeddays, gmdate("Y")));
        $toDate = gmdate("Y-m-d H:i:s", gmmktime(23, 59, 59, gmdate("m"), gmdate("d"), gmdate("Y")));

         $ordercollection = Mage::getResourceModel('sales/order_item_collection')
        ->addAttributeToSelect('order_id')
        ->addAttributeToSelect('created_at')
        ->addAttributeToFilter('created_at', array('from' => $fromDate, 'to' => $toDate))
        ->load();

        count($ordercollection);

        foreach ($ordercollection as $orderkey => $ordervalue) {
        $eid = $ordervalue->getOrderId();
        $order = Mage::getModel("sales/order")->load($eid);
        Mage::log("Testing success...........");
        Mage::log($customerorderid = $order->getIncrementId());
        Mage::log($customeremailid = $order->getCustomerEmail());
        Mage::log($customername   = $order->getCustomerFirstname());
        Mage::log($order->getPayment()->getMethodInstance()->getTitle());
        Mage::log($order->getStatusLabel());
        $billingAddress = $order->getBillingAddress();
        $shipping_address = $order->getShippingAddress();
        Mage::log($billingAddress->getStreetFull());
        Mage::log($billingAddress->getRegion());
        Mage::log($billingAddress->getCountry());
        Mage::log($billingAddress->getPostcode());
        Mage::log($billingAddress->getTelephone());
        Mage::log($shipping_address->getStreetFull());
        Mage::log($shipping_address->getRegion());
        Mage::log($shipping_address->getCountry());
        Mage::log($shipping_address->getPostcode());
        Mage::log($shipping_address->getTelephone());
        Mage::log($orderTotalValue = number_format ($order->getGrandTotal(), 2, '.' , $thousands_sep = ''));

        }

    }
}


texts: Mirror my Magento 2 website on one domain

texts:
Here is one request on me for a Magento 2 website.
The boss here wants to make the following.
He have a Magento 2 web store with 3500 products and lot of orders per day. Cause sometimes the website is
"failing"(last they there was an error with the hosting, and the website didn't work for days), he wants to make a mirror of the website and lets imagine the situation like this.
Working website is = A
Cloned website is = B
When "A" fails to work for some reason, automatically the "B" to be "loaded" and the work can keep going smoothly without, losing his orders. The 2 websites "A", "B" to be on a same domain - www.example.com
Is that somehow possible ? How I can manage to do that?
Do I have to buy another hosting and redirect the domain of "B" to point to "A" ?


texts: Magento2 - How get all prices of all Blocks within HomePage?

texts:
I have working a website with others extensions between them the "Ultimo - Fluid Responsive" theme that overwrite much part of website, as well as my own extension.

My question friends:

I how can get all products(prices) before to be renderized? I need
get this collection for send it to my webservice and make some
calculate.
I thinked in get the products of each block/widget. Is optimal? How can overwrite all product's prices of any block/widget?

Here part of my code

Multicalculate Class: (truncated)

namespace MyExtension\Checkout\Plugin\Product;

class MultiCalculatePrice
{
    ...
    const MULTI_CALCULATE_PRICE_RESULT_RESPONSE = 'multi_calculate_result';
    ...

    public function __construct(
        ...
        \MyExtension\Checkout\Block\Product\AfterPrice $productBlock,
        \Psr\Log\LoggerInterface $logger,
        ...
    ) {
        $this->productBlock = $productBlock;
    }

    public function beforeGetLoadedProductCollection($subject)
    {
        ...
    }

    public function afterGetLoadedProductCollection($subject, $collection)
    {
        foreach ($collection as $item) {
            $dataProduct = $this->productBlock->getDataProduct($item);

            $product = new MyExtension\Checkout\Sdk\Entities\Product();
            $product->setId($dataProduct['id']);
            $product->setSku($dataProduct['sku']);
            $product->setName($dataProduct['title']);
            $product->setPrice($dataProduct['price']);
            $product->setImg($dataProduct['image']);
            ...
            $products[] = $product;
        }

        $wsclient = $this->dataHelper->getClient();
        $resultResponse = $wsclient->getCatalog()->multiCalculate($products);

        $this->coreRegistry->register(self::MULTI_CALCULATE_PRICE_RESULT_RESPONSE, $resultResponse);

        return $collection;
    }
}

AfterPrice Class: (truncated)

namespace MyExtension\Checkout\Plugin\Product;

use \Magento\Catalog\Pricing\Price\ConfiguredPrice;
class AfterPrice
{
    private $priceCode;

    public function beforeRender(
        \Magento\Framework\Pricing\Render $subject,
        $priceCode,
        \Magento\Catalog\Model\Product $saleableItem,
        array $arguments = []
    ) {
        $this->coreRegistry->unregister(self::PRODUCT_REGISTRY_KEY);
        $this->coreRegistry->register(self::PRODUCT_REGISTRY_KEY, $saleableItem);
        $this->priceCode = $priceCode;
        ...
    }

    public function afterRender(\Magento\Framework\Pricing\Render $subject, $renderHtml) {
        $product = $this->coreRegistry->registry(self::PRODUCT_REGISTRY_KEY);
        if ($this->priceCode === \Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE) {
            return '
getId() . '">' . $this->priceCode . '
';
        } else {
            return $this->priceCode;
        }
    }
}

Here my di.xml

<config>
    ...
    <type name="Magento\Framework\Pricing\Render">
        <plugin name="myextension_product_priceRender" type="MyExtension\Checkout\Plugin\Product\AfterPrice" />
    </type>
    ...
    <type name="Magento\CatalogWidget\Block\Product\ProductsList">
        <plugin name="myextension_widget_productslist" type="MyExtension\Checkout\Plugin\Product\MultiCalculatePrice" />
    </type>
    ...
</config>

With "MultiCalculatePrice" class I try get all product collection for
send it to my webservice. But it work getting products from my first
block only, no for others.
With "AfterPrice" class I try update the price before of renderized
of each product for any block. Work renderized any products of any
block.

Here an screenshot of HomePage with my three blocks:

The Block's definitiion within Home Page:


texts: Magento 2.2.6 CSS JS not loading in admin panel after changing base and custom admin URLs

texts:
It's a multi store site in development and I changed the test URL to one of the production URLs for the default Base URLs and one of the store Base URLs. I also changed the option to Use Custom Admin URL from Yes to No.

All static content has been deleted and redeployed and cache flushed. The frontend is loading OK with CSS. The admin login page comes up, and I can log in, but with no CSS.

Any help with resolving this much appreciated.


texts: How to solve patch update/revert errors? SUPEE-6285 and 1.9.2.0

texts:
While reverting the SUPEE-6285 patch (in order to install SUPEE-6285-V2), I get errors like

  patching file downloader/template/connect/packages_prepare.phtml
  Hunk #1 FAILED at 33.
  1 out of 1 hunk FAILED -- saving rejects to file downloader/template/connect/packages_prepare.phtml.rej

I've had these before with different patches, but usually replacing these files with a file solves the problem. With this patch however, replacing with files from both magento 1.9.2 pre and post the SUPEE-6285 V2 patch doesn't work.

I'm running 1.9.2. Is anyone else facing this problem? And what is best practice for patching? I would guess you should do something with the .rej file, they aren't created.


texts: Customer can't login after Use SID on Frontend = No

texts:
I am using Magento 1.9.3 and server Godaddy VPS.
I am trying to disable Use SID on Frontend in admin->configuration->web->Session Validation Settings->Use SID on Frontend No.

After this change URL working properly but customers can't login in front-end. Even invalid username and password message also not displaying, just page loading.

But same function is working in localhost.

How can I fix this issues...?

And thanks in advance....


texts: I have been sent an email from a customer this morning. The password reset email has a link which doesn't work. The hyperlink to the page is not there. Where do I find this in Magento 1.9 to rectify the issue?


texts:
https://9a1843a442.nxcli.net/
If you add more than 100 products cart almost does not load quickly, superslow. after adding 800 cart items, Cart page stop loading and took 3 min to come up. its magento optimize hosing with redis.
Anyone having same issue? Its magento 2.3.


texts: Difference between these 2 get category products call?

texts:
I have 2 sets of codes to get products in category.

Set 1

$category = Mage::getModel('catalog/category')->load(4);
$products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addCategoryFilter($category)
    ->load();

Set 2

$products = Mage::getModel('catalog/category')->load(4)
     ->getProductCollection()
     ->addAttributeToSelect('*') // add all attributes - optional
     ->addAttributeToFilter('status', 1) // enabled
     ->addAttributeToFilter('visibility', 4) //visibility in catalog,search
     ->setOrder('price', 'ASC'); //sets the order by price

With Set 1, I can obtain correct number of products (9 items in total), while in Set 2, I can only obtain 4 items (strange).

However, only Set 2 returns product model (and I can obtain information such as names from it). Set 1 returns the following object:

Mage_Catalog_Model_Product::__set_state(array(
   '_cacheTag' => 'catalog_product',
   '_eventPrefix' => 'catalog_product',
   '_eventObject' => 'product',
   '_canAffectOptions' => false,
   '_typeInstance' => NULL,
   '_typeInstanceSingleton' => NULL,
   '_linkInstance' => NULL,
   '_customOptions' =>
  array (
  ),
   '_urlModel' => NULL,
   '_errors' =>
  array (
  ),
   '_optionInstance' => NULL,
   '_options' =>
  array (
  ),
   '_reservedAttributes' => NULL,
   '_isDuplicable' => true,
   '_calculatePrice' => true,
   '_defaultValues' =>
  array (
  ),
   '_storeValuesFlags' =>
  array (
  ),
   '_lockedAttributes' =>
  array (
  ),
   '_isDeleteable' => true,
   '_isReadonly' => false,
   '_resourceName' => 'catalog/product',
   '_resource' => NULL,
   '_resourceCollectionName' => 'catalog/product_collection',
   '_dataSaveAllowed' => true,
   '_isObjectNew' => NULL,
   '_data' =>
  array (
    'entity_id' => '9',
    'entity_type_id' => '4',
    'attribute_set_id' => '4',
    'type_id' => 'simple',
    'sku' => 'SKU101',
    'has_options' => '0',
    'required_options' => '0',
    'created_at' => '2015-01-19 10:29:08',
    'updated_at' => '2015-07-20 08:09:53',
    'cat_index_position' => '1',
    'is_salable' => '1',
    'stock_item' =>
    Varien_Object::__set_state(array(
       '_data' =>
      array (
        'is_in_stock' => '1',
      ),
       '_hasDataChanges' => false,
       '_origData' => NULL,
       '_idFieldName' => NULL,
       '_isDeleted' => false,
       '_oldFieldsMap' =>
      array (
      ),
       '_syncFieldsMap' =>
      array (
      ),
    )),
  ),
   '_hasDataChanges' => true,
   '_origData' => NULL,
   '_idFieldName' => 'entity_id',
   '_isDeleted' => false,
   '_oldFieldsMap' =>
  array (
  ),
   '_syncFieldsMap' =>
  array (
  ),
))

How can I:

Get all products from Set 2? or
Get product name & URL from Set 1?

p.s. all items have:

Status = Enable
Visibility = Catalog, Search
Price > 0
Have stock left


texts: I have deleted cache directory from media/catalog/product folder. Now all image paths are giving code 500. How can I regenerate Images?

texts:
So as the title says I made a mistake and deleted all cached images. And now Magento is confused as image paths are pointing to no files.
I know there is the command to resize images, but it takes forever and crashes if there is unsupported image format or quality. Is there a way to generate these images on the fly, meaning when someone opens a product or category page? Or is there some kind of image cache warmer?


texts: How to create an Observer for the OrderCommentSender class

texts:
I need to create an observer of the vendor/magento/module-sales/Model/Order/Email/Sender/OrderCommentSender.php class, at the send() method (83th line), so that I can append a customized comment in the comments section.
Line 83 starts at $this->eventManager->dispatch
public function send(Order $order, $notify = true, $comment = '') {

$this->identityContainer->setStore($order->getStore());

$transport = [
    'order' => $order,
    'comment' => $comment,
    'billing' => $order->getBillingAddress(),
    'store' => $order->getStore(),
    'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
    'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
    'order_data' => [
        'customer_name' => $order->getCustomerName(),
        'frontend_status_label' => $order->getFrontendStatusLabel()
    ]
];

$transportObject = new DataObject($transport);

/**
 * Event argument `transport` is @deprecated. Use `transportObject` instead.
 */
$this->eventManager->dispatch(
    'email_order_comment_set_template_vars_before',
    ['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
);

$this->templateContainer->setTemplateVars($transportObject->getData());

return $this->checkAndSend($order, $notify); }


texts: Add to cart is not working: Uncaught TypeError

texts:
Add to cart is not working and getting error:

  section-config.js:33 Uncaught TypeError: Cannot read property '*' of
  undefined

I am very new to magento and by following docs, I have created a custom theme overriding the default LUMA theme.

And when i try to add a product to cart it shows Adding.. and loader keeps spinning.

I get following error in the console:

Uncaught TypeError: Cannot read property '*' of undefined
at Object.getAffectedSections (section-config.js:33)
at HTMLDocument.<anonymous> (customer-data.js:218)
at HTMLDocument.dispatch (jquery.js:5226)
at HTMLDocument.elemData.handle (jquery.js:4878)
at Object.trigger (jquery.js:5130)
at Object.jQuery.event.trigger (jquery-migrate.js:493)
at done (jquery.js:9858)
at XMLHttpRequest.callback (jquery.js:10311)

I tried flushing cache, deleting everything inside var folder and also changed url from http://localhost/dir-name to http://127.0.0.1/dir-name but no luck!


texts: Magento-Adobe Acquisition - What does it mean for the community version?

texts: Any idea of how the Magento-Adobe acquisition will affect the developers or the community version in general?


texts:
my objective is to find all orders with status "pending".

Seems the way to do this is to use the Order\Collection

class Modelx extends \Magento\Framework\App\Helper\AbstractHelper {

    /**
 * @var \Magento\Sales\Model\ResourceModel\Order\CollectionFactory
 */
protected $salesOrderCollectionFactory;

public function __construct(
        \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $salesOrderCollectionFactory
) {

            $this->salesOrderCollectionFactory = $salesOrderCollectionFactory;

}

    public function getSalesOrderCollection(array $filters = [])
{
    /** @var \Magento\Sales\Model\ResourceModel\Order\Collection $salesOrderCollection */
    $salesOrderCollection = $this->salesOrderCollectionFactory->create();

    foreach ($filters as $field => $condition) {

        $salesOrderCollection->addFieldToFilter($field, $condition);
    }

    return $salesOrderCollection->load();
}

}

I'm passing  status='pending' to the filter which seems to be working.

$return = $this->_model->getSalesOrderCollection( array('status' => 'Pending'));

From $return I like to retrieve the order ids but not sure how to do this.  Any suggestions?


texts: How do you deal with 61 tables join limit when building magento collection?

texts: Mysql has known limitation of 61 tables to join, how do you overcome that when you have more than 61 attributes to join in magento collection?


texts: Magento 2: Cart is allowing update more than available qty

texts:
I am having very odd issue. I am using Magento 2.3.2. I have migrated data from magento 1.9.3.

While I am adding product to cart, It works perfect, however whenever I try to update qty from cart it allows the qty limit to "Maximum allow qty" although products are not having Qty(s). Maximum allow qty is 10000 so I am able to add qty till 10000 but most of the products are having 250 Qty(s)

Please help on this. Thank you.


texts: how to add extra field in 'order_item' table when product order success?

texts:
Which event I have to use?
I have need to store product wise shipping tax.


texts: Magento2 Cant override checkout js file billing-address.js

texts:
It seems like a dumb question that was answered a lot here but I cant get it to work.

I want to override Magento_Checkout/js/view/billing-address.js the file is physically under module-checkout/view/frontend/web/js/view/billing-address.js.

Ive copied the file to my <theme>/web/js/components/checkout/billing-address.js and added the configuration to my requirejs-config.js:

map: {
        "*": {
            "dropdownDialog":       "js/components/dropdownDialog",
            "sidebar":              "js/components/sidebar",
            "catalogAddToCart":     "js/components/catalog-add-to-cart",
            "cookieNotices":        "js/components/cookieNotices",
            "loader":               "js/components/loader",
            "Magento_Checkout/js/view/billing-address":
                                             "js/components/checkout/billing-address",
        }
    }

But the file is not overriden. I still geht the original from module-checkout.


texts: Find referenceContainer in Magento 2.1 module

texts:
This is my first attempt to write a Module for Magento 2.1 I have read the documentation for referenceContainer that is not very helpful,

I would like to know how can I access and apply my change in a specific div in my template, following is the code of template of another module where I would like to inject my code

About Store

On the Social Web

I would Like to add the information beneath
About Store
 or with in  or above  what ever is doable for now

I have following xml in layout for this injection

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="3columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/e$

        <referenceContainer name="content">
            <block class="App\Helloworld\Block\Helloworld" name="helloworld" template="helloworld.phtml" />
        </referenceContainer>

</page>

now with name="content" it injects the html right before the end of
 how do I identify the correct container to inject html using referenceContainer


texts: footer contant not changing when cache enabled

texts:
magento/app/design/frontend/argento/argento/template/page/html/footer.phtml

This is the file in which i added dynamic content. It works fine when cache is disabled. But when I enabled cache then it does not work. It display the line which display at first refresh.

Any kind of help will be appreciable.


texts:
Here are my questions
1.) How to display products of specific category?
2.) How can I organize the way it is displayed? (column, size, row, etc) ?

Hi. I have tried almost all the tutorials in google but I failed to display products in my Home Page. Although displaying "all products" is not working, the displaying of new items works fine. This is what I did so far.

This is the line of code which works:

{{block type="catalog/product_new" name="home.catalog.product.list" template="catalog/product/new.phtml"}}

Though the code above works, the way it displays the product is not right.

This line of code doesn't work:

{{block type="catalog/product_list" category_id="3" template="catalog/product/list.phtml"}}

Yes, I have tried clearing the cache as well. Also, I am using Magento 1.9.2.3.

UPDATE:
After following the instruction, something was displayed:

Although something was displayed on my homepage, this is not how I expect the products to be displayed. Why does it display like this ?


texts: Converting this date format 2021-04-26 05:31:38 to 26 Apr, 2021 in magento 2

texts: How can we Convert this date format 2021-04-26 05:31:38 to 26 Apr, 2021 in Magento 2. Please let me know how can I do this.


texts: Magento2 - How to implement slow loading

texts:
I want to implement slow loading for my homepage.

My homepage consist of category image then 9 products related to that category.This continues for all categories. For that, I want to implement lazy loading. first by default one category and there products are displayed after that, rest category image and there products are displayed through lazy loading.

I want to know how can I implement lazy loading for this


texts: Clickable mailto link in custom order grid?

texts:
Magento 1.7.0.2

This is how I show the mail address from my collection in my custom order grid:

$this->addColumn('mail', array(
        'header'       => $helper->__('E-Mail'),
        'index'        => 'mail',
        'filter_index' => 'mail',
    ));

This works, but I want that shown value (which is a mail address) to be a mailto link. How would I do that?

Thanks!


texts:
I have a client's website in magento 1.9.2.0. Am trying to edit database details and admin custom url in app/etc/local.xml but no changes reflecting.

when I do research for this, they asking for clean the cache, and check if any extra xml file exist in app/etc folder.

So I have deleted cache in var/cache, var/session folder. var/tmp folder is also empty.
and in app/etc folder, here is no extra xml file.

Is there any way to know which file is loading as local.xml means where from database details coming.

Please help me. Thanks in advance.


texts: Hide flatrate shipping method if free shipping available

texts:
I found the following working code but it hides all the other shipping methods. How could i change it to hide only the flat rate?
private function filterOutput($output)
{
    $free = [];
    foreach ($output as $shippingMethod) {
        if ($shippingMethod->getCarrierCode() == 'freeshipping' && $shippingMethod->getMethodCode() == 'freeshipping') {
            $free[] = $shippingMethod;
        }
    }
    if ($free) {
        return $free;
    }
    return $output;
}


texts: Magento 2.4 Blank page for store or admin pages after installation

texts:
this is my first time setting up a Magento2 server, I've followed the guide from the official website.
I am using PHP 7.4, mysql, apache, all on the same host.
I pulled the repo to /var/www/html where it puts itself into /var/www/html/magento2
I then run "composer install" within /var/www/html/magento2, which does its thing without error.
Then I run the magento install using bin/magento, which does its thing without error once again.
Since I just want to test for now, I've set the base url as 127.0.0.1/magento2.
According to every guide I've found, after that, I should only have to go to 127.0.0.1/magento2 and see the store, but I get a blank page instead. The default apache page on 127.0.0.1 works just fine, tested both locally and remotely with another computer on the lan, and on both 127.0.0.1/magento2 returns a blank page.
The PHP memory is set to 2G, I've done every little recommendation from the official guide. Since this was for a test run, I am running the webserver as root, so it shouldn't be getting file permission issues (it passes the file permission check on the install).
Any help would be greatly appreciated, thank you for your time.
Edit: So the webserver installation seems to be fine, if I modify the index.php to do an echo test, that works fine, that means the issues seems to be within the running of the application within the index.php and further down the line but I am not getting any errors out of it. That means it doesn't trigger the try/catch (which would output something) and then crashes later on.
Edit #2: I managed to identify this loosely as Http ERROR 500.


texts: Display Color names Of Configurable Swatches On Product View Page 1.9

texts:
I hope someone can help,

I have Configurable Swatches working on my site, Magento 1.9.

Some of my customers are confused by the fact that the name of the colour swatch only appears when they hover over the swatch.

I would like to put the name of each colour swatch beneath the swatch.

Can anyone point me in the right direction to add this?

Thanks


texts:
I've got two app servers that are load balanced by a third server.  Right now I've got Magento's cron setup on just one of the app servers.  The problem is that I want to turn on Magento sitemap cron job. However, since cron is only setup on one app server, the sitemap will only be generated on one app server.

Is there any danger in configuring Magento's cron scheduler on both of the app servers?  Will that create any race conditions, conflicts, duplicate tasks, etc?  Or what is the standard for handling Magento's cron system in a clustered environment?


texts: how can i show Min Qty "min_qty" As MOQ at Product Page

texts:
I have read the below post to show sku but now i need to show Minimum Order Qty on product page. Please guide me how can i show Minimum order quantity.

Post is :

https://magento.stackexchange.com/questions/42511/sku-in-magento-product-page-description?answertab=oldest#tab-top1


texts: Magento: Filter huge sales order collection

texts:
I am trying to filter a huge collection of sales order. There are more then 5 million records in it. Below is my code to get the order collection and also i puts some joins to get the desired columns
    $resource = Mage::getSingleton('core/resource');
    $collection = Mage::getResourceModel('sales/order_grid_collection');

    $collection ->join(
      'sales/order_item',
    '`sales/order_item`.order_id=`main_table`.entity_id',
    array(
    'skus' => new Zend_Db_Expr('GROUP_CONCAT(`sales/order_item`.sku SEPARATOR "</br>")'),
    )
    );

    $collection->getSelect()->joinLeft(array('sfog' => $resource->getTableName('sales_flat_order_grid')),
    'main_table.entity_id = sfog.entity_id',array('sfog.shipping_name','sfog.billing_name'));

    $collection->getSelect()->joinLeft(array('sfo'=>  $resource->getTableName('sales_flat_order')),
    'sfo.entity_id=main_table.entity_id',array('sfo.customer_email','sfo.weight',
    'sfo.discount_description','sfo.increment_id','sfo.store_id','sfo.created_at','sfo.status',
    'sfo.base_grand_total','sfo.grand_total'));

    $collection->getSelect()->joinLeft(array('sfoa'=>  $resource->getTableName('sales_flat_order_address')),
    'main_table.entity_id = sfoa.parent_id AND sfoa.address_type="shipping"',array('sfoa.street',
    'sfoa.city','sfoa.region','sfoa.postcode','sfoa.telephone','sfoa.fax'));

when i apply addAttributeToFilter function on this collection then it takes 10 minutes to fetch the result. My question is that is there any efficient and fast way to filter collection
Update
Below are my filter logic's. I want to search a order by using different filters
    $email = Mage::app()->getRequest()->getParam('email');

    $phone = Mage::app()->getRequest()->getParam('phone');

    $postcode = Mage::app()->getRequest()->getParam('postcode');

    $skus = Mage::app()->getRequest()->getParam('skus');

    if($email!='')
    {
        $collection->addAttributeToFilter('sfo.customer_email',$email);
    }

    if($phone!='' && $postcode=='')
    {
        $phone = str_replace(' ', '', $phone); // Replaces all spaces with hyphens.
        $phone = preg_replace('/[^A-Za-z0-9\-]/', '', $phone); // Removes special chars.
        $collection->addAttributeToSearchFilter(
            array(
                array(
                    'attribute' => 'sfoa.telephone',
                    'eq' => $phone
                ),
                array(
                    'attribute' => 'sfoa.fax',
                    'eq' => $phone
                )
            )
        );
    }

    if($postcode!='' && $phone!='')
    {
        $collection->addAttributeToFilter('sfoa.postcode',$postcode);
        $phone = str_replace(' ', '', $phone); // Replaces all spaces with hyphens.
        $phone = preg_replace('/[^A-Za-z0-9\-]/', '', $phone); // Removes special chars.
        $collection->addAttributeToFilter('sfoa.telephone',$phone);
    }

    if($skus!='')
    {
        $sku_array = explode(",",$skus);
        $collection->addAttributeToFilter('sku', array('in' => array('finset' => array($sku_array))));
    }


texts: How to display MSRP price in product details page in Magento 2.1.8?

texts: I don't know how to implement this task.Is it possible to display MSRP price on product details page? Can you please help me.


texts: Soap API Parsing WSDL : Couldn't load from, Extra content at the end of the document

texts:
On Magento 1.14.2.0.

I am connecting to the SOAP API via a URL like http://example.com/api/soap?wsdl=1

However, when I try and access the API it fatals filling my apache error log fills with

[Wed Jul 22 14:05:55 2015] FastCGI: server "/tmp/php-fpm5.5" stderr: PHP message: PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://custom-admin-url.example.com/index.php/api/soap/index/?SID=a_sid&wsdl=1' : Extra content at the end of the document
[Wed Jul 22 14:05:55 2015] FastCGI: server "/tmp/php-fpm5.5" stderr:  in /var/www/vhosts/development/example/lib/Zend/Soap/Server.php on line 814

The interesting thing to note is that we are no longer trying to access the API via http://example.com/api/soap?wsdl=1, but by https://custom-admin-url.example.com/index.php/api/soap/index/?SID=a_sid&wsdl=1 instead.

This admin url is correct, and is the one stored in the core_config_data table under the path admin/url/custom.

There is functionality to prevent the admin panel being accessed by anyone not coming from a certain IP address. The "Extra content at the end of the document" in the error is actually the html home page we view after being redirected.

How can I best solve this redirect issue?


texts: Magento2: How to use flat table instead of EAV?

texts:
I have a Magento 2 project, in which the customer will have only a very few attributes. So instead of EAV a want to use Flat tables. i.e I want all the attributes to be columns.

Customer Address will remain out of this and will work as is (default implementation).

Has anyone done anything like this in magento 1 or 2 ?


texts: I want to change the price labels in Magento. How can I achieve that?


texts: Magento 2: How can I add External URL in top menu

texts:
Is there a way to create a custom menu item in the magento 2 Top menu which links to an external URL.

Static page only category doesnt suit my need because I just want to redirect the user to a different website.

Update: I tried with the plugin as suggested and it doesn't come.  I cleared the cache too.


texts:
Is it possible to bulk-insert data into a table using Magento?

I am working on extending the Magento import/export feature for a custom module, and noticed that each row is added one-at-a-time in a while loop. For a CSV containing thousands of rows of data, this could take a VERY long time to insert. Instead, is there a bulk-insert function laying around that takes an array of record data and bulk-inserts them?

Crude example (in reality the row data would be added to the $data array in the while loop):

$data = array(
    array('column1' => 'value', 'column2' => 'value', ...),
    array('column1' => 'value', 'column2' => 'value', ...),
    ...
);

Mage::getModel('module/model')->insert($data,true);

Where the second parameter in insert indicates a bulk-insert operation?

If not, why not? I am aware some PDOs don't have the functionality to do bulk-insert, in which case Magento would default to doing a foreach anyway. However, for PDOs that DO support bulk-insert (such as MySql) it would save a lot of time compared to touching the db for every insert. If this is not already in Magento, how would I go about implementing it? Can I have a link to the Magento feature suggestion page (Google suggests Magento Forum but I would like a second opinion before posting there).

Thanks.


texts: Magento 2: Not able to revert Category URL Suffix and Product URL Suffix to .html

texts:
I am having strange trouble in my Magento 2.1.7 website. As per my client's requirement, I changed category URL suffix and product URL suffix to blank.

Issue 1: After making such changes in the settings, I got the following error:

  Error filtering template: Element with ID 'widget.products.list.pager' already exists.

Issue 2: After getting above error, I tried to reindex, flush cache and deploy static content, but nothing worked. Then I tried to revert back my changes and set .html as URL suffix again.

Now the setting is being saved in the admin panel but nothing is being changed in the frontend.

I am still getting category and product URLs without .html.

Kindly suggest, how can I get rid of such problem.

Thanks in advance


texts:
When I am creating new module I ran following commands for full deployment:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

But it took so much time, 30 minutes approx

How can I make it more faster?


texts: Magento 2 : shipping method in dropdown view in frontend

texts:
On Checking out,I have a lot of shipping methods listed.
Any solution, how to customize it into a drop-down?

Thank in advance.


texts:
Most of the times I find a solution here, but in this case it's a little more complicated. I followed the instructions given in several posts, but none of them worked.

The pagination block should be there if I take a look inside the catalog.xml file:

                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">

Maybe this could be something worth telling: When I check the template hints, there's no such block. The template is a customized version of the RWD theme.

this is the url: https://www.kweekotheek.nl/kweeklampen/led.html


texts: Waiting for incoming connection with ide key 'xxxxx'

texts: In phpstrom variable getting "Waiting for incoming connection with ide key 18836" while trying to run debug magento2 using xdebug. Xdebug is installed correctly in my Ubuntu system,checked with php -v. I thought, issue with phpstrom xdebug configuration. how to configure xdebug(3.0.3) in phpstrom (2020.3.2)


texts: How to customize Add to cart functionality based on product categories in Magento 2?

texts:
I am using Magento 2.3.0

I have some products in my website which allows custom printing and these products are assigned in category "Printing Products". Now I want to customize add to cart functionality for these custom printing products. I don't want to add any other category products with these custom printing products. For Ex., Let's say When there is custom printing product is already added to a product and if I try to add any products other than "Printing product" category then this product must not be added to cart and an error message should be displayed.

In short, Custom Printing category products are not allowed to shop with other products. So, How can I do this?

EDIT : When the cart is empty or cart is having other product from "Printing Products" category then I should be able to add printing product into the cart and in this situation, if I try to add products other than "Printing Products" category then the error message should be shown.


texts: How to change landing page to Wordpress site from Magento?

texts: I have a Wordpress blog and a magento shopping cart. I would like the wordpress blog to show as my home page instead of the magento site. How can I change this? Thank you in advance for any help or advice!


texts:
I've been working with Magento since April and plan on starting to study so that I can write the exam soon.

I was trying to find out where/when I could take exams to see what kind of schedule I would be on.

I found the FAQ - https://magento.com/training/catalog/certification/faq and have located the nearest test center to me, but when I try to view the page where I can register (http://www.webassessor.com/magento) I get a 404 - does anyone know any other way I can schedule a test, please?


texts: Information Changes have been made to this section that have not been saved. This tab contains invalid data in Magento 2

texts:
I am facing this error in the admin side when viewing the orders.

It showing

Order View
Information Changes have been made to this section that have not been saved. This tab contains invalid data. Please resolve this before saving.

I am getting this error on that page.

<b>Fatal error</b>:  Uncaught Error: Call to a member function getValue()     on null in /home/oherron/public_html/vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml:162


texts: After Magento update(2.1.9>2.2.2) JS error on admin dashboard

texts:
Uncaught SyntaxError: Unexpected token } in JSON at position 33

Specifically, this line inside page's html is causing the error:

<script type="text/x-magento-init">{"*": {"Magento_Ui/js/core/app": }}</script>

"Magento_Ui/js/core/app" doesn't have a value.

I've already cleared all the exceptions on the front-end relating to xml configuration.

Can somebody point me the right direction? I'm still discovering new Magento2 AJAX request flow.

Edit/solution:

the problem was cause by a single module. Removing its settings from core_config_data and clearing the cache fixed the problem - the settings were regenerated.


texts: How to hide Payment method based on Shipping Method Magento2

texts: Hello I want to hide "Cash on Delivery" Payment method when i select the Flat Rate Shipping Method in magento2 , already try another solution but it not work, please help me how can i achieve this thing?


texts:
Currently this query is slowing the entire site down:

Spawns in irregular times:

SELECT `main_table`.`entity_id`, main_table.`name`, main_table.`path`,
`main_table`.`is_active`, `main_table`.`is_anchor`,
`url_rewrite`.`request_path` FROM `catalog_category_flat_store_1` AS
`main_table` LEFT JOIN `core_url_rewrite` AS `url_rewrite` ON
url_rewrite.category_id=main_table.entity_id AND url_rewrite.is_system=1
AND url_rewrite.store_id = 1 AND url_rewrite.id_path LIKE 'category/%'
WHERE (main_table.include_in_menu = '1') AND (main_table.is_active = '1')
AND (main_table.path like '1/2/%') ORDER BY `main_table`.`position` ASC

Freezes the entire site and the process says, creating sort index, or sending data. Meanwhile CPU spikes to 100%...

Anyone knows what triggers this, and/or how to resolve this?


texts: what is the use of _merge_before and _merge_after event in Magento 2

texts:
I want to know the difference between following Magento 2 events

  1)sales_quote_add_item

  2)_merge_before

  3) _merge_after

and how I can use the event in event.xml

sales_quote_add_item and _merge_before is both are same event or different

could anyone give some ideas?


texts: Magento giving error 503 upon sending emails for New Orders, Invoice, Shipment etc.?

texts:
I have an ecommerce website built on Magento (1.9.2.3). Last night I shifted it from localhost to online hosting (BigRock) - let's call this live server. The issue is that on live server Magento is not sending any mails. Instead it gives the following error:

  Service Unavailable

  The server is temporarily unable to service your request due to
  maintenance downtime or capacity problems. Please try again later.

  Additionally, a 503 Service Temporarily Unavailable error was
  encountered while trying to use an ErrorDocument to handle the
  request.

The store is not in maintenance mode.

I am using SMTP Pro extension and it's self-test are running fine. On localhost, the same setup is working i.e. I can receive new order, invoice, shipment etc. mails.

I have checked the access logs on online hosting, nothing stands out. Have compared them to the logs on localhost, they both show same request and response sequence.

I have enabled logging in Magento. Got the following in exceptions.log:

https://pastebin.com/rch2BsrX

Following are the content of system.log:

https://pastebin.com/4F6wK35e

If I disable email communication in Magento (in Configuration > System > Mail Sending Settings) everything works fine, except obviously mail functionality is disabled.

I have checked file permissions as well, they are same as on localhost.

Cron settings are as per the guidelines. Though when I access cron.php from the browser it gives error 403.

There's an error_log file in the webroot directory. It says:

  [10-Feb-2018 05:03:03 UTC] PHP Notice:  Undefined index: SCRIPT_NAME
  in /cron.php on line 40 [10-Feb-2018 05:03:03 UTC] PHP
  Notice:  Undefined index: SCRIPT_FILENAME in /cron.php on
  line 41

Right now, I am not sure where or what the issue is. I have recently begun with Magento development. Can really use some help.

Adding my comments here (since I don't have comment privileges as of now):

@Piyush: It's set to 30 seconds on both localhost and Web host


texts:
I used an observer in my extension called checkout_type_onepage_save_order_after but I don't know why this observer work even customers do not use my extension!

My extension is custom shipping extension and for saving my orders with api in my shipping panel, should use observer

code is

<global>
<events>
    <checkout_type_onepage_save_order_after>
        <observers>
            <mycompany_myextension_order_complete>
                <class>myextension/observer</class>
                <method>myextensionCompleteOrder</method>
            </mycompany_myextension_order_complete>
        </observers>
    </checkout_type_onepage_save_order_after>
</events>
</global>

How can I prevent load observer when customers do not select this shipping method ?


texts: 503 service error for shipping information api in magento 2?

texts:
I have logged in as USER and at checkout end in the network seeing that for ship information I am getting 503 service error. how to fix this issue.How to resolve this issue.

Request URL:

https://xxxxxxx/index.php/rest/default/V1/carts/mine/shipping-information

Response

<title>503 Service Unavailable</title>

Service Unavailable

The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.


texts: I would like to show the brand, discount and category filters in the toolbar. I want to show it like this - Sort by - category - Brand - Discount - in the toolbar above the category products. Please help me i am a new to magento. I tried to echo filter.phtml in toolbar.phtml and list.phtml but it doesn't seems to pick the code, tried to change it through xml but no help at all. I don't know what else to do, please help. Thanks in advance..


texts: Magento 2 : Pass a variable to getChildBlock() in LayeredNavigation view.phtml

texts:
I have to pass a variable in layer/view.phtml

  /Magento_LayeredNavigation/templates/layer/view.phtml

to its getChildBlock which is renderer/labels.phtml

  Amasty_Shopby/templates/layer/filter/category/items/renderer/labels.phtml

I am not able to send a variable, have added a setter & getter in its block file.

Following the layer/view.phtml  file the block file I find is
  $block \Magento\LayeredNavigation\Block\Navigation

I have overridden the vendor file with the following code

class Navigation extends \Magento\LayeredNavigation\Block\Navigation
{

   private $_filter;

   public function setCustomVariable($filter){
   $this->_filter = $filter;
   }

   public function getCustomVariable(){
    return $this->_filter;
   }
 }

I want something like that

<?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->setCustomVariable($customData)->render($filter); ?>

and in the child HTML which is layer/filter/category/items/renderer/labels.phtml

$block->getCustomVariable()

but it doesn't set the variable in layer/view.phtml  and not able to get the value in its child phtml renderer/labels.phtml

So upon digging I find the catalog_category_view_type_layered.xml in vendor which

  vendor/magento/module-layered-navigation/view/frontend/layout/catalog_category_view_type_layered.xml

 <attribute name="class" value="page-with-filter"/>
    <referenceContainer name="sidebar.main">
        <block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" before="-" template="Magento_LayeredNavigation::layer/view.phtml">
            <block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalog.navigation.state" as="state" />
            <block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalog.navigation.renderer" as="renderer" template="Magento_LayeredNavigation::layer/filter.phtml"/>
        </block>
    </referenceContainer>

This say Magento_LayeredNavigation::layer/view.phtml has block file
Magento\LayeredNavigation\Block\Navigation\Category which doesnt even exist in my code base of vendor.

Magento\LayeredNavigation\Block\Navigation\State and Magento\LayeredNavigation\Block\Navigation\FilterRenderer is there in the vendor block folder but no Magento\LayeredNavigation\Block\Navigation\Category.

At first, I have overridden the Navigation.php which is under Block\Nagivation.


texts: After migration cannot access Magento 2 backend anymore

texts:
I just got the migration working - all categories, products etc. seem to be fine in the frontend.

My backend was at: http://localhost/magento2/admin_1bcprj/
env.php:

return array (
  'backend' =>
  array (
    'frontName' => 'admin_1bcprj',
  ),

and web/unsecure/base_url and the secure version are pointing to: http://localhost/magento2/

But in the browser under: http://localhost/magento2/admin_1bcprj/ I only get a 404 from Magento. Is there any other setting somewhere that I've overlooked?


texts: Is it safe to disable Magento Message Queues ( Magento_Amqp )?

texts:
Upon checking my server logs I see that in the system.log I have a lot of records with this error: main.INFO: Consumer "async.operations.all" skipped as required connection "amqp" is not configured. Unknown connection name amqp [] []

Could someone please confirm if I can disable this module I am not able to understand what it is even used for. I've read this article from the official Magento docs: Manage message queues
 but still I am not able to understand do I have to leave it enabled or I can disable it. If someone could please explain what this module does would be great as well.

I am using Magento 2.3.2 on a VPS.