texts: Magento 2.4 - difficulties with permissions before install

texts:
I'm familiar with magento1 and decided to learn about magento2 so I've been trying to install it but am having some difficulties with permissions of folders and files.
I've looked at lots of videos, tutorials and documentations but I can't seem to get it right.
I'm working on ubuntu 20.04, have already installed lamp stack, elasticsearch, composer...
After that, when I switch to the user I've created specifically for that purpose, I create a directory in /var/www/html named magento2 and use composer to download magento 2.4
At this point, I'm supposed to run this command :
cd /var/www/html/magento2 && find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento

However I'm getting an error saying I don't have the rights for certain files, namely

var/composer_home/cache/.htaccess
var/composer_home/.htaccess
var/.regenerate.lock
var/cache/mage--f/mage---ea6_MAGE_VERSION
var/cache/mage-tags/mage---ea6_CONFIG
var/cache/mage-tags/mage---ea6_MAGE
var/log/debug.log
var/log/magento.cron.log
var/log/system.log
generated/code/Magento/Framework/Event/Config/Reader/Proxy.php
generated/code/Magento/Framework/Validator/RegexFactory.php
generated/code/Magento/Framework/ObjectManager/Config/Reader/Dom/Proxy.php
generated/code/Magento/Framework/App/ResourceConnection/Proxy.php
generated/code/Magento/Framework/App/ResourceConnection/Config/Proxy.php
generated/code/Magento/Framework/Config/Composer/PackageFactory.php
generated/code/Magento/Framework/Data/Argument/InterpreterInterface/Proxy.php
generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php
generated/code/Magento/Indexer/Model/Indexer/CollectionFactory.php
generated/code/Symfony/Component/Console/Question/QuestionFactory.php
generated/code/Symfony/Component/Console/Helper/TableFactory.php
generated/code/Symfony/Component/Console/Input/ArrayInputFactory.php
generated/code/Composer/Console/ApplicationFactory.php

I've checked their ownership and they link to root instead of magentouser. Other folders and files seem to have the right ownership so I don't understand what's happening...
Any help?
Thank you


texts: Magento 2 overriding Block Class Function

texts:
I just want to override vendor/magento/module-backend/Block/Dashboard/Orders/Grid.php
I added this line $collection->addAttributeToFilter("status",["neq"=>"failed"]);
Core overriding is successful but it doesn't effect admin dashboard.

<?php
/**
 * Created by PhpStorm.
 * User: development
 * Date: 19.01.2018
 * Time: 08:54
 */

namespace Example\OrderStatistics\Override;

use Magento\Backend\Block\Dashboard\Orders\Grid;

class PassFailedOrders extends Grid
{
    protected function _prepareCollection()
    {
        if (!$this->_moduleManager->isEnabled('Magento_Reports')) {
            return $this;
        }
        $collection = $this->_collectionFactory->create()->addItemCountExpr()->joinCustomerName(
            'customer'
        )->orderByCreatedAt();

        if ($this->getParam('store') || $this->getParam('website') || $this->getParam('group')) {
            if ($this->getParam('store')) {
                $collection->addAttributeToFilter('store_id', $this->getParam('store'));
            } elseif ($this->getParam('website')) {
                $storeIds = $this->_storeManager->getWebsite($this->getParam('website'))->getStoreIds();
                $collection->addAttributeToFilter('store_id', ['in' => $storeIds]);
            } elseif ($this->getParam('group')) {
                $storeIds = $this->_storeManager->getGroup($this->getParam('group'))->getStoreIds();
                $collection->addAttributeToFilter('store_id', ['in' => $storeIds]);
            }

            $collection->addRevenueToSelect();
        } else {
            $collection->addRevenueToSelect(true);
        }
        $collection->addAttributeToFilter("status",["neq"=>"failed"]); // This is added

        $this->setCollection($collection);

        return parent::_prepareCollection();
    }

}

And here is my di.xml file.

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Backend\Block\Dashboard\Orders\Grid" type="Example\OrderStatistics\Override\PassFailedOrders"/>
</config>

Any help will be appreciated. Thank you.

I found what is problem. in Magento\Backend\Block\Dashboard\Orders\Grid Class there is _prepareCollection() function. And when I override this function it just returns to again same class. But I need to return Magento\Backend\Block\Widget\Grid _prepareCollection() function. How do I ?


texts: Magento 2.2.3 | Cant Find "Search Synonyms" Under Admin->Marketing->SEO & Serch

texts:
| Summary of the issue
i cant find the "Search Synonyms" in "Admin->Marketing->SEO & Serch"

| Information on your environment
Centos Server | php 7 | mysql 5 | magento 2.2.3 CE upgraded from 2.2.2

| Steps to reproduce
i dont know (:

| Expected and actual results
to be able to show "Search Synonyms" under "Admin->Marketing->SEO & Serch"

Note: i saw some tutorials on youtube like this one: "https://www.youtube.com/watch?v=bE3Gx1P3SvQ"
but i have no idea why it is showing on his screen but not on mine?


texts: Creating new form in Magento 2 always getting error

texts:
I have created a custom module, it has a grid and also should have an add new button, the grid is working but the add new button is giving me errors. Below is given NewAction.php inside Vendor_Module_Controller_Adminhtml_Index

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Vendor\Module\Controller\Adminhtml\Index;

class NewAction extends \Module\Vendor\Controller\Adminhtml\Index
{
    /**
     * Create new customer action
     *
     * @return \Magento\Backend\Model\View\Result\Forward
     */
    public function execute()
    {
        $resultForward = $this->resultForwardFactory->create();
        $resultForward->forward('edit');
        return $resultForward;
    }
}

So now, it will load the Edit, because I will use, edit file to edit or add new.

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Vendor\Module\Controller\Adminhtml\Index;

use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Registry;
use Magento\Backend\App\Action;
use Magento\Framework\App\State;

class Edit extends \Magento\Backend\App\Action
{

    /**
     * Customer edit action
     *
     * @return \Magento\Backend\Model\View\Result\Page|\Magento\Backend\Model\View\Result\Redirect
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function execute()
    {

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

And this is the error getting:

Fatal error: Uncaught Error: Call to undefined method Vendor\Module\Model\ResourceModel\Module\Interceptor::getMainTable() in /var/www/html/site/vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php:145 Stack trace: #0


texts: `core_cache` and `core_cache_tag` empty?

texts:
I'm trying to debug a problem with FPC on Mage EE 1.11.2.0 (the problem is related to some custom modules )

I have truncated table core_cache and core_cache_tag to have fresh data but now those table are always empty even if I refresh cache.

By the way the cache system looks to work fine

What I did is so wrong ?
How can I regenerate the content (blob) of those table ?

I definitely miss something in the understanding of the many layers of cache magento has. ( I guess I have some mess in the local.xml )

<config>
  <global>
    <install>
      <date><![CDATA[Thu, 26 Jan 2012 16:09:29 +0000]]></date>
    </install>
    <crypt>
      <key><![CDATA[XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]]></key>
    </crypt>
    <disable_local_modules>false</disable_local_modules>
    <resources>
      <db>
        <table_prefix><![CDATA[]]></table_prefix>
      </db>
      <default_setup>
        <connection>
            <host><![CDATA[localhost]]></host>
            <username><![CDATA[xxxx]]></username>
            <password><![CDATA[xxxx]]></password>
            <dbname><![CDATA[xxxx]]></dbname>
          <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
          <model><![CDATA[mysql4]]></model>
          <type><![CDATA[pdo_mysql]]></type>
          <pdoType><![CDATA[]]></pdoType>
          <active>1</active>
        </connection>
      </default_setup>
    </resources>
    <session_save><![CDATA[files]]></session_save>
  </global>
  <admin>
    <routers>
      <adminhtml>
        <args>
          <frontName><![CDATA[admin]]></frontName>
        </args>
      </adminhtml>
    </routers>
  </admin>
</config>


texts: Conditional Content for Transactional Email Templates

texts:
I want to provide more relevant information to the customer in the "New Order" email template dependent on what method of payment was selected when placing the order.

I implemented this method from ʍǝɥʇɐɯ here https://stackoverflow.com/a/6628433
and created
/app/design/frontend/default/default/template/paymentstatus/orderemail.phtml

<?php if($this->getData('order')->getStatus()=='pending_payment_tt'): ?>

        <?php echo $this->__('Your Order Status is pending_payment_tt and you paid by Bank Transfer Payment') ?>

<?php elseif($this->getData('order')->getStatus()=='awaiting_check'): ?>

        <?php echo $this->__('Your Order Status is awaiting_check and you paid by Electronic Check') ?>

<?php else: ?>

        <?php echo $this->__('Your Order Status is pending and you probably paid by CC') ?>

<?php endif; ?>

then edited the New Order email template inserting

{{block type='core/template' area='frontend' template='paymentstatus/orderemail.phtml' order=$order}}

This all works well enough, however the actual content of the conditional message resides in a template file and I now want to pull the content from a Custom Variable enabling easier access to editing the message.

If I create a Custom Variable 'payment_comment', how should I insert it into my
orderemail.phtml template?

I found this code but am not sure how to integrate it

$comment = Mage::getModel('core/variable')
    ->setStoreId(Mage::app()->getStore()->getId())
    ->loadByCode('payment_comment')
    ->getValue('html');


texts: Browser History back() Method decreases minicart quantity

texts:
We have discovered an interesting phenomenon with browsers history.
When I add some products from several product pages to the basket then the minicart at top will always update and shows me the current quantity of products in it.
But now when I decided to go some pages back with the browser back button (no matte if it is Firefox or Chrome) the minicart will decrease the quantity each time to that state before I put products into the basket.
 1. Product page 1 --> add 1 product in basket - in total 1
 2. Product page 2 --> add 1 product in basket - in total 2
 3. Product page 3 --> add 1 product in basket - in total 3
So when I go back in browser history to the second product I choosed before then my minicart suddenly displays 2 products in minicart.

When I click on the minicart to go to the cart directly then I have all 3 products.
It is only connected to browser history.

Since two days I can't find a reason why this happens.

We use Varnish 3 but we have added an esi cache-policy to exclude the minicart block from varnish caching.

And the shop is the latest Enterprise version 1.14.7.
I couldn't find any issues at github also.


texts: Configurable product with different URLS for simple

texts:
If I sell a t-shirt which has 2 colours, normally I would have 1 URL for the configurable product as the 2 simple products would be set to have a visibility of hidden.

However I would quite like to replicate the functionality offered on this site, http://goo.gl/55VLRt, where each time you choose a variant then the URL changes. Is this possible with Magento?


texts: Super Products Attributes Configuration - Double Price Uptick

texts: I'm creating a listing for coveralls in Magento with inseam and chest.  All inseam 32s have a price uptick in Super Products Attributes Configuration.  Also chest sizes 52 and 54 in Super Products Attributes Configuration carry a price uptick.  When on the Super Products Attributes Configuration I've filled out the table with these price upticks however in the case of inseam 32, chest 52 and inseam 32, chest 54 there are two price upticks when there should only be 1 - how can I change this?


texts: Magmi product deleter does not delete attributes?

texts:
I use Magmi Product deleter for deleting products from Magento 1.8.

The plugin has a function removeFromFlat() to delete all records of the product from the catalog_product_flat_% tables.

What is the reason this is not done for all catalog_product_entity_% tables as well?

When I remove a product now, all attribute-values remain in the database.


texts: Flatten product image directory structure

texts:
I need to replace all images in the product catalogue with larger images. The filenames are the same but Magento spread all images under some very nested directory structure like

example.com/media/catalog/product/d/c/product-image.jpg

Is there a way to tell Magento to flatten this directory stucture to one directory so that I can just bulk update all the images via FTP without having to work my way through the Magento admin one by one?


texts:
I want to create a custom template for Magento ver.2.0.7 and am trying to find the location of the main HTML file. i.e. The file that is loaded when I go to my Magento URL.

Can I extend this HTML file to add Bootstrap elements?


texts:
This question is already on Elasticsearch forums: Elastic Forum

I am new to Elasticsearch. I use one installation on my server with version 6.8.5 for a Magento 2 instance I have. I am using java-8-openjdk openjdk version "1.8.0_222". Although it, not the first time I use the same setup now in my last scenario I have the high load in CPUs with was not there before. In peak, it goes up to 4.00 with htop saying JAVA 400% CPU.

jvm options:

  -Xms15g

  -Xmx15g

  -XX:+UseConcMarkSweepGC

  -XX:CMSInitiatingOccupancyFraction=75

  -XX:+UseCMSInitiatingOccupancyOnly

  -Des.networkaddress.cache.ttl=60

  -Des.networkaddress.cache.negative.ttl=10

  -XX:+AlwaysPreTouch

  -Xss1m

  -Djava.awt.headless=true

  -Dfile.encoding=UTF-8

  -Djna.nosys=true

  -XX:-OmitStackTraceInFastThrow

  -Dio.netty.noUnsafe=true

  -Dio.netty.noKeySetOptimization=true

  -Dio.netty.recycler.maxCapacityPerThread=0

  -Dlog4j.shutdownHookEnabled=false

  -Dlog4j2.disable.jmx=true

  -Djava.io.tmpdir=${ES_TMPDIR}

  -XX:+HeapDumpOnOutOfMemoryError

  -XX:HeapDumpPath=/var/lib/elasticsearch

  -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log 8:-XX:+PrintGCDetails 8:-XX:+PrintGCDateStamps

  8:-XX:+PrintTenuringDistribution 8:-XX:+PrintGCApplicationStoppedTime

  8:-Xloggc:/var/log/elasticsearch/gc.log 8:-XX:+UseGCLogFileRotation

  8:-XX:NumberOfGCLogFiles=32 8:-XX:GCLogFileSize=64m

  9-:-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m

  9-:-Djava.locale.providers=COMPAT 10-:-XX:UseAVX=2

And elasticsearch.yml:

  indices.query.bool.max_clause_count: 10024

I have specified JAVA_HOME as elastic advice and I have no errors anywhere.

Maybe I should use other JDK versions?

If someone could help me, please.

Thank you


texts: Magento2 : Override core files vendor/magento/module-catalog/Pricing/Price/TierPrice.php

texts:
How to override

vendor/magento/module-catalog/Pricing/Price/TierPrice.php ?

in magento 2


texts: Setup page not getting loaded after install

texts:
I have been trying to install magento 2,

When i am trying to access the setup page from url, but the url is not accessible it says

  This page isn’t working xx.xx.xxx.xxx is currently unable to handle
  this request. HTTP ERROR 500

I have no idea what the problem is apache2 is running properly I am able to access other pages like phpinfo.

Any help or pointers will be really appreciated.


texts: How to add Buy now button in Magento 2.1.8?

texts: How to add buy now button in Magento 2.1.8 ?


texts:
when edition the product for the backend, I faced the unique constraint violation found in the Magento-2.3 . I have checked the exception log this shows

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '404-0-4-1.0000-0' for key 'UNQ_E8AB433B9ACB00343ABB312AD2FAB087', query was: INSERT INTO `catalog_product_entity_tier_price` (`entity_id`, `all_groups`, `customer_group_id`, `qty`, `value`, `percentage_value`, `website_id`) VALUES (?, ?, ?, ?, ?, ?, ?)


texts: Magento 2: Billing address same as shipping doesn't work while changing the shipping method

texts:
So I have 3 shipping methods on my checkout page,

Shipping Method

Free Ground Shipping- $0
2-Day Shipping - $15
Overnight - $35

By default, the first one Free Ground Shipping- $0 is always selected, but if I select either 2-Day Shipping/Overnight as the shipping method, I get the issue of  Billing address same as shipping,
as Billing Address is not set as Shipping address. but the checkbox is selected somehow I don't know-how.

These are the error I get

I know this has something to do with app/code/MODULE/Checkout/view/frontend/web/js/model/checkout-data-resolver.js

 applyBillingAddress: function () {
        var shippingAddress;

        if (quote.billingAddress() && quote.billingAddress().hasOwnProperty('telephone')) {
            selectBillingAddress(quote.billingAddress());

            return;
        }
        shippingAddress = quote.shippingAddress();

        if (shippingAddress &&
            shippingAddress.canUseForBilling() &&
            (shippingAddress.isDefaultShipping() || !quote.isVirtual())
        ) {
            //set billing address same as shipping by default if it is not empty
            selectBillingAddress(quote.shippingAddress());
        }
    }

How to fix this.


texts: Display custom widget to specific product

texts:
I created a custom widget. Now I want it to display into the specific product page. Example I have Product 1 and Product 2. I want my custom widget to display in Product 1 but not in Product 2. How can I achieve this? It seems that going to the admin->catalog->product and selecting the product does not work because there are no option to select the widget I want. What will be the best or correct approach to do this?

Note: My widget displays a form and I want that form to only display to a specific product. Is this possible? If so how?


texts: Magento 2: How to Solve Defer parsing of JavaScript on CDN?

texts:
My website in Production Mode & I set Javascript to be Merged. So we have only one JS file.

On Speed related website it keep saying F grade on Defer Parsing of Javascript. I'm using CDN.

<script type="text/javascript"  src="cdn.domain.com/pub/static/_cache/merged/0285dfa79816d33a235c33875d3d2e57.min.js"></script>

How to achieve mostly A Grade in this?

Need to add async in Script Tag but How & Where?

Already followed Defer parsing of JavaScript in Magento


texts:
I have added new field to the admin form which manages the taxes but I did this by editing the core files themselves.

I would like to adapt this to a separate module so the changes remain after I would update Magento.

I found some tutorials online about how to create a module but it doesn't say how to make the config file of the module to add just one field at a particular spot.

Now I added

  <displaytax>0</displaytax>

to the app/code/core/Mage/Tax/etc/config.xml file in the  tag.

And added this to the app/code/core/Mage/Tax/etc/system.xml

<displaytax translate="label">
    <label>Display Tax</label>
    <frontend_type>select</frontend_type>
    <source_model>adminhtml/system_config_source_yesno</source_model>
    <sort_order>45</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</displaytax>

Below the

I also made some adjustments to the Block and Model files, where I added the function to call this variable.

app/code/core/Mage/Tax/Block/Checkout

class Mage_Tax_Block_Checkout_Tax extends Mage_Checkout_Block_Total_Default
{
    protected $_template = 'tax/checkout/tax.phtml';

    /**
     * Check if we have include tax
     *
     * @return bool
     */
    public function displayTax()
    {
        return Mage::getSingleton('tax/config')->displayCartTax($this->getStore());
    }
}

Added to app/code/core/Mage/Tax/Model/Config.php

const XML_PATH_DISPLAY_CART_DISPLAYTAX  = 'tax/cart_display/displaytax';
public function displayCartTax($store = null)
{
    return (bool)Mage::getStoreConfig(self::XML_PATH_DISPLAY_CART_DISPLAYTAX, $store);
}

Of course I made them HTML changes in /app/design/frontend/default/{mytemplate}/template/tax/checkout/tax.phtml

How should I convert this to a module?

How should you add a yes/no field to the admin form in the correct manner? Because this method works but will be overwritten in case of an update. I'd like a more sustainable solution.


texts:
I am having an API that give me price of metals and I want to use that price just before placing an order and re calculate the cart price before order has been placed.

In order to do that I created an observer.
Here is the code for config file:

<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
    <CustomPriceUpdate_Checkout>
        <version>0.0.1</version>
    </CustomPriceUpdate_Checkout>
</modules>
<global>
    <models>
        <myCustomPriceUpdate_Checkout>
            <class>CustomPriceUpdate_Checkout_Model</class>
        </myCustomPriceUpdate_Checkout>
    </models>
    <events>
        <sales_order_place_before>
            <observers>
                <modify_product_price>
                    <type>singleton</type>
                    <class>myCustomPriceUpdate_Checkout/observer</class>
                    <method>update_price</method>
                </modify_product_price>
            </observers>
        </sales_order_place_before>
    </events>
</global>
</config>

Observer.php:

<?php
class CustomPriceUpdate_Checkout_Model_Observer{
  public function update_price($observer){
    $client = new SoapClient('http://domain.com/index.php/api/v2_soap/?wsdl');
    $session = $client->login('username', 'key');
    $quote = $observer->getQuote();
    foreach ($quote->getAllItems() as $item) {
        $product = $item->getProduct();//if you need it
        $product_id = $product->getId();
        $price = $product->getPrice();
        $discountprice = 23;
        $newPrice = ($price)+($discountprice);
        $product->setPrice($newPrice);
        $result = $client->catalogProductUpdate($session, $product_id, array(
                        'price' => $newPrice,
                    ),'brisbanebullion');
        Mage::log($product_id, null, "order.log", true);
    }
  }
}

I am using catalogProductUpdate API to update the price. The above code is only updating the price of Product, but its not updating the cart prices.

If I use the trigger "checkout_cart_save_before", then its changing price in both cart and catalog.

Can anyone please suggest me, which trigger I should use to update cart price just when user click place order button on checkout page.


texts: How to Update customer in magento 2.2 programmatically?

texts:
I want to update customer information programmatically. so I have used below code.

public function execute()
{
    $resultRedirect = $this->resultRedirectFactory->create();
try{
    $path = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('catalog/import/epicore/UPB-customers.csv');
    $dataExcel = fopen($path, "r");
    while (!feof($dataExcel) ) {
        $line_of_text[] = fgetcsv($dataExcel, 1024);
    }
    array_shift($line_of_text);
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    foreach($line_of_text as $customerNewData){
        $websiteId  = $this->storeManager->getWebsite()->getWebsiteId();
        $customer = $objectManager->create('Magento\Customer\Api\CustomerRepositoryInterface')->getById($customerNewData[0]);
        //echo "<pre>"; print_r($customer->getData()); exit;
        if(count($customer)){
            $data = array();
            $email = $customer->getEmail();
            $customer->setWebsiteId($websiteId);
            $customer->setData("custid", $customerNewData[1]);
            $customer->setData("custnum", $customerNewData[2]);
            $customer->setData("salesforceid", $customerNewData[3]);
            $customer->setEmail($email);
            $customer->save();
        }else{

        }
    }
} catch(\Exception $e) {
        echo $e->getMessage(); exit;
}
$this->_redirect('*/*/');
    return;
}

But Its returns "Please enter email address" error.


texts: Magento 2 : Manually send current currency to a payment method in a multi currency store

texts:
I have to manually send price of the products in cart, tax, total etc.  in current currency to a payment method as by default magento sends it in base currency of the store.

Can anyone point me in the right direction on how to do so?

Thanks in advance!


texts: Magento grid column filter by text instead of id

texts:
I created a column for my grid using renderer to change id to name like this:

$this->addColumn(
            'city_destination',
            array(
                'header' => Mage::helper('test_shippingcost')->__('City Destination'),
                'index'  => 'city_destination',
                'type'=> 'text',
                'renderer'  => 'Test_ShippingCost_Block_Adminhtml_Renderer_City'
            )
        );

But when i want try to filter the value using text, it won't budge unless i'm using id

renderer:

class Test_ShippingCost_Block_Adminhtml_Renderer_City extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
  public function render(Varien_Object $row)
  {
    $id =  $row->getData($this->getColumn()->getIndex());
    $collection = Mage::getModel('test_shippingcost/city')->load($id);
    $value = $collection->getName();
    return $value;
  }
}


texts: SQLSTATE[42000]: Syntax error or access violation: 1064 in magento 2.2.5

texts:
I have deleted old theme column in database table "theme".
after that i am getting error on catalog view page and product view like this

 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (e.created_in <= 1) AND (e.updated_in > 1) AND ( e.website_id = '1' ) AND ( ' at line 7, query was: SELECT ROUND((e.min_price) * 1, 2) AS `min_price_expr` FROM `catalog_product_index_price` AS `e`
INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='1872'
    LEFT JOIN `magento_catalogpermissions_index` AS `perm` ON perm.customer_group_id = 0 AND perm.category_id = cat_index.category_id AND perm.website_id = '1'
INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1
    INNER JOIN `catalog_product_entity_int` AS `at_approval` ON (`at_approval`.`row_id` = `e`.`row_id`) AND (`at_approval`.`attribute_id` = '261') AND (`at_approval`.`store_id` = 0)
INNER JOIN `catalog_product_entity_int` AS `at_listing_fee` ON (`at_listing_fee`.`row_id` = `e`.`row_id`) AND (`at_listing_fee`.`attribute_id` = '263') AND (`at_listing_fee`.`store_id` = 0)
INNER JOIN `search_tmp_5b863003f2f674_54776102` AS `search_result` ON e.entity_id = search_result.entity_id WHERE AND (e.created_in <= 1) AND (e.updated_in > 1) AND ( e.website_id = '1' ) AND ( e.customer_group_id = 0) AND (e.min_price IS NOT NULL) ORDER BY `e`.`min_price` ASC
LIMIT 100
Exception #1 (PDOException): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (e.created_in <= 1) AND (e.updated_in > 1) AND ( e.website_id = '1' ) AND ( ' at line 7

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (e.created_in <= 1) AND (e.updated_in > 1) AND ( e.website_id = '1' ) AND ( ' at line 7, query was: SELECT ROUND((e.min_price) * 1, 2) AS `min_price_expr` FROM `catalog_product_index_price` AS `e`
 INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='1872'
LEFT JOIN `magento_catalogpermissions_index` AS `perm` ON perm.customer_group_id = 0 AND perm.category_id = cat_index.category_id AND perm.website_id = '1'
INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1
INNER JOIN `catalog_product_entity_int` AS `at_approval` ON (`at_approval`.`row_id` = `e`.`row_id`) AND (`at_approval`.`attribute_id` = '261') AND (`at_approval`.`store_id` = 0)
INNER JOIN `catalog_product_entity_int` AS `at_listing_fee` ON (`at_listing_fee`.`row_id` = `e`.`row_id`) AND (`at_listing_fee`.`attribute_id` = '263') AND (`at_listing_fee`.`store_id` = 0)
INNER JOIN `search_tmp_5b863003f2f674_54776102` AS `search_result` ON e.entity_id = search_result.entity_id WHERE AND (e.created_in <= 1) AND (e.updated_in > 1) AND ( e.website_id = '1' ) AND ( e.customer_group_id = 0) AND (e.min_price IS NOT NULL) ORDER BY `e`.`min_price` ASC
LIMIT 100


texts: How to convert HTML / Php code to pdf code

texts: I had made a custom module for replacing the existing invoice pdf with my custom pdf, I displayed all the information using coordinates... Is there a way that I design all my pdf using normal html code with html tables and after that I can convert all that code to pdf code means assign coordinates automatically..


texts: Set expiry date and save value in table magento 2?

texts:
I want to set expiry date for let say store credit, I have created custom column by installschema in table as:

{
        $table = $setup->getConnection()->addColumn(
            $setup->getTable('magento_customerbalance_history'),
            'created_at',
            [
                'type' => Table::TYPE_TIMESTAMP,
                'nullable' => 'false',
                'default' => Table::TIMESTAMP_INIT,
                'comment' => 'Creation Date'
            ]
        );
}

I want to create a column 'expiry date', formula could be:

  $expiry_date = $created_at + $one_month;

How to do this manipulation and save value in Table?


texts: How to solve 'Mismatch of entities in the documents: rating, rating_store' error in Data migration Magento2.2.0?

texts:
In data migration process, recently I faced this error in Rating Step:

  [ERROR]: Mismatch of entities in the documents: rating, rating_store

I check this both table and put ignore field value in map.xml.dist file.

But still, this error occurred in every migration process.

How to solve this error?


texts:
I have a Magento 2.1.5 store, language settings English (United States) for admin and I want to mass update price attribute of a couple of products. I select the products and choose "update attributes".

In "attributes" I scroll to "Price", select change and enter 49.95 (euros). I press save and the strangest thing happens:

My prices for the selected products is changed to 100,00,00.00 euros!

I've searched the forums and the github magento2 issues but can't find which issue this is. I did find a youtube that seems to be related.

So I'm not the only one running into this. Does anyone have a solution or know which issue this is on github magento2 issues?

I really need to get this solved, I can't have my customer mass update his simples and then find out all his simples are now over 100,000,000.00 euros...

Anyone who can point me in the right direction?


texts: Magento 2 : Billing addresses as radio button and popup

texts: How can we display billing addresses as radio buttons instead of drop-down ? And open a popup while adding new billing address in one step checkout.


texts: Add multiple select control to fieldset in form magento 2

texts:
I need to add mutiple select in form. I have try this:

$fieldset->addField(
            'shipping_method_no_free',
            'select',
            [
                'options' => ['1' => __('Shipping method no free 1'), '0' => __('Shipping method no free 2')],
                'name' => 'shipping_method_no_free[]',
                'label' => __('Shipping Methods No Free'),
                'title' => __('Shipping Methods No Free'),
                'class' => 'main_acount',
                'multiple' => 'true'
            ]
        );

But it is render like normal select.

I have also try this:

$fieldset->addField(
        'shipping_method_no_free',
        'multiselect',
        [
            'options' => ['1' => __('Shipping method no free 1'), '0' => __('Shipping method no free 2')],
            'name' => 'shipping_method_no_free[]',
            'label' => __('Shipping Methods No Free'),
            'title' => __('Shipping Methods No Free'),
            'class' => 'main_acount'
        ]
    );

It render as i multiple select, but there are no content in it.

I have also try this:

 $fieldset->addField(
        'shipping_method_no_free',
        'multiselect',
        [
            'values' => ['1' => __('Shipping method no free 1'), '0' => __('Shipping method no free 2')],
            'name' => 'shipping_method_no_free[]',
            'label' => __('Shipping Methods No Free'),
            'title' => __('Shipping Methods No Free'),
            'class' => 'main_acount'
        ]
    );

But it is render the page incompletly.

Is anyone facing the problem like that ?

Please, help me!


texts: Why are Magento 1.9 tax zones and rates for post codes / zip codes ignored?

texts:
We are based in the UK where 20% VAT is due on all domestic sales. We offer shipping to the Channel Islands (Jersey/Guernsey) where tax should be zero rated. I have set up Jersey and Guernsey as separate countries with their own tax rate of 0%, if a customer correctly chooses Jersey/Guernsey as their shipping address then the correct rate of tax is applied.

However, the problem is that many customers in the Channel Islands select 'United Kingdom' as their country and enter Jersey/Guernsey as their state, UK VAT at 20% is then incorrectly applied. The same may apply to Gibraltar and a similar problem applies to the Canary Islands. There are legal and accounting implications with this, inevitably we occasionally fail to manually intercept these orders before they reach our business system, so we need to filter these orders by postal code, i.e. JE* and GY*. I've set this up in Sales -> Tax -> Manage Tax Zones & Rates but VAT for the United Kingdom continues to be applied regardless of the postal code.

Has anyone else been able to set postal codes up to apply the correct tax rate? Is it likely I've missed something in the Magento configuration settings? I've no idea where to start debugging this issue so I'd like to rule out configuration errors as a possibility before looking for a dev to help fix the problem.

Magento version is 1.9.0.1 CE with all SUPEE patches applied.

TIA for any suggestions.


texts:
I've recently began building a community module that allows Magento to react appropriately when certain PayPal error codes are returned from the DoExpressCheckoutPayment call.

However with Magento 1.9+ I'm seeing there's an oddity.  Looking at line 524 on app/code/core/Mage/Paypal/Model/Api/Nvp.php, we can see that there is a new array element added as follows:

protected $_requiredResponseParams = array(
    self::DO_DIRECT_PAYMENT             => array('ACK', 'CORRELATIONID', 'AMT'),
    self::DO_EXPRESS_CHECKOUT_PAYMENT   => array('ACK', 'CORRELATIONID', 'AMT'), // this line was added
);

The second array element is not present in Magento 1.8 and prior.  This addition causes Magento 1.9+ to throw an exception earlier in the error handler than in past versions.

public function call($methodName, array $request)
{

    /// code above snipped

    if (!$this->_validateResponse($methodName, $response)) { /// THIS CALL THROWS IN MAGENTO 1.9+
        Mage::logException(new Exception(
            Mage::helper('paypal')->__("PayPal response hasn't required fields.")
        ));
        Mage::throwException(Mage::helper('paypal')->__('There was an error processing your order. Please contact us or try again later.'));
    }

    $this->_callErrors = array();
    if ($this->_isCallSuccessful($response)) {
        if ($this->_rawResponseNeeded) {
            $this->setRawSuccessResponseData($response);
        }
        return $response;
    }
    $this->_handleCallErrors($response); /// Execution reaches here in Magento 1.8 and prior
    return $response;
}

According to the PayPal documentation, the following error codes should result in the user being redirected back to PayPal from the application:

10417
10422
10485
10486
10736

In Magento 1.9+, the execution never reaches the point where an override of _handleCallErrors is able to properly figure out if a redirect is required or not.

Was there a good reason for this change, or just an oversight?  Should I be concerned about removing the second array element of the _requiredResponseParams in the overriding class?

-Edit 1
It looks like there's a non-fatal error handling mechanism built into Magento 1.9+, however the presense of the addition to the _requiredResponseParams array is preventing the code from executing.

Interesting...


texts: auto invoice in magento 1.9.2 using paypal

texts: we need to disable the auto invoice created by magento after a paypal payment. The magento version is 1.9.2 and no settings are present to avoid this. Is there any paypal account setting to stop the auto invoice in magento 1.9.2 ?


texts: Extend addProductstoCart mutation in Magento 2.4

texts:
I want to extend the addProductsToCart mutation because I need to pass some product attributes and get the into cart using $_item->getProduct()->getData('attribute_name');
In my custom module, I created the etc/schema.graphqls file with the following configuration ...
input CartItemInput { attribute_name: String @resolver (class: "\\MyVendor\\MyModule\\Model\\Resolver\\AttributeName") }
Then, inside the AttributeName.php resolver, I have
declare(strict_types=1);

namespace MyVendor\MyModule\Model\Resolver;

use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\QuoteGraphQl\Model\Cart\GetCartForUser;

class AttributeName implements ResolverInterface
{
    public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
    {
        return "test";
    }
}

Inside Magento_Checkout, default.phtml, when I try to get this attribute, it doesn't work.
What's the issue?


texts: How to set "Configurable" as a default product type on Magento's new product 1st step?

texts: When we click to create a new product, the default option is "Simple product". Is there a way to set "Configurable" as default option since the store will always work with configurable products?


texts: Qty in cart to dropdown and automatic update

texts:
I've managed to convert the basket qty to a dropdown.

Any ideas how I can update the basket upon selection of dropdown value, as oppose to selecting "Update Cart".


texts:
On this item:
https://sssextreme.com/westbeach-twist-ski-snowboard-ladies-jacket-rasberry-sinatra-blue.html
It works fine 100%

But some items like this one below
https://sssextreme.com/twf-adults-xt3-full-wetsuits.html
It does not swatch, but it does on the category pages like below
https://sssextreme.com/catalogsearch/result/?q=TWF+ADULTS+XT3+FULL+WETSUITS


texts:
Is there a way to validate fields in OSC, in a way that as an specific  country is selected, another fields like 'Postal Code' would only allow the introduction of numbers?

Thanks for your collaborations.


texts:
execution of magento2 commands taking so much time
setup:upgrade
cache:clean
cache:flush
indexer:reindex

execution of upgrade command will take 10 - 15 minutes
even cache and flush commands also take 10-15 minutes to execute


texts: Magento 2: target _blank in navigation links do not work!

texts:
Anyone know how to get target _blank to work on links in the navigation?
I created a custom mega menu and all links with target _blank do not actually open in a new tab.
I've seen other posts about this, but the files mentioned in those posts do not exist!


texts: Style image captions using Fishpig blog extension

texts: Anybody know how to style the caption text - Have it display in the magento template like it displays in the wordpress backend?


texts: How to create a Magento 2 Modal popup that cannot be closed?

texts:
I'm trying to create a modal popup that cannot be closed. It has a button that takes you to the next page by clicking on it, but I don't want users to be able to close it.

The modal popup can be closed in 3 ways:

Clicking the cross/[X] button in the top right corner
Pressing escape
Click on the overlay

So far this is my modal JS and I think with clickableOverlay: false I've already tackled the 3rd one:

require(
    [ 'jquery', 'Magento_Ui/js/modal/modal' ],
    function($, modal) {
        $("#popup").modal({
            autoOpen: true,
            responsive: true,
            clickableOverlay: false,
            modalClass: 'modal-custom',
            title: 'Popup',
            buttons: [{
                text: $.mage.__('Take me back to the homepage'),
                class: 'action close-popup wide',
                click: function () {
                    window.location.href = '/';
                }
            }]
        });
    }
);

UPDATE:

I also tried to setup the modal in a different way when trying the provided solutions:

require(
    [ 'jquery', 'Magento_Ui/js/modal/modal' ],
    function($, modal) {
        modal({
            //options
        }, $("#popup"));
    }
);


texts: Magento 1.9 Checkout Registration Password Match Issue

texts:
Have recently upgraded to Magento 1.9.1.0 and now when you go through checkout and enter your details and password, it popups with an error saying - Please make sure passwords match.

I have tried over and over again and cannot get it working.


texts:
I was trying to edit a user role (System -> Permission -> User Roles) on the magento 2.3.1 admin panel and I started to get this error:

[2019-06-17 08:34:01] main.CRITICAL: Item (Magento\User\Model\User\Interceptor) with the same ID "11" already exists. [] []
[2019-06-17 08:34:01] main.CRITICAL: The "adminhtml.user.editroles" block threw an exception, and it can't be rendered. [] []

I've tried to google the issue and I've seen similar errors relating to products, however, nothing to do with user roles.

The result of this error is that I see a mostly blank page with no ability to edit the assets that a role has access to.

Appreciate any help.


texts:
Customer not get any mail for Order success . But get new user registration mail on Magento-1.9.1.1

I already set Store email as

01. System ==> configuration ==> Store Email Addresses All as:
    support@mydomain.com
02. System ==> configuration ==>Sales==> Sales Emails==>
    Order:Enable (All configured properly)
03. System ==> configuration ==>ADVANCED==>System ==>
    Mail Sending Settings:
    a) Disable Email Communications: NO
    b)Host: mail.mydomain.com Port:25

Admin Panel:

a). Sales==>Order==>Open Order ==>Invoice
Show here Order # 100000080 (the order confirmation email is not sent)


texts: Magento 2 - Save custom shipping address' fields to quote_address table

texts:
I have did all the steps from this tutorial and it works well for updating custom fields in quote table.

In my case, I need to add custom fields to quote_address and (later) in customer_address_entity tables.

I've created a plugin for:
<type name="Magento\Checkout\Model\ShippingInformationManagement">.

What I've got so far:

#Vendor/module/Plugin/Checkout/Model/Checkout/ShippingInformationManagementPlugin.php

public function beforeSaveAddressInformation(
    ShippingInformationManagement $subject,
    $cartId,
    ShippingInformationInterface $addressInformation
) {
    $this->logger->log(\Psr\Log\LogLevel::DEBUG, 'INDEXIS');

    $extAttributes = $addressInformation->getExtensionAttributes();

    $number = $extAttributes->getNumber();
    $complement = $extAttributes->getComplement();
    $district = $extAttributes->getDistrict();
    $area_code = $extAttributes->getAreaCode();
    $this->logger->log(\Psr\Log\LogLevel::DEBUG, "number: " . $number);
    $this->logger->log(\Psr\Log\LogLevel::DEBUG, "complement: " . $complement);
    $this->logger->log(\Psr\Log\LogLevel::DEBUG, "district:" . $district);
    $this->logger->log(\Psr\Log\LogLevel::DEBUG, "area_code:" . $area_code);

    $quote = $this->quoteRepository->getActive($cartId);

    $quote->setNumber($number);
    $quote->setComplement($complement);
    $quote->setDistrict($district);
    $quote->setAreaCode($area_code);
}

It logs the values in debug.log file but won't update the fields in my database.

I know that my mistake is trying to set my custom fields in $this->quoteRepository. So my question is: What object should I use to set my custom fields in quote_address table?

There will more questions related to this topic, but only after this one is solved.


texts:
In template file Magento_Theme/templates/html/pager.phtml the following code is never displayed:

<?php if ($block->canShowPreviousJump()): ?>

        <a class="page previous jump" title="" href="<?= $block->getPreviousJumpUrl() ?>">
            ...

<?php endif;?>
<?php if ($block->canShowNextJump()): ?>

        <a class="page next jump" title="" href="<?= $block->getNextJumpUrl() ?>">
            ...

<?php endif;?>

I am testing this in a category that has 35 pages of listing products. I'm browsing random pages.

I have also tried changing Pagination Frame and Pagination Frame Skip in magento configuration.

How does pagination jump work? What should I do to make it visible?


texts: images of magento home page are not seen

texts:
the images on my Magento2 home page are not seen anymore

I enabled cache and disabled also  is it possible that it was?
does anyone help me?
Thank you!!

@ Rakesh Donga  I have attached the file


texts: Why do we use bin/magento setup:di:compile

texts:
I know why we use bin/magento setup:upgrade and bin/magento setup:static-content:deploy

It is recommended on many blogs and forums that we need to execute bin/magento setup:di:compile after upgrade command.

It will be great if anyone can tell why do we use this command, what is the purpose behind it?

bin/magento setup:di:compile


texts: Update order status on click of place order with post data to controller

texts:
How can I post some additional parameters to the custom controller and update the order with order status?

With a custom payment module, the payment is processing on the checkout page with JS. I need to update the order status after place order.

Does anyone know how to do it? Thanks in advance.


texts: Why my css is loading from the base theme instead of custom theme on migrating the site?

texts:
I developed a site in magento on windows 7, and now my system has been updated and install an ubuntu 12.04 in it.

Now when I am running my site in browser I got an issue that my css is not loaded from the path which is loaded before.

Firstly my css path is like this

http://127.0.0.1/magento/skin/frontend/default/sportation/css/style.css

sportation is my custom theme, and now in ubuntu path is like this

http://127.0.0.1/magento/skin/frontend/base/default/css/style.css

Can anyone tell me why it is loading a css from the base theme I didn't understand, not only style.css every css is getting the path of the base theme.

My custom theme is still in working but not the css. How can I set the correct path.

Thanks.


texts: Magento Server is at 100% CPU after installing Extension

texts:
I just installed a new Extension via Composer:

$ composer require mageworx/module-advancedproductoptions

This is the output:

Using version ^2.16 for mageworx/module-advancedproductoptions
./composer.json has been updated
Loading composer repositories with package information                                                                                Updating dependencies (including require-dev)         Package operations: 11 installs, 0 updates, 0 removals
  - Installing mageworx/module-optionbase (2.8.1): Downloading (100%)
  - Installing mageworx/module-optionvisibility (2.0.1): Downloading (100%)
  - Installing mageworx/module-optiontemplates (2.5.7): Downloading (100%)
  - Installing mageworx/module-optionswatches (2.2.0): Downloading (100%)
  - Installing mageworx/module-optionfeatures (2.9.0): Downloading (100%)
  - Installing mageworx/module-optionskupolicy (2.1.5): Downloading (100%)
  - Installing mageworx/module-optionlink (2.0.10): Downloading (100%)
  - Installing mageworx/module-optioninventory (2.6.3): Downloading (100%)
  - Installing mageworx/module-optiondependency (2.3.1): Downloading (100%)
  - Installing mageworx/module-optionadvancedpricing (2.0.3): Downloading (100%)
Writing lock file
Generating autoload files

Then I did a

bin/magento setup:upgrade

Which was already executed very slowly but didn't show any errors.
Now when I open the homepage I get a timeout and I can see that the server is on 100% CPU constantly.

I can see with top that this is caused by about 15 different php7.2 processes

How can I find out what is causing this?
Which logs files can I check?
Did I miss some step in the installation process?


texts: 500 server error after coupon application

texts:
I have created a coupon (Cart promotion). I use " for a subselection of items in cart matching" in the rule. If try to apply the coupon but the cart don't not satisfy the rule then i get a 500 internal server error.

  The server encountered an internal error or misconfiguration and was
  unable to complete your request. Please contact the server
  administrator to inform of the time the error occurred and of anything
  you might have done that may have caused the error. More information
  about this error may be available in the server error log.

I saw the logs of server and i find that:

[Thu Dec 24 23:15:01 2015] [warn] [client xxx.xxx.xxx.xxx]
  (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server,
  referer: http://www.exampe.com/checkout/cart/
[Thu Dec 24 23:15:01 2015] [error] [client xxx.xxx.xxx.xxx]
  Premature end of script headers: index.php,
  referer: http://www.example.com/checkout/cart/

Any solution for this problem?


texts: Custom Category Attribute not rendered in backend Categories Page

texts:
i try to add a new category attribute in Magento 2.3.6 and render an input in the category backend.
Setup worked, attribute is created. But the category_form.xml seems to be ignored. Maybe someone can show me whats wrong here.
I used this explanation first:
https://devdocs.magento.com/guides/v2.3/ui_comp_guide/howto/add_category_attribute.html
But i dont get the Attribute shown in backend. Module is enabled, setup creates the entries in eav_attribute and catalog_eav_attribute. I dont have errors in the logs.
Vendor/Module/Setup/InstallData.php
<?php
namespace Vendor\Module\Setup;

use Magento\Framework\Setup\{
    ModuleContextInterface,
    ModuleDataSetupInterface,
    InstallDataInterface
};

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory) {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->removeAttribute(\Magento\Catalog\Model\Category::ENTITY, 'product_group');
        $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'product_group', [
            'type'     => 'varchar',
            'label'    => 'Product Group',
            'default'  => null,
            'input'    => 'text',
            'visible'  => true,
            'required' => false,
            'global'   => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'group'    => 'general',
            'source' => '',
            'backend'  => '',
            'user_defined' => false,
            'sort_order'   => 100,
        ]);
    }
}

UI Component
Vendor/Module/view/adminhtml/ui_component/category_form.xml
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="general">
        <field name="product_group">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="required" xsi:type="boolean">false</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                    </item>
                    <item name="sortOrder" xsi:type="number">100</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" translate="true" xsi:type="string">Product Group</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

Would be great if someone can help me :)
Regards,
Andreas


texts: If attribute 'is_customizable' = 1 then add custom option to product

texts: I have 18,000 products and they can either be personalized with text or they can't be personalized.  I imported the products with a custom is_customizable field that is either 1 or 0.  Now I'm trying to figure out how to add a custom option, in bulk, to the products where is_customizable is true.  The custom option is going to be a text area called Personalization Text.


texts: What is the best way to handle multiple countries, languages, and mobile/dekstop views?

texts:
I have site that will need to front stores for two countries (US, MX). Both countries need to be available in en_US and es_MX languages. There is no difference between the product offerings for the countries, only the currency and translation of the product data, including images.

The theme will be responsive but there are certain blocks the are only used in the "large" or "small" screen views so something RESS like is required.  There are also certain pieces of content coming from the Catalog that will need to be different for "small" and "large" screens (in addition to language) for example "category" banner images that need to be different between "small" and "large" because of the aspect ratio.

I read this post in addition to several articles and it seems like I'll need to do the second option from the SO question:

Website:    country
Store:      small/large
Store View: translations

Will this accommodate all my requirements? Are there any additional drawbacks other than those listed in the referenced SO q/a?


texts:
I'm in the very earlier stages of learning magento and trying to create a new theme for my client.

I'm slowly getting to grips with the cusomisations but at the moment I'm having to clear the caches, delete files and reindex to see my changes..Is there a way I can streamline this? It seems a very long winded way just to see a little change... I've put Magento in Developer mode by doing-

bin/magento deploy:mode:set developer

And the env.php

'MAGE_MODE' => 'developer',

Does seem to make a difference though


texts: Magento 1.9 : How to add popup window in custom tab grid adminhtml

texts: Popup window on adminhtml grid signature column now plase check it screen short


texts: Access current product collection in 2-columns-left

texts:
I need to access the current product collection in teh main page template (in this case 2-columns-left) in order to check whether a certain product exists, and if it does, display a banner advert.

I have tried:

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

but this loads all products, not just the ones loaded into the product list template.

Is there a way I can access only those products listed in the product view template from the parent template (2-columns-left)?


texts:
Good evening.
I inherit a Magento from my webmster that can no longer deal with it.
I know little about programming, but I can do something about it.
For several days I would like to enter the admin but I will return this string

  "You have not signed in correctly or your account is temporarily
  disabled"

Someone can help me ? I have access to the database via phpmyadmin

Thanks in advance !

Buona sera.
Eredito un Magento dal mio webmster che non può più occuparsene.
So poco di programmazione, ma qualcosa riesco a farlo.
Da diversi giorni vorrei entrare in admin ma mi restituisce questa stringa

  "Non hai eseguito l'accesso correttamente o il tuo account è
  temporaneamente disattivato"

Qualcuno potrebbe aiutarmi.Ho l'accesso al database mediante il phpmyadmin
Grazie in anticipo !


texts: (Magento\Customer\Model\Customer\Interceptor) with the same ID "16" already exists. Error keeps showing in Health Monitor Suite.


texts: Disable shipping Method from frontend but not in backend

texts:
In Magento 1.x all shipping rates calculation done by a collect rate function

public function collectRates(Mage_Shipping_Model_Rate_Request $request) {
    if (!Mage::getStoreConfig('carriers/' . $this->_code . '/active')) {
        return false;
    }
/*************** Start Logic to calculate rates****************/

/***************End Logic to calculate rates****************/

}

So if we want to hide that specific shipping method from the list in checkout page frontend. Then what is the correct way to do this.


texts: How can we use Admin Js file in custom theme in magento 2

texts:
I want to modify File /vendor/magento/module-bundle/view/adminhtml/web/js/components/bundle-user-defined-checkbox.js.
I have a custom theme.

I have put this file app/design/adminhtml/Magento/backend/Magento_Bundle/web/js/components/bundle-user-defined-checkbox.js but doesn't work.


texts:
I want to remove magento default jquery.elevateZoom-3.0.8.min.js zoom ectension on the product view page.

i tried removing the commenting js file from catalog.xml file but not working.

Please help me
Thanks  In Advance


texts: Want to display the special price directly with out any pop dailog box?

texts:
hi

I dont want this dailog box and i want to show the price in the place of Click for price.


texts: Magento 2: How to setup Elasticsearch from CLI?

texts:
We need to setup elasticsearch on Magento 2 when a new container starts.
We have post-install scripts that could handle that and not have someone go into the admin and manually do it.

Thanks.


texts: How to get current user's name in layout xml file?

texts:
I want to add a top.links that shows user's name instead of "My Account".

In the old way, I've done by:

Remove the line which add My Account link in customer.xml (usually in default handler)
In page/template/links.phtml I add

$session = Mage::getSingleton('customer/session');
if($session->isLoggedIn()) {
    $customer = $session->getCustomer();
    $full_name =  $customer->getName();
    $this->addLink($label = $full_name, $url= $this->getUrl('customer/account'), $title='', $prepare = false, $urlParams = array(),
    $position = 10, $liParams = array('class' => 'my-class'), $aParams = null, $beforeText = '', $afterText = '');
}

But now, in new theme, I can't do this way because I use page/template/links.phtml for several kinds of links (account.links, checkout.links, top.links, ...)

So, turn back to customer.xml,

<action method="addLink" translate="label title" module="customer">
      <label>My Account</label>
      <url helper="customer/getAccountUrl"/>
      <title>My Account</title>
      <prepare/>
      <urlParams/>
      <position>10</position>
</action>

How to replace "My Account" to user's name if user logged in? Is there any ways to get this done in customer.xml?


texts: Does Magento2 cancel orders after 2 hours?

texts:
We are seeing a few orders in our sales list that are 'Cancelled' and when we look at them, the reason for authorization failed is: "You have to enter the card holder name."

I thought this was a bit odd because Magento does not let you progress to the payment page without first entering a first and last name (which passes through automatically to the payment page)

We are using a Sagepay extension to process payments so I asked those developers why the autorization failed on those orders.

They say that Magento creates orders before the payment is executed. This means that if the customer enters wrong data or doesn't even enter any info, Magento sets a corresponding status and cancels the order after 2 hours.

This behaviour is most probably caused by the users themselves, by leaving the payment page without explicitly cancelling the transaction.

Is this true that Magento cancels the order after 2 hours? (I cant seem to find any information regarding this) If so can this timeout be increased?

Thanks


texts: Magento 2.3.2: Minify and merge are not working in Production mode

texts:
I am using Magento 2.3.2 When I enabled production mode with Minify and Merge options for both CSS and JS only Minify is working. Js and CSS files are not merged. Did anyone came across the issue.

I have checked the Database and ran all commands. Still no luck.


texts: Magento 2.1 : How to add Custom button on a custom grid in customer view Adminhtml

texts:
I have created a custom grid on customer view in admin

 protected function _construct()
    {
        parent::_construct();

        $this->setDefaultSort('model','desc');
        $this->setSortable(true);
        $this->setPagerVisibility(true);
        $this->setFilterVisibility(true);
    }

are used to get sorter , pager and filters

How can i add new custom button here above the grid?


texts:
We have 2 buttons in Product view page, after we click on 1st button, we creating Product Programtaically.

once click on 2nd button [ after entering email, password] we are assigning that product to that customer.

Here issue is saving "customer id"  value in Attribute [ attribute id : custom_uid ] is not working.

as we create the product after click on 1st button, is there any way to update the same product on click 2nd button

protected function _createProduct($type, $doSave = true, $originalProduct, $newImagePath = "")
    {

        Mage::register('isSecureArea', true);
        $session = Mage::getSingleton('customer/session');

        $result = array(
            'success' => false
        );

        $login = "";
        $productId = "";
        if ($this->getRequest()->isPost()) {
            $login = $this->getRequest()->getPost('login');
            $productId = $this->getRequest()->getPost('product_id');
        }

        try {
            if (isset($login) && (is_array($login) && !empty($login)) || ($login != "")) {
                $designId = Mage::getSingleton('core/session')->getData('mydesign_id');
                $session->login($login['username'], $login['password']);
                $result['redirect'] = $this->_getRefererUrl() ? $this->_getRefererUrl() : Mage::getUrl('customer/account', array(
                    '_secure' => true
                ));
                $result['success'] = true;
                $customerId = Mage::getSingleton('customer/session')->getCustomerId();
                $model = Mage::getModel('example/mydesign')->load($designId);
                if ($model->getId()) {
                    $model->setData('customer_id',$customerId);
                    $model->save();
                }

                Mage::getSingleton('core/session')->unsetData('mydesign_id');
                $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
                return $this;
            } else {
                $customerId = "";
            }

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

            $product->setName($originalProduct->getName());

            $customerId = Mage::getSingleton('customer/session')->getCustomerId();
            $product->setCustomUid($customerId);   // fetching cutomer id

            if ($doSave) {
            }
            $product->save();

            $fav1_id = '';
            $data = array(
                'title' => $fav1_id,
                'product_id' => $product->getId(),
                'customer_id' => $customerId

            );
            //echo '<pre/>';
            $model = Mage::getModel('example/mydesign')->setData($data);
            try {
                $fav1_id = $model->save()->getId();
                if (!$customerId) {
                    Mage::getSingleton('core/session')->setData('mydesign_id', $fav1_id);
                }

            } catch (Exception $e) {
                echo $e->getMessage();
            }
            // To save

            return $product;

        } catch (Mage_Core_Exception $e) {
            switch ($e->getCode()) {
                case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:
                    $message = Mage::helper('customer')->__('This account');
                    break;
                default:
                    $message = $e->getMessage();
            }
            $result['error'] = $message;
            $session->setUsername($login['username']);

        } catch (Exception $e) {
            $result = "ERROR :" . $e->getMessage();

        }

        Mage::unregister('isSecureArea');
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

    }


texts: Is there an event for after a product is saved only in admin?

texts:
So I'm looking for an event for after a product is saved in the admin interface? Similar to catalog_product_prepare_save (which is before save).

It's important that it doesn't fire when e.g. another module does $product->save(). It should only fire when a someones saving a product manually using the  admin interface.

Or any thoughts on other solutions of course.


texts:
I wanted to show the subcategory images on the category pages. I was following the instructions from this link.

Somehow I either deleted something and now my website is bringing up a fatal error. I have several Magento sites so I tried numerous times to copy the navigation.php files from the other site into the error site but its not working. Can someone assist me with this?

the message I am receiving is:

  Fatal error: Class 'Mage_Catalog_Block_Navigation' not found in
  /home/public_html/app/code/community/Codnitive/Sidenav/Block/Navigation.php
  on line 25


texts: "More Views" images are 66x66, containers for said images are 60x60, how to fix?

texts:
On our website, we have several products where their secondary images are displaying chopped off on the bottom and right sides of the image. More specifically, the images generated by Magento are 66px square, and the parent li is 60px square. We need to make these numbers match to make the full thumbnail be shown, but I just don't know how to do it. I guess I have a few questions:

What is used for Magento's image generation?
What can be done to change how Magento generates the thumbnail images below the primary image?
Does anyone else have this issue?


texts: Magento 2.2.5 - The price attribute and visibility attributes are not visible in admin panel product editing page

texts:
Magento 2.2.5- The price and visibility attributes of catalog_products are not visible while going to the product edit page. I want to update the price of the products.

What could be the reason?


texts:
Is it possible to run one elastic search on two different Magento 2 sites?

Currently, one Magento site running elastic search smoothly, but now I need to add elastic search in another Magento site also.

Will it conflict with the results? if yes, then how to resolve?

What is the role of the prefix index name in elastic search?

please help me make elastic search work with two magento sites.


texts: how to disable javascript merging programmatically

texts:
Today, i merged js from magento admin panel. After merging, my store is not working properly. I now want to disable js merging but i am unable to do this form my admin panel because now save button is also not working.
How can i disable js merging programmatically?


texts:
I search the entire web to found solutions for rewriting an url from a custom action but nothing works.

I tried to put into global this :

<rewrite>
            <artist_list_index>
                <from><![CDATA[#artist/list/index#]]></from>
                <to><![CDATA[artists]]></to>
                <complete>1</complete>
            </artist_list_index>
        </rewrite>

It gives me a 404 when i try to reach artist/list/index or artists route.

I tried to put this in gobal :

<routers>
            <artist>
                <rewrite>
                    <list>
                        <to>artists</to>
                    </list>
                </rewrite>
            </artist>
        </routers>

I can real artist/list/index but artists gives me a 404. I think i understand why by checking the _rewrite function. It's because this allow to override a function from a controller by forwaring a route to another.

Finally i tried to create my own router and then i get this error "Front controller reached 100 router match iterations
". So in global i added this :

<events>
            <controller_front_init_before>
                <observers>
                    <artist_rewrite>
                        <class>Confidential_Artist_Controller_Router</class>
                        <method>insertControllerRouter</method>
                    </artist_rewrite>
                </observers>
            </controller_front_init_before>
        </events>

Confidential_Artist_Controller_Router functions are :

/**
     * Initialize Controller Router
     *
     * @param Varien_Event_Observer $observer
     */
    public function insertControllerRouter($observer)
    {
        /* @var $front Mage_Core_Controller_Varien_Front */
        $front = $observer->getEvent()->getFront();
        $front->addRouter('artist', $this);
    }

    /**
     * @param Zend_Controller_Request_Http $request
     * @return bool
     * @throws Mage_Core_Model_Store_Exception
     */
    public function match(Zend_Controller_Request_Http $request)
    {
        if (!Mage::isInstalled()) {
            Mage::app()->getFrontController()->getResponse()
                ->setRedirect(Mage::getUrl('install'))
                ->sendResponse();
            exit;
        }

        $requestPathInfo=trim($request->getPathInfo(),'/');

        if($requestPathInfo != 'artists'):
            return false;
        endif;

        $request->setModuleName('artist')
            ->setControllerName('list')
            ->setActionName('index');
        $request->setAlias(
            Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,
            $requestPathInfo
        );

        return  true;
    }

Finally, here is my action controller definition :

    <routers>
        <artist>
            <use>standard</use>
            <args>
                <module>Confidential_Artist</module>
                <frontName>artist</frontName>
            </args>
        </artist>
    </routers>

Can you help me please ? i don't know what's wrong.


texts: Magento 1.9 Remove stock status from order confirmation email

texts:
I can't seem to find how to remove the stock status from the order confirmation (which goes to the client). We would like to remove it because we don't like to inform the client about it. I've already checked the stock status settings in the backend (System -> Catalogue -> Stock -> Backorders = Accept under the stock of 0 (not the one which includes informing the client).

Can somebody please send me in the correct direction on how to remove this? Please also see the attached image. I also tried to check the item's email template (under order) but I can't seem to find the exact rule where this gets inserted. Does it also seem that it's trying to 'add' it to the product name?

Thanks in advance! PS. I'm not a Magento pro, haha.


texts: Advanced Pricing is missing in Magento 2.1.8

texts:
This is my product adding screen of Magento now.

And the old screen was

No more "Advanced Pricing", and I have "Dynamic SKU", "Dynamic Price",...
It is correct ?, because I am in Simple Product, it is really strange...


texts:
In the backend i change the PO box to say Credit account as we offer a credit account to our customers, However whenever this is the case and we print invoices it still says "PO NUMBER:"
which could be confusing to our customers.

I changed the name in the back end so it shows credit account during checkout. But in the backend and on shipping labels and invoices it still says "PO Number"  how can i change this?

If i am not being clear please just let me know

Thank you


texts: Magento 2.1: Only admin can upload images to visual swatch

texts:
Administrators can upload images to visual swatches but users with limited access can't.

I'm trying to find the resource to give this user role access to it but can't seem to figure out which one it is. Does anyone know which one it is?


texts: i recently uploaded my magento site from local. But afetr i faced some issues. Firstly all my products are showing on the home page. But any time i try to view them on their own page, it gives me 404 error. What i noticed is a custom module SM Shop By isn't indexing in my index manager. Av tried several solutions i found online to correct it. But no result. Pls help Asap. http://www.innoshoppers.com.ng/


texts: There was a problem with reindexing process - Rebuild Catalog product fulltext search index

texts: Problem with catalog search reindexing process.


texts: M2: Quote Lifetime vs Persistent Shopping Cart

texts:
Most previous questions on this are old, related to M1 and never garnered a conclusive response.
Why is there a need for a Persistent Shopping Cart (PSC) and how does this interact with Quotes?
On our M2.3.3 site, we see quotes being created when anyone visits the site - although not all the time. For example, we have an uptime monitor that polls every minute. Sometimes we see a new "null" quote created each time the monitor polls (from the same IP) and other times nothing. Same for bots visiting the site. These quotes remain active and stay, unused, in the quote table forever. There are now thousands of null quotes registered with the same IPs but no customer.
What's the logic for when it decides to create a new quote?
When a customer logs in (we're B2B and require login to even view the shop), they either get a quote created or an existing quote updated. Anything added to the cart goes in the quote and lives there forever; quote lifetime only applies to inactive quotes (i.e. those converted to orders). Login from another device and what's in the cart is there. Persistent Shopping Cart is disabled.
So there's no need for PSC to maintain a cart, despite how PSC is described and the use-cases for registered customers presented in the documentation for it.
So what is the point of the PSC? Is it meant as a cookie-based fix for whatever is happening with guest quotes, where they seem to be randomly created or not?
Can anyone shed some light on why there are apparently two different mechanisms for the same thing - retaining a cart.


texts:
I have few problems when try make a plugin.

This is my code:

**Mibloque.php

class Uniagro_Tpv_Block_Mibloque extends Mage_Core_Block_Template
{
    public function methodblock()
    {
        //return "informations about my block !!" ;
        //on initialize la variable
        $retour='';
        /* we are doing the query to select all elements of the pfay_test table (thanks to our model test/test and we sort them by id_pfay_test */
     $collection = Mage::getModel('tpv/tpv')->getCollection()->setOrder('id','asc');
         /* then, we check the result of the query and with the function getData() */
        foreach($collection as $data)
        {
             $retour .= $data->getData('banco').' '.$data->getData('codigotienda')
                     .' '.$data->getData('url').'
';
         }
         //i return a success message to the user thanks to the Session.
         Mage::getSingleton('adminhtml/session')->addSuccess('Cool Ca marche !!');
         return $retour;
    }
}

** config.xml

<?xml version="1.0"?>
  <config>
     <modules>
        <Uniagro_Tpv>
          <version>1.0.0</version>
        </Uniagro_Tpv>
     </modules>
     <frontend>
       <routers>
          <routeurfrontend>
              <use>standard</use>
              <args>
                 <module>Uniagro_Tpv</module>
                 <frontName>pasarela</frontName>
              </args>
           </routeurfrontend>
       </routers>
       <layout>
            <updates>
                <tpv>
                    <file>uniagropasarela.xml</file>
                </tpv>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <tpv>
                 <class>Uniagro_Tpv_Block</class>
            </tpv>
        </blocks>
        <models>
            <tpv>
                <class>Uniagro_Tpv_Model</class>
                <resourceModel>tpv_mysql4</resourceModel>
            </tpv>
            <tpv_mysql4>
                <class>Uniagro_Tpv_Model_Mysql4</class>
                <entities>
                    <tpv>

uniagro_datosPasarela

                    </tpv>
                </entities>
            </tpv_mysql4>
        </models>
        <resources>

            <tpv_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </tpv_write>

            <tpv_read>
              <connection>
                 <use>core_read</use>
              </connection>
            </tpv_read>
        </resources>
    </global>
</config>

** model/Tpv.php

class Uniagro_Tpv_Model_Tpv extends Mage_Core_Model_Abstract
{
     public function _construct()
     {
         parent::_construct();
         $this->_init('tpv/tpv');
     }
}

** model/Mysql4/Tpv.php

class Uniagro_Tpv_Mysql4_Tpv extends Mage_Core_Model_Mysql4_Abstract
{
    public function _construct()
    {
        $this->_init('tpv/tpv', 'id');
    }
}

I'm try some solutions (for example this [fatal error: Call to a member function getCollection() on a non-object in magento

[1]: fatal error: Call to a member function getCollection() on a non-object in magento ) but always send my the same error "Fatal error: Call to a member function setOrder()"

And i review my bd and have the column to order ('id')


texts: Transfer All Data from one magento system to other

texts:
I have one Magento system1(2.3.4) system with all the Data

  Orders

  Products

  Customers

  Reviews

  Quotes

  Categories

Other Magento systems 2(2.3.4), I have to transfer all the data from system 1 to system 2.

Is there any quick way using database table transfer or through pro-grammatically?

Can anyone suggest me what is the better approach for this with the steps?

Thanks!!


texts:
I've created ui_form

Form in working fine, Image also render when i edit form.

But when i am trying to update image it giving me below prompt.

This is what I've in my ui_form for Image.

<field name="profile">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">string</item>
                <item name="source" xsi:type="string">contact</item>
                <item name="label" xsi:type="string" translate="true">Group Image</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="formElement" xsi:type="string">fileUploader</item>
                <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                <item name="previewTmpl" xsi:type="string">Vendor_Module/image-preview</item>
                <item name="required" xsi:type="boolean">false</item>
                <item name="sortOrder" xsi:type="number">40</item>
                <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="url" path="credit/grid/upload"/>
                </item>
            </item>
        </argument>
    </field>

I also created preview file.

        <button
            type="button"
            class="action-remove"
            data-role="delete-button"
            attr="title: $t('Delete image')"
            click="$parent.removeFile.bind($parent, $file)">

        </button>

    <text args="$file.previewWidth"/>x<text args="$file.previewHeight"/>

Below is the controller for upload.

public function execute()
{
    try {
        $result = $this->imageUploader->saveFileToTmpDir('contact');

        $result['cookie'] = [
            'name' => $this->_getSession()->getName(),
            'value' => $this->_getSession()->getSessionId(),
            'lifetime' => $this->_getSession()->getCookieLifetime(),
            'path' => $this->_getSession()->getCookiePath(),
            'domain' => $this->_getSession()->getCookieDomain(),
        ];
    } catch (\Exception $e) {
        $this->logger->critical($e);
        $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()];
    }
    return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData($result);

}

I can't figure out what's issue,
If i dump $_FILES at controller its showing data.
Anyone has idea what's missing in this ??
Thanks in Advance.


texts: magento2 recently viewed products collection is not working

texts:
I need magento2 recently viewed product collection I tried below code but not working

$_recentlyViewedProductCollection = $this->reportProductViewed->getItemsCollection();
        $_recentlyViewedProductCollection->addStoreFilter($this->getStoreId())
                                         ->setPageSize($this->getProductsCount()) // load 10 products
                                         ->load();

can anyone please help me.


texts: How to add css in themes default.xml blocks?

texts:
<referenceContainer name="header.container">
        <block class="Magento\Framework\View\Element\Template" name="test" before="-" template="Magento_Theme::html/header1.phtml">
               <arguments>
                    <argument name="css_class" xsi:type="string">header</argument>
                </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Links" name="top.links">
                </block>
    </referenceContainer>


texts: How to get Image type, file size and url?

texts:
is it possible to get Image filename and path, type (jpg,png etc) and file size(in bytes)?

In fact I need the same data that you get from an image upload form, but I need to retrieve them from already saved images using magento uploader.


texts:
I want to create a new order from an existing order (customer address, cart products...etc) with a button "copy", Is it possible ?

Edit :

1) Imagine you have :

Order n°10001
Customer name : Magento, email : magento@magento.fr ...etc
Customer products : computer ASUS , speakers...

Now you want to have exactly the same order with the same customer and the same products BUT with a different n° of order :

Order n°10002
Customer name : Magento, email : magento@magento.fr ...etc
Customer products : computer ASUS , speakers...

So, first question : Is it possible ?

2) If yes, how can i do this ? i just don't know how to begin to do this in fact...


texts:
I want to display the pig chart on the invoice grid and the pie chart should be updated after applying the filer in the grid.
Well, I am able to display the Pie chart on the sales order invoice grid with the help of layout/templates. But I am not able to update the chart by applying the filter because filter loads by UI component.
Any approach or idea?

Thanks


texts: Error while submitting Extension to Magento2

texts:
We have an extension released in Magento with version 1.3.1.

Now we are trying to upload the new extension with version 1.3.2.

This is our composer.json:

{

    "name": "celigo/magento2-netsuite-connector",
    "description": "A Magento 2 module for Celigo Magento2 NetSuite Connector",
    "type": "magento2-module",
    "version": "1.3.2",
    "license": [

    ],
    "require": {
        "php": "~5.6.5|7.0.2|7.0.4|~7.0.6",
        "magento/framework": "100.1.*"
    },
    "autoload": {
        "files": [ "registration.php" ],
        "psr-4": {
            "Celigo\Magento2NetSuiteConnector\": ""
        }
    }
}

On Technical Review i got this error:

Errors during installation

Please visit the Magento DevDocs guide in order to learn how to install extensions and use CLI.

Environment: Operating System - Centos 7, PHP Version - 7.0.23, Magento Platform - 2.1.9 CE

Command: composer require celigo/magento2-netsuite-connector:1.3.2'
Installation issue: Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1

The requested package celigo/magento2-netsuite-connector 1.3.2 exists as celigo/magento2-netsuite-connector[0.0.1, 1.1.0, 1.2.0, 1.3.0, 1.3.1] but these are rejected by your constraint.
Installation failed, reverting ./composer.json to its original content.
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[DockerOperationsPHP70Magento21CEVarnish] Running shell script

echo Failure
Failure

Why are they trying to install via composer if it does not exist in the composer via the command composer require celigo/magento2-netsuite-connector:1.3.2?

Can anyone please help me getting the extension submitted?


texts: Magento2 need to hide product images thumbnails from specific category

texts: Magento2 How Can I hide product images thumbnails & also with place holder thumbnails from specific category?


texts: How to make a callback option in Magento 2?

texts:
I want to implement a callback option on our Magento 2.3.2 site so that we can callback customer to fulfill their needs. How can I do that?

We want to include that option in footer under the option attached.

Could anyone please help me to implement that?


texts: Magento 2 duplicate product entry in default store view

texts:
In my magento2 store I only have one single store assigned to the default view and all the products in were in "all store view". So the store view column in the csv was blank.

But somehow someone changed the store view to default while editing the products and now we ended up with products with same sku but in a different view with different details. CSV looks like below:

Now, for these reason..everytime we put in a special price in the advanced pricing - we have to put that in both the views which is causing human error and costing time.

I tried to delete only the default store view sku via csv and both admin panel. From the admin panel it deletes the entire product - having to recreate that again. From CSV it shows success but doesn't have any impact at all.

As we now have many products like these are products customers have already placed an order for - I was wondering if someone can give me an idea on how to delete only the products in default store view without having to delete the entire product.

Thank you.!


texts:
I was wondering how long a deployment of Magento ECE was supposed to take. Everytime I push on Magento Cloud it takes 30 minutes at least. I wonder if that is "Magento normal" or not?

Apparently Magento ECE has a normal deployment duration: https://www.youtube.com/watch?v=mRu7D_aIF9c

Is there any way to increase this process speed ?


texts: Magento 2.4: show variant images of configurable product based on filter

texts:
i have configurable product on listing page with swatches enabled .
Configurable product has images swatches - Red , Green, Blue.
Not when i applied Color - filter as Red still images on Listing page -it still shows default configurable product image, instead it should show Red one image of one of Variant Product with Red image.


texts: Array of product ids for a given category (ignoring is_anchor)

texts:
When grabbing the product id's from a category where the is_anchor attribute is set we get the complete collection. Including products from underlying categories.

Question: How can we get a list/array of product id's for any given category id that has the is_anchor attribute set - where the collection contains only the real products from that category only (and not also products from underlying categories)

This is what we have to date. But I am sure this is not the fastest method.

$category = new Varien_Object(array('id'=>$_cat));
$positions = Mage::getResourceModel('catalog/category')->getProductsPosition($category);
$includeIDs = array_keys($positions);

Reference: Array of product ids for a given category (respecting is_anchor)


texts: Get access to $item->getNumberOfDownloadsUsed() function on Download.php

texts:
I need to get the number of downloads bought and used, that's two methods that are available on $item object. But I can't instance $item on the file that I'm working:

app/code/core/Mage/Downloadable/Helper/Download.php

On this file, I need to retrieve the number of boughts and used of the download purchased.

I'm also trying to get the order ID or at least the link hash to identify that number of boughts/used downloads with the unique id of the purchase.

For example, I try this:

Mage::getModel('downloadable/link_purchased_item')
            ->load($this->getOrderItem()->getOrder()->getId(), 'order_id');

But $this->getOrderItem() is not available on Download.php file. I was trying this:

Mage::getModel('downloadable/link_purchased_item')->getCollection()
            ->addFieldToFilter('order_item_id', $this->getOrderItem()->getId());

But obviously getOrderItem() is unavailable.

  Fatal error: Call to undefined method Mage_Downloadable_Helper_Download::getOrderItem() in /[...]/app/code/core/Mage/Downloadable/Helper/Download.php on line 135

But I'm able to use the customer singleton to retrieve client data like this:

$cliente = Mage::getSingleton('customer/session')->getCustomer();

So on this file I'm able to access others methods, but I'm unable to get the following details:

Number of downloads bought
Number of downloads used
Order ID or Link hash ID.

So please, I'm requesting how to get the current order instance and / or the current link instance, on the Download.php related with the file downloading.

Thank you!


texts: Use Simple Product Price in Backend Orders

texts: When creating an order in the Magento admin using a configurable product, is it possible to use the simple product price instead of the configurable product price ? I have found an extension for using the simple product price when placing an order in the front end but that functionality does not apply when placing an order in the admin.  Any help would be great!


texts: Paypal check customer email before review

texts:
I have created a custom Magento module to check banned customers coming from Paypal and I overridden returnfromPaypal function:

    public function returnFromPaypal($token)
{
    $this->_getApi();
    $this->_api->setToken($token)->callGetExpressCheckoutDetails();

    // import billing address
    $billingAddress = $this->_quote->getBillingAddress();
    $exportedBillingAddress = $this->_api->getExportedShippingAddress();

        foreach ($exportedBillingAddress->getExportedKeys() as $key) {

            if (array_key_exists($key, $dataOrg))
            {
                $billingAddress->setData($key, $dataOrg[$key]);

            }
        }
        $this->_quote->setBillingAddress($billingAddress);

    if( $this->isCustomerBanned( $this->_quote->getBillingAddress()->getEmail() ) )
        {
             Mage::throwException(Mage::helper('paypal')->__('Sorry!, We cant process you order this time.'));
        }
        else
        {
            parent::returnFromPaypal($token);

        }

}

But the problem is when the $billingAddress is saved for the first time in the quote $this->_quote->getBillingAddress()->getEmail() will be blank.

I want to know if there is another way to get customer email directly from $exportedBillingAddress I searched for documentation for it but nothing found.
Thanks in advance


texts:
After clicking in any category the page is not loading .Please find the below screenshot of the page.

Any body know why it is like this?


texts: Magento 2.3: Attribute swatch not working in category listing

texts:
In console i can see error:

  Uncaught TypeError: Cannot read property 'swatchImage' of undefined

In the code i can see the main div set like this:

Why is the swatch not displaying in category listing? The setting "Show swatched on product list" is enabled too yes.

Do I need to set any additional settings with the product?


texts: Magento 2 applying tax class on ALL product SQL query

texts: you can use SQL query for the update all product tax class and it will save your time, attribute id you can find from the attribute


texts: Implementing international multistore shop workflow

texts:
Under a single www.domain.com URL, I have to implement an international shop that does the following:

1) Identify the customer's country (Done)

2) Identify the customer's browser language (Done)

3) Match the browser language with a choice of implemented translations (about 10) and show the front end and store in that language. If not supported, fall back to English.

4) Load that customer's country specific listing (we have 180! Most are in dollars) and show it.

Any suggestions accepted!


texts: How to install an extension on a private Github using Composer?

texts:
I'd like to know how to install extensions on my Magento 2.1 using Github / Bitbucket / Gitlab with public and private repositories.

Thanks.


texts:
I am trying to extend the Mage_Catalog_Block_Product_View class in app/core/Mage/Catalog/Block/Product/View.php

To do that I declared a new module in app/etc/modules/Fkoessler_myProduct.xml:

<config>
  <modules>
    <Fkoessler_MyProduct>
      <active>true</active>
      <codepool>local</codepool>
    </Fkoessler_MyProduct>
  </modules>
</config>

I created a app/code/local/Fkoessler/MyProduct/Block/Product/View.php file:

<?php
class FKoessler_MyProduct_Block_Product_View extends Mage_Catalog_Block_Product_View
{
    protected function _prepareLayout(){}
}

and finally I created the app/code/local/Fkoessler/MyProduct/etc/config.xml file:

<config>
    <modules>
        <Fkoessler_MyProduct>
            <version>0.1</version>
        </Fkoessler_MyProduct>
    </modules>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <product_view>Fkoessler_MyProduct_Block_Product_View</product_view>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

However it doesn't seem to be taken into account: the product view page still uses the prepareLayout as defined in the Magento core class.

What am I doing wrong?


texts: Controller is working in admin side but adding Template or block not call or (display)?

texts:
add config file it display admin side as sub menu name (New Address)

<admin>
     <routers>
         <test>
            <use>admin</use>
            <args>
               <module>Pfay_Test</module>
               <frontName>admintest</frontName>
            </args>
         </test>
      </routers>
 </admin>
 <adminhtml>
   <layout>
      <updates>
          <test>
              <file>test.xml</file>
           </test>
      </updates>
   </layout>
   <menu>
      <test translate="title" module="adminhtml">
         <title>My Pugins</title>
         <sort_order>100</sort_order>
         <children>
             <set_time>
                   <title>Adress book</title>
                   <action>admintest/adminhtml_index</action>
              </set_time>
              <submenu translate="title" module="adminhtml">
                                        <title>New Address</title>
                                        <action>admintest/adminhtml_test/</action>
                                    </submenu>
          </children>
       </test>
    </menu>
</adminhtml>

Create controller file it's name is Test

class Pfay_Test_Adminhtml_TestController extends Mage_Adminhtml_Controller_Action
{
  public function indexAction()
  {

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

adding my layout file test.xml

<test_adminhtml_index_index_test>
     <reference name="content">
            <block type="test/monblock"  name="afficher_monbloc"
                  template="test/test2.phtml" />
                  <block type="test/adminhtml_grid" name="test" />
      </reference>
   </test_adminhtml_index_index_test>

Can You Please solve this?


texts: What is the best strategy to integrate WordPress inside of Magento?

texts:
I am looking for the best way to integrate WordPress inside of Magento.

First I would like WordPress to use the Header and Footer of Magento.

Second, I would like it to be possible for a user to search on Magento, and WordPress at the same time. And not be stuck. Having to search input.


texts: Buy X Get Y Free With auto add the same product in the cart

texts:
How to implement the custom functionality without extension i.e Buy X Get Y free. If customer buy the 2(X) quantity then the third (Y) will free and the third product will automatically add in the cart with the amount zero(Free product)

If the free extension are available for this( Buy X Get Y free) please share the link.

Am using magento 2.2.2