texts:
for our customer I've to create a custom validation for a field in the shipping-address-fieldset. For that I've created a custom module in /app/code. The js requirement works but the validation doesn't appear. Here is what I've got (anonymised):
/app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js
var config = {
    config: {
        mixins: {
            'mage/validation': {
                '[Vendor]_[Module]/js/test-mixin': true
            }
        }
    }
}

/app/code/[Vendor]/[Module]/view/frontend/web/js/test-mixin.js
define([
    'jquery',
    'jquery/ui',
    'jquery/validate',
    'mage/translate'
], function($) {
    'use strict';

    return function(){
        $.validator.addMethod(
            // validator name
            'validate-five-words',
            // validator check function
            function(value, element){
                return value.split(' ').length == 5;
            },
            // error message
            $.mage.__('Please enter exactly five words')
        );
    };

});

and I've tried to add the validator to the company field in checkout_index_index.xml
<item name="company" xsi:type="array">
    <item name="validation" xsi:type="array">
        <item name="required-entry" xsi:type="boolean">true</item>
        <item name="validate-five-words" xsi:type="boolean">true</item>
    </item>
</item>

The required-entry validation and others like validate-street are working correctly.
May be it's the wrong mixin hook or I miss something else.


texts:
How can we add extra fee on Cash on delivery payment method in magento2.
I tried to convert Phoenix COD in magento2 but not getting the result.


texts: Fatal error message still shown after fix on customer browsers

texts:
I have fixed the fatal error:Allowed memory size exceeded by increasing my memory limit in my php.ini to 125M. But for some users
they're still seeing the message, months after the fix.

I though the reason why they could still be seeing the message could be the cached version on their browser or something related to the Magento site.

I fixed this problem months ago and every now and again a users comes out of the wood work with the error message. When I view the site it's fine and when they clear their cache and cookies it works fine.

Anyone have an idea why this is still cache or appearing on their browser?


texts: I have add custom attribute and as it is labels are showing in frontend

texts:
I have added some custom attribute in new-address.js file Whenever i add new address in the time of checkout that address shows up with label of new added customattribute label.
How do i resolve it help.

Example like this label - block and text field block, building_number is label building is value
i want to hide this label .
if (address.customAttributes == undefined) {

                   var block1 = $('.checkout-shipping-address input[name=block]').val();
                   var building1 = $('.checkout-shipping-address input[name=building_number]').val();
                   var floor1 = $('.checkout-shipping-address input[name=floor_number]').val();
                   var apartment1 = $('.checkout-shipping-address input[name=apartment_number]').val();
                   var comments1 = $('.checkout-shipping-address input[name=notes]').val();

                address.customAttributes = {
                    block : block1,
                    building_number : building1,
                    apartment_number : apartment1,
                    floor_number : floor1,
                    notes : comments1,
                };
            }


texts: Override Zend library classes in magento2

texts:
Its true that this question already exists. But thought of posting it anyway as couldnt find the solutions helpful.

I am using an url to connect to an endpoint. And the url has '<','>' character in it. Like https://www.domain.com?filter=(order_number>2000).

When i am trying to use this url i am getting Invalid URI supplied error. Here is the code

 /**
     * @return object
     * @throws \Zend_Http_Client_Exception
     */
    private function getZendHttpClient()
    {
        $client = new \Zend_Http_Client();
        $client->setUri('https://www.domain.com?filter=(order_number>2000)'); // Here is the error
        $client->setConfig($this->getSSLConfig());
        $client->setMethod(\Zend_Http_Client::GET);
        $client->setHeaders($this->getHeader()); // Getting the header here
        return $client;
    }

    /**
     * Setting SSL check off in production not desirable. Needs to be removed.
     * @return array
     */
    private function getSSLConfig() : array
    {
        $config = array(
            'adapter'     => '\Zend_Http_Client_Adapter_Curl',
            'curloptions' => [CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false]
        );
        return $config;
    }

Now the issue is magento2 creates an instance of Zend_Uri_Http which checks for all the possible characters which can be inside an url and '>','<' cant be there. Inside Zend_Uri_Http magento2 has defined all the characters which can be inside an url. I need to override it to add '>','<'.

Now 1 option can be like

  i) create new class A which will extend Zend_Http_Client. Use class A
  instead of Zend_Http_Client.

  ii) Now create new class B which will extend Zend_Uri. And use class B
  inside class A.

  iii) Create a new class C which will extend Zend_Uri_Http. And use
  class C inside class B.

But this is too much for a little change. I'm sure there would some better and short approach.


texts: How to hide magento 2.2 messages after a time has passed?

texts:
I want to remove the success notification message with animation included, trying with below code with no success:

define([
'jquery',
'uiComponent',
'underscore',
'Magento_Customer/js/customer-data',
'jquery/jquery-storageapi'
], function ($, Component, _, customerData) {
'use strict';

return Component.extend({

    defaults: {
        cookieMessages: [],
        messages: [],
        selector: '.page.messages .message'
    },
    /** @inheritdoc */
    initialize: function () {
        this._super();

        this.cookieMessages = $.cookieStorage.get('mage-messages');
        this.messages = customerData.get('messages').extend({
            disposableCustomerData: 'messages'
        });

        if (!_.isEmpty(this.messages().messages)) {
            customerData.set('messages', {});
        }

        $.cookieStorage.set('mage-messages', '');
        this.RemoveMessageAfterTime;
    },

    initObservable: function () {
        this._super();

        return this;
    },

    RemoveMessage: function () {

        var el = $(this.selector);

        el.toggleClass('bounceInRight bounceOutRight');
    },

    RemoveMessageAfterTime: function() {
        var el = $(this.selector);

        setTimeout(function() {
            $('.page.messages .message').toggleClass('bounceInRight bounceOutRight');
        }, 6000);
    }

});

});

  Messages.phtml


texts: How do i stop magento Caching Global Messages on CMS

texts:
i have an application form that is created on a CMS using this line

{{block type="[MODULE]/[BLOCK]" template="[TEMPLATE]"}}

now when you submit the form and get the success message at the top, it gets cached so no matter how many times i reload or return to the page from another page the success message remains

this is a problem because if you submit the form multiple times then go to the login page all the success messages all output there so they get piled up because their not outputting, and any error messages that should output because of invalidation do the same, the moment i clear the cache or turn it off it's fine

so how do i stop magento caching Global Messages on a CMS


texts:
My guest checkout page looks ugly.
How can I customize just the guest checkout and add these fields? Image below.

I have found tutorials here at https://www.mageplaza.com/devdocs/custom-checkout-component-magento-2.html. But I am still kind of confused how to edit certain fields.


texts:
Below is the code for creating a custom collection, but it is breaking pagination. It is showing only one item in pagination, When I am printing getSize() it is giving one(which is wrong), but on printing count() it is printing correct result.

               $sampleqry = 'select entity_id from catalog_product_entity_int as sample where sample.store_id=0 and sample.attribute_id="169" and sample.value=0';

                $this->_productCollection->getSelect()->joinLeft(array('r' => 'catalog_product_relation'), 'r.parent_id=e.entity_id', array());
                $this->_productCollection->getSelect()->joinLeft(array('s' => 'sales_flat_order_item'), '(r.child_id=s.product_id AND s.product_id IN(' . $sampleqry . ')) OR (s.product_id=e.entity_id)', array('SUM(s.qty_ordered) as qtyordered'));
                $this->_productCollection->getSelect()->group('e.entity_id');
                $this->_productCollection->getSelect()->order('qtyordered DESC');

Same code is working fine in Magento 1.4 but not in 1.7.0.2
How can I fix this issue, any help will be appreciated.


texts: Magento verion is community or enterprise

texts: I'm working with few Magento websites and how can i find out that which website is enterprise and which one is community.


texts: Magento unable to add webp images to category thubmnail

texts: I want to add webp images to category thumbnail, how can we do this, it gives below error on adding webp images "File validation failed."


texts: How do I stop my Magento Theme Overriding Instant Search

texts:
I have been setting up a Magento 1.9 site and using the excellent free Instant Search extension from Magestore.

After installing a new Theme, the Instant Search has since stopped working.

Is there an easy way to set the "weight" of extensions so they are not overridden by others?

Or does anyone know how I could make the Magestore Instant Search work with Ultimo theme?


texts:
I used

Use Auto-Generation

Magento coupon code but all coupon codes generated uppercase like F1Z8Z2FPQQYL

how can I generate the lowercase coupon?!

I found code but I can't understand it, how does it generate the lowercase coupon code!

 public function generateCode()
    {
        $format  = $this->getFormat();
        if (!$format) {
            $format = Mage_SalesRule_Helper_Coupon::COUPON_FORMAT_ALPHANUMERIC;
        }
        $length  = max(1, (int) $this->getLength());
        $split   = max(0, (int) $this->getDash());
        $suffix  = $this->getSuffix();
        $prefix  = $this->getPrefix();

        $splitChar = $this->getDelimiter();
        $charset = Mage::helper('salesrule/coupon')->getCharset($format);

        $code = '';
        $charsetSize = count($charset);
        for ($i=0; $i<$length; $i++) {
            $char = $charset[mt_rand(0, $charsetSize - 1)];
            if ($split > 0 && ($i % $split) == 0 && $i != 0) {
                $char = $splitChar . $char;
            }
            $code .= $char;
        }

        $code = $prefix . $code . $suffix;
        return $code;
    }


texts: How can I add new IF statement to \Magento\Sales\Model\ResourceModel\Order\Handler::check() body with a plugin? I don't want to override it like in Magento 1.


texts: Filtering products by multiple categories in Magento

texts:
I have some problem with filtering categories in Magento. The filter method which I used, display only one category, but I need to display few more. Here is my code:

$products = Mage::getModel('catalog/product')->getCollection();
$products->joinField(
    'qty',
    'cataloginventory/stock_item',
    'qty',
    'product_id=entity_id',
    '{{table}}.stock_id=1',
    'left'
);
$products->addAttributeToFilter('qty', array('neq' => 0));
$products->addAttributeToFilter('type_id','simple');
$products->addAttributeToFilter('status', 1);
$products->addAttributeToFilter('visibility', 4);
$products->addAttributeToSelect('sku');
$products->addAttributeToSelect('name');
$products->addAttributeToSelect('description');
$products->addAttributeToSelect('short_description');
$products->addAttributeToSelect('url');
$products->addAttributeToSelect('image');
$products->addAttributeToFilter('price', array('gt' => 250));
$products->addAttributeToSelect('special_price');
$products->addAttributeToSelect('manufacturer');

$products->addCategoryFilter(Mage::getModel('catalog/category')->load(array('32,5')),true);

The code display only products from id=32. The products from category id=5 are not displayed.


texts: Magento 2: How to use min() and max() function to filter high price or quantity

texts: I want to get the highest price from the database using max() on price column and low quantity using min() on qty column. How can I write the query?


texts:
I have a Multi webshop installation with 3 existing shops. They have their products.
Now I want to migrate an OSCommerce shop to Magento and add as 4th shop.
About 50% of the products are shared between the new shop and the existing Magento shops. Just different names, descriptions, amounts.
I want to keep the SEO/ranking of the OSCommerce products when moving to Magento.

However, these products have already their permanent re-direct enabled in product maintenance. The problem I see is that the URL-key is only at a global level and not on the shop level.
Is there any way I can keep the re-directs as currently maintained in Magento for the 3 shops already AND also add a 301 re-direct from the OSCommerce to the new Magento product for the 4th shop?

example:
product URL existing Magento shop "1":
sony-Bravia-8100.html

existing OSCommerce URL
LED-Bravia-sony-8100.html

I want to keep sony-Bravia-8100.html (as this has its own ranking and is applicable for shop 1, but I also want to have for the same product in Magento for shop 4 the re-direct from LED-Bravia-sony-8100.html.


texts: Exception #0 (Exception): Notice: Undefined index: id in Iterator

texts:
I'm tryingto extend Magento2 Adminhtml with some custom nodes, which has worked good so far. What I'm trying to do now is to figure out how this error is happening:

Exception #0 (Exception): Notice: Undefined index: id in /var/www/magento/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php on line 63

So basically this issue is coming from malformed XML files that handles my adminhtml.

ACL:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="Vendor_Module::config" title="Config for Advanced Catalog" sortOrder="100"/>
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

config:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <advancedcatalog>
            <general>
                <enabled>1</enabled>
                <debug>0</debug>
            </general>
        </advancedcatalog>
    </default>
</config>

system.xml:

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

            Advanced Catalog
            <tab>advancedcatalog</tab>
            <resource>Vendor_Module::config</resource>
            <group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1"
                   showInStore="1">
                General
                <field id="enabled" translate="label" type="select" sortOrder="1" showInDefault="1" showInStore="1"
                       showInWebsite="1">
                    Enabled
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="debug" translate="label" type="select" sortOrder="2" showInDefault="1" showInStore="1"
                       showInWebsite="1">
                    Debug Mode
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>

    </system>
</config>

However, if I flush and clean cache's I'll get the error message. I do know that this error is coming when there are different IDs, however I cannot  figure out where I made my mistake.


texts: Adding custom font to _typography.less parse error

texts:
I try to add some custom fonts to my theme, so I created file app/design/frontend/vendor/theme/web/_typography.less and added the code inside of it:

.lib-font-face (
  @family-name:'OpenSans Condensed Light',
  @font-path: '@{baseDir}fonts/OpenSans-CondLight.ttf',
  @font-weight: 300,
  @font-style: normal
)

When I use grunt to compile less files, I get a parse error:

ParseError: Unrecognised input in pub/static/frontend/[vendor]/[theme]/[lang]/css/source/_typography.less on line 1, column 16:
>> 1 .lib-font-face (
>> 2   @family-name:'OpenSans Condensed Light',

What am I doing wrong here?


texts: having different visibility for different store views

texts:
I would like to be able to have the ability to just have different store views with particular visibility and not all follow the same strcuture - i know this is possibly by clicking the top left dropdown on store view but we want to be able to do this via CSV or Magmi CSV - and this unfortunately puts it into 2 lines.

Is there a way to code a fix so that particular store views always show in catalog?

We also dont want to create new categories as this adds a further level of complexity.

Thank you,
Chris


texts: Can we add and confirgure Elasticsearch on Magento 2.4 after Magento is already installed?

texts:
We are at our first installation, and we did install Magento 2.4 without Elasticsearch as we didn't know it was mandatory.
Now, sysadmin added Elasticsearch as a service on the server, but in Magento -> Store -> Settings -> Catalog Search, we have no options.
We see that we should have installed Elasticsearch prior to installing Magento.
Is there a solution without reinstalling everything?
Thank you.


texts: I have spent hours searching forums and trying several methods but cant get anywhere. does anyone know how to order all sub categories in magento to display alphabetically front end A-Z?


texts: Magento Development environment database setup

texts:
Our company is new at Magento development so we are still figuring out a good dev cycle. I read the guide that Magento provided. But still not sure on how to develop with a team (5-10 people). Our goal is that we each have our own environment where we can code custom module(s) and we have our own (feature) branch in Git. My question is should we use a shared database or each have our own database? Here's is what I think about pro's and con's for each option:

Shared database

PRO'S

We have the same cms content / products and dummy data only needs to be added once
If we go live we don't have to figure out which one is the right one to copy or to export the configuration from.

CON'S

Someone installed a module and disabled it but other developers do not have the code yet.
The Base_url is different for some environments

Separate database

PRO'S

Make changes not worrying that other developers will have a problem

CON's

We need a way to merge the database's into one.

So are there other pro's con's that you? Know how are you working? Which method would you recommend?


texts: Where does Magento decrement quantity of a product after the order is placed?

texts:
I need to check the Product Salable Quantity of a product after a successful order to change one of the product´s attributes.

I keep getting the product salable quantity before It´s decremented. Where can I insert my code?

Thank you!


texts: Tried to install a patch on my EE 1.14.2 store and I got a weird error

texts:
exxxitt@p3plcpnl0539 [~/public_html]$ sh SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch
diff: unrecognized option '--git'
diff: Try `diff --help' for more information.
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 2: index: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 3: ---: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 4: +++: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 5: @@: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 6: usps_Express Mail Hold For Pickup,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 7: usps_Express Mail International,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 8: usps_First-Class Mail International Package,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 9: -: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 10: +: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 11: +: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 12: usps_First-Class Mail International Large Envelope,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 13: usps_First-Class Mail International,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 14: usps_Global Express Guaranteed (GXG),: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 15: usps_USPS GXG Envelopes,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 16: usps_Global Express Guaranteed Non-Document Non-Rectangular,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 17: usps_Media Mail,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 18: -: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 19: +: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 20: +: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 21: usps_Express Mail,: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 22: usps_Priority Mail: command not found
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 23: syntax error near unexpected token `)'
SUPEE-935_EE_1.12.0.2_v1-2013-01-23-05-20-54.patch: line 23: `         ))) {'

I've tried to install git because i believe that's why i can't just run the patch like i usually would.

SH and then whatever patch goes here:

Also, i don't have root access because this is a shared server. So it will be tough to install other package variations.

What should i do?


texts:
we done the changes in production mode and now we are trying to make it live but facing issue "theme css,js not loading".

require js error after deploying.

we have tired with some commands but not getting final solution.


texts: when my Cron got executed I am getting Luma image as Header Image in Email instead of my custom Image. When I write the same functionality as API i am getting the right Image. Can some one help me on this?


texts:
For a own test.phtml I need a filter by Product Attribute and Category.
if the product is in category X and have custom-attribute x
echo sku

what is the right code?

I found solutions for each (categoryfilter / attributefilter) but not a combination of both.


texts: Magento2 - How to override Currency::formatTxt

texts:
Function formatTxt() inside class Magento\Directory\Model\Currency is in charge of formatting the 'Price' throughout the shop.

I want to change its return value, but I don't know how.
Thanks for your helps in advance :)

--------- EDIT thanks to @Ankit Shah -----------

As mentioned in "How to Override Core Block, Model and controller in Magento2" I created a module named Amaj_CorePlugin and did a module:enable and setup:upgrade to activate it.

Its app/code/Amaj/CorePlugin/etc/di.xml code is as follows:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Directory\Model\Currency" type="Amaj\CorePlugin\Model\Currency" />
</config>

The app/code/Amaj/CorePlugin/Model/Currency.php code is as follows:

<?php

namespace Amaj\CorePlugin\Model;

class Currency extends \Magento\Directory\Model\Currency
{

    /**
     * @var \Psr\Log\LoggerInterface
     */
    protected $logger;

    public function __construct(
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Locale\FormatInterface $localeFormat,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Directory\Helper\Data $directoryHelper,
        \Magento\Directory\Model\Currency\FilterFactory $currencyFilterFactory,
        \Magento\Framework\Locale\CurrencyInterface $localeCurrency,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    )
    {
        parent::__construct(
            $context, $registry, $localeFormat, $storeManager, $directoryHelper, $currencyFilterFactory, $localeCurrency,
            $resource, $resourceCollection, $data
        );

        $this->logger = $logger;
    }

    /**
     * @param float $price
     * @param array $options
     * @return string
     */
    public function formatTxt($price, $options = [])
    {
        $this->logger->info('++++++++++++++++Amaj formatTxt');
        return 'customOutput$';
    }
}

My formatTxt doesn't get called. I think the problem is that the Magento_Directory:Model\Currency has not been set inside any di.xml at all. So the "preference" is useless against it.
What do you think should I do?


texts:
I have referred this link for set session variable however I bit confused which one is adapt for my situation.

\Magento\Backend\Model\Session
\Magento\Catalog\Model\Session
\Magento\Checkout\Model\Session
\Magento\Customer\Model\Session
\Magento\Newsletter\Model\Session

I am looking for carry chat session so I don't mind whether they customer or visitor, I need to give supports to both.

my question is

What is the right session to handle the session of both visitor and customer.


texts:
Hi I have a castom module news. When I create news I save all my informations in table news. But I need to save author input to table Authors.

And display all informations here

This is my News Grid!!!
Please Help Me

class Task_News_Block_Adminhtml_News_Grid extends Mage_Adminhtml_Block_Widget_Grid
{

    protected function _prepareCollection()
    {
        $collection = Mage::getModel('tasknews/news')->getCollection();
        $newsAuthorsTable = Mage::getSingleton('core/resource')->getTableName('tasknews/news');

        $collection->getSelect()->join(array('authors'=> $newsAuthorsTable),
           'main_table.news_id=authors.news_id',
           array());
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    protected function _prepareColumns()
    {

        $helper = Mage::helper('tasknews');

        $this->addColumn('news_id', array(
            'header' => $helper->__('News ID'),
            'index' => 'news_id'
        ));

        $this->addColumn('title', array(
            'header' => $helper->__('Title'),
            'index' => 'title',
            'type' => 'text',
        ));

    $this->addColumn('author', array(
            'header' => $helper->__('Author'),
            'index' => 'author',
            'type' => 'text',
        ));

        $this->addColumn('created', array(
            'header' => $helper->__('Created'),
            'index' => 'created',
            'type' => 'date',
        ));

        return parent::_prepareColumns();
    }

 protected function _prepareMassaction()
    {
        $this->setMassactionIdField('news_id');
        $this->getMassactionBlock()->setFormFieldName('news');

        $this->getMassactionBlock()->addItem('delete', array(
            'label' => $this->__('Delete'),
            'url' => $this->getUrl('*/*/massDelete'),
        ));
        return $this;
    }

    public function getRowUrl($model)
    {
        return $this->getUrl('*/*/edit', array(
                    'id' => $model->getId(),
                ));
    }


texts: Access Magento Connect Manager Without Using Admin Panel

texts:
Is it possible to access my Magento Connect Manager without using the Admin dashboard?

I installed an extension that has locked up my site, even my admin page. I need to go through a backway to uninstall that extension. How can I do that?


texts: How to extend customer registration with attributes specially radio button

texts:
I want to extend the customer Registration form of the frontend with some custom customer attributes. I tried a TextBox and a RadioButton. The TextBox works perfektly.
But the RadioButton value won't stored.

What is wrong?

I added a sql scipt

...
$installer->addAttribute('customer', 'test2', array(
    'type'              => 'int',
    'input'             => 'select',
    'source'            => 'eav/entity_attribute_source_boolean',
    'label'             => 'Test2',
    'global'            => 1,
    'visible'           => 1,
    'required'          => 0,
    'default'           => 0,
    'sort_order'        => 130
));

$attribute = $eavConfig->getAttribute('customer', 'test2');
$attribute->setData('used_in_forms', $forms);
//$attribute->setData('is_user_defined', 0);
$attribute->save();

$installer->addAttribute('customer', 'test', array(
    'type'              => 'text',
    'input'             => 'text',
    'source'            => 'eav/entity_attribute_source_boolean',
    'label'             => 'Test',
    'global'            => 1,
    'visible'           => 1,
    'required'          => 0,
    'default'           => 0,
));

$attribute = $eavConfig->getAttribute('customer', 'test');
$attribute->setData('used_in_forms', $forms);
//$attribute->setData('is_user_defined', 0);
$attribute->save();
...

I extend my config

<global>
    ...
    <fieldsets>
        <customer_account>
            <test>
                <create>1</create>
                <update>1</update>
            </test>
            <test2>
                <create>1</create>
                <update>1</update>
            </test2>
         </customer_account>
    </fieldsets>
    ...
</global>

I extend a copy of register.phtml

            *<?php echo $this->__('Test') ?>

                <input type="text" autocapitalize="off" autocorrect="off" spellcheck="false" name="test" id="test_1" value="<?php echo $this->escapeHtml($this->getFormData()->getTest()) ?>" title="<?php echo $this->quoteEscape($this->__('Test')) ?>" class="input-text required-entry" />

            *<?php echo $this->__('Do you want to ...?');?>

                <input type="radio" id="yes_test2" name="test2" value="0" <?php if($this->getFormData()->getTest2()): ?> checked="checked"<?php endif; ?> class="validate-one-required-by-name" />

                    <span title="<?php echo $this->__('Yes');?>"><?php echo $this->__('Yes');?>

                <input type="radio" id="no_test2" name="test2" value="1" checked="checked" class="validate-one-required-by-name" />

                    <span title="<?php echo $this->__('No');?>"><?php echo $this->__('No');?>


texts: Upgrading from Magento 2.2 to 2.3 Undefined index

texts:
I created a new installation of a Magento 2.3.5-p2 and I want to use or get the data from a database that were used in a Magento 2.2 installation.
I corrected the type from some tables that could not be enum that's fine but then this appears when I run setup:upgrade
Notice: Undefined index: CUST_pecustomer_entity in /var/www/webroot/ROOT/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

And idk what to do, it doesn't seem to be an old extension problem that's a core table that's why I'm kinda lost here.
I checked in app/etc/config.php and the search is already at 'Magento_Search' => 1 and searched database for any references to CUST_pecustomer_entity but no luck.
Any solution for this?
Thanks :D


texts:
I am working on a Magento site. Version of the site is 1.8.1.0. I configured Payment Method like below.

But Payment is not gathered after order. Why it is happening ?


texts: Magento 2.3.2 Product Export Message: "Message is added to queue, wait to get your file soon"

texts:
when i have product export and below message showing

  Error: "Message is added to queue, wait to get your file soon"

Also i run cron command like

php bin/magento cron:run

still not downloading CSV file

i know here asking someone but this is not working for me
Any help would be appreciated.

Thanks.


texts: Magento 2 Js want to call from my theme?

texts:
I want to call the complete js files from vendor to Smartwave/porto theme.

vendor/magento/module-catalog/view/base/web/js/price-box.js
vendor/magento/module-catalog/view/base/web/js/price-options.js

As per the customization i need complete two files.

My theme Name is: Smartwave/porto

I kept the above files in the below path:

app/design/frontend/Smartwave/porto/Magento_Catalog/web/js/price-box.js
app/design/frontend/Smartwave/porto/Magento_Catalog/web/js/price-options.js

did the php bin/magento setup:static-content:deploy

but unable to get the changes.

Please suggest me thanks


texts: Downloadable products - zip files cut off at just over 1GB mark

texts:
We've had a problem with our Magento store for a long time now (used to be Magento 1.4, recently upgraded to 1.9.2) and after a few days pulling my hair out trying to find a solution without success, I thought I'd post here in case anyone has had similar problems or has any ideas what else to try.

Our Magento store sells some digital products - ranging in size from a few hundred MB to a couple of GB.

A lot of customers complain on the larger products that their downloads cut off at around the 1 gigabyte mark, and lots of testing ourselves over the last few days I've been unable to figure out the cause or a solution.   I've been testing with 1.9GB file that has caused problems for many of our customers.  (Note however that the download does not fail every time -- just more often than not!)

When the file is downloaded directly -- via the filesystem or a custom test .php script -- the download almost always finishes in its entirety.
When downloaded via Magento downloadable product link (testing via 'sample'), the download almost always stalls and then cuts off at around 1.08GB - 1055MB (different byte sizes each time -- have hex-inspected the end of the downloaded files and can't see any incorrect headers etc).  This is the same thing that customers report, and I can see this in the log files too -- but not everyone experiences this, and not every time -- just the vast majority of times!

Our Magento 1.9.2 is running on a dedicated server, running Centos with nginx.

Things that I have tried changing in order to solve this problem are:

disabling CloudFlare (but problem occurred before I ever used CloudFlare, and persists after it is disabled)
disabling nginx gzip support
increasing PHP.ini gc.max_session_lifetime setting
increasing max_execution_time setting
set the 'sample link' to use a custom php script that uses X-Accel-Redirect (script downloads OK when accessed directly, but commonly fails at ~50% when used through Magento)

I've attempted to inspect the HTTP traffic to find out exactly what's going on, but have been unable to.  I also haven't been able to spot any pattern around when

When inspecting the request & response headers between the 'working' direct-download requests and the non-working Magento download requests, I can see some differences, for example:

Magento sends Content-Type as application/zip, custom scripts send Content-Type as application/octet-stream;
Magento sends Expires: header, custom scripts do not. (Expires: header says 1981, if that may make any difference!)
Magento sets cookies, the custom scripts do not.
Magento sends an X-Powered-By: PHP/5.4.27 header, the custom scripts do not;
Custom scripts send an ETag: header, Magento does not;

Short of attempting to implement a replacement Downloadable class that hands file downloads off to nginx via X-Accel-Redirect -- and I don't know if that would even help or just be a waste of time? -- I don't know what to try next.

If anyone has any ideas where to look, light to cast on the technologies involved - or even better if you've had this problem yourself and know how to fix it!


texts:
I have just installed magento 1.9 for my store, and I am now trying to make a custom theme...

I would like to use the new RWD theme option for tablets/smartphones best compatibility.

I then read the knowledge base document called "Magento CE 1.9 and EE 1.14 Responsive Web Design Developer's Guide" and started the different steps :
- Ruby, compass and cass installed on my computer
- Magento cache disabled on my store on my web host
- Copying files to create a custom theme (both on my local computer and on my web host)
(all the steps were passed successfully)

But now, I am a bit lost on what to do…

First questions : If I understand correctly, I must modify the files locally, compiled them with compass and then reload them on my web host? I am right?

Second question : In the file copying process of the knowledge base document, not all the files of the default theme are copied. I then think some of the default theme files are still used if not redefined in the new theme? I am right?

I would like to first change the structural blocks of the store…

I would like the header, the left, the content and the footer block (no right block).
Where / How can I Modify this?

Where / how can I modify the content block to structural block mapping?

Sorry for all these questions and thank you for your help,


texts: Redirect all http:// request to https://

texts:
Earlier i have posted this question : https://stackoverflow.com/questions/36104047/how-to-redirect-all-http-requests-to-https-on-magento but didn't get any reaction.

Here is my site URL : www.trendy-mode.nl
it will redirect you to : https://www.trendy-mode.nl/

Now problem is menu link or any other sub-links are not redirect with https://
EX: There is menu like - NIEUW | KLEDING | SCHOENEN | ACCESSOIRES etc.
If you click on NIEUW menu, a new page will be open but not redirect with https://

I have tried a lot .htaccess tweaks but not works. Anybody here to help me on this?

Thank you in advance!


texts: Magento 2 add tooltip for the discount section on checkout page?

texts:
I would like to display tooltip on checkout page for discount section in the magento2.
Can anyone provide me the steps to achieve this? Please refer the screenshot


texts: Add column to order grid in customer edit page - M2

texts:
How can i add new column in order grid in customer edit page?
I want to show custom columns records from sales table in order grid in customer edit page.
I found this file but also not able to overwrite:
vendor\magento\module-customer\Block\Adminhtml\Edit\Tab\Orders.php

Any help will be appreciated! Thanks.


texts:
HI am trying to restrict customer from adding product to cart.
i have a condition where i want to check the item type in the cart if customer adds the same product type to the cart then it should be success else if the product in cart does not match with the product type then its should show an error and should be added to cart
below is my code to restrict product from adding cart but its not working
RestrictAddToCart.php
<?php
namespace Mageplaza\HelloWorld\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Exception\LocalizedException;

    protected $_cart;
    protected $_messageManager;
    protected $_request;
   protected $collectionFactory;
    protected $formKey;
    protected $product;
 protected $checkoutSession;
  protected $product;

    public function __construct(
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Framework\Message\ManagerInterface $messageManager,
        \Magento\Framework\App\RequestInterface $request,
        \Magento\Framework\Data\Form\FormKey $formKey,
         \Magento\Checkout\Model\Session $checkoutSession,
          \Magento\Catalog\Model\ProductFactory $product,
         \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory,
    ) {
        $this->_cart = $cart;
        $this->_messageManager = $messageManager;
        $this->_request = $request;
         $this->collectionFactory = $collectionFactory;
         $this->product = $product;
         $this->formKey = $formKey;
          $this->checkoutSession = $checkoutSession;
    }

    public function getProductCollection()
            {
                $productCollection = $this->collectionFactory->create();
                $productCollection->addAttributeToSelect('*');
                foreach ($productCollection as $product){
                     echo 'id  =  '.$product->getTypeId().'<br>';

                }

    public function execute(\Magento\Framework\Event\Observer $observer) {

        $productId = $product->getTypeId();
          $params = array(
            'form_key' => $this->formKey->getFormKey(),
            'product_id' => $productId, //product Id
            'qty'   => 1 //quantity of product
          );

        $product = $observer->getEvent()->getProduct();
       $_product = $this->product->create()->load($productId);
        $this->cart->addProduct($_product, $params);

        $item = $this->cart->getQuote()->getItemByProduct($_product);
        if ($item == $productId) {
            $this->cart->addProduct($_product, $params);
        } else {
            echo "please remove ". $productId;
        }

    }
}

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_checkout_cart_add">
        <observer name="customname" instance="Mageplaza\HelloWorld\Observer\RestrictAddToCart" />
    </event>
</config>

any help on this thankss


texts: CMS Hierarchy isn't displaying menu left magento 2.1.1

texts:
I have created some CMS Hierarchy, in my configuration I set to display menu left. It work correctly for node children, however when I go to parent node(Main menu), the menu left disappear, also the item in the main menu apear as not selected.
I want to show the menu left when I go to root item of CMS Hierarchy


texts: Magento2 interface not found in Model class

texts:
I am new to Magento2. I am developing a payment method and I am getting the  message:

  Fatal error:  Interface 'Test\TestThesis\Model\Test\TestThesis\Api\Data\CryptocurrencyInterface' not found in C:\xampp\htdocs\magento\app\code\Test\TestThesis\Model\Cryptocurrency.php on line 9

I have added the dependency in di.xml. Is there something that I am missing and I am getting this message?

<?php

namespace Test\TestThesis\Model;

use Magento\Framework\Model\AbstractModel;

class Cryptocurrency extends AbstractModel implements Test\TestThesis\Api\Data\CryptocurrencyInterface
{

    protected function _construct(){
        $this->_init('Test\TestThesis\Model\ResourceModel\Cryptocurrency');
    }

    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    ) {
        parent::__construct($context, $registry, $resource, $resourceCollection, $data);
    }

    /**
     *
     * {@inheritdoc}
     * @see CryptocurrencyInterface
     */
    public function getId(){
        return $this->getData(self::ENTITY_ID);
    }

    /**
     *
     * @param type $id
     * @return type
     * @see CryptocurrencyInterface
     */
    public function setId($id){
        return $this->setData(self::ENTITY_ID, $id);
    }

And the interface:

<?php

namespace Test\TestThesis\Api\Data;

/**
 * Interface CryptocurrencyInterface
 *
 * @package Test\TestThesis\Api\Data
*/
interface CryptocurrencyInterface
{

    const ENTITY_ID = 'id';
    const ORDER_ID = 'order_id';
    const AMOUNT_DEPOSIT = 'amount_deposit';
    const STATUS = 'status';

    /**
     * @return mixed
     */
    public function getId();

    /**
     * @param $id
     *
     * @return mixed
     */
    public function setId($id);


texts: CMS Pages are not adding blocks in {{ }} SUPEE-6788

texts:
On Magento 1.9.2.2 patch1 a cms page content disappears when I add a block like:

{{block type="imprint/field" value="shop_name"}}.

If I remove it, the page (text) content is back again.

Anybody an idea where this could come from? It is the same with all blocks added like this.


texts: How to add this category in marketing menu?

texts:
I want to add new category called aaa and a link called bbb.. in magento2

Thanks for the help.


texts:
I would like to understand when (and why) should I use <action method="insert">...</action> instead of using <block type="... />.

Example: move cart sidebar from left to right column :

1/

<reference name="left">
 <action method="unsetChild">
  <blockName>cart_sidebar</blockName>
 </action>
</reference>

2.1/

<reference name="right">
 <block type="checkout/cart_sidebar" name="cart_sidebar" tempalte="checkout/cart/sidebar.phtml" />
</reference>

2.2/

<reference name="right">
 <action method="insert">
  <blockName>cart_sidebar</blockName>
 </action>
</reference>

2.1 or 2.2 ?

Thanks


texts: Email template 'customemail_email_template' is not defined. in magento2

texts:
hello everyone i am sending mail to admin form details it is

  Getting error : Email template 'customemail_email_template' is not
  defined.

The link i have referred :
http://www.codextblog.com/magento-2/sending-custom-emails-using-custom-module-in-magento-2/


texts: Magento Custom Register Page - Redirect Issue

texts:
I created a custom register-trade.phtml for trade customer signups that I am pulling into a CMS page.

The issue is if a customer enters something wrong e.g. their email is already in use it redirects to /customer/account/create/ and shows the normal register form.

This form is different, has different fields and ultimately will not sign the user up in the trade group.

Can I redirect to the trade register page and display the error rather than going to /customer/account/create/ ?


texts:
I have spent the last couple of days trying to figure out how to pass variables from my controller to my model. I am trying to build a very simple product filter that takes some form inputs and builds a product collection based on them. I have the form built and I am using AJAX:

jQuery.ajax(
    {
        url: formURL,
        type: "POST",
        data: {
            location : location,
            width : width
        },
        success: function() {
            alert('form good');
        },
        error: function() {
            alert('form issue');
        }
    });

to post to my controller:

    class Custom_GateSelector_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $gate_location = $this->getRequest()->getPost('location');
        $gate_width    = $this->getRequest()->getPost('width');
    }
}

Then I need the two variables there to be available in my model:

    class Custom_GateSelector_Model_Products extends Mage_Catalog_Model_Product
{
  public function getItemsCollection()
  {
      $topStairs = 'yes';
      $gateWidth = 29.00;
      $rootcatID = Mage::app()->getStore()->getRootCategoryId();

      $collection = $this->getCollection()
          ->addAttributeToSelect('*')
          ->addAttributeToFilter('gate_max_width', array('gt' => $gateWidth))
          ->addAttributeToFilter('category_id', array('in' => $rootcatID))
          ->addAttributeToFilter('type_id', array('eq' => 'simple'))
          ->addAttributeToSort('price', 'DESC')
          ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));

      return $collection;
  }
}

I've tried the Mage::register('gate-location', $gate_location); method but I can't access them in the Model class from some reason.


texts:
I just tried to upgrade from Magento 2.2.6 to 2.3 and composer wouldn't let me because of the Matomo extension fron henek. So for now some dependency restrictions seem to prevent an upgrade.

https://github.com/henkelund/magento2-henhed-piwik

Any ideas to get this working?


texts:
it not work ! please help me!

system.xml

<menu_category>
                            Menu Category
                            <frontend_type>select</frontend_type>                             <source_model>MW_News_Model_Config_Source_category</source_model>
                            <sort_order>2</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </menu_category>

in Model: Category.php

<?php
class MW_News_Model_Config_Source_Category
{
   public function toOptionArray()
   {
       $kq = array(
           array('value' => 'letf', 'label' => 'Left'),
           array('value' => 'right', 'label' => 'Right'),
           array('value' => 'disable', 'label' => 'Disable'),
       );

       return $kq;
   }
}
?>

template Category_right.phtml

<?php
$kq = (int) Mage::getStoreConfig('mw/news/menu_category');

    if ($kq == 'right') {

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

    <?php echo $this->getMenu(); ?>

}

.xml

<reference name="right">
            <block type="mw/menu" name="category_menu_right" before="-">
                <action method="setTemplate">
                    <template>mw/news/category_right.phtml</template>
                </action>
            </block>
        </reference>


texts:
I am working on a Magento 2.1.7 shop.

On my category pages, I need to disable "As low as" price, as it ruins the products grid.

I want to hide it on configurable and non-configurable products, but only on the category pages. If possible, not with CSS (display: none).

What is the easiest and/or the most appropriate way to do this?


texts: Magento 2.2 Easy way to add a size chart in PDP

texts:
Assuming I have a webshop with shoes, jackets, t-shirts, ect. for men and women, what would be the best way to implement size charts for ant of these products, in a way that they show in the product page.

I really do not know how, but I would like to see of it's possible but customizing the code, and not by purchasing any expensive extension.

xml code:

<referenceBlock name="product.info.options.wrapper">
    <block class="Magento\Framework\View\Element\Template"
           name="size-guide"
           template="Magento_Swatches::product/view/sizeguide.phtml"
           before="product.info.options.swatches" />
</referenceBlock>


texts: How and where do I fix this math error? Cart totals are being added/subtracted wrong

texts:
Thank you in advance for any help.

I am not sure when this happened. It seems to only be for our home state as that is the only place we charge tax. In the cart it adds the shipping for the Grand Total Incl. Tax then it subtracts the tax for the Grand Total Excl. Tax.

204.48+20.00=224.48 (bottom number)
224.48-13.47=211.01 (middle number)

In the checkout it does display the correct amount as seen here.

But when the order comes to us and what it shows in the back end have it backwards like the cart. What the heck am I missing and where can I fix this? Thank you for any help.


texts: New Attribute set Product page not displaying first half of the content

texts:
I created new attribute set [ Wallposter ] & created new product with that attribute set.

in frontend , first half of the product page is not displaying , but 2nd half is displaying fine.

I done reindex, still not working.....

New product with new attribute set link

old product with old attribute set link

New product image :

Old Product image :


texts: Magento : Custom extension overwrites gender values. How to Fix?

texts:
Shop owner called telling me the gender select in the store contains Apple and Banana  instead of male and female. Turns our this was the case in all form frondend/backend.

After some digging I found an extension with an mysql4-upgrade file. The only place I got any Apples, so this must be causing this problem:

$installer->addAttribute('catalog_product', 'p_layout', array(
             'label'             => 'Motiv',
             'type'              => 'varchar',
             'input'             => 'select',
             'backend'           => 'eav/entity_attribute_backend_array',
             'frontend'          => '',
             'source'            => '',
             'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
             'visible'           => true,
             'required'          => true,
             'user_defined'      => true,
             'searchable'        => false,
             'filterable'        => false,
             'comparable'        => false,
             'option'            => array (
                                            'value' => array(
                                                '1' => array('Apple'),
                                                '2' => array('Banana'),
                                            )
                                        ),
             'visible_on_front'  => false,
             'visible_in_advanced_search' => false,
             'unique'            => false
));

$attributeId = $installer->getAttributeId('catalog_product', 'p_layout');

if ($attributeId) {
    $option['attribute_id'] = $attributeId; //p_layout
    $option['value']['optionone'][0] = 'Apple';
    $option['value']['optionone'][1] = 'Apple';
    $option['value']['optionone'][2] = 'Apple';
    $option['value']['optionone'][3] = 'Apple';
    $option['value']['optiontwo'][0] = 'Banana';
    $option['value']['optiontwo'][1] = 'Banana';
    $option['value']['optiontwo'][2] = 'Banana';
    $option['value']['optiontwo'][3] = 'Banana';

    $installer->addAttributeOption($option);
    $installer->addAttributeSet('catalog_product', 'Stuff');

In eav_attribute_option_value I found option_id 1 and 2 being Apple and Banana. I guess during an update or the recent page move to another server this was overwritten.

Any idea how to fix this? I would like to avoid having this mess again...

Looks to pretty much like this: Upgrade script - Create new select attribute with options

Could the missing 'source'        => 'eav/entity_attribute_source_table' causing this problem?

Or is '1' => array('Apple') the problem? I noticed in other places they set the value like this: array('Apple', 'Banana')


texts: Display all related products independently of cart

texts:
As per answerfrom Patrick Steenks there, when a related product is already in cart, it is not displayed in the related product block.

How to display it anyway?


texts: Rebuilding catalogsearch_fulltext index stucked

texts:
I am trying to rebuild catalogsearch_fulltext index but the process always get stucked in the middle. Normally it was running 3-4 hours but now it did not finish after 19 hours. I already killed the process and started it again but same problem.

web-user 17756 52.7  0.9 646208 166816 ?       S    09:53  90:20 php indexer.php --reindex catalogsearch_fulltext

Looks like the database table is blocked. I can't run SELECT COUNT(*) as table_size FROM catalogsearch_fulltext anymore. It just runs for ever. ok, now this query works again but indexer is stucked at 92381 of 152362 rows.

Why does is the table blocked and how can I stop this from happening?

Update

I read about innodb deadlocks and SHOW ENGINE INNODB STATUS is showing me one transaction with INSERT INTO catalogsearch_fulltext ... that is running for every ACTIVE 11636 sec:

---TRANSACTION 0 360093642, ACTIVE 11636 sec, process no 14899, OS thread id 139663553517312
47 lock struct(s), heap size 6752, 12055 row lock(s), undo log entries 6018
MySQL thread id 15706, query id 2449417 localhost db-user-1 Table lock
INSERT INTO `catalogsearch_fulltext` (`product_id`,`store_id`,`data_index`) VALUES ('

also it shows ~10 transactions with that looks like they are coming from user search queries :

INSERT INTO `catalogsearch_result` SELECT 763 AS `query_id`, `s`.`product_id`,
  MATCH (s.data_index) AGAINST (' \"coldplay\" \"viva\" \"la\" \"vida\"' IN
  BOOLEAN MODE) AS `relevance` FROM `catalogsearch_fulltext` AS `s` ...

Is it possible that user queries create this deadlock?


texts: Why Magento admin panel is often called backend?

texts:
Back-end is a server side code and not admin part of a front-end, we all nkow this.
Then why it keeps been called backend?


texts: How can I programmatically create a RESTful api role and consumer?

texts:
How can I create a RESTful role and consumer during the installation of an extension (module) using a data-install script located at:

app/code/community/Namespace/Module/data/namespace_module_setup/data-install-1.0.0.php


texts:
This is my xml code:

<admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <mymodule before="Mage_Adminhtml">Mynamespace_Mymodule_Adminhtml</mymodule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <mymodule>
                    <file>mymodule.xml</file>
                </mymodule>
            </updates>
        </layout>
    </adminhtml>

This is my controller:

class Mynamespace_Mymodule_Adminhtml_ShipmentController extends Mage_Adminhtml_Controller_Action
{

    public function indexAction()
    {
       echo '1';
       exit();
        $this->loadLayout();
        $this->renderLayout();
    }
}

This is my layout:

 <?xml version="1.0"?>
    <layout version="0.1.0">
        <adminhtml_mymodule_shipment_index>
            <reference name="content">
                <block type="mymodule/shipment" template="mymodule/shipment.phtml" name="mymodule_shipment">
                </block>
            </reference>
        </adminhtml_mymodule_shipment_index>
    </layout>

Can you please tell me why I don't get the echo '1' exit?

Also when I access this url

<a href="<?php echo Mage::helper("adminhtml")->getUrl("mymodule/shipment/index/order_id/".$_order->getId()) ;?>">myurl

I get a 404 error


texts: How to check IsHomePage in Magento 2? Are we on the homepage?

texts: I want check current page is home page, category page, product page & cms page in magento 2


texts:
Suddenly the tabs in products stopped working. (products/description and reviews). I am using Madison magento theme.

Even I add description in back end it's not displayed any clues what might be the issue.

http://www.clients.avant8.com.au/nessco-pressure-systems/products/compressor-system/csk-compressor.html


texts: Custom products attributes stopped updating from dashboard or programmatically

texts:
So, on this Magento 1 instance, everything worked fine until a couple of months ago.

I have approx 20 custom attributes attached to an attribute set for a Product. Two of them are not saving. If change the value and click save it says Product has been saved but the value is the same.

I've tried reindexing, disable the cache and save them programmatically, nothing works anymore. If I create new attributes, they are not saving either.

How can I fix this as these attributes were working before.?


texts: Magento 1.9: How to add customer group on registration page

texts:
I have followed every tutorial I have found and doesn't work. I am trying to add the customer groups on the customer registration page but its not working. I hope this question will help others also as all the previous questions based on this are too old. Please, check below my code:

app/code/core/mage/customer/etc/config.xml

<global>
..........
<customer_account>
 <group_id>
   <create>1</create>
   <update>1</update>
</group_id>
</customer_account>
..........
</global>

app/code/core/mage/customer/controllers/AccountController.php

Replace this

$customer->getGroupId();

with

if($this->getRequest()->getPost('group_id'))
{
   $customer->setGroupId($this->getRequest()->getPost('group_id'));
}
else
{
   $customer->getGroupId();
}

app/design/frontend/base/default/template/persistent/customer/form/register.phtml

<?php echo $this->__('Group') ?>*

<select name="group_id" id="group_id" title="<?php echo $this->__('Group') ?>" class="validate-group required-entry input-text" />
<?php $groups = Mage::helper('customer')->getGroups()->toOptionArray(); ?>
<?php foreach($groups as $group){ ?>
<option value="<?php print $group['value'] ?>"><?php print $group['label'] ?></option>
<?php } ?>
</select>


texts: How to display custom attribute brand value on custom phtml file?

texts:
I want to display custom attribute brand value on custom phtml file.

I tried Below code in phtml file but not working

<?php echo $_product->getResource()->getAttribute('brand')->getFrontend()->getValue($_product);?>

Is there any solution please share it.


texts: Magento2 weird checkout page issue on click of Proceed to Checkout button

texts:
Why does my checkout page navigate from checkout/cart to /checkout instead of checkout/onepage/success even though i have not done any modification to the Checkout module in magento 2

This issue popped up all of a sudden, it happens when i click on 'Proceed to Checkout' button

No errors in var/log or system log does not say anything related to this!!

Where might be the issue?


texts:
I have on admin panel in menu section for example

 "review & rating"
     ->"customer review"
           -> "pending review"
           -> "all review"

that is "customer review" has two sub-links "pending review" & "all review"

Now when i click on "customer review" it will show "pending review" page .

I want to merge or say append the contents of "all review" on "pending review" page.So that when i click on "customer review" it will show "pending review" page which will show both the pages contents.

Help me out to solve this.


texts: RewardspointsFactory class does not exist

texts:
Please anyone review my code.
Facing this error.
Exception #0 (ReflectionException): Class Sugarcode\Test\Model\ResourceModel\Test\RewardspointsFactory does not exist
Exception #1 (ReflectionException): Class Sugarcode\Test\Model\ResourceModel\Test\RewardspointsFactory does not exist

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Sugarcode\Test\Model\Total;

class Fee extends \Magento\Quote\Model\Quote\Address\Total\AbstractTotal {

    /**
     * Collect grand total address amount
     *
     * @param \Magento\Quote\Model\Quote $quote
     * @param \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment
     * @param \Magento\Quote\Model\Quote\Address\Total $total
     * @return $this
     */
    protected $quoteValidator = null;

    protected $rewardspointCollectionFactory;

    public function __construct(
            \Magento\Quote\Model\QuoteValidator $quoteValidator,
            \Sugarcode\Test\Model\ResourceModel\Test\RewardspointsFactory $rewardspointCollectionFactory
            ) {
        $this->quoteValidator = $quoteValidator;
        $this->rewardspointCollectionFactory = $rewardspointCollectionFactory;
    }

    public function collect(
    \Magento\Quote\Model\Quote $quote, \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment, \Magento\Quote\Model\Quote\Address\Total $total
    ) {
        parent::collect($quote, $shippingAssignment, $total);

        $exist_amount = 0; //$quote->getFee();
        $fee = 200; //Excellence_Fee_Model_Fee::getFee();
        $balance = $fee - $exist_amount;

        $total->setTotalAmount('fee', $balance);
        $total->setBaseTotalAmount('fee', $balance);

        $total->setFee($balance);
        $total->setBaseFee($balance);

        $total->setGrandTotal($total->getGrandTotal() + $balance);
        $total->setBaseGrandTotal($total->getBaseGrandTotal() + $balance);

        return $this;
    }

    protected function clearValues(Address\Total $total) {
        $total->setTotalAmount('subtotal', 0);
        $total->setBaseTotalAmount('subtotal', 0);
        $total->setTotalAmount('tax', 0);
        $total->setBaseTotalAmount('tax', 0);
        $total->setTotalAmount('discount_tax_compensation', 0);
        $total->setBaseTotalAmount('discount_tax_compensation', 0);
        $total->setTotalAmount('shipping_discount_tax_compensation', 0);
        $total->setBaseTotalAmount('shipping_discount_tax_compensation', 0);
        $total->setSubtotalInclTax(0);
        $total->setBaseSubtotalInclTax(0);
    }

    /**
     * @param \Magento\Quote\Model\Quote $quote
     * @param Address\Total $total
     * @return array|null
     */

    /**
     * Assign subtotal amount and label to address object
     *
     * @param \Magento\Quote\Model\Quote $quote
     * @param Address\Total $total
     * @return array
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total) {

        $rewardspointCollection = $this->rewardspointCollectionFactory->create();
        $customerId = $quote->getCustomerId();
        $rewardspointCollection->addFieldToSelect('*')
                ->addFieldToFilter('dukaaniatest_id',$customerId);
        if(count($rewardspointCollection) > 0){
           $firstItem =  $rewardspointCollection->geFirstItem();
           return [
            'code' => 'fee',
            'title' => $firstItem->getData('title'),
            'value' => $firstItem->getData('author')
        ];
        }else{
            return [
            'code' => 'fee',
            'title' => 'Fee',
            'value' => 0
        ];
        }

    }

    /**
     * Get Subtotal label
     *
     * @return \Magento\Framework\Phrase
     */
    public function getLabel() {
        return __('Fee');
    }

}


texts: 3 column content in homepage with 1 column layout in Magento 2

texts:
I want to create a 3 column content on homepage which is having layout property as 1 column . How can i do this without changing the default layout of homepage?

Can i create a block with 3 columns and add it to the homepage?


texts: Magento product CSV sheet is not import, just show loading image

texts: I just update my Magento 1.9.0.1 to 1.9.2.2 but after update i noticed that Magento import is not working. As i upload product CSV sheet thorough System --> Import/Export --> Import (method), it didn't show any error (in check data) after when click on import data then it just show loading image nothing else, when i cancel the process product are in back-end but products are not showing at front-end, also it's not asking for any indexing. I optimized the database and again create core_url, delete all logs, but any of them works.


texts: How to add a block (which has no template) to another template

texts:
I have an extension with a Block/Tracking.php. It contains

class Custom_Analytics_Block_Tracking extends Mage_Core_Block_Template
{
    protected function _toHtml() { return "Hi"; }
}

The layout update file contains

<checkout_onepage_success>
    <reference name="content">
        <block type="analytics/tracking" name="analytics_tracking" />
    </reference>
</checkout_onepage_success>

I also added in success.phtml (it looks like this is not needed!)

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

But this doesn't add the return value of _toHtml() to the success page.
What am I doing wrong? Thank you so much!


texts: magento 2 iframe src code login not wokring

texts:
Hi I am facing some issues add to cart and login with iframe. I have created i frame code
<iframe id="Pawan" frameborder="0" align="middle" width="100%" height="100%" src='https://abc.pawan.com' scrolling="yes"></iframe>

Now i tried to test iframe code https://jsfiddle.net/westonruter/6mSuK/  placed iframe code site loading fine when i trying to login it redirecting to same page same thing for add to cart item not adding to cart in chrome browser only with iframe .Directly it working fine.
Here thing is i have main site pawan.com having subdomains *.pawan.com
can anyone have idea how to solve this i think it having session issue


texts: After Magento upgrade 1.6 to 1.9 its show error

texts:
Fatal error: Call to a member function getUsername() on a non-object
  in
  C:\wamp\www\magento-1.9\app\design\adminhtml\default\default\template\page\header.phtml
  on line 33


texts: Magento v2 REST API - use_config_manage_stock setter does not exist

texts:
\"UseConfigManageStock\" does not have corresponding setter in class \"Magento\\Catalog\\Api\\Data\\ProductInterface

I have sync between my backonffice applicaiton and Magento v2. this was working fine but all of a suddned it started gving above error.

I would appreciate for Any help?


texts: Theme's dashboard content is displaying in another theme

texts: I have a theme named Solwin. I have applied this theme before and changed it to Magento luma. Dashboard content in Solwin is showing up on homepage even after I selected luma theme. How to disable that? Any ideas


texts: Hide attribute type dropdown if no value

texts:
I use this code to hide attributes when they do not have data:

        <?php foreach ($_additional['items'] as $_data): ?>
         <?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>

                <?php echo $this->htmlEscape($this->__($_data['label'])) ?>
                <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

        <?php } ?>
        <?php endforeach; ?>

This works great, but not for the type dropdown attributes.
How can I also hide dropdown attributes, that do have any value?


texts: Magento 2: Email template grid is not working

texts: I'm using Magento 2.2.6. In Email templates, I can't see the grid table. On the other page, the grid table is working fine. I tried to manually remove static content and deploy but not working.


texts: When I upgrade Magento from 2.1.9 to 2.2.0 and run deploy, there is a problem occurred

texts:
Any guy who knows how to resolve this ?

thank you!


texts: Magento 2.2.2 - Import Product Images Categorically

texts:
To import all the product images, we are using below approach

On the Magento server, upload the image files to the default folder
for importing product images: pub/media/import
In the CSV data, enter the name of each image file to be imported on
the correct row, by SKU, and in the correct column according to
image type (base_image, small_image, thumbnail_image, or
additional_images).

Here I can upload all the prod images under folder pub/media/import. I have 10 categories and products associated with those categories.

How do I upload product images categorically? For example create
folders with category name in pub/media/import like
pub/media/import/categoryA, pub/media/import/categoryB and in CSV image path is
categoryA/prod-image-a.png, categoryB/prod-image-b.png


texts:
I would like add some static text to product views on product-info-main and should be multi language compatible how would I do that? As I understand I can inject static-block content but somehow is not working for me.

I added the following to my custom themes Maganeto_Catalog -> catalog_product_view.xml

   <block class="Magento\Cms\Block\Block" name="custom.text">
        <arguments>
             <argument name="static_text" xsi:type="string">custom</argument>
        </arguments>
   </block>

and created in backed a static block with id static_text but do not show up.


texts: Magento 2 Success page with trailing slash and without

texts:
We are experiencing some conversion tracking issues in our Magento
  2.3.3 installation.

We are using Native checkout with Paypal Payments Pro Hosted and Paypal Express.

We are having 2 versions of Success page being generate /success/ and /success

See the image below of 10 sample orders.

I can not find any relation between which orders hit /success/ and which hit /success it seems completely random. Orders hitting /success are not being tracked properly by google adwords/analytics conversion tracking. We do not get conversion data.

I have checked for patterns of the below:
Payment methods, country, logged in or guest, shipping method, order amount

I can't find any pattern that's resulting in certain customers hitting /success or /success/

Does anyone have any experience with this or what might be causing this issue?

Thanks


texts: How to Migrate Magento2 store to localhost?

texts:
I am trying to migrate an established Magento2 store from an EC2 server to work on my local developer environment.  I have the files downloaded in my root directory and and have backed-up the database and put the database into my new mysql database.  However, when I go to my localhost I get this...
Fatal error: Uncaught Magento\Framework\Exception\NoSuchEntityException: The store that was requested wasn't found. Verify the store and try again. in /Users/jonathanhelvey/UpperLimitsSite/httpdocs/vendor/magento/module-store/Model/StoreRepository.php:112 Stack trace: #0 /Users/jonathanhelvey/UpperLimitsSite/httpdocs/vendor/magento/module-store/Model/StoreRepository.php(127): Magento\Store\Model\StoreRepository->getById('1') #1 /Users/jonathanhelvey/UpperLimitsSite/httpdocs/vendor/magento/module-store/Model/StoreResolver.php(181): Magento\Store\Model\StoreRepository->getActiveStoreById('1') #2 /Users/jonathanhelvey/UpperLimitsSite/httpdocs/vendor/magento/module-store/Model/StoreResolver.php(126): Magento\Store\Model\StoreResolver->getDefaultStoreById('1') #3 /Users/jonathanhelvey/UpperLimitsSite/httpdocs/vendor/magento/module-store/Model/StoreManager.php(160): Magento\Store\Model\StoreResolver->getCurrentStoreId() #4 /Users/jonathanhelvey/UpperLimitsSite/httpdocs/generated/code/Magento/Store/Model/StoreManagerInterface/Pr in /Users/jonathanhelvey/UpperLimitsSite/httpdocs/vendor/magento/module-store/Model/StoreRepository.php on line 112

Does anyone know the right steps to migrate a Magento2 store to localhost from development.  There is no version control.  The store also does have 3rd parties extensions.


texts: How to override \Magento\Framework\Exception\NoSuchEntityException magento 2

texts:
I'm tryng to debug a "No such entity exception" error during the creation of a Credit Memo. I want to have a more explicit error message. I work in a Magento Cloud enviroment, so I can't modify the /vendor files.
I've created a new module to override a core method. The module has this path /app/code/Dev/Debug
Here are my files
/app/code/Dev/Debug/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Dev_Debug" setup_version="1.0.0">
    </module>
</config>

/app/code/Dev/Debug/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Framework\Exception\NoSuchEntityException" type="Dev\Debug\Exception\NoSuchEntityExceptionDebug" />
</config>

Then my override
<?php
namespace Dev\Debug\Exception;

use Magento\Framework\Phrase;

class NoSuchEntityExceptionDebug extends \Magento\Framework\Exception\NoSuchEntityException
{
    public function __construct(Phrase $phrase = null, \Exception $cause = null, $code = 0)
    {
        $debug = "";
        foreach (debug_backtrace() as $_stack) {
            $debug .= ($_stack["file"] ? $_stack["file"] : '') . ':' .
                ($_stack["line"] ? $_stack["line"] : '') . ' - ' .
                ($_stack["function"] ? $_stack["function"] : '');
        }

        mail("email@gmail.com","DEBUG", $debug);

        exit();

        if ($phrase === null) {
            $phrase = new Phrase('No such entity.');
        }
        parent::__construct($phrase, $cause, $code);
    }
}

So, I expect than when the error is raised, the system should send me an e-mail with the debug trace info. But nothing happens.
Can you see any error in my code?
Is it correct to adopt a custom module like mine?
Thank you in advance.


texts:
I'm using Magento 2.3.1, I have let's encrypt SSL installed, I want to force HTTPS in the admin area and the storefront end
in the admin panel, I go to
Stores > Configuration > General > Web

I put yet to "Use Secure URLs on Storefront" and yes to "Use Secure URLs in Admin"
That only enforces https in the admin area. I modifying .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

That doesn't work, I can't really play with apache that much, because I might break varnish which doesn't play well with HTTPS, tried that.
Is there an easy way to enforce HTTPS?


texts: Change shopping cart color when adding a product

texts:
I need when I put a product in the shopping cart, it changes color.

but I couldn't get it to do that.


texts: Magento 2 Cart Summary loading after code execution

texts:
When I visit the checkout page, the checkout summary loads after my custom.js file. This means when i'm trying to pull values from the summary to perform some logic on these values always return null.

Is there any way of me setting my custom.js file as the last file that gets loaded?


texts: Switch around two products generated by widget

texts:
In my CMS page, I am using widget to display two products:

{{widget type="catalog/product_widget_new" display_type="new_products" products_count="2" template="catalog/product/widget/new/content/new_grid.phtml"}}

Is there an easy way to switch the places of these two products?

UPDATE

Or, is there a way to call a product just by ID? That way, I can display the 2 products just singular by ID.


texts: Magento 1.9 Remove Trailing Slash from Cms page URL

texts:
Duplicate Content Issue

Example: https://www.example.com/test/

expectation:

https://www.example.com/test


texts: 404 not found error when new form, controller is added

texts:
I have created a new module with three forms, first two forms are working fine but when I created a third new form with controller, block and its xml file in layout.

It says 404 not found. I have done the same steps as for the previous two forms and they are working fine

also when I try to run di:compile command it is also not completely working it just stuck in this step

Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec 44.0 MiB

Below is the code

  routes.xml

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

  test_order_print.xml

<title>Return with revocation</title>

    <referenceContainer  name="content">
    <block class="Module\Test\Block\Order\Print" name="module_print" template="Module_Test::print.phtml" />
    </referenceContainer>

  Controller

<?php

namespace Module\Test\Controller\Order;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\View\Result\PageFactory;

class Print extends Action
{
    protected $resultPageFactory;
    public function __construct(Context $context, PageFactory $resultPageFactory)
    {
        $this->resultPageFactory= $resultPageFactory;
            parent::__construct($context);
    }
    public function execute()
    {
        var_dump('test print');
        $resultPage = $this->resultPageFactory->create();
        return $resultPage;
    }
}

  Block

<?php
namespace Module\Test\Block\Order;

class Print extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        array $data = []
    )
    {
        parent::__construct($context, $data);
    }

    public function _prepareLayout()
    {
        return parent::_prepareLayout();
    }
}

  phtml file

test1

the url will be:

http://localhost/magento2/test/order/print -->not working

previous forms
http://localhost/magento2/test/order/index working
http://localhost/magento2/test/order/view working

View.php file in controller

<?php

namespace Module\Test\Controller\Order;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\View\Result\PageFactory;

    class View extends Action
    {

        protected $pageFactory;
        protected $_coreSession;
        public function __construct(Context $context, PageFactory $pageFactory, \Magento\Framework\Session\SessionManagerInterface $coreSession)
        {
            $this->pageFactory = $pageFactory;
        $this->_coreSession = $coreSession;
            parent::__construct($context);
        }

        /**
         * Execute action based on request and return result
         *
         * Note: Request will be added as operation argument in future
         *
         * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
         * @throws \Magento\Framework\Exception\NotFoundException
         */
        public function execute()
        {
        $orderNumber = $this->_coreSession->getOrderNumber();
        $resultPage = $this->pageFactory->create();
        if($this->getRequest()->getParam('returnOrderPrint')) {
            $this->_redirect('test/order/print');
        }
        return $resultPage;
        }
    }


texts: magento 1.9 order email total column move to right

texts:
I am using Magento 1.9.3. In the order email, I am just adding product image. After adding this total column showing some white space. Following image will explain you clearly:

My query is how can I use colspan in that column..? or how can I move to right corner?


texts: Not able to upload image in admin-end by Insert Image button

texts:
I am not able to upload images in the admin-end by clicking "Insert Image" link in CMS block or CMS page.

On Clicking Insert Image link the Media gallery popup appears. Then on clicking the browse button it allows me to select image from my machine, but after selecting the image, it throws the error in console and doesn't show me the image in Media gallery popup to upload the image in Magento.

I am getting below error message in the firebug console.

<admin-end url>/cms_wysiwyg_images/thumbnail/file/QWJvdXRfUGV0RG9vcnMuY29tX2ltYWdlX29mX2JvcmRlcl9jb2xsaWVfYW5kX2dvbGRlbl9yZXRyaWV2ZXJfZ29pbmdfdGhyb3VnaF9kb2dneV9kb29yXzEucG5n/

When I am trying to open this link directly in the browser, it is generating error report.
The error in error report is below :

"Unsupported image format.";i:1;s:1512:"#0 lib/Varien/Image/Adapter/Gd2.php(60): Varien_Image_Adapter_Gd2->_getCallback('create')

Same thing is working absolutely fine in my staging environment but creating issue on live.
Staging and live site are on same server.
I have tried uploading different image types as well like gif, png, jpg, but everytime the issue is same.

What can be the probable cause of this issue and how can I fix it?


texts: Change the template inheritance hierarchy

texts:
Is there a way to change the template/skin inheritance hierarchy?

Currently you can have:

custompackage/customtheme

custompackage/default

base/default

Is there a way or a module that would allow more control so you could do (for example):

custompackage/customtheme1

custompackage/customtheme2

custompackage/default

base/default


texts: Magento 2 : customer attribute not saved

texts:
I created a custom customer attribute with the following script :

$customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
$usedInForms = ['adminhtml_checkout','adminhtml_customer','customer_account_edit', 'customer_account_create'];

$customerSetup->addAttribute(
  \Magento\Customer\Model\Customer::ENTITY,
  'company_legal_form',
  [
    'type'         => 'varchar',
    'label'        => 'Company Legal Form',
    'input'        => 'text',
    'required'     => false,
    'visible'      => true,
    'user_defined' => true,
    'position'     => 92,
    'system'       => 0,
  ]
);
$customerAttribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'company_legal_form');
$customerAttribute->setData('used_in_forms', $usedInForms);
$customerAttribute->save();

I am able to see the new field on the customer registration form but my value is not saved ?
I clear all caches but nothing is working...

Thanks for your help !


texts: Magento 2 - What is the correct way to change default Order Id?

texts:
Magento 2. After fresh install the new Order id will be 100000001, 100000002 and so on.

What is the correct way to change that increment id so it would be a higher number? For example  155555552, 155555553 and so on. When changed it will look much better.

In Magento 1.9 To edit default Id for Orders, Invoice or Shipment we simply had to change values in database in "eav_entity_store".

Magento 2 looks so different...

I know there are some plugins that offer to do this, but I want to know how to do it manually.


texts: Braintree PayPal error after upgrading magento version to 2.3.5

texts:
In my dev site I started getting the error in the image below after upgrading from 2.3.2 to 2.3.5.

code: "PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED"

details: undefined

message: "A linked PayPal Sandbox account is required to use PayPal Checkout in Sandbox. See https://developers.braintreepayments.com/guides/paypal/testing-go-live

In my main branch witch is still on the 2.3.2 version everything works well (it's pointing to the same braintree sandbox accounts). Any help is much appreciated. thanks !


texts: Magento 2.2.5: How to join a table with a repository

texts:
I am trying to join table 'cataloginventory_stock_status' with order item table using OrderItemRepositoryInterface and searchCriteriaBuilder.

$searchCriteria = $this->searchCriteriaBuilder
                       ->addFilter('product_type', 'simple', 'eq')
                       ->create();
$collection = $this->orderItemRepository->getList($searchCriteria);

$collection->getSelect()->join(array('stock' => 'cataloginventory_stock_status'), 'main_table.product_id = stock.product_id', 'stock.stock_status')
               ->where('stock.stock_status = 1')
               ->columns('SUM(qty_ordered) as total_qty')
               ->group('main_table.product_id')
               ->order(array('total_qty DESC', 'name ASC'));
return $collection;

When i echo $collection->getSelect();

then its show write query, but got wrong data on template file.

Any solution for this please.


texts: Magento2 filter products based on location (custom attribute) programmatically

texts:
I have a Magento2 Store (v2.4) where I have multiple locations. for (eg. Jaipur, Delhi, Mumbai etc). I have managed locations using custom attribute using multiple dropdown list and assigned it to product.
I want to filter products on frontend store using this attribute.
These attributes appear in layered navigation and working fine but I want to filter them programmatically.
I created a beforeLoad plugin for \Magento\Catalog\Model\ResourceModel\Product\Collection using below code
public function beforeLoad(\Magento\Catalog\Model\ResourceModel\Product\Collection $subject, $printQuery = false, $logQuery = false)
{
        if (!$subject->isLoaded()) {
            $id = 212;
            $subject->addAttributeToFilter('store_address', ['finset' => $id]);
        }

        return [$printQuery, $logQuery];
}

This code filter product collection based on location but toolbar and pagination data is incorrect.
For ex there are 3 product available and pagination size is 12 per page so 2 product on page 1 and 1 item appear on page 2.
I want to show all 3 items on page 1.
Please help me how can I implement this filter based on custom attribute.
Thanks


texts: Layered Navigation: Always show full category tree

texts:
Consider the following category tree:

A
  A1
    A11
  A2
    A21
    A22
B
  B1
C

By default, the categories listed in the layered navigation are the child categories of the current category, so for example if I opened up the A/A2 category in the front end, the following categories would be shown in the layered navigation:

A21
A22

Is there a way to always show the full category tree, starting from the root category? A lot of shops seem to do this but I haven't found a way yet to do this with Magento.


texts: rest api to get product information returns null

texts:
I'm building an api function that returns me products information based on category id. here is the code:

public function getAssignedProducts($categoryId)
{
    $category = $this->categoryRepository->get($categoryId);

    /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $products */
    $products = $category->getProductCollection();

    $items =array();
    $i=1;

    /** @var \Magento\Catalog\Model\Product $product */
    foreach ($products->getItems() as $product) {
        $items[$i]['sku'] = $product->getSku();
        $myProduct = $this->getProduct($product->getSku());
        $items[$i]['products'] = $myProduct;
        $items[$i]['name'] = $product->getName();
        $items[$i]['description'] = $product->getData('description');
        $items[$i]['price'] = $product->getPrice();
        $items[$i]['quantity'] = $product->getQty();
        $items[$i]['isAvailable'] = $product->isAvailable();
        $items[$i]["mediaURL"] = $this->getMediaUrl();
        $items[$i]["imageTitle"] = $product->getImage();

        $i++;
    }
    return $items;
}

but it returns only sku, isAvailable and image and other information are null

I need to know why


texts: What do you think about "Magento Associates"?

texts:
Magento announced in this blog post: Strengthening our Solution Partner Program a new partner status (?): Magento Associates

  Our goal is to help Magento Associates develop the skills they need to
  become Magento Enterprise experts and engage in Enterprise
  implementations. These companies may or may not have the goal of
  joining the Solution Partner program, but we will provide them the
  resources and opportunity to do so if they choose.

What do you think this is? Some kind of Partners but with no certified developers?  Lower status for Solution Partners?
Does anyone has more info about fees for becoming a Magento Associate
Why would a company do that?
What benefits would a Magento Associate have?


texts: Best way to include namespaces in Magento 2

texts:
I was wondering how i should load my namespaces.

<?php
namespace MyVendor\MyModule\Cron;

use \MyVendor\MyModule\Model\ResourceModel\Message\Collection;

class Order
{
    protected $_logger;
    protected $_messages;

    public function __construct(
        \Psr\Log\LoggerInterface $logger,
        Collection $_message
    )
    {
        $this->_logger = $logger;
        $this->_messages = $_message;
    }

    public function execute(\Magento\Cron\Model\Schedule $schedule)
    {
        return $this;
    }
}

In this short example \MyVendor\MyModule\Model\ResourceModel\Message\Collection is loaded using "use" but \Psr\Log\LoggerInterface is loaded in the constructor.

Is there a significant difference? If yes, what is it?


texts:
Hey, I just installed Magento 1.9.2.4 and try to upload new product all goes well but when I try to upload image it uploads to 100% and then I am getting " File was not uploaded." error.

Could someone help?

Thanks,

Denys


texts: Magento store to work with SSL after server modification

texts:
I have a Magento store in a sub-directory. I don't mind having sub domain or a sub directory. I have a wilcard SSL certificate and I was able to make https work with my store.

But I needed to have an Apache modification for my Wordpress multisite installation installed in my domain root - from this:

<VirtualHost 109.73.236.14:443>
ServerName *.lumenco.ca
ServerAlias *.lumenco.ca
VirtualDocumentRoot /home/lumenco0/public_html/%1
ServerAdmin webmaster@lumenco.ca
UseCanonicalName Off

To this:

<VirtualHost 109.73.236.14:443>
ServerName lumenco.ca
ServerAlias *.lumenco.ca
VirtualDocumentRoot /home/lumenco0/public_html/%1
ServerAdmin webmaster@lumenco.ca
UseCanonicalName On

Because of that modification, my store sub domain (store.mysite.com) doesn't work so I had to change it to a subdirectory (mysite.com/store) but with a sub directory, https doesn't work correctly - it works for admin but I get an internal error when https is used on frontend pages.

I'm not really sure the best place ask this question but any ideas to fix this issue will be much appreciated.


texts: Magento 2: How to install & configure xdebug (linux +magento+ sublime)

texts:
Is their any way to configure xdebug on linux+magento+sublime debug environment ?
I am using PHP Version 7.3.26-1+ubuntu18.04.1+deb.sury.org+1


texts: Allow Backorder for Admins only Magento 2

texts:
Does anyone know how we can setup to allow backorders to happen only for orders placed in the backend admin?

So customers on the frontend store would not be able to place an order for an out of stock item.

Our sales reps need to be able to place orders for products that are out of stock, but not our frontend customers.

Is there an extension that would do this or any help would be greatly appreciated.
Thanks.


texts: How to properly register account using rest api

texts:
i have a problem creating a customer account and add item to cart

The API i am using to create account :

/V1/customers

{
"customer": {
    "firstname": "fname",
    "lastname": "lname",
    "email": "email@gmail.com"
},
    "password": "12345678"
}

And then create cart using following API without body :

/V1/carts/mine

The problem is :

When i add item to the cart via API the price is always 0 or null, but
If i create the account from the web, and add item via API the cart has its price

I checked via this API : /carts/mine/totals

Account created from web returns following result:

    {
  "grand_total": 0,
  "base_grand_total": 0,
  "subtotal": 0,
  "base_subtotal": 0,
  "discount_amount": 0,
  "base_discount_amount": 0,
  "subtotal_with_discount": 0,
  "base_subtotal_with_discount": 0,
  "shipping_amount": 0,
  "base_shipping_amount": 0,
  "tax_amount": 0,
  "base_tax_amount": 0,
  "weee_tax_applied_amount": null,
  "subtotal_incl_tax": 0,
  "base_currency_code": "USD",
  "quote_currency_code": "USD",
  "items_qty": 0,
  "items": [],
  "total_segments": [
    {
      "code": "subtotal",
      "title": "Subtotal",
      "value": 0
    },
    {
      "code": "shipping",
      "title": "Shipping & Handling",
      "value": 0
    },
    {
      "code": "grand_total",
      "title": "Grand Total",
      "value": 0,
      "area": "footer"
    }
  ]
}

while account created from API return different result :

 {
  "grand_total": 0,
  "weee_tax_applied_amount": null,
  "base_currency_code": "USD",
  "quote_currency_code": "USD",
  "items_qty": 0,
  "items": [],
  "total_segments": [
    {
      "code": "subtotal",
      "title": "Subtotal",
      "value": null
    },
    {
      "code": "shipping",
      "title": "Shipping & Handling",
      "value": null
    },
    {
      "code": "grand_total",
      "title": "Grand Total",
      "value": null,
      "area": "footer"
    }
  ]
}


texts: Magento 2 Customer registration with customer group

texts: In Magento 2 , defaultly admin has to assign customer groups for all the user but I need to develop, user will select their role while register his/her account.