texts: Custom module collection array not return

texts:
I have created a custom module and I have return collection array but it does not return foreach array in Magento 2.3.2. it returns the only foreach last value.

Block Code

<?php
/**
 * @copyright Devidas
 *
 * @see PROJECT_LICENSE.txt
 */

namespace Developer\Infographics\Block\Index;

use Magento\Framework\View\Element\Template;
use Magento\Catalog\Model\CategoryFactory;

class Leftinfographics extends Template {

    protected $_resource;
    protected $session;
    /**
     * @param \Magento\Framework\Registry $registry
     */
    private $_registry;
    /**
     * @param \Magento\Framework\Registry $registry
     */
    protected $_catalogSession;
    /**
     * @param \Magento\Catalog\Model\CategoryFactory $categoryfactory
     */
    private $_categoryFactory;
    /**
     * @param Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
     */
    protected $_productCollectionFactory;
    /**
    *@param Magento\Catalog\Model\Category $catgory
    **/
    protected $_category;
    /**
     * Constructor
     * @param \Magento\Framework\App\Helper\Context $context
     * @param \Magento\Catalog\Model\Session $catalogSession
     **/
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Developer\Infographics\Model\InfographicsFactory $collectionFactory,
        \Magento\Framework\View\Page\Config $pageConfig,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Framework\Registry $registry,
        \Magento\Catalog\Model\Session $catalogSession,
        \Magento\Framework\Session\SessionManagerInterface $session,
        \Magento\Catalog\Model\Category $catgory,
        CategoryFactory $categoryfactory,
        \Magento\Framework\App\ResourceConnection $resource,
        array $data = [])
    {

        parent::__construct($context, $data);
        $this->pageConfig = $pageConfig;
        $this->collectionFactory = $collectionFactory;
        $this->_registry = $registry;
        $this->_catalogSession = $catalogSession;
        $this->session = $session;
        $this->_categoryFactory = $categoryfactory;
        $this->_productCollectionFactory = $productCollectionFactory;
        $this->_category = $catgory;
        $this->_resource = $resource;
    }

    public function getCategoryViceversaCollection()
    {

        $collection = array();
        $finalsearch = 'test,magento,abc,xyz'
        $commaList = explode(',', $finalsearch);
        foreach ($commaList as $key => $value) {
        $collection = $this->collectionFactory->create()->getCollection()->addFieldToFilter('tags', array('like' => '%'.$value.'%'));
        }
        return $collection;

    }

}

Template Code

$productxyzdata = $block->getXYZ();
var_dump($productCollectiondata->getData());


texts: I'm wondering where can I find the table that holds the prices for all of my catalog->products item?


texts: How can we use getCountryTranslation() in magento2

texts:
I need full country name using short code.
I have code for magento 1.9 But I need it for magento2. can any one help me please.

$customerBillingCountry = 'IE';

$customerBillingCountry = Mage::app()->getLocale()->getCountryTranslation($customerBillingCountry);


texts: How to add Dynamic Rows Component to my custom module?

texts:
I developed site in magento 2. i create a custom module. now i want to add Dynamic Rows Component to my module i read document.

http://devdocs.magento.com/guides/v2.1/ui-components/ui_dynamic_rows.html

But i know magento at beginner level. and i can't able to understand after reading document. i can't understand where on which file should i changed.


texts: How to get order details in custom order grid?

texts:
I have to create custom module,
in this module have a grid,
in this grid such as a some fields, like, order_id,product_name, etc
in that field how to get order data?

here is my Grid.php Code

<?php

class Mt_Wizardsports_Block_Adminhtml_Wizardsports_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
    public function __construct()
    {
        parent::__construct();
        $this->setId('wizardsportsGrid');
        // This is the primary key of the database
        $this->setDefaultSort('wizardsports_id');
        $this->setDefaultDir('ASC');
        $this->setSaveParametersInSession(true);
    }

    protected function _prepareCollection()
    {
        $collection = Mage::getModel('wizardsports/wizardsports')->getCollection();
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    protected function _prepareColumns()
    {
        $this->addColumn('wizardsports_id', array(
            'header'    => Mage::helper('wizardsports')->__('ID'),
            'align'     =>'right',
            'width'     => '50px',
            'index'     => 'wizardsports_id',

        ));

        $this->addColumn('order_id', array(
            'header'    => Mage::helper('wizardsports')->__('Order ID'),
            'align'     =>'right',
            'width'     => '50px',
            'index'     => 'order_id',
        ));

        $this->addColumn('product_name', array(
            'header'    => Mage::helper('wizardsports')->__('Product Name'),
            'align'     =>'left',
            'index'     => 'product_name',
        ));

        $this->addColumn('find_wizardsports', array(
            'header'    => Mage::helper('wizardsports')->__('How To Find Wizardsports?'),
            'align'     =>'left',
            'index'     => 'find_wizardsports',
        ));

        return parent::_prepareColumns();
    }

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

}


texts: Order email template override in magento 2

texts:
Am trying to override the sales order email and I did that override but I have doubt in code, In that email template they called variable like

{{var payment_html|raw}}

in payment methods, I want to know in which file this variable is calling please tell me.


texts:
I try to follow this tutorial:
http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-5.html

Problem is it doesn't work at all as Magento always tries to load the model from the wrong folder

Warning: include(Mage/My/Module/Model/Resource/Blogpost.php)

Here is my config.xml. The part with overwriting the success page works like a charm.

<?xml version="1.0"?>
<config>
    <modules>
        <my_module>
            <version>1.0.0</version>
        </my_module>
    </modules>
    <frontend>
        <routers>
            <my_module>
                <use>standard</use>
                <args>
                    <module>My_Module</module>
                    <frontName>my_module</frontName>
                </args>
            </my_module>
        </routers>
        <layout>
            <updates>
                <my_module>
                    <file>module.xml</file>
                </my_module>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <my_module>
                <class>My_Module_Block</class>
            </my_module>
            <checkout>
                <rewrite>
                    <onepage_success>My_Module_Block_Onepage_Success</onepage_success>
                </rewrite>
            </checkout>
        </blocks>
    </global>
    <models>
        <my_module>
            <class>My_Module_Model</class>
            <resourceModel>my_module_resource</resourceModel>
        </my_module>
    </models>
</config>


texts: For the past three days there has been sudden spike in bandwidth. Upon analyzing a specific IP address is constantly doing catalog search. Please see attachment. What is the best way to block this bandwidth consumption. I already have Disallow: /catalogsearch/ in robots.txt. Do I ask the hosting provider to block the IP?


texts: Question about UpgradeSchema and UpgradeData files

texts:
Sorry, I'm new in using Magento 2.

In my UpgradeSchema.php I would like to add a column to my table and in my UpgradeData.php

I would like to add new records to the table.

In both the file i have this if statement...

if(version_compare($context->getVersion(), '1.0.1', "<")) {
    //do something
}

My ask is :

Who $context->getVersion() and 1.0.1 are ?

Does $context->getVersion() match with the setup_version in my module.xml file ?


texts: How to define an area for layout and controllers like adminhtml and frontend in magento2?

texts:
I want to create a separate area for vendor just like Adminhtml and frontend.

Is that possible??


texts: Converting M1 password hash to M2 password hash

texts:
I imported around 6000 customers from Magento 1.3 to a magento 2.2 through csv.

Of course when i try to login to magento 2 with an account from magento 1, it doesn't work probably  because of the password hash that looks like this:

  b67f0da6abeaa55560701296df7f05d7:3K

Any idea to convert the password_hash? To make it compatible with Magento 2.2?


texts: Magento 2: Change "Qty" label to "Select Qty" in product view page

texts:
Is there another way to change the product page "Qty" label text to "Select Qty" than overriding the file

/var/www/html/magento/vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml

in custom module ?

Maybe a method similar to changing the content of blocks like this ?

<referenceBlock name="product.info.sku">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Magento_Theme::lorem.phtml</argument>
    </action>
</referenceBlock>


texts: Display email id in shipping and billing address

texts:
I am working on Magento 1.9 version, I want to show email ID of user on billing and shipping address. I want to add variables in html of

System->Configuration->Customer->Customer Configuration->Address
Templates

but I didn't find variable to add email address.
Use

{{depend order.getBillingAddress().getEmail()}}
{{var order.getBillingAddress().getEmail()}}
{{/depend}}
{{depend order.getCustomerEmail().getEmail()}}
{{var order.getCustomerEmail()}}
{{/depend}}

But still output is empty


texts:
I want to display a specific attribute only when the set time is not passed.
Therefore I created the following code:

<?php $dateFrom = Mage::app()->getLocale()->storeTimeStamp(); $dateTo = $_product->getData('actie_datum_eind');?>
<?php if (Mage::app()->getLocale()->isStoreDateInInterval($store, $dateFrom, $dateTo)) : ?>

<?php echo $this->htmlEscape($_product->getData('actie_label')); ?>

<?php endif;?>

But does not work, the label is not displayed.

When I echo both values, I get the following results:

<?php echo $_product->getData('actie_datum_eind')?>

<?php echo Mage::app()->getLocale()->storeTimeStamp()?>

That results in the following:

2017-10-04 00:00:00
1505465811

The results of:

<?php echo $dateFrom?>

<?php echo $dateTo?>

Are:

1505465811
2017-10-04 00:00:00

What am I missing here?


texts:
I want to run a update query but it is not working with multiple conditions.

$where = ['parent_id'  => (int)$shipmentId,
                  'order_item_id' => (int)$itemId,
                 ];

        $connection->update(
        $tableName,
        array("status" => 'requested'),
        $where
        );

How can I do that?


texts:
I am working on a B2B website in which the customers have sub accounts. I have added a attribute in the quote and order for including the sub user ID. When the different sub user login I am able to set the privileges and dashboard links. But I am not able to load separate cart for each sub user. Is there any possible way in magento.

I have tried many options but nothing is giving the output

                $currentusertype='customer';
                $customerid='';
                if(Mage::getSingleton('core/session')->getUserType()){
                    $currentusertype=Mage::getSingleton('core/session')->getUserType();
                }
                $customer = $observer->getCustomer();
                $quotes = Mage::getModel('sales/quote')->getCollection();
                $quotes->addFieldToFilter('customer_id',$customer->getId());
                if($currentusertype=='customer'){
                    $quotes->addFieldToFilter('customerid',$customer->getId());
                    $quotes->addFieldToFilter('customertype',$currentusertype);
                    $customerid=$customer->getId();
                } else {

                    $quotes->addFieldToFilter('customerid',Mage::getSingleton('core/session')->getUserId());
                    $quotes->addFieldToFilter('customertype',$currentusertype);
                    $customerid=Mage::getSingleton('core/session')->getUserId();

                }
                if($quotes->count()){
                    Mage::getModel('checkout/cart')->setQuoteId($quotes->getFirstItem()->getId());
                    $cart = Mage::getModel('checkout/cart')->getQuote();

                }else{
                    $quoteObj = Mage::getModel('sales/quote')->assignCustomer($customer);
                    $quoteObj->setCustomerid($customerid)->setCustomertype($currentusertype)->save();
                    Mage::getModel('checkout/session')->setQuoteId($quoteObj->getId());
                    $cart = Mage::getModel('checkout/cart')->getQuote();
                }


texts: Magento 2 not loading css/js after pointing domain to new location

texts:
I originally had Magento 1 at example.com which my webhost had in /public_html/example

I installed Magento 2 at v2.example.com which my webhost had pointed at /public_html/example2

After migration, I am attempting to switch the Magento 2 shop to be located at the old shop's domain.

I've set webhost to point example.com to public_html/example2
I've changed the corresponding values in core_config_data's web_*_url both to example.com instead of v2.example.com.
I also changed the cookie domain setting accordingly.
I've cleaned caches and deleted /var/cache content.

When attempting to load example.com, the browser attempts to load

http://example.com/example/index.php/?SID= . . .

The title of the page is 404 and it loads some of the front page content but without css styling or js.

Also, when attempting to access the backend, http://example.com/index.php/admin takes me to http://example.com/index.php/admin/example.com/index.php/admin/?SID= . . .

What have I forgotten to do?


texts: How can i change the Attribute Set by products?

texts:
I need to change Attribute set for some of the products but
there is no option to change them.


texts: jQuery programatically set options of dropdowns

texts:
I am lost, please take a look at http://www.austrokamin.at/edelstahlkamine/edelstahlkamin-doppelwandig/bodenplatte-dw.html

I need to set the two dropdowns with jQuery.
For example:

jQuery('#product-options-wrapper .input-box select').eq(0).prop('selectedIndex', 2);

No Problem so far. But now some event handler(s) must be triggered so that the second dropdown is activated.

When i select the element in Firebug and type getEventListeners($0) it tells me "blur", "focus" and "change"

I fired all of these events in the console with:

jQuery('#product-options-wrapper .input-box select').eq(0).focus();
jQuery('#product-options-wrapper .input-box select').eq(0).change();
jQuery('#product-options-wrapper .input-box select').eq(0).blur();

but nothing seems to have effect.
Can anyone help me please.


texts: Magento 2: Not able to import store table

texts:
I have exported database. The size of database approximately 10GB. I imported the database in my local server, but Few tables like store & store_group is not installed. I imported store_group but I am not able to import table store. It returns error "Cannot add foreign constraints" every time.

I tried all the possible ways but I am stuck.

Could you please help?


texts: How to include custom JS files in magento 2 custom module

texts:
I am well aware of a RequireJS feature of Magento 2. I used it quite well for some JS scripts.

require(['jquery', 'ajaxform', ''], function (jQuery)
{
         // JS code
});

But now I have a template HTML for which I have custom JS files to perform actions.

Like -

          <select class="form-control" id="font-dropdown">
          </select>

Now here I am fetching options for above select tag dynamically using JSON from a custom JS file.
I have not used any JS code on the template file. I have called events on each HTML element from custom JS files. I have nearly 15-20 JS files like this.

So I am confused about how to include these JS files in my custom module. I have rendered my template on front-end using the custom module. How should I add JS files?


texts: Custom Yes/No product attribute in template works on product page, but not on category page

texts:
I have a yes/no attribute used in product to output some text and it works fine:

<?php if ($_product->getAttributeText('sale_text') == "Yes"): ?>
    <?php
        $day = strtotime('friday this week');
        echo " - On Sale Through " . date('m/d/Y', $day);
    ?>
<?php endif; ?>

However, when outputting yes/no attribute label on the category page (list.phtml) with the following code, I'm getting a "No" for all products even though I have several products set as "Yes":

<?php echo $_product->getAttributeText('sale_text'); ?>

Any idea what the issue is and how to fix?


texts:
How can I update the custom attributes such as description?
The following code properly update price and product name, but not custom attributes (unchanged). The new product is created properly with custom attributes, the problem is while updating.


texts:
I recently noticed an error in my apache logs:

PHP Fatal error:  Call to a member function processIpnRequest()
on a non-object in /app/code/core/Mage/Paypal/controllers
/IpnController.php on line 43

I'm not sure what might be causing this issue, but it does seem to show up whenever a Paypal payment goes through the site (though the payments seem to go through successfully).  Any thoughts on what might be causing it?


texts: Unable to find default theme files in Magento 2

texts:
I installed Magento 2 and also migrated my categories, products, attributes etc from Magento 1.9.2.2 to Magento 2.0 successfully. Now I need to work on my existing theme and want to migrate it for Magento 2.0. I read many blogs and articles about Magento 2.0 theme development, however, I can't find default theme files in app/design/frontend/Magento to get an idea about the structure of Magento 2.0 themes.

Kindly help me out with this. Share some tutorials or methods to develop Magento 2.0 theme.

Thanks in advance.


texts: I want to add a note on product detail page in admin under "Images And Videos" tab in Magento 2

texts:
How can i add a note on product detail page in admin under "Images And Videos" tab in Magento 2.

Any help would be appricicated.


texts: How to place a block inside another one without getChildHtml()

texts:
I'm working on a loyalty module. For each order, i would like to show the number of loyalty points related to the it in the sales_order_view, just below the order_totals block, declared in the sales.xml layout.

The problem is that i can't modify or override core's templates to avoid any conflict with another module. Therefore, i can't add getChildHtml() to place my block.

Do you have any idea ?


texts: Assigning Multiple Customer Groups to Customers

texts:
I'm working on a Magento 2 Commerce project at the moment that has data ready to be imported that has thousands of price rules.

The issue I have currently is that there are customer groups in their system that have more than one price group associated with it.

For example, they have a customer price list group called '03', and within that they have price codes called '03Q1', '03Q2', '03Q3', etc.

Therefore, the only way we could do this within Magento is to create each variation as a customer group. The issue with that is because there are so many (around 4500), this would be impractical to maintain.

Another issue we found was that within their price data, they have examples where one product appears in more than one price group, and the customer appears in more than one price groups.

In Magento, advanced pricing is handled by customer groups, and we know that you can't have a customer that belongs to more than one customer group.

As such, are they any plugins out there that might be able to assist with this issue and make admin work a lot easier to manage ? We tried Customer Segmentation but you can't use that for product price rules, only cart price rules.

Any help would be really appreciated.

Many thanks,
Joe


texts:
I want to change the font size of my h1 tag on the homepage. I am using Chrome inspect and it tells me the css changes are actually inside the page itself, not css. So I look at source code:

/* Theme Fonts Settings */

        .page-title h1,
        .page-title h2,
        .page-print h1
         {font-family: 'Open Sans';}

        .page-title h1,
        .page-title h2,
        .page-print h1
        {  color: FFFFFF;}

I want to make it large by adding a font-size command.

How do I access this via FTP to edit it? I been looking at through all /app/design/frontend/npdiploma/default/layout/ files and /template/ files and can't find anything related to this.

Normally I just edit media/css_secure/ files but this seems embedded into the actual page.


texts: Magento 2: why price textbox dissappeared from add product?

texts:
Why the price box is not there?

please check the following image

in the console I get this error message:

TypeError: Constr is not a constructor[Learn More] layout.js:137:25
initComponent http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/Magento_Ui/js/core/renderer/layout.js:137:25
fire http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/jquery.js:3232:12
fireWith http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/jquery.js:3362:8
Deferred/</deferred[tuple[0]] http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/jquery.js:3461:6
fire http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/jquery.js:3232:12
fireWith http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/jquery.js:3362:8
Deferred/</deferred[tuple[0]] http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/jquery.js:3461:6
loadSource/< http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/Magento_Ui/js/core/renderer/layout.js:120:13
execCb http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1650:24
context.execCb http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/mage/requirejs/resolver.js:145:24
check http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:866:43
enable/</< http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1113:29
bind/< http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:132:20
emit/< http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1156:21
each http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:57:31
emit http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1155:17
check http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:917:25
enable http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1143:17
init http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:774:21
callGetModule http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1170:17
completeLoad http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1564:25
onScriptLoad http://localhost/pub/static/version1540020473/adminhtml/Magento/backend/en_US/requirejs/require.js:1671:21


texts: Where to add margin on the original price?

texts:
I have the problem that the imported prices are the prices from the wholesale and my buying price.

However I'd like to add a margin based on the price ranges and sell it accordingly.

The rules are easy:

0-500: 15%
500-1000: 18%
1000-1500: 20%
etc.

Is there any standard? I used to work with the plugin Percentage Pricing but unfortunately there are side effects like on special price it doesn't work. It seems that also the "promotion"-setting could set the same pricing as percentage pricing does.

So I'd like to stick as much as possible to the standard.


texts: Magento 2 - Get all details in product list api

texts:
Is it possible to get product available quantity and ordered product quantity to get product API
http://localhost/test/rest/V1/products with all other details?

And extension_attributes are also not showing.


texts: Magento2 - How to execute validator on form

texts:
I've extended the register form with some AJAX functionality and added a custom validator method decribed here. Now I want to execute the validation process after getting the result of the AJAX call.

How can I do that?


texts: Admin grid save & continue edit button - ui components

texts:
So as you already understand I want to create Save & Continue Edit button with ui components. Here is my ui components file:

 <item name="buttons" xsi:type="array">
        <item name="back" xsi:type="string">Vendor\ProductComments\Block\Adminhtml\Comment\Edit\BackButton</item>
        <item name="saveAndContinueEdit" xsi:type="string">Vendor\ProductComments\Block\Adminhtml\Comment\Edit\SaveAndContinueButton</item>
        <item name="save" xsi:type="string">Vendor\ProductComments\Block\Adminhtml\Comment\Edit\SaveButton</item>
        <item name="delete" xsi:type="string">Vendor\ProductComments\Block\Adminhtml\Comment\Edit\DeleteButton</item>
    </item>

SaveAndContinueButton.php:

<?php

namespace Vendor\ProductComments\Block\Adminhtml\Comment\Edit;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class SaveAndContinueButton extends GenericButton implements ButtonProviderInterface
{
    /**
     * @return array
     */
    public function getButtonData()
    {
        return [
            'label' => __('Save and Continue Edit'),
            'class' => 'save',
            'data_attribute' => [
                'mage-init' => ['button' => ['event' => 'save']],
                'form-role' => 'save',
            ],
            'sort_order' => 80,
        ];
    }
}

My save button is working correctly, but when I press save and continue button, it just goes to admin index page. Also I haven't yet decided how to do that so it stays on edit page, but first I need to fix it so it uses Save.php controller. For save button i did this:

<item name="config" xsi:type="array">
                <item name="submit_url" xsi:type="url" path="*/*/save"/>
            </item>

Do i need to do something like this also for save and continue button?


texts: How to pass data using chackboxes in HTML uiComponent

texts:
I'm trying to add/remove data based on a checkbox. I can't figure out how go get the value to get through to the function.
My console is logging a list of my observed variables.
Any idea how to pass the data that I need using checkboxes?
Thanks
My html

                <input type="checkbox" id="awning"
                       value="Awning"
                       checkedValue="awning"
                       click="processCheckbox.bind('awning')">
                Awning

                <input type="checkbox" id="sign"
                       value="Sign"
                       checkedValue="sign"
                       click="processCheckbox.bind('sign')">
                Sign

js

define(['jquery', 'uiComponent'], function ($, Component) {
    'use strict'

    return Component.extend({
        defaults: {
            industries: []
        },

        initObservable: function () {
            this._super().observe(['industries']);

            return this;
        },

  processCheckbox: function (value) {
            console.log(value);
}


texts: Set Cron depending on user input in configuration

texts:
In custom module's configuration, we allow admin to select a day when a task needs to be executed.

How do I specify that value dynamically in cron schedule?

for eg: Admin selected 20 in the settings page, then I need the cron schedule like this:
* * 20 * *

Please let me know if anyone have achieved this before?


texts:
I've developed a bespoke module which lists a series of people on the site. Each person has their own URL (a bespoke Magento controller, which does basic CRUD on Person models) and I need to feed these public URLs into a Google Sitemap XML file.

I want to use Magento's own sitemap generation and the cron if I can.

The Mage_Sitemap_Model_Observer already pulls all the Sitemap records from the sitemaps table and one-by-one calls their generateXml() methods.

$collection = Mage::getModel('sitemap/sitemap')->getCollection();
/* @var $collection Mage_Sitemap_Model_Mysql4_Sitemap_Collection */
foreach ($collection as $sitemap) {
    /* @var $sitemap Mage_Sitemap_Model_Sitemap */

    try {
        $sitemap->generateXml();
    }
    catch (Exception $e) {
        $errors[] = $e->getMessage();
    }
}

I think I need to add my new Sitemap in the sitemaps table which will then be called to generate my (separate) XML file for my custom model records. However, I don't know how to tell Magento to use my extended My_Module_Model_Sitemap instead of just Mage_Sitemap_Model_Sitemap, the latter of which will just give me an XML file listing all the same categories, products, and CMS pages as the main sitemaps.

The sitemaps table has a sitemap_type column, but this is never referenced in the Magento codebase as far as I can tell.

How can I use Magento's inbuilt sitemap engine while overwriting the Mage_Sitemap_Model_Sitemap to have my own generateXml() method? Or must I build an alternative sitemap system just for my own purposes here?


texts: Why does a category have both parent_id and path?

texts:
I was wondering...

As of 1.9.1.0, catalog_category_entity still has both a path as well as a parent_id field. Why is that? Isn't that just redundant information? You could follow the parent_id up the tree to resolve the path; is it made for query speed purposes?


texts:
I am trying to have a few more additional tabs added after the Reviews tab, though my tab keeps appearing as the first tab

<?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">
    <body>
        <referenceBlock name="product.info.details">
          <block class="Magento\Catalog\Block\Product\View" name="postage.tab" as="postage" template="product/view/postage.phtml" group="detailed_info" >
             <arguments>
                <argument translate="true" name="title" xsi:type="string">Postage</argument>
             </arguments>
          </block>
        </referenceBlock>
    </body>
</page>


texts: We want to be able to take payment without creating an order. The record should be maintained in orders > transactions or any other panel. Very much like a donation.


texts: Get the special price of the product using query in Magento

texts:
I want to create a view of Magento products. The following query will do that:

Note: Magento's default records used to create it.

SELECT
   P.entity_id as uid,
   P.created_at as cdate, # Created to updated date?
   PN.value as name,
   C.attribute_set_name as category,
   PR.value as price,
   'INR' as price_unit,
   concat('http://www.mydemo.com/media/catalog/product/', U.value) as pic_url,
   D.value as description,
   concat('http://www.mydemo.com/', PU.value) as product_url

FROM catalog_product_entity as P
   LEFT OUTER JOIN catalog_product_entity_varchar as PN
       ON P.entity_id = PN.entity_id
           AND PN.attribute_id = 71 # 71 Product name
   LEFT OUTER JOIN eav_attribute_set C
       ON C.attribute_set_id = P.attribute_set_id
   LEFT OUTER JOIN catalog_product_entity_decimal PR
       ON PR.entity_id = P.entity_id
       AND PR.attribute_id = 75 # Price
   LEFT OUTER JOIN catalog_product_entity_media_gallery as U
       ON P.entity_id = U.entity_id
       JOIN catalog_product_entity_media_gallery_value as V
           ON U.value_id = V.value_id
               AND V.position = 2
   LEFT OUTER JOIN catalog_product_entity_text as D
       ON P.entity_id = D.entity_id
           AND D.attribute_id = 72
   LEFT OUTER JOIN catalog_product_entity_varchar as PU
       ON P.entity_id = PU.entity_id
       AND PU.attribute_id = 98
       AND PU.store_id = 1
WHERE P.entity_id in ('402', '403', '404', '413')
ORDER BY P.entity_id

Here, it will show the products with  its price. For the product id 403 it shows the price as 175.00 but it has a special price 140. What I want to show is if special price is there it show that otherwise its actual price.

Currently:

uid  price
402  190.00
403  175.00 # this is wrong because it has spacial price is 140
404  160.00
413  125.00

Expected result:

uid  price
402  190.00
403  140.00
404  160.00
413  125.00

If I pass PR.attribute_id = 75, it gives price if PR.attribute_id = 76 it gives special price. How can we show both values in the same result.
How should I modify the query to achieve this?

UPDATE:

The query is updated as below to get the value as expected:

SELECT
  #CP.special_from_date,
  #CP.special_to_date,
   P.entity_id as uid,
   P.created_at as cdate, # Created to updated date?
   PN.value as name,
   C.attribute_set_name as category,
   #PR.value as price,
   #PRN.value as normal_price,
   #PRS.value as special_price,
   coalesce(PRS.value, PRN.value) as price,
   'INR' as price_unit,
   concat('http://www.mydemo.com/media/catalog/product/', U.value) as pic_url,
   D.value as description,
   concat('http://www.mydemo.com/', PU.value) as product_url

FROM catalog_product_entity as P
   LEFT OUTER JOIN catalog_product_entity_varchar as PN
       ON P.entity_id = PN.entity_id
           AND PN.attribute_id = 71 # 71 Product name
   LEFT OUTER JOIN eav_attribute_set C
       ON C.attribute_set_id = P.attribute_set_id

   INNER JOIN catalog_product_entity_decimal PRN
       ON PRN.entity_id = P.entity_id
       AND PRN.attribute_id = 75 # Price
   LEFT JOIN catalog_product_entity_decimal PRS
       ON PRS.entity_id = P.entity_id
       AND PRS.attribute_id = 76 # Special Price

   LEFT JOIN catalog_product_flat_1 as CP
        ON CP.entity_id = P.entity_id
          AND CURRENT_DATE() BETWEEN CP.special_from_date and CP.special_to_date

   LEFT OUTER JOIN catalog_product_entity_media_gallery as U
       ON P.entity_id = U.entity_id
       JOIN catalog_product_entity_media_gallery_value as V
           ON U.value_id = V.value_id
               AND V.position = 2
   LEFT OUTER JOIN catalog_product_entity_text as D
       ON P.entity_id = D.entity_id
           AND D.attribute_id = 72
   LEFT OUTER JOIN catalog_product_entity_varchar as PU
       ON P.entity_id = PU.entity_id
       AND PU.attribute_id = 98
       AND PU.store_id = 1

Another thread which helped me to fix it: https://stackoverflow.com/questions/31770234/how-the-write-the-query-to-get-the-special-price-if-available


texts: Magento call session object directly to get last added session messages

texts:
I am working on Magento 1.9.1.0 site which has been heavily customized for client's needs.

By "heavily customized" I mean not just templates override but also many modules added for "Model" and "controller" rewrites too.

Now I am having issue of displaying messages(from Magento core/session) when a product is added to wishlist. What I have done here is when a customer adds product(from list page) to wishlist, he is redirected back to product-list page redirectReferrer().

Now problem is the message <Product name> is added to your wishlist is not shown on product list page but it shows when customer manually goes to his wishlist page after adding product.

Even if I call message block by echo $this->getMessagesBlock()->getGroupedHtml(); or echo $this->getMessagesBlock()->getMessages(); messages doesn't show up in list page.


texts: Speed Optimization by disabling Mage_Reports module?

texts:
When thinking about optimizing the speed of Magento, there are several possibilities like caching (PHP, Database, even Full Page Caches) to speed up your site.

Another possibility is to reduce the amount of processing which is done, i.e. reduce the number of modules running in your shop.

Recently, I have wondered whether it is possible / safe to deactivate the Mage_Reports module.

This is in the file app/etc/modules/Mage_All.xml as

<Mage_Reports>
    <active>true</active>
    <codePool>core</codePool>
    <depends>
        <Mage_Customer/>
        <Mage_Catalog/>
        <Mage_Sales/>
        <Mage_Cms/>
    </depends>
</Mage_Reports>

So it comes bundled with the core and depends on several other modules.

However,I do not see other modules having Mage_Reports as a dependency.

I deactivated it in a test store and everything seems to run fine.

Question => Is it true, that besides losing the reports data, of course, the store can run well without this module?

Or are there any points at which my store will break when this module is not activated?


texts: Email Template Based on Payment Method Magento 2

texts:
I want to use separate email templates for orders depending on the payment method selected.
I have looked around but not found anything to achieve this so I started trying to build a module to handle this.
I have started with overwriting the function configureEmailTemplate() within Magento/Sales/Model/Order/Email/SenderBuilder
protected function configureEmailTemplate()
{
     /**
     * @var \Magento\Checkout\Model\Session $_checkoutSession
     */

    if ($this->_checkoutSession->getQuote()->getPayment()->getMethod() == "LEASING") {
        $this->transportBuilder->setTemplateIdentifier("leasingid");
    } else {
        $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
    }

    $this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
    $this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
    $this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
    $this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity());
}

This is an example of what I want to achieve. I am unsure how I can call this checkoutSession data so have added
     use Magento\Checkout\Model\Session;

and
    protected $_checkoutSession;

So I can determine my payment method. Then set the template based on that payment method using something like below.
if ($this->_checkoutSession->getQuote()->getPayment()->getMethod() == "LEASING") {
    $this->transportBuilder->setTemplateIdentifier("leasingid");
}

I have been trying to get a message to log, to begin with, but nothing is showing. I would like to know if this is the correct way to go about achieving this before i invest lots of time in figuring this out?


texts: How to add external js script in block via requireJs?

texts:
What is the simplest way to add external js script like:
https://sandbox-geowidget.easypack24.net/js/sdk-for-javascript.js
on my page? I've created block which i render on my product page. But i get an error.
Error: Script error for: and also mismatch error.
I've tried:
requirejs-config.js:

var config = {
    map: {
       '*': {
           'map' : 'https://sandbox-geowidget.easypack24.net/js/sdk-for-javascript.js'
       }
    }
};

also tried:

var config = {
     paths: {
        map: 'https://sandbox-geowidget.easypack24.net/js/sdk-for-javascript.js'
    }
};

then in my js file:

require(['map'], function () {
        window.easyPackAsyncInit = function () {
            easyPack.init({});
            var map = easyPack.mapWidget('map', function(point){
            });
        }
});

but i get above errors.


texts:
I have a client login popup on my page with the form

action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>"

How can I change this so the form will not redirect to the account dashboard?

I have set to redirect "no" in the backend. Does not help.

Thank you.

Edit after Prince answer:

My problem is that I do not know where to start. I have found something in

/home/admin/domains/qvicktime.eu/public_html/vendor/magento/module-customer/Controller/Ajax/Login.php

It might control the login?

And this code?

            if (!$this->getScopeConfig()->getValue('customer/startup/redirect_dashboard') && $redirectRoute) {
            $response['redirectUrl'] = $this->_redirect->success($redirectRoute);
            $this->getAccountRedirect()->clearRedirectCookie();
        }

But if I want to stay on the same page after login (the user should have logged in status after ajax/reload)

And there are many other files that might be the right one? How can I locate the right one? (same problem all the time :( )


texts: Magento 1.9.3.8 : how to remove download link in New purchase order mail?

texts:
I want to remove download link from purchase order mail.

Anyone know about that?


texts: Magento2 variable in transactional email

texts: I would like to add customer email to order confirmation email, but can't figure out how to do that. Is there any predefined variable that i can use in Transactional email templates or what does it take in order get customer email in each order confirmation email?


texts: Download LINK for product all images magento

texts:
I am new to Magento. I have a Magento 1.9 site where I am required to provide a Downloadable link for all images of a particular product that should automatically get downloaded on button click.

Is there any free extension for this purpose.  Please help me


texts:
I applied commands to my database in SSH (Putty) and my problem is solved.
But a number of commands are in error: ERROR 1701 (42000): Can not truncate a table referenced in a foreign key constraint (db_name.sales_payment_transaction, CONSTRAINT FK_DA51A10B240XXXXXXXXXXXX FOREIGN KEY (payment_id) REFERENCES db_name.sales_flat_order_payment (entity_id))

Problem with:

TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `downloadable_link_purchase

What could be the problem? Thanks for any advice!

Full solution is below:

SET FOREIGN_KEY_CHECKS=0;

##############################
# SALES RELATED TABLES
##############################
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `log_quote`;

ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;

#########################################
# DOWNLOADABLE PURCHASED
#########################################
TRUNCATE `downloadable_link_purchased`;
TRUNCATE `downloadable_link_purchased_item`;

ALTER TABLE `downloadable_link_purchased` AUTO_INCREMENT=1;
ALTER TABLE `downloadable_link_purchased_item` AUTO_INCREMENT=1;

#########################################
# RESET ID COUNTERS
#########################################
TRUNCATE `eav_entity_store`;
ALTER TABLE  `eav_entity_store` AUTO_INCREMENT=1;


texts:
On this page, the Smart Coffee Australia / APAC is pulled from a setting somewhere.

The rest is taken from Configuration > Store Information.

Do you know where I can change this?

Configuration > Store Information > Store Name is set to Smart Coffee APAC Pty Ltd


texts: Magento 2 Admin slow when changing into multistore

texts:
We have a site that is running Magento ver. 2.1.0. They have a number of mutli-sites set up, when you select one of the stores then select a product from one of the stores it takes a long time to load. Is there a way I can speed this up?

Thanks


texts: When trying to add Tab in sales I get this error

texts:
This is my Ui component code:

<?xml version="1.0" encoding="UTF-8"?>

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="custom_field" class="Sales\WalletDeatils\Ui\Component\Listing\Column\Status">
            <settings>
                <filter>text</filter>
                <label translate="true">Wallet Used</label>
                <visible>true</visible>
            </settings>
        </column>
    </columns>
</listing>

But I'm getting is below error.

The requested component ("filter") is not found. Before using, you must add the implementation.

I can't trigger what is the error.


texts: After upgrading Magento2.2.3 to Magento 2.2.5 getting Error

texts:
After upgrading Magento2.2.3 to Magento 2.2.5 below getting Error

  Fatal error: Cannot use Magento\Sales\Model\Order as Order because the name is already in use in D:\Projects\xampp\htdocs\project\vendor\temando\module-shipping-m2\Model\OrderInterfaceBuilder.php on line 12


texts: Cant Set default values For Form fields in magento admin grids

texts:
i cant set any default value for textfield or button in my custom admin grid form ,here is my code, iam following http://markshust.com/2012/07/05/creating-magento-adminhtml-grids-simplified tutorial
     protected function _prepareForm()
    {
        $model = Mage::registry('custom_backorder');

    $form = new Varien_Data_Form(array(
        'id'        => 'edit_form',
        'action'    => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
        'method'    => 'post'
    ));

    $fieldset = $form->addFieldset('base_fieldset', array(
        'legend'    => Mage::helper('checkout')->__('Backorder Information'),
        'class'     => 'fieldset-wide',
    ));

    if ($model->getId()) {
        $fieldset->addField('id', 'hidden', array(
            'name' => 'id',
        ));
    }

    $fieldset->addField('User_Id', 'text', array(
        'name'      => 'User_Id',
        'disabled'  => TRUE,

        'label'     => Mage::helper('checkout')->__('UserId'),
        'title'     => Mage::helper('checkout')->__('UserId'),
        'required'  => true,
    ));
    $fieldset->addField('User_Email', 'text', array(
        'name'      => 'User_Email',
        'disabled'  => TRUE,
        'label'     => Mage::helper('checkout')->__('UserEmail'),
        'title'     => Mage::helper('checkout')->__('UserEmail'),
        'required'  => true,
    ));
    $fieldset->addField('Product_Id', 'text', array(
        'name'      => 'Product_Id',
        'disabled'  => TRUE,
        'label'     => Mage::helper('checkout')->__('ProductId'),
        'title'     => Mage::helper('checkout')->__('ProductId'),
        'required'  => true,
    ));
    $fieldset->addField('Product_Name', 'text', array(
        'name'      => 'Product_Name',
        'disabled'  => TRUE,
        'label'     => Mage::helper('checkout')->__('ProductName'),
        'title'     => Mage::helper('checkout')->__('ProductName'),
        'required'  => true,
    ));
    $fieldset->addField('Qty', 'text', array(
        'name'      => 'Qty',
        'label'     => Mage::helper('checkout')->__('Quantity'),
        'title'     => Mage::helper('checkout')->__('Quantity'),
        'required'  => true,
    ));
    $fieldset->addField('Avail_Qty', 'text', array(
        'name'      => 'Avail_Qty',
        'disabled'  => TRUE,
        'label'     => Mage::helper('checkout')->__('AvailableQuantity'),
        'title'     => Mage::helper('checkout')->__('AvailableQuantity'),
        'required'  => true,
    ));

    $fieldset->addField('Flag', 'text', array(
            'name'      => 'Flag',

            'label'     => Mage::helper('checkout')->__('Status'),
            'title'     => Mage::helper('checkout')->__('Status'),
            'required'  => true,
    ));

    $fieldset->addField('submit', 'submit', array(

        'value'     => 'Submit',
        'label'     => Mage::helper('checkout')->__('Submit'),
        'required'  => true
        /*'tabindex'  => 15*/
    ));
    $fieldset->addField('title', 'text', array(
      'label'     => Mage::helper('checkout')->__('Title3'),
      'class'     => 'required-entry',
      'required'  => true,
      'name'      => 'title',
      'onclick' => "alert('on click');",
      'onchange' => "alert('on change');",
      'style'   => "border:10px",
      'value'  => 'hello !!',
      'disabled' => false,
      'readonly' => true,
      'after_element_html' => '<small>Comments</small>',
      'tabindex' => 1
    ));

    ?>

    <?php
        $form->setValues($model->getData());
        //$form->setUseContainer(true);
        $this->setForm($form);
        return parent::_prepareForm();
}


texts:
It seems for many people, the error message on checkout is out of their screen view and the message rapidly disappeas, so most of the time the error occurs the customer has no idea and just continues to hit the place order button over and over. This is for AVS errors and when cards are declined or any other error.

Is there a way to change the error to show in a modal pop-up that would show on the users screen and require the user to close the error message? Or make the error message more visible and persistent?


texts: Magento 2 - Adding template block to footer

texts:
I am creating a theme for a Magento 2 store which extends the Magento blank theme and I would like to add some inline javascript in the footer.

The way I would ideally like to do that would be to create some .phtml file in my new theme and use the layout or something to make it display in the footer.

I am not too sure how to do that.


texts: Magento Upgrade: Fatal error: Class 'Magento_Db_Adapter_Pdo_Mysql' not found in /home/xxxxx/public_html/includes/src/__default.php on line 29298

texts:
I just updated my magento installation from 1.7 to the latest version via FTP

and now when I try to access the website or the backend I get the error

    Fatal error: Class 'Magento_Db_Adapter_Pdo_Mysql' not found in

/home/xxxxx/public_html/includes/src/__default.php on line 29298

Any ideas what is wrong?


texts:
any solution for this error?

  createApplication(\Magento\Framework\App\Http::class); * $bootstrap->run($app); * -------------------------------------------- * * Copyright Â© Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ try { require DIR . '/app/bootstrap.php'; } catch (\Exception $e) { echo <<
  Autoload error
  {$e->getMessage()}
  HTML; exit(1); } $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class); $bootstrap->run($app);


texts:
I need a mysql query to change the postcode field on the billing address on customer accounts to blank for user only from one country (Ireland). Currently we have 5000+ user accounts with N/A or NA in the postcode for the billing address and we need this to be changed to blank.  I had a look at the database and i can't see where the postcode/zip field is stored.

Thanks


texts: Patch for php 7.2, many deprecated functions

texts:
I've just installed Magento 1.9.3.10, which contains the patch that supports PHP 7.2.
In Dev mode I get many errors of deprecated functions.
Such as:

Deprecated functionality: The each() function is deprecated. This message will be suppressed on further calls  in /var/www/html/lib/Zend/Cache/Backend.php on line 79

How is this possible? have not all the deprecated features of the core and the used Zend libraries been removed?

How do I use the Developer mode every page is blocked by deprecated functions.


texts: Adding custom code in head (header html tag)

texts:
we want to add the google+ links / code to our head (html) tag in our website. We have a multisite. We could edit phtml, create phtm etc ...

What is the best way to do this? via xml update?

Or is there another way?

Many thanks!


texts:
Magento 2.2.1 released today which fixes some critical vulnerabilities. https://magento.com/security/patches/magento-221-2110-and-2017-security-update

While upgrading the store from 2.2.0 to 2.2.1, I am facing below issue which I am sure many others are facing.

Signifyd

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
- magento/product-community-edition 2.2.1 requires magento/module-signifyd 100.2.1 -> no matching package found.
- magento/product-community-edition 2.2.1 requires magento/module-signifyd 100.2.1 -> no matching package found.
- Installation request for magento/product-community-edition 2.2.1 -> satisfiable by magento/product-community-edition[2.2.1].

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.

For additional assistance, see component dependency help .

Did anyone managed to get a workaround for this?

What other issues are you facing during this upgrade?


texts:
I've added one step in checkout after Review & payment step. Now i want to get last order id in this step. Can anyone help me?

Actually added the last step at the checkout page and that step I want to show just like checkout sucess page, but i dont know how to get the last order id at the my custom step in .html file


texts: Magento 1.9 : sales_flat_order and sales_flat_order_grid tables are not updating

texts:
I used many update methods for update values in sales_flat_order and sales_flat_order_grid tables, but no method didn't work.

I don't know why the update is not done.

Method 1:-

$coreResource = Mage::getSingleton('core/resource');
$write = $coreResource->getConnection('core_write');
        $_field_flat_order =array();
        $_field_flat_order['grand_total']          = $order_gt;
        $_field_flat_order['base_grand_total']     = $order_gt;
        $_field_flat_order['discount_amount']      = $order_discount;
        $_field_flat_order['base_discount_amount'] = $order_discount;
        $_field_flat_order['discount_description'] = "1%";
        $write->update($coreResource->getTableName('sales_flat_order'),$_field_flat_order,array('entity_id = ?' => $order_id,));

Method 2:-

$order_data=Mage::getModel('sales/order')->loadByIncrementId($increment_id);
        $order_data->setGrandTotal($order_gt);
        $order_data->setBaseGrandTotal($order_gt);
        $order_data->setBaseDiscountAmount($order_discount);
        $order_data->setDiscountAmount($order_discount);
        $order_data->setDiscountDescription("1%");
        $order_data->save();

Method 3 :-

$sql_order = "UPDATE sales_flat_order SET grand_total='".$order_gt."',base_grand_total='".$order_gt."',discount_amount='".$order_discount."',base_discount_amount='".$order_discount."',discount_description='1%' WHERE entity_id ='".$order_id."'";
$write->query($sql_order);

No method didn't work, but all other tables are updating perfectly.

Anyone know the reason.?


texts:
I have some products which they are out of stock in backend and also in catalog pages, but on the product page, they appear as in stock.

This behavior is the same whether the flat product enabled or disabled.

I have Manage Stock enabled and also the back orders


texts: ERP Purchase Order Entries and having incoming items 'visible' in Magento Products

texts:
Magento ERP Products section has 4 lines,, ,  and .
If a product is ordered and being expected, ERP Products section shows the qty and arrival date of this item under  column.
We added new items in the inventory recently. Each time I prepare PO and Container info for this new line group, Magento's Expected POs section does not show any qty-arrival date-etc info, yet initial inventory items entered 4 years ago are visible for all incoming orders.
How can I configure new inventory items, so they will be visible in ERP products' Expected POs column ?


texts: How to update or rename the attribute code of the attribute in magento 2

texts:
How to update the attribute code of the attribute in magento 2.

I have refered below link https://stackoverflow.com/questions/5198266/how-do-i-rename-an-attribute-code-in-magento


texts: Some products can't be added to cart from a particular store

texts:
I have an install where multiple stores are being used and some products are common across all stores.

The issue is with one of the store, the url http://domain.lo/store2/checkout/cart/add?product=327&qty=1 doesn't add the product to cart but session message does show up on cart page saying product was successfully added. I tried to use a debugger but didn't find anything wrong in the execution flow, it works correctly as far as I can tell.

The product is definitely in stock and works fine on main & other stores. Even its product page loads fine directly but that doesn't load on store2, one in which I have the problem. So, I reindexed everything but still no luck.

Out of ideas how to troubleshoot it further. Any pointers?


texts: Magento 1.9 new admin user current password

texts:
I've installed fresh 1.9 CE Magento providing an admin user and password. I can login to backend, but when I want to create new user for admin access, there is a 'current admin password' and I cannot create new user because the new user has not current password and this field is mandatory. How can I create a new admin user?
What I'm missing?


texts: How can I issue store credits in Magento CE?

texts:
I want to know, is there anyway that customers can have funds added to an account balance and then use their balance for shopping?

Don’t need buy coupon, gift or some things like these…

I want they add an amount, for example $50 in the field and then redirect to bank(for example paypal) , pay and after that their balance show :

Your Balance : $50

How can I go about this in Magento CE?


texts:
How a HTML view of Magento 2 composed ? I know this is a broad question.

Actually I am trying to remove Header and Footer from Print out of Sales Order. I can see a HTML view of Magento 2 when I am browsing this URL https://chaldal.com/sales/order/print/order_id/13/.I need to remove some portion of this HTML view. In this regard I turned on Enabled Template Path Hints for Storefront. I found that there is no main .phtml file which has to contain all the .phtml file.So that I can remove some of the .phtml files and keep some of them to have my desired HTML view.

I have to remove these .phtml files /home/theuaeex/public_html/app/design/frontend/Alothemes/default/Magento_Theme/templates/html/header.phtml

/home/theuaeex/public_html/app/design/frontend/Alothemes/default/Magiccart_Magicproduct/templates/productcustom.phtml and /home/theuaeex/public_html/app/design/frontend/Alothemes/default/Magento_Theme/templates/html/footer.phtml.

I tried through .xml files to remove those inclusion but failed.

Here is my print.xml file.

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <attribute name="class" value="page-print"/>
        <referenceContainer name="header.container" remove="true"/>
        <referenceBlock name="catalog.topnav" remove="true"/>
        <referenceContainer name="footer-container" remove="true"/>
        <move element="logo" destination="main.content" before="-" />
        <move element="copyright" destination="main.content" after="-" />
        <referenceContainer name="before.body.end">
            <block class="Magento\Framework\View\Element\Template" name="sales.order.print.js" template="Magento_Theme::html/print.phtml" />
        </referenceContainer>
    </body>
</page>


texts:
I am using magento 2.3.4, i am trying to set exiting coupon code programatically by event/observer.
$quotecoupon = $quote->setCouponCode($couponCode);

Coupon code set successfully but now not able to remove this coupon code even not able to add another coupon code. how to handle this?


texts: Magento 2 add div around compare in header

texts:
I want to add a div container with class around the compare ul in the header.

How can I achieve that inside my custom default.xml file?


texts:
I have an issue that seems to be related to the caching of CMS static blocks.

I have a cms page and within that page I am rendering a number of cms static blocks. A simplified version of the CMS page content looks like this:

{{block type="cms/block" block_id="banner_home"}}

{{block type="cms/block" block_id="promo_home_1_1"}}

{{block type="cms/block" block_id="promo_home_1_2"}}

{{block type="cms/block" block_id="promo_home_2_1"}}

{{block type="cms/block" block_id="promo_home_2_2"}}

{{block type="cms/block" block_id="promo_home_2_3"}}

{{block type="cms/block" block_id="promo_home_3_1"}}

{{block type="cms/block" block_id="promo_home_3_2"}}

The page loads as expected immediately after the block cache is cleared, that page looking something like this:

banner content

promo_home_1_1 content

promo_home_1_2 content

promo_home_2_1 content

promo_home_2_2 content

promo_home_2_3 content

promo_home_3_1 content

promo_home_3_1 content

However after the inital page load, every subsequent page load the content is incorrect. It looks like this:

banner content

promo_home_1_1 content

promo_home_1_2 content

promo_home_1_1 content

promo_home_1_2 content

promo_home_2_1 content

promo_home_2_2 content

promo_home_2_3 content

In the second example you can see the first two promos are correct, however everything after that is displaying the wrong content for the block_id. Also, block promo_home_1_1 and promo_home_1_2 are both rendered twice and promo_home_3_1 and promo_home_3_2 are never rendered. Its like the mapping between block_id and its associated static block content is being mixed up somehow. This is related to caching as if block cache isn't enabled then I no longer see the problem.

Also, it's probably worth noting that this page used to work on EE 1.13, however after upgrading to EE 1.14.2 this problem has started occurring.

I realise its pretty hard to say whats wrong without knowing what else is going on in the system but I am hoping someone might be able to give me at least some more direction here as I am running out of ideas.

Update:

I also tried this with widgets, e.g

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="63"}}

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="64"}}

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="65"}}

In this case all 3 blocks returned the same content even though the ids are pointing to different blocks in the database. When the cache is cleared the block returned will sometimes change, but all three widgets will still have the same content.


texts: Magento 2: Class Magento\Eav\Model\Attribute\Data\Checkbox does not exist

texts:
when an user try to register in frontend, magento gives me this error:

main.CRITICAL: Exception message: Class
Magento\Eav\Model\Attribute\Data\Checkbox does not exist

I can't debug this please help.

Magento 2.2.1


texts: How to update block in magento using ajax

texts:
i want to update sidebar block in magento 1.9 when add to cart action fire

my controller is

public function sidebarAction()
{
    $this->getLayout()->createBlock('checkout/cart_sidebar')->setTemplate('checkout/cart/sidebar.phtml')->toHtml();
}

But this code cant update block


texts: Show product attribute instead of prodict Name

texts:
Is there a way to show product attribute instead of the product name (title) globally on the frontend for Magento 2? Basically every product has a custom attribute 'frontend_name' which must appear everywhere on the frontend (breadcrumbs, product page, cart, and so on) instead of the product name.

Maybe somewhere in Magento 2 core exists a method to get product name/title so I can put I plugin to extend/rewrite it?

My Magento version 2.3.2

Thanks


texts: order_cancel_after event doesn't gives the total number of canceled orders in magento 2

texts:
I am trying to achieve total number of canceled order when any of the placed order has been canceled by admin area. The problem i am facing that i am getting wrong number of canceled order by difference of 1. It means the order which has been just canceled in this event (order_cancel_after) is not being calculated.

Here is the code below. Any help would be greatly appreciated.

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="order_cancel_after">
        <observer name="order_cancel_placed_after" instance="My\MyModule\Observer\SalesOrderCancelAfter"/>
    </event>
</config>

In Observer/SalesOrderCancelAfter.php

<?php

namespace My\MyModule\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;
use Magento\Sales\Model\Order;
use My\MyModule\Helper\Data;

class SalesOrderCancelAfter implements ObserverInterface
{

    protected $order;

    protected $helperData;

    public function __construct(
        Order $order,
        Data $helperData
    )
    {
        $this->order = $order;
        $this->helperData = $helperData;
    }

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

        /* To get the total number of canceled orders */
        $ordercollection  = $this->order->getCollection()
            ->addAttributeToFilter('customer_email', $customerEmail)
            ->addFieldToFilter('status', array('in' => array('canceled')));
        $totalcancelorder = $ordercollection->getSize();
    }
}


texts:
I used Magento 1.9 suddenly I faced a problem in it .When i create a product and upload images, it is shown in back end and not show in front end.But after this when I edit the same product and add one more image in it then in front end it shown second images.

What is the reason of this strange behavior.May be this is all because before a week I enabled cache and due to some issue in it I again disable it.

Till now it tried solution:- 1.Clear cache and index many times.(My cache is disabled).

2.Rename .htaccess of media folder.

3.Give 777 permission tomedia folder.

Please see the image attached.

/media/catalog/product/cache/1/thumbnail/80x80/117ec6be2be2581904bec9efa7f5ed31/images/catalog/product/placeholder/thumbnail.jpg (Placeholder shown)

/media/catalog/product/cache/1/image/580x580/0fb09527b0cea108ca47a7bcd7e27e43/6/_/6_1_2.jpg(Image shown which is uploaded second time)


texts:
In a multistore setup, I need to find products that are assigned to website A and website B.

The product collection has a addWebsiteFilter() method but unfortunately it doesn't serve this purpose, as can be seen in Mage_Catalog_Model_Resource_Product_Collection::_productLimitationJoinWebsite(), where the filter gets applied:

        $conditions[] = $this->getConnection()
            ->quoteInto('product_website.website_id IN(?)', $filters['website_ids']);

The query will match for all products that are assigned to any of the given websites. What is the best way to build a query for products that are present in multiple websites?


texts: Magento 2.3.5 main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [news_to_date.sort_news_to_date]

texts:
This error is causing a lot of problems on our site with our products disappearing. I think this error happens at times when certain products are edited from admin. Errors are below.
I think this has to do with Elastic Search and sorting attributes or something with Layered Navigation. I am not sure. I know in catalogue_eav_attribute table news_to_date is attribute Id 94 in database. But I am not sure how to fix.
Any help would be much appreciated.

main.CRITICAL:
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"No
mapping found for [news_to_date.sort_news_to_date] in order to sort
on","index_uuid":"UC9WC9aUSue1pmOFxrjZ3g","index":"magento2live_webpos_productsearch_fulltext_1_v7"}],"type":"search_phase_execution_exception","reason":"all
shards
failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2live_webpos_productsearch_fulltext_1_v7","node":"Ml8-bmNiSkqu5yLzk8on9g","reason":{"type":"query_shard_exception","reason":"No
mapping found for [news_to_date.sort_news_to_date] in order to sort
on","index_uuid":"UC9WC9aUSue1pmOFxrjZ3g","index":"magento2live_webpos_productsearch_fulltext_1_v7"}}]},"status":400}
{"exception":"[object]
(Elasticsearch\Common\Exceptions\BadRequest400Exception(code: 400):
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"No
mapping found for [news_to_date.sort_news_to_date] in order to sort
on","index_uuid":"UC9WC9aUSue1pmOFxrjZ3g","index":"magento2live_webpos_productsearch_fulltext_1_v7"}],"type":"search_phase_execution_exception","reason":"all shards
failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2live_webpos_productsearch_fulltext_1_v7","node":"Ml8-bmNiSkqu5yLzk8on9g","reason":{"type":"query_shard_exception","reason":"No
mapping found for [news_to_date.sort_news_to_date] in order to sort
on","index_uuid":"UC9WC9aUSue1pmOFxrjZ3g","index":"magento2live_webpos_productsearch_fulltext_1_v7"}}]},"status":400}
at
/var/www/vhosts/upperlimitsinc.com/httpdocs/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:641)"}
[]

UPDATE:
We have discovered something else with this error. It seems to trigger and only happen when we change certain products to different categories. I have not been able to recreate this error on localhost only happens on Production. So it seems to only happen on Category Change of Products.


texts: Element 'css': This element is not expected in magento2.2.5

texts:
1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'css': This element is not expected. Line: 542 facing this issue in 2.2.5.

My store is working fine but suddenly it's throw error like Element 'css': This element is not expected

Does anyone have an idea?

I search this issue and found below link but not give solutions.
Magento 2 Element 'file': This element is not expected
Element 'css': This element is not expected. in Magento 2.2.5 (upgraded from Magento 2.1.9)


texts: Magento 2 Order Confirmation Email Send Programatically from Success.php

texts:
I have disabled Order Confirmation Email from backend because I want to send Order Email when User redirect to Success.phtml after order successfully placed.

I have created Plugins for it
di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\Checkout\Block\Onepage\Success" type="<vendor_name>\Checkout\Block\Onepage\Success"/>
    <type name="Magento\Sales\Model\Order\Email\Sender">
        <plugin name="sale_order_custom_email_send" type="<vendor_name>\Checkout\Model\Plugin\Sender" sortOrder="1" />
    </type>
    <type name="Magento\Sales\Model\Order\Email\Sender\OrderSender">
        <plugin name="sale_order_sender_custom_email" type="<vendor_name>\Checkout\Model\Plugin\OrderSender" sortOrder="1" />
    </type>
</config>

Created Around Plugin: OrderSender.php

<?php

namespace <vendor_name>\Checkout\Model\Plugin;

use Magento\Sales\Model\Order;

class OrderSender
{
    /**
     * Order success action.
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function aroundSend(\Magento\Sales\Model\Order\Email\Sender\OrderSender $subject, \Closure $proceed, Order $order, $forceSyncMode = false, $isCustom = false)
    {
       $order->setSendEmail(true);
        if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
            if ($this->checkAndSend($order, $isCustom)) {
                $order->setEmailSent(true);
                $this->orderResource->saveAttribute($order, ['send_email', 'email_sent']);
                return true;
            }
        }

        $this->orderResource->saveAttribute($order, 'send_email');

        return false;
   }
}

I have passed $isCustom parameter in checkAndSend() method so It can check my custom condition.

Second Plugin : Sender.php

<?php

namespace <vendor_name>\Checkout\Model\Plugin;

class Sender
{
    /**
     * Order success action.
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    protected function aroundCheckAndSend(\Magento\Sales\Model\Order\Email\Sender $subject, \Closure $proceed, Order $order, $isCustom = false)
    {
       $this->identityContainer->setStore($order->getStore());
        if (!$this->identityContainer->isEnabled() && $isCustom = false) {
            return false;
        }
        $this->prepareTemplate($order);

        /** @var SenderBuilder $sender */
        $sender = $this->getSender();

        try {
            $sender->send();
            $sender->sendCopyTo();
        } catch (\Exception $e) {
            $this->logger->error($e->getMessage());
        }

        return true;
   }
}

If $isCustom is true then even if Order Confirmation is Disabled from backend It should send Order Confirmation Email to customer.

Don't Know where am I wrong but not getting any email. May be We can not create a plugin for Absract class's Protected method but any other solution to change condition in checkAndSend().

Any help would be appreciated.


texts: Customer can open success page with parameters in URL, causing duplicate transactions in analytics

texts:
On one of our Magento websites we found that anyone is able to view the success page of a specific order if they provide parameters in the URL. Customers can reopen, reload or bookmark URLs like this and end up making our Google Analytics code record multiple transactions when they actually happened only once.

The URL looks like this:
https://www.magentostore.com/checkout/onepage/success/oide/102573/qide/88498/incide/233916/inv/1/

Anyone can go to this URL and see the success page with the respective order number on it.

Normally, when a customer tries to refresh the success page or browse to it with no parameters with the url https://www.magentostore.com/checkout/onepage/success they are brought to checkout/cart and told their shopping basket is empty.

Another one of our Magento stores always shows a plain checkout/onepage/sucess URL when an order is placed, while still showing the order number on the page and the customer can't revisit this page later.

I have found no redirects related to checkout, onepage, success or those parameters that would trim the URL and both Magento websites (both installed separately, single store) use the same core code of Magento CE 1.9.2.3


texts: How to skip any particular indexer from indexing when cron runs?

texts:
I have configured cron (php bin/magento cron:run) which runs every minute. One of the tasks this cron job does is to update all indexers in Magento.

When the indexing is run via this cron job, I want to skip/exclude indexing for a particular indexer, let's say catalog_category_product from indexing and allow indexing for other indexers.

For this particular indexer, I will configure another cron (php bin/magento indexer:reindex catalog_category_product) which will run less frequent (not every minute).

So, how to exclude catalog_category_product from indexing when cron runs?


texts: Magento 2 Captcha Images Not Deleting (thousands of files using space)

texts:
We've got a Magento store running on version 2.2.5.

The captcha images that are generated in /pub/media/captcha do not seem to be automatically deleting once expired. I know that the DeleteExpiredImages cron job should be doing this, and it looks like it should be working, but it just isn't. The result of this is that there are hundreds of thousands of captcha images in the folders in this directory.

There are different directories in the captcha folder for our different stores, but the admin directory is by far the one with the most captcha images in it. I can't seem to figure out why these aren't clearing.

Does anyone have any ideas?


texts: Extension recommendation for "Zalando"-like filter functionality in layered navigation

texts:
I'm looking for an extension that implements the filter in the layered navigation much like popular german retailer Zalando:

https://www.zalando.de/damenbekleidung-shirts/ (You can see the filter right below the "Shirts & Tops" title)

The main requirements are:

Toggle-able filter display
Multi-value selection using checkboxes, without refreshing the page after each selection

Does anybody have any recommendations?


texts: Product description is used as meta description

texts:
I tried to update the meta descriptions for my products so that they are different to the normal description. My main problem is, that in the source code the normal description of the products is shown as the meta description and the text entered in the meta description is ignored.

Any tips how to solve this? (this isn't my website, I try to polish it up a bit, which all works fine except this problem)


texts: How I can stop disposable email address registration on the Magento 1.9

texts: We are getting so many disposable email address registered on our e-commerce store. We did everything. but still, some users are coming. I limit the characters for usernames as well. but still, they are registering I do not know how?


texts: Event to use to fetch Order Id and not Increment Id

texts:
I am using the event <sales_order_place_after> in my observer to perform some action. I am inserting the Order ID in my custom table. But what I observe is that it does not give me Order ID but instead Increment ID, which I am fetching using getReservedOrderId().

Now to fetch Order ID from Increment ID I can use,

$order = Mage::getModel('sales/order')->load($incrementId, 'increment_id');

but I need to insert the data at the time of order placed, instead of fetching it again.

Observer Code;

$order = $observer->getEvent()->getOrder(); //returns null

So I am using

$order = $observer->getEvent()->getOrder()->getQuote();

Which event should be used in order to get all order details after an order is placed or on order success ?


texts: Can not export database by command line window

texts:
I exported database by command line.

I got this error:

  gzip is not recognized as an internal or external command, operable
  program or batch file.

How to fix it ?


texts: Tracing missing order numbers in the database, possibly even before they are "reserved"

texts:
Hoping for someone to chime in who extensively knows the Magento database architecture inside out.

Missing order numbers. Example, in Magento, order number increments like:

100002410
100002411
100002412
100002414
100002415

I get that depending on the stage a customer is at on the website, an order number may get reserved for that transaction should they complete or return at a later time and complete.

I know that the reserved order numbers are stored in the sales_flat_quote table under reserved_order_id and those that complete are stored in the sales_flat_order table which should look pretty identical the Magento sales order grid in the backend.

I'm trying to locate any kind of information on what happened to missing order 100002413 in the above sequence.

It doesn't show up as an order in the backend (and subsequently is not within the sales_flat_order table) yet it was never reserved in the sales_flat_quote table neither (and many other order ids don't appear to be either).

What exactly is happening with these missing order numbers? Just what information can we trace against them in the database directly?

If you are wondering why I am searching for this, it is because we are trying to debug why we had a conversion via Google Shopping Adwords that never actually happened in Magento. No order at all for the conversion value logged (and is definitely not any of the sales that did occur on the same day) so I am wondering if the conversion value matches any cart total that perhaps is connected to this missing order number.


texts:
I am Getting following error, when trying to create/edit user role.

Wrong tab configuration.

app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php(42): Mage_Adminhtml_Block_Widget_Tabs->addTab('account', false)

I am unable to figure out problem.


texts: Why did the Payment section stopped working after switching primary domain? And - does Form Key Validation On Checkout need to be enabled?

texts:
Porto theme

I switched the primary domain in our Magento 1.9.4 store and then the Payment section of the checkout stopped working altogether - you could select a Payment method by placing a tick in the radio button but it would NOT proceed to the next step.

I found other posts dealing with problems regarding the payment section and they suggested to Disable the Form Key Validation. I did that and it made the Payment section work.

Why is this and do we need to have it enabled or are we going to get by with it disabled?


texts: Magento Error report message show in alert box in ajax response

texts:
I am adding virtual products to cart by my custom ajax function and now virtual products can only be added one in the cart.if i had second one in the cart it is generating error report as Nominal items can only be purchased as standlone.

I want to show this message on the alert box on the add to cart button page which should i get in the ajax response data.

MY code

$j.ajax({
                url: "<?php echo Mage::getUrl('customblocks/ajax/virtualpick2addtocart'); ?>",
                type: "POST",
                data: {pro_id:sel_pro_id,sel_pro_price:sel_pro_price},
                success: function(data){
                    //$j("#spinner1").hide();
                    location.href = checkout_url;
                },
                error: function(){
                }
            });

and my ajax add to cart code

$cart = Mage::getModel('checkout/cart');
    $cart->init();
    $cart->addProduct($_product,$params);
    $cart->save();

Thanks In Advance


texts: I want to add cron in magento 1.9 . using config.xml & observer run cron every 30 minute


texts: How to disable front end price caching, Magento 2.3

texts:
We have a need to display customer specific prices on the front end. Our current implementation would work if it were not for caching (Full-Page Caching if I've understood correctly).

Is there a way modify the caching process so that the end users would see the correct prices? (assuming that is what we should do)

I read on a post that it should be possible to create a PageCache Identifier, but it threw an exception:

Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Framework\App\PageCache\Kernel

Here's the code:

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Framework\App\PageCache\Identifier" type="Vendor\Module\PageCache\Identifier" />
</config>

Identifier.php

namespace Vendor\Module\PageCache;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Serialize\Serializer\Json;

class Identifier
{
    protected $request;
    protected $context;
    private $serializer;
    private $session;

    public function __construct(
        \Magento\Framework\App\Request\Http $request,
        \Magento\Framework\App\Http\Context $context,
        Json $serializer = null
    ) {
        $this->request = $request;
        $this->context = $context;
        $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
    }

    public function getValue()
    {
        $data = [
            $this->request->isSecure(),
            $this->request->getUriString(),
            $this->request->get(\Magento\Framework\App\Response\Http::COOKIE_VARY_STRING)
                ?: $this->context->getVaryString()
        ];
        return sha1($this->serializer->serialize($data));
    }
}


texts: How to get cart grand total(Summary) without shipping cost in checkout/cart page in Magento2.1.7?

texts: I want to get cart grand total(Summary) without shipping cost in checkout/cart page in Magento2.1.7?


texts: Redirecting a product from category page to a landing page without redirecting the product page

texts:
Instead to the product page, I would like to direct our customers to a custom URL that holds our landing page from the category product... without affecting the product url.

Recommendation of an extension can also be an option.


texts: Cash on delivery payment method should visible only for some zip codes/pin codes

texts:
we are using "Cash On Delivery" Payment method in magento 1.9.0

we support cash on delivery to only some zip/pin codes locations.

means we will accept cash only from some zip codes [means locations].

under "checkout" in "shipping address", customer will type his/her "zip code" .

using that zip code we have to validation.

means if we deliver the product to that zip code, than "COD" payment method should visible under "payment method"

otherwise "COD" should not visible.

if someone is unclear with above question , please refer following link :

https://stackoverflow.com/questions/16439761/how-to-restrict-default-cod-in-magento-to-certain-zip-codes-only

this is the question.

can anyone explain in detail about above solution....

or

also here in following link :

https://stackoverflow.com/questions/29248124/restrict-default-cash-on-delivery-for-some-zip-pin-codes-in-magento-1-9-0/29259050#29259050

there is an option to enter list of zip codes that are restricted. but we need a solution for list of zip codes that allowed.


texts: Magento Products are not listed on fronend

texts:
I downloaded a old magento site and installed it on my local server. My admin panel is working perfect but products are not listed in frontend. Links on the front end page are also not working.
I have reindexed data, cleared cache, my urls also updated in database, increased memory_limits but nothing is working.....


texts: what is best way to modify add to cart in magento 2.2.x

texts:
I want to modify add to cart with product options price

If option 1: then price 1
If option 2: then price 2


texts: Multiple cookies for CUSTOMER_SEGMENT_IDS when placing order

texts:
During the Ajax call to submit order in one-page checkout process, I'm getting cookie "CUSTOMER_SEGMENT_IDS" multiple times, with "Deleted" as value. This is causing header size to go much beyond the allowed limit (more than 8k in some scenarios), and thus causing error in placing the order. It is only happening for customers having more than 4 addresses in their address book.

I have located it to the Enterprise_PageCache_Model_Observer where this cookie is getting set by core Magento code. There is no customization present in store for dealing with cookies or customer segments.

I'm planning to re-write this class to remove all "Deleted" cookies from response altogether. Is there any drawback of this approach that I should be aware of ? All I could find similar to this is this question : Multiple Cookies in Ajax call but, there is no activity in that question.

Anyone else experienced this problem earlier ? Is there any particular reason for this behavior in Magento code-base ?


texts: Changing the Title of a product tab depending on the category

texts:
I have added a new tab to my product page next to my description for PDF documents. I implemented this in the local.xml using

 <action method="addTab" translate="title" module="catalog">
      <alias>pdf_tabbed</alias>
      <title>Data Sheets</title>
      <block>catalog/product_view_attributes</block>
      <template>catalog/product/view/pdf.phtml</template>
 </action>

however i want to change the title depending on what category the product is in for example if you are in the clothing category (id:145) i want the Title to be "Sizing Guide" instead of "Data Sheets".

I have put an if statement in my pdf.phtml to display the sizing guide instead of the PDFs however i do not know how to change the Title. Is there any way to do this in either local.xml or to get it to get the title from pdf.phtml?

This is the code in my pdf.phtml

<?php $layer = Mage::getSingleton('catalog/layer');
$_category = $layer->getCurrentCategory();
$currentCategoryId= $_category->getId();?>
<?php $_pdf = $this->getProduct()->getPdf(); ?>

<?php if ($currentCategoryId = '145')
{?> Size table code goes here }

else{

<?php if ($_pdf): ?>

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

        <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_pdf, 'pdf') ?>
        <?php var_dump ($currentCategoryId);?>

<?php else: ?>
    Sorry but there are no data sheets associated with this product!
    <?php var_dump ($currentCategoryId);?>
<?php endif;
};?>

summary: Is it possible to change the title of my tab depending on the category ID, either in the local.xml or the .phtml file it displays?


texts: Pdf does not showing product image? Magento 2

texts:
When printing the order pdf, product image is not showing. When I var dump the imagePath I get result:

string(150) "http://mysite/media/catalog/product/cache/15/thumbnail/75x75/beff4985b56e3afdbeabfc89641a4582/b/j/bj9660_02_reebok_les_mills_zenski_sorc.jpg"

This is the code that returns an image:

$image = [
      'items_small_image' => [
      'value' => '',
      'label' => __('Product image'),
   ],
];

But, when I hard code the image path the the image is showing:

$image = [
      'items_small_image' => [
      'value' => '',
      'label' => __('Product image'),
   ],
];

What is the problem with variable? Did anybody had the same issue?


texts: Magento 2.3.4 - Reindex Catalog Search MySql Error

texts:
I am trying to reindex the Search however, I keep getting this error; any hint?
bash-4.2$ php bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search indexer process unknown error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) GROUP BY `product_id`' at line 1, query was: SELECT `catalog_category_product`.`product_id` FROM `catalog_category_product` WHERE (product_id IN (396)) AND (category_id != ('2')) AND (category_id IN ()) GROUP BY `product_id`


texts: Magento 2 CE upgrade hangs while update application is running

texts:
I have a clean M2 CE install.
When trying to upgrade from 2.02 to 2.04, the update takes forever and seems to hang.

The System Upgrade Status is "Update application is running".

In the Console Log, the last two lines of code are:

[2016-04-18 15:08:06 UTC] Starting composer update...
[2016-04-18 15:08:06 UTC] ./composer.json has been updated

I don't see a progression bar or anything else that indicates that the update is still being carried out.

Should I just wait longer or should I upgrade in a different way? Or do I need to change settings, e.g. on the server?


texts:
I want to run my magento in my local system like localhost:8080 instead of localhost/magento.

How to access magento using localhost:portnumber ?


texts:
I have added configurable products with size and then added the simple products for each size.

When an item is added to shopping cart the price is doubled. If I remove the price from the configurable item i.e. set it to 0 then the price does not double.

Any idea how to fix this?

Thank You!


texts: Show a product attribute under price - Magento 2

texts:
I'm trying to show a product attribute underneath the price in Magento 2. I have overridden the template by adding it to my theme:

Magento_Catalog/templates/product/price/amount/default.phtml

This is the contents of this file:

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

// @codingStandardsIgnoreFile

?>

<?php /** @var \Magento\Framework\Pricing\Render\Amount $block */ ?>

<span class="price-container <?= /* @escapeNotVerified */ $block->getAdjustmentCssClasses() ?>"
    <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
<?php if ($block->getDisplayLabel()): ?>
    <?= /* @escapeNotVerified */ $block->getDisplayLabel() ?>
<?php endif; ?>
<span <?php if ($block->getPriceId()): ?> id="<?= /* @escapeNotVerified */ $block->getPriceId() ?>"<?php endif;?>
    <?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
    data-price-amount="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>"
    data-price-type="<?= /* @escapeNotVerified */ $block->getPriceType() ?>"
    class="price-wrapper <?= /* @escapeNotVerified */ $block->getPriceWrapperCss() ?>"
><?= /* @escapeNotVerified */ $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?>
<?php if ($block->hasAdjustmentsHtml()): ?>
    <?= $block->getAdjustmentsHtml() ?>
<?php endif; ?>
<?php if ($block->getSchema()): ?>
    <meta itemprop="price" content="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>" />
    <meta itemprop="priceCurrency" content="<?= /* @escapeNotVerified */ $block->getDisplayCurrencyCode() ?>" />
<?php endif; ?>

So I would assume that I need to add this at the top of the file:

<?php
  $_product = $block->getProduct();
  $myattr = $_product->getResource()->getAttribute('attribute_name')->getFrontend()->getValue($_product);
?>

Then use the following to include it where I need it

<?php if($myattr != "") { echo $myattr } ?>

But I just get a blank page when I view it on the front end. Can anyone help please?


texts: Magento 2 - Why is it showing "Please specify at least one search term"?

texts:
I'm doing many advanced searches on my Magento 2.1.5 and each consult is showing this message below:

My URLs are like:

mystore.com/catalogsearch/advanced/result/?brand=859

mystore.com/catalogsearch/advanced/result/?name=Test&sku=&description=&short_description=&price%5Bfrom%5D=&price%5Bto%5D=&manufacturer%5B%5D=263&credit_rate%5Bfrom%5D=&credit_rate%5Bto%5D=


texts: How to modify a Magento left side navigation

texts:
My magento site using an extension called "codnitive" for left column side navigation. It is coming as a list of links with active and inactive headings.
But I want a check box should appear before each of links.So should I modified the code of the extension ? Or will it create any problem ? Kindly suggest..Thanks.
The module present in : app/code/community/Codnitive/Sidenav/Block/navigation.php
The template present in : app/design/frontend/mypackage/default/codnitive/sidenav/navigation.phtml
current image is the top one and required in the bottom


texts: import product images via csv in magento 1

texts: I have already imported simple and configurable products. Now I need to import multiple images for a product. I need csv format and process to upload images.


texts: How Add customer credit points in magento 2?

texts: I created new payment method using http://mage2gen.com/ using this website. It is working fine. But I need user to buy products when product price is equal to credit points. I'm beginner I hope will get help. Thanks in advance.