texts: how to filter magento 2 collection with 'or', 'and' combination?

texts:
For example, the search query is 'samsung lcd'. it can match with product name or SKU.

I have below product names.

1.samsung xyz lcd.

2.samsung lcd pack.

3.samsung mobile

4.screen lcd.

so when I filter I need to get only

 1.samsung xyz lcd.

 2.samsung lcd pack.

where name like '%samsung lcd%' or sku like '%samsung lcd%' or (name like '%samsung%' or sku like '%samsung%' and(name like '%lcd%' or sku like '%lcd%'))

but now I'm getting all above product names.
Could you please help me with this.

$term = $this->getRequest()->getParam('term');
$termArr = explode(' ', $term);
$search = array();
$search[] = array('attribute' => 'sku', 'like' => '%' . $term . '%');
$search[] = array('attribute' => 'name', 'like' => '%' . $term . '%');
        foreach ($termArr as $termc) {
            $search[] = array(
                'attribute' => 'name', 'like' => '%' . $termc . '%');
            $search[] = array(
                'attribute' => 'sku', 'like' => '%' . $termc . '%');
        }

  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $collection = $objectManager->create('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory')->create();
        $collection->addAttributeToSelect('name');
        $collection->addFieldToFilter($search);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        $collection->setPageSize(10);

update:
The following code is working fine, but not optimized.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $term = $this->getRequest()->getParam('term');
    $termArr = explode(' ', $term);
    $pids = array();
    if (count($termArr)) {
        $collection1 = $objectManager->create('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory')->create();
        foreach ($termArr as $termc) {
            $termc = trim($termc);
            if ($termc == '')
                continue;

            $search1 = array();
            $search1[] = array(
                'attribute' => 'name', 'like' => '%' . $termc . '%');
            $search1[] = array(
                'attribute' => 'sku', 'like' => '%' . $termc . '%');
            $collection1->addFieldToFilter($search1);
        }
        $collection1->getSelect()->reset(\Zend_Db_Select::COLUMNS);
        $collection1->getSelect()->columns(['entity_id']);
        $pids = $collection1->getAllIds();
    }
    $collection = $objectManager->create('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory')->create();
    $collection->addAttributeToSelect('name');
    $search = array();
    $search[] = array('attribute' => 'sku', 'like' => '%' . $term . '%');
    $search[] = array('attribute' => 'name', 'like' => '%' . $term . '%');
    if (count($pids)) {
        $search[] = array('attribute' => 'entity_id', 'in' => $pids);
    }
    $collection->addFieldToFilter($search);
    $collection->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
    $collection->setPageSize(10);


texts:
I need to give option to pay by paypal method in order view page for the customer if they choosen the COD while they place the order.

How to get the paypal payment link for an order?


texts: Magento Custom theme template file is not calling

texts:
I create a new theme in magento like below
Namespace : ndot , Template : english, then in admin configuration i defined this is my theme.

Copy the layout files form app/design/frontend/base/default/layout to  app/design/frontend/ndot/english/layout.
template files
app/design/frontend/base/default/template to
app/design/frontend/ndot/english/template/customer.

but when i changes the file in app/design/frontend/ndot/english/template/customer/form/register.phtml, the changes is never reflecting

How to i fix this problem ?


texts: User created at the exact same time an order was placed. Magento 1.8.1.0

texts:
We have had an issue where a customer was able to create an account on one of our stores. We have external account creation disabled and use Formstack to generate login request emails. Each user has to be Created Manually.

This customer was able to create an account and checkout at the exact same time.

does anyone have any idea if there is a work around to making a login on a site with front end registration disabled?


texts:
I'm trying to use the Magento UI Library "dropdown" element.

I've found an official (https://magento.com/developers/magento2) Magento 2 Demo at this link and going to the dropdown docs i've found that they are broken (i get no dropdown in chrome or firefox)

The documentations says that with this markup

        span + dropdown

             One

             Two

             Three

and with this less mixin

.example-dropdown-2 {
    .lib-dropdown();
}

it should work but as you can see it doesn't.

Am I missing something?


texts:
In My site i used getShippingDescription but it's not fetching shipping price.

How to check and where to check for this method

    <?php $_order = $this->getOrder() ?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>

<?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?>

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

<?php echo $this->getStatusHistoryRssUrl($_order) ?>

<?php echo $this->__('About This Order:') ?>

        <?php $_links = $this->getLinks(); ?>

        <?php foreach ($_links as $_link): ?>
            <?php if($_link->getUrl()): ?>

<a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?>

            <?php else: ?>

<?php echo $_link->getLabel() ?>

            <?php endif; ?>
        <?php endforeach; ?>

<?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?>

<?php if (!$_order->getIsVirtual()): ?>

<?php echo $this->__('Shipping Address') ?>

                <address><?php echo $_order->getShippingAddress()->format('html') ?></address>

<?php echo $this->__('Shipping Method') ?>

                <?php if ($_order->getShippingDescription()): ?>
                <?php echo $_order;?>
                    <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
                <?php else: ?>

<?php echo $this->helper('sales')->__('No shipping information available'); ?>

                <?php endif; ?>

<?php endif; ?>

<?php echo $this->__('Billing Address') ?>

                <address><?php echo $_order->getBillingAddress()->format('html') ?></address>

<?php echo $this->__('Payment Method') ?>

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


texts: What does it take for an order that's been created programmatically to appear in the dashboard statistics?

texts:
Currently building an extension that creates orders programmatically following this guide. I have also added on a section to create an invoice for each order following this guide.

All working as expected and tested. An order is created, along with an invoice.

However, the dashboard statistics revenue counter stays at zero, despite the number of orders counter going up as new orders are created.

My question, is what does it take for the dashboard counter to accept an order as revenue, if an invoice exists?


texts: Magento 2: store selector for custom module in admin form

texts:
Stuck in a new issue regarding adding store selector for my custom module in admin form -
I need to add a store selector and to add the values of a store in a different table as it is working with existing cms_block and cms_page modules

EDIT

I added a custom form in admin section without using ui_component and now added a store selector in form, now a new issue in my front is to save this store data in my custom modules store's table , my custom table is cms_job and my custom module's store table is cms_job_store

 now further i want to save data in both these tables and to retrive data for Grid section which is generated using ui_component

please help me on this,

Thanks


texts: Display Products on Homepage From Custom Module

texts:
I created one custom back-end module and admin can add products id in the back-end with comma separated , so how can I display that products on home page which is admin add in the back-end.

Here is my productlisting.phtml file

$collection1 = Mage::getModel('catalog/product')->getCollection()->getAllIds();
        echo "
";
        //print_r($collection1);
        echo "
";
        $collection = Mage::getModel('productlisting/productlisting')->getCollection();
        foreach($collection as $date_to){
            if($date_to == $collection1)
        //  print_r($date_to->getProductId());
                $date_to->getLimit();
            //  print_r ($date_to->getLimit());
    //  var_dump($date_to->getProductId());
            echo "
";
            //print_r($date_to->getDateTo());
        }


texts: Send Copy of Order Confirmation email programmatically in magento 2

texts:
I want to send copy of order confirmation mail to another customer so for that i am using btn_sales_order_save_after event

and in observer construct i am adding

\Magento\Sales\Model\Order\Email\Sender $sender,
....
$this->sender = $sender;
......

And call method like this

 $order->setCustomerName($customerName);
$order->setCustomerEmail($customerEmail);
$this->sender->checkAndSend($order);

But it gives this error

  "Fatal Error: 'Cannot instantiate interface Magento\Sales\Model\Order\Email\Container\IdentityInterface' in 'magento\lib\internal\Magento\Framework\ObjectManager\Factory\Dynamic\Developer.php' on line 73";

is this right way to send copy of order confirmation email?


texts: Magento 1.9 - Add multiple product in one click in "Add to Cart" inside magento

texts:
I working in view.phtml and my project is can add in the cart two or more products in only one click. I explain my project...

In the product details we have a normal product and the button add to cart In the same page i would recall another simple/virtual product with a variable. So i would that when the customer push on "add to cart" in checkout there will be two product added simultaneously.

How can I do? What files can I touch?

Thanks.


texts: Add More Product Data to Search Results Page

texts: I'm shooting to add some additional information (below the price, in the template) to products on my search results page only. This data is not available to the price.phtml template, as it is never loaded into the collection. What I need to do is get to that search results page product collection, and add a few more selects. I was hoping there would be an after_collection event to observe, but I found none being fired that looked at all useful. I perused catalogsearch, but became confused and frustrated, as Magento often makes me feel. If someone knows where this collection is coming from and how to hook into it and modify it, that would be extremely helpful and much appreciated.


texts: Magento 2 Overriding Sales shipping email templates not working

texts:
We are overriding shipping templates from admin but in email Shipped By & Tracking Number  and Products information is missing.
Does anyone know why it is not showing?


texts:
I  want to implement a payment gateway (NTPnow) in Magento for credit card processing.

I am providing web-services of Magento for POS app and POS team want to make credit cart payment at end of Magento using this specific payment method

I searched on google for it but not find any solution.

How can implement a new payment method in Magento??


texts:
I've tried to read up on this, but the information I found only got me more confused.

PayPal refuses to work on my Magento installation. I have called their support and they told me that there is no request to the PayPal servers. So I assume the issue is local.

Does PayPal need encryption to be enabled on the server hosting the shop?

Is there anything else that could stop PayPal in its tracks before even reaching their servers?

This error is logged in exception.log:

  exception 'Mage_Core_Exception' with message 'PayPal NVP gateway errors: Array Correlation ID: . Version: .' in /is/htdocs/xxx/xxx/app/code/core/Mage/Paypal/Model/Api/Nvp.php:1062

This is what it tells me when I try to check out with PayPal Express:

  PayPal gateway has rejected request. Method Specified is not Supported (#81002: Unspecified Method).


texts:
I am looking at the possibilities of having a discount code applied to a recurring profile.
For instance, a customers subscribes our subscription (basis = 12 months) at 34.99 but with the special promotion he will get 10 % off for the 12 months. Is this possible ? If yes, how ?
Thanks.


texts:
We have a three-day vacation
And I want to pause the Order Magento
How's the way?


texts: Magento 2 Minicart template not changing on front end

texts: I want to style the minicart in my Magento 2 store. When I edit /Magento_Checkout/web/template/minicart/item/default.html none of the changes show up in the cart. Is that a caching issue? or am I editing the wrong thing?


texts:
After Varnish cache enables from Magento admin catalog menu disappears

Steps I follows to enable cache

*Admin>>> Store >> Configuration

*Advanced>>>> System
*Full Page Cache

Please find setting screenshot

Please anyone knows the solution for it


texts: Changing the radio button as Anchor Buttons 1.9.1.0

texts:
Is there any way to convert the radio buttons into buttons so that it can be directly clicked as a button.

I have two Custom Options, namely Buy and Rent.
I created a custom JS:

$selectHtml .='<script type="text/javascript">'.'function clicking(){opConfig.reloadPrice();productAddToCartForm.submit(this);}'.'</script>'.

and added the clicking function to onClick of Radio Button.

This is working fine. But i want a seperate Button
Something like this:

<button onClick="clicking();"> Click here for rent </button><br>
<button onClick="clicking();"> Click here for buy </button>

But for this we need to get the custom option ID and append it to the button (i am assuming)


texts: Where the actual data of custom attribute is stored in magento 2?

texts:
I have added a custom attribute in existing table catalog_category. The following code i have write in InstallData.php.

namespace BelVG\AdditionalImageTemplate\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Catalog\Setup\CategorySetupFactory;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface {

    /**
     * Category setup factory
     *
     * @var CategorySetupFactory
     */
    private $categorySetupFactory;

    /**
     * Init
     *
     * @param CategorySetupFactory $categorySetupFactory
     */
    public function __construct(
    CategorySetupFactory $categorySetupFactory
    ) {
        $this->categorySetupFactory = $categorySetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function install(
    ModuleDataSetupInterface $setup, ModuleContextInterface $context
    ) {
        $installer = $setup;
        $setup->startSetup();
        $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
        $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Category::ENTITY);
        $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
        $categorySetup->addAttribute(
                'catalog_category', 'additional_image', [
            'type' => 'varchar',
            'label' => 'Additional Image',
            'input' => 'image',
            'backend' => 'Magento\Catalog\Model\Category\Attribute\Backend\Image',
            'required' => false,
            'sort_order' => 100,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'group' => 'General Information',
                ]
        );
        $installer->endSetup();
        $setup->endSetup();
    }

}

This works fine and I got the entry in eav_attribute table.
After that I created a Thumbnail Image in backend category form and that too works fine.

But I did not get where the actual values of the image I upload from backend side is stored and how to fetch that values?

Basically I need the image name and url of the image.


texts: How to prepare for Magento Solution Specialist Certification?

texts:
Does anyone here have experience with Magento Solution Specialist exam? Past, present and future.

Everyone I speak to tells me I would definitely pass, but I think that is making it harder to take the plunge as it will be even more embarrassing if I fail!

I am currently gathering as much experience and knowledge on Magento to up my confidence before going for it.

If you have done it, or are planning to do it, I would love to know how you prepared, what you found helpful, how relevant the resources out there are and just generally how you found the exam?


texts: Want to display simple product's attribute on product detail Page

texts: Can anyone help me to display simple products custom attribute value on grouped.phtml page.


texts: Magento 2: Update Product Data Outside Magento with Tier Pricing

texts:
I have below script for Update Product records with Tier Pricing.

I have already Product SKU in CSV. On basis of that fetching Product Id & Try to update Record.

$mysqli = mysqli_connect('localhost', 'root', '', 'magento2');

if (!$mysqli) {
    echo "Error: Unable to connect to MySQL." . PHP_EOL;
    echo "Debugging errno: " . $mysqli->connect_errno . PHP_EOL;
    echo "Debugging error: " . $mysqli->connect_error . PHP_EOL;
    exit;
}

$file_name = "final_sheet.csv";

// MAGENTO START
include('app/bootstrap.php');

use Magento\Framework\App\Bootstrap;

$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

if (($handle = fopen($file_name, "r")) !== FALSE) {
    $i = 0;
    while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
        $i++;

        if ($i > 1) {

            $_product = $objectManager->create('Magento\Catalog\Model\Product');
            $_productTierPrice = $objectManager->create('Magento\Catalog\Api\ProductTierPriceManagementInterface');

            $productSKU = $mysqli->real_escape_string(trim($data[0]));
            $productDesc = $mysqli->real_escape_string(trim($data[1]));
            $productTierPrice = $mysqli->real_escape_string(trim($data[2]));
            $productTierPrice = (!empty($productTierPrice)) ? number_format($productTierPrice, 4) : '';

            $sql = "SELECT entity_id FROM catalog_product_entity WHERE  sku = '" . $productSKU . "';";
            $result = $mysqli->query($sql);

            if ($result->num_rows > 0) {
                while ($row = $result->fetch_array()) {
                    $entityId = $row['entity_id'];
                }

                echo "Product Id. " . $entityId . "
";

                $_product->load($entityId);
                $_product->setDescription($productDesc);

                $_product->save();

                $getData = $_product->getData();
                $_product->setData($getData);
                $_product->save();

                $sku = $productSKU; //Product sku
                $customerGroupId = 2; //Wholsaler group id
                $price = $productTierPrice;
                $qty = 1;

                $_productTierPrice->add($sku, $customerGroupId, $price, $qty);

                $_productTierPrice->save();
            } else {
                echo "Product Not Found";
                exit;
            }

            if ($i > 3)
                break;
        }
    }
    fclose($handle);
}

mysqli_close($mysqli);

echo 'Done';

It's saving product description data in Database, but not showing in Admin.


texts: Add to cart functionality is not working for any product

texts:
my add to cart not working, its showing nothing in cart for 2 stores and for 1 store adding a default product everytime, doesn't matter which product we added,
its showing this exception....

We can't add above item to cart.Please contact administratorThe product wasn't found. Verify the product and try again.

i have checked my code is fine, its working on local setup and dev server, just issue is on production,

i have tried with cookie lifetime increase and permission settings on directories but none worked..
do it need some more cookie or session changes which can be done ?

can any body share any idea or solution with some details ??


texts: Having pagination issue with collection with addAttributeToFilter

texts:
I'm having issue with the pagination and the layered navigation on filtered product collection. The goal is to filter the products by a customer attribute and show only products related to that attribute. The filter is fine except that I get more pages than really available. By example, a certain filter would return 10 products (which is correct) but give me 3 pages of 12 products (page 2 and page 3 doesn't show anything but the pager still show 3 pages). Same thing for the layered navigation on the left. I got results from not available products. By example, the color filter shows 2 products matching this color, but once clicked, no product is listed (it is normal, there is no blue product for that filter) but the results are still showing.

Based on that post

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">

    <type name="Magento\Catalog\Model\ResourceModel\Product\Collection">
        <plugin name="sidebarFilters" type="Vendor\Module\Model\Plugin\SidebarFilter"/>
    </type>

</config>

Sidebarfilter.php:

<?php namespace Vendor\Module\Model\Plugin;

use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;

class SidebarFilter
{
    /**
     * aroundAddFieldToFilter method
     *
     * @param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection
     * @param \Closure                                                $proceed
     * @param                                                         $fields
     * @param null                                                    $condition
     *
     * @return \Magento\Catalog\Model\ResourceModel\Product\Collection
     */
    public function aroundAddFieldToFilter(ProductCollection $collection, \Closure $proceed, $fields, $condition = null)
    {
        $collection->addAttributeToFilter('brand',[ 'nin' => array(31, 32, 33) ]);

        return $fields ? $proceed($fields, $condition) : $collection;
    }
}

Everything is fine except pagination and layered navigation.

Thanks for help !


texts: Add a button in fornt of each row that send email to the a column email value

texts:
I have a form in front end that save vale in database and shown in the admin grid. I have an action button in front of each row so click of this button i want to get the rest of columns value.

I have following grid in admin:

 protected function _prepareColumns()
{
    $this->addColumn('name', array(
        'header' => Mage::helper('optfirst_reviewmycompany')->__('Name'),
        'align' => 'right',
        'width' => '10px',
        'index' => 'name',
        ));

    $this->addColumn('email', array(
        'header' => Mage::helper('optfirst_reviewmycompany')->__('Email'),
        'align' => 'left',
        'index' => 'email',
        'width' => '50px',
        ));

    $this->addColumn('comment', array(
        'header' => Mage::helper('optfirst_reviewmycompany')->__('Comments'),
        'width' => '150px',
        'index' => 'comment',
        ));

      $this->addColumn('action',
        array(
      'header' => Mage::helper('optfirst_reviewmycompany')->__('Send Email'),
      'width' => '50',
      'type' => 'action',
      'getter' => 'getId',
      'actions' => array(
             array(
                  'caption' => Mage::helper('optfirst_reviewmycompany')->__('Review Email'),
                  'url' => array('base'=> '*/*/view'),
                  'field' => 'id'
                )),
      'filter' => false,
      'sortable' => false,
      'index' => 'stores',
      'is_system' => true,
     ));

How i can do this for each row.


texts:
How can i redirect pub/static page to home page?
for exsample: https://xxxxxx/pub/static is will showing , how to redirect to home page.
Requested path '' is wrong.
<pre>#1 Magento\Framework\App\StaticResource->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#2 Magento\Framework\App\Bootstrap->run() called at [pub/static.php:13]
</pre>


texts: Add two attribute values and display the result as a column in admin grid

texts:
I have an admin grid with two attributes of customer (attr1 and attr2). I can display them in the grid as two separate columns with addAttributeToSelect method.

protected function _prepareCollection() {
    $collection = Mage::getResourceModel('customer/customer_collection')
        ->addAttributeToSelect('email')
        ->addAttributeToSelect('attr1', 'left')
        ->addAttributeToSelect('attr2', 'left');
    ...

I need to add a third column displaying the sum of the values of those attributes. I can display this column too, with addExpressionFieldToSelect.

    ...
        ->addExpressionAttributeToSelect('sum', 'SUM({{attr1}})+SUM({{attr2}})', array(
            'attr1', 'attr2'
        );

    $collection->getSelect()->group('e.email');
}

The problem is if I filter the sum column, Magento gives me an error:

SQLSTATE[HY000]: General error: 1111 Invalid use of group function, query was: SELECT COUNT(*) FROM `customer_entity` AS `e`
 LEFT JOIN `customer_entity_int` AS `at_attr1` ON (`at_attr1`.`entity_id` = `e`.`entity_id`) AND (`at_attr1`.`attribute_id` = '866')
 LEFT JOIN `customer_entity_int` AS `at_attr2` ON (`at_attr2`.`entity_id` = `e`.`entity_id`) AND (`at_attr2`.`attribute_id` = '864')
 WHERE (`e`.`entity_type_id` = '1') AND (SUM(at_attr1.value)+SUM(at_attr2.value) >= '0.000000') GROUP BY `e`.`email`

I tried to define a custom filter callback:

protected function _prepareColumns() {
    $this->addColumn('email', array(
        'header' => Mage::helper('customer')->__('Email'),
        'width' => '300px',
        'index' => 'email'
    ));
    $this->addColumn('attr1', array(
        'header' => Mage::helper('core')->__('Attr 1'),
        'index' => 'attr1',
        'type' => 'price',
        'currency_code' => $store->getBaseCurrency()->getCode(),
    ));
    $this->addColumn('attr2', array(
        'header' => Mage::helper('core')->__('Attr 2'),
        'index' => 'attr2',
        'type' => 'price',
        'currency_code' => $store->getBaseCurrency()->getCode(),
    ));
    $this->addColumn('sum', array(
        'header' => Mage::helper('core')->__('SUM'),
        'index' => 'sum',
        'type' => 'price',
        'currency_code' => $store->getBaseCurrency()->getCode(),
        'filter_index' => 'sum',
        'filter_condition_callback' => array($this, '_filterSum'),
    ));

    return parent::_prepareColumns();
}

protected function _filterSum($collection, $column) {
    if (!$value = $column->getFilter()->getValue()) {
        return $this;
    }

    if (isset($value['from'])) {
        $collection->getSelect()->having('sum > '.$value['from']);
    }
    if (isset($value['to'])) {
        $collection->getSelect()->having('sum < '.$value['to']);
    }

    $this->setCollection($collection);
    return $this;
}

But this time I get this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sum' in 'having clause', query was: SELECT COUNT(*) FROM `customer_entity` AS `e`
 WHERE (`e`.`entity_type_id` = '1') GROUP BY `e`.`email` HAVING (sum > 0)

So, my question is how can I display the sum of two attributes in an admin grid?


texts: How to add min value for a field in custom Module system.xml file?

texts:
I want to add minimum value attribute for a admin interface field in my custom module. Can anyone suggest me how I can add min attribute in field? Here is my system.xml code:

<field id="uspsintexpress" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
<label>USPS Int'l Express Days</label>
</field>


texts: Magento 2 disabled shipping option after changing State of a new shipping address

texts:
In the checkout page, I found that the radio buttons of shipping options will be disabled after changing State/Provice of a new address if "tablerate" shipping method is used.
Is there any method to solve this issue?
Thanks


texts: Fatal error: Cannot instantiate interface Zend\Http\Client\Adapter\AdapterInterface in magento2

texts:
$httpAdapter = new \Zend\Http\Client\Adapter\AdapterInterface();

give error -

  Fatal error: Cannot instantiate interface Zend\Http\Client\Adapter\AdapterInterface.


texts: magento transfer from one server to another after that problem

texts:
Magento 1.9 transfer from one server to another,as follow  all steps such as(all file transfer, database import, change URL in database, database name change in .XML file and last clear cash), after that when we refresh webpage than automatically start fresh Magento installation process.
so please help me!, what can i do?


texts:
After entering my username and password into the admin uri of magento I get the following error in system.log

[2017-10-09 00:00:00] main.CRITICAL: Image CAPTCHA requires FT fonts support [] []

there is no such requirement listed by the magento installation guide

Is there a php module I have to enable/install?  php -m|grep -i -e 'font' lists nothing...  freetype and freetype-devel (v2.4.11)have both been installed to the system.


texts: Add same block to one page but different data

texts:
I have one block on the page :

<block type="obishomeaddon/customcategory" name="customcategory"   template="homeaddon/customcategory.phtml">
    <action method="setData"> <name>column_count</name> <value>4</value> </action>
    <action method="setData"> <name>category_id</name> <value>213</value> </action>
</block>

Now, I want to have two of these blocks but different category_id. The problem I have is Magento will loop through the XML first, so the last category_id will be set and all the blocks will have the same category_id

Which is a good way to solve this problem?


texts: Graph is not showing magento admin dashboard

texts:
My Magento having over 1 lakh products orders, but graph not showing according to sale on magento admin dashboard.
please help me what i need to do.
Graph showing blank. no graph image is showing.
Thanks in advance


texts: Creating a product programmatically without deprecated functions

texts:
I have the following code which creates a product programmatically but it uses deprecated functions eg the save

Therefore my question is how do you create a product programmatically without using deprecated functions?

public function __construct (
  \Magento\Catalog\Model\ProductFactory $productFactory
)
{
  $this->productFactory = $productFactory;
}

public function createProduct(){
  $simpleProduct1 = $this->productFactory->create();
  $simpleProduct1->setData('sku', 'Test Simple Product 1');
  $simpleProduct1->setData('name', 'Test Simple Product 1');
  $simpleProduct1->setData('website_ids', array(1)); // product can be found in main website
  $simpleProduct1->setData('attribute_set_id', 4);
  $simpleProduct1->setData('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
  $simpleProduct1->setData('visibility', 4);
  $simpleProduct1->setData('price', 12);
  $simpleProduct1->setData('type_id', 'simple');
  $simpleProduct1->setData('stock_data', array(  // set product quantity
   'use_config_manage_stock' => 0,
   'manage_stock' => 1,
   'is_in_stock' => 1,
   'qty' => 100
  ));
  $simpleProduct1->save();
}


texts: Magento 1: How can we get WebsiteId or websites from $product?

texts:
Magento 1: How can we get WebsiteId or websites array from $product?
Something like?
$product->getWebsiteId()


texts: Magento 2: Adding an additional filter in categories / products in category

texts:
Is there any way to add a custom attirbute in here? (See picture). I know the file is in

  /vendor/magento/module-backend/view/adminhtml/templates/widget/grid/extended.phtml

But I have no idea how to add ?


texts: Magento 2 - Cant place orders after migration

texts:
i experienced another bug (?) after migrating from Magento 1.9.1.0 to Magento 2.1.3 within the Checkout.

Steps to reproduce:

1) Setup a store in Magento 1.9.1.0 with some products and customer

2) Migrate that Store to Magento 2.1.3 - using the Magento Data migration tool

3) Add custom payment methods and shipping rates - actually migrated from 1.9.1.0

4) Login to an existing customer account and order something.

What should happen

Order gets placed

What happens

Failed to load resource: the server responded with a status of 400 (Bad Request) - www.host.domain/rest/default/V1/carts/mine/payment-information
POST host.domain/rest/default/V1/carts/mine/payment-information 400 (Bad Request)

Anyone who can help me with this ? A store with no orders cant be a working store :)

Thanks in andance

EDIT

Log from debug.log:

[2017-02-08 09:47:44] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://host.domain/rest/default/V1/carts/mine/payment-information","invalidateInfo":{"tags":["catalog_product_12265","FPC"],"mode":"matchingTag"},"is_exception":false} []

EDIT 2

After some more testing and google'ing i found out that the error only appears on migrated customers. With a new created one the order went straight through without any problems.

EDIT 3

After editing the PaymentInformationManagement.php to display the actuall error i finally get a exception.log with the following content:

[2017-02-14 11:04:51] main.CRITICAL: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '201600769-1' for key 'SALES_ORDER_INCREMENT_ID_STORE_ID' in /usr/www/users/nullnp/de_nullbar/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228

So my guess was to increase the increament ID but i cant figure out where..


texts: Image field is not updating while in import

texts:
I have CSV file and when i import the file , file imported successfully but image field is not updated.Product added to list but without image.

In the csv i checked and it has image link.How can i solve the issue.

May be some hints works for me.I tried these links examples but not succeeded.link1


texts:
I created a controller which show a simple block.

public function execute() {
        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();
    }

When I go to my controller page route I get the block but I get too the ,  and  tags. So how to render a page without theses ?

I tried this :

namespace Maxime\Helloworld\Controller\Index;
class Index extends \Magento\Framework\App\Action\Action {
    public function execute() {
        echo $this->_view->getLayout()
        ->createBlock('Maxime\Helloworld\Block\Hello')
        ->setTemplate('Maxime_Helloworld::helloworld.phtml')
        ->toHtml();
    }
}

but I get this html :

HelloWorld

Congratulations ! You have created your first Magento Module !

The block classname is : Maxime\Helloworld\Block\Hello

Install kint with "composer require raveren/kint"

get the request fired by collection echo $myCollection-&gt;getSelect()-&gt;__toString();

My block content is (I add in future some stuff here) :

<?php
namespace Maxime\Helloworld\Block;
class Hello extends \Magento\Framework\View\Element\Template {

}

My template is (it's an old module test for testing the output without html) :

HelloWorld

Congratulations ! You have created your first Magento Module !

The block classname is : <?php echo get_class($block) ?>

Install kint with "composer require raveren/kint"

get the request fired by collection echo $myCollection->getSelect()->__toString();


texts: I want to ship partial orders. As user has order some product which is currently not available in stack how can I achieve this ??


texts:
I need to change the name of country in magento store e.g. United Kingdom needs to be changed to Great Britain. How can I achieve this?

I tried looking at the following tables directory_country_region, directory_country_region_name, directory_country but country full names are not stored here.

I also tried using locale files to see if it updates, but no luck there as well.

Is there any way I can achieve this?


texts: Magento 2: How to get related product image url

texts: I am calling API for fetching the product details along with the related products, but in default API its only display the sku but i need to get the related product's image url also and display it in the same API call.


texts: Please select a customer for this transfer. Error occurred when import review from magento dataflow

texts:
I am developing one extension import/export product review. I have create dataflow script so admin can run dataflow profile for import/export. export is working fine. but when i run import i got this error Please select a customer for this transfer.. this error only occurred when there is guest review for product.
i have used this code for customer session.

 $_customer = Mage::getModel('customer/customer')->load($customerid);
$_session = Mage::getSingleton('customer/session')->setCustomer($_customer)->setCustomerAsLoggedIn($_customer);

So how we can resolve this error.


texts:
I want to Get Tracking id when shipping the order, For it, I use "sales_order_shipment_save_after" Observer. And I try but I got the blank array. My code is

$shipment = $observer->getEvent()->getShipment();
$order = $shipment->getOrder();
$shipmentCollection = $order->getShipmentsCollection();

$tracksCollection = $order->getTracksCollection();

foreach ($tracksCollection->getItems() as $track) {

    $trackNumbers[] = $track->getTrackNumber();

}

I also try other solution which is given in the old post but I am not got any result.
I am also try $observer->getEvent()->getTrack();  but also got blank in data.


texts: Module for customer can enter products images and attributes

texts: I need a site(embroidery shop),Here they designs cloths according to the customer designs.Customer can enter their embroidery images and some attributes. Then it will display price according to the customers details and customer can place their orders.If there is any 3rd party module have similar to these properties .Suggest please


texts:
Authorize.net on magento .1.9.2 is not working with Test mode set to NO. It is giving Gate way error(Gateway error: This transaction has been declined. Response code 103). When Test mode is Yes . It is accepting transactions.
I don't know what is wrong with it. I tried new trasaction key, cleared cache , reindexed.

Can anyone please help me.


texts: Getting SQLSTATE[HY000] [2002] Connection refused when running upgrade command for Magento 2.3

texts:
I am getting the following error when running the php bin/magento setup:upgrade command in my Magento 2.3 instance:

SQLSTATE[HY000] [2002] Connection refused

I can connect to the database using the mysql -u root -p and can run commands there without any issue. So I've determined that this is an issue with Magento's connection to the DB. I have gone in and changed the env.php setting from localhost to 127.0.0.1 with no luck. Recently we did have a DNS change, but I'm not sure if that would effect the database. Are there any other solutions?


texts: Toggle price on category/view.phtml and product/view.phtml

texts:
I need an option to toggle off/on the price (category/view.phtml and product/view.phtml).

Let's say a logged in customer wants to hide the price.

So he ticks a checkbox or anything like that which hides prices on the both mentioned view.phtml

Is there any way to achieve something like that in magento 1.9.3.6 ?
Thanks


texts: Is it possible to setup a cron job to flush product catalog images?

texts:
You can obviously manually flush the catalog images cache by going to Cache management and clicking on "Flush Catalog Images Cache". My question is can this be set as a scheduled task? If so, what would the code be to create this and what file would it be inserted into?

The below extension looks like it will do what I'm after and a bit more, so will possibly just go with that unless there are any suggestions of a better way to do?

http://www.magentocommerce.com/magento-connect/cron-cache-cleaner-3782.html


texts: Magento - Should I stop to write JS/CSS directly in the backend in CMS pages?

texts:
In Magento you can create CMS pages. It is also possible to add CSS and JS code, directly to the page, which I sometimes do for rather smaller changes and style fixes and such, because then that specific code is only loaded on this page and not on any others where it is not needed.

Also it is way faster than the normal way and I don't need to push it via git which can take ages because our agency is slow, and it costs us money if they have to deal with git.

But now our agency don't want us to do this anymore, because they say it is dirty. If it is dirty, then why is it possible and not blocked by magento?

And how am I supposed to add a code which should only render on a specific CMS page?

How should I argue?


texts: Hiding tax amount on one page chceckout using xml file

texts:
I'm trying to hide tax amount on one page checkout. Hiding that in phtml files is not a problem, but I want to hide it using xml file.

To that moment I have this code in my local.xml file:

<sales_order_view>
<reference name="content">
    <block type="sales/order_view" name="sales.order.view">
        <block type="sales/order_items" name="order_items" template="sales/order/items.phtml">
            <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
              <action method="unsetChild">
                <name>tax</name>
              </action>
            </block>
        </block>
    </block>
</reference>
</sales_order_view>

But it didn't work. Any sugestion?


texts:
Magento version: 2.0.0

I copied the Magento_Checkout file to my custom vendor directory and renamed it, but the block and layout are not working for me when i modified some files.

How to overwrite them?

need to change the di.xml?

i just copied it.


texts: Update minicart after adding products programmaticaly

texts:
I'm adding products programmaticaly in my module. I've created etc/frontend/sections.xml file with following content:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="modextend/cart/addProducts">
        <section name="cart"/>
    </action>
</config>

And it's routes.xml content:

<?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="modextend" frontName="modextend">
            <module name="Vendor_ModulesExtend" />
        </route>
    </router>
</config>

And for some reason minicart isn't updating itself after using my controller. Products are added successfully because I can see them in checkout and cart.

Do you know why isn't it working?

Edit:
I've tried it also by AJAX request:

var url = '/modextend/cart/addProducts/products_ids/';
//selectedAccessories is array of products id's
url += selectedAccessories.join(',');

$.ajax(
    url,
    {method: 'post'}
).done(function(res)
{
    console.log(res);
});

And its my controller action:

$products = $this->getRequest()->getParam('products_ids');
$result = [];

if($products)
{
    $products = explode(',', $products);

    try {
        $this->cart->addProductsByIds($products);
        $this->cart->save();

        $result['success'] = true;
        $this->messageManager->addSuccess(__('Selected accessories has been added to your cart.'));
    } catch (LocalizedException $e) {
        $result['error'] = true;
        $this->messageManager->addException(
            $e,
            __('%1', $e->getMessage())
        );
    } catch (\Exception $e) {
        $result['error'] = true;
        $this->messageManager->addException($e, __('There was an error while adding accessories to your cart.'));
    }
}

$this->getResponse()->representJson(
    $this->_objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result)
);


texts: Magento 2: set different languages for the back-end and storefront

texts:
I have recently set up a Magento 2 shop. I need to set the part that is visible to the customers in one language (German) and the backend (Dashboard) in another language (English).

I have not managed to see such an option in the admin section.


texts:
I am trying to have multiple price options for books, for example Book A - hardcover will be $20 and softcover will be $16.00

But I want it to display the price as "$16-$20" or say "Price Varies"
right now what I do is create a custom option and have a drop down, but the base price is $16 and it says "hardcover + $4.00"  That I know how to do, but I want it on the category page where it says the products to show "$16-$20" or "price varies" is there such a way?


texts: Magento 2: How to copy the value of field to another field?

texts:
I need to copy the value of the Social Reason field to the firstname field so I can hide it and not leave it empty.

Is it possible with magento? or is a script necessary?


texts: how to display size attribue as dropdown?

texts:
In product details page, value of size attribute is displayed like:

I want to display it as dropdown. Please help.

The below code is use to choose whether it should be a dropdown or a swatch:

<dd class="clearfix swatch-attr<?php if ($_attribute->decoratedIsLast) echo ' last'; ?>">

        <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select no-display swatch-select">
            <option><?php echo $this->__('Choose an Option...') ?></option>
        </select>
        <ul id="configurable_swatch_<?php echo $_attrCode ?>" class="configurable-swatch-list clearfix">
            <?php foreach ($_swatchArray->options as $_option): ?>
                <?php
                $_optionCode = Mage::helper('configurableswatches')->getHyphenatedString($_option->label);
                $_swatchUrl = Mage::helper('configurableswatches/productimg')->getSwatchUrl($_product, $_option->label, $_swatchInnerWidth, $_swatchInnerHeight, $_swatchType);
                $_hasImage = !empty($_swatchUrl);
                $_liClass = '';
                $_aClass = 'swatch-link swatch-link-' . $_attribute->getAttributeId();
                if ($_hasImage) {
                    $_liClass .= $_swatchType == 'media' ? ' is-media' : '';
                    $_aClass .= ' has-image';
                } elseif (strlen($_option->label) > 3) {
                    $_liClass .= ' wide-swatch';
                }
                ?>
                <li class="option-<?php echo $_optionCode; ?><?php echo $_liClass; ?>" id="option<?php echo $_option->id; ?>">
                    <a href="javascript:void(0)" name="<?php echo $_optionCode; ?>" id="swatch<?php echo $_option->id; ?>" class="<?php echo $_aClass ?>" title="<?php echo $_option->label; ?>"
                       style="height: <?php echo $_swatchOuterHeight ?>px; <?php if (!$_hasImage): ?>min-<?php endif; ?>width: <?php echo $_swatchOuterWidth ?>px;">
                <span class="swatch-label" style="height: <?php echo $_swatchInnerHeight ?>px; <?php if (!$_hasImage): ?>min-<?php endif; ?>width: <?php echo $_swatchInnerWidth ?>px; line-height: <?php echo $_swatchInnerHeight ?>px;">
                <?php if ($_hasImage): ?>
                    <img src="<?php echo $_swatchUrl; ?>" alt="<?php echo $_option->label; ?>" width="<?php echo $_swatchInnerWidth ?>" height="<?php echo $_swatchInnerHeight ?>" />
                <?php else: ?>
                    <?php echo $_option->label; ?>
                <?php endif; ?>

                        X

            <?php endforeach; ?>

And the js required for this is :

setAttrData: function(attr, i) {
    var optionSelect = $('attribute' + attr.id);
    // Flags
    attr._f = {};
    // FIXME for Custom Option Support
    attr._f.isCustomOption = false;
    attr._f.isSwatch = optionSelect.hasClassName('swatch-select');
    // Elements
    attr._e = {
        optionSelect: optionSelect,
        attrLabel: this._u.getAttrLabelElement( attr.code ),
        selectedOption: false,
        _last: {
            selectedOption: false
        }
    };
    attr._e.optionSelect.attr = attr;
    if (attr._f.isSwatch) {
        attr._e.ul = $('configurable_swatch_' + attr.code);
    };
    return attr;
},

If I do some changes here it is affecting the color swatches also. I want only size attribute to be displayed as dropdown not the color. Please help.


texts: How do you analyze if an OpenMage project needs to switch to Magento 2

texts:
How do you analyze the urgency of migration of a project (which is to be done is almost taken for granted) that in 2021 asks you the question: should I go from Magento 1.9 to 2?
Assuming that the e-commerce in question already has important things for the PCI DSS like: the card data is managed by a gateway and does not go through the e-commerce, they are already using OpenMage.
I would like to know a little what criteria you considered so as to enrich my idea...


texts: Magento 2 install nginx php mysql dnsmasq xdebug php codesniffer on mac high sierra

texts:
Is there any complete guide where I can see how to install

1. nginx
2. php (multiple version)
3. mysql
4. dnsmasq
5. xdebug
6. php codesniffer

on mac high sierra?

Please don't suggest Valet+ ;).
I need flexibility to change configurations :) like we do in linux environment.

Thanks


texts: How to disallow my customer to not purchase any product from my site magento 2

texts: For temporary purpose, i want none of my customer should place order on my site. They can browse on my website but cant place any order. How can i do that in magento 2


texts:
I created a Magento 2.0 module and it calls an external web service with the command \Zend_XmlRpc_Client.

/* REST */
$client = new \Zend_XmlRpc_Client($this->_scopeConfig->getValue('akria_store/store_view/domain_configurateur').'/api/xmlrpc/');
$session = $client->call('login', array($this->_scopeConfig->getValue('akria_store/soap/user'), $this->_scopeConfig->getValue('akria_store/soap/password')));
$result = $client->call('call', array   ($session, 'configurateur_api.setprojectstate' ,array(array('order_id'=>$order_id,'state' => \Akria\Configurateur\Model\Project::PENDING,'project' => $item->getData('configurateur_project_id')))));

But this function no longer exists.

How can I now call an external web service without using curl? replacement function of \Zend_XmlRpc_Client.

thank you in advance.


texts: Removing catalog/layer/view.phtml gives wrong search results

texts:
I'm having an issue with search results. I was switching my search results page over to a one column layout and removed the sidebar in catalogsearch.xml by taking out

    <reference name="left">
        <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
    </reference>

When I removed that, the search results that were returned were incorrect, but when I leave it in, the search results are correct. The page successfully got switched over to a 1column layout, so overall, the problem is solved, however it would be nice to know why I need that in the xml to return proper results and it would be nice to remove unneeded code. I'm not seeing anything in that file that should effect the collection that gets returned.


texts: How to run cron job using config.xml in magento 1.9x

texts: How to run cron job using config.xml in magento 1.9.x ?


texts:
I have just recently started dabbling in the idea of upgrading from Magento 1.9.x to 2.2.x now.

Working with installing Mangento and now having to use Composer, I am attempting to run simple commands but I am constantly running out of allocated memory.

I imagine this could become a pretty common issue on shared servers as we are typically not allowed to change the memory limits.

Are there alternatives to using Composer to upgrade/install new extensions? Is there a work around to working with Composer under such restrictions?


texts: Magento 2.4.1 - I get "The value specified in the URL Key field would generate a URL that already exists" even though URL does not exist yet

texts:
I try to save the category "Drehrahmen", but I get this error message:

The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL
Key field (located in the Search Engine Optimization section) to a
unique value, or change the Request Path fields in all locations
listed below:

produkte/insektenschutz/fenster/drehrahmen

But the error message makes no sense. It claims the URL with request path "produkte/insektenschutz/fenster/drehrahmen" does already exist, but as you can see there is no such URL:

What is going on?


texts: Customer Backend Fax option not displaying

texts:
In Magento 2 Community edition,

Fax attribute is not displaying in customer and there is no option to enable it. Can anybody help me How to display FAX in create customer form backend ?


texts: Magento 2: Getting "Warning: getimagesize(): Filename cannot be empty" after switching to a new empty theme with no parent

texts:
I wanted to start building a theme from scratch & my first step was to create a new theme with "Blank" as a parent. I then browsed a few pages & saw that everything works just fine.
On the next step, I removed the parent from my theme & checked again.
Now, the homepage loads OK (only with no CSS, as expected), but on categories & product pages I get this exception:

Exception #0 (Exception): Warning: getimagesize(): Filename cannot be empty in {Magento-Root-Dir}/vendor/magento/module-catalog/Model/Product/Image.php on line 890
...

Thing I already tried (that didn't solve the problem):
* Reset owner & permissions.
* Removing all the generated stuff (cache, page_cache, view_preprocessed, generation, generated, di, static files, ...) & catalog images cache.
* Running all sort of CLI commands like setup:upgrade, setup:static-content:deploy, setup:di:compile, ...
* Resizing product images using catalog:images:resize.

* I'm using Magento 2.2.2 with developer mode enabled.
* Environment: Ubuntu 16.04 LTS + Apache/2.4.18 & php7.0.26

-- Any Idea??

UPDATE:
During some debugging I discovered that the method getMediaAttributes when called from \Magento\Catalog\Helper\Image on line 191, returns different results for Blank theme than my custom parentless theme. On my theme it's like the product has no images (& it's the same product). Does it ring a bell? So far that's what I found out...


texts: Magento 2: specific store selector for custom module in admin form

texts:
Hello I how add this store selector (first in photo) to my ui_component.
Maybe someone have xml file


texts: Sorting a collection by an attribute of an object

texts:
I am trying to add menu items in Magento using an observer and I have managed that but now I need to sort the order of the menu items by an attribute inside of each menuelement object (the attribute is position so I want to sort it so position 1 comes first, 2 comes second etc.). I have tried usort but can't get it to work

public function addItemsToTopmenuItems($observer)
{
    $menu = $observer->getMenu();
    $tree = $menu->getTree();

    $collection = Mage::getModel('sean_menucreator/menuelement')->getCollection();
    $menuelementNodeId = 'menuelement';

    foreach($collection as $menuitem) {
        if($menuitem->getLevel()=='1'){
            $node = new Varien_Data_Tree_Node(array(
                'name'   => $menuitem->getName(),
                'id' => $menuelementNodeId.'_'.$menuitem->getEntity_id(),
                'url'    => $menuitem->getUrl(), // point somewhere
            ), 'id', $tree, $menu);
            $menu->addChild($node);

            $parent_id = $menuitem->getEntity_id();

            $action = Mage::app()->getFrontController()->getAction()->getFullActionName();
            foreach ($collection as $menuitem){
                if(isset($parent_id) && $menuitem->getParent_id() == $parent_id) {
                    $tree = $node->getTree();
                    $data = array(
                        'name' => $menuitem->getName(),
                        'id' => $menuelementNodeId.'_'.$menuitem->getEntity_id(),
                        'url' => $menuitem->getUrl(),
                        'is_active' => ($action == 'sean_menucreator_menuelement_index' || $action == 'sean_menucreator_menuelement_view')
                    );

                    $menuelementNode = new Varien_Data_Tree_Node($data, 'id', $tree, $node);
                    $node->addChild($menuelementNode);

                }
            }
        }
    }
    return $this;
}

As you can see $collection is a collection of menuelements and each menuelement is an object - is the way to do this somehow sort the initial collection before I do my foreach's? therefore initially the collection will all be in order so it will add them in order?


texts: How to move custom link right after logo in custom theme?

texts:
I have created custom link under
app\design\frontend\Myrwd\mytheme\Magento_Theme\layout\default.xml
<!-- location added in header -->
<referenceBlock name="header.links">
<block class="Magento\Framework\view\Element\Html\Link" name="custom-link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true"> Custom Link </argument>
<argument name="path" xsi:type="string" translate="true"> customlink </argument>
</arguments>
</block>
</referenceBlock>

Now my custom link placed between customer link and minicart, how should place right after logo?
Workout :
In same path (app\design\frontend\Myrwd\mytheme\Magento_Theme\layout\default.xml)
I have added,
<move element="custom-link" destination="header-panel" after="logo" />

Its not working, how to solve the issue?


texts:
I'm trying to Create new customer attribute "last_login_at" to store customer last login date time. My requirement is to update "last_login_at" data for the customer after the customer logged in. I really don't know how to update it with an observer. Can anybody help me?
Many thanks,

Here is my code for creating the attribute:

if (version_compare($context->getVersion(),'2.2.17','<')){
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
      $attributeCode = 'last_login_at';

        $eavSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY, // customer entity code
            'last_login_at',
            [

                'label' =>"Last Login",
                'type' => 'datetime',
                'input' => 'date',
                'frontend' => \Magento\Eav\Model\Entity\Attribute\Frontend\Datetime::class,
                'backend' => \Magento\Eav\Model\Entity\Attribute\Backend\Datetime::class,
                'required' => false,
                'user_defined' => true,
                'visible' => true,
                'system' => false,
                'input_filter' => 'date',
                'validate_rules' => '{"input_validation":"date"}',
                'position'     => 999,

            ]
        );

        $eavSetup->addAttributeToSet(
            \Magento\Customer\Api\CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
            \Magento\Customer\Api\CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER,
            null,
            'last_login_at');

        $lastLogin = $this->eavConfig->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'last_login_at');

        $lastLogin->setData(
            'used_in_forms',
            ['customer_account_edit','adminhtml_customer','customer_account_create']
        );
        $lastLogin->save();
    }
    $setup->endSetup();
}


texts: Prevent files from being uploaded after the UiComponent's ajax file upload

texts:
I'm currently implementing the UiComponent's Form Component, which has a section on using file uploads.

You can define the file upload path and after selecting a file in your form, an AJAX call is being executed where you can process the upload.

However, because this request is "stateless", if you submit your form afterwards, the files selected are still being uploaded.

In other words, You do the same upload of the file twice, once in the ajax call and once on form submit.

Is there a way to notify the Form & let it know we've already uploaded and processed the file?


texts:
I am creating dynamic CSS graphics that will update as the user adjusts various options on the product (size and color mainly). This replaces the product's image and it works great from a UI/UX standpoint. It's fast and the display updates instantly.

The problem is that these images will need to still become actual raster graphics at some point (for display in email, cart, shopping feeds, etc).

I am debating whether to use PHP-GD to build these images as needed or to instead render only the CSS version to its own URL and then convert this to an image with one of the many available methods for saving CSS/markup into a raster image (ie. Phantom.js).

1. How can I set a product image's URL so that it points to a controller instead of an uploaded file?

2. How can I then add these generated images to the product's image cache?


texts: How to write function for getting subcategories of particular category?

texts:
function productDescription()
{
    $_helper = Mage::helper('catalog/category');
    $category = Mage::getModel('catalog/category')->load($categoryId);
    $_categories = $category->getChildrenCategories()
    print_r($_categories);
    $array = json_encode($_categories);
    file_put_contents("product_node.json", $array);
}


texts: Magento 2 Xdebug PHPStorm JIT does it work for Fatal Errors?

texts:
Has anybody got JIT xdebug to work in Magento 2 with PHPStorm, is it compatible? I have regular debugging with breakpoints working fine, but JIT will not work I get a Fatal Error like this:

Fatal error: Uncaught Error: Cannot instantiate abstract class Magento\Framework\Model\ResourceModel\AbstractResource in C:\WTServer\WWW\mage23update\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php:50 Stack trace: #0 C:\WTServer\WWW\mage23update\vendor\magento\framework\ObjectManager\ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') #1 C:\WTServer\WWW\mage23update\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...') #2 C:\WTServer\WWW\mage23update\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'resource', 'Itoris\\DynamicP...') #3 C:\WTServer\WWW\mage23update\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(236): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Itoris\\ in C:\WTServer\WWW\mage23update\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php on line 50

and have JIT enabled in php.ini for Xdebug but it does not break. I also enabled the xdebug logs and nothing is logged, but the logs work fine when using breakpoints. Php.ini:

zend_extension = "php_xdebug"
xdebug.remote_mode = "jit"
xdebug.idekey="PHPSTORM"
xdebug.remote_enable=1


texts:
We are unable to get any Shipping Methods to show on customer check out.

Checking out as a guest (call to estimate-shipping-method) or as a registered user (call to estimate-shipping-method-by-address-id) are returning empty arrays.

According to this... I am missing the email and region_code as required in the payload.  On our live site the exact same payload is being delivered and working fine, missing those two attributes.  We are upgrading a stage site to Magento 2.3.3 and the customer wants to remove the one-page checkout and use the default Magento check out.

We have tried many of the fixes found through research and nothing seems to be helping at this time.  I am not sure what information you will need, so please feel free to ask and I will update with the information as soon as I am able.


texts: get customer id in payment method block for new order in admin

texts:
How could I get the customer Id selected in magento admin for new order in my payment method block

My payment method block extends to Mage_Payment_Block_Form


texts: Product image according to selected color option on cart page Magento

texts:
My problem is that the images of a configurable product change according to the color option on product  detail page but when I add to cart that product default image is shown on cart page while I want image according the selected color option

I have a Product with two color 'Black' and 'White'. when I click on black color the image on product detail page has been changed but when I add to cart that and check that on cart page product , product image is white which is default image.

I am using Magento 1.9. with default color swatches.

Thanks


texts:
How can I create a new order by using a rest api.
Can you provide api link for creating a new order also provide us the procedure to create new order using rest API.


texts: Colour swatch switching back to default randomly [Mage2]

texts:
For the past 2 days I've been monitoring my configurable products to see if there is an issue and not to my surprise, I see there is.

Basically, I set up a test product with a colour, and checked back in hourly to see if it gets switched back to the default value.

There are no other users on my site that can login and my password is pretty much... uncrackable.

Has anyone else had this issue? I know Magento 2 has quite a few bugs, but I can't find something alike this on the internet or on MageStack anywhere.

If anyone could help, that would be amazing!

Thanks so much in advance.


texts: Magento2 what is use of canRestore property in system.xml?

texts: Can anyone let me know what is exact use of canRestore property defined in system.xml field in Magento2?


texts: How to add invoice column to payment grid

texts:
I have a custom grid that show all information of save CC method per order.

protected function _prepareCollection()
    {
        $collection = Mage::getModel('sales/order_payment')->getCollection();
        $collection->addFieldToFilter('method', array('in' => array('ccsave', 'ccsaveins')));

        $columns = array(
            'parent_id',
            'cc_exp_month',
            'method',
            'cc_last4',
            'cc_owner',
            'cc_type',
            'cc_exp_year',
            'cc_bankname',
            'cc_nom',
        );
        $collection->addFieldToSelect($columns);

        $collection->getSelect()->joinLeft(Mage::getConfig()->getTablePrefix().
            'sales_flat_order', 'main_table.parent_id ='.Mage::getConfig()->getTablePrefix().
            'sales_flat_order.entity_id',array('status', 'created_at', 'increment_id'));

        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

Now I want to add a new column that define order has been invoiced or not, make it filterable. I don't know how to join to get result like that. Can anyone help me please ?.

I really really appreciate your help.


texts: Magento send custom mail to custom person after Place Order

texts:
Magento How to send a mail to a custom person after Place order

I tried below code in observer.php but it's not working

 <?php

class Manoj_Customemail_Model_Observer{
     public function customMail($event)
    {
        $order = $event->getOrder();
       //add your mail send code here

        $html="put your html content here blah blah";
$mail = Mage::getModel('core/email');
$mail->setToName('Your Name');
$mail->setToEmail('mymail@gmail.com');
$mail->setBody('Mail Text / Mail Content');
$mail->setSubject('Mail Subject');
$mail->setFromEmail('Sender Mail Id');
$mail->setFromName("Msg to Show on Subject");
$mail->setType('html');// YOu can use Html or text as Mail format

try {
$mail->send();

    }
}

}

confix.xml

    <?xml version="1.0"?>
    <config>
      <modules>
        <Manoj_Customemail>
          <version>0.1.0</version>
        </Manoj_Customemail>
      </modules>
      <global>
        <helpers>
          <customemail>
            <class>Manoj_Customemail_Helper</class>
          </customemail>
        </helpers>

 <models>
            <customemail>
                <class>Manoj_Customemail_Model</class>
            </customemail>
        </models>

         <events>
                <sales_order_place_after>
                    <observers>
                        <sales_order_observer>
                            <type>singleton</type>
                            <class>Manoj_Customemail_Model_Observer</class>
                            <method>customMail</method>
                        </sales_order_observer>
                    </observers>
                </sales_order_place_after>
            </events>

      </global>
    </config>

After Place order it redirect to cart page


texts: Magento2 system.xml Adding Section To Existing Tab

texts:
On

  Stores -> Configuration -> Sales

i amtrying to add one more section there is no groups yet:

Lukas\DeliveryNotification\etc\adminhtml\system.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>

        Shipping Notifications
        <tab>sales</tab>
        <resource>Lukas_DeliveryNotification::lukas_deliveryNotification</resource>

</system>

Lukas\DeliveryNotification\etc\acl.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
    <resources>
        <resource id="Magento_Backend::admin">
            <resource id="Magento_Backend::stores">
                <resource id="Magento_Backend::stores_settings">
                    <resource id="Magento_Config::config">
                        <resource id="Lukas_DeliveryNotification::lukas_deliveryNotification" title="Delivery Notification" />
                    </resource>
                </resource>
            </resource>
        </resource>
    </resources>
</acl>

But it does not get added, what is the problem?


texts:
I am using Porto Theme and I'm trying to remove product tool bar from the home page but it isn't working. My Magento version is 1.9.2.4.

I'm using this method by Anders Wik

My theme configuration:

I also did it:

I've copied

app/design/frontend/smartwave/porto/layout/local.xml

to

app/design/frontend/smartwave/criaseo/layout/local.xml

and I also copied

app/design/frontend/smartwave/porto/template/catalog/product/list.phtml

to

 app/design/frontend/smartwave/criaseo/template/catalog/product/list.phtml

But the toolbar is still there!!!

Here is the original local.xml of my theme:

<cms_index_index>
    <update handle="MAP_popup"/>
    <reference name="top.container">
        <block type="core/template" name="home_slider">
            <action method="setTemplate" ifconfig="homeslider/general/slider_type" condition="0"><template>homeslider/home_slider.phtml</template></action>
        </block>
        <remove name="pageHeader"/>
    </reference>
    <reference name="after_body_start">
        <block type="core/template" name="home_slider">
            <action method="setTemplate" ifconfig="homeslider/general/slider_type" condition="1"><template>homeslider/home_slider_top.phtml</template></action>
        </block>
    </reference>
    <reference name="newsletter_popup">
        <action method="setTemplate" ifconfig="porto_settings/newsletter_popup/enabled" condition="1"><template>newsletter/popup.phtml</template></action>
    </reference>
</cms_index_index>

This is where I want to remove the toolbar. Only on the home page.

It will be great if anyone could tell me where I am doing wrong here. Thanks!


texts: Hiding decimals from prices with 00 decimals

texts:
I need a solution to strip decimals, but only from the prices that have ,00 decimals.
Example 1:
Price currently showing: € 543,00
Price should show: €543

Example 2:
Price currently showing: €280,95
Price should show: €280,95 (which is good)

I've tried multiple Price Formatting extensions, but none seem to do what I want. They're hiding all decimals, some even do this by rounding the price. That is not what I need. Does anybody know a working solution? I've been looking for weeks, but can't seem to find a solution.
The solution needs to cover at least category pages and product pages.
Same questions, but accepted solutions are wrong:

Remove .00 decimal from price (Extension provided in solution hides ALL decimals, not just zeros.)

Prices, How to hide decimals when are .00? (Magento 1, not Magento 2. Solution no longer exists anyway.)


texts:
Entities in Magento 2 are like:

Product is an entity?
Order/Sale is an entity?
Customer/Users/Clients is an entity?
etc??

Where can I find a list of all entities?
Are they declarated in the DB?

For example in eav_attribute table I can see a column entity_type_id that in a default Magento2 installation goes from 1 to 4, these number represents entities?

PD Taking in mind that eav_entity is empty in a default installation


texts: What are stable Magento versions from 1.4.1.1?

texts:
I'm currently using Magento 1.4.1.1. I'm thinking of upgrading it.
I have never conducted this kind of operation.

What are the stable and compatible Magento versions from 1.4.1.1 ?
Do you know any best practices to succeed an upgrade ?

Thank you !!


texts: How to stop flow from observer in Magento2 without using die or exit?

texts:
I have a custom observer and I am intercepting calls in some situation I want to return some specific data and prevent Magento to proceed with its flow, how can I achieve this without using die or exit in Magento 2?

my event.xml is like :

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
  <event name="controller_action_predispatch">
      <observer name="my_observer" instance="MyObserver" shared="false" />
  </event>
</config>

and my cobserver looks like

class MyObserver implements ObserverInterface
{
  public function __construct(
  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
  \Magento\Framework\App\State $state)
  {

  }
  public function execute(\Magento\Framework\Event\Observer $observer)
  {
    $action = $observer->getEvent()->getControllerAction();
    //if(X exist in cookie)
            {
                $response = $action->getResponse();
        $response->setRedirect($result->redirectUrl)->sendResponse();
                return;
            }
    else if(Y exist in cookie)
       {

                $response->setHeader('YResult', 'Y Result');
        //Send for example empty body from here to client and prevent Magento 2 to continue
       }
    else
        {
        //Do nothing continue normal flow
        }

  }
}

in the first if I was able to send redirect header and stop the normal flow by

$response->setRedirect($result->redirectUrl)->sendResponse();

but for the second if I do not want response with redirect, I want to send empty a response with a custom header (custom javascript on client side will pick up the answer and react to it  )


texts:
Can anyone please let me know if there is any magento event available for adding comment to a particular order?
Let me know if question is not clear.


texts: How to display a selected simple product's image for configurables in the catalog?

texts:
We import configurables without images, but the simples have images (marked by a special attribute).
How can we show the image of a simples as main image of the configurables (thumbnail, base image)
EDIT
There seems to be already similar logic in the core:
\Magento\ConfigurableProduct\Model\Product\Type\Configurable::setImageFromChildProduct
public function setImageFromChildProduct(\Magento\Catalog\Model\Product $product)
{
    if (!$product->getData('image') || $product->getData('image') === 'no_selection') {
        foreach ($this->getUsedProducts($product) as $childProduct) {
            if ($childProduct->getData('image') && $childProduct->getData('image') !== 'no_selection') {
                $product->setImage($childProduct->getData('image'));
                break;
            }
        }
    }
    return parent::setImageFromChildProduct($product);
}

Problem is that I need something similar for category (product list) pages and I think they do not use the image but the small image.


texts: magento 1.9 one concrete product is not displaying on frontend

texts:
All the products are displayed on the store correctly, but one concrete product is not displaying on frontend. This product is a configurable product, and was visible some time ago.

I checked the following steps:

I reindexed all and cleaned all the caches, the product is still not
visible.
Product is enabled
Visibility is set on 'Catalog, Search'
Product is added to all websites
Product is asigned to more than one category, the cateories are visible
Product inventory is set to 'manage stock' and is 'in stock'
Simple associated products (childs) to this configurable product are 'in stock' and have stock quantity greater than 0
Product has images
Category display mode is set to display products, actually is displaying the rest of products.
Copy the url key from backend/catalog/product and paste it in the browser displays a 404

And after checking all this points I have no idea why this product is not displaying on front.


texts: How to move Checkout button to the bottom of minicart

texts:
I've been trying to move the "Go to check button" to the bottom of the minicart, as this example but I have had no success.

I've done this kind of changes in ver.1.9.1 with no problem. What am I possibly doing wrong?


texts: Magento admin URL redirecting to index.php/admin, resulting in redirect loop

texts:
If I enter URL

https://server.com/admin

It ends up redirecting to:

https://server.com/index.php/admin

and I end up with "This webpage has a redirect loop".

a) Is this redirect url correct? Doesn't look to be valid.
b) Where do I correct it?


texts: Shall i learn zend if i want to become magento 2 extension developer

texts:
I am a front end developer and worked on many wordpress,magento and shopify stores . But now i want to become real developer . I mean i want to prepare myself so i can develop magento 2 extensions from scratch.

As magento 2 is Zend based. Can you please suggest if somebody want to become good developer of magento 2 then is it mandatory to learn zend first ?

Because during extension development MVC of zend will be followed so i have this question.

Apart from this i am looking to learn one framework of php. I see codeignitor is easy to learn but neither we can develop shopify apps nor magento 2 modules so wanted to select between Zend and laravel.

Any help will be highly appreciated.


texts: Rich Snippets inside or outside of the template?

texts:
I recently added rich snippets to the product detail page for simple and configurable.
But now I'm asking myself if it was right to add the meta datas at the end of the templates.

How do you solved this in your projects?

I first tried to set the meta tags outside my template or with other words at the top of my layout.
But then I had to struggle with all product details.

How do I know if the product is a simple or configurable?
How do I know if the product has related products?

To solve this I need a new template and a new block to make all the queries I have to do when I enter the product detail page.
But at that point I guess it is much easier to create a module.


texts: Blank page for disabled products - Compilation enabled - Magento 1.9.2.2

texts:
Trying to solve a long standing issue on Magento 1.9.2.2 with Compilation Enabled.
To replicate
Run and Enable Compilation.
Make any product disabled.
Viewing disabled product URL on frontend produces a blank page - should return a 404.

This produces no PHP errors, system logs or error reports.  Any ideas?


texts: Magento2 SOMETIME The order confirmation email is not sent

texts:
When an order is placed and payed, usually all emails are sent (confirmation to the customer and bcc to addresses specified in configuration.. 'Send Order Email Copy To' ) but I have two cases in wich the email is not sent.
All is configured correctly and usually running properly, no logs related in the system log, debug.log or exception.log.

Where I can find info about this failure? Are there any table in the db to check?

The only information I have found is in sales_order where fields email_sent and send_email are both null, usually = 1.

Why send_email is null?

I cannot find any checkbox during the ceckout process to not receive the order email confirmation.

In Magento 1.9 there was the table core_email_queue. In Magento 2?

Thanks,
Ale


texts:
I have searched high and low for an answer on this but have not been able to come up with the solution I am looking for.  I am hoping maybe someone here can point me in the right direction.

I have a website that uses a 2column-left nav layout with no top menu.  I do however have a set of top.links "My Account" "My Wishlist" "My Cart" etc.  It is here I would like to add an additional category menu navigation where a user hovers over something like "Categories" and it drops down through the different levels.

In the file topmenu.phtml I can this by the following code:

<?php $_menu = $this->getHtml('level-top') ?>

<a href="<?php echo $this->getUrl() ?>"><?php echo $this->__('Home') ?>

<a href="<?php echo $this->getUrl('') ?>"><?php echo $this->__('Products') ?>
        <?php if($_menu): ?>

                <?php echo $_menu ?>

        <?php endif ?>

        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('menu')->toHtml(); ?>

However, I cant seem to get this to work in the top.links section "links.phtml", it looks like $_menu is not getting populated.  Thanks for the help.


texts:
In our staging area, I added a new extension and the developers have had to do some work to get a few features working properly. Now that the backend features are working properly, I went to load the product on the frontend and got this error:

Fatal error: Cannot redeclare formatHex() (previously declared in ~/app/design/frontend/neighborhood/default/template/notificationbar/notificationbar-header.phtml:19) in ~/app/design/frontend/neighborhood/default/template/notificationbar/notificationbar-header.phtml on line 21

The code sitting between lines 19 - 21 looks like this:

function formatHex($value) {
    return "#" . str_replace('#', '', $value);
}

If I disable the extension completely, flush the cache, then reload the page - I'm given a completely different error with a SQL call and files relating to the new extension.

Any pushes in the right direction are appreciated. I have already tried removing lines 19-21 - the page will load but only the "notificationbar" area, everywhere after is blank.


texts: Uninstall Extension Magento 2 and Clean Database (tables and datas)

texts:
I need to uninstall an extension in Magento 2.3.1, this extension was installed manually. I follow the follow steps (for example for the extension "Size Chart"):

bin/magento module:disable Bss_SizeChart --clear-static-content
rm -rf app/code/Bss/SizeChart
bin/magento cache:clean
bin/magento cache:flush
bin/magento setup:upgrade

But I have detected that there are still data and tables related to this extension in the database:

In the table eav_attribute there is a record associated with this module (which I must delete manually so as not to have errors on my website
In my database there is a table associated with this extension: bss_size_chart
In the table setup_module there is a record associated with this extension

My Questions

How can I know if there is more information associated with an extension that I want to delete?
Is there any way to be able to uninstall an extension and automatically delete all the records and tables in my database associated with the extension we want to delete?


texts: Magento Success page, only half or less being reported in Google Analytics

texts:
Since the past month Google Analytic are been reporting the incorrect amount of views going to the Magento Success page for 2 days ago it said I had 11 people hit the success page but I had 22 orders with emails, emails only being sent out if the user goes to the success page.

No changes have been made to the magento checkout system up to 3 weeks before the problem started happening, Is there any reason this could be happening or anything I should be looking at to get the correct results showing again.

Checkout Progress does as following:

Cart -> Enter Billing Details -> Enter Shipping Details -> Select Shipping Method -> Select payment method -> Redirected to payment provider website -> Redirect back on payment to Success page

The site uses Universal analytics


texts: Magento Commerce Cloud : Tool for real time monitoring of sql queries and processes

texts:
I need to monitor the number of SQL queries and processes and their corresponding CPU and swap usages in real-time just like the monitoring tool provided with PHPMyAdmin. I need something similar for commerce cloud environment.

Please note that I have already used Newrelic APM and it seems it only provides historical data. Also, show processlist command on mysql-cli does not auto-refresh so that does not fulfill the requirement as well.


texts:
So I am new to collections and messing with the DB directly. I have my collection pulling the data that I need but now im not sure what direction to go in.

My problem is that I don't know what to do with the collection. Are collections just used to generate the SQL and then you call a query to manipulate the data? Or would one copy the data from the collection to an array?

I only need the sku and one other attribute. I tried copying the collection to an array using  $collection->getColumnValues(). Using this it will only pull one attribute. What I would like is to have an array with both attributes needed.

I just am not sure how to properly use the data in collections.

The end goal is to use the data from the collection to search and pull data from a DB and write it out to a csv file.

Any help would be appreciated and can provide clarity.

Thanks!


texts: Product details tabs messed with other tabs in Magento 2

texts: While I loading the product details page is overlapping other tabs check with sample screenshot


texts: Setup Issue on New Installation Magento 2.3.3 in ubuntyu

texts:
nvironment
Ubuntu 18.04.3 LTS
Apache/2.4.29 (Ubuntu)
PHP 7.3.13
mysql Ver 8.0.19
I installed all the source file for Magento 2.3.3 using composer command.
Composer command ended with no issue
Configured apache2 host server and PHP
Configured mysql and created a new database DbMagento
Accessed through Browser to Magento Setup
Filled all the information requested and reached the last step:
1 - Readiness Check = no issue
2 - Add a Database = no issue
3 - Web Configuration = no issue
4 - Customize your store = no issue
5 - Create Admin Account = no issue
6 - install = ISSUE
During the last step "6" relating to install ... system performs initial installation and then stops ... see console Log herewith
`Starting Magento installation:
File permissions check...
Required extensions check...
Enabling Maintenance Mode...
Installing deployment configuration...
Installing database schema:
Schema creation/updates:
Module 'Magento_AdminAnalytics':
Module 'Magento_Store':
Module 'Magento_AdvancedPricingImportExport':
Module 'Magento_Directory':
Module 'Magento_Amqp':
Module 'Magento_AmqpStore':
Module 'Magento_Config':
Module 'Magento_Theme':
Module 'Magento_Backend':
Module 'Magento_Variable':
Module 'Magento_Eav':
Module 'Magento_Customer':
Module 'Magento_AuthorizenetGraphQl':
Module 'Magento_Search':
Module 'Magento_Backup':
Module 'Magento_AdminNotification':
Module 'Magento_BraintreeGraphQl':
Module 'Magento_Indexer':
Module 'Magento_Authorization':
Module 'Magento_BundleImportExport':
Module 'Magento_CacheInvalidate':
Module 'Magento_Cms':
Module 'Magento_Catalog':
[ERROR] Magento\Framework\Setup\Exception: Unable to apply patch Magento\Catalog\Setup\Patch\Schema\EnableSegmentation for module Magento_Catalog. Original exception message: Invalid column data type "" in /var/www/magento/vendor/magento/framework/Setup/Patch/PatchApplier.php:241
Stack trace:
#0 /var/www/magento/setup/src/Magento/Setup/Model/Installer.php(1004): Magento\Framework\Setup\Patch\PatchApplier->applySchemaPatch('Magento_Catalog')
#1 /var/www/magento/setup/src/Magento/Setup/Model/Installer.php(832): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\Setup), 'schema', Array)
#2 [internal function]: Magento\Setup\Model\Installer->installSchema(Array)
#3 /var/www/magento/setup/src/Magento/Setup/Model/Installer.php(367): call_user_func_array(Array, Array)
#4 /var/www/magento/setup/src/Magento/Setup/Controller/Install.php(109): Magento\Setup\Model\Installer->install(Array)
#5 /var/www/magento/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(84): Magento\Setup\Controller\Install->startAction()
#6 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#7 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#8 /var/www/magento/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(116): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#9 /var/www/magento/vendor/zendframework/zend-mvc/src/DispatchListener.php(118): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#10 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 /var/www/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /var/www/magento/vendor/zendframework/zend-mvc/src/Application.php(340): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#13 /var/www/magento/setup/index.php(39): Zend\Mvc\Application->run()
#14 {main}`


texts: Category Layout Update - Custom Product List Template

texts:
I'm trying to apply an XML Layout Update to a small selection of categories to have a custom product listing design. All other categories need to remain as-is so I cannot simply globally change the product list template for all categories.

I have already made various attempts to do this including (Where Namespace_Module is my own module with a list.phtml)

<referenceBlock name="category.products.list" template="Namespace_Module::list.phtml" />

and

<referenceBlock name="category.products.list">
    <arguments>
        <argument name="template" xsi:type="string">%Namespace_Module::list.phtml%</argument>
    </arguments>
</referenceBlock>

Is there any restriction on overriding certain blocks? I can't see what is wrong with the above for this not to work?

To confirm, I'm applying this in the Category > Layout Update XML as that is the only place I can do it dynamically for a range of categories

I'm running Magento v2.1.3


texts: Magento 2.3: Fatal error: Uncaught Error: Call to undefined method Magento\Framework\View\Element\UiComponent\Context::getUrlBuilder()

texts:
I'm new to Magento 2.3, I'm getting an error when I hit Add New Banner button, Grid is loading perfectly, error appear when i try to open form, I don't know how to resolve this, BTW I copied this module and may be the module was running on Magento 2.1.

ERROR IMAGE

Code for /PHPCuong/BannerSlider/Block/Adminhtml/Banner/Edit/GenericButton.php

<?php

namespace PHPCuong\BannerSlider\Block\Adminhtml\Banner\Edit;

use Magento\Framework\View\Element\UiComponent\Context;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
 * Class GenericButton
 */
class GenericButton implements ButtonProviderInterface
{
    /**
     * @var Context
     */
    protected $context;

    /**
     * @var \Magento\Framework\AuthorizationInterface
     */
    protected $_authorization;

    /**
     * @param Context $context
     * @param \Magento\Framework\AuthorizationInterface $authorization
     */
    public function __construct(
        Context $context,
        \Magento\Framework\AuthorizationInterface $authorization
    ) {
        $this->context = $context;
        $this->_authorization = $authorization;
    }

    /**
     * Return the Banner ID
     *
     * @return int
     */
    public function getBannerId()
    {
        return (int)$this->context->getRequest()->getParam('id');
    }

    /**
     * Generate url by route and parameters
     *
     * @param   string $route
     * @param   array $params
     * @return  string
     */
    public function getUrl($route = '', $params = [])
    {
        return $this->context->getUrlBuilder()->getUrl($route, $params);
    }

    /**
     * {@inheritdoc}
     */
    public function getButtonData()
    {
        return [];
    }

    /**
     * Check permission for passed action
     *
     * @param string $resourceId
     * @return bool
     */
    protected function _isAllowedAction($resourceId)
    {
        return $this->_authorization->isAllowed($resourceId);
    }
}


texts:
In my project I have hamburger menu to show up the menu list for Ecommerce site. But I have tried in normal php site it works fine, but I am confused where to put the javascript code in Magento site. I am using the magento version 1.9.3

Even I tried this code in layout.xml

<action method="addItem"><type>skin_js</type><name>js/nav.js</name><params/></action>

Can anyone help me. Thank you in advance.


texts: Load catalog displaying values from 2 stores at the same time

texts:
I searched for a similar question, but didn't find any suitable answer.

I have a multi-store Magento and I simply want to load my catalog seeing some attributes values of the admin/global store view scope + store 1 view at the same time, just like Magento grid does when you change the scope, you see the name of the product in the global scope and beside the name in the choosen store view, side by side.

At this moment, this is what I do:

$store_id = 1;

$_p = Mage::getModel('catalog/product');

$_product = $_p
                    ->getCollection()
                    ->addAttributeToSelect('sku')
                    ->addAttributeToSelect('ean')
                    ->addAttributeToSelect('name')
                    ;

foreach ($_product as $product) {
    $prod_admin  = $product->getData();
    $prod_store1 = $_p->setStoreId($store_id)->load($product['entity_id']);

    $prod_admin['sku']; // SKU in the global scope
    $prod_store1['sku']; // SKU in the store 1

    (...)
}

I get the product collection from the global scope, than inside the loop, I reload the product's attributes of the specific store. But that requires quite some resources to load the full catalog. Is there a way to do this loading a single collection?


texts:
Am unable to remove the footer links from deafault.xml page using remove tag.

<referenceBlock name="logo" remove="true"/>


texts: Can't View *MANAGE PRODUCTS* Page... Is This a Magento Cache Issue?

texts:
I have an issue where my screen/page seems to be caching, so I can't view existing products...

If I clear the Cache in Cache Management it works perectly until I create or edit a product and also if I use CMD + R to refresh (on a mac) or Ctrl + F5 to force refresh (on a windows PC) it works after a few attempts (sometimes 3 sometimes 10).

Not sure whats causing it, any ideas of where to look would be really helpful

Thanks


texts: Where to setup product dimensions(width, length, height)?

texts:
I'm building a custom shipping method for Magento 2. And I couldn't seem to find product dimensions within the standard attributes
However, when receiving product data information from the checkout in my plugin it does show width, height and length. (dump shown below)
{"street":"Test street 23","postcode":"1122AB","country":"NL","city":"Amsterdam","packages":{"height":null,"width":null,"length":null,"qty":1,"value":45,"weight":0}}

As I want to make this shipping method as general as possible, where can these 'standard' attributes for dimensions be set?
Thanks.


texts: Error when sending purchase order e-mail in Magento 2.3

texts: Magento 2.3 is recognizing as a wrong route when sending the email, it also happens when making the purchase by the store. The process with Vindi works perfectly, there is only the detail of sending the email with the expected information


texts: How to run magento 2.3 scripts through cron

texts: I have made one script (addproducts.php) in my Magento root folder for adding products programmatically. For now, I am hitting this script in URL as localhost/addproducts.php. What should I do to execute this script through cron job. How can I set this script to run at regular time interval?