texts: debugging magento code on xampp using netbeans and xdebug

texts:
I want to debug Magento code for learning Magento. I have Magento installed on XAMPP (windows XP sp2).I have installed Netbeans(php version) and configured xdebug.

In netbeans I selected "php application with existing sources".Then I created a folder "myFolder" in C:\xampp\htdocs for the purpose of exporting the Magento code .

Now I want to know that In the 'name and location panel'(in Netbeans) would setting the "source folder" field to "C:\xampp\htdocs\magento" be right('Magento' is the directory under which Magento is installed)?

Also what should I enter in the "copy to folder" field under the "run configuration" panel, should I enter "C:\xampp\htdocs\myFolder" and if I do this then would the entire Magento code would be exported to "myFolder".

Please help I would be very thankful.


texts:
Tring to create Plugin for elasticSearch resolve function

<?php

namespace Devall\ElasticsearchPlugin\Plugin\Checkout\Controller;

use Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\SearchCriteriaResolver;
use Magento\Framework\Api\Search\SearchCriteriaBuilder;
use Magento\Framework\Data\Collection;
use Magento\Framework\Api\Search\SearchCriteria;

class EmptyProducts
{

    /**
     * @var SearchCriteriaBuilder
     */
    private $builder;

    /**
     * @var Collection
     */
    private $collection;

    /**
     * @var string
     */
    private $searchRequestName;

    /**
     * @var int
     */
    private $size;

    /**
     * @var array
     */
    private $orders;

    /**
     * @var int
     */
    private $currentPage;

    /**
     * SearchCriteriaResolver constructor.
     * @param SearchCriteriaBuilder $builder
     * @param Collection $collection
     * @param string $searchRequestName
     * @param int $currentPage
     * @param int $size
     * @param array $orders
     */

    public function __construct(
        SearchCriteriaBuilder $builder,
        Collection $collection,
        string $searchRequestName,
        int $currentPage,
        int $size,
        ?array $orders
    ) {
        $this->builder = $builder;
        $this->collection = $collection;
        $this->searchRequestName = $searchRequestName;
        $this->currentPage = $currentPage;
        $this->size = $size;
        $this->orders = $orders;
    }

    public function afterResolve(SearchCriteriaResolver $searchCriteriaResolver){
        if ($this->size !== 0) {
            $this->builder->setPageSize($this->size);
        }
        $searchCriteria = $this->builder->create();
        $searchCriteria->setRequestName($this->searchRequestName);
        $searchCriteria->setSortOrders($this->orders);
        $searchCriteria->setCurrentPage($this->currentPage - 1);

    return $searchCriteriaResolver;
    }
}

It shows an error like

Exception #0 (BadMethodCallException): Missing required argument $searchRequestName of Devall\ElasticsearchPlugin\Plugin\Checkout\Controller\EmptyProducts.

But why I have no idea.
Help.


texts: when add to cart then page is very slow after cache is page speed up in magento 1.9

texts: I have recently upgraded the Magento from 1.6.2 to 1.9.2 and I found the cart page is too slow. Not only when I add the product to cart, but also when I just load the cart page. I did confirm that the site is using the default cart controller. Here is the profiler report


texts:
I uploaded a translation package from Magaplaze.
but alert messages as text in red color in an image below not translated. how to do it?

Magento CE 2.1.9


texts: Selecting Default option for configurable product

texts:
I have a website selling handsets. The flow of website is. There are two categories
1) Phone on plans
2) prepaid phones

Now what we have set is a configurable product having two drop down
1) Phone option: phone on plans and prepaid phones
2) Plans : It contains plans and recharge which are configured depending on option selected.

I used a javascript code as below to select default option ie "Phone on plan" when user browse from phone on plan category.  The code is used is as below

 jQuery(document).ready(function () {
    //var phonedropdown = document.getElementById('attribute156');
    //var plandropdown = document.getElementById('attribute157');
    <?php if($category_name == "Prepaid Phones") :?>
        Event.observe(window, 'load', function() {
            setDefaultConfigOptions(2);
        });
        //plandropdown.disabled = false;
    <?php endif; ?>
    <?php if($category_name == "Phones On Plan"):?>
        Event.observe(window, 'load', function() {
            setDefaultConfigOptions(1);
        });
        //phonedropdown.value = "44";
        //plandropdown.disabled = false;
    <?php endif; ?>
});
var spConfigIndex = 0;
function fireEvent(element,event)
{
    if (document.createEventObject)
    {
        // dispatch for IE
        var evt = document.createEventObject();
        return element.fireEvent('on'+event,evt);
    }
    else
    {
        // dispatch for firefox + others
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent(event, true, true );
        return !element.dispatchEvent(evt);
    }
}

function setDefaultConfigOptions(index)
{
    if (spConfigIndex >= spConfig.settings.length)
    {
        return; // stop
    }
    spConfig.settings[spConfigIndex].selectedIndex = index;
    var obj = spConfig.settings[spConfigIndex];

    ++spConfigIndex;

    Event.observe(obj,'change',function(){});

    window.setTimeout("setDefaultConfigOptions()", 1); // Add a small delay before moving onto the next option
}
// THE CODE ENDS HERE

</script>

The problem is it works fine in mozilla and firefox but its not working in IE browsers. I think the issue is of Event.observer() but i am not sure what's going wrong.

Can anyone please help me in this

Thanks


texts: Magento 2 in admin panel side attributes drop down values not be save and delete?

texts:
Attributes dropdown values not be save and delete in admin panel side

I have change the php.ini files max_input_vars=100000 but its not working?

Please give me any solutions..?


texts: How to change price range filter Magento 2

texts:
I'm aiming to change how the price range filter is displayed and works. I would like it to be like this:

Any ideas about how I would go about doing this?


texts: DHL - how to integrate the DHL plugin and hide the rate

texts:
i’m currently struggling to get the DHL not to pull the quote and show on the checkout as these quotes get added to the Subtotal of the order and since the store offers International free shipping .
So the store is sending the order request to DHL and the response comes with a quote/rates, is there a way to not get the rates from DHL, please see screenshot below from the checkout which shows the DHL rate and would like to be free of charge

Please advise.


texts: How to left product "in_stock "quantity as is after order placed?

texts:
Product's in stock quantity should be decrease with logistics company via API.
So I need to stop decreasing "in_stock" quantity by default after order placed.

Please, any advice how to stop decreasing by default?


texts:
I have added slick.min.js in my custom module in the path below

  app/code/company_name/vendor_name/mymodule/view/frontend/web/js/slick.min/js

and my slick initialization js for my template is

require([
    'jquery',
    'slick'
], function ($) {
$(document).ready(function () {
    $(".slider").slick({
        autoplay: true,
        slidesToShow: 1,
        slidesToScroll: 1,
        autoplay: true,
        autoplaySpeed: 2000,

    });
});
});

and added in requirejs-config.js as

var config = {
    paths: {
        'slick': "xxx_yyy/js/slick.min"
    },
    map: {
       '*': {
           slickSlider: 'xxx_yyy/js/slick-slider'
       }
   },
   shim: {
        slick: {
            deps: ['jquery']
        }
   },
};

Now it is working except the design. How to add slick.less and slick-theme.less files in custom module?


texts:
I found this bug on both Website Payments Standard and Express Checkout methods.

If a customer chooses to pay via Paypal, he enters in PayPal's pages. If he changes his mind he can press "cancel and return to website" link to return back.

What if then he uses the "previous arrow" of his browser to return to PayPal? He can still pay for the previous order, even if he has modified his cart in the meanwhile.

This is a video explaining the bug (customer discomfort):
https://drive.google.com/file/d/0B7GTXoOzbPUXOEYyZlAwdm5od3M/view?usp=sharing

Also, Magento's previous order was put in "canceled" status, all items have been void and returned to stock. The automatically generated invoice (if the customer at last pays) has no reference to the items and they cannot be shipped. The order, after "canceled" status, returns to "processing" but nothing can be done.

I read PayPal's API documentation and it is stated that "cancel_return" url cancels the payment.
I had a long conversation with PayPal developer's support. This is their last answer:

  As per understanding that we've got from the video, most probably the
  bug is from the shopping cart that you are currently using which is
  Magento. We understand that this might cause a hassle to the
  customer and as the standard logic in PayPal, PayPal is considered
  everything sent over to the server will be processed if and only if
  the order or the request did not have any problem such without any
  price or valid email of the merchant.

Is this a known bug? I could reproduce this behavior from Magento version 1.4.0.1 to 1.9.0.1, with both PayPal Standard and PayPal Pro, except direct card payment.
How can this be solved, except by changing the payment method?


texts: How can I add any CMS page to the main navigation in Magento RWD theme? I am aware of the URL rewrites that can be done through catalogue but there must be an easier way?


texts: Magento language/ store switcher not working correctly

texts:
I have installed a "fresh old" Magento (v1.7.2) for testing purposes and I have created two different stores with different store views:

If I take a look at the frontend of my shop I can see that the store switcher is enabled:

Furthermore I have created a global category "electronics" and I have configured the name and url key for the german store view. So this category is enabled for both stores. In addition I have created the sub directory "gb" in my Magento root directory. This directory represents the english store, so I have created some symlinks and a htaccess file which sets the store code:

SetEnv MAGE_RUN_CODE gb

So far all is working fine and I got two different stores with the following urls:

German store: http://localhost/magento-1.7.2/
English store: http://localhost/magento-1.7.2/gb/

So the category urls for my global category electronics looks as follows:

German store: http://localhost/magento-1.7.2/elektronik.html
English store: http://localhost/magento-1.7.2/gb/electronics.html

But If I change the store on the german electronics category page to the english store I get redirected to home page of the english store and not to the english category page of electronics. So I have inspected the store switcher on the german electronics category page:

    Select Store:
    <select id="select-store" title="Select Store" onchange="location.href=this.value">
          <option value="http://localhost/magento-1.7.2/gb/?___store=gb">English Store</option>
          <option value="" selected="selected">German Store</option>
    </select>

As you can see the values of the store switcher seems to be wrong because I have expected something like the following:

    Select Store:
    <select id="select-store" title="Select Store" onchange="location.href=this.value">
        <option value="http://localhost/magento-1.7.2/gb/electronics.html">English Store</option>
        <option value="http://localhost/magento-1.7.2/elektronik.html" selected="selected">German Store</option>
    </select>

But I don't know why the store switcher is not working as expected. Did I forget a specific setting?

UPDATE

Or is this just a configuration mistake because this is not a multistore case and I have to use store views instead of multistores, because multistores are independent of each other?


texts: Staging environment to manage the catalog

texts: I would like to be able to manage the catalog in a staging environment and make sure that in cron (or other way) the catalog (categories and products) synchronize from Staging to Production.


texts: Magento 2: How to add custom field in contact page

texts:
I have added in Magento_Contact module custom field with order number:

                        <input placeholder="<?php echo __('Your Phone') ?>" name="telephone" id="telephone"
                               title="<?php /* @escapeNotVerified */
                               echo __('Phone Number') ?>" value="" class="input-text" type="text"/>

                        <input placeholder="<?php echo __('Order Number') ?>" name="ordernumber" id="ordernumber"
                               title="<?php /* @escapeNotVerified */
                               echo __('Order Number') ?>" value="" class="input-text" type="text"/>

screen:
https://prnt.sc/s5fgtu

But when I sent a message via this form after filling this custom field (order number), when I receive a message from this contact module then this field is not displayed.

screen: https://prnt.sc/s5fh54

Any solution how to do?


texts: Would it be possible to make different frontName in one module?

texts:
I would like to call three urls that show me three views from one module with three methods and three templates.
Exemple
Saying that I have a module called promo and controller is IndexController.php and in the controller three methods: method1, method2, method3.

Url 1 : www.exemple.com/promo/index/method1

Url 2 : www.exemple.com/promo/index/method2

Url 3 : www.exemple.com/promo/index/method3

It is possible to replace the urls to :

Url 1 : www.exemple.com/promo

Url 2 : www.exemple.com/promo2

Url 3 : www.exemple.com/promo3

Which my question and my idea is to call directly the frontname in the URL and this allows me to not create three modules for only three views.


texts: How to log list of Magento Events Being Called During Checkout

texts:
I am not looking for an arbitrary list of events I want to see the order of events called (anywhere in the app not just core) during the checkout process with the ability to log.
Example: I am in the frontend and click checkout out go through the motion and there is code logging events being called on the backend somewhere.

Log list of the events called upon any action.


texts:
I want to export table content in downloadable csv format. In magento 1.x it can be achieve by _prepareDownloadResponse() how can we achieve same in magento 2. Looks like this function is missing in magento 2. Is their any alternative for this.

Please note that I don't want to use header() I am already using this which is working but i want to implement it by magento way as this gives warning at the time of extension upload in Magento connect.


texts: Magento Security Scan fails AngularJS version

texts:
The Magento security scan tool failed our website after we upgraded to Magento 2.1.18.

  Outdated JS Libraries - Failed. Outdated AngularJS library found,
  response body contains unexpected 'AngularJS
  v1.2.17-build.***+sha.********'

Any idea of how this can be fixed or checked?

As far as I know AngularJS is only used by Magento installation wizard.


texts: Does it make any difference whether I declare my  inside ,  , , , ?

texts:
At the surface, all seem to work.
Are there any less obvious implications/consequences of choosing one over the other?


texts: Magento 2 : Possible bugs/solution in Magento 2.2.0

texts:
Magento 2 released it's new version Magento 2.2.0

I just want to know what are structural changes which are new in this series.

Also is it the right version which we have to use instead of the last version(2.1.9) as we know there are lots of bugs pending in Magento 2.

What are the common bugs which are resolved in this series.

  Can we upgrade our Magento 2.1 series setup in this 2.2.0 version
  without having any issue?


texts: What does this Magento base js line mean?

texts:
This line of javascript is in the Magento base code in app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml:

        $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

Here is the line in context:

    <script type="text/javascript">
//<![CDATA[
var billing = new Billing('co-billing-form',
                          '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/',
                          '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
var billingForm = new VarienForm('co-billing-form');

/*billingForm.setElementsRelation('billing:country_id',
                                  'billing:region',
                                  '<?php echo $this->getUrl('directory/json/childRegion') ?>',
                                  '<?php echo $this->__('Select State/Province...') ?>');*/

$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

var billingRegionUpdater = new RegionUpdater('billing:country_id',
                                             'billing:region',
                                             'billing:region_id',
                                             <?php echo $this->helper('directory')->getRegionJson() ?>,
                                             undefined,
                                             'billing:postcode');
if ($('onepage-guest-register-button')) {
    Event.observe($('onepage-guest-register-button'), 'click', function(event) {
        var billingRememberMe = $('co-billing-form').select('#remember-me-box');
        if (billingRememberMe.length > 0) {
            if ($('login:guest') && $('login:guest').checked) {
                billingRememberMe[0].hide();
            } else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
                billingRememberMe[0].show();
            }
        }
    });
}
//]]>
</script>

It looks like it's comparing two values but doing nothing with the comparison. What is the purpose of it?


texts: magento 2 / can't set addImageToMediaGallery path

texts:
i created php file in root folder and trying to create simple product programatically in magento 2. testimg folder locating in root. I always thow the error: The image does not exist. Here is code:

$_product->setImage('testimg/test.jpg');
$_product->setSmallImage('testimg/test.jpg');
$_product->setThumbnail('testimg/test.jpg');
$_product->addImageToMediaGallery(
    'testimg/test.jpg',
    null,
    false,
    false
);
$_product->addImageToMediaGallery(
    'testimg/test.jpg',
    null,
    false,
    false
);

when i put 'testimg' folder in 'pub/media' and run script:

$dir = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList');
$_product->addImageToMediaGallery(
    $dir->getPath('media') . '/testimg/test.jpg',
    null,
    false,
    false
);

i receive next error:
The file "/home/xxx/pub/media/tmp/catalog/product/t/e/test.jpg" doesn't exist or not a file.
Why magento looking for my file in tmp/catalog/product/t/e/ ?


texts: Magento 2: Is it no longer possible to load Quotes by ID?

texts:
In the past, to load a quote by id, i used to use the factory:

protected $quoteFactory;

public function __construct(
    ...
    \Magento\Quote\Model\QuoteFactory $quoteFactory,
    ....
) {
    ....
    $this->quoteFactory = $quoteFactory;
    ....
}

But since moving on, it is more recommended to use the service contract:

protected $cartRepository;

public function __construct(
    ...
    \Magento\Quote\Api\CartRepositoryInterface $cartRepository,
    ....
) {
    ....
    $this->quoteRepository = $cartRepository;
    ....
}

However this will give me a Cart API, and some of the functions available in Quote like getAllItems i cannot use via the Cart service, the function getItems only lists visible ones (meaning it will exclude children items of a configurable item). Is this designed to be this way in order to restrict bad practices or how can i retrieve a quote using the quote_id or the Cart service?


texts:
I wanted to be able to display a link on a product that will open up a new window showing a Size Guide if one is available. To do this I added a new Media Image attribute called size_guide_media and assigned it the type Media Image and added it to the product attribute group. It now shows as a column within the Images tab. Excellent. I can now assign an uploaded image as a size guide.

So I wrote this code into view.php to manage whether or not to show a link that opens up an assigned size guide:

<?php
    // Check if size guide media attr has been set for product
    if ($_helper->productAttribute($_product, $_product->getSizeGuideMedia())) {
    // Assign size guide img url to variable
    $size_guide_url = Mage::helper('catalog/image')->init($_product, 'size_guide_media');
?>
<a href="<?php echo $size_guide_url; ?>" onclick="javascript:void window.open('<?php echo $size_guide_url; ?>','1435746173051','width=800,height=600,toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1,left=30,top=30');return false;" class="size-guide-button"><?php echo $this->__('Size Guide'); ?>
<?php } ?>

It works... almost. An issue arises when the following is done:

I add a size guide to a product and set it to the size guide
attribute
Saved product now shows size guide link and works correctly.
I now go back to the product editor, and set the Size Guide column under the images tab to no media and save the product.
I Refresh the same product on the front end and the screen goes
completely white.

I'm assuming this is down to my if statement and how it is checking to see if the variable size_guide_media is in use...

This bit:

  if ($_helper->productAttribute($_product, $_product->getSizeGuideMedia())) {

My question is what happens when a media image attribute is set to no image? Because this is when my code falls over...

Any thoughts?


texts: Magento 2 Plugin on Magento\Store\Model\Store

texts:
How to check if a plugin really work?
files are:
app/code/Vendor/Module/etc/di.xml
<?xml version="1.0" encoding="utf-8"?>
<config>
    <type name="Magento\Store\Model\Store">
      <plugin name="set_default_currency" type="Vendor\Module\Plugin\Store\Model\Store" disabled="false" />
    </type>
</config>

app/code/Vendor/Module/Plugin/Store/Model/Store.php
<?php
namespace Vendor\Module\Plugin\Store\Model;

class Store
{

    private $_logger;

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

    public function afterGetDefaultCurrencyCode(
        \Magento\Store\Model\Store $subject,
        $result
    )
    {
        $this->_logger->debug("GEOIP::".$result);
     }
     ....

The plugin seems to never been called.
The method Magento\Store\Model\Store->getDefaultCurrencyCode() is one in the Limitation of plugins?

Limitations
Plugins can not be used on following:

Final methods
Final classes
Non-public methods
Class methods (such as static methods)
__construct
Virtual types
Objects that are instantiated before Magento\Framework\Interception is bootstrapped

EDIT
The reason was a silly typo mistake in registration.php file.
I want to add a note for those who find themselves in this situation.
My aim was to update the default currency based on the user's geo location.
Although it is a good method to create a plugin for the getDefaultCurrencyCode function, I ran into the issue of Full Page Cache, that literally drove me crazy.
Remembering the famous acronym "RTFM" I found an easy solution in:
Configure page variations
Hope Will Help Someone...


texts:
So the official documentation is very terse (bad!), particularly for someone who hasn't worked with REST/Oauth in the past.  I'm using Magento 1.8.1 CE.

Can somebody provide a simple PHP example of how to use Magento's REST API?

Using their example code (http://www.magentocommerce.com/api/rest/introduction.html) I get two errors:

Message: Undefined index: state
Message: Use of undefined constant OAUTH_AUTH_TYPE_URI - assumed 'OAUTH_AUTH_TYPE_URI'

Thus far I've done:

Install php oauth extension
Create at least one product in Magento
Configure resource permissions for Admin REST user for retrieving all product data for Admin
Create a Consumer

Any help is greatly appreciated.

EDIT: I narrowed down the problem to (surprise, surprise!) OAuth not working properly.  I gave up and changed the Guest roles and attributes to allow all.  Then, I tested things to see if they were working by navigating to:

http://yourdomain/api/rest/products
http://yourdomain/api/rest/products/1/images

Everything is indeed working.  If/when I figure out how to properly deal with authentication, I'll post the answer.


texts: Is there any way to kick off a very specific cron process in Magento 2 using command line?

texts:
We're working on troubleshooting a bug where product back in stock alerts aren't sent on our production or staging environment, but they are in dev(after a custom patch was applied to all three). Magento 2 by default only schedules this process once a day, even if you change the time the cron is supposed to run. We've cloned our staging environment to run some tests. We'd like to test this more frequently without the need to install one of the cron scheduler apps.
Is there any way to fire off a specific cron process, catalog_product_alert in our case, through command line alone?
We're on Magento 2.3.5


texts: Magento 2.4 - Build Child Theme parent of theme installed via composer

texts:
)
I need a tip. I've installed a theme via composer and I need to create a child theme having as parent a theme installed via composer.
path of theme installed via composer: vendor/{vendor}/{theme}/
path of child theme: app/design/frontend/{vendor}/{theme}/
in the child theme folder i've created:
theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>TitleTheme</title>
    <parent>{folder-name-vendor}/{folder-name-theme}</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

Composer.json
{
    "name": "{my-vendor-folder}/{my-child-theme}",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-theme",
    "version": "100.0.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

registration.php
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/{my-vendor-folder}/{my-child-theme}',
    __DIR__
);

When I change the theme from the magento backend panel under
Content > Design > Configuration
and then run:
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
It does not load me the parent theme I have chosen, but the default magento theme.I don't know what I'm wrong.
Can someone help me?
Thank you ;)


texts: Block class is not getting loaded in magento 2.3.4

texts:
I created a simple layout where I specify the block class and the template to be rendered. But it seems like the block and template is not getting rendered. Below is the code. I am trying the CRUD models implementation in magento. I have successfully created the table via the InstallSchema.php. Also, when I var_dump in the controller the data is displayed perfectly. The problem arises when I try to divert it via the block.

routes.xml

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

Controller/Index/Index.php

<?php
namespace Mathanagopal\CRUD\Controller\Index;

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

        public function __construct(
            \Magento\Framework\App\Action\Context $context,
            \Magento\Framework\View\Result\PageFactory $pageFactory
        ) {
            $this->_pageFactory = $pageFactory;
            return parent::__construct($context);
        }

        public function execute()
        {
            return $this->_pageFactory->create();
        }
    }

crud_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="content">
        <block class="Mathanagopal\CRUD\Block\Index"
               name="crud_index_index"
               template="Mathanagopal_CRUD::index.phtml" />
    </referenceContainer>
</page>

Block/Index.php

<?php
namespace Mathanagopal\CRUD\Block;

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

        protected $_postFactory;

        public function __construct(
            \Magento\Framework\View\Element\Template\Context $context,
            \Mathanagopal\CRUD\Model\PostFactory $postFactory
        ) {
            parent::__construct($context);
            $this->_postFactory = $postFactory;
        }

        public function getResult()
        {
            $post = $this->_postFactory->create();
            return $post->getCollection();
        }
    }

index.phtml

        Id
        Name
        Created At
        Updated At
        Action

    <?php
        /** @var \Mathanagopal\CRUD\Block\Index $block */
        $collection = $block->getResult();
        foreach ($collection as $item) {
            ?>

        <?php echo $item->getData('post_id'); ?>
        <?php echo $item->getDate('name'); ?>
        <?php echo $item->getData('created_at'); ?>
        <?php echo $item->getData('updated_at'); ?>
        <a href="<?php echo $block->getUrl('crud/index/edit') . 'id/' . $item->getData('post_id'); ?>" class="action primary">Edit
        <a href="<?php echo $block->getUrl('crud/index/delete') . '?id=' . $item->getData('post_id'); ?>" class="action primary">Delete

    <?php
        } ?>

This is the output. go to the image.


texts: Domain level admin Permission In Magento 2 Backend

texts:
I have experience with magento for a long time, When creating multiple domain sites, i always thought Magento 2 has, by default, the option to have a specific admin for each domain (that's what I sold). I'm working on 2.3.5 and i dont see it anywhere, I'm missing something? is hidden somewhere? maybe 2.4.1 have it? it it doesn't, please advise if there is a extension for this already developed
thanks


texts: Performance of configurable products category

texts:
How can I improve performance of my category page which consists mostly of configurable products?
I have configurable products created out of cca 160 simple products (different sizes, colours and formats). If I put those products to certain category, site load will slow down to cca 40 seconds!
base url (which works at normal speed): www.malckovsvet.si
problem on this page: http://www.malckovsvet.si/oblacila/potiskani-bodiji.html
example of product (which loads normally): http://www.malckovsvet.si/oblacila/potiskani-bodiji/bodi-mami-ati-jaz.html

HW: CPU - xenon X5570  @ 2.93GHz, Ram - 2 GB (4GB peak), Disk - SSD

SW: PHP 5.5.9 with opcache, Magento CE ver. 1.9.2.1

I am thinking of implementing redis on this server, but will that help enough? What do you recommend?


texts: Magento 2 How to navigate to product page by make and model number

texts: How to navigate to the product page by manufacturer and model number for example in my site I created category led tv parts >>led tv power supply. so when customer click led tv power supply I want the customer to select the manufacturer then when the customer selects the manufacturer I want the customer to select a model number when the customer selects the model number it should take the customer to the specific product for that make and model number. I hope someone can point me in the right direction your help would be really appreciated thank you.


texts:
I am looking for a way to make free shipping if the customer orders a minimum amount of 12 items or over.

I have not found a way to do this anywhere, so i am counting on that someone here can point me in the direction i need.


texts:
Creating a custom module that has a grid in admin. I'm trying to assign the value of a function to be the column value. The hard part is the $columnid as what I want doesn't have an attribute in the db.

Here's my add column section:

   $this->addColumn(
        '',
        array(
            'header' => Mage::helper('catalog')->__('Amount Sold (Monthly)'),
            'index'  => $this->getSalesOverMonth()
        )
    );

and my getSalesOverMonth function:

public function getSalesOverMonth() {
    $from = date('Y-m-d', strtotime('first day of this month'));
    $to   = date('Y-m-d');

    $sku = $this->getSku();

    $qty = Mage::getResourceModel('reports/product_collection')
        ->addOrderedQty($from, $to)
        ->addAttributeToFilter('sku', $sku)
        ->getFirstItem();

    return (int) $qty;
}

that function does actually return the correct value but I can't plug it into the table

any idea where I'm going wrong?

Thanks


texts: Attribute sets - why not just use default set?

texts: A really basic question, but I've read a lot about not just using the default attributes set. What are the benefits (both the the customer and in the back end) of having multiple attribute sets by product type, apart from LH filters?


texts:
We are using the default Magento CE v 1.9.1.0 USPS shipping functionality. We have our api credentials allowed to create a shipping label.

However when we create a USPS shipping label inside the usps.com website their is an option to add a reference # to the shipping label which we use to add the order number onto the label.

However now that we are using Magento to create the shipping labels we do not see the order # on the shipping label that Magento developers and would like to now how to alter the code to send the order # as a ference # to USPS when we have Magento generate the shipping label.

Any suggestions on the file to edit?


texts: Can we set production mode from localhost in Magento 2

texts:
I am trying to set production Mode from my localhost, but it is throwing error.

Can we set Production Mode from localhost? and let us know the precautions before setting the production mode?


texts: How are related banners used with promotions?

texts: Documentation of this feature is very sparse. Basically, I want the ability to dynamically display a banner on the cart/checkout pages when a certain product is in the cart. Is this what related banners are for? If not, what is their function?


texts: Show random products from multiple preselected categories

texts:
I have seen multiple posts about random products here ...
But mine is a bit different.

What i would like to to do:

Day one:
Lets say 8 .... (could change later on) random products selected from multiple categories (max 6 different categories) For example with the following id's 7, 34, 76, 81, 83 and 92

But when 8 products are choosen the should remain all day ... and don't be reloaded when you hit refresh.

Day two:
8 new random products selected from other categories, for example 9,15,22,45,78,82

And so on ... Untill about 7-8 days ... and than restart from day one but with different products.

And it must be a automatic process.
Is this even possible?

And if possible ... where should i start ...


texts: Exclude one SKU from all cart price rules at once

texts: I'm having trouble with this subject. I have one new SKU, where I would like none of my cart price rules to apply. Can somebody help me with this? It's a bit urgent :-)


texts: One specific product detail page returns 404 error

texts:
I have check the visibiity option and status of that product is also enabled and also reindex the data but  still one product is returning 404 error.

https://qa2.yeswellness.com/vitamins-and-minerals/greens-and-antioxidants/chlorella.html.Check first product on the list.


texts:
I had installed some extension to add an step and two input fields in Magento 1.9.
But currently i am using magento 2.1 and there is no any free extension available.

Please let me know if any free extension available to achieve this.

OR

I don't have much idea about magento 2.1, please guide me to add
an step with 2 fields. This step is optional for customer.

Below is the screen shot of version 1.9 which i need in magento 2.1 thanks.


texts: Crosssell Products on Product Page with Magento 2

texts:
I have been trying to get crosssell products to show on the product pages. however adding the block does not work as it relies on the product being in the cart. I have tried to overcome this by following the following post: Magento 2 - How To Display Cross Sell Products On Product Details Page (PDP)?

The module described here no longer seems to work however as folowing error occurs:

"PHP Fatal error: Uncaught Error: Call to a member function toHtml() on null "

Removing the toHtml function allows my page to load and a list of products is almost rendered however some data for products does not seem to be available.

This is the code i'm currently using for my block:

<?php
namespace Vendor\Module\Block;

class Crosssellproduct extends \Magento\Catalog\Block\Product\AbstractProduct implements \Magento\Framework\DataObject\IdentityInterface {

protected $_registry;
protected $_itemCollection;

public function __construct(
    \Magento\Catalog\Block\Product\Context $context,
    \Magento\Framework\Registry $registry,
    array $data = []
) {
    $this->_registry = $registry;
    parent::__construct(
        $context,
        $data
    );
}

public function getCurrentProduct() {
    return $this->_registry->registry('current_product');
}

public function getItems() {
    $items = $this->getData('items');
    if ($items === null) {
        $product = $this->getCurrentProduct();
        $items = $product->getCrossSellProducts();
        $this->setData('items', $items);
    }
    return $items;
}

public function getItemCount() {
    return count($this->getItems());
}

public function getIdentities()
{
    $identities = [];
    foreach ($this->getItems() as $item) {
        $identities = array_merge($identities, $item->getIdentities());
    }
    return $identities;
}
}

UPDATE

Using some code from related products i have it a little closer to working with working links and add to cart buttons. I've updated code in question to above. However images show the placeholder image, names are not showing and prices appear as £0.00. So below sections of code do not appear to work as expected:

echo $block->escapeHtml($_item->getName())
echo $block->getProductPrice($_item);
echo $block->getImage($_item, $image)->toHtml();

However these do work:

echo $block->getProductUrl($_item)
$block->getAddToCartUrl($_item)

Does anyone know why these would be failing slightly and what is required to allow these to work?


texts: Show categories based on first dropdown values in admin form

texts:
I have added two components using Ui component in the admin form,
the first one is a simple dropdown and the second one is a category selector
I want to show the parent category and its subcategories based on the values selected from the first dropdown.
how can I do that?


texts: Cant find where to edit Sidebar in Athlete Thema

texts:
I cant find the location where my sidebar is located in my webshop. I want to remove some stuff to make the sidebar smoother, but i cannot find the location where it is standing in my scripts. I am using Athlete theme, and searched every file. What is the most common place?

See sidebar here: http://www.thefixedgearshop.com/fietsen-frames/6ku-bikes


texts: Magento 2.3.4 How to change the order status from COMPLETE to CLOSED after 5 days with a cronjob?

texts: Since Yotpo plug-in triggers Automatic Review Email upon Magento changing order status to COMPLETE, I need to further change the status from Complete to Closed after 5 days so that the Automatic Review email is made to be sent to customer on closed status. This ensures the order would have by then been delivered. Could any please suggest how could one accomplish this programmatically?


texts:
I have products that have an attribute for an external image location.  When one of these products is added to the cart, I would like the cart thumbnail to to be replaced by this external image file.

Because I'm making this as part of an extension, for compatibly/portability reasons I really do not want to edit

  /template/checkout/cart/item/default.phtml

I would rather just make it so when

  $this->getProductThumbnail()->resize(75)

is called it knows to look for the external URL first, and display that if it's there.

I wanted to override

  Mage_Checkout_Block_Cart_Item_Renderer:getProductThumbnail()

but then resize doesn't work properly.

Any ideas or help implementing this would be awesome.  I know there must be some way to do it because there are extensions that allow all images to be moved to S3.  Essentially it's the same idea.  I think.

Thanks!


texts: Magento 2 Remove page-wrapper from Magento/blank theme

texts:
I am developing a new theme for Magento 2, based on Magento/blank.
I am trying to remove the div "page-wrapper", unsuccessfully.
Inside my app/design/frontend/custom/theme/Magento_Theme/layout/default.xml I inserted the following <referenceContainer name="page_wrapper" remove="true"/> but nothing happens, the div is still there. What should I do to remove it?


texts: Trying to extend Layout. File not used at all

texts:
I try to extend

/vendor/magento/module-sales/view/frontend/layout/sales_order_view.xml

Therefore I created

/app/design/frontend/Company/basic/Magento_Sales/layout/sales_order_view.xml

inside my sub-theme with this content:

<?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content" remove="true" />
    </body>
</page>

In the end I want to add content under the purchased items. Removing something is just for seeing if it works.

The theme is correctly used as far as I can see (I can overwrite templates inside the sub-theme folder)

But nothing changes on this page:

domain-dev.de/sales/order/view/order_id/1/

If I change /vendor/magento/module-sales/view/frontend/layout/sales_order_view.xml directly it works. But obviously this is not the correct way of doing things.

I also tried to add a block via sales_order_view.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="page.main.title">
            <block class="Magento\Sales\Block\Order\Info" name="customtext" template="customtextab.phtml" />
        </referenceContainer>
    </body>
</page>

and therefore added the file /app/design/frontend/Company/basic/Magento_Sales/templates/customtext.phtml
with this content:

<div class="block" style="float: right;margin-bottom: 0.5%;margin-top: 0.5%;">
    <?php echo __('This is Custom Text overwritten'); ?>
</div>

like described here: How To Use Magento 2 Layouts

But nothing changes. I flushed the cache every time:

rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/*
php bin/magento cache:clean
php bin/magento cache:flush

And installed the theme by doing

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

I'm using Magento 2.1.7 with the vagrant box from paliarush: https://github.com/paliarush/magento2-vagrant-for-developers in case that matters.

Can anybody help me?


texts:
Bit of a strange one and in my years of Magento development have never come across this before.

When you add to cart in Firefox, chrome everything works as it should.

When you add to cart in safari then visit the site on another browser e.g iPad, iPhone you can see what cart items were added on the different browser. Discount codes and account details seem to be switching between everyone sessions so sometimes you are logged in as another customer. obviously this is a pretty big issue but i'm running out of ideas.

The server has Varnish which is running however I have turned this off which had no effect. Its running on Amazon EC2 if that's any help to anyone.

Magento version 1.7.0.2

It doesn't happen on our development server so that points to server rather than code / modules.

Any ideas on how to debug this would be greatly appreciated.


texts:
Picture generation does not work after URL redirect in .htaccess with the following script:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


texts: How to update magento2 from 2.0.0 to 2.0.2

texts:
The docs here say that you should use the system upgrade utility:
http://devdocs.magento.com/guides/v2.0/comp-mgr/upgrader/upgrade-start.html
and do it from the admin.

I thought that you would be able to update it by changing the composer.json file to     "version": "2.0.2", and then just run composer update.

Would this be another way to update or system upgrade utility is the only way of doing it?


texts: Unable to call my observer using Factory

texts:
Can someone tell the right method of calling the objectManager's create() in Observer

Vendor\Module\Observer\SyncObserver.php

<?php
namespace Vendor\Module\Observer;

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

class SyncObserver implements ObserverInterface
{
//protected $_queue;

/**
 * @var \Vendor\Module\Model\QueueFactory
 */
protected $syncQueueFactory;

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

function __construct(
    \Vendor\Module\Model\QueueFactory $syncQueueFactory,
    \Psr\Log\LoggerInterface $logger
)
{
    $this->syncQueueFactory = $syncQueueFactory;
    $this->logger = $logger;
    //$this->_queue = $this->syncQueueFactory->create();
}

public function execute(\Magento\Framework\Event\Observer $observer)
{
    echo 'Sync obssrexe';die;
    $event = $observer->getEvent();
    $this->syncQueueFactory->productUpdate($observer);
}
}

Im calling the productUpdate() from Model in the observer

Vendor\Module\Model\QueueFactory.php

<?php
namespace Vendor\Module\Model;

class QueueFactory extends \Magento\Framework\Model\AbstractModel
{
    protected $logger;
    protected $_queue;
    protected $syncQueueFactory;

 public function __construct(
  //If i give this i get circular dependency error

   \Vendor\Module\Model\QueueFactory $syncQueueFactory,
    array $data = []
     ) {
    $this->syncQueueFactory = $syncQueueFactory;
    $this->logger = $logger;
    $this->_queue = $this->syncQueueFactory->create();
      ....
    );
  }

How to use syncQueueFactory in my code


texts: Apache reverse-proxy to serve SSL to Varnish on magento 2 - results in 503 Backend Fetch Failed

texts:
magento 2 install on a centos 7 server. with a LAMP stack (php 7)

we have installed magento 2.2.3 with the virtual hosts only using SSL through port 443 and have now come to installing and configuring varnish

varnish 5 installed, varnish configuration exported from the backend of magento and listening on port 80, apache listening internally on port 8080.

now if i try and set apache up to act as the SSL termination by listening on port 443 and forward this to varnish on 80 by adding

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/

to our ssl.conf we get a 503 Backend Fetch Failed error

after searching around, i found the magento devdocs troubleshooting, and have already increased the

http_resp_hdr_len

and the

http_resp_size

but i still get the 503 error.

I have seen people suggesting that the /pub/health_check.php is located/listed wrong in the varnish.vcl that magento generates but this seems to have been patched in 2.2.2

i have also seen people suggest downgrading php to 5.6 but that seems pretty extreme.

does anyone have a solution for this?

EDIT:

this has been resolved, it was a combination of the /pub/health_check.php issue seen elsewhere, missing virtualhosts as a result of the server being locked to only port 443 for security (we made a new vhost for port 80 for varnish, and for port 8080 for apache's backend listen port) AND the DocumentRoot line not being required in the virtualhosts file for the SSL connections (but IS required in the vhosts for port 80 and 8080)

hope this helps anyone else with our issue to resolve it, the site is flying now.


texts: I get an error on customer or product grid when I sort by ID or apply filter on product ,customer , content->block , content->page then show error

texts:
I get an error when I am trying to sort on the basis of ID are apply filter on product ,customer , content->block , content->page  then this error pops up
Error:Something went wrong with processing the default view and we have restored the filter to its original state
I got some solutions that asked me to clear the UI_bookmark table. This however temporarily solved the problem and let the page load.
It’s not however the solution as when I did the action again it causes the same issue all over again


texts: How to upload Extension files in magento Connect

texts: I am trying to upload my custom Extension in magento Connect. I am following this url http://www.gosolid.net/pages/info/index/page/how-to-add-magento-extension-using-magento-connect/ . I am able to upload ScreenShot Tile ,description . But I am not getting Interface to upload my extenion Files .without uploading files its asking for to Submit for approval. Can you help me out to provide Screen shot or Exact location to upload extension files


texts: Always show full URL including categories for product

texts:
For our Magento webshop (1.7.0.2), we're trying to optimize the URL structure. We've already managed to improve some things, but in one things we didn't succeed. We want to use a full URL (including categories) for all of our products. For example:

www.website.com/products/best-products/product
or: www.website.com/products/best-products for a category page

This works fine when browsing through the categories and using the breadcrumbs, but not when searching. It then always uses www.website.com/product as URL, most likely because a product can be in multiple categories and it doesn't know which category to use in the search results.

Is there a way to force this? To make it somehow use the "first" category, or even make it use some default category that you can pick? I'm a developer, so I'm willing to make changes to the code, but only if there isn't another/more reliable way. Any tips or tricks are welcome, many thanks in advance!


texts:
I am trying to override some Mageplaza 2 Blog Extension template .phtml files

(for this question lets focus on topmenu.html)

Before you downvote me,
I read a tone of answers and tried implementing them, and nothing worked

I am a complete magento2 newbie whatever I know is mostly assumptions and whatever I experienced in my magento2 journey so far

My Vendor Name: C2ghq

My theme Name: c2g

What I tried so far and didn't work:

app/design/frontend/C2ghq/c2g/Mageplaza_BlogExtension/templates/html/topmenu.html
app/design/frontend/C2ghq/c2g/Mageplaza_Blogextension/templates/html/topmenu.html
app/design/frontend/C2ghq/c2g/Mageplaza_2BlogExtension/templates/html/topmenu.html
app/design/frontend/C2ghq/c2g/Mageplaza_Magento2BlogExtension/templates/html/topmenu.html
app/design/frontend/Mageplaza/c2g/Mageplaza_BlogExtension/templates/html/topmenu.html

In the vendor folder the extension has:

  /vendor/mageplaza/magento-2-blog-extension

  /vendor/mageplaza/module-core

What confuses me:

Magento's modules folder, has i.e. module-product, so the prefix is indeed "module", so if i want to override it, I do

app/design/frontend/C2ghq/c2g/Magento_Product/templates/...

But Mageplaza has magento-2-blog-extension, is it also considered a module?

*And finally: What am I doing wrong?

Edit:
registration.php file:

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Mageplaza_Blog',
    __DIR__
);


texts: Product/Store Data Deployment Best Practices

texts:
I'm currently working on a store with Pipeline deployment and in the docs for the Production system it states that:

  You should make minimal configuration changes here and no changes to websites, stores, store views, products, or the catalog. You should make all those types of changes in your development system.

The configuration being done on the development makes sense to me as that's easily trackable in version control. But, the actual data such as products/categories/cms data, seems a bit backwards to handle it that way, especially when people other than a developer will be making changes to the store. You can have a staging server that those changes are made and the data is eventually migrated to production, but seems unnecessary for that, unless if I'm missing something?

Is it fundamentally wrong to keep that data in production only? Or, am I fundamentally wrong and staging that data is best? I've always had production be the source of truth for that data as it made it far easier for other people managing stores to make edits/add product/store data, but with Magento stating that's wrong, making me rethink everything.

What are your guys' thoughts on this? How do you handle it?


texts: The website program is installed under the local wampserver, but the access path still jumps to the domain name

texts:
I downloaded the magento 2 website program and database for local debugging of the local computer wampserver. I have installed the website program and database, but I now enter the path: localhost/supwatch/

The website can be opened, but jumping to the domain name of my website is not a local path! How to solve it?


texts:
I've been trying to translate the word "Open Now" that is written in my JavaScript like so
$('.store__info_' + locationCode).text('Open Now');

I followed the dev docs here, to no avail.
I've also used the necessary require statements to look like this
require(["jquery", "uiRegistry",'mage/translate'], function ($, registry, $t)

in all cases, the word inside the text() function remained the same and would not translate. I even switched it to a word that has already been translate and proven to be translated and it wouldn't change then either.
My attempts were this:
 $('.store__info_' + locationCode).text($t('Open Now'));
 $('.store__info_' + locationCode).text($.mage.__('Open Now'));
 $('.store__info_' + locationCode).$t('Open Now');
 $('.store__info_' + locationCode).$.mage.__('Open Now');

Does anyone have any idea why this JS wont be translated?


texts: change url of the contact page in form.phtml file in magento

texts:
the contact us page url is "contacts" in this site : http://demo.kidsdial.com/CONTACTS

this is the code : http://pastebin.com/eWDcbi0W

in above code, where i have to change "contacts " to "contact-us" to change the "url"

of that "contact" page.

please help me to find solution.

thanks in advance.


texts: Customer logged in condition not working on controller

texts:
My controller,
     <?php
/**
 *
 * Copyright © 2015 Zmagecommerce. All rights reserved.
 */
namespace Zero\my_module\Controller\Index;

use Magento\Framework\Controller\Result\JsonFactory;

class Wishlist extends \Magento\Framework\App\Action\Action
{
    protected $_customerSession;
    protected $_resultJsonFactory;
    protected $wishlistProvider;
    protected $_wishlistRepository;
    protected $_productRepository;
    protected $customerSession;
    protected $urlInterface;
    protected $_session;
    protected $storeManager;
    protected $resultPageFactory;

    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Customer\Model\Session $session,
        \Magento\Framework\UrlInterface $urlInterface,
        \Magento\Framework\App\Action\Context $context,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
        JsonFactory $resultJsonFactory,
        \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider,
        \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
    ) {
        $this->_customerSession = $customerSession;
        $this->_wishlistRepository = $wishlistRepository;
        $this->_resultJsonFactory = $resultJsonFactory;
        $this->wishlistProvider = $wishlistProvider;
        $this->_productRepository = $productRepository;
        $this->urlInterface = $urlInterface;
        $this->_session = $session;
        $this->storeManager = $storeManager;
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute()
    {

        //Redirect to login page if customer is not logged in
        // if (!$this->customerSession->isLoggedIn())
        // {

        //     $this->messageManager->addErrorMessage("You must be logged in to add/update product");
        //     $this->customerSession->setAfterAuthUrl($this->urlInterface->getCurrentUrl());
        //     $this->customerSession->authenticate();
        //     return;
        // }
        if($this->_session->isLoggedIn()) {
        $response = [];
        $productId = $this->getRequest()->getParam('productId');
        $customerId = $this->_customerSession->getCustomer()->getId();
        // $customerId = $this->_customerSession->getCustomerId();

        if ($productId && $customerId) {
            try {
                $product = $this->_productRepository->getById($productId);
            } catch (NoSuchEntityException $e) {
                $product = null;
            }

            if ($product) {
                $wishlist = $this->_wishlistRepository->create()->loadByCustomerId($customerId, true);
                $wishlist->addNewItem($product);
                $wishlist->save();
                $response['productid'] = $productId;
            }

        $resultJson = $this->_resultJsonFactory->create();
        $resultJson->setData($response);
        return $resultJson;
        }

        }else{
        $url = $this->storeManager->getStore()->getBaseUrl();
        $login_url = $this->urlInterface
                          ->getUrl('customer/account/login',
                                array('referer' => base64_encode($url))
                            );
        $resultRedirect = $this->resultRedirectFactory->create();
        $resultRedirect->setUrl($login_url);
        return $resultRedirect;
        }

    }
}

customer logged-in condition error?


texts:
What I know how to do:

I have set up an observer to catch the event "Go to Checkout".Everything seems to work fine.I can make a check that I want and redirect back to the page with an error message.

What I don't know:

I want to have a better message than the error.Ideally I would like to make a propose to customer and return something like a table and a custom message and not the default error styled message.

Thanks in advance.


texts: How can I Unassigned all products from categories in Multi-Store

texts: Don't want to delete products, because i just assigned my products to my next store like adding another root category and assigned to categories, Same products assigned to two stores. How can i bulk Unassigned products from second store categories?


texts: Can't change logo & custom welcome msg after upgrade from 2.1.2 to 2.1.3

texts:
I've updated my magento install from 2.1.2 to 2.1.3. After that, for some reason, my logo and custom welcome message are gone, and I can't change them.

As you can see, I have added a logo and a custom welcome message:

But they are not shown on the website:

what I have tried in the meantime:
- Flushed all cache multiple times
- Updated Porto theme to the latest version (including 2.1.x patch)
- run php bin/magento setup:upgrade
- run bin/magento setup:static-content:deploy nl_NL

But no luck...

Anyone could help me and has an idea what is going on?

Thanks!


texts: How can we remove an attribute from the xml block in layout file in magento2?

texts:
I need to remove the ttl attribute value from catalog.topnav block in default.xml file.
I have overrided the file in custom path as follows:

  Magento_Theme/layout/default.xml

<referenceBlock name="catalog.topnav">
   <attribute name="ttl" value="" />
</referenceBlock>

Original block is as follows:

 <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" ttl="3600" before="-">


texts:
Today I noticed that my price rules weren't working correctly, so I tried to reindex. I wasn't able to reindex, Magento said. When I looked it up I somewhere read that I should export the table catalog_catagory_product_index with disable foreign key check checked and then import it back in. When I did that I got an error (I don't remember the exact error).

Now, some of my categories don't display products anymore. I have no idea what the problem might be. https://sportinngerritsen.nl/tennis


texts: Magento2 Community multicurrency website i want to checkout page country dropdown only india to be set when product purchase like inr (Indian Rupies).so only dropdown showing india.not other country in the dropdown.how this is possible in one step checkout page in billing.


texts: SQL Query for get all orders with customer and shipping data (sql query)

texts:
Need help making a query that returns the data:
Customer Code,
Customer name (first – middle – last),
Customer Email address,
Customer Phone,
shipping Address (full address data segmented),
Order Source (Web site / Mobile),
Order Number,
Order Status (submitted / Deleted ….etc),
Order details (SKU Code – Name – Quantity – Unit Price – Total item Price),
Discount method (Promo code),
Discount code (Promo code ID),
Discount value,
Total Order (Before Discount) And
Net order value (after Discount)


texts: Magento2: Remove Sample field from Downloadable Information

texts:
I want to remove sample field from downloadable information as highlighted in image below:

Can anyone give me solution.

Thanks


texts: Magento 2 would like to add tab on PDP page using jquery

texts:
Magento 2 How to add custom tabs (what's included & additional items) besides more information tab.
using JQuery (or) programatically (without using layout concept)


texts:
I'm creating a very simple module and I am missing something.
The module page will not load, and I see these errors:
[2020-12-11 15:51:21] main.CRITICAL: Class Company\Modulename\Block\Index does not exist [] []
[2020-12-11 15:51:21] main.CRITICAL: Invalid block type: Company\Modulename\Block\Index [] []

I believe the problem must be somewhere in these two files and the name of them
Company/Modulename/view/frontend/layout/mapsearch_index_index.xml
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Mapsearch bbb</title>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Company\Modulename\Block\Index" name="mapsearch_index" template="Company_Modulename::mapsearch.phtml" />
        </referenceContainer>
    </body>
</page>

Company/Modulename/Block/Index/Index.php
namespace Company\Modulename\Block;

use \Magento\Framework\View\Element\Template;
use \Magento\Framework\View\Element\Template\Context;

class Index extends Template
{

    public function __construct(Context $context,
        \Magento\Store\Model\StoreManagerInterface $storeManager
    )
    {
        $this->_storeManager = $storeManager;
        parent::__construct($context);
    }

    public function getBaseUrl()
    {
        return $this->_storeManager->getStore()->getBaseUrl();
    }

    public function getNeData()
    {
        return $this->getNe();
    }

    public function getNwData()
    {
        return $this->getNw();
    }
}


texts: Does Magento know the date that an item went out of stock?

texts: In order for my RSS feed to inform me of low inventory changes I need to know the date that the item became low in inventory. If I do not have this date then every time I refresh the feed in a browser or reader it looks at the pubDate - which changes every rss load - and thinks that all of the items have updated.


texts: Magento 2 - Format Price in Product detail page with locale currency symbol

texts:
I need to format my custom price on product detail page.

I've already refer this KO Template and Using Javascript question but both have same solution of using  quote.getPriceFormat() for formatting.

But in my case on product detail page quote object is not available so how can I format the price with a local currency symbol.

var ko = require('priceUtils');
ko.formatPrice(10,{}); //Price format Object{}
output : "10,00" // expected result $10.00


texts: Adding date-check functionality to CMS Static Block

texts:
I want to add the ability to do a date check inside a CMS Static Block. Something like this:

{{if date == '2015-12-25'}}Merry Christmas!{{else}}It's not Christmas{{/if}}

However, I'm not sure how to introduce new functionality like this. I haven't been successful even using {{if}} statements like this with existing variables.

Some pointers on getting {{if}} statements working, and adding custom variables which can be accessed this way should be enough. I can populate said variable with the date pretty easily.


texts: I have a shopping site in Magento now I would like to create its app in iOS and android mobile phone.So I need to create rest apis in Magento.. How I will do this.. I am new to this..


texts: Single product, shared catalog, multiple stores, cannot assign a store_view different categories?

texts:
Interesting problem:

  Magento 2.1.10 CE

I have two websites that share the same root catalog, one store (StoreA) contains 2 store_views, and the other store (storeB) has a single store_view.

I have a single product that needs to be listed in ALL 3 store_views. However, in StoreB it also needs to be listed in a category that is only enabled for StoreB.

The problem I'm having is, if I change the category that the Product is assigned to in StoreB, it also updates and changes the Category for StoreA's individual Store_views. Someone told me that this is because Both Websites share the same root category, but I'm not 100% convinced of that.

Can anybody else confirm if this is true, or am I experiencing a bug?


texts: PHP 7.0.9/NGINX 1.11.3/Magento 2.0 Setup gives blank page

texts:
This is my first time posting here and I am hoping someone can help me out, I am a little stumped.

We have a Linux CentOS 7 server with PHP 7.0.9 and NGINX 1.11.3 installed.

We are trying to install Magento 2.0 but we keep getting a blank page when going to the setup.

We are not seeing an errors in the NGINX on PHP logs and the php info page renders correctly.

Please let me know what other information to provide.

Thank You.


texts: Want to delete old products on my product pages

texts: I need to put new products on magento product pages and remove old ones. I have tried that on admin page but the old products don't delete when I try to.


texts: How to check if a page your are on has a success massage on it

texts:
I need to add a a piece of javascript (a quantast tracking pixel) to the /contacts/index/ page when the user successfully sends a message by completing the contact us form.

Similarrly I need to add another piece of JavaScript code to the /customer/account/index when the user create a customer account, and again for another page where the user books an appointment.

Is there away I could check from a Magento Template file if the user is is on a page which has a success message?


texts: Magento2: How can i get all Customers from database tables

texts:
I want to get all Customers record (including their address) from database.How many tables i have to dump for.Kindly enlist the tables names here.
How many tables which i have to dump and import another database and getting the all customers and customers will be able to login the site.


texts:
I have the following Observer event that is called after the product is saved.

  Subscribers

is a custom model

<?php

namespace Namespace\Modulename\Observer;

use Magento\Framework\Event\ObserverInterface;
use Namespace\Modulename\Model\SubscribersFactory;

class Productsaveafter implements ObserverInterface {

    public function __construct(
    SubscribersFactory $modelSubscribersFactory
    ) {
        $this->_modelSubscribersFactory = $modelSubscribersFactory;
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $_product = $observer->getProduct();  // you will get product object
        $_sku = $_product->getSku(); // for sku
        $subscriber_product_id = $_product->getId();//gives '2'
        $subscriber = $this->_modelSubscribersFactory->create()->getCollection();//This is working

        $subscriber = $this->_modelSubscribersFactory->create()->load(2);//This is not working

    }

}

I can not figure out why ths 'load' function is not working.


texts: How to set custom discount on totals of product(type=bundle) price in cart. Magento 2

texts:
I want to set custom price to bundle product. especially apply to the main product, not its options product. I need to apply the discount on the bundle's total price.

Here is my code working for the normal product type. it's properly working.

  /**
     * @param type $item
     *
     * @return true
     */
    protected function setItemPrice($item, $price) {
        $item->getProduct()->setSpecialPrice($price);
        $item->setCustomPrice($price);
        $item->setOriginalCustomPrice($price);
        $item->getProduct()->setIsSuperMode(true);
    }


texts: How can I get a picture of the category in magento?

texts: I can get all the category names and ids by the following code, but I can only get the thumbnails of the first level classification, can't get the pictures of the subclasses? What should I do? If you can help me, this will be a wonderful thing.


texts: What module do I need to improve magento search?

texts:
I would like to improve search functionality on our magento website: AND instead of OR in the default search field. Search suggestions and spelling corrections would be great.

Searching for this, I found the following modules: Elastic Search (http://www.magentocommerce.com/magento-connect/elasticsearch.html) and Sphinx Search Pro.

Elastic search is "search in the cloud", but I have no idea what that means here. Our magento installation is installed on AWS EC2, so in the cloud, but I don't see how that makes a difference. Search is performed on the database, or does it work otherwise, from cache or somehow?

What is the best module to use? Any other tips?


texts:
We want to display a div when the validation is passed for that field.
We verify the validation direct after hitting the next field,

For example when a customer enters their first name, we want to display a div that says "Hi (customers-firstname)"

What code do we need to display a div when validation is passed?

Thanks!


texts: When clicking on "add to cart " it shows popup , how to change text of that popup in magento

texts:
i want to change text in popup like "view cart and checkout" & "Not Now" texts to other text.

Where i will get this file so i will change text.


texts: Magento 2 How to override third party html template in my Module

texts:
Magento 2 How to override third party .html template in my Module

https://magento.stackexchange.com/a/188790/55981


texts: Image doesn't upload in custom module magento

texts:
I have created custom module in magento with image upload attribute. Image name was successfully stored in DB table. But image doesn't upload to the target folder.

I have tried with this following code. please show me "what am i doing wrong here"

 $uploader = new Varien_File_Uploader('fileinputname');
 $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
 $uploader->setAllowRenameFiles(false);
 $uploader->setFilesDispersion(false);

 $path = Mage::getBaseDir('media') .DS. 'foo'.DS ;
 $uploader->save($path, $_FILES['fileinputname']['name']);


texts: Add Custom Field in Order and Quote Table To be Used in REST API

texts:
Using UpgradeSchema, I've successfully added two fields to the table

quote

and

sales_order

The two fields are called

delivery_note_doc_due_date

and

remarks

My question is: how can I add the methods

getRemarks()
setRemarks()
getDeliveryNoteDocDueDate()
setDeliveryNoteDocDueDate()

inside the

Data\CartInterface

and

Data\OrderInterface

modules so that I can use REST API to create an order?

Your help will be much appreciated!

LDR


texts: Why some classes define injections in both their constructor and di.xml?

texts:
I don't understand why, in some classes, their dependency injections are declared twice - once in the di.xml and in the concrete class's constructor.

For instance in Magento\Backend\Model\Url, its di.xml has this set of types for DI defined:

<type name="Magento\Backend\Model\Url">
    <arguments>
        <argument name="scopeResolver" xsi:type="object">
Magento\Backend\Model\Url\ScopeResolver</argument>
        <argument name="authSession" xsi:type="object">
Magento\Backend\Model\Auth\Session\Proxy</argument>
        <argument name="formKey" xsi:type="object">
Magento\Framework\Data\Form\FormKey\Proxy</argument>
        <argument name="scopeType" xsi:type="const">
Magento\Store\Model\ScopeInterface::SCOPE_STORE </argument>
        <argument name="backendHelper" xsi:type="object">
Magento\Backend\Helper\Data\Proxy</argument>
    </arguments>
</type>

But at the same time, in its concrete class, those classes defined in di.xml required for injection is re-declared again in the constructor:

<?php
    public function __construct(
        \Magento\Framework\App\Route\ConfigInterface $routeConfig,
        \Magento\Framework\App\RequestInterface $request,
        \Magento\Framework\Url\SecurityInfoInterface $urlSecurityInfo,
        \Magento\Framework\Url\ScopeResolverInterface $scopeResolver,
        \Magento\Framework\Session\Generic $session,
        \Magento\Framework\Session\SidResolverInterface $sidResolver,
        \Magento\Framework\Url\RouteParamsResolverFactory $routeParamsResolverFactory,
        \Magento\Framework\Url\QueryParamsResolverInterface $queryParamsResolver,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        $scopeType,
        \Magento\Backend\Helper\Data $backendHelper,
        \Magento\Backend\Model\Menu\Config $menuConfig,
        \Magento\Framework\App\CacheInterface $cache,
        \Magento\Backend\Model\Auth\Session $authSession,
        \Magento\Framework\Encryption\EncryptorInterface $encryptor,
        \Magento\Store\Model\StoreFactory $storeFactory,
        \Magento\Framework\Data\Form\FormKey $formKey,
        array $data = []
) {
    //...
}
?>

If we look at its constructor above, \Magento\Framework\App\Route\ConfigInterface $routeConfig, for example, is not defined in di.xml. It is only defined in the constructor and Magento will still inject the routeConfig into the class for use, wouldn't it? Same for \Magento\Framework\Encryption\EncryptorInterface $encryptor and a few others.

Then, why is there a need to define the other injections in both di.xml and in the constructor when having those declarations in the constructor is sufficient for Magento to inject those dependencies into the class for use?


texts: How can I send Email By TransportBuilder

texts:
I want to send Email By TransportBuilder.
But I got Exception :  Required parameter theme_dir was not passed .

I found  in
/vendor/magento/framework/View/Design/Fallback/Rule/Theme.php Line 66.

$params['theme_dir'] = $this->componentRegistrar->getPath(
                    ComponentRegistrar::THEME,
                    $theme->getFullPath()
                );

It result is empty.
So it will got this exception.
And I print $theme->getFullPath()
I got

crontab/Magento/luma

How can I fix it?

My Send Email Code :
        $post['name'] = 'Name';
    $post['email'] = 'whoami@gmail.com';
    $content = 'It content';

$post['comment'] = $content;
$postObject = new \Magento\Framework\DataObject();
$postObject->setData($post);
$transportBuilder = $this->objectManager->create('\Magetools\SohoAuto\Model\Repository\TransportBuilder');
$transport = $transportBuilder->setTemplateIdentifier($this->template) // this code we have mentioned in the email_templates.xml
            ->setTemplateOptions(
            [
            'area' => \Magento\Framework\App\Area::AREA_FRONTEND, // this is using frontend area to get the template file
            'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
            ]
            )
            ->setTemplateVars(['data' => $postObject])
            ->setFrom($sender)
        ->addTo($emailAry)
        ->getTransport();
$transport->sendMessage();


texts: Magento 2 - InstallSchema.php does not create table

texts:
I have created a module that has a setup that creates a table for me. However, the table does not exist after installing the module. I don't know why.

Error:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mag2new.formmodule_users' doesn't exist, query was: DESCRIBE formmodule_users

File is: Setup/InstallSchema.php

namespace Company\FormModule\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Adapter\AdapterInterface;

class InstallSchema implements InstallSchemaInterface
{
    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();
        $table = $installer->getConnection()->newTable(
            $installer->getTable('formmodule_users')
        )->addColumn(
            'id',
            \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            null,
            ['identity' => true, 'nullable' => false, 'primary' => true],
            'ID'
        )->addColumn(
            'name',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => true],
            'Firstname'
        )->addColumn(
            'lastname',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => true],
            'Lastname'
        )->addColumn(
            'address',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => true],
            'Address'
        )->setComment(
            'FormModule User Table'
        );
        $installer->getConnection()->createTable($table);
        $installer->endSetup();
    }
}

I've tried setup:upgrade, setup:db-schema:upgrade, setup:db-data:upgrade, cache:clean and deleting the record in setup_module. Any tips?

I used this for my module: How do I make a module with the form component?


texts:
I need to find out how this "Export to: CSV" field in order management does to export all products at once.
Does he receive id for all products?


texts: Magento 2 Change order of Tabs on product page

texts:
I have added catalog_product_view.xml in the location app/code/design/frontend/kh/custom/Magento_Catalog/layout

Set the priority for the tabs for the product detail page, but its is not working properly.

Code is given below :

<?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">
            <referenceBlock name="product.info.description">
                <arguments>
                    <argument name="priority" xsi:type="string">4</argument>
                </arguments>
            </referenceBlock>
            <referenceBlock name="product.attributes">
                <arguments>
                    <argument name="priority" xsi:type="string">2</argument>
                </arguments>
            </referenceBlock>
            <referenceBlock name="reviews.tab">
                <arguments>
                    <argument name="priority" xsi:type="string">1</argument>
                </arguments>
            </referenceBlock>
            <block class="KH\Hello\Block\Hello" name="new.tab" template="KH_Hello::hello.phtml" group="detailed_info" >
               <arguments>
                   <argument translate="true" name="title" xsi:type="string">New Tab</argument>
                   <argument name="priority" xsi:type="string">3</argument>
               </arguments>
           </block>
        </referenceBlock>
   </body>
</page>


texts:
I have a Magento e-commerce with 60.000+ products. Every night some crons are executed for the synchronization of the catalog with the management tool.

During the night I found two types of errors about cron execution:

1. PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away'

2. PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 202312905 bytes)

Searching information about these errors I found that maybe are linked with PHP configuration of the variables memory_limit and max_execution_time.

Can you help to find the cause of these errors?

If the cause is the PHP configuration, can you give me an advice about a possible configuration for a Magento e-commerce of 60.000+ products?(max_execution_time, max_input_time, memory_limit, wait_timeout, connect_timeout).

Thanks in advance


texts:
On the product pages only 1 dropdown should be active.  All of mine are active.  No idea why.  Please help.

See here: http://www.gsworkwear.com/portwest-wakefield-trousers-2085.html

Very URGENT.


texts: Delete the price from whole site and from product magento 2

texts: In my website i want to insert product without price and so i don't want to see this attribute none in FO none on BO so how to proceed any help please ?? another question  please: i want to buy products on wholesales so that if a client want to buy some book he should know that when he choose to buy 300 book the box can contain 240 piece so he should choose the quantity 2 (2box) so please help me i am really stuck in this part please it's an emergency and thanks in advance


texts: Magento2. Error with attributes on front-end

texts:
After filling in all field in an attribute (id160) i get an error on the frontend when loading this page.

(Exception): Notice: Array to string conversion in /vendor/magento/module-catalog/Block/Product/View/Attributes.php on line 84

It has to do with this piece of code:

public function getAdditionalData(array $excludeAttr = [])
    {
        $data = [];
        $product = $this->getProduct();
        $attributes = $product->getAttributes();
        foreach ($attributes as $attribute) {
            if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
                $value = $attribute->getFrontend()->getValue($product);

                if (!$product->hasData($attribute->getAttributeCode())) {
                    $value = __('N/A');
                } elseif ((string)$value == '') {
                    $value = __('No');
                } elseif ($attribute->getFrontendInput() == 'price' && is_string($value)) {
                    $value = $this->priceCurrency->convertAndFormat($value);
                }

                if (($value instanceof Phrase || is_string($value)) && strlen($value)) {
                    $data[$attribute->getAttributeCode()] = [
                        'label' => __($attribute->getStoreLabel()),
                        'value' => $value,
                        'code' => $attribute->getAttributeCode(),
                    ];
                }
            }
        }
        return $data;
    }

and line 84 is  } elseif ((string)$value == '') {

When i comment this line and the next line the problem is fixed for now.

But what does this line do? And is there a other way to solve it?

I have magento 2.1.7ce


texts: Change ZIP to POSTCODE in Estimate Shipping

texts:
I'm working with the madison island template in 1.9.1 and when you are viewing the cart the shipping estimator shows COUNTRY, STATE/PROVINCE, ZIP.
I'd like to change STATE/PROVINCE to read as CITY/REGION and also ZIP to read as POSTCODE.
Can somebody describe which files and where in those files I need to amend to achieve that please. Thanks


texts: Display all Reviews On a Single CMS page in Magento 2

texts:
I've searched for the answer to this, but I'm only seeing answers to Magento 1. I need to display all of the approved Reviews on a single page. Preferably a CMS page. How do I go about this?

The best code I've seen for this is:

<?php
$review_collection = Mage::getModel('review/review')
->getResourceCollection()
->addStoreFilter(Mage::app()->getStore()->getId())
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
->setDateOrder()
->addRateVotes();
 ?>

<?php foreach($review_collection as $review): ?>

    <?php echo $review['title'];  ?>

    <?php echo $review['detail'];  ?>

    <?php echo $review['nickname'];  ?>

From this Magento forum page: Display all reviews on one page

But it is for Magento 1.9 and I'm not sure it will work in Magento 2.1.7 which is what I am using.  Further more, I am not sure what pieces of the code go where (ie: PHP into a phtml or PHP file - but what directory do I place it in, Do I place any code in the XML section of the CMS page, etc)

Any help would be greatly appreciated.

Thanks,
A


texts: How to make price filter by default collapsible false?

texts:
How to make this price filter close by default in Magento 2.
When i starting loading the page it shoes price filter open by default.
How to make it close by default.
Any help is appreciated.


texts: How to get subscription and unsubscribe URL

texts:
I am trying to send Subscribe & unsubscribe URL to customer on new order or other alerts via email.
I have tried below code, but it does not work. I am currently using Magento 2.3.5-p1 version, can anyone please suggest me URL or code that's going to work?
Subscribe
Unsubscribe

I also tried subscriber_data.subscrption_link but it does not work.


texts:
I have just installed magento2.4 with sample data. Setup looks fine from frontend and backend also, but facing 2 issues  -
1 - when I run 'indexer:reindex' command, it giving me below issue  -
Catalog Search index process unknown error: {"error":"MapperParsingException[No handler for type [text] declared on field [_search]]","status":400}
don't know why it is giving this issue,
2 - I have created one more website/store in same instance. Created a different root category and 2sub categories in it, and also assigned products to these new subcategories, but products not showing on frontend over this website. On default website they are showing properly.
I checked, they are in-stock, have qty greater then 0, assigned to respective website also.
run indexer and cache clean command multiple time..but no success.
Both site's frontend URl's are  -
http://localhost/mage2/us    (on this products showing properly)
http://localhost/mage2ca (Same products not showing here)
Plz helo me to solve this.


texts: Magento 1.9.3.7 to 2.3.3 migration after "This site can’t be reached" issue

texts:
After Magento 2 migration, I had this error :

  "This site can’t be reached"

In Below Page showing this type message

like:

  Admin
  Cart
  Customer/account/create
  Contact
  login pagees


texts: Importing Single New Sales Orders From Spreadsheet

texts:
Please can anyone help me with where to get an extension like this... (free or paid)

I am trying to find a solution for my ordering process for my customers.

My customers send me orders on an excel spreadsheet. I then process them myself. There are 300 rows with products. There are columns for various things. One of them is a unique sku/barcode.

What I want to do is, login to magento, click a customer, create an order, then without manually adding each item in just click upload and the quantity of all the sku's on the spreadsheet are automatically added to the cart.

I just want to be able to click a current customer in my base, then upload order. All the sku's are uploaded and then I carry on as normal.

Is this possible?

Thanks in advance for any advice given.


texts:
We can get from a product a few different prices, like:

$product->getFinalPrice();
$product->getCalculatedFinalPrice();
$product->getPrice();
...

How many types does Magento 2 have and what's the difference between them?


texts: Order States - Change 'Completed' to 'Shipment Pending'

texts:
we have a store set up that uses the DHL Intraship module. (we've only just enabled it a couple of weeks ago).

The problem that we now have is that orders are automatically set to 'completed' because the shipment is autocreated

(Invoiced -> payment is received -> Shipping is autocreated via DHL Intraship -> Status changed to Completed because invoice, payment received and shipment are true).

But in reality we havn't shipped the items yet.

As you can imagine this is confusing as when many new orders come in, we aren't sure which have been shipped and which havn't.

Our aim is to change the default 'completed' message to 'pending shippment' until an order has been marked as shipped, after which it becomes completed.

How does one go about this?

We are on CE 1.8.1 and all modules are up to date.


texts: Ignoring unused parameter with code sniffer

texts:
I'm running the codesniffer with the EcgM2 standard on my custom extension and I'm getting the warning

  The method parameter $context is never used

for the InstallSchema.php file.
How can I make this warning go away?
My method looks like this (notice the SuppressWarnings at the top of it):

/**
 * {@inheritdoc}
 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    //my install script here that does not use the parameter $context
}


texts: Remove Shipping Information and Shipping method?

texts:
I want to remove Shipping Information and Shipping method in onepage checkout.

I followed this link for removing shipping information and shipping method http://www.justwebdevelopment.com/blog/removed-shipping-address-and-shipping-method-from-onepage-checkout-in-magento/

After that i have different type of payment in mysite all payment method it's not appear


texts: Undefined index: rule_id when trying to create a cart rule (coupons) after upgrading from magento 2.1 to 2.3.5

texts:
When upgrading from 2.1 to 2.3.5, I am now getting the following error when I try to create a new cart rule:
[2020-09-19 15:53:49] main.CRITICAL: Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 {"exception":"[object] (Exception(code: 0): Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 at /var/www/html/magento2/vendor/magento/framework/App/ErrorHandler.php:61)"} []
I emailed stripe support and they've told me it's not them.
Any help would be appreciated. Thank you.


texts: Using the standard advanced search block I am getting a Multiselect box instead of a dropdown. The attribute under 'Catalog Input Type for Store Owner' is set to 'Dropdown'... how can I fix this?


texts: How to update product attribute from magento 2 root folder?

texts:
How to update product attribute from magento 2 root folder ?

I want to add file on magento root and run this file to update product,customer or category attribute from magento root


texts:
How to create a popup window in admin panel?

I want to open a popup window when a custom button on the sales/order page is clicked to show details to the customer.


texts: Sales Report Shows incorrect Invoiced amount

texts:
I'm running sales reports within Magento and I see that last month I did (roughly) $12000 in sales total and $5100 invoiced. Although I'm aware that these numbers shouldn't completely match, I would assume that they should be roughly around the same total.

I also ran a report on completed sales totals on my PayPal merchant account and I have confirmed that the sales totals are (within a margin of error) around $12000.

Looking in the past months, I see that these numbers were closer and within $300-500 off which is more reasonable when you take into account the cancelled orders.

The issue started to happen in June and this happens to coincide with the date that I upgraded from Magento 1.7.2 CE to Magento 1.9.0.1.

Why are my invoiced total's incorrect?


texts: How to get phone on in customer form edit(Account setting) Magento 2

texts:
I have added a phone no text box in Customer Account edit form(Account Edit).

  Block file
  \Magento\Customer\Block\Form\Edit

The issue is, I am not able to get the phone no to get it after the user saved it.

For dob(date of birth)

 <?php $_dob = $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob') ?>

 <?php if ($_dob->isEnabled()): ?>
       <?= $_dob->setDate($block->getCustomer()->getDob())->toHtml() ?>
 <?php endif ?>

For Telephone, I am not able to get phone no.

 <?php $_telephone = $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Telephone') ?>

 <?php if ($_telephone->isEnabled()): ?>
       <?= $_telephone->setTelephone($block->getCustomer()->getTelephone())->toHtml() ?>
 <?php endif ?>

as error is

Method 'getTelephone' not found in Magento\Customer\Api\Data\CustomerInterface more...

How can I get Customer telephone no, from this interface
Magento\Customer\Api\Data\CustomerInterface


texts: Magento 2 : How to Override Magento\Catalog\Pricing\Render\FinalPriceBox in two different modules?

texts:
I'm overriding a Magento\Catalog\Pricing\Render\FinalPriceBox in my two different modules.

  Vendor\Module1\etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
      <preference for="Magento\Catalog\Pricing\Render\FinalPriceBox" type="Vendor\Module1\Block\FinalPriceBox" />
</config>

  Vendor\Module2\etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
      <preference for="Magento\Catalog\Pricing\Render\FinalPriceBox" type="Vendor\Module2\Block\FinalPriceBox" />
</config>

  Both Class Overrides the same method
  wrapResult($html).

It only shows the output of Module2, not both modules output at the same time. I've installed the Conflict detector Extension to see the confliction which shows something like this.

What I've tried so far,

How to override core class which is already overrided by other custom module in Magento 2

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
      <preference for="Vendor\Module1\Block\FinalPriceBox" type="Vendor\Module2\Block\FinalPriceBox" />
</config>

but it gives me the error as shown below,

  1 exception(s): Exception #0
  (Magento\Framework\Exception\RuntimeException): Type Error occurred
  when creating object:
  Vendor\Module2\Block\FinalPriceBox\Interceptor

UPDATE

I've tried using a plugin but it shows only one module's output.

  Vendor\Module1\etc\di.xml

<type name="\Magento\Catalog\Pricing\Render\FinalPriceBox">
        <plugin name="vendor_module1_finalpricebox" type="Vendor\Module1\Plugin\FinalPriceBox" sortOrder="1"/>
</type>

  Vendor\Module2\etc\di.xml

<type name="\Magento\Catalog\Pricing\Render\FinalPriceBox">
     <plugin name="vendor_module2_finalpricebox" type="Vendor\Module2\Plugin\FinalPriceBox" sortOrder="1"/>
</type>

Let me know if anyone has a solution.


texts: Magento 2.1.2 static content not generating

texts:
I have the site set to developer mode,
I have verified write-ability to all var/ directories.
Clear cache and generation.

Verified write-ability to pub and pub/static.   Nothing.....  No static files generate at all. cleared everything except .htaccess from pub/static.   So I have no css, style information, and connot navigate to admin or any other page, as if mode_rewrite is not installed or permitted.  I have set all directives to allow all in apache configs for .htaccess to work.

I have even tried setting everything to 777 permissions.

There are no errors that I can tell.


texts: Magento2 CMSBlock API contains variables. How to replace?

texts:
I Have a magento2 EE with a headless implementation. Hence I am using the rest/V1/cmsBlock/<id> to fetch the content which is added by admin (WYSIWYG).
Problem:
I see the output like :
<response>
    <id>2</id>
    <identifier>pirates</identifier>
    <title>Pirates are Back!</title>
    <content>

    </content>
    <creation_time>2017-01-09 16:03:20</creation_time>
    <update_time>2017-01-09 16:07:12</update_time>
    <active>true</active>
</response>

Now my front-end does not really understand
{{media url="wysiwyg/the-Pirates-of-the-Caribbean-Pop-172-Jack-Sparrow.jpg"}}

So now, how do I get the actual URL of the image instead of the variable. As a part of the XML response itself without overriding the API.


texts: Add HTTP referer to admin's Online Customers

texts: Is it possible to add HTTP referer to Customers>Online Customers, in the admin area?