texts: Is it bad to switch to Developer Mode when your website is already live and has a lot of traffic?

texts:
I don't have a test server but I like to change a few things, the thing is - I don't know where the code for that section is.

I know you can use the hints in developer mode but for that I have to switch from production mode to developer mode. I'm afraid this will mess things up or cause problems with the customers.


texts: How to apply patches for Magento 1.x in Windows?

texts:
I don't know how to update patches for magento. I tried cygwin in Windows but without success:

Can anybody help me to solve these problems?


texts: In Magento 1.9 Customers > Add New > Account Information  What does "Associate To Website" field mean? What's the difference between "Admin" and "Main Website"?


texts: how to add a div in topmenu bar in magento?

texts:
I am trying to add a div inside a menu bar, it gets added but it gets displayed below the menu bar. I have added the div as given below in topmenu.phtml:

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

        <?php echo $_menu ?>

<?php endif ?>

If this is not the right way to add a div, is their any other way?

Thanks.!


texts:
Very often Magento required Cache "Refresh" to be done.
I am looking for a Cron Job Command for Magento Cache "Refresh".
I need to Refresh cache and not Clear them.

To "Clear" cache, Cron job command I got is: rm -rf /home/hosting/html/var/cache/*

Whats the command for refresh ?

The main blog I always need to Refresh is "BLOCK_HTML"
I would like to set a cron job for it, every 15 minutes


texts: How to link observer to methods from another block

texts:
I have an observer and would like to get the selected custom options array.
The observer event is: checkout_cart_product_add_after

I have found the two methods I require in: app/design/frontend/MY-THEME/default/template/checkout/cart/item/default.phtml

Which are:

$_item = $this->getItem();
$_options = $this->getOptionList();

I just don't know how to link to them from an observer.


texts: How can I get Add products link on Backend Products Information Page

texts: I need to add products from Backend  Products Information Page, how can i get add products link on products information page.


texts: Rest API (Consumer is not authorized to access %resources)

texts:
I know this question was already asked very often, but I got a little different kind of problem.
At first I´m just trying to get normal categories via rest api and I fail.

I installed local Magento 2.2.2 and everything works fine.

I installed same version on webserver and everytime I try to receive the categories via rest api I get, that consumer is not authorized.

I can definitely make sure that:
- I connect via admin and admin has all rights for access on all api endpoints (I also created a single apiuser and gave him all rights and another tiem just right for catalog/categories and so on)
- I already read every post found to that topic with that normal solutions like token is expired and stuff...
- I receive a token from "index.php/rest/V1/integration/admin/token".
- I checked everything, no kidding twenty times, compared to working local installation and webserver installation.
- Local works fine (normal xampp environment), webserver refuses to acceppt admin rights.

On Local install everything is okay, I already imported all my categories via rest api on local, but on my webserver - everything I tried just fails.
I received categories via anonymous access but that doesn´t help posting categories and that was everything that worked.

I already suspected some problems with apache, because I have no access to apache and php installation but I can give my webserver provider a ticket if something would be a problem with apache.

If anybody has any kind of idea please let me know, I´m really looking for a solution to that problem. I´m desperate now.

Best Regards,
Loqic


texts: How to set product images from external url

texts: I have created products in magento site. Now I want to load product images from external url.. how I will do this?


texts:
Which is the best tool available for migration magento 1 to magento 2.

Can anyone give official magento tool for migration.


texts: sales_clean_quote cron not working magento 2.3.4

texts: sales_clean_quote cron shows error when querying from cron_schedule table.


texts: responsive design category page optimization

texts:
I am working on a responsive design. In category pages i am showing the product small_image with resize(270,null). This is okay with desktop. But in mobile it takes little more seconds to load the product image.

This i tried to fix as following

Loaded image with resize(110,null). but the images is too small
and the it just sits in center of the grid with spaces around it.
so i gave width to the img tag, then the image looks stretched,
and i don't want this.

And there is another problem associated with this.
My site is having varnish sitting in front of webserver and uses URL based caching. So once the page is cached it servers the same page irrespective of the device or resolution. So i tried to append a query string to all url that is being accessed with mobile devices so that desktop's and mobile's will have different cached pages.

eg:mysite.com/abc.html to mysite.com/abc.html?device=mobile

But magento simply refuses to redirect to my new url, with htaccess OR php code added in the top of index.php page. If it was working i thought of adding a forth image type called mobile and show that in mobile devices.

Is there a way by which i can show a non-stretched prod image in mobiles with image weight considerably decreased.

  I think the question is clear,if it is not i will provide more info

EDIT
http://adaptive-images.com/ is a popular way doing this and integration is also pretty easy. But its not working. This involves some htaccess coding to redirect the images to a php file. I think that part is not working

htaccess code

    RewriteCond %{REQUEST_URI} !ai-cache

    RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php

just above the line

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

This is creating cache-images for skin folder but not for media/catalog
Any sought of input on this from anybody.?


texts: Magento 2: Sending Email Programmatically

texts:
Does Magento 2 have any built-in integration with third party transaction email deliverability systems like Amazon SES, Mandrill, etc., or is the built-in email functionality still based around PHP's mail function?  Or are the emails sent with some third thing?

If the answer is mail, are there any third party extensions like SMTPPro for Magento 2 that would let a developer replace the standard email system?


texts: Magento 2 | add Terms & Conditions to customer registration

texts:
I am currently trying to add Terms & Conditions to the customer registration.
I thought the best would be just to update the layout.

So I simply extended customer_account_create.xml this in my theme:

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="form.additional.info">
            <block class="Magento\CheckoutAgreements\Block\Agreements" name="register_agreements"
                   template="Magento_CheckoutAgreements::additional_agreements.phtml" before="-"/>
        </referenceContainer>
    </body>
</page>

However it does not show up any check box.

Any idea why?

Thanks in Advance!


texts: Restricting customers to max of (some number) purchases for a certain product in Magento

texts:
Is there any good modules out there that can handle this? Or would this be a custom event / observer that needs to be written?

Here's an image on a non magento site that shows specifically what i'm looking for.

Magento 2.2.3 EE

This needs to work with the Magento commerce b2b module. So everyone in a group/company would be limited. If there was 4 people in the group but one person purchased the max amount then the other 3 would not be allowed to purchase any. This makes it increasingly more complex and difficult logic.


texts: can anybody help me regards this error m doing work on magento 2 after installing sample data i got this?

texts: i found this issue anybody can resolve this


texts: Magento Wordpress integration or standalone for KB & FAQ? Please advise

texts:
I am thinking of either integrating Wordpress to my most current Magento .com website installation or using a .help domain extension of my website which I can install WordPress to and add a knowledge base to it for articles which contain information in regards to my main .com Magento site.

If the latter then when users visit my main Magento .com website and click on Knowledge base or FAQ link(s) for example then they will be redirected to my .help Wordpress site where articles with information will be presented for my main .com website. Will this work and is it advisable? Or should I integrate Wordpress to my Magento installation by finding readily available extensions and installing them?

Which is the better option in your opinion?

Appreciate and thanking you in advance for your advice.


texts: Magento hangs/gets stuck on on "order processing" - No order created in back end

texts:
Magento 1.9.1, rwd theme, one step checkout, stripe payment processor

For some reason the order gets stuck after customer presses "Place Order" using credit card. There is no order created in the back end.

We process over 100 orders daily without any issue but at least 4-5 times a week I get a phone call from a customer stating that they had issues placing an order.

We initially thought it was a phone number issue, where customer has spaces or dashes in it, once we asked a customer to delete the spaces and the order went through successfully but other times it didn't.

I don't know if that was a coincidence or there is something really wrong here.

Has any one had such an issue or know of a fix?


texts: How to change a particular store's product prices?

texts:
I have different stores of different products. I want to change all products prices of particular store.
I have a code of it. But it takes so much time on save function because i have so many products.

$product = Mage::getModel('catalog/product')
                        ->setStoreId($storeid)
                        ->load($productid)->setPrice($price);$product->save();

Is there any better way?


texts: Magento 1 : Some active categories are not displaying in sitemap.xml

texts:
Two category pages are not displaying in sitemap.xml
these categories are active in backend, and also showing in frontend still my sitemap.xml is not displaying these two category pages.

Can any one help please.


texts: template is not working magento 2 admin customer_index_edit

texts:
I am calling a js function form this file current.phtml like this

<script type="text/javascript">

 require([ 'jquery', 'jquery/ui'], function($){ $(document).ready(function($) {
   updateAjax();
    }); });
</script>

And this is my function here in js.phtml same module same directory

<script>
function updateAjax(current,returnpaymentid)
    {
        console.log(asdada);
        resetPaymentBlock();
    }
</script>

Here is my customer_edit_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
       <referenceBlock name="customer_form">
         <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\CurrentTransactions" name="tm_cm_current" >
        </block>

         <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\ArchivedTransactions" name="tm_cm_archived" >
          <action method="setTabLabel">
              <argument name="label" xsi:type="string">Archived Transactions</argument>
          </action>
        </block>
        <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\Statements" name="tm_cm_statements" >
          <action method="setTabLabel">
              <argument name="label" xsi:type="string">Statements</argument>
          </action>
        </block>
        <block class="TM\CreditManagement\Block\Adminhtml\Edit\Tab\PaymentsReceived" name="tm_cm_received" >
          <action method="setTabLabel">
              <argument name="label" xsi:type="string">Payments Received</argument>
          </action>
        </block>

      </referenceBlock>
        <referenceContainer name="before.body.end">
        <block class="TM\CreditManagement\Block\Adminhtml\Transactions\Current" template="TM_CreditManagement::transactions/js.phtml" name="before_js_cm"/>
        </referenceContainer>

</body>

All other are working fine except the last one with template "transactions/js.phtml" this templete is not loading


texts: MAGENTO 2.4 WHEN EXPORT BY BULK 10, 100 AND 1000 PRODUCTS ITS OK BUT I CAN NOT WITH 4000

texts:
I am newbye with Magento.... the issue i am experienced at this moment is when i try to export 10, 100 or 1000 products everything goes ok and the CSV file appears to be downloaded properly.... but when i tried to get 4000 products it never appears...
what i can see is the file csv in path var/ the file with 0 bytes.
please help... i think is a limitation but i do not know what to do...
thanks in advance


texts: How to remove price from configurable products drop down options in magento 2.3.2

texts:
I have configurable products made with multiple simple products on my magento 2.3.3 site.
I have one attribute called Product lenght which consists of Yards and Swatch option.
In the dropdown along with these options it also shows the price of the product.
See https://prnt.sc/v6t1b6
Can any one tell me how to remove this price and show only Yards.


texts: How to return the customer data on customer_register_success event and where to put my callback function on that event

texts:
I want to get newly registered users' data on the customer_register_success event for integration purposes with other CMS to push it there so as I'm new to Magento development I want some help on how and where to code my process upon that customer_register_success  event.

appreciate any further help.


texts: Magento 2: Custom block doesn't show on the cart page

texts:
Namespace/Modulename/Block/donation.php

namespace Namespace\Modulename\Block;

class Productpoint extends \Magento\Framework\View\Element\Template
{

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

}

Namespace/Modulename/view/frontend/web/templates/checkout/cart/donation.phtml

<?php echo 'Eureka'; ?>

Rewrite checkout_cart_index.xml

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

        <referenceContainer name="content">
            <block class="Namespace\Modulename\Block\Productpoint" before="-" template="Namespace_Modulename::checkout/cart/productpoint.phtml"/>
        </referenceContainer>

</page>

The block is not loading on cart page. How do I call my custom block on cart page?


texts:
where can change the order of the meta tags in Magento 2?
currently description meta tag & keywords meta tag showing before the title and are not in top of the page.


texts: Magento2 - How to get json data from layout js to a php file?

texts:
I need to add a javascript into customer edit page in admin panel, I had created  /view/adminhtml/layout/customer_index_edit.xml and /view/adminhtml/web/js/customer.js
customer_index_edit.xml
<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="MyCustomModule::js/customer.js"/>
    </head>
</page>

customer.js
require([
    'jquery'
], function ($) {
    'use strict';

    $(document).ready(function(){

        //my js code

    });

});

My question is, how can I get data outside of this javascript file? I want to get customer attribute in this page.


texts: How can I make admin login landing page stay on current page?

texts: When I log in to the admin area after a session has expired the system redirects me to the Dashboard instead of the page that I was on before the session expired. How can I prevent this?


texts: Set Category Attribute to Use Default Value

texts:
When setting the product to use the default value, setting the value to false would do it.

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$product = Mage::getModel('catalog/product')
    ->load($product_id)
    ->setStoreId($store_id)
    ->setData($attr, false)
    ->save();

However, it appears that in category, this doesn't work? What am I missing?

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$category = Mage::getModel('catalog/category')
    ->load($category_id)
    ->setStoreId($store_id)
    ->setData($attr, false)
    ->save();

This doesn't work either:

Mage::app()->setCurrentStore(SOME_STORE_ID);
$category = Mage::getModel('catalog/category')->load($category_id);
$category->setAttr(false);
$category->save();


texts:
I am getting the following error on the readiness check step:

  We found conflicting component dependencies.
  Command "update" failed: Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package magento/product-community could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details. Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

I read on the official docs that they might be a typo in composer.json file. My file is like this:

{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.1.4",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"require": {
    "magento/product-community-edition": "2.1.8",
    "composer/composer": "@alpha",
    "magento/product-community": "2.1.8"
},
"require-dev": {
    "phpunit/phpunit": "4.1.0",
    "squizlabs/php_codesniffer": "1.5.3",
    "phpmd/phpmd": "@stable",
    "pdepend/pdepend": "2.2.2",
    "fabpot/php-cs-fixer": "~1.2",
    "lusitanian/oauth": "~0.3 <=0.7.0",
    "sebastian/phpcpd": "2.0.0"
},
"config": {
    "use-include-path": true
},
"autoload": {
    "psr-4": {
        "Magento\\Framework\\": "lib/internal/Magento/Framework/",
        "Magento\\Setup\\": "setup/src/Magento/Setup/",
        "Magento\\": "app/code/Magento/"
    },
    "psr-0": {
        "": "app/code/"
    },
    "files": [
        "app/etc/NonComposerComponentRegistration.php"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
        "Magento\\Tools\\": "dev/tools/Magento/Tools/",
        "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
        "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
        "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
    }
},
"minimum-stability": "alpha",
"prefer-stable": true,
"repositories": [
    {
        "type": "composer",
        "url": "https://repo.magento.com/"
    }
],
"extra": {
    "magento-force": "override"
}

}

Can't think what's wrong. Any ideas?

Thanks in advance.


texts: Magento 2 rest api get product's attributes options

texts:
I would like to get more then one product's attributes options in one query
I have my url for one attribute option as follow:

  http://magento2.dev/rest/V1/products/attributes/size/options

The above I am receiving all the options for size, now the question is:

How do one get attribute options for colour in the same call?

e.g One could do http://magento2.dev/rest/V1/products/attributes/size|colour/options

passing parameters separated by pipe or comma whatever how can one do this in Magento 2?

Thank you in advance.


texts: Magento 2.3.1 Fatal Error when overriding Helper in Magento Bundle module

texts:
In order to override the function getBundleOptions from magento2/vendor/magento/module-bundle/Helper/Catalog/Product/Configuration.php i have implemented the following module:

MySpace/MyModule3/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
     <preference for="Magento\Bundle\Helper\Catalog\Product\Configuration" type="MySpace\MyModule3\Helper\Bundle\Catalog\Product\Configuration\Configuration" />
</config>

MySpace/MyModule3/Helper/Bundle/Catalog/Product/Configuration/Configuration.php

<?php
namespace MySpace\MyModule3\Helper\Bundle\Catalog\Product\Configuration;
class Configuration extends Magento\Bundle\Helper\Catalog\Product\Configuration
{
    /**
     * Get bundled selections (slections-products collection)
     *
     * Returns array of options objects.
     * Each option object will contain array of selections objects
     *
     * @param ItemInterface $item
     * @return array
     */
    public function getBundleOptions(ItemInterface $item)
    {
        $options = [];
        $product = $item->getProduct();

        /** @var \Magento\Bundle\Model\Product\Type $typeInstance */
        $typeInstance = $product->getTypeInstance();

        // get bundle options
        $optionsQuoteItemOption = $item->getOptionByCode('bundle_option_ids');
        $bundleOptionsIds = $optionsQuoteItemOption
            ? $this->serializer->unserialize($optionsQuoteItemOption->getValue())
            : [];

        if ($bundleOptionsIds) {
            /** @var \Magento\Bundle\Model\ResourceModel\Option\Collection $optionsCollection */
            $optionsCollection = $typeInstance->getOptionsByIds($bundleOptionsIds, $product);

            // get and add bundle selections collection
            $selectionsQuoteItemOption = $item->getOptionByCode('bundle_selection_ids');

            $bundleSelectionIds = $this->serializer->unserialize($selectionsQuoteItemOption->getValue());

            if (!empty($bundleSelectionIds)) {
                $selectionsCollection = $typeInstance->getSelectionsByIds($bundleSelectionIds, $product);

                $bundleOptions = $optionsCollection->appendSelections($selectionsCollection, true);
                foreach ($bundleOptions as $bundleOption) {
                    if ($bundleOption->getSelections()) {
                        $option = ['label' => $bundleOption->getTitle(), 'value' => []];

                        $bundleSelections = $bundleOption->getSelections();

                        foreach ($bundleSelections as $bundleSelection) {
                            $qty = $this->getSelectionQty($product, $bundleSelection->getSelectionId()) * 1;
                            if ($qty) {
                                $option['value'][] = $this->escaper->escapeHtml($bundleSelection->getName());
                                $option['has_html'] = true;
                            }
                        }

                        if ($option['value']) {
                            $options[] = $option;
                        }
                    }
                }
            }
        }

        return $options;
    }
}

However, the module is not working, and still returns the following:

Fatal error:  Class 'MySpace\MyModule3\Helper\Bundle\Catalog\Product\Configuration\Magento\Bundle\Helper\Catalog\Product\Configuration' not found in /data/web/magento2/app/code/MySpace/MyModule3/Helper/Bundle/Catalog/Product/Configuration/Configuration.php on line 3

Any ideas of how to correct for this error, and make the module work?


texts: Some of customer login in magento 2.1 welcome Undefined is getting

texts:
Once the customer logged in to our site Welcome Undefined message is getting in Header rather than customer name, Some of the customers are working but some old customers its throwing Welcome Undefined message in magento 2.1.

Can anyone help me to solve this please.


texts: How to over ride frontend-blank _navigation.less in custom theme?

texts:
There are a number of great answers on less extending and overriding but none seem to answer this.

I want to override the following in a custom theme.
/vendor/magento/theme-frontend-blank/web/css/source/_navigation.less

I've tried the following:

Copy _navigation.less to app/design/frontend/Vendor/custom-theme/web/css/source/_navigation.less and recompile.
Copy _navigation.less and _sources.less to app/design/frontend/Vendor/custom-theme/web/css/source/ and comment out other partials I don't want to override.
Save theme-frontend-blank/web/css/source/_navigation.less to  app/design/frontend/Vendor/custom-theme/web/css/source/_navigation_override.less and import it in app/design/frontend/Vendor/custom-theme/web/css/_styles.less

@import 'source/_navigation_override.less';

Option 3 does work but only because it's loaded after _navigation.less so it's not ideal.

Does any know how I should be doing this?


texts: How can I display `₹` properly in invoice pdf without changing core files

texts:
₹ is properly displaying in front pages as well as product pages. But it is not displaying properly in pdf of invoice and shipment. How to change for proper displaying.

I have tried changing in lib/zend/locale/data/root.xml and also in admin/system/manage currency/symbols ,but no changes updating in pdf's.


texts: Adding dropdown sku list to my form - Fatal error: Call to a member function toOptionArray

texts:
I am working on a custom module and this is one of my form:

At the moment, I am using a text input for "Magento SKU". The form is constructed like this:

Company_Integration_Block_Adminhtml_Manageskumappings_Edit_Tab_Form

$fieldset->addField('magento_sku', 'text', array(
    'label' => Mage::helper('integration')->__('Magento SKU'),
    'class' => 'required-entry',
    'required' => true,
    'name' => 'magento_sku'
));

$fieldset->addField('sage_sku', 'text', array(
    'label' => Mage::helper('integration')->__('Sage SKU'),
    'class' => 'required-entry',
    'required' => true,
    'name' => 'sage_sku'
));

$fieldset->addField('status', 'select', array(
    'label' => Mage::helper('integration')->__('Status'),
    'name' => 'status',
    'values' => array(
        array(
            'value' => 1,
            'label' => Mage::helper('integration')->__('Enabled')
        ),
        array(
            'value' => 2,
            'label' => Mage::helper('integration')->__('Disabled')
        )
    )
));

I want to turn this field magento_sku into a drop down list (from existing sku in magento).

I know I can do this manually by doing this:

$fieldset->addField('magento_sku', 'select', array(
    'label'     => Mage::helper('form')->__('Magento SKU'),
    'class'     => 'required-entry',
    'required'  => true,
    'name'      => 'title',
    'value'     => '1',
    'values'    => array(
        '-1'    => 'Please Select..',
        'SKU1'  => 'SKU1',
        'SKU2'  => 'SKU3',
        'SKU3'  => 'SKU3'
    )
));

How can I automate this, so that this field is auto-populated from an external source (model? helper?) within my module?

This is my module config: http://pastebin.com/raw.php?i=ATy2NnEL

This is what I tried so far:

$fieldset->addField('magento_sku', 'select', array(
    'label' => Mage::helper('integration')->__('Magento SKU'),
    'class' => 'required-entry',
    'required' => true,
    'name' => 'magento_sku',
    'values' => Mage::getSingleton('manageskumappings/skus')->toOptionArray()
));

My model was here: app\code\local\Company\Integration\Model\Skus.php with the following:

class Company_Integration_Model_Skus extends Varien_Object
{
    static public function getOptionArray()
    {
        return array(
            '-1'    => 'Please Select..',
            'SKU1'  => 'SKU1',
            'SKU2'  => 'SKU3',
            'SKU3'  => 'SKU3'
        );
    }
}

When I did this, I get the error: Fatal error: Call to a member function toOptionArray() on a non-object similar to my other question from yesterday: https://stackoverflow.com/questions/23222513/magento-call-to-a-member-function-getoptionarray-on-a-non-object


texts: Customisation create one array and in that array add all check boxes option ids Magento ver. 2.3.2

texts: How to create one function in magento 2 and every customisation create one array and in that array add all check boxes option ids.


texts: Magento 1.9 group price incorrectly calculated for simple products

texts:
We appear to have an issue with customer group pricing discounts on simple products. We have a 25% discount customer group with the following configuration in 'Catalog Price Rules':

This appears to be correctly calculated in admin

But in the front end, only for simple products, we are not seeing the same  price

As you can see here, configurable product options are ok

What could I possibly be missing here?


texts: OWL Carousel Banner Slider is not responsive

texts: I have installed OWL Carousel bannerslider extension successfully,but it is not been responsive after 768 pixel.


texts:
I am able to login to the admin control panel the first time and when I logout and login again it get this message:

  There has been an error processing your request
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO `admin_user_session` (`session_id`, `user_id`, `status`, `ip`) VALUES (?, ?, ?, ?)

But this works again when I get the empty ADMIN_USER_SESSION table in PHPMyAdmin.


texts: Setting Headerdata (canonical) depending on magento pagetype

texts:
I need to modify the page header depending on the page-type.
While canonicals on category and product pages are set manually, I want to fix pages, CMS-pages and blog-pages with a conditional.

The code I’m using now:

<?php
/*
Canonical Link snippet
Code by: Mohamed Elgharabawy [ItsCoding.com]
This will show the canonical links on CMS pages. You do not need this on catalogue and product pages as Magento has that function in place already
http://itscoding.com/how-to-add-rel-canonical-tag-to-magento
*/
// get the page type: CMS, Catalog, .. etc
$pageType = $this->getRequest()->getModuleName();
// if page type is cms or blog, put the canonical link
if ($pageType == "blog" || $pageType == "cms")
 {
 $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 $url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
 $path = $url->getPath();
?>
<!-- Canonical link with (www) -->
<link rel="canonical" href="<?php echo "www.myDomain.com".$path; ?>" />
<?php
 }
?>

Works as expected on blog and CMS pages.
However, as it comes to magento-standard-pages (/contacts), the canonical is not set.
Which page type do I need to add to my statement in order to modify the header of (what I would call) standard pages?


texts: Get quote_item data using quote id and product id filter in Magento 2

texts:
I have to get the data from quote_item table using quote id and product id filter in Magento 2.

I was doing like this but it's not the good way

$connection->select()
    ->from(
        ['ce' => 'quote_item'],
        ['length']
    )->where('ce.quote_id IN (?) ',$quoteId)
    ->where('ce.product_id IN (?) ',$product_id);


texts:
How to Change the success message in the popup when click add to cart?
https://ibb.co/nigBmy


texts: Has anyone used Amazon CloudFront with Magento for serving static files?

texts: If so could you recommend any extensions ?


texts: Document adminnotification_inbox can not be copied directly

texts: while data migrating from magento 1.9.2.3 to Magento 2.3.4 with data migration tool, the error as shown in the screenshot is displayed. Could anyone please enlighten me on why it occurs and the fix for the it? Thanks.


texts: How to override magento theme layout file

texts:
I am a newbie to Magento 2.2.4 and i want to get bootstrap 4 css and my own js files.. As a first step trying to override the theme layout file.

I created a theme and enabled it successfully. (All js and css call are routed to my theme). The theme is inherited from magento-blank theme

Now i am trying to override the parent blank theme with my theme layout following this guide
https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/layouts/layout-override.html

I am getting the following error :

  Trying to override modular view file 'C:/xampp/htdocs/magento/app/design/frontend/TridentTechnominds/store/TridentTechnominds_Theme/layout/override/theme/magento/blank/default_head_blocks.xml'
  for theme 'magento/blank', which is not ancestor of theme
  'TridentTechnominds/store'

I tried all methods like :

  theme/Magento/theme-frontend-blank/default_head_blocks.xml => getting error over here
  theme/Magento/frontend-blank/default_head_blocks.xml
  theme/Magento/blank/default_head_blocks.xml => getting error over here
  theme/magento/theme-frontend-blank/default_head_blocks.xml

Kindly guide me the right folder structure. I have been just making and googling for 6 hours now.

Attached is the folder structure...

Update 1:

My mistake in naming convention of the folder. The blue underlined folder name was changed.

Even then, the trident.css is getting loaded from position black underlined i.e. under layout folder.

If i take it inside theme/magento/blank it doesnt work.
Note: I tried Magento as foldername too.

Attaching the updated folder structure.


texts: Magento 2 edit my-account-link element content?

texts: I'm using magento 2, and I'm trying to edit the my-account-link element , the one that writes My Account in the top bar , I just want to change the text with an icon , what's the html or phtml file to edit it ?


texts: catalogsearch url being spammed by chinese bots

texts:
Constantly getting hits on our site search catalogsearch url by what appear to be Chinese bots from mainly China, e.g.

/catalogsearch/result/?q=大奖娱乐88tb88手机版+Q82019309.com.com

I have blocked a lot of IP ranges for China, Russia and Ukraine. Some individual IP addresses are also blocked ** from other countries like **Germany.

The only one that seems to be active now is one that is supposed to be a GoogleBot, several in the 66.249.76.114 range.

Other than IP blocking, all I could think of was copying  Data.php to

/app/code/local/ from /app/code/core/Mage/CatalogSearch/Helper/

and changing the public function getQueryText() to catch searches that had .com in the string.

I changed the string randomly to something more befitting what the store sells using a small array of products. Only tested so far, see below!

if ($this->_queryText === null) {
   $this->_queryText = '';
} elseif (strtolower(strpos($this->_queryText, '.com')) !== false) {
   $botitems = Array("* product 1","* product 2","* product 3","* product 4","* product 5","* product 6","* product 7","* product 8","* product 9");
   $this->_queryText = $botitems[rand(0, count($botitems) - 1)];
} else {
   /* @var $stringHelper Mage_Core_Helper_String */
   $stringHelper = Mage::helper('core/string');

Questions are:

Is there any other way to stop bots using the search string?
Will these hits cause any problems with site ranking?
other than i.p. blocking is changing the search query when they hit a good or bad idea?
Is the bot that looks like a Googlebot legit?
What are they up to?

Thanks in advance for any help.


texts: Magento 2 configurable product price change is not working on the category page

texts:
Now I am using Magento 2.1.5 setup.

I created a configurable product. But the price is not a change in product list page (category page)


texts: Magento admin Base table or view not found

texts:
I'm moving a magento website over to a new server, I'm getting this error trying to access admin.

There has been an error processing your request

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cmodz_control_data_7_10.mag2013ves_pdfpro_apikey' doesn't exist

Not much experience with Magento, so any help appreciated.


texts: How to disaply tax and grandtotal in minicart

texts:
i have tax setup in website everywhere showing but in minicart not showing in tax

so i want to tax and grand total show in mini cart

how can achieve this?

Thanks in advance


texts: Magento 2 Sort By Price: Low to High and High to Low

texts:
I want to custom sort by option in category Filter For price like this Price: Low to High & Price: High to Low.
Please suggest me how to change sorting option in my site.
i am using magento 2.1.2


texts: Wrong url redirection for product or category page Magento 2.2.3

texts:
I am using magento 2.2.3 for my store.I observed that some of my product page url goes wrong url or 404 ex.

if i am try to open this url:

  https://baseurl/good-tee-hoodie-1-lb

then it open like this:

  https://baseurl/catalog/product/view/id/119/s/good-tee-hoodie-1-lb/category/301/

there can be multiple urls which is not working correctly.

what should i do? Any suggestion?

Is there any way where i can regenrate all the product or category urls? Is that good idea?

I have tried this extension (https://github.com/Iazel/magento2-regenurl) to regenerate the url but it's not working for me.

Please help me out with this probelm.


texts:
I want to get all product images in modal for slider. So that if product view modal is opened, the it should contain all images to swipe.(on product view page)

<?php $items = $this->getItems();?>
<?php $thumbnails = $this->getGalleryImages();?>

        <?php foreach ($items as $item): ?>

                            <?php if (count($thumbnails) > 0): ?>
                                <?php
                                // GravDept:
                                $photoswipeIndex = 0;
                                ?>

                                <?php foreach ($thumbnails as $thumbnail): ?>

                                        <a
                                        class="product-image thumbnail-list_link"
                                        href="<?php echo $this->helper('catalog/image')->init($item, 'image', $thumbnail->getFile()); ?>"
                                        title="<?php echo Mage::helper('core')->quoteEscape($thumbnail->getLabel()); ?>"data-photoswipe-index="<?php echo $photoswipeIndex; ?>">
                                            <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $thumbnail->getFile())->resize(60); ?>" alt="<?php echo $this->escapeHtml($thumbnail->getLabel()); ?>">

                                    <?php $photoswipeIndex++; ?>
                                <?php endforeach; ?>

                            <?php endif; ?>


texts: Magento 2.2: How to add country and region drop-downs in a custom step form in one page checkout?

texts:
I need to add a custom step in Magento which verifies the address of the customer via a third party API, the fields are similar to the shipping address form, but I could not find out how the country and region drop-downs are added from the core files.

The fields in the shipping form are set from the checkout_index_index.xml, and displayed using the knockout for each loop, but I could not do the same.

Thanks

EDIT
I have added the country_id, region, and region_id fields using layout xml, but it adds text box instead of the drop-down.


texts: How to add plus and minus button on products list in magento 2

texts:
I want add to cart button should turn into a plus (+) or minus (-) button upon clicking (quantity should be update cart on click + and -). On the product listing also home page update (+ or -) product's quantity into the cart. This is urgent if anyone have any solution please comment.

Thanks,


texts:
I am enabling maintenance mode by adding a file var/.maintenance.flag, but i am getting the error:

Unable to proceed: the maintenance mode is enabled.
#0 /backup/html/magento2/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Bootstrap->assertMaintenance()
#1 /backup/html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#2 {main}

I even tried enabling it using the command:

bin/magento maintenance:enable

Also, enabled the production mode, cleared caches still I am not getting 503 page. Please help!


texts:
I want to add js EXACTLY right before end of head tag
I've try this solution, but it only put the js to middle of the head tag, not right before end of head tag
https://magento.stackexchange.com/a/286655/70258
Thanks.


texts: Why doesn't flush cache storage flush Full page cache db with Redis

texts:
I just noticed when trying to flush cache storage through the admin in Magento Enterprise 1.13.1 for one of our clients, it isn't flushing the database set in the Redis configuration for FPC. I notice in the method clean, this is called when the cleaning mode is set to all.

 $this->_redis->flushDb();

shouldn't it be  $this->_redis->flushAll();

or loop over all of the dbs setup in the configuration of local.xml and flush each database. I haven't noticed this before but maybe it was because I always did it through a script or command line. But our client needs to be able to do it from the admin panel.

I saw this in another thread and may install it but I am trying to understand if there is something I am missing first about the FPC db flushing through default Magento
https://github.com/steverobbins/Magento-Redismanager


texts:
I have installed an extension.
But in the magento connect manager, there is some error.

  CONNECT ERROR: Package community/Skrill_Hosted_Payment_Solution 1.0.7:
  requires PHP version >= 5.4.0 and <= 5.6.13 current is: 5.2.17

In the past question and answers, it can be added

AddHandler application/x-httpd-php54 .php .php5 .php4 .php3

But still there is an error. Help me.


texts:
I've added the banner-slider extension to my Magento.
But I seem to have a problem where the slider is not showing up :(

I've added the following block to my cms home-page:

{{block type="bannerslider/default" name="bannerslider.bannerslider" template="bannerslider/bannerslider.phtml" bannerslider_id="1"}}

I've added the slider (id=1) with manage sliders and added some banners to it.
I've positioned the slider to a custom position with the correct width and height.
The slider is enabled and has a mode set to it. (only show title is disabled)

But it doesn't show the slider in the front-end...
What am I doing wrong?

I've contacted the developer, but I didn't get an answer :(

Thanks for the help


texts: Custom Shipping Method only for logged users

texts:
Like in the title, i want to make custom shipping method which will appears only for the logged users.

I had reward points module, and i wanna make a "FreeShipping for Points" you can use the reward points only if you are logged in user so the shipping for points option have to be available only for logged users.

I already made custom shipping method based on http://code.tutsplus.com/tutorials/create-a-custom-shipping-method-in-magento--cms-23747.

<?php
// app/code/local/Envato/Customshippingmethod/Model
class Envato_Customshippingmethod_Model_Demo
extends Mage_Shipping_Model_Carrier_Abstract
implements Mage_Shipping_Model_Carrier_Interface
{
  protected $_code = 'envato_customshippingmethod';

public function collectRates($carrierCode, $request)
    {
        if (!$this->_isAvailable($carrierCode, $request)) {
           return $this;
        }
        return parent::collectCarrierRates($carrierCode, $request);
    }

  public function getAllowedMethods()
  {
    return array(
      'envato_customshippingmethod' => $this->getConfigData('name'),
    );
  }

  protected function _isAvailable($carrierCode, $request)
    {
        $regionCode = $request->getDestRegionCode();

        switch ($carrierCode) {
            case 'envato_customshippingmethod':
                if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
                    return false;
                }
                break;
        }
        return true;
    }

  protected function _getDefaultRate()
  {
    $rate = Mage::getModel('shipping/rate_result_method');

    $rate->setCarrier($this->_code);
    $rate->setCarrierTitle($this->getConfigData('title'));
    $rate->setMethod($this->_code);
    $rate->setMethodTitle($this->getConfigData('name'));
    $rate->setPrice($this->getConfigData('price'));
    $rate->setCost(0);

    return $rate;
  }
}

?>


texts: Database performance issue even on new server. database issue on magento store?

texts:
I just migrated a store with around 5.000 products, i always found the store a bit slow (around 4/5s per page), this was a year back 2s. so it slowly declined.

I now installed a complete new server with loads of ram, ssd disks and so on.
this did not improve a single. this. This site is the only site running on this server.

When i run the top command, i see the following

p 2 days, 20:39,  2 users,  load atotop - 11:52:44 utop - 11:53:09 up 2 days, 20:40,  2 users,  load average: 1.80, 1.91, 1.99
Tasks: 242 total,   4 running, 237 sleeping,   0 stopped,   1 zombie
Cpu(s): 55.3%us,  5.1%sy,  0.0%ni, 37.9%id,  1.6%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  32695208k total, 31576368k used,  1118840k free,   359384k buffers
Swap: 16777084k total,     8492k used, 16768592k free, 29262460k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
10276 mysql     20   0 1332m  66m 6984 S 233.7  0.2  49:16.61 mysqld

This seems to be the real issue of the lack of speed.
even with things like redis no improvement off all, so finding cache solutions is the wrong way i suspect.

it definitely needs to be database health kind of thing.
i mean i have store running on poorer servers with 2 to 8 times more products without issues.

I have no clue where to look for anymore.


texts: magento 2, cookie notice does not appear in home page

texts: Cookie Restriction mode is enabled in admin panel. I see <div class="message global cookie" id="notice-cookie-block"> is exist in other page but missing in home page. What could cause this? Any thing related to cache?


texts:
I have created a custom module to disable free shipping based on some conditions. I have to used
Custom/ShippingRule/Plugin/Magento/Shipping/Model/Shipping.php to do the functionality.
It is working fine now. I want to enable/disable this from admin.


texts: How to change product name dynamically in configurable product when click swatches Magento 2.3

texts: How to Change the Configurable products name dynamically when i click configurable swatches, currently price change when click swatches .I need to change name too. please suggest better way! Thank You,


texts: `getAttributeText('attribute_code')` return `false` always

texts:
when I am using this code $product->getAttributeText('attribute_code');

It always return false in one of my script.

and if I do  below way then it return right value why ??

$attr_option_val = Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'attribute_code');
$product->setData('attribute_code',$attr_option_val);
echo $product->getAttributeText('attribute_code');


texts: Use knockout.js in catalog page in magento 2

texts:
We are developing an extension for configurable products which provides the following functionality on product page.

On the product view page of the configurable product, when the customer finishes the selection of the config options, the product detail and sku should change just like the media is changing.
I tried to trace this from the functionality implemented in checkout but i got more confused by doing this.

Can anybody tell what is the procedure to use the ko.js in magento frontend?


texts: Magento 2.3.4 Load Product by id by any method

texts: In Magento 2 there is more than one method to get product by id. Anyone show me how to get product y in any of the method step by step include files name nd path used.


texts: magento2.4 how to check on listing page if the product is already in compare list or not, or get list of products in compare list?

texts:
I need to get the know on list page whether the product is already in compare list or not, else get the list of products already in compare list.
I tried the code in below link but getting blank array
https://magento.stackexchange.com/questions/224987/how-to-get-compared-product-collection-in-magento-2

Can some one please help me on this?


texts: Magento custom module setup script, add pre-fix

texts:
For my custom module I create a database table with the magento sql setups script.
The problem is that if the magento installation has a prefix on the database it doesn't add the prefix. So the table is created but without the needed prefix.

Anybody knows how I can add this to my script?


texts: Is there a way to get Product List Toolbar into breadcrumbs.phtml? All I want to do is display toolbar options inside the breadcrumbs wrapper.


texts: How can i get customer information in observer : Magento2

texts:
Actually, I am trying to get customer data in observer and my event is

"adminhtml_customer_save_after"

I have made observer

Code:-

    <?php
/**
* Copyright � 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Amitshree\Customer\Observer;

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

class Customersaveafter implements ObserverInterface
{
    protected $_request;
    protected $_layout;
    protected $_objectManager = null;
    protected $_customerGroup;

    /**
    * @param \Magento\Framework\ObjectManagerInterface $objectManager
    */
    public function __construct(
        \Magento\Framework\View\Element\Context $context,
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_layout = $context->getLayout();
        $this->_request = $context->getRequest();
        $this->_objectManager = $objectManager;
    }

    /**
    * @param \Magento\Framework\Event\Observer $observer
    * @return void
    */
    public function execute(EventObserver $observer)
    {

    echo "<pre>";
    $event = $observer->getEvent();
    $customer = $event->getCustomer();
    print_r($customer->getData());
    die('Observer Is called!');

    }
}

I want to get Customer infromation and i am trying to print customer in this file using

$event = $observer->getEvent();
$customer = $event->getCustomer();
print_r($customer->getData());

but don't get any result.

I have created events.xml in etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="adminhtml_customer_save_after">
        <observer name="Amitshree_Customer_Customer_Save_After" instance="Amitshree\Customer\Observer\Customersaveafter" />
    </event>
</config>


texts: Magento2 Catalog price rule randomly stop working

texts:
I created a catalog price rule on a 15k catalog; the rule concerns about 10k items.
I often need to re-apply the rule because Magento shows full price.
The rule has a start date and NOT an end date.
Any ideas?


texts:
I'm looking for a solution to manage read/write access on backend customers area.

Some users need to be able to view the customers détails & create/edit customers data. But others (different user role) should be able to view only.

I've already see an extension dedicated to my requirement: http://www.magentocommerce.com/magento-connect/manage-customer-acl.html
But it is an alpha stability state, and the installation through Mage Connect is stopped because of Php 5.4.12 incompatibility.

Is someone have an idea how to achieve that?


texts:
I'm getting frustrated with up grading from magento 2.2 to 2.3. no matter what I try I keep getting stuck step by step and it's getting really frustrating.

Right now I'm getting stuck at the symphony errors, and yes I have already read the threads about how to get rid of those but it's just not working for me.

If I were to do a fresh install of 2.3 and then transfer over order data products and customer data. What would be wrong with that?

The only real issue for me would be transferring over the customer data. Because I would want customers to still be able to log into their accounts using their password. I don't care if they can see their previous order information. But I would want their passwords to work.


texts: Top links only show all when customer is logged in

texts:
I've eliminated all of my top links with the exception of:

  Login

  My Cart

I've done this by commenting out the appropriate sections in my themes customer.xml file.

Now what I would like to do is have the following display when the customer logs in:

  My Account

  Compare

  Wish list

I have tried to place the layout information as follows for My Account however I haven't be able to get it to work:

  <customer_logged_in>
    <reference name="top.links">
<action method="addLink" translate="label title" module="customer">Log Out<url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>10</position></action>
<action method="addLink" translate="label title" module="customer">My Account<url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
    </reference>
</customer_logged_in>

How can I display the customer specific links only when they are logged in?


texts: How can I change City (text) to Select base on State in Magento 2

texts:
City field is normally required text field in magento 2. I like to change it into select field like as country and state relationship.

Country>State>City


texts:
We have a link to the complete inventory of magento, the link goes to a cms page and we have added this code inside:

{{block type="catalog/product_list" template="catalog/product/list.phtml"}}

We see all inventory and we can  sort by:, View as:, show:,

The number of page doesn't appears and we need it to navigate truth all inventory, we have more than 150 product and it is not possible to view in the same page.

We also try to add advanced search in left, but when we search things, the advanced search find nothing.


texts: Can't install new composer modules due to PHP version

texts:
I'm trying to install a module on Github through
 composer require postcode-nl/api-magento2-module

However, the installation is failing with this error:
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - feedbackcompany/module-reviews 1.0.0 requires php ~7.1.3||~7.2.0||~7.3.0 -> your PHP version (7.4.18) does not satisfy that requirement.
    - feedbackcompany/module-reviews 1.0.0 requires php ~7.1.3||~7.2.0||~7.3.0 -> your PHP version (7.4.18) does not satisfy that requirement.
    - feedbackcompany/module-reviews 1.0.0 requires php ~7.1.3||~7.2.0||~7.3.0 -> your PHP version (7.4.18) does not satisfy that requirement.
    - Installation request for feedbackcompany/module-reviews ^1.0 -> satisfiable by feedbackcompany/module-reviews[1.0.0].

My situation: I have recently moved my Magento 2 installation to a new hosting environment. The previous environment had PHP 7.3, current environment PHP 7.4.
Is there a way to get around this without having to downgrade my PHP version? Removing the module mentioned in the error is not really an option as well. Besides, the module in the error works just fine on 7.4.


texts: I want to override backend file. Magento2

texts:
I want to override backend file items.phtml

vendor\magento\module-sales\view\adminhtml\templates\order\invoice\view\items.phtml

what i was doing

design\adminhtml\xzktur\Xzktur_Theme\Magento_Sales\templates\order\invoice\view\items.phtml

but it doesn't work, what's my mistake ? Thanks


texts:
<?php

ini_set('max_execution_time', 93600);
ini_set('memory_limit', '4096M');

require str_replace('importers', '', dirname(__FILE__)) . 'app/Mage.php';

error_reporting(E_ALL);
ini_set('display_errors', 1);

try {

$app = Mage::app('default');
    $toDate = date('Y-m-d H:i:s',strtotime('now'));
    $fromDate = date('Y-m-d H:i:s', strtotime('-100 days'));

 $orders = Mage::getModel('sales/order')->getCollection();

echo $orders->getSelect();
//print_r($orders);

}  catch (Exception $e) {
    Mage::printException($e);
    echo "Some Error Occurred";
}


texts: Magento does not use specified default value on attributes of type yes/no

texts:
I added a new attribute with Default Value set to Yes.

I added the attribute to my attribute set and edited the product, but it is set to No by default.

How can I fix it?


texts:
I am running Magento 1.14 EE version. I am also using a third party extension called 'One Step Checkout'
In the checkout, I do not want to load the site footer.
There is a onestepcheckout.xml which I have edited and added the following lines:

<onestepcheckout_index_index>
    <remove name="bottom-footer-new"/>
</onestepcheckout_index_index>

I am using the name of 'bottom-footer-new' which is listed in the CMS -> StaticBlocks
It still will not remove the footer.


texts: How to override subscr_success.html email template in custom theme Magento 2?

texts: I need to change the content of newsletter success email. I tried to override the subscr_success.html file in \Magento_Newsletter\templates\email\ folder in my custom theme. But it cannot be overridden. Can anyone suggest how can I do this? Thanks for your help..


texts: Can't find Payment Date in the Payment or Order class


texts:
Can any one help me to, Where i have to include translated text for German in which csv file have to include ?

Find the below screenshot:


texts: how to show users list in product edit page?

texts:
List all users in product edit page admin panel.
Any tutorial or guide please share.

I just created a tab in product edit page but need to show all users details in that tab.

Here's my code:

<?
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Learning\ClothingMaterial\Model\Attribute\Source;

class Material extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{
    /**
     * Get all options
     * @return array
     */
    public function getAllOptions()
    {

        $roleName = "merchant";
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$roleModel = $objectManager->create('Magento\Authorization\Model\Role');
$userModel = $objectManager->create('Magento\User\Model\User');
$roleModel = $roleModel->load($roleName, 'role_name');
$option_val = [];
        if($roleModel->getId()) {
            $userIds = $roleModel->getRoleUsers();
            foreach($userIds as $userId) {
                $user = $userModel->load($userId);
                $usernames = $user->getUsername();
                $userid = $user->getId();
                $option_val['label'] =  __($userid - $usernames);
                $option_val['value'] =  __($userid.$usernames);
            }
        }
        if (!$this->_options) {
            $this->_options = [$option_val];
        }
        return $this->_options;
    }
}


texts: Magento 2 Knockout JS data binding issue

texts:
My Magento 2 check out page looks like this, seems it does not bind the knockout JS data. When I check the JavaScript console, there are no errors or issues.

What could be the reason for that?


texts:
Can I merge attributes to be a sub-attribute of another?

I have two attributes, capacity and measure.  Each have units of measure and essentially do the same thing.

Is there an easy way to do it?  Is exporting to a CSV, making the changes, and then importing them back a viable option?


texts: How to override core block class correctly? - Magento 1.x

texts:
1 way: to copy directory structure of core block to local code pool and copy core block file. For example : app/code/core/Mage/Catalog/Block/Navigation.php to app/code/local/Mage/Catalog/Block/Navigation.php. And then and needed methods.

2 way: Configure rewrite in this way:

 <global>
    <blocks>
      <catalog>
        <rewrite>
          <navigation>Vendor_Catalog_Block_Navigation</navigation>
        </rewrite>
      </catalog>
    </blocks>
  </global>

And then extend my class from magento core class.

Which way is more correct?


texts: System Upgrade: 2.3.0 -> 2.3.1 -> Cron errors

texts:
I really hope someone can help. As my name suggests I am a noob to Magento. I installed Magento a few months ago and have been going through training and learning sites to find my feet. Yesterday, an update was released (v2.3.1). I have tried to update it via the SYSTEM UPGRADE option. At first, I had errors that the cron was not set up or configured correctly - to fix this I did the following:

Putty into server
log in as owner
changed to root
ran the command  (water is the owner)
inserted the following lines

  /usr/local/bin/php /public_html/bin/magento cron:run |
  grep -v "Ran jobs by schedule" >>
  /public_html/var/log/magento.cron.log

  /usr/local/bin/php /public_html/update/cron.php >> /public_html/var/log/update.cron.log

  /usr/local/bin/php /public_html/bin/magento setup:cron:run >> /public_html/var/log/setup.cron.log

exited the editor
crontab -u water -l
bin/magento cron:run

This gave the output of

  Ran jobs by schedule

However, the readiness check still gave the error that the cron was incorrectly configured. I tried to restart the cron service but it did not help.

I then decided to try the following:
- bin/magento cron:remove
- php bin/magento cron:install (without the [--force])

This change the cron to the following:

> #~ MAGENTO START d548577901e562a035b1312551f1a47d SHELL="/bin/bash"
>     * /opt/cpanel/ea-php72/root/usr/bin/php /home/water/public_html/bin/magento cron:run 2>&1 | grep -v "Ran jobs
> by schedule" >> /home/water/public_html/var/log/magento.cron.log
>
> SHELL="/bin/bash"
>     * /opt/cpanel/ea-php72/root/usr/bin/php /home/water/public_html/update/cron.php >>
> /home/water/public_html/var/log/update.cron.log
>
> SHELL="/bin/bash"
>     * /opt/cpanel/ea-php72/root/usr/bin/php /home/water/public_html/bin/magento setup:cron:run >>
> /home/water/public_html/var/log/setup.cron.log

-bin/magento cron:run

Everything seems to be working as the logs were being generated.

I tried the readiness check again - success the cron was working. BUT, how the error is

  Found non-writable path(s): /home/water/public_html/.user.ini (this
  file I can't find on the system)
  /home/water/public_html/generated/code/* (there are a whole bunch of
  folders and files) /home/water/public_html/var/.htaccess (this file I
  can't find on the system).

The permissions are set to 0644 for files and 0775 for folders.

Any ideas on how I go about fixing this?

Thanks


texts:
I've tried to add the cronjobs for Magento 2 with the Plesk panel. But it doesn't work. Have anyone experience or a solution?

PS.: Magento 1 was a little easier, only run the cron.php and it works.

Thanks for the help.


texts: Magento 2. How can I have some categories show products in Grid View, while others show it in List view?

texts: I have a website where I need to show some products in Grid view while others are in List view. How is this possible in Magento 2? Does anyone know about an extension for this? Or can it be set up in the code?


texts: Free extension for auto address fill in Magento 2

texts: Looking for a free extension for auto address fill in magento 2.


texts: Magento 2 Multistore is not working with multi domain

texts:
I am facing issue while creating multi store in magento 2. I have added 2 store abc and xyz, each points to different domain.

I have added suggested code from different sites.

In index.php I added following code

switch($_SERVER['HTTP_HOST']) {
 case 'dev.abc.com':
        $mageRunCode='abc';
        $mageRunType='store';
        break;
  case 'dev.xyz.com':
        $mageRunCode='xyz';
        $mageRunType='store';
        break;
}
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $mageRunCode;

$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = $mageRunType;
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

In .htaccess file I added

SetEnvIf Host dev.abc.com MAGE_RUN_CODE=abc
SetEnvIf Host dev.abc.com MAGE_RUN_TYPE=store

SetEnvIf Host dev.xyz.com MAGE_RUN_CODE=xyz
SetEnvIf Host dev.xyz.com MAGE_RUN_TYPE=store

Base url is also set for both store correctly in store configuration.

Now the problem is xyz store with dev.xyz.com is working fine however when i switch to abc store using store switcher its always redirect to xyz store dev.xyz.com

Please suggest me any solution. Is this store switcher issue or issue with multi domain, and how I will fix this issue.


texts:
I have a website with two stores let's say English and Greek. So in the Admin Panel on the upper left corner there is also the Default value. I want to the the description of the products of the Default values with store id = 0 so I'm using the following code:

$store_id = 0;
 $collection = Mage::getResourceModel('catalog/product_collection')
                   ->addStoreFilter($store_id)
                   ->addAttributeToSelect('*');

 foreach ($collection as $product) {
            echo "Name".$product->getName()."
";
            echo "Description ".$product->getDescription()."
";
    }

I manage to get the name of the name of all the products but I can't get the description.

Any help would be helpful. Thank you.


texts: How to save an EAV entity from controller?

texts:
I'm trying to build a custom module that contains an EAV entity in Magento 2 for learning purposes.
I have troubles performing a proper save from an admin controller.
I'm trying to avoid code like:

$data = get data from post here;
$myObj->addData($data)->save();

Because the save method is deprecated and because I'm trying to work with interfaces instead of their implementations.

For a flat entity I could do this:

$entity = either get it from a repository or via factory;
$data = get data from post
$this->dataObjectHelper->populateWithArray($entity, $data, EntityInterface::class);

Where dataObjectHelper is an instance of \Magento\Framework\Api\DataObjectHelper that reads the setters of the interface passed as the 3rd parameter and maps the corresponding to the methods from the $data array to my entity.

So if $data looks like this:

$data = [
    'title'=>'Some title',
    'description' => 'Some description'
]

will just call $entity->setTitle('Some title')->setDescription('Some description').

But I cannot do that for the EAV entities because my entity interface will contain only the system attributes and not the custom ones.

I need to get the data from POST and pass it to the $entity instance and then call $entityRepository->save($entity) but I don't want to lose any custom attributes.

How can I proceed in this case?
I looked in the core and for products and categories the controllers still call $entity->save() which is not OK.


texts:
We fetch orders from magento from several clients on hourly basis. With most of our clients it works perfectly. But with two of them i am facing a weird issue.

For them magento ignores all the filters (order_status/time range) and fetches all the orders. But this happens at a specific time of the day. For one client it happens everyday at 7pm and for other 9pm.

This happens every day at that exact time (give or take 2 minutes). And for the rest of the times it works perfectly. I am not a magento expert and i do not have access to their systems.

Any help would be appreciated


texts: Add Text After Price in Spesific Theme Phtml

texts:
I can only add  text before price. I use MeigeeTeam's Bizarre theme. Here is the code including my edit in price.phtml

?php else: ?>
        <?php echo $this->__("Adet Fiyatı") ?>
            <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                <?php if ($_finalPrice == $_price): ?>
                    <?php echo str_replace('class="price"', 'class="price" itemprop="price"', $_coreHelper->formatPrice($_price, true)); ?>
                <?php else: ?>
                    <?php echo str_replace('class="price"', 'class="price" itemprop="price"', $_coreHelper->formatPrice($_finalPrice, true)); ?>
                <?php endif; ?>

This piece of code is starts at line 208 in

  app/design/frontend/bizarre/default/template/catalog/product


texts: Issue while Submitting module for Magento Marketplace

texts:
I tried to upload my Magento 2 module in Magento Marketplace while uploading the file, there was suddenly error came up and stopped to proceed.

Can anyone help with the error?

Environment: PHP 5.6.37 Magento 2.1 EE

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing <namespace>/module-name (1.1.1): Downloading (connecting...)Downloading (0%)           Downloading (100%)
    proc_open(): fork failed - Cannot allocate memory
    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

PHP Warning:  proc_open(): fork failed - Cannot allocate memory in phar:///usr/bin/composer/vendor/symfony/console/Application.php on line 959

Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/bin/composer/vendor/symfony/console/Application.php on line 959

  [ErrorException]
  proc_open(): fork failed - Cannot allocate memory

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...


texts:
I need to replace the invoice id to order id on my invoice PDF (see image).
Spent a few hours researching without finding a proper guide on getting started with customising magento's PDF :/ and explored a few extensions but i really don't wanna add an extension for this. So any help would be greatly appreciated.


texts: M2.3.4 - Category Selections & List not loading in Product Edit

texts:
When in M2 backend, whether going to edit an existing product or adding a new product, Category selection feature not showing any categories or allow you to add any new categories.
The only error output I'm seeing in system.log is when I click on "New Category":

Notice: Undefined index: optgroup in /var/www/html/vendor/magento/module-catalog/Ui/Component/Product/Form/Categories/Options.php on line 108

Tracking that error down to this line of code from Options.php:

$this->categoriesTree = $categoryById[CategoryModel::TREE_ROOT_ID]['optgroup'];

Also getting this 500 error in browser console for this AJAX URL:

/mui/index/render_handle/handle/catalog_category_create/store/0/buttons/1/key/{token}/?namespace=new_category_form&isAjax=true

I have not installed any new extensions and this was a situation where working fine one day and all of sudden just starting getting this error the next.
I'm kind of not sure what direction to go in troubleshooting, any help is greatly appreciated.


texts: Does the default data import supports configurable product?

texts: Under the system->data transfer->import, is this feature supports configurable products import? I downloaded the sampledata link, there is no configurable product inside.


texts: Topics and core stuffs for Magento 2 certifications

texts:
I am planning for Magento 2 certification. Do anyone expert tell me what are normal concepts to master before taking exam? i checked magento stack but didn't get desired result. Also, If possible let me know expected time of magento2 certification exam?

I already checked similar link like Magento 2.0 certification?

Looking response from experts regarding topics and expected date of exam release.

My main objective is also to be aware about topics which i need to master for magento 2 certification. I have started preparation so topics response would be GREAT help for me and community members to be good in magento 2 and for certification as well.

This is not a duplicate to mentioned link in post.


texts: Is there any event on which we can observe eav attribute option save

texts:
I tried eav_entity_attribute_save_after but its not working.

Which event triggerd during eav attrbiute save can anyone please help me on this.


texts: Magento 2 Please check the billing address information. %1

texts:
Anyone experienced this error "Please check the billing address information. %1" I am getting this error while checkout using payment method as my Credit Card.

I sure I am using correct billing information

Any help or suggestions?


texts: order was processed but no trace of it in the admin

texts: We use authorize.net as a payment gateway. They(Authorize) had an outage recently that made it impossible for customers to check out on our website. If someone tried to submit an order during this time, error messages reading "Gateway error: Unable to read response, or response is empty" or "payment capturing error". One customer attempted to place their order 5 or 6 times, with all appearing to fail. However, we looked at our settled transactions report and it looks like one of these orders DID get through and his credit card was processed. Magento has no history of this what so ever. I asked Authorize.net and they claim that their system was back up and running one whole minute before this order came through, so the issue is not with them but with the shopping cart. -_- So, all that being said, how/why would this happen? We have never had this issue before.


texts: Magento 2.1.7 new theme installation error

texts: am tried to change new Magento theme. Store - configuration - Design. but design change not showing here


texts:
I have already created a table with name tutorial_simplenews.I want to add new column to that table.my code is below.

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Tutorial\SimpleNews\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

/**
 * @codeCoverageIgnore
 */
class UpgradeSchema implements UpgradeSchemaInterface
{
    /**
     * {@inheritdoc}
     */
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        if (version_compare($context->getVersion(), '1.0.0') < 0) {
            $connection = $setup->getConnection();

            $connection->addColumn(
              $setup->getTable('tutorial_simplenews'),
            'test',
            ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_INT,
            'length' => '11',
           'nullable' => false,
         'default' => '0',
           'comment' => 'Jute Is Allow Status']);

        $setup->endSetup();
    }
}

module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../../htdocs/lib/internal/Magento/Framework/Module/etc/module.xsd">
     <module name="Tutorial_SimpleNews" setup_version="1.0.0" schema_version="1.0.0">

    </module>
</config>

Please can you any one help me, where am i doing wrong in above code.Any references or suggestions are highly appreciated.


texts: How to find custom catalog search in magento2?

texts:
We checked the following url in http://localhost/magento2/search/ajax/suggest/?q=tes&_=1545813701256

In this url, how to customize the response from that url.

My file path: app/code/Magento/Search/Controller/Ajax


texts: Magento2 around method in plugin to save extra field data of customer

texts: I would like to add extra information to the customer. I have added field in admin side form of customer. I have to save that data. How to add plugin around method during save customer.


texts:
After building my module I tried running bin/magento dev:tests:run static.
This reported a few problems with my code, but I'm not sure exactly what is checked when running this tests.
The official documentation says

  Static code analysis checks that PHP code follows the Magento 2 coding standards and best practices. They usually are executed during continuous integration using the bin/magento tool.

But that does not mean much.
What I found so far is.

presence of composer.json
presence of README.md
presence of licence.txt
order of constructor arguments matches parent order of arguments.

What else?


texts:
I am trying to include the Mini Login Form in a CMS Page in Magento 1.9.2.

The PHP file path is: app/design/frontend/rwd/kellyseye/template/customer/form/mini.login.phtml

This is the code I have included in my CMS Page HTML Editor:

Welcome to

Cashino Market

Exclusively built for Cashino customers; Cashino Market offers fantastic
products and services at discounted prices.

{{block type="customer/form" template="customer/form/mini.login.phtml"}}

    {{block type="banners/banners" template="banners/banners.phtml"}}

Does anyone know why nothing is showing up?

Link to Store: https://cashino.kellyseye.com/


texts: Maganto 2.2.7 product image loading and loading on product details page but it appears on the Homepage/Frontpage

texts: Product images are shown on the Main Front Home page but when single product image clicked and land on the product details page, product image is not shown not appearing instead a gif is loaded. I can't figure this out. Since the folders permission seems to be OK, memory limit set right and etc.


texts: Source class Result for ResultFactory generation does not exist. (magento2)

texts:
I am creating a custom module,

at the end of which I am redirecting it to checkout cart url.

Here is my code, of the index class of custom module.

<?php

namespace Neo\Pincode\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_logger;

    protected $_responseFactory;

    protected $_messageManager;

    protected $_scopeConfig;

    protected $_urlInterface;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,// Context injection
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, // ScopeConfig injection
        \Psr\Log\LoggerInterface $logger //log injection
    ) {
        $this->_resultFactory = $context->getResultFactory();
        $this->_scopeConfig = $scopeConfig;
        $this->_logger = $logger;
        $this->_messageManager = $context->getMessageManager();
        parent::__construct($context);
    }

    public function execute()
    {
        $isValid = 0;
        $availablePincodes =  $this->_scopeConfig->getValue('pincode_section/pincode_group/pincode_field', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
        $pincodes = explode(",",$availablePincodes);
        $userPincode = $this->getRequest()->getParam('pincode');
        foreach ($pincodes as $key => $value) {
            if($value==$userPincode){
                $isValid==1;
                break;
            }
        }
        if($isValid==1){
            $this->_messageManager->addSuccess("Delivery available for above area");
        }
        else{
            $this->_messageManager->addError("Delivery not available for above area");
        }

        $resultRedirect = $this->_resultFactory->create(ResultFactory::TYPE_REDIRECT);
        $resultRedirect->setUrl($this->getBaseUrl().'checkout/cart');
        return $resultRedirect;
    }
}

When this method is excecuted, then at the execution of last line, this error occurs,

Source class "\Neo\Pincode\Controller\Index\Result" for "Neo\Pincode\Controller\Index\ResultFactory" generation does not exist.

I think it is some dependency injection conflict.

Please help, to get out from the issue.


texts:
Resource interpreted as Document but transferred with MIME type application/json warning in Chrome Developer Tools

How to fix this...


texts: Set default role permissions during Magento installation (magerun ?)

texts:
I have Magento installation script (running php install.php (...)) that reinstalls Magento. However - everytime when I reinstall Mage during the development - I have to set permissions for each role individually again.

I would like to make something like
php magerun.phar customer:create test@test.pl test123 Test Test 2

But setting custom role permissions:

Eg. php magerun.phar role:permissions:set role_name permission_name or anything programatically.

Do you know any way to get that?


texts: add admin rating stars to magento products

texts:
how to add another rating stars to a product bay admin, nearby the customer rating stars.
this stars should be different by Magento default rating stars. i mean i want two kinds of stars to be shown for one product. one of theme for admin to put his rating and one of theme for customers.

i created an attribute with admin_rating attribute Code and with global Scope and Catalog Input Type for Store Owner set to text field and Input Validation for Store Owner set to integer number and admin name set to AdminRating. then i assigned this attribute to default attribute set. then i created a product with admin_rating number 30. after that i edited this file where my current ratting is:

app/design/frontend/fortis/default/template/review/helper/summary_nolinks.phtml

default summary_nolinks.phtml content:

?>
<?php if ($this->getReviewsCount()): ?>

        <?php if ($this->getRatingSummary()):?>

                <div class="rating" style="width:<?php echo $this->getRatingSummary() ?>%">

        <?php endif;?>

            <?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?>
            |
            <?php echo $this->__('Add Your Review') ?>

<?php elseif ($this->getDisplayIfEmpty()): ?>

<?php echo $this->__('Be the first to review this product') ?>

<?php endif; ?>

and i added this line under line 6 :

<div class="rating" style="width:<?php echo $_product->getAdminRating();?>%;">

summary_nolinks.phtml content after making changes:

?>
<?php if ($this->getReviewsCount()): ?>

        <?php if ($this->getRatingSummary()):?>

                <div class="rating" style="width:<?php echo $this->getRatingSummary() ?>%">

                <div class="rating" style="width:<?php echo $_product->getAdminRating();?>%;">

        <?php endif;?>

            <?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?>
            |
            <?php echo $this->__('Add Your Review') ?>

<?php elseif ($this->getDisplayIfEmpty()): ?>

<?php echo $this->__('Be the first to review this product') ?>

<?php endif; ?>

  but my whole template messed up and no admin rating is showing.


texts: How to get the products associated with shipment Id?

texts:
I've looked at

How to get ordered items associated with tracking numbers?

How to Access Shipment from Order ID and product ID?

How to get the shipment number of an order item?

Create part shipment and check if item has been shipped

None have worked for what I'm trying to do.

I have the shipment ID in a variable $shipid. Is there anyway to get the products that go with the shipment ID?

I have my figures crossed!

Thanks


texts:
I have 3 static blocks in footer.
Now they are showing up like

Block1
Links
Links

Block2
Links
Links

Block3
Links
Links

I want to show them in same line - like

Block1    Block2    Block3
Links     Links     Links
Links     Links     Links

How to achieve it


texts: How many stores can I create in Magento 2?

texts: I want to create 2 websites and 2 stores and more than 200 store views, so I want to know if Magento 2 can support so much store views? And after adding all the products, will the performance be the same for all the store views?


texts: Can't get Magento javascript component to initialize before my phtml script

texts:
I'm trying to call a Magento Javascript Component in my phtml page to get the customer data saved in session.

I'm having an issue in that the customerdata constructor gets loaded after my script and I can't figure out how to get my script to run after.

This is the customer-data.js file that needs to get loaded before my script

'Magento_Customer/js/customer-data': function (settings) {
            options = settings;
            invalidateCacheBySessionTimeOut(settings);
            invalidateCacheByCloseCookieSession();
            customerData.init();
 }

Here is how I'm trying to call it

require([
    'jquery',
    'Magento_Customer/js/customer-data',
    'domReady!',
    'mage/loader'
], function (jQuery,customerData) {
    //<![CDATA[
    jQuery(document).ready(function() {

        var data = customerData.get('mysession-data');

    });
});

My code works when the customerdata gets initialized but it's not always getting initialized first.

Is there anyway to configure this to get the customerdata to initialize and then I can call my session data?


texts: Enable disabled functionality is not working in magento 2

texts:
I am trying to enable/disable Magento 2 from admin general setting.
I created an option to disabled / enabled module from backend > configuration > module > enable (Yes/No)

when I tried to disabled module functionality still working.
Is it a database related issue or another issue.

Secondly, I tried to get check in coding whether module enable or not by followed below steps

Index controller :-

<?php
namespace Vender\Modulename\Controller\Index;
use Magento\Framework\App\Action\Context;

class Index extends \Magento\Framework\App\Action\Action
   {
      protected $resultJsonFactory;
      protected $scopeConfig;

      public function __construct(Context $context,
      \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
     \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory)
        {
           $this->resultJsonFactory  = $resultJsonFactory;
         //$this->_helper = $helper;
           $this->scopeConfig = $scopeConfig;
           parent::__construct($context);
        }
      protected function helper($className)
      {
         return $this->_objectManager->get($className);
       }

      protected function getUrl($path)
     {
      return $this->_objectManager->get('Magento\Framework\UrlInterface')->getUrl($path);
      }

     public function execute()
     {
    //die('dfsd');
    //$topTel = $this->_helper->getConfig('dynamicpdf/general/topTel');
    //$_thishepler = $this->_helper('Vender\Modulename\Helper\Data');
    //$isEnabled = $helper->getStoreConfig('VenderMOdulename/general/enabled');
    //print_r($isEnabled); die;
    $helper = \Magento\Framework\App\ObjectManager::getInstance()->get('Vendor\modulename\Helper\Data');

    echo "<pre>";
    //print_r($helper);

    if($helper->isEnable()){
    }
          // My code
  }

}

Helper > Data.php

namespace Vendor\Modulename\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;

class Data extends AbstractHelper
{
   protected $context;

   public function __construct(Context $context)
   {
       $this->context = $context;
       parent::__construct($context);
   }

   public function isEnable()
   {
    return $this->scopeConfig->getValue('modulename/general/enable', ScopeInterface::SCOPE_STORE);
   }
}


texts: How do i add event for delete catagory, with same method which i used in add event?

texts:
<config>
   <modules>
        <Ab_CategoryObserver>
            <version>0.0.1</version>
        </Ab_CategoryObserver>
    </modules>
    <global>
        <models>
            <ab_categoryobserver>
                <class>Ab_CategoryObserver_Model</class>
            </ab_categoryobserver>
        </models>
    </global>
    <adminhtml>
        <events>
            <catalog_category_save_commit_after><!-- observe the event -->
                <observers>
                    <ab_categoryobserver>
                        <class>ab_categoryobserver/observer</class>
                        <method>updateTopMenuJson</method>
                    </ab_categoryobserver>
                </observers>
            </catalog_category_save_commit_after>
        </events>
    </adminhtml>

</config>


texts: Magento 2 : Override 'Magento_Checkout/js/view/billing-address.js' with Custom JS

texts:
I want to override Magento's Magento_Checkout/js/view/billing-address.js with my custom JS file, for that I have added below code in my requirejs-config.js

var config = {
    map: {
        "*": {
            "Magento_Checkout/js/view/billing-address": "Example_Module/js/view/billing-address"
        }
    }
};

This works perfectly and I can see my js file overriding magento's default file.

The issue is when I enable JS minify option from admin panel, my JS file does not get loaded and checkout page displays below error.

  Failed to load the Magento_Checkout/js/view/billing-address component.

Is there anyway to resolve this issue?


texts: Infinite scroll is loading once all products are loaded

texts:
I want to  make infinite scroll to load even if not all products are loaded
templates for infinite scroll
here is the code :
<?php if($block->isEnabled()): ?>

        <div id="infinite_loadMoreAnchor"
             data-pages="<?php echo $block->getPagesToShow(); ?>">

Block code for Infinite.php
protected function _getProductsCount()
    {
        $block = $this->getLayout()->getBlock('category.products.list');

        if (!$block) {
            $block = $this->getLayout()->getBlock('search_result_list');
        }

        if (!$block) {
            return false;
        }

        $productCollection = $block->getLoadedProductCollection();

        return $productCollection->getSize();
    }

    /**
     * Get number of pagination pages
     *
     * @return mixed
     */
    public function getPagesToShow()
    {
        return min($this->getPagesCount(), $this->_pagesToShowOption());
    }

    /**
     * Get pagination pages from collection
     *
     * @return float
     */
    public function getPagesCount()
    {
        $pages = ceil($this->_getProductsCount()/$this->_productsPerPage());
        return $pages;
    }

    /**
     * If is enabled
     *
     * @return mixed
     */
    public function isEnabled()
    {
        return $this->_scopeConfig->getValue('ajaxcatalog/general/ajaxcatalog_infinite_scroll',
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    /**
     * Get pages to show option
     */
    protected function _pagesToShowOption()
    {
        return $this->_scopeConfig->getValue('ajaxcatalog/general/ajaxcatalog_infinite_pages',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    /**
     * Get number of products displayed in grid/list mode
     *
     * @return mixed
     */
    protected function _productsPerPage()
    {
        if($this->_request->getParam('product_list_mode') == 'list'){
            return $this->_scopeConfig->getValue('catalog/frontend/list_per_page',
                \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
        }


texts:
I'm using Magento 2.2.6, How can I get the email ID of logged in user to show in header.

Thanks.


texts: How can I filter customers by the fact if they have a quote in the sales_flat_quote table? I could foreach every customer to check if their email address is located in the sales_flat_quote table, but that doesn't sound like a good way to do it.


texts: I'm going to move from Squarespace to Magento- does anyone have any recommendations on how to get my products, customer and order information into Magento?


texts: Group-prices isn't getting added to the cart

texts:
I have some products, where there are some normal prices, but when logged in as a customer (in a specific group) the prices changes.
These price-changes works fine on the product-view, but when adding a product to the cart, the price is the same as the "logged-out"-price.

Why isn't the group-price getting added to the cart?

Thanks in advance


texts: Magento2 : Add New columns in "Products in Category"

texts:
I want to add new columns in Magento 2 admin category where product assign  to category with product details.

Please check below image for more details:

Here, I have tried to add column using xml file at this path:

  /vendor/magento/module-visual-merchandiser/view/adminhtml/ui_component/merchandiser_product_listing.xml

But that custom column appear while click on add product at that time it's window column display there.


texts:
File location

<magento dir>\vendor\magento\module-directory\Model\Currency.php

In Magento we have "finalPrice" & "oldPrice"

Can anybody tell me how to check Price Type? Can we use

$priceCurrencyObject = $_objectManager->get('Magento\Framework\Pricing\PriceCurrencyInterface');

Not sure


texts: How can I add all child simple products to a Magento collection?

texts:
I'm getting a collection of products which are on a customer's wishlist by passing in the IDs of those products (a mix of simple and configurable products) in the $customerListItemIds array and then running a stock check on them in the foreach loop. This is working fine except it's flagging up all configurable products as having 0 stock when, actually, their child products do have stock.

So I tried adding the visibility and type_id filters to the collection to skip configurable products and to include all simple products but this isn't working – the child simple products are not being added to the collection.

My question is how can I include the children of the configurable products and not include their parent?

<?php

    $lowStockCollection = array();
    $stockThreshold = Mage::getStoreConfig('cataloginventory/options/stock_threshold_qty');

    ...

    $productCollection = Mage::getModel('catalog/product')
                         ->getCollection()
                         ->addAttributeToSelect('*')
                         ->joinField('qty',
                             'cataloginventory/stock_item',
                             'qty',
                             'product_id=entity_id',
                             '{{table}}.stock_id=1',
                             'left')
                         ->addAttributeToFilter('visibility', array(1,2,3,4))
                         ->addAttributeToFilter('type_id', Mage_Catalog_Model_Product_Type::TYPE_SIMPLE)
                         ->addAttributeToFilter('qty', array('gt' => 0))
                         ->addAttributeToFilter('entity_id', array('in' => $customerListItemIds));

?>

<?php foreach($productCollection as $product): ?>
        <?php if($product->getQty() < $stockThreshold): ?>
            <?php $lowStockCollection[] = $product; ?>
        <?php endif; ?>
<?php endforeach; ?>


texts:
I first install Magento in local host with xampp but after my installation i can't connect to my database and show me the following notice.
how to solve ?

  There has been an error processing your request Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root
  directory.  The following modules are outdated: Magento_Customer data:
  current version - none, required version - 2.0.6
  Magento_BundleImportExport data: current version - none, required
  version - 2.0.0

Error log record number: 740330652


texts:
I don't know if it is the reason to introduce custom CSS.
Now my website opens some product pages, which prompts the following error.
But some product pages are open normal. How can I solve it?


texts: Magento 2 goes down with 50 concurrent request

texts:
I am running magento 2 (using magento rest api services only) on aws t2 medium instance with ubuntu16.04, apache 2.4, php7, mysql 5.7.

When I use seige tool for load testing with 50 concurrent request to api. CPU goes up. And server get crash.

Not able to understand why this is happening.

Aws console shows higher mysql connections rate.

How I can handle this situation? Do I need to tune apache or magento2?


texts: How to include a phtml file into CMS page in magento 2?

texts:
This is the code equivalent in magento 1

{{block type="core/template" template="theme/home_banner.phtml"  name="myname"}}

Which is the equivalent code for magento 2.
I try to include my phtml in this Path: ?.

C:\xampp2\htdocs\myProject\vendor\magento\theme-frontend-luma\Special_Price\special_price.phtml

I' am opened for any ideas.
Thank you!


texts: minicart displaying 0 and not displaying products

texts:
Hi I have an issue with my minicart when I open this it displays a zero and does not display the product details.  I have tried to work out where the problem is but cannot seem to resolve the error.
my version of magento is 2.2 and the url to access the site is https://tradedoorhandles.co.uk the site is not 100% finished yet trying to resolve the last few issues but this one has been driving me mad for weeks. If anyone is able to offer some advice on how to resolve this or where to go I would really appreciate this, the site uses grouped products I have looked at the various vendor and theme minicart files and have had no joy resolving the issue.


texts: How to store dropdown value in database and display selected when edit item?

texts:
I am developing custom module. Other fields are saving data in database but i have issue with Dropdown field. It's not saving value in database. My code as following:

$elements['target'] = $fieldset->addField(
        'target',
        'select',
        [
            'name' => 'target',
            'label' => __('Link Target'),
            'title' => __('Select target of slide item\'s link'),
            'required' => true,
            'options' => $model->getLinkTargetOptions()
        ]
    );

In the model file

public function getLinkTargetOptions()
{
    return [
        '_self' => __('Self'),
        '_blank' => __('Blank'),
    ];
}

Above code adding Dropdown in the admin form. I don't know how to store it's value.