texts: Magento 2 - Get search query without temporary or virtual table

texts:
I was trying to debug the search query. Temporarily I changed the _getProductCollection method in vendor/magento/module-catalog-search/Block/Result.php .

I notice the query string contains some virtual memory tables like temp_db7..., search_tmp_5d9.. which do not exist in the database. Are there any ways to print the query without virtual tables or debugging processes to know what exactly returned from the database? Any help would be appreciated. Thank You.

SELECT `e`.*, `stock_status_index`.`stock_status` AS `is_salable`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e`
 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_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id='2'
 INNER JOIN `temp_db7f68ddb4b3ed1441588c3557b0c19a2835876f` AS `product_id_filter` ON `e`.`entity_id` = `product_id_filter`.`entity_id`
 INNER JOIN `search_tmp_5d96cbb832b505_33637111` AS `search_result` ON e.entity_id = search_result.entity_id WHERE (stock_status_index.stock_status = 1) ORDER BY `e`.`entity_id` DESC, `e`.`entity_id` ASC
 LIMIT 240


texts: You used BCP - Better Configurable Products for Magento 1.9.2.2 - 1.9.2.4?

texts:
Has anyone here tried to use Magento extension BCP - Better Configurable Products with Magento 1.9.2.2 or later? (Don't remember if links are discouraged. Sorry, if so.) The site at http://www.nr-apps.com/store/bcp-better-configurable-products.html shows it to be compatible with 1.9, but not higher. Sometimes developers don't keep up with compatibility, and these guys don't answer questions since it's a free extension.

It looks like it might be a good substitution for Matt Dean's SCP - SimpleConfigurableProducts extension, which they also claim on this site, if it works beyond 1.9.

Since it is a free item, which they encourage further development, is there anyone willing to test it and/or tweak it, if necessary, to ensure it works with 1.9.2.2 through 1.9.2.4?


texts: how can i restrict my module to use single url

texts:
Right now i am facing a problem. i have requirement to use a single url like test.html or test at one time. right now problem is that test is always true because it is module name. right now i  want if the use add the url suffix then  url test.html is active otherwise test. no direct access with test allowed. any help or any suggestion is welcome.
 i am using this code

Router.php

         $urlsuffix = Mage::helper('test')->getUrlSuffix();
         $identifier = trim($request->getPathInfo(), '/');

        if($urlsuffix!="")
        {
              $pos = strpos($identifier,$urlsuffix);
        }else {
             $pos=true;
        }
        if($identifier=='test' && $pos== true)
        {
            $request->setModuleName('test')
                ->setControllerName('index')
                ->setActionName('index');

        return true;

        }


texts: Display child categories in the top menu in magento 1.9

texts:
I need to display all the subcategories in the top menu navigation in my custom module.

From the below code i m getting only the categories in the menu.

public function getMenu2($_cats, &$menu, $text = '', $parent = 0){ print_r($hasChild);
    $hasChild = false;
    $w1 = 50; $h1 = 50;

    //Begin-Home page hover menu
    $_categories =  $this->getCategories();
    $_subcategories = $_category->getChildrenCategories();
    $menu2 = '
';
    $store_id = (int) Mage::app()->getStore()->getStoreId();
    foreach($_cats as $item)
    {
        $langtxt = $item->getLanguage();
        $langtxt = json_decode($langtxt, true);

        if($store_id && is_array($langtxt) && @$langtxt[$store_id]){
            $currentData = $langtxt[$store_id];
            foreach($currentData as $k => $v){
                if(!in_array($k, array('id' , 'filename' , 'category_id' , 'urlwrite'))) $item->setData($k, $v);
            }
        }
        //begin code change to disable categories in hover
        if($item->getParentid() == $parent && $item->getStatus()!=2){
        //end code change to disable categories in hover
            $hasChild = true;
            $menu .= $menu2;
            $menu2 = '';
            $menu .= '

                getTitle().'" href="'.$item->getLink().'">
                    getFilename().'" alt="'.$item->getTitle().'" />

                getLink().'" title="'.$item->getTitle().'">'.$text.$item->getTitle().'';
            //$this->getMenu2($_cats, $menu, $text, $item->getCategoryId());
            //End-Home page hover menu

            $menu .= '
';
        }
    }
    if($parent==0 || $hasChild){
        $menu .= '
';
    }
}

How to get the subcategories/child categories here??


texts: Loading payment methods goes to 504 error on admin side

texts: I am trying to load payment option on admin side on magento but it goes to 504 timeout error.I enabled the logs but didn't get any issue there.Other settings on admin side are working fine.What could be the reason that payment method link not loading ? Thanks i tried by enable the error reporting and logs but didn't get any error on logs.


texts: lamp stack localhost using vagrant - not getting any error messages in var/log for system.log or exception.log

texts:
It's a magento 12 ee build... I went into some core code and purposely changed a method for log exception purposes to see if i would throw and error. It broke my store (like i suspected) and i got the error message on the front end but it's not writing to my log.

System => Linux precise64 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64
Build Date => Apr 17 2015 15:09:58
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
Additional .ini files parsed => /etc/php5/cli/conf.d/00-ioncube.ini,

I just finished checking the permissions on the log folder and it's set to 755.

It's turned on = yes in system preferences of the admin panel.

public static function getVersionInfo()
    {
        return array(
            'major'     => '1',
            'minor'     => '12',
            'revision'  => '0',
            'patch'     => '2',

Any ideas?


texts:
I just saw in Report > Order count page, if choosing "show by month", it will show the merged row blanks.

How can I set the rowspan class by code?

Thanks!


texts: Magento : Add Orders Amount Column in Sales Tax report

texts:
I need to add new column in Reports > Sales > Tax. The column should render Total amount on which tax is implemented.
I've created a renderer but don't know how to fetch values in it.
There are two tables in database that seems to work for it.

1) tax_order_aggregated_created
2) tax_order_aggregated_updated

I think, I have to add join query in the getResourceCollectionName() but not sure, how it will work for the issue.

Override Mage_Adminhtml_Block_Report_Sales_Tax_Grid::_prepareColumns() and  add the following code.

$this->addColumn('taxtotal', array(
    'header' => Mage::helper('sales')->__('Tax Total'),
    'index' => 'taxtotal',
    'type' => 'string',
    'renderer'  => 'RLTS_GrandTotal_Block_Adminhtml_Sales_Order_Grid_Widget_Renderer_Taxtotal',
    'sortable'      => false,
));

and then add a renderer as follow

class RLTS_GrandTotal_Block_Adminhtml_Sales_Order_Grid_Widget_Renderer_Taxtotal
    extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    /**
     * @param Varien_Object $row
     * @return string
     */
    public function render(Varien_Object $row)
{
    $rate = $row->getData("percent");
    $numberOfOrders = $row->getData("orders_count");
    $taxAmount = $row->getData("tax_base_amount_sum");
    if($rate > 0 ){
        $finalPrice = ( $taxAmount * 100 ) / $rate;
        return Mage::helper('core')->currency($finalPrice, true, false) ;
    }

    return ' ';
}
}

it gives me the 'test' phrase successfully in new added column with label Tax Total. Now what I need to add return here that will gave me actual order's total.

Update:
Now I've sorted out a work around and add a column by calculating it with tax percentage and tax amount as follow.

public function render(Varien_Object $row)
    {
        $rate = $row->getData("percent");
        $numberOfOrders = $row->getData("orders_count");
        $taxAmount = $row->getData("tax_base_amount_sum");
        if($rate > 0 ){
            $finalPrice = ( $taxAmount * 100 ) / $rate;
            return Mage::helper('core')->currency($finalPrice, true, false) ;
        }

        return ' ';
    }

But I don't think it is the best way. It must be joined with probably sales_order table. Also with the above solution, I'm not able to add the total of newly added column.


texts: CE v1.9.3.4 (v2) did NOT fix the "Enable Form Key Validation On Checkout" Was released July 12,2017

texts:
@Ryan-hoerr YESTERDAY sent out message that there was v2 Patch or upgrade  to v1.9.3.4 from v1.9.3.3 because of the form_key checkout problem which the Magento CE 1.9.3.4 Release Notes was supposed to address.

"...changed how Magento validates form keys during the generic five-step checkout process. Previously, customer registration failed during standard checkout processing if form key authentication was enabled."

However after upgrading the v1.9.3.4 did NOT fix or change the checkout process issue Im seeing. i.e. when anyone tries to check out as Guests/ or Registration form still cant get past initial page for registration i.e. wont change pages and stays on page one on checkout with Enable Form Key Validation "On" at Checkout. It stays on same page and if set to 'no" will go through all 6 form pages but wont send form to PayPal. (Im using Standard PayPal checkout API).

It will take too long to wait for patch (v3?) and Im unable to have a single checkout on this live site. Read way too many comments that talked about other bugs, or other versions, mostly using hours and read through them all. So far there were no clear and specific answers or addressing this as a work around.

I just need the specific
1) path/location to fix this in V1.9.3.4 and

2) what specifically in the code that must be commented out (or added or whatever) so I can get this live site running again. If your guessing then please dont respond as there is a fix that does work (according to @Ryan-hoerr message who appears to have worked on it) That specific change to get it to work is what I do need. Thanks ahead of time for your help.

EDIT: to be clear I would like to NOT have to roll back to v.1.7.0.2 but will if no solution for this v1.9.3.4 checkout problem is presented that works. If v1.7.0.2 will still function with PayPal new security requirements started June 30 then that would be best option.


texts: Scheduled index not working / Products show after running manual index

texts:
I have a Magento CE 2.1 site. Products are not showing up until after a manual index is run.

Index is set to run on schedule.
Cron is running

*/1 * * * * php -f /path/to/Magento2.1CE/bin/magento cron:run  &> /dev/null
*/1 * * * * php -f /path/to/Magento2.1CE/update/cron.php &> /dev/null
*/1 * * * * php -f /path/to//Magento2.1CE/bin/magento setup:cron:run &> /dev/null

Tested it this way

php -f /path/to/Magento2.1CE/bin/magento cron:run

Ran jobs by schedule.


texts: magento dataflow profile product import bug

texts:
i imported product in magento via data flow profile, csv got uploaded , and i am able to see all product in admin but it not show in frontend , but when i edit that product in admin can click save with out making any changes product starts showing of frontend,

i searched lot but could not find any proper solution to this


texts: Magento 2.3 inline Edit ui component grid what's the use of "all in column" field?

texts:
I'm developing an admin grid for my custom module with the inlineEdit active instead of the usual edit link in action column.

The grid works fine and also the inlineEdit works as intended.

My only question is about the "all in column" field that appears when I'm in edit line mode.

I cannot understand what this field is for. If I write something in this field, the "save edits" button become disabled so I cannot save anything.

So what's this field for?


texts: Magento is not working after compilation

texts:
Initially, observers are not worked & I found that compilation is enabled.So I have used these steps to disable compilation.But no use.After using the third step.The site itself not working.
How to solve this issue?
Thank you in advance!

Steps I have followed:

1. Via Magento admin

Navigate to System > Tools > Compilation page and click on Disable button
Navigate to System > Cache Management screen and use Flush Cache button.

2. Via SFTP, by editing the includes/config.php file

To disable compilation in Magento, edit includes/config.php. At around line 28, uncomment the first line and comment out the second:

#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');

3. Via SSH

php -f shell/compiler.php -- disable
php -f shell/compiler.php -- clear

Reference links:
link


texts:
If a user forgets her password, she can request a new one which will be sent as plain text by mail. Is there a way (extension for example) to not send the password directly, but a password recovery link which is only valid for a certain amount of time?

Thanks!


texts: How to Go To previous Url with an Error from Observer in Magento 2

texts:
I am working on Magento 2 Extension i am trying to implement an event customer_save_before

What i want to do is.. if user email is from a domain like abc.com it should go to Previous URL with an error abc.com is Not Allowed


texts: Why the translation isn't working from XML file?

texts:
I'm using below code in my XML and translate it using translate.csv.

But it isn't working can anyone please help me?

<checkout_cart_index translate="label">
    <reference name="breadcrumbs">
        <action method="addCrumb">
            <crumbName>Beregn pris</crumbName>
            <crumbInfo>
                Beregn pris
                <title>Beregn pris</title>
                <link>/beregn-pris</link>
            </crumbInfo>
        </action>
        <action method="addCrumb" translate="label" module="checkout">
            <crumbName>Cart</crumbName>
            <crumbInfo>
                Indkøbskurv
                <title>Indkøbskurv</title>
            </crumbInfo>
        </action>
    </reference>
</checkout_cart_index>


texts: Varnish 4.1 + Turpentine : Varnish admin socket timeout

texts:
I have been trying for ages getting varnish + turpentine to work proper...
But turpentine keeps saying

  Error determining Varnish version: Varnish admin socket timeout. Failed to load configurator

and

  Error determining Varnish version: Failed to read response code from Varnish. Failed to load configurator

I dont know whats wrong.

My Nginx config:

upstream backend {
  # Varnish port – kan også være 80
  server 127.0.0.1:8081;
}

upstream website{
  server 127.0.0.1:9000;
}

server {
  listen 0.0.0.0:8;
  server_name website.dk;

 return 301 https://www.website.dk$request_uri;
}

server {
    listen        0.0.0.0:443 ssl;
    server_name   website.dk;

    ssl on;
    ssl_certificate /etc/ssl/www_website_dk.crt;
    ssl_certificate_key /etc/ssl/www_webite_dk.key;
    include /etc/nginx/ssl_common.conf;
    include /etc/nginx/location_common.conf;
}

server {
    listen 8080;

    server_name website.dk
    include /etc/nginx/common.d/top_common.conf;

    root /var/www/www.website.dk/deployed/current;

    index index.php;

    add_header Access-Control-Allow-Origin "https://website.dk";

    include /etc/nginx/common.d/locations.conf;

    location ~ \.php$ {
        include /etc/nginx/common.d/fcgi_common.conf;
        include fastcgi_params;
        fastcgi_param MAGE_RUN_CODE base;
        fastcgi_param MAGE_RUN_TYPE website;
        fastcgi_param  HTTPS on;
    }
}

My varnish.params:

RELOAD_VCL=1
VARNISH_VCL_CONF=/etc/varnish/default.vcl
VARNISH_LISTEN_PORT=8081
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
VARNISH_ADMIN_LISTEN_PORT=6082
VARNISH_SECRET_FILE=/etc/varnish/secret
VARNISH_STORAGE="malloc,256M"
VARNISH_USER=varnish
VARNISH_GROUP=varnish
DAEMON_OPTS="-p thread_pool_min=5 -p thread_pool_max=500 -p thread_pool_timeout=300 -p feature=+esi_disable_xml_check,+esi_ignore_other_elements \ -p vsl_reclen=4084 \ -p vcc_allow_inline_c=on \ -p vcc_allow_inline_c=on \ -p 'cc_command=exec cc -fpic -shared -Wl,-x -o %o %s -lcrypto -lssl' \ -p workspace_client=128k \ -p shm_reclen=4084"

Turpentine configuration (Varnish options):
Varnish version: 4.1.x
Server list: 127.0.0.1:8081

Turpentine configuration (Cache options):
Backend host: 172.20.252.8
Backend port: 8080

What am i doing wrong?


texts: Can i import theme variables to custom less file?

texts:
I want to add a variable that located in "web/css/source/_theme.less" to my custom less file, that I created specialy for home page. I added my less file in "Magento_CMS/layout/cms_index_index.xml"

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/home.css" />
    </head>
</page>

In this home file i wrote

@baseDir: '../';
@import 'source/_theme.less';
@import 'source/_home.less';

but it doesn't import variable from "_theme.less" to my "_home.less" file.


texts: How to load block class within other block in magento

texts:
I want to load my grid class within constructor method of other block.I try this peace of code but don't succeed.

`class Mymodule_Block_Adminhtml_Sales_Order_View_Tabs  extends
    Mage_Adminhtml_Block_Sales_Order_Abstract
        implements Mage_Adminhtml_Block_Widget_Tab_Interface
    {

        protected $_chat = null;

        protected function _construct()
        {
            parent::_construct();
               $class = Mage::getConfig()->getBlockClassName('mymodule/adminhtml_mymodule_edit_tab_tickethistory');
                $block = new $class;
               $block-> _prepareCollection();

        }
    } .

I can set phtml file here but my requirement is to load grid class.how can i do that ? Thanks in advance


texts:
/**
     * @return array
     */
    protected function getItems()
    {
        $items = [];
        foreach ($this->helper->getItemCollection() as $item) {
            $items[] = [
                'id' => $item->getId(),
                'product_url' => $this->productUrl->getUrl($item),
                'name' => $this->outputHelper->productAttribute($item, $item->getName(), 'name'),
                'image' => $this->outputHelper->getProductImageUrl($item),
                'remove_url' => $this->helper->getPostDataRemove($item),
            ];
        }
        return $items;
    }

$this->_itemCollection->addAttributeToSelect('image')->addUrlRewrite()->load();

<img data-bind="attr: {'src': image}"/>


texts:
I want to change City input to Select and populate its value or Alternative hide city input box and add Custom select and fill that option in City field
help me if anyone know.


texts: Magento 2: How to install custom module in app/code folder only using composer.json file?

texts:
I'm trying to install my custom module using composer.json file and after run
composer update command my custom module installed successfully in magento2.

Actually I want to install my custom module in app/code directory using composer.json and I have found some solution from dedicated developers and add extra section in my composer.json as following:

"extra": {
    "map": [
        [
            "*",
            "Gotham/Customimgattr"
        ]
    ]
}

Using the above code snippet my module added in app/code folder but also added in vendor directory. So anyone knows how to install custom module in app/code folder only not in vendor using composer.json file? Thanks in advance. My composer.json file:-

{
    "name": "myproject/mymodule",
    "description": "Upload Db Schema",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
     "require": {
        "php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
      },
      "type": "magento2-module",
      "version": "1.0.0",
      "extra": {
        "map": [
            [
                "*",
                "Gotham/Customimgattr"
            ]
        ]
      }
}


texts: Magento 2 how to upload image in order dispatch email

texts:
I want to upload the open package image that was taken through mobile, that we'll be able to upload in the complete order template email(shipment email).
the area from where we can be able to upload should be in the order detail page where tracking has entered or in the order processing area.


texts: How to resize image when click attribute on color swatches change image

texts:
In file list.html image when load page resize 230. but when i click attribute color. size images from 230px to 300px. how can resize images 300px -> 230px

< img id="product-collection-image-getId(); ?>"
src="helper('catalog/image')->init($_product, 'small_image')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(230);?>helper('catalog/image')->init($_product, 'small_image')->resize($ratio_width,$ratio_height); ?>" alt="stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"/>


texts: Magento Shipping Price calculation for back-end Edit Order

texts:
I am using Amsty shipping table rate extension for shipping rate calculation.

Also am using TinyBrick extension for back-end order edit.

Once i edit the order in back-end, some amount ($-Grand Total) will increase.
Now that time shipping rate is not changed for current amount ($-Grand Total)  its showing old shipping rate.

(I am edit the order in back-end, After submit that page that time,  i got $Grand Total, $country_id, $region_id, $postcode, $region, $city. How i calculate new shipping value for new grand total.)

How to fix this issue.

Please help me..


texts:
I found this sql query :

UPDATE IGNORE catalog_product_entity_varchar SET store_id =0 WHERE attribute_id = <my_attribute_id>

I replace "my_attribute_id by "Brand", where Brand is the attribute_id

so I am running following query :

UPDATE IGNORE catalog_product_entity_varchar SET store_id =0 WHERE attribute_id = <brand>

but i am getting following error :

#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 '<cost>' at line 1

please help me to find proper query.


texts: How to display all the products from a category in the homepage of magento?

texts:
{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="4" template="catalog/product/list.phtml"}}

That line of code lists up the products from the category id 4. But i want to display all the 48 products from the category id 4 on the homepage while in the other categories i want to display 20 items per page.

Note :

All my category pages are in list mode while the homepage featured category is in grid mode.


texts: Magento widget display wordpress home page

texts:
i am new to magento. Can you please help me to find a solution?

Inserted 3 widget in CMS -> Pages. I have to do display those widgets in home page.

I used this code

$aCmsPage = Mage::getModel('cms/page')->load('main-page', 'identifier');
echo $theContent = $aCmsPage->getContent();

but output was like this

{{widget type="meigeewidgets/featuredcategory" featured_category="category/5" template="meigee/meigeewidgets/slider.phtml" products_amount="15" slider_speed="1000" slider_displayslideqty="4" slider_moveslideqty="1" slider_easing="easeInQuad" widget_id="7646"}}

I have tried this code:
echo Mage::helper('cms')->getPageTemplateProcessor()->filter($theContent);

if i add menus in magento, it will display in wp

iam not getting answer still now pls anyone can help me


texts: What are "_controller" class conventions in our Custom Module PHP files

texts:
I just started working in Magento 2 , What is "_construct" mandate for

My question are
 1. When they are used (as in some files they are not there) ?

<?php
namespace Mycompany\Customerhomepage\Block;
use  Magento\Framework\View\Element\Template\Context;
use Magento\Framework\UrlInterface;
use Magento\Store\Model\StoreManagerInterface;

class Landing extends \Magento\Framework\View\Element\Template
{
    /**
     * @var \Mycompany\Customerhomepage\Model\landing
     */
    protected $_normCollectionFactory;

    /**
     * @var \Magento\Customer\Model\Session
     */
    protected $_customerSession;
    protected $_categoryRepository;
    protected $_urlInterface;
    protected $_storeManager;
    protected $_tableFactory;
    protected $_attributeRepository;
    protected $_attributeValues;

    /**
     * @param Context $context
     * @param StoreManagerInterface $storeManager
     * @param \Mycompany\Customerhomepage\Model\landing $_normCollectionFactory
     * @param \Magento\Customer\Model\Session $_customerSession
     * @param \Magento\Catalog\Model\CategoryRepository $_categoryRepository
     * @param \Magento\Eav\Model\Entity\Attribute\Source\TableFactory $_tableFactory
     * @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $_attributeRepository
     * @param array $data

     */
    public function __construct(
        Context $context,
        StoreManagerInterface $storeManager,
        \Mycompany\Customerhomepage\Model\landing $_normCollectionFactory,
        \Magento\Customer\Model\Session $_customerSession,
        \Magento\Catalog\Model\CategoryRepository $_categoryRepository,
        \Magento\Eav\Model\Entity\Attribute\Source\TableFactory $_tableFactory,
        \Magento\Catalog\Api\ProductAttributeRepositoryInterface $_attributeRepository,
        array $data = []

    )
    {
        $this->_normCollectionFactory = $_normCollectionFactory;
        $this->_customerSession = $_customerSession;
        $this->_categoryFactory = $_categoryRepository;
        $this->_storeManager = $storeManager;
        $this->_tableFactory = $_tableFactory;
        $this->_attributeRepository = $_attributeRepository;

        parent::__construct($context);
    }

What is significance of \Magento\Eav\Model\Entity\Attribute\Source\TableFactory $_tableFactory in above code
what is significance of array $data = []
Why this is done 'this->_tableFactory = $_tableFactory;'
what is use for this parent::__construct($context); , when is had to extend product_list class i had to pass all the same variable that was in product_list to my class constructor like this parent::__construct($context,$postDataHelper,$layerResolver,$categoryRepository,$urlHelper); , why that so ?

I would be happy even if direct me to some articles to read , as i was not sure what to search for (I thought it was DI but i guess it was just half of it )


texts: Searching for orders that do not exist takes several minutes to finally show 0 results in admin backend

texts:
We're running Magento 2.1.5 CE, and I have a very specific speed issue with the Admin Backend.  My frontend responds very quickly, and MOST of the admin backend is very fast as well, but with one exception: If I search in Orders for something that cannot be found, the search takes several minutes to complete and show me that there are no matches. If I search for something that can be found, the results appear in just a second or 2.

I've made a video that shows exactly what I'm talking about, which can be viewed here: Video Demonstrating The Problem.

Can anyone offer some help for how to speed this up?


texts: Magento CE 2.0 Index Management Always Processing

texts:
How to fix Magento 2.0 Index Management stuck at processing state?

There's no var/lock to delete inside Magento 2 root directory, so old ways to fix this are obsolete.

Forcing with these new CLI didn't work either:

sudo -u www-data php /var/www/html/magento2/bin/magento cache:flush
sudo -u www-data php /var/www/html/magento2/bin/magento indexer:reindex


texts: keeping customers logged in after deleting var/session in magento

texts:
we are facing some problem in live site as below link.

For my knowledge if we delete var/session folder, than we have to login to both frontend and backend .

To solve this problem : Live site blank in frontend or keep on loading and never load we have to delete the session folder again and again. is there any way if we delete session folder also , we can keep our customers logged in for the site?


texts: Use Turpentine in a mutliple Magento sites

texts:
I have a server with two Magento websites and a Varnish instance.
They are using different domain names.

I setup the first website and the cache works well.
In the second website, instead, cache not works.

I read that Turpentine didn't support multiple backend.
In the release 0.6.7. Turpentine supports them?

Thanks


texts: What is the direct URL for Magento 1.9.2.2

texts:
Trying to retrieve CE 1.9.2.2 directly via ssh however
wget http://www.magentocommerce.com/downloads/assets/1.9.2.2/magento-1.9.2.2.tar.gz
is returning a not found


texts: Receiving error message "Enterprise_Pci requires module Mage_Api"

texts:
I've managed to fix the previous

  error processing your request

and had the dev site running again. The following day, I was preparing myself to run some tests but couldn't because of the error message is back.

This time, error is different and I don't  understand what the issue is now.

  a:4:{i:0;s:51:"Module "Enterprise_Pci" requires module
  "Mage_Api".";i:1;s:926:"#0
  /chroot/home/vpwindow/dev.mossyoakgraphics.com/html/app/code/core/Mage/Core/Model/Config.php(849):
  Mage::throwException('Module "Enterpr...')

Note: I can not access the admin side either.

Greatly appreciate any help!


texts: Magento 2: Which event fires when I reorder from admin side?

texts:
I have activated reorder on my magento 2 site. Now I want a event which can catch reorder both in frontend and backend (admin). I am using "controller_action_predispatch_sales_order_reorder" for my front end which is working perfectly fine but I want to catch reorder on the backend as well. Can anyone tell me which event to use for backend as "controller_action_predispatch_adminhtml_sales_order_create_reorder" is not working for backend?
Here is my code:
Event file
app/code/VoltLighting/OrderInfo/etc/adminhtml/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="controller_action_predispatch_adminhtml_sales_order_create_reorder">
    <observer name="admin_reorder_observer" instance="VoltLighting\OrderInfo\Observer\AdminReorder" />
</event>

<event name="checkout_submit_all_after">
    <observer name="admin_order_observer" instance="VoltLighting\OrderInfo\Observer\AdminOrder" />
</event>

Observer file
app/code/VoltLighting/OrderInfo/Observer/AdminReorder.php
<?php
namespace VoltLighting\OrderInfo\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class AdminReorder implements ObserverInterface
{

    public function execute(Observer $observer)
    {
        $order= $observer->getEvent();

        echo "hello world";
        exit;

    }
}


texts: magento 2 change page title on registration page

texts:
On the customer registration page, I need to change the page title depending on the condition.
In my custom module I try extend \Magento\Customer\Block\Form\Register
method protected function _prepareLayout(). My code is:

namespace Dv\RegistrationNotify\Block\Customer\Block\Form;
class Register extends \Magento\Customer\Block\Form\Register
{
    protected function _prepareLayout()
    {
        if(my condition){
            $this->pageConfig->getTitle()->set(__('Custom title Create New Customer Account'));
        } else {
            $this->pageConfig->getTitle()->set(__('Create New Customer Account'));
        }
        return parent::_prepareLayout();
    }
}

in di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Customer\Block\Form\Register" type="Dv\RegistrationNotify\Block\Customer\Block\Form\Register" />
</config>

But in result title doesn't change and page is empty

How can I change the title depending on the condition ?


texts: How to set different currency symbol according to website currency in multi-website on admin product edit page in magento 2.3.2

texts: I have 2 website A And B with Currency CA and CB and I did all configuration For currency setup and currency rate, But on admin product edit page, it's still showing 'CA' Currency for both website product.


texts: How to add product to customer cart in magento2 programmatically

texts:
Everything works well, but it adds for all by default, but I need it added for a specific customer, regardless of whether it’s active at the moment or not, I have a customer ID, but how can i add  product to his card ?

    ...
    \Magento\Checkout\Model\Cart $cart,
    \Magento\Catalog\Model\ProductRepository $productRepository,
    \Magento\Quote\Model\QuoteRepository $quoteRepository,

    ...
    $this->_cart = $cart;
    $this->_productRepository = $productRepository;
    $this->_quoteRepository = $quoteRepository;

    ...

public function autoAddToCart(){

  ....

try {
    $data = [
        'qty' => $products_count,
        'product' => $products_id,
        'bundle_option' => $selectionProds
         ];
     $this->_cart->addProduct($_product,$data);
     $this->_cart->save();
     $cartId = $this->_cart->getQuote()->getId();
     $quote = $this->_quoteRepository->getActive($cartId);
     $this->_quoteRepository->save($quote);
     $quote->collectTotals();
      }
      catch(\Exception $e) {
           echo  $e->getMessage();
      }


texts: Item has $0.00 price in cart when creating an order programmatically

texts:
So, I am trying to create an order programmatically in Magento 1.12 EE.  I can load the a product and see that the price property holds the correct value.  When I add the item to the cart, the price changes to $0.00.  Here's the script I'm using:

$customer = Mage::getModel('customer/customer');
$customAddress = ...;
//set customer data and log in customer, left out for this post

$checkout_session = Mage::getSingleton('checkout/session');
$quote = $checkout_session->getQuote();

$checkout_session->getQuote()
    ->setBillingAddress(Mage::getSingleton('sales/quote_address')
    ->importCustomerAddress($customAddress));

$product = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToFilter('entity_id', '634887')
    ->addAttributeToSelect('*')
    ->getFirstItem();

echo "product price: " . $product->getPrice() . "
";
//prints correct price

$pid = $product->getId();
$product->load($pid);

$cart = Mage::getSingleton('checkout/cart');
$cart->truncate();
$cart->save();
$cart->getItems()->clear()->save();

try {
    $cart->addProduct($product->getId(), array('qty'=>1));
    $cart->save();
    print "product added
";
}
catch (Exception $ex) {
    echo "product error " . $ex->getMessage() . "
";
}

$cart_grand_total = $cart->getQuote()->getGrandTotal();
$quote_grand_total = $quote->getGrandTotal();
$cart_items = $cart->getItems()->getData();
$quote_data = $quote->getData();

echo "CART GRAND TOTAL
";
var_dump($cart_grand_total);
//returns 0

echo "CHECKOUT SESSION QUOTE GRAND TOTAL
";
var_dump($quote_grand_total);
//returns 0

echo "CART ITEMS DUMP
";
var_dump($cart_items);
//shows item price as 0.00

echo "CHECKOUT SESSION QUOTE DATA DUMP
";
var_dump($quote_data);
//shows grand total = 0

Any ideas as to why the item goes from correct price before being added to the cart, then becomes $0.00 price when it is in the cart?

Thanks in advance for any help.


texts: Odd varnish behavior after saving a product. Hit idle send timeout

texts:
Magento 2.2.6, varnish 5.2.1.  I'm on a product page, hit it twice to get a cache hit.  Then I update the product from the back end and hit refresh on the product.  The page will load fairly quickly (faster than the idle send timeout value) and show a cache hit.  But I know that isn't correct since it has been purged from varnish on the save.  While watching the varnish logs I see that there are actually two requests for the product page.  The first is a cache miss but shows this debug message
-   Debug          "Hit idle send timeout, wrote = 32768/794307; retrying"
-   Debug          "Write error, retval = -1, len = 761539, errno = Broken pipe"

The second entry in the log shows the cache hit which is what I'm seeing in the browser.
Another odd thing is that the first wrote value in the debug message, 32768, is always the same.  I've tried adding all kinds of varnish start up values for:
http_resp_hdr_len
http_resp_size
http_req_hdr_len
http_req_size
idle_send_timeout
workspace_client
workspace_backend
gzip_buffer
http_max_hdr
Checking param.show shows me that the values I'm setting are taking effect. Bur nothing seems to help.  And I've tried on other product pages as well.  It's the same scenario and the same wrote value.  Where else should I look?


texts: Magento2 : customer_account_create event is not triggering

texts:
I have created a custom module, and added event in etc/events.xml as below :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="customer_account_create">
        <observer name="customizecustomer_accountcreate" instance="Module\Custom\Model\Accountcreate" shared="false" />
    </event>
</config>

And created a file Model/Accountcreate.php as below :

namespace Module\Custom\Model;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

class Accountcreate implements ObserverInterface
{

    public function execute(Observer $observer)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/customer.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('Accountcreate'); // to check if event is working or not

    }
}

Also executed below commands :

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

But when I'm trying to register as customer the event is not calling.

I want to add some server side validation on customer account create.

Am I doing anything wrong? Is there any another event which trigger before account create?


texts: exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Producttabs_Block_Producttabs'

texts:
I'm getting the following errors in my exception.log:

2015-09-04T04:26:55+00:00 ERR (3):  exception 'Mage_Core_Exception' with message 'Tipo de bloco inválido: Mage_Producttabs_Block_Producttabs' in /home/my.websiteaddress.com/public_html/app/Mage.php:595 Stack trace: 0 /home/my.websiteaddress.com/public_html/includes/src/__default.php(28247): Mage::throwException('Tipo de bloco i...') 1 /home/my.websiteaddress.com/public_html/includes/src/__default.php(28189): Mage_Core_Model_Layout->_getBlockInstance('producttabs/pro...', Array) 2 /home/my.websiteaddress.com/public_html/includes/src/__default.php(27367): Mage_Core_Model_Layout->createBlock('producttabs/pro...', NULL, Array) 3 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array) 4 /home/my.websiteaddress.com/public_html/includes/src/__default.php(27037): call_user_func(Array, Array) 5 /home/my.websiteaddress.com/public_html/includes/src/__default.php(27746): Varien_Filter_Template->filter('
filter('
_toHtml() 8 /home/my.websiteaddress.com/public_html/includes/src/__default.php(2331): Mage_Core_Block_Abstract->toHtml() 9 /home/my.websiteaddress.com/public_html/includes/src/__default.php(2271): Mage_Core_Block_Abstract->_getChildHtml('cms_page', true) ...

So my question is, where can I find to add in the module name for this?


texts: How to create custom reports in Magento2?

texts:
Now the real question
I need to create custom reports based on conditions.

Sales Report
Marketing Report
Customer Report
Product Report

.  Example:

Conditions:

How  many products or list of products which sold more than 200 times.
I need to show it graphically in Charts (comparision,pie) e.g https://google-developers.appspot.com/chart/

I have already develop extension how can I use google charts ?


texts:
I'm trying to display a history of customer's orders by products. I succeeded to display every product ordered with its date, name, price, sku and quantity. But now I'd like to display it by at least one criteria: the date.

The purpose is to offer the customer a list of his purchases per month.
How could I do it? Right now, I have done this in history.phtml file:

<?php
    if (Mage::getSingleton('customer/session')->isLoggedIn()) {

        $orders= Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id',Mage::getSingleton('customer/session')->getCustomer()->getId());

            ?>

                Produit
                Référence
                Date
                Prix
                Quantités

            <?php
            foreach($orders as $eachOrder) {
                $order = Mage::getModel("sales/order")->load($eachOrder->getId());

                $items = $order->getAllVisibleItems();
                $i = 0;

                foreach($items as $item): ?>

                    <?php
                        echo "" . $item->getData()['name'] . "	";
                        echo "" . $item->getData()['sku'] . "	";
                        echo "" . $this->formatDate($item->getData()['created_at']) . "	";
                        echo "" . $item->getData()['price'] . "	";
                        echo "" . intval($item->getData()['qty_ordered']) . "	";
                    ?>

                <?php endforeach;
            }
    }

             ?>

EDIT
I edited my code and now I can sort my orders by month by adding a new attribute: addAttributeToFilter('created_at', array('like' => date('Y') . '-10-%');

But I still don't know how to create a dropdown list to select the month and then refresh to sort products with the chosen month.
Thank you!


texts:
I'm trying to display a little carousel in the top navigation, the .phtml file calls a static-block which calls a block:

{{block type="catalog/product_list" category_id="12" template="catalog/product/featured-products.phtml"}}

It works fine in homepage and category pages, but it fails to display this block in the product-view pages.
Do you know why this is happening?.

Thanks
.-


texts: Category order does not work, always sort by the entity_id desc

texts:
I have a problem with my categories, and I don´t know if this is normal or not.

In Magento 2.2.2 I created a custom attribute, and added it for sorting attributes. But when I tried to order product list with this attributes, they didn´t move. I create a observer to listen catalog_product_collection_load_after event, to get the collection query:

$productCollection = $observer->getEvent()->getCollection();
$select  = $productCollection->getSelect()->assemble();
echo $productCollection->getSelect()->__toString();

And I saw that in the ORDER BY part of the query, it is not only ordered by my custom attribute:

... ORDER BY `e`.`entity_id` DESC, `equipo_original` DESC LIMIT 9

equipo_original is my custom attribute, but the query is sorting first to entity_id (and always desc) and in second place with my attribute. I tried with name and position, and result was the same:

... ORDER BY `e`.`entity_id` DESC, `cat_index`.`position` DESC LIMIT 9

... ORDER BY `e`.`entity_id` DESC, `name` DESC LIMIT 9

And both didn't order product correctly. Ony works with price:

... ORDER BY `price_index`.`min_price` desc, `e`.`entity_id` DESC LIMIT 9

What coul it be? How can I resolve this problem?

Thanks!

UPDATE: After some research in Magento code, I detected that the entity_id field is added to ORDER BY segment in Magento\CatalogSearch\Model\ResourceModel\Fulltext::_renderFiltersBefore, exactly here:

/**
     * @inheritdoc
     */
    protected function _renderFiltersBefore()
    {
        ...

        /*
         * This order is required to force search results be the same
         * for the same requests and products with the same relevance
         * NOTE: this does not replace existing orders but ADDs one more
         */
        $this->setOrder('entity_id');

        return parent::_renderFiltersBefore();
    }

This code segment is only in Magento 2.2.2, I don´t know if is present in 2.2.1 or 2.2.0 but is not in 2.1.7 at least.

Anyway, the comment says that "this does not replace existing orders but ADDs one more", but the true is that this order field is added BEFORE my main order field (before name, before position, before my custom attribute). So, I guess this function is running before the chosen field is added, and therefore it first ordered by the entity_id. But here my question would be: is this normal and then would it be a Magento bug? Or is it not something normal and then could there be something at code level, either of the theme or of some extension, that is causing it?

What do you think? What could I check next?


texts: how to column and show in one from field admin panel

texts:
I an facing this problem the data is save in two different column. date and time for adding it is working but in edit how to combine these two field and show values in edit from.

for adding i am doing.

$start_date = date("Y-m-d",strtotime($data['start_datetime']));
$start_time = date("H:i:s",strtotime($data['start_datetime']));

thanks in advanced


texts: Magento 2.1 admin logged in issue in session

texts:
If I logged in admin side by chrome.then if when I logged-in successfully in Mozilla for same magento instance in magento2.1 then I automatically log out in chrome and throw message Someone logged into this account from another device or browser. Your current session is terminated.

Why does this happen in Magento 2.1?


texts: Magento 2 custom route 404 without index.php

texts:
I have created a new module with my custom route. The frontname for my module is vendor and the id is vendor

I have created a page with route vendor/index/index, created a controller and block for my page. I have also created a layout file with name frontend/layout/vendor_index_index.xml

But when I try to access my page on frontend with url vendor or vendor/index/index it shows me 404 page. The page works if I use index.php/vendor or index.php/vendor/index/index

I am not sure about the issue as I have other modules with custom routes and they work perfectly fine without index.php.

I have checked and made sure that I have URL rewrite enabled in my configuration. Did anyone face any issue like this? What could be the reason and the solution for the issue?


texts: Magento 2: How to change Tabs to simple order?

texts:
I want to change the detail tabs in the product view page like a simple order.

Description

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim.

More Information

Activity    Gym, Athletic

Material    Metal, Rubber, Silicone

Gender  Women

Category    Electronic, Exercise, Timepiece

How to change below tabs in simple order as defined above.


texts:
I need to pass customer information to WordPress before s/he logout from Magento Automatically before session expired.

Which Observer event I need to use to resolved this issue?


texts: JoinField Show error same id is already exists

texts:
We want to change below line:

->joinField('store_credit','kartparadigm_storecredit_creditinfo','total_credits', 'c_id=entity_id', null, 'left');

with this one:

->joinField('store_credit','kartparadigm_storecredit_creditinfo','total_credits', 't_id =(SELECT t_id FROM `kartparadigm_storecredit_creditinfo` WHERE c_id = e.entity_id ORDER BY action_date DESC LIMIT 1)', 'null', 'left');

Can anyone Please suggest me how to solve this error.


texts: How to Configure Notification for New Admin User Created

texts:
With the recent release of Magento 1.9.3.10 in September 2018, there is a new option to send an email notification when a new admin account is created. I can't seem to find any documentation on this.

I have found where I can enable or disable this functionality at Configuration > Advanced > Admin > Security > New Admin User Create Notification

After enabling the option, I cleared cache and then created a new admin user. We have multiple admins created, but none of them received any notifications.

How does Magento determine the email address it uses to send this new
notification?
I couldn't find anywhere that I could configure this, did I miss
something?


texts: Magento Search option shows irrelevant suggestions dropdown list

texts: When i search a particular products the search bar shows some irrelevant suggestion in a drop down as you can see in image.It shows that products categories which doesn't exist in my store. i don't want these suggestion drop down list. Please tell me a solution to remove this dropdown list. Thanks


texts:
We are trying to implement JSPDF on our product pages.  We have created a module to load the JS on these pages but we are coming up short.  We are getting constructor errors or not defined errors based on variations on implementation.

We have tried the following:
How to add JS library to Magento 2?

Currently we have this deployed unsuccessfully and are interested in learning what we can do to resolve the constructor errors and begin using JSPDF within our magento 2 installation.

  app/code/VENDOR/JSpdf/view/frontend/requirejs-config.js

var config ={
paths:{
    'jSpdf': 'VENDOR_JSpdf/js/jspdf.min'
},
shim:{
    jSpdf :{
        deps: ['jquery']
    }
}
};

  app/code/VENDOR/JSpdf/view/frontend/templates/jspdf_index_index.phtml

Run Code!!!

        Page Heading - Nothing More To See Here

The reason for defining the pdf function outside of require is found and outlined here:
Magento2 : how to load and execute third party .js

Also this is another resource which we found useful but could not implement
https://github.com/mrdoob/three.js/issues/9602

Any advice on mixing non AMD and AMD modules within Magento 2 would be very welcomed.


texts:
I am using Marketplace in my website. In here seller can able to Process the order. I given below the code

public function shipementorderAction(){
                $id = $this->getRequest()->getParam('id');

                $order = Mage::getModel('sales/order')->load($id);
                $order->setData('state', 'shipement');
                $order->setStatus('shipement');
                $history = $order->addStatusHistoryComment('', false);
                $history->setIsCustomerNotified(false);
                $order->save();

                $order->sendOrderUpdateEmail(true, null);

                $this->_getSession()->addSuccess(
                    $this->__('The order state has been changed.')
                );

                Mage::getSingleton('core/session') ->addSuccess('Order Updated Successfully'); $this->_redirectReferer();

                }

I used this code to send a email to customer

$order->sendOrderUpdateEmail(true, null);

How to send copy of email to that current seller? Like customer got a order status mail as well as seller also got copy of same mail


texts: Magento Move billing address below shipping address in checkout

texts:
I want to move the billing address form below the shipping address in the checkout, on the first page/step.

I created a custom module like tigren method https://www.tigren.com/billing-under-shipping-address-m2/

It all works fine, but when I press the place order button and want to complete the order I get the following error message:

"please check the billing address information. regionid is required."

So the billing address is not transferred, who can help me?


texts:
I'm getting corrupted urls in enterprise_url_rewrite that look like this:

category/subcategory.html-274

Note, the number is after the suffix. When I reindex the url_redirect process, the number increments to 275.

Any body have any idea?


texts: Add custom block in Magento 2 admin dashboard

texts:
Is there any way to add a custom block in magento 2 admin dashboard? I have a requirement to add custom table in dashboard. Can anyone help me?

My current magento version 2.2.1


texts: Which version of Solr does Magento EE 1.14.3.2 support out of the box? Is it still 3.6.2?


texts:
I changed the password of my Magento backend.
Too many people knew the password so I changed it.

I wanted to install magento extension notification bar in the Magento Connect Manager.
After the installation Magento went into maintenance mode
Then I deleted the maintenance flag and after that I am gettting the 404 error.

what to do? i cant login to the admin area and also i get the error on all pages

need your help.


texts: In Magento 2.3, How to add custom error code with response

texts:
In Magento 2.3, How to add custom error code along with response.
For example,
If I add the code as below, I am getting this below response:

  throw new InvalidEmailOrPasswordException(__('Invalid login or
  password.'), null, 900)

"message": "Invalid login or password.",
    "code": 900,
    "trace": "#0 [internal function]

But this is only accepting integer(900), not any characters. Is any poosibility to add this characters in the code.
Thanks in Advance.


texts: Magento2: How to show subtotal in minicart

texts:
I'm trying to show subtotal in minicart block. I've overridden minicart.phtml in my theme and added the below code:

Its showing subtotal on page refresh. But when I add product in the cart the amount doesn't load by Ajax.

Can anyone help me in this?

Thanks in advance.


texts: Force In Store Pickup based on product attribute

texts:
For regulatory reasons, some of our products must be shipped to an authorized receiver. We have a list of a few thousand authorized receivers.  Those items have a serial number and are closely tracked.  Sadly, when we ship non-tracked items to those authorized receivers, they rarely make it to the customer.
So, in the checkout process, we want to check for products with an assigned attribute, "restricted_shipping"
If the customer has such items in their cart, they will be required to use something like a store locator to select the shipping destination of the restricted items, AND enter the desired shipping address for any non-restricted items that tend to "fall off the truck" when sent to authorized receivers.
Shipping to the authorized receiver would be free, shipping of non-restricted items would be subject to the existing shipping methods, i.e. UPS, USPS ect.
We've looked at this from several angles, but I've yet to determine the best approach. I'd value insight on the different ways other developers would skin this cat.
Thanks!


texts: Magento 1: Load failed with status 404 for script ‘https://mywebsite/sp-push-worker.js

texts:
I'm getting this error message, why this is coming nowadays suddenly I didn't understand.
Error:
Failed to register/update a ServiceWorker for scope ‘https://mywebsite/’: Load failed with status 404 for script ‘https://mywebsite/sp-push-worker.js’


texts:
I am stuck in a situation where I can't edit/create any new customers using the backend in magento.
The requirement was simple: Create some customer attributes, so I installed this extension to do the job.
It seems to add the attributes that I created using the customer attributes section from the backend but after that I can't access the customers section from the backend.
Everytime I try it gives me this error
Fatal error: Call to a member function addCustomerIdFilter() on a non-object in xxxxx\app\code\core\Mage\Adminhtml\Block\Customer\Edit\Tab\View\Accordion.php on line 74
I tried everything including un-installing the extension but it doesn't help.
Please can anyone guide me how to solve this?


texts: Downloadable product on Magento 2.3.1 out of stock issue

texts:
I'm issuing a problem with newly created downloadable products on Magento 2.3.1

This store contains about 10k products (phisical and digital) imported from M1

Phisical in stock/out of stock is working both for imported and native products
Digital in stock/out of stock is working only for M1 imported products.

I compared the records of 2 digital products (1 imported and 1 native) in all %stock% database tables and the only strange things I noticed is that:

M2 native downloadable product has several records on cataloginventory_stock_cl table
M2 imported downloadable product has no records on cataloginventory_stock_cl table

What is the use of cataloginventory_stock_cl table?

There are other places where I can find to debug this problem?


texts: error on magento 2 after update php 5 to 7, Warning: require(/var/www/html/vendor/magento/framework/registration.php):?

texts:
Error on Magento 2 after update from PHP 5 to PHP 7:

Warning: require(/var/www/html/vendor/magento/framework/registration.php): failed to open stream: No such file or directory in /var/www/html/vendor/composer/autoload_real.php on line 60
Fatal error: require(): Failed opening required '/var/www/html/vendor/magento/framework/registration.php' (include_path='/var/www/html/vendor/phpseclib/phpseclib/phpseclib:/var/www/html/vendor/magento/zendframework1/library:/var/www/html/vendor/phpunit/php-file-iterator:/var/www/html/vendor/phpunit/phpunit:/var/www/html/vendor/symfony/yaml:.:/usr/share/php') in /var/www/html/vendor/composer/autoload_real.php on line 60

Any help?


texts: Migrate category and product urls from magento 1 to magento 2

texts:
How to migrate only category and product urls from magento 1 database to magento 2.

I am using magento 2.2.6

Thanks
Pradeep


texts: plugin to stop redirecting to cart from checkout

texts:
In M2 if the user tries to go to the checkout without any items in their cart the Magento\Checkout\Controller\Index\Index::execute() function redirects them to the cart.

if (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {
    return $this->resultRedirectFactory->create()->setPath('checkout/cart');
}

I would like to change this behaviour and enable them to move directly to the checkout. (in the module I've created they can add a product to the cart from checkout).

I've tried doing this with the below Plugin Interceptor after method, but it gives a ERR_TOO_MANY_REDIRECTS error in my browser.

public function afterExecute(
    \Magento\Checkout\Controller\Index\Index $subject,
    $result
) {

    $result->setPath('checkout');
    return $result;
}

Any idea, how I can do this.


texts: Layered navigation in phtml, custom product collection

texts:
I'm attempting to show a list of products with layered navigation filters through a phtml. This template is used on a CMS page.
I am able to output the list of products with the custom product collection assigned. The layered navigation filters also output, but without the custom collection assigned, once the toHtml() method is called for the layered navigation block, it loses the custom product collection and it just shows the filters for the root category. However  I can see in the debugger that the collection is there in the layer before toHtml().
$listProduct = $this->getLayout()->createBlock("Workspace\Widgets\Block\Product\CustomList")
->setTemplate("Magento_Catalog::product/list.phtml");

$om = \Magento\Framework\App\ObjectManager::getInstance();

$layer = $om->create('Workspace\Widgets\Block\LayeredNavigation\Layer');

$layeredNav = $this->getLayout()->createBlock("Workspace\Widgets\Block\LayeredNavigation\Navigation")
    ->setTemplate("Workspace_Widgets::layer/view.phtml");
$state = $this->getLayout()->createBlock("Workspace\Widgets\Block\LayeredNavigation\State")
    ->setTemplate("Workspace_Widgets::layer/state.phtml");
$filterRenderer = $this->getLayout()->createBlock("Workspace\Widgets\Block\LayeredNavigation\FilterRenderer")
    ->setTemplate("Workspace_Widgets::layer/filter.phtml");

$layer->setPromoCollection($prodsManufacturer);

$layeredNav->setLayer($layer);

$layeredNav->setChild('state', $state);
$layeredNav->setChild('renderer', $filterRenderer);

$listProduct->setCollection($layer->getProductCollection());

echo $layeredNav->toHtml();
echo $listProduct->toHtml();

Any idea on how to achieve this?


texts: How to change product price calculation?

texts:
I would like to add an additional fee to a product. This fee will then be calculated on top of the product's price. So in the catalog the regular product price will be displayed, and in the cart/checkout/emails/etc the price+addedfee will be displayed.
Any specials or discounts will have to apply to the product's price only, and not the additional fee.

so basically I want the final price to be:

price = (magentos-calculated-product-price) + added-fee + tax-over-both

and in the cart I want to display for each item:

name | amount | unit price | added fee | subtotal

I know how to create a custom product attribute and how to sync that attribute to a quote and then an order. Also, editing the templates is not a problem.

What I would like to know is how and where should I do the price calculation? Should I use an event (which one?) or should I overwrite a core model?

There seem to be many different ways to accomplish this, and I don't want to break discount calculation or admin functionality.


texts: Nginx and Magento 1.13 running URL migration script

texts:
I have to upgrade to 1.14 from 1.11 and have to go through 1.13, and the long url_migration_to_1_13.php script.

The website is running on NGinx, and I know the script can run on multiple thread with the command php -f shell/url_migration_to_1_13.php 7

Do I need to set up thread pooling and such on Nginx? Is there anyway to make the script go faster?


texts: How to get Customer default shipping address in Magento 2

texts: I want to get Customer default shipping address in Magento 2.


texts: Magento 2 get custom module image url from backend

texts:
I used

<?php echo $this->getViewFileUrl('Vendor_Module::images/demo.jpg'); ?>
<?php echo $block->getViewFileUrl('Vendor_Module::images/demo.jpg'); ?>

But it's working only frontend, I want it in adminhtml block file.

I used this in renderer column of grid
File:

namespace Vendor\Module\Block\Adminhtml\Product\Renderer;

use Magento\Framework\DataObject;

class FileIcon extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{

    public function render(DataObject $row)
    {

        echo $this->getViewFileUrl('Vendor_Module::images/demo.jpg');
        echo $block->getViewFileUrl('Vendor_Module::images/demo.jpg');

        exit;
        //return $file;;

    }
}


texts: getCollection returns active products without status filter

texts:
I am getting product collection without using addAttributeToFilter('status',array('eq'=>,1)),but still my collection has only active products.

Why it returns active products default?Is there any values set for this in admin?

My Full code is,

$products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')->addCategoryFilter($category)
    ->addAttributeToFilter('entity_id',array('neq'=>$current->getId()))
    ->addAttributeToFilter('name',array('eq'=>$current->getName()))
    ->addAttributeToSort('price', 'asc')
    ->addFieldToFilter($attr_brand['code'], $attr_brand['val']);


texts: how to add an attachement to an order mail?

texts: i am trying to add an attachment  to the  order complete email  that is sent right after the order is set to status complete i am using the event observer to catch the event checkout_submit_all_after and created a custom function to process the event and get the order  but after that i need help or a lead to attach a file to the email and send it  , any leads would be helpful.


texts:
Searching is not working for new added products, though it's working for old products.

Any ideas?


texts:
How can i fire this JS with an observer every time a user is adding, updating or deleting a product from the cart ?

<script type="text/javascript">
    _paq.push(['addEcommerceItem',
        "{{sku}}",
        "{{name}}",
        "{{categoryname}}",
        {{price}},
        {{quantity}}
    ]);
    _paq.push(['trackEcommerceCartUpdate',{{totalcartvalue}} ]);
    _paq.push(['trackPageView']);
</script>


texts: The requested URL was not found on this server. Magento 2.1

texts:
Home Page after fresh Installation :

Admin Page :

I followed this link on Stack

maddy@maddy:/var/www/html/Magento2$  ls -a -l
total 916
drwxrwx--- 12 maddy www-data   4096 Sep 30 17:57 .
drwxrwxrwx  4 root  root       4096 Sep 30 17:59 ..
drwxrwx---  4 maddy www-data   4096 May 30 15:39 app
drwxrwx---  2 maddy www-data   4096 May 30 15:39 bin
-rw-rw----  1 maddy www-data 435065 May 30 15:39 CHANGELOG.md
-rw-rw----  1 maddy www-data   1843 May 30 15:37 composer.json
-rw-rw----  1 maddy www-data 344683 May 30 15:39 composer.lock
-rw-rw----  1 maddy www-data   3381 May 30 15:39 CONTRIBUTING.md
-rw-rw----  1 maddy www-data    631 May 30 15:39 COPYING.txt
drwxrwx---  5 maddy www-data   4096 May 30 15:39 dev
-rw-rw----  1 maddy www-data   1116 May 30 15:37 .gitignore
-rw-rw----  1 maddy www-data   2864 May 30 15:39 Gruntfile.js.sample
-rw-rw----  1 maddy www-data   6355 Sep 30 18:22 .htaccess
-rw-rw----  1 maddy www-data   9314 May 30 15:39 .htaccess.sample
-rw-rw----  1 maddy www-data   1368 May 30 15:39 index.php
-rw-rw----  1 maddy www-data    315 May 30 15:39 ISSUE_TEMPLATE.md
drwxrwx---  4 maddy www-data   4096 May 30 15:39 lib
-rw-rw----  1 maddy www-data  10376 May 30 15:39 LICENSE_AFL.txt
-rw-rw----  1 maddy www-data  10364 May 30 15:39 LICENSE.txt
-rw-rw----  1 maddy www-data   5071 May 30 15:39 nginx.conf.sample
-rw-rw----  1 maddy www-data   1427 May 30 15:39 package.json.sample
-rw-rw----  1 maddy www-data   1627 May 30 15:39 .php_cs
-rw-rw----  1 maddy www-data    814 May 30 15:39 php.ini.sample
drwxrwx---  2 maddy www-data   4096 May 30 15:39 phpserver
drwxrwx---  6 maddy www-data   4096 May 30 15:39 pub
drwxrwx---  7 maddy www-data   4096 May 30 15:39 setup
-rw-rw----  1 maddy www-data    884 May 30 15:39 .travis.yml
drwxrwx---  7 maddy www-data   4096 May 30 15:37 update
-rw-rw----  1 maddy www-data    101 May 30 15:39 .user.ini
drwxrwx---  7 maddy www-data   4096 Sep 30 18:17 var
drwxrwx--- 29 maddy www-data   4096 May 30 15:39 vendor

/etc/apache2/apache2.conf

if is use below changes it gives Internal Server Error

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

</Directory>

maddy@maddy:/etc/apache2/sites-available$ apache2 -v
Server version: Apache/2.4.18 (Ubuntu)
Server built:   2017-09-18T15:09:02


texts: Hide order summary from mageplaza checkout

texts: I want to hide or remove the Order Summary Section from Magaplaza one step checkout page, but there is no option from admin to hide it.


texts:
I'm trying to create a Configurable Product

The doc says to first create a Product Template:

  http://docs.magento.com/m2/ce/user_guide/catalog/product-templates.html?Highlight=product%20template

My version of 2.0.2 does not have a Product Template option. See screen shot:

  https://drive.google.com/open?id=0Bytqhoir_Tt5bHU5YWliWkFNZk0

How do I create product Template?


texts: How can I see a list of products that customers have asked to be alerted on?

texts:
I was looking in the admin area for a place to see products customers have chosen to be alerted on. This seems like a useful feature considering you may want to re-stock those products since they will sell fast. I couldn't find any way to do it though. I also want to use it for testing to make sure these are working correctly.

Also, while reading this other question (Are stock and price alerts ever removed?) it made me think there was a way for customers to see products they have chosen to be alerted on, and unsubscribe from those alerts, however I can't find a way to do that either.

I found this article with a way to list them out for each customer (http://magenting.wordpress.com/2011/12/05/get-customer-product-alert-subscriptions-list-in-magento/), but I was wondering if there was any built in functionality for this.

Are either of these things possible? I'm using Magento 1.6.2.0


texts: Increment and decrement qty button on shopping cart page

texts: How to add increment(plus +) and decrements(minus -) qty button on shopping cart page?


texts: How do you flush a specific URL from the Enterprise Full Page Cache?

texts: I had a look through Enterprise_PageCache_Model_Processor::extractContent() to see how it determines the cache key for each page that it caches, but it's pretty complicated and there doesn't seem to be a simple way to determine the cache key for a given URL in order to remove it from the cache...?


texts: Showing dollar sign for Product Attribute field... and two decimal point, if possible

texts:
I was able to show a product attribute payamount in catalog/product/list.phtml.

But how can I show it formatted with $ sign and 2 decimal point?

<?php echo $_helper->productAttribute($_product, $_product->getpayamount() , 'payamount'); ?>


texts: Stop ordering and redirecting to a page from the Observer with an error message

texts:
How I can stop ordering and redirecting to a page from the Observer with an error message.

    public function setSubscribeField($observer)
        {
            if(Mage::app()->getRequest()->isPost()){
                $postData = Mage::app()->getRequest()->getPost();
                $session = Mage::getSingleton('checkout/session');
                if(isset($postData['mailchimp_subscription'])){
                    $session->setData('mailchimp_subscription',$postData['mailchimp_subscription']);
                }else {
                    if($postData['mailchimp_subscription'] != 'on' && Mage::helper('subscription')->isRequired()){
   ????????
                    }
                }
            }

            return $this;
        }

If this parameter is required, than I must redirect to page with form and show error message .
Thanks in advance.


texts: I have uploaded a Magento Community Extension on Magento connect .. but now its status showing "Not Approved". how can I know what is the reason for not approved. and how this all process works ?


texts: Magento 2: how should I display only date in grid

texts:
How should I hide the time in this grid? I only want date to display but the time field is also coming like 13/03/2018 00:00:00

In my .xml file, this column is responsible for displaying date column:

 <block class="Magento\Backend\Block\Widget\Grid\Column" as="date">
   <arguments>
     <argument name="header" xsi:type="string" translate="true">Date</argument>
     <argument name="index" xsi:type="string">date</argument>
   </arguments>
</block>


texts:
As I was updating ready for installing the new patches on a site I have inherited, I found this in my reports:

a:5:{i:0;s:313:"SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`__COMPANYNAME___magento`.`__COMPANYNAME__catalog_compare_item`, CONSTRAINT `FK___COMPANYNAME__CAT_CMP_ITEM_PRD_ID___COMPANYNAME__CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `__COMPANYNAME__catalog_product_entit)";i:1;s:2270:"#0 lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ge...', Array)
#4 lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ge...', Array)
#5 lib/Zend/Db/Adapter/Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ge...', Array)
#6 app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(453): Zend_Db_Adapter_Abstract->insert('__COMPANYNAME__catalog...', Array)
#7 app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Catalog_Model_Product_Compare_Item))
#8 app/code/core/Mage/Catalog/Model/Product/Compare/List.php(51): Mage_Core_Model_Abstract->save()
#9 app/code/core/Mage/Catalog/Model/Product/Compare/List.php(67): Mage_Catalog_Model_Product_Compare_List->addProduct('http:')
#10 app/code/core/Mage/Catalog/controllers/Product/CompareController.php(63): Mage_Catalog_Model_Product_Compare_List->addProducts(Array)
#11 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_Product_CompareController->indexAction()
#12 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 app/Mage.php(684): Mage_Core_Model_App->run(Array)
#16 index.php(87): Mage::run('', 'store')
#17 {main}";s:3:"url";s:329:"/catalog/product_compare/index/items/244,http://some-inexistent-website.acu/some_inexistent_file_with_long_name%3F.jpg,246,251,253,254,255,256,257,258,264,266,267,268,269,271,272,273,274,275,276,277,278,287,339/uenc/aHR0cDovL3d3dy5nZWxwYWNrc2RpcmVjdC5jby51ay9jYXRhbG9nc2VhcmNoL3Jlc3VsdC9pbmRleC8_bW9kZT1saXN0JnE9aWNlJTIwd3JhcA,,/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

By accessing the url example.com/catalog/product_compare/index/items/244,http://some-inexistent-website.acu/some_inexistent_file_with_long_name%3F.jpg,246,251,253,254,255,256,257,258,264,266,267,268,269,271,272,273,274,275,276,277,278,287,339/uenc/aHR0cDovL3d3dy5nZWxwYWNrc2RpcmVjdC5jby51ay9jYXRhbG9nc2VhcmNoL3Jlc3VsdC9pbmRleC8_bW9kZT1saXN0JnE9aWNlJTIwd3JhcA,,/

I would have thought it would fail before getting to the MySQL error and this is not normal, although everything is the stack trace is from the Core codepool.

Magento version is CE 1.9.0.1


texts:
I have a module that places some shipping information into the order view of the admin.  I am trying to display the current shipping method in this section.
I have this in view/adminhtml/templates/order/view/custom_fields.phtml:
$orderId = $this->getRequest()->getParam('order_id');
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('Magento\Sales\Api\Data\OrderInterface')->load($orderId);

$shippingMethod = $order->getShippingDescription();

echo 'Shipping is ' . $order->getShippingMethod();

This works fine but I know it isn't the proper way to use Object Manager.  Can someone help me use this properly?
Thanks,
Stan


texts:
All of a sudden Magento (1.9.1.0) stopped sending new order emails automatically.
From backend if I click on Send Email in Sales > Orders > Random Order then the user receive the email, but I have to do it manually.

I checked all the options in Configuration > Sales > Sales emails > Order and Enabled is set to Yes and sender email domain is the same domain of the site.

I have enabled logging in System > Configuration > Developer > Log Settings and checked logs files in magento var/log but there's nothing strange.

I also checked mail server logs, there's no trace of automatically sent emails, i only see entries of manually sent emails


texts: How to stop Magento from sending emails via cron?

texts: In Magento 1.9.1, order confirmation emails are queued and scheduled to be sent. How can I disable this? I would like Magento to send emails in real time like it used to do.


texts:
For some reason when an order is processed magento automatically sends 2 Invoice emails as well as the order confirmations email.

I have 2 questions.

Should magento send an invoice email automatically ( I am using a payment gateway that authorises and captures payment so I believe the invoice is generated at the time of sale.)
How do I find out what is sending the emails i.e. is it magento, my payment gateway, another extension???? Is there a way to trace this?

Current work around is I have the invoice email disabled and it stops the 2 invocie emails being sent.

Cheers


texts: Extend/Override Javascript Included from Layout (head->link)

texts:
I want to extend:
vendor/magento/module-catalog/view/adminhtml/web/js/edit-tree.js

Which is loaded by layout:
vendor/magento/module-catalog/view/adminhtml/layout/catalog_category_edit.xml:12

Why I want to expand this javascript? To put a password input.

I tried to override using requirejs-config.js, but doesn't work.

What should I do? What methods are there to put an input on this confirm modal?


texts: How to get information about payment status from order?

texts:
I was trying to get some details about payment from order and all I achieved is the payment method. Unfortunately I can't get more details like a payment status.
So far the code is working well but still ... how to get these details ?
Here is my code:

$order_id = $_POST['ordernumber'];///238425;
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
$order->getAllVisibleItems();
$orderItems = $order->getItemsCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('product_type', array('eq'=>'simple'))
    ->load();
echo '
';
echo 'Mage Order #: '.$order_id.'
';
echo 'Order Total: &pound'.number_format($order->getGrandTotal(),2).'
';
echo 'Qty Ordered: '.number_format($order->getTotalQtyOrdered(),0).'
';
$payment = $order->getPayment();
$method = $payment->getMethod();
$payment->getData('cc_type');
$payment->getMethodInstance()->getCode();
$payment->getMethodInstance()->getTitle();
$payment->getMethodInstance()->getCardsStorage();
$payment->getMethodInstance()->getCardsStorage()->getCards(); //array()
echo 'Payment: '.$method.'
';
echo 'Status: '.$payment->getMethod().' => '.$order->getPaypalPaymentStatus().'
';

Problem solved.


texts:
This problem has me beyond stumped.  A little background:

Red Hat Enterprise Linux 6
PHP 5.3.3
Magento 1.7.0.2
Hacked Core
Compilation is disabled
Ioncube Loader Zend Extension Included

Installed Third Party Modules:

Aitoc Aitinstall
Aitoc Aitsys
Anaraky Gdrt
Aoe Scheduler
Devinc License
Devinc Multipledeals
Displaze MyProductType
Dull Uploader
Listrak Remarketing
Magemaven OrderComment
Magestore Bannerslider
OlegKoval ProductReviewCaptcha
Phoenix VarnishCache
AW All
AW Core
AW Kbase
Aitoc Aitgroupedoptions
Amasty Base
Amasty Conf
Amasty Coupons
Amasty Oaction
Amasty Promo
Amasty ShippingPerItem
Amasty Shiprestriction
Amasty Shiprules
Bazaarvoice Connector
Bizrate Buyersurvey
CommerceExtensions Productimportexport
GoDataFeed Services
Humsayaa AbsolutePricing
ME Base
ME DataFlowAdvanced
ME ProductInParent
ME Shipping
ME UrlMapper
Magestore Imageoption
Magestore Magenotification
Mirasvit FeedExport
Mirasvit MstCore
RapidCommerce Browserupgrade
SOAP ShoppingAnalytics

PHP Include Path:

/home/xxx/htdocs/app/code/local:/home/xxx/htdocs/app/code/community:/home/xxx/htdocs/app/code/core:/home/xxx/htdocs/lib:.:/usr/share/pear:/usr/share/php

The Problem

On approximately 1% of all requests, I'm seeing an issue where the Varien auto-loader fails to include a core file: app/code/core/Mage/Core/Model/Layout.php

Tracing this down to the autoload($class) method inside the lib/varien/Autoload.php file, I am able to confirm that include $classFile is returning FALSE approximately 1% of the time.  This indicates that the file could not be found and/or opened.  This seems to be the only file that fails to be loaded.

It's currently my theory that something is locking the file...but I am at a loss as to what the most efficient next debugging step should be.  Has anyone had any experience with third party modules doing some funky file locking during the Magento bootstrapping process?

How the devil should one go about finding the root cause of this?

*Edit 1:

I've modified the autoload function as follows:

public function autoload($class)
{
    if ($this->_collectClasses) {
        $this->_arrLoadedClasses[self::$_scope][] = $class;
    }
    if ($this->_isIncludePathDefined) {
        $classFile =  COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . $class;
    } else {
        $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class)));
    }
    $classFile.= '.php';

    $includeResult = include($classFile);

    /// Whoa something is very wrong here!
    if(!$includeResult) {
        error_reporting(E_ALL);
        ini_set('display_errors', '1');
        $handle = fopen('/home/xxx/htdocs/app/code/core/Mage/Core/Model/Layout.php');
        $wb = false;
        if(!flock($handle, LOCK_EX|LOCK_NB, $wb)) {
            if($wb) {
                die('Something has the darn thing locked...');
            } else {
                /// Nothing has the darn thing locked!
                $includeResult = include($classFile);
                if(!$includeResult) {
                    die('....something just does not make sense here.');
                } else {
                    die('Included the file this time.......');
                }
            }
        } else {
            die('Was able to lock the file successfully...');
        }
    }
    return $includeResult;

}

The result is as follows:
....something just does not make sense here.

This indicates that nothing has a lock on the file.  This also indicates that no warnings are emitted from the include construct.

*Edit 2 - Reading from the PHP language specification (https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#the-include-operator), it appears that if an included file cannot be opened or read, then a warning is emitted.  Additionally, the value FALSE is returned.

FALSE is definitely being returned by the inclusion, however no warning is being emitted.  This leads me to believe that this is likely an internal PHP issue.


texts: Fatal error Magento 2: On product page HTTP ERROR 500

texts:
On the product page this error is showing
Magento 2.3.1 ultimo theme
What to do please help?

Fatal error: Uncaught Error: Call to a member function getFrontend() on boolean in /var/www/html/app/code/Infortis/Brands/Block/AbstractBlock.php:160 Stack trace: #0 /var/www/html/app/code/Infortis/Brands/Block/Logo.php(116): Infortis\Brands\Block\AbstractBlock->getBrand(Object(Magento\Catalog\Model\Product\Interceptor))
#1 /var/www/html/app/code/Infortis/Brands/Block/Logo.php(103): Infortis\Brands\Block\Logo->getCurrentBrand()

#2 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1036): Infortis\Brands\Block\Logo->getCacheKeyInfo()

#3 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1094): Magento\Framework\View\Element\AbstractBlock->getCacheKey()

#4 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(661): Magento\Framework\View\Element\AbstractBlock->_loadCache()

#5 /var/www/html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Element\AbstractBlock->toHtml()

#6 /var/www/html/vendor/magento/framework/View/Layout.php(533): Magento\Framework\ in /var/www/html/app/code/Infortis/Brands/Block/AbstractBlock.php on line 160


texts:
I've tried to test my admin-module with casperjs. Locally all my test are passing but on travis some of theme are failing.

Has anyone of you ever worked with this combination of tools + magento?


texts: Add select quantity options on product page Magento 2

texts:
I want to change quantity textbox to quantity dropdown on product page. I found solutions that work for magento 1 not for magento 2.

There is less information/doc about magento 2. It's being very difficult to customize magento 2.

Can anyone help me how i can do this.

Thanks in advance.


texts: Override Magento 2 Catalog Bock Toolbar.php

texts:
I'm trying to change change the default "sorter by"

I can't override
Magento\Catalog\Block\Product\ProductList\Toolbar

I created a custom module, set the di.xml with

<preference for="Magento\Catalog\Block\Product\ProductList\Toolbar" type="Custom\Catalog\Block\Product\ProductList\Toolbar" />

But I got this

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to
Magento\\Catalog\\Block\\Product\\ListProduct::configureToolbar() must
be an instance of
Magento\\Catalog\\Block\\Product\\ProductList\\Toolbar, instance of
Custom\\Catalog\\Block\\Product\\ProductList\\Toolbar given, called in
/var/www/html/site/vendor/magento/module-
catalog/Block/Product/ListProduct.php on line 206 and defined in
/var/www/html/site/vendor/magento/module-
catalog/Block/Product/ListProduct.php:488\nStack trace:\n#0
/var/www/html/site/vendor/magento/module-
catalog/Block/Product/ListProduct.php(206):
Magento\\Catalog\\Block\\Product\\ListProduct- >configureToolbar(Object(Custom\\Catalog\\Block\\Product\\ProductList\\Toolbar), Object(WeltPixel\\LayeredNavigation\\Model\\ResourceModel\\Fulltext\\Collection\\Interceptor))\n#1 /var/www/html/site/vendor/magento/module-catalog/Block/Product/ListProduct.php(467): Magento\\Catalog\\Block\\Product\\ListProduct->addToolbarBlock(Object(WeltPixel\\LayeredNavigation\\Model\\ResourceModel\\Fulltext\\Collection\\Interceptor))\n#2 /var/www/html/site/vendor/ma in /var/www/html/site/vendor/magento/module-catalog/Block/Product/ListProduct.php on line 488,


texts: How to create entity array in mftf data?

texts:
I have this code defined on my shop-meta.xml:
<?xml version="1.0" encoding="UTF-8"?>
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
    <operation name="CreateShops" dataType="shops" type="create" auth="anonymous" url="/V1/shop" method="POST">
        <contentType>application/json</contentType>
        <object dataType="shops" key="shops">
            <array key="shops">
                <value>Shop</value>
            </array>
        </object>
        <object dataType="Shop" key="Shop">
            <field key="shop_id">integer</field>
            <field key="shop_name">string</field>
            <array key="services">
                <value>Service</value>
            </array>
        </object>
        <object dataType="Service" key="Service">
            <field key="service_id">integer</field>
            <field key="service">string</field>
            <field key="service_name">string</field>
            <field key="waiting_time_seconds">integer</field>
            <field key="tickets_in_queue">integer</field>
            <field key="current_ticket">string</field>
        </object>
    </operation>
</operations>

How can I create an entity of the object shops in my ShopData.xml?


texts: Magento 2: How to add class for custom tab in form ui component?

texts:
I tried additional classes but it working with the content of my custom tab still not working with my custom tab. So who can help me how to add a class for custom tab?

code :-

<fieldset name="custom_tab">
     <settings>
           <label translate="true">Settings</label>
           <imports>
                <link name="visible">${ $.provider }:data.hide-export</link>
           </imports>
     </settings>
</fieldset>


texts: Modifying an extension to include a script on static pages as well as product & category pages?

texts:
I've installed an extension that includes a script on product and category pages. I'm trying to get the script to load on static content pages as well. I've been digging through the source code of the extension and thought that I found the spot where it's determined whether or not to load the script but haven't had any luck.
The extension contains a view/frontend/templates/config.phtml file that has the following:
<?php if ($block->isAjaxAdd()): ?>
    <script type="text/x-magento-init">
    <?= /* @noEscape */
        $helper->encode(
            [
                "#product_addtocart_form:not([amcart-observed]), form[data-role=\"tocart-form\"]:not([amcart-observed]), .action.tocart:not([amcart-observed])" => [
                    'Amasty_Cart/js/amcart' => $amcartParams
                ]
            ]
        );
    ?>
    </script>

The isAjaxAdd method looks like this:
public function isAjaxAdd()
{
        return ($this->getPageType() == self::PRODUCT_PAGE && $this->getHelper()->isUsedOnProductPage())
            || $this->getPageType() == self::CATEGORY_PAGE;
}

I've attempted to just comment all of this code out and return true on the method but the script is still not loaded on normal pages.
I've also just tried to echo something out on this phtml template before the $block->isAjaxAdd() call, but it still only shows on category and product pages.
Is there another place that I'm missing that would only load this template on product/category pages?


texts: Magento 2 - Check in minicart if customer is loggedin knockout

texts:
We want to check in the minicart if the customer is loggedin.
<!-- ko if: isCustomerLoggedIn == 1 -->

Does not seem to work well for the mini cart. This only works when you are visually in the checkout. When you are in the category or on the productpage, this does not work.
So how can we always check in the mini cart if the customer is loggedin?


texts:
I am trying to get product reviews filtered by Product Id, but in the product which doesn't have any reviews added, the reviews count still shows 2 reviews.

This means review collection filter by Product Id isn't working.

Below is the code I am using to get Review collection.

<?php
$_product = $this->getProduct();
$productId = $_product->getId();
$reviews = Mage::getModel('review/review')->getResourceCollection()
        ->addStoreFilter(Mage::app()->getStore()->getId())
        ->addEntityFilter('product', $productId)
        ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
        ->setDateOrder()
        ->addRateVotes();
$avg = 0;
$ratings = array();
if (count($reviews) > 0){
foreach ($reviews as $_review): ?>
<?php foreach( $_review->getRatingVotes() as $_vote ): ?>
<?php $ratings[] = $_vote->getPercent(); ?>
<?php endforeach; ?>
<?php endforeach;
$avg = array_sum($ratings)/count($ratings); }
?>

Can somebody let me know what might be going wrong with this ?


texts:
Is possibile to use media browser of admin on frontend?

I am meaning the pop up window when clicking browse server of wyswyg, the pop up is this image

I am using the webkul marketplace extension, it's using wyswyg as editor and let user enter the content of product description.

Unfortunately, the wyswyg  on frontend is not including media browser.


texts: Displaying several currencies in product details page

texts:
Please check the screen shot.

I've allowed INR, EUR and USD in magento shop. I want to display appropriate price values of all allowed currencies for a product.
Example: If the EUR value is €16.98, then appropriate USD and INR values will be $23.00 and Rs1,388.63 respectively (based on webserviceex values). I want all 3 values to be displayed in product details page. I also want to add 2 more attributes Price(EUR) and Price(INR) for prices tab in backend. How to do that?


texts: Magento2 negotiable quote save programatically

texts:
How to create and save the negotiable quote programatically in M2.
Can any one provide some example with dummy data / (or) provide me the test script with simple example please
Thanks


texts: How to enable auto currency conversion in multiple websites in Magento?

texts: I am using Magento community edition 1.9.1.0. I have set up two websites: USD and NRS (Nepalese rupee). I have also set up the base currency for both the stores respectively. The default currency in default store config is NRS. What I want to achieve is, once I enter a product, the currency gets converted accordingly for both the websites. How can I achieve this?


texts: Reasons to setup cronjob for setup:cron:run and update/cron.php on a deployed production system?

texts:
In Magento 2 there are three commands that should be set up as cronjob

* * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log
* * * * * <path to php binary> <magento install dir>/update/cron.php >> <magento install dir>/var/log/update.cron.log
* * * * * <path to php binary> <magento install dir>/bin/magento setup:cron:run >> <magento install dir>/var/log/setup.cron.log

  The first command (magento cron:run) reindexes indexers, send automated e-mails, generates the sitemap, and so on. Usually it’s associated with the PHP command line .ini file. The other two commands are used by the Component Manager and System Upgrade.

Source: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

If I understand the docs correctly, update/cron.php and bin/magento setup:cron:run are only used for module installations and updates from the admin panel.

This is something that does not happen in a properly deployed production system where all updates are at least done on a staging system first, then moved to production.

So is there any reason to set up these cronjobs? What changes if I leave them out?


texts:
Please note the current development is in dev mode & writing to pub/static. It is using browser sync and the sass snowdog theme for magento2.

I've got my theme running and using the Sass Snowdog theme, had it all running fine like so:

Theme directory:

  app/design/frontend/Vender/Theme/

With the snowdog themes.json file looking like so:

{
  "blank": {
    "src": "vendor/snowdog/theme-blank-sass",
    "dest": "pub/static/frontend/Snowdog/blank",
    "locale": ["en_US"],
    "ignore": [".test"]
  },
  "lovelane": {
    "src": "app/design/frontend/Vender/Theme",
    "dest": "pub/static/frontend/Vender/Theme",
    "locale": ["en_GB"],
    "localeOverwrites": true,
    "parent": "blank"
  }
}

And when I do:

gulp styles watch browser-sync

The files are watched inside of:

  app/design/frontend/Vender/Theme/web/css

And get written to the pub/static folder. However when i try to add these styles to the page with the following inside of:

  app/design/frontend/Vender/Theme/Magento_Theme/layout/default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="/web/css/mysuperstyles.css"/>
        <css src="//fonts.googleapis.com/css?family=Roboto:100,300,400,700" src_type="url" />
    </head>
</page>

The styles don't get pulled through onto the page. Im stuck, I've run:

  bin/magento setup:di:compile

And done the static content deploy but, the files just don't load on to the page.

Any help would be awesome.


texts: "Too many redirects". No access to Magento back end

texts: Just tried logging into Magento CE back end, and its returning a "Too many redirects occurred trying to open page" message.  Several of us using different browsers in locations are having same problem with same site.  Any ideas please?


texts:
I need to add a <select> for the available websites in magento admin at user registration page and associate that customer to the selected website. e.g., if there were 3 websites in magento viz. Main Store, Other Store and Another Store then user will be able to chose any one of them at registration page and associated with that particular website.

I'd been google for a long and found quite similar thing Select Customer Group at Registration but that wasn't helpful to me. Can anybody have any idea on how to do this?

What I've tried till now?
I'd overriden the Customer/AccountController's createPostAction() for adding the selected website in customer model. The code snippet I tried:

$webid = $this->getRequest()->getParam('website_id');
$customer = $this->_getCustomer();
$customer->setData('website_id', $webid); //1st approach
$customer->setWebsiteId($webid); //2nd approach
//3rd approach
$customerForm = $this->_getModel('customer/form');
            $customerForm->setFormCode('customer_account_create')
                    ->setEntity($customer);

//and before }
parent::createPostAction();

How do I'm getting the website list?

<select name="website_id" id="store_name">
    <option value="">Please select...</option>
    <?php
    $websites = Mage::app()->getWebsites();
    foreach ($websites as $web) {
        echo "<option value='" . $web->getId() . "'>" . $web->getName() . "</option>\n";
    }
    ?>
</select>


texts: Multiple magento-2 modules in single git repository

texts:
I am trying to host my magento 2 extensions in a bitbucket repository.
each extension will be a branch of that repository. The problem is that, we need to create tag for particular version of the extension as the composer takes tag as version in composer require vendor/module:<version>, and the tags can not be duplicated, so if there are two extensions with same version, it will not work. There needs to be single repository to avoid adding new repository to composer to install a new extension every time.

And we need to have version to be comparable as the magento composer.json has minimum-stability defined as alpha.