texts: How to assign multiple TAX classes for customer group?

texts:
Hi I need to assign multiple TAX classes for different customer group.

For example:

I have three customer group: group1, group2, group3

For group1 2% tax will be applicable.

But for group2 2% and 5% both will be applicable.

And for for group3 no TAX will be applicable.

Can anyone please suggest me how I can solve this problem?

Any kind of support


texts:
Migrating Customers Magento 1.9 to 2.3.5
I am trying to migrate all my Magento 1.9 customers (and maybe orders/invoice history as well. Products not needed to transfer) to new Magento 2.3.5 site. I thought I could easily export a.csv file to import to M2, boy was I wrong. I need to find the easiest way to so. Hopefully I don't have to purchase an extension for this.
Any guidance would be appreciated.


texts:
custom option decimal point validation in magento
like : xxx.xxxxxx  x is a number

Is it possible to validate the below condition

3 digits before decimal and 6 after decimal. xxx.xxxxxx


texts:
I'm trying to change the order of the steps in the magento onepage checkout. What I need to do is to move the Review step before the Payment selection.

I've looked on the internet for a solution but everything I found was to change the order in app/code/core/Mage/Checkout/Block/Onepage/Abstract.php

I've tried it, but nothing changed.

What I did was creating a file inside app/code/local/Mage/Checkout/Block/Onepage/Abstract.phpand inside this file I've changed the line 208 in:

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

what am I missing here?

(I'm using Magento 1.9.1.1)


texts: How to integrate MCOM - Magento Commerce Order Management tool to Magento 2

texts:
We are struggling with lack of proper documentations for integrating MCOM - RabbitMq - Magento 2.

All we have done so far is we have integrated/configured Magento 2 with RabbitMq and RabbitMq queues are generated properly.

How to establish connection between MCOM and Magento 2.

This may not be a right place to ask this question, but any help would be appreciated.


texts: Magento 2 -Override tax functionality to calculate tax on cost instead of price

texts:
I have checked below mentioned files to override tax functionality:

\vendor\magento\module-tax\Model\Sales\Total\Quote\Tax.php
\vendor\magento\module-tax\Model\Sales\Total\Quote\CommonTaxCollector.php

I am looking into the mapItem function in CommonTaxCollector.php. I have added static values for setBaseTaxCalculationPrice and setTaxCalculationPrice, but cart row total, subtotal and tax are changed.

I want to change only tax to apply it on manufacturer cost instead of price. Row total and Total should not be affected.

public function mapItem(
    \Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory $itemDataObjectFactory,
    AbstractItem $item,
    $priceIncludesTax,
    $useBaseCurrency,
    $parentCode = null
) {
    $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/mylogfile3.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);
    $logger->info($item->getTaxCalculationPrice());

    if (!$item->getTaxCalculationItemId()) {
        $sequence = 'sequence-' . $this->getNextIncrement();
        $item->setTaxCalculationItemId($sequence);
    }
    /** @var \Magento\Tax\Api\Data\QuoteDetailsItemInterface $itemDataObject */
    $itemDataObject = $itemDataObjectFactory->create();
    $itemDataObject->setCode($item->getTaxCalculationItemId())
        ->setQuantity($item->getQty())
        ->setTaxClassKey(
            $this->taxClassKeyDataObjectFactory->create()
                 ->setType(TaxClassKeyInterface::TYPE_ID)
                 ->setValue($item->getProduct()->getTaxClassId())
        )
        ->setIsTaxIncluded($priceIncludesTax)
        ->setType(self::ITEM_TYPE_PRODUCT);

    if ($useBaseCurrency) {
        if (!$item->getBaseTaxCalculationPrice()) {
            //$item->setBaseTaxCalculationPrice($item->getBaseCalculationPriceOriginal());

            $item->setBaseTaxCalculationPrice('200');
        }

        $itemDataObject->setUnitPrice($item->getBaseCalculationPriceOriginal())
            ->setDiscountAmount($item->getBaseDiscountAmount());
    } else {
        if (!$item->getTaxCalculationPrice()) {
            //$item->setTaxCalculationPrice($item->getCalculationPriceOriginal());

            $item->setTaxCalculationPrice('200');
        }

        $itemDataObject->setUnitPrice($item->getBaseCalculationPriceOriginal())
            ->setDiscountAmount($item->getDiscountAmount());
    }

    $itemDataObject->setParentCode($parentCode);
    return $itemDataObject;
}


texts: Product page Review Section from tabs to Bottom of page

texts:
I need to move/rearrange Reviews from tabs of product page to bottom of page. Here is how I updated my theme file's default.xml

<referenceBlock name="reviews.tab" remove="true" />    <!-- Removed tab  -->

        <referenceContainer name="content">
        <container name="new_space"  htmlTag="div" htmlClass="container"  after="-">  <!-- New Container to display at bottom of page -->

This code works well and placed reviews at bottom of page but Home page of site goes blank and error log display below errors:

  PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /chroot/home/londonwa/londonwala.in/html/vendor/magento/module-review/Block/Product/View.php:131

My issue same issue like: How to Exclude Magento Review tab from tabs and show at bottom    but thats in magento 1.x version.


texts: Separate Favicon for Frontend and Backend

texts:
So, I've located the file responsible for assigning the Favicon:

vendor/magento/magento2-base/setup/view/layout/layout.phtml

Does anyone have a thought/suggestion on how to separate the Frontend and Backend Favicons? This is purely as a real-world QoL improvement that allows admins to quickly identify tabs when they have many open.

EDIT: So far, I've been able to build and apply a Backend Theme to apply my favicon. However, I'm still working on stopping the original favicon code from loading. As at the moment, this code is executed last so that's what the Browser sees.

EDIT: Swapping out the SVG with an ICO appears to have solved the issue.


texts: A hidden attribute set / product info and menu options only seen via proper login

texts:
We are looking to take a fully functioning e-commerce site and use it as a way to link to product assets and resources from our dropbox.
Our ideal execution would be an attribute set or section of product info and a sub menu of options that can only be seen by a particular login.
The site currently uses groups and discount with logins to display prices for vendors at their specified margin. We would like to create an internal team login that displays the product assets and media links for ease of sharing and navigation, and a similar partners login to share the assets and enable creation of listings without having to navigate our dropbox structure.
Is it possible to hide features and content behind an account login on Magento 2?


texts: how to validate custom filed in admin in magento 2.1?

texts: I want to validate a custom field in admin so how to do that validation in magento 2.1?


texts:
I have been monitoring this problem for a few days and I believe that this increase in cpu and disk usage that occurs every 1 minute is related to PHP7 running the magento crontab.
Is this consumption normal or should I worry?
I looked for something strange in the logs in /var/log and found nothing
Follow how crontab is configured
MAGENTO START

/usr/bin/php7.0 /var/www/html/magento2/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >>> /var/www/html/magento2/var/log/magento.cron.log

/usr/bin/php7.0 /var/www/html/magento2/update/cron.php >> /var/www/html/magento2/var/log/update.cron.log

/usr/bin/php7.0 /var/www/html/magento2/bin/magento setup:cron:run >> /var/www/html/magento2/var/log/setup.cron.log

MAGENTO END


texts: Account Information custom field on Order Details

texts:
I'm trying to add custom fields in the order information. I found this on
app/design/adminhtml/default/default/template/sales/order/view/info.phtml

But I did not intend to change it directly to the core

What is the correct way to do this? Thanks in advance.


texts: How to bulk import products with images into Magento 2 from CSV file

texts:
I'm sitting with Magento 2.3.3.
I have a CSV file with some products but when I import the products no images are attached.

My imported fine, but when I press Import I get the error message "Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10"

I have imported my images into cpanel under /pub/media/import.
(I have also tried placing the images under var/import).

This is the CSV file I'm using.

https://docs.google.com/spreadsheets/d/1W1aQiF15kIUxnIO8FapYcbOtEzS2qtCZogsmcqgkMzQ/edit?usp=sharing

I have been following these instructions but it doesn't seem to work for me.
https://docs.magento.com/m2/ce/user_guide/system/data-import-product-images.html

This didn't either work for me:

https://community.magento.com/t5/Magento-2-x-Technical-Issues/How-to-organise-images-when-importing-cvs-into-my-own-structure/td-p/120238

How to import product images in bulk into Magento 2?

Magento 2 product import won't import images

https://community.magento.com/t5/Magento-2-x-Admin-Configuration/Unable-to-import-images/td-p/24009

https://bsscommerce.com/blog/how-to-import-product-images-in-magento-2/


texts: Integrity constraint violation: 1062 Duplicate entry '3-2-9' for key 'PRIMARY', query was: ALTER TABLE `catalog_category_product_index_tmp`

texts:
Integrity constraint violation: 1062 Duplicate entry '3-2-9' for key 'PRIMARY', query was: ALTER TABLE catalog_category_product_index_tmp ADD CONSTRAINT  PRIMARY KEY (category_id,product_id,store_id), COMMENT='Catalog Category Product Indexer temporary table'

this error come when i run setup:upgrade command in magento 2
please make some suggestions to get rid off this error


texts:
I am having a problem trying to migrate my magento2 board from server to my localhost, I copy the database and files I changed app/etc/env.php config parameters to fit with the local host, I did the changes in the database about the secures URLs.
But I can't clear the cache using the commands
php bin/magento cache:clean
php bin/magento cache:flush

I obtaining:
[InvalidArgumentException]
There are no commands defined in the "cache" namespace.

I run:
php bin/magento list

which resulting in
We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.

[CredisException]
Connection to Redis failed after 2 failures.Last Error : (111) Connection refused


texts: Getting errors after setup:upgrade ssh command (and all pages are blank)

texts:
On a clean installation after copying theme files and running the setup:upgrade command, suddenly all pages are blank (including admin).
I enabled error reporting and get this on all pages:

Fatal error: Uncaught RuntimeException:
Can't create directory /var/www/magento/generated/code/Magento/Framework/App/ResourceConnection/. Class Magento\Framework\App\ResourceConnection\Proxy generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. in /var/www/magento/vendor/magento/framework/Code/Generator.php:135 Stack trace:
#0 /var/www/magento/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...')
#1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...')
#2 [internal function]: spl_autoload_call('Magento\\Framewo...')
#3 /var/www/magento/vendor/magento/framework/Code/ in /var/www/magento/vendor/magento/framework/Code/Generator.php on line 135

What should I do?


texts: Magento 2 addAttributeToFilter not working

texts:
In product collection addAttributeToFilter is not working if we assing attribute value in only store view. But if we assing in default and store view than it working fine.

anyone have idea why it is happening ?

This is my code :

$products = $category->getProductCollection();
$products->addFieldToSelect('*');
$products->setStore($storeId);
$products->addAttributeToFilter('status', ['in' => $this->productStatus->getVisibleStatusIds()]);
$products->setVisibility($this->productVisibility->getVisibleInSiteIds());


texts:
How to add simple product to basket if this product is child of configurable product ?

How I can get super_attributes of simple product ( I got ID ) to make it ?

An example: I have T-shirts (id 1) configurable product.

And I got XL (id 5), L (id 6) versions of this product.

I want add to shopping cart id 5, but I cannot make it without requestInfo (super_attributes) when I'm using addProduct($productInfo, $requestInfo=null)


texts: Error when upgrading from CE 2.1.2 to 2.1.4 via Composer

texts:
Composer version is 1.4.1

I ran composer require magento/project-community-edition 2.1.4 --no-update and then composer update

Error message returned: Your requirements could not be resolved to an installable set of packages. The requested package magento/project-community-edition 2.1.2 is satisfiable by magento/project-community-edition[2.1.2] but these conflict with your requirements or minimum-stability.

My composer.json:

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

Installed CE 2.1.2 via Composer. How do I upgrade?


texts: Magento 2 How to hide or show contents based on drop-down content in Admin page

texts:
Here am added a dropdown for a list of type. based on selected type I need to show or hide the another field. how to achieve it.
Here is my code.
$mainTypeField = $fieldset->addField(
    'school_type',
    'select',
    [
        'label' => __('School Type'),
        'title' => __('School Type'),
        'name' => 'school_type',
        'options' => $this->getTypeOption(),
        'disabled' => $isElementDisabled
    ]
);
$mainTypeField = $fieldset->addField(
    'school_city',
    'select',
    [
        'label' => __('City'),
        'title' => __('City'),
        'name' => 'school_city',
        'class' => 'school_city',
        'options' => $this->getCityOption(),
        'disabled' => $isElementDisabled
    ]
);

$mainTypeField->setAfterElementHtml('<script>
//<![CDATA[
    require(["jquery"], function ($) {

        var prd = $("#page_type").val();
                if(prd == 3)
                {
                    $("#page_prd").show();
                }
                else
                {
                    $("#page_prd").hide();
                }

        $(document).ready(function() {
            $("select[name=school_type]").change(function () {

                var prd = $("#page_type").val();

                if(prd == 3)
                {
                    $("#page_prd").show();
                }
                else
                {
                    $("#page_prd").hide();
                }
            });
    });

//]]>
</script>');

 public function getTypeOption(){
        $data_array=array();
            $data_array[0]='Type 1';
            $data_array[1]='Type 2';
            $data_array[2]='Type 3';
            $data_array[3]='Type 4';
        return($data_array);
    }

Can I get Help.? Thank You in advance


texts: I'm new in Magento, I want to ask how we make custom progress bar like this, I want to give feedback on user and display the percentage of process completion


texts: Magento product with many custom options, need to update the prices with unique values for each product

texts:
I have simple products with 1,815 custom options which are tartans, and I need to update the price with unique values for each product. Would I be able to achieve this using a CSV import or do I need to do it programatically using a script in the root folder?
If it is, CSV file>>system>>import/export>>import, what columns are required and do I need to include all of the information or only the information I need to update?

Apologise if this question seems either simplistic but I'm new to Magento and this is the last issue I have before finishing the configuration or my products.

Thanks you for any advice you may have.


texts: Configurable Swatches products in magento 1.9.0.1 version

texts:
can i make a configurable products as like this :

http://www.magentocommerce.com/knowledge-base/entry/ee1141-ce191-configurable-swatches

in magento 1.9.0.1 version.

as in the post they mentioned it's only from 1.9.1 and after,

what changes i have to make it to work for 1.9.0.1?

please help me to find solution.

thanks in advance.


texts: How to know the correct path to extend in Magento?

texts:
I am new in Magento. I am having a lot of problems to achieve each step in the learning curve.
I needed to add a custom shipping method. I was fallowging this tutorial:
https://www.mageplaza.com/devdocs/magento-2-create-shipping-method/
Is not working for me, maybe because multiple causes. But for example, I see the class Shipping is extending from "\Magento\Shipping\Model\Carrier\AbstractCarrier" but I don´t have this path in my Magento folder.
I have Magento CE 2.1.
That changes for each version? I am really confused, :(.
Thank you very much


texts: Magento2 - Getting Grouped and Configurable Product ID from Simple Product Id

texts:
I am trying to get a Grouped product ID (and then the grouped product URL, but I can do this) from a Simple product which is part of this grouped product.
I tried the following:
$parents = $product->getTypeInstance()->getParentIdsByChild($productId);
Without success. Thanks!


texts: Magento Insert Image on WYSIWYG editor does not show images

texts:
I have been facing this issue on one of my client's Magento website.

On Magento admin panel WYSIWYG editor, when I click on Inert image icon and browse button, the Insert Image... pop up appears.

It displays the left side tree structure but the images are not displaying on the right side. Please refer to the screen shot.

I have 777 permission given for media folder and files.

I have cleared cache folder.

When I log the getStorageRoot() function, it returns,

/var/www/vhosts/domainname.com/httpdocs/media/wysiwyg/


texts: Set custom tab in customer edit page Active

texts:
I created a custom tab for customer edit page in backend like this:

app/code/Namespace/Module/view/adminhtml/layout/customer_index_edit.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
           <referenceBlock name="customer_form">
             <block class="Namespace\Module\Block\Adminhtml\Edit\Tab\Vcard" name="customer_edit_tab_vcard" >
              <action method="setTabLabel">
                  <argument name="label" xsi:type="string">V-Card</argument>
              </action>
            </block>
          </referenceBlock>
    </body>
</page>

When i opened the customer edit page, the first tab that is active is Customer View

How can i set my custom tab that is active?


texts: Magento 2: Can you use a Plugin with the `Psr\Log\LoggerInterface` type?

texts:
I've got a di.xml that looks something like this

<config>
<type name="Psr\Log\LoggerInterface">
    <plugin name="namespace_modulename_plugins_psr"
            type="Namespace\Modulename\Plugins\Psr"
            sortOrder="10"
            disabled="false"/>
</type>
</config>

The Namespace\Modulename\Plugins\Psr class can be instantiated, and has a beforeInfo method defined

public function beforeInfo($subject)
{
    var_dump(__METHOD__);
    exit;
}

However, if I inject a logger and try to use it

/* @var $psr `Psr\Log\LoggerInterface` */
$psr->info("This is a message");

The message will successfully log, but the system does not call my plugin method.

Is there something special about the Psr\Log\LoggerInterface that makes in non-plugin-able?  If not, does anyone have a solid methodology for debugging plugin configuration issues?


texts: Magento 2 Create multiple store views in an easy way?

texts: I need to create more than 100 store views to my Magento website. Is there an "easy" way of doing this, like by using command line? It will take a long time if I create each store in admin -> stores -> all stores


texts: Magento 2 - Error on running update/cron.php

texts:
I'm getting an error on running update/cron.php

I setup the cronjob according to the documentation. But it gives the following error:

  PHP Warning:  require_once(update/vendor/autoload.php): failed to open stream: No such file or directory in update/app/bootstrap.php on line 13

  PHP Fatal error:  require_once(): Failed opening required 'update/vendor/autoload.php' (include_path='.:') in update/app/bootstrap.php on line 13

I found that the path update/vendor/autoload.php is wrong. The autoload.php should be at /vendor instead. Is it a bug?


texts: Checkout page take too much time to load

texts:
On my magento 2.3 website when i go to checkout page, it take too much time to load. It goes to infinite loading and does not display anything.
see https://prnt.sc/ph91kn
Please help how to solve this issue.
I am loosing customers because of this.


texts: Get products in Magento 2 by option's SKU

texts:
I wonder how to get products where the product options->SKU field is 'MyOptionSku' in Magento 2.

Something like

/** @var \Magento\Catalog\Model\ResourceModel\Product\Option\Collection $optCollection */
$foundProducts = $optCollection->getAllProductsWhichOptionsSkuIs('MyOptionSku')

UPDATE:

Screenshot from Admin Backend

UPDATE

It is not possible to do that. Reason: The author of the Magento Shop has created these option fields "Titel", "Preis" and "SKU". SKU is a free text field. As Philipp Sander said, options has no SKU.


texts: Site Magento 1.7.2 is down for Malware reason

texts: I cannot access the site in Chrome and Mozilla. In internet Explore it is OK. It shows me "Security error->The site ahead contains malware". When I try to open it. The site is melvinflex.com. Is there any way how to solve this by not upgrade it to any other version because I have some bad experience with magento in version upgrades.Thank you.


texts: Magento 2.3: Call to undefined method Magento\Framework\View\Result\Page\Interceptor::setPath()

texts:
I want to configure Nextopia Extension, i installed it properly after that when i go to this URL http://mysite.dev.us/nsearch, i get an error like this:

And the file
/app/code/Nextopia/Search/Controller/Index/Index.php

<?php

namespace Nextopia\Search\Controller\Index;

use \Nextopia\Search\Helper\Data as NsearchHelperData;
use \Magento\Catalog\Controller\Category\View as Action;
use \Magento\Catalog\Api\CategoryRepositoryInterface;
use \Magento\Framework\View\Result\PageFactory;
use Magento\Catalog\Model\Layer\Resolver;

class Index extends Action
{
    /** @var  \Magento\Framework\View\Result\Page */
    protected $resultPageFactory;

    /** @var \Nextopia\Search\Helper\Data  */
    protected $nsearchHelperData;

    /** @var \Magento\Catalog\Model\Design   */
    protected $catalogDesign;

    /**
     * Constructor
     *
     * @param \Magento\Framework\App\Action\Context $context
     * @param \Magento\Catalog\Model\Design $catalogDesign
     * @param \Magento\Catalog\Model\Session $catalogSession
     * @param \Magento\Framework\Registry $coreRegistry
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param \Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator $categoryUrlPathGenerator
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     * @param \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory
     * @param Resolver $layerResolver
     * @param CategoryRepositoryInterface $categoryRepository
     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Catalog\Model\Design $catalogDesign,
        \Magento\Catalog\Model\Session $catalogSession,
        \Magento\Framework\Registry $coreRegistry,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator $categoryUrlPathGenerator,
        PageFactory $resultPageFactory,
        \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory,
        Resolver $layerResolver,
        CategoryRepositoryInterface $categoryRepository,
        NsearchHelperData $nsearchHelperData
    ) {
        $this->resultPageFactory = $resultPageFactory;
        $this->nsearchHelperData = $nsearchHelperData;
        $this->catalogDesign = $catalogDesign;

        parent::__construct($context, $catalogDesign, $catalogSession, $coreRegistry, $storeManager,
                $categoryUrlPathGenerator, $resultPageFactory, $resultForwardFactory, $layerResolver, $categoryRepository);
    }

    /**
     * Blog Index, shows a list of recent blog posts.
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $storeId  = $this->nsearchHelperData->getCurrentStoreId();
        $resultsPage = $this->resultPageFactory->create();

        if(!$this->nsearchHelperData->isEnabled($storeId) && !$this->nsearchHelperData->isDemo($storeId)) {

            $resultsPage->setPath("catalogsearch/result/index", $this->getRequest()->getParams());

            return $resultsPage;
        }

        /**
         * Since we don't have catalogsearch_result_index in Nxt extension,
         * the next line takes the catalog result layout settings from the client's theme,
         * We need it to have the current catalog layout and all fonctionalities of the sidebar(Add to wishlist, Add to compage...)
         */
        $resultsPage->addHandle("catalogsearch_result_index");
        $keywords = $this->getRequest()->getParam("q");
        $resultsPage->getConfig()->getTitle()->set($this->nsearchHelperData->getLabelSearchResultPage($storeId)." ".$keywords);

        return $resultsPage;
    }

}


texts: Magento 2: The style.css inside Magento installation directory is effecting cache

texts:
I am very new to Magento. Recently I have to add extra styles to my magento website. So I go to adminpanel -> content-> design->configuration->my theme ->HTML Head

I add the following line

<link rel="stylesheet" type="text/css" media="all" href="https://example.com/my-style/style.css" />

Then I save that one. Now new styles are working on my website. But I edited some of the styles through opening the file through Filezilla and edit. After that, I uploaded. Then I noticed that new changes are not coming. So I open https://example.com/my-style/style.css in a browser so I can see that it is not updated the copy. I refresh the page and I open in incognito window. Still the same. But when I open in the same file through editor using FileZilla I can see that it is updated copy.

Then I try to refresh page cache, layout cache but the result is the same.

  i am using FileZilla for accessing the file . i don't have the
  terminal . Please help


texts:
I am using this code to display the languages that are active on my magento installation:

<?php foreach ($this->getStores() as $_lang){ ?>
  <a href="<?php echo $_lang->getCurrentUrl() ?>">

        <?php echo $this->escapeHtml($_lang->getName()) ?>

<?php } ?>

How do I get the country codes to display? I have tried getId(), but that only gives me a number.


texts: How to save data from Magento 2 Backend(Admin)?

texts:
I have a custom table in which i have some data for that data there are some text and select box field.
I want to save these data in database custom table.

I want to save the data like order id and action which has pending and complete in select box.
How to save these data any help is appriciated.


texts: Custom table data not shown in tempalte file Magento 2

texts:
\app\code\Packt\welcome\Block\Post.php

namespace Packt\welcome\Block;
class Post extends \Magento\Framework\View\Element\Template
{
    protected $_postFactory;
        protected  $postdata;

        public function __construct(\Magento\Framework\View\Element\Template\Context $context,
                \Packt\welcome\model\postFactory $postFactory, array $data = array()){
        $this->_postFactory = $postFactory;
        parent::__construct($context,$data);
    }
        public function _prepareLayout()
    {
        $post = $this->_postFactory->create();
        $collection = $post->getCollection();

        foreach($collection as $item){
            $postlist[]=array("data"=> $item->getData());

        }

                //print_r($postlist);

               return $postlist;
    }
}

  Here print_r shows the data.

Layout :\app\code\Packt\welcome\view\frontend\layout\welcome_index_postdisplay.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">
    <body>
        <referenceContainer name="content">
            <block class="Packt\welcome\Block\Post" name="welcome" template="post.phtml" />
        </referenceContainer>
    </body>
</page>

  \app\code\Packt\welcome\view\frontend\templates\post.phtml

<?php var_dump($block->_prepareLayout());?>

But when I call the function from template file it shows nothing.


texts: How to remove Magento2 sample data without uninstall

texts:
Is there a way to remove sample data in Magento2 without uninstalling/re-installing Magento?

I want this because I changed settings in my backend that I don't want to be removed.


texts: How to switch from Zen-Cart to Magento 1.9

texts:
My website when you type the domain sends you to the current Zen-Cart shopping cart.  I have populated my Magento cart with my products and I'm now ready to make my new Magento shopping cart the main cart when people go to the website.  Right now the Magento is a folder off the public folder that you have to type in the /magento/ after the domain for example, "www.MY_DOMAIN.com/magento/".  I want to now have the Magento cart show up when customers type just our website for example, "www.MY_DOMAIN.com".  I know that I can just do a URL permanent forward but I would like it so when you see the address box it no longer has the forward slash magento.

www.MY_DOMAIN.com (this is current a Zen-Cart shopping cart)
www.MY_DOMAIN.com/magento/ (this is where my Magento shopping cart is)


texts: Where is Magento SUPEE-7405 Patch for ver. 1.9.0.1?

texts:
Magento SUPEE-7405 Patch files:
https://github.com/magecomp/Magento-Pre-Patched-Files/tree/master/SUPEE-7405

Patch files available for these versions:

CE-1.8.1.0
CE-1.9.1.1
CE-1.9.2.1
CE-1.9.2.2

My Magento ver. is: 1.9.0.1

Which patch files should I apply?


texts: Magento REST API: What populates the api2_acl_attribute Table?

texts:
I'm trying to run through the oAuth/REST examples on the Magento website and I'm hitting a snag.

I've successfully created a consumer key and a consumer secret, and used these to fetch an authentication token.  However, my API request

$resourceUrl = "$apiUrl/products";
$productData = json_encode(array(
    'type_id'           => 'simple',
    'attribute_set_id'  => 4,
    'sku'               => 'simple' . uniqid(),
    'weight'            => 1,
    'status'            => 1,
    'visibility'        => 4,
    'name'              => 'Simple Product',
    'description'       => 'Simple Description',
    'short_description' => 'Simple Short Description',
    'price'             => 99.95,
    'tax_class_id'      => 0,
));
$headers = array('Content-Type' => 'application/json');
$oauthClient->fetch($resourceUrl, $productData, OAUTH_HTTP_METHOD_POST, $headers);

Keeps returning the following error

  Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)
  {"messages":{"error":[{"code":400,"message":"The request data is invalid."}]}}

I've traced the failure to the following point.

#File: app/code/core/Mage/Api2/Model/Resource.php
if ($this->getRequest()->isAssocArrayInRequestBody()) {
    $this->_errorIfMethodNotExist('_create');
    $filteredData = $this->getFilter()->in($requestData);
    if (empty($filteredData)) {
        $this->_critical(self::RESOURCE_REQUEST_DATA_INVALID);
    }
    $newItemLocation = $this->_create($filteredData);
    $this->getResponse()->setHeader('Location', $newItemLocation);
}

Specifically, $filteredData is coming back as an empty array.  This triggers the _critical method code branch, which results in my seeing the error.

When I dive deeper, it looks like Magento pulls the allowed attributes with the following code

#File: app/code/core/Mage/Api2/Model/Resource/Acl/Filter/Attribute.php
public function getAllowedAttributes($userType, $resourceId, $operation)
{
    $select = $this->_getReadAdapter()->select()
        ->from($this->getMainTable(), 'allowed_attributes')
        ->where('user_type = ?', $userType)
        ->where('resource_id = ?', $resourceId)
        ->where('operation = ?', $operation);
    Mage::Log((string) $select);
    return $this->getReadConnection()->fetchOne($select);
}

In plain SQL, that's

SELECT `api2_acl_attribute`.`allowed_attributes`
FROM `api2_acl_attribute`
WHERE (user_type = 'admin')
    AND (resource_id = 'product') AND (operation = 'write');

When I look at my api2_acl_attribute table, it's empty

What's supposed to populate this table with data?  Possibly higher level,  what key bit of setup/usage/received-wisdom have I missed?


texts: Magento 2 Commerce cloud : How to monitor/confirm that the results are served from elastic search?

texts:
We are using elastic search in our store but I am not convinced that all the results are served from elastic search. Is there a tool/feature where we can monitor activity in elastic search server just like MONITOR on redis-cli, or access logs on apache?

We are using the Magento commerce cloud, but I would be open to tools not provided in commerce cloud stack as well to monitor things at least on dev machines.

EDIT :

I apologise if it wasn't clear from my examples but I want real time monitoring of requests served from elastic search to confirm that the search results are served from elastic search in my store.


texts: Magento contact us custom transactional email: Customer received plain html codes

texts:
I have created a custom transactional email for contact us and applied this on the admin contact. The emails are successfully received on our test email. However, the email contains all the html codes. I have tried my best to solved this but I can't do it. I also tries to research for similar problem but no luck. I am using magento 1.9.1.0 version.

this is my transactional email code

<!doctype html >

<meta http-equiv="Content-Type"  content="text/html; charset=UTF-8" />
<title>Hey</tile>

Name:

{{var data.name}}

this is what we received in the email

<!doctype html >

<meta http-equiv="Content-Type"  content="text/html; charset=UTF-8" />
<title>Hey</tile>

Name:

Simon

How do I solve this issue? Is there any settings on the admin that I did not enabled?

I hope you can help me.

Thanks


texts: How can I load a custom attribute and display it as the default value in an input box?

texts:
Specifically, I have a custom attribute called minqty and I'd like to amend the frontend/mypackage/mytheme/template/catalog/product/view/addtocart.phtml file to load this custom attribute and, if it has been set, display it in the Qty input box instead of the 1 that is currently displayed.

Here's the unedited version of the addtocart.phtml line that needs amending:

<input type="text" pattern="\d*" name="qty" id="qty" maxlength="12" value="<?php echo max($this->getProductDefaultQty() * 1, 1) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" />

Thanks for any help you can provide.

nB This is for a configurable product so there is no "Minimum Qty Allowed in Shopping Cart" system attribute on the admin inventory tab.


texts: Magento URL Rewrite - Extract match string and redirect to new path

texts:
I have URL For example
mydomainname/dir1/dir2/dir3/dir4/abc.jpg
I want to redirect dynamically to all matching URL
mydomainname/dir4/abc.jpg    //Want extract some part and redirect to reaming part of URL
Basic I want to extract some part of URL and redirect to remains part of URL. This should be dynamically.
Thank You


texts: Magento 2: What are Generated Logger Classes For?

texts:
In Magento 2, If I have a class named, say

Pulsestorm\Nofrillslayout\Model\Test

and I attempt to inject a non-existant class named

public function __construct(Pulsestorm\Nofrillslayout\Model\Test\Logger $logger)
{
}

Magento will automatically generate a a logger class for me

#File: var/generation/Pulsestorm/Nofrillslayout/Model/Test/Logger.php
<?php
namespace Pulsestorm\Nofrillslayout\Model\Test;

/**
 * Logger class for @see \Pulsestorm\Nofrillslayout\Model\Test
 */
class Logger extends \Pulsestorm\Nofrillslayout\Model\Test
{
    /**
     * Object Manager factory log
     *
     * @var \Magento\Framework\ObjectManager\Factory\Log
     */
    protected $log = null;

    /**
     * Object Manager instance
     *
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $subject = null;

    public function __construct($subject, $log)
    {
        $this->log = $log;
        $this->subject = $subject;
    }

    /**
     * Invoke method
     *
     * @param string $methodName
     * @param array $methodArguments
     * @return mixed
     */
    protected function _invoke($methodName, array &$methodArguments)
    {
        $this->log->invoked($this->subject, $methodName);
        $result = call_user_func_array(array($this->subject, $methodName), $methodArguments);
        if ($result === $this->subject) {
            return $this;
        }
        return $result;
    }

    /**
     * Clone subject instance
     */
    public function __clone()
    {
        $this->subject = clone $this->subject;
        $this->log->add($this->subject);
    }

    public function __sleep()
    {
        return array('subject');
    }

    public function __wakeUp()
    {
        $this->log = \Magento\Framework\ObjectManager\Profiler\Log::getInstance();
        $this->log->add($this->subject);
    }
}

However, Magento will also give me the following error.

Does anyone know what these generator logger classes are for and how to use them?


texts: Excl & Incl. Tax Displaying same when customer is logged in

texts:
I've noticed that my website is displaying both Exclude Tax and Include Tax same when log in. When I'm logged out, it is displaying calculations fine.

Any idea why it might be displaying like that?


texts: Magento FPC with Redis - Header not punched out

texts:
Redis: 2.8.19

I have punched a hole in the header and FPC is enabled. Everything works great with file based cache. However as soon as I switch to Redis as cache backend, the header on cart and account pages are cached (not changing based on user). The content updates but not the header.
The site is not open i.e. only logged in customers can access the site.

cache.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <placeholders>
        <header_cache>
            <block>page/html_header</block>
            <name>header</name>
            <placeholder>MODULENAME_HEADER</placeholder>
            <container>Company_Module_Model_Container_Header</container>
            <cache_lifetime>0</cache_lifetime>
        </header_cache>
    </placeholders>
</config>

Company/Module/Model/Container/Header.php

<?php
class Company_Module_Model_Container_Header extends Enterprise_PageCache_Model_Container_Abstract
{
    protected function _getIdentifier()
    {
        $cacheId = $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '')
            . '_'
            . $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER_LOGGED_IN, '');
        return $cacheId;
    }

    /**
     * Get cache identifier
     *
     * @return string
     */
    protected function _getCacheId()
    {
        return 'CONTAINER_HEADER_' . md5($this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier());
    }

    /**
     * Render block content
     *
     * @return string
     */
    protected function _renderBlock()
    {
        $layout = $this->_getLayout('default');
        $block = $layout->getBlock('header');
        $block->setSkipRenderTag(true);
        return $block->toHtml();

    }

    protected function _saveCache($data, $id, $tags = array(), $lifetime = null) { return false; }

}

It's very strange that everything works fine on file based caching.
With Redis, all pages (category, product view, cms pages) punch the hole just fine. It's just the cart and account pages.
Can anyone please help me or point me in the right direction?


texts: Magento 2 : create view table via setup script

texts:
How do you create a view table via setup script

Direct sql CREATE OR REPLACE VIEW... etc

Or is there a magento way?

Update

Thanks for your suggestions so far.  I'm asking whether possible to create a view table.

To clarify I know how to create a standard table.

Magento 2.2 (EOL) syntax would be as follows

<?php

namespace Vendor\Example\Setup;

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

class InstallSchema implements InstallSchemaInterface
{

    /**
     * {@inheritdoc}
     */
    public function install(
        SchemaSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $table_vendor_example_example = $setup->getConnection()->newTable($setup->getTable('vendor_example_example'));

        $table_vendor_example_example->addColumn(
            'example_id',
            \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            null,
            ['identity' => true,'nullable' => false,'primary' => true,'unsigned' => true,],
            'Entity ID'
        );

        $table_vendor_example_example->addColumn(
            'title',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            [],
            'Title'
        );

        $table_vendor_example_example->addColumn(
            'content',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            null,
            [],
            'content'
        );

        $table_vendor_example_example->addColumn(
            'status',
            \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
            null,
            [],
            'Status'
        );

        $setup->getConnection()->createTable($table_vendor_example_example);
    }
}

2.3 syntax would look a little like this

etc/db_schema.xml

<?xml version="1.0" ?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table comment="vendor_example_example Table" engine="innodb" name="vendor_example_example" resource="default">
        <column comment="Entity Id" identity="true" name="example_id" nullable="false" padding="6" unsigned="false" xsi:type="smallint"/>
        <constraint referenceId="PRIMARY" xsi:type="primary">
            <column name="example_id" comment="ID"/>
        </constraint>
        <column length="255" name="title" nullable="true" xsi:type="varchar" comment="Title"/>
        <column name="content" nullable="true" xsi:type="text" comment="Content"/>
        <column name="status" nullable="true" xsi:type="smallint" comment="Status"/>
    </table>
</schema>

I'm asking how to create a view table. Or more accurately a database view.

View tables are used as part of Magento 2.3 MSI - see inventory_stock_1


texts: Will EV SSL work with Subdirectory storefronts?

texts:
I want to have:

myname.com
myname.com/fr/
myname.com/en/
myname.com/fr/checkout/onepage/
myname.com/en/checkout/onepage/

The reason I want to run Magento with sub-directories is so that English speaking customers see the store and checkout cart in their language, and the French speaking customers see the store and checkout in their language.

Will this cause any issues with an EV SSL?


texts:
I need to translate magento 2 admin panel to Persian language.

Can anyone suggest to me the best ways to achieve this?

I suppose I need to download some language pack and then install it.

Or I just could export all the admin phrases and translate them manually and then install translated phrases.

If somebody could explain to me both ways I would be very thankful.


texts: Can I collect product data with a community extension

texts:
I am developing a community extension in which the client would like to gather and collect the store's product data.

To be specific, the extension is for a service the user is paying for. The extension allows them to connect to the service with their Magento site easier. The developer of the extension would like to collect the store's product data and retrieve it, sending it back to their servers to improve the Magento user's service.

My question is whether or not there are any restrictions on this behavior from an extension? Should the user simply be prompted to agree to share the data? There is no customer data involved, only products.


texts:
I want to set up multiple magento websites with multiple currencies

website A with currency INR
website B with currecny USD

Products in each website should have prices which are not dependent on the other website.

website A - product A - INR 100
website B - product A - USD 15

I have changed the currency scope to website but while adding the product the default currency in still being shown as INR.

Can some one please tell me how this can be done in magento 1.9


texts: How do I redefine a search query? Magento 2

texts:
I am trying to override the search query when loading the search results page. For example: the user enters "Gren Aple", and my script fixes syntax/spelling errors and loads the page with the result of "Green Apple".
I will be glad to any help.


texts:
I have a custom router that I'd like to be used for matching before the Standard router. I'm having issues trying to figure out how to change the order in which the routers are added and used for matching requests subsequently.

It looks like the Admin and Standard routers are defined in Mage_Core's config.xml and loaded in Mage_Core_Controller_Varien_Front::init with following line.

$routersInfo = Mage::app()->getStore()->getConfig(self::XML_STORE_ROUTERS_PATH);

However, I've tried to add my custom router's definition in Mage_Core's config.xml before any of the default routers to test, but it still gets added at the end. I've tried changing the order in which Admin and Standard routers are defined in config.xml, and that doesn't take effect. I clear cache, and I'm not sure why.

I wan to do this without rewriting Mage_Core_Controller_Varien_Router_Standard (app/code/local/Mage/Core/...), if possible. Any ideas?


texts:
When building Magento, a lot seems to fail when expected to work. One computer may succeed in building, while another throws a few errors. This may be because of the difference in PHP, but the ones I have tested had some very similar setups (Ubuntu 16.04, PHP 7.2, same SQL version, all set up by me with the same processes)

Now when developing all my compilations succeed. But when pushing the composer file run the building steps on another PC, e.g. Pull > setup:upgrade > setup:di:compile.. the compilation often fails.

Most of these are pretty easily fixed and (maybe) a result of my project setup with modules. However, others are hard to debug as far as I can see.

Currently, I am getting the error cited below. (note the required type array, actual type array)

I am not sure how to proceed. Removing vendor directories or cleaning cache does not help. Where can I start debugging (as this seems to be a core-Magento error and the error does not tell me anything)? I am running a very similar project that has almost all the same dependencies which does compile.

09:43:57-hades@Hades:~/Workspace/magento$ php7.2 bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 6/7 [========================>---]  85% 43 secs 488.0 MiBErrors during compilation:
        Magento\AsynchronousOperations\Ui\Component\Operation\DataProvider
                Incompatible argument type: Required type: array. Actual type: array; File:
vendor/magento/module-asynchronous-operations/Ui/Component/Operation/DataProvider.php

Total Errors Count: 1


texts: How to get total paid value of the cart in magento 2

texts: I am trying to build up an extension that affiliates with the customer's final paid total and divide the value by 100, in order to give a customer a 1% point.


texts: Chekout Page Redirect to checkout/noroute/

texts:
I installed one page checkout in magneto 2.3.2 When i try to go in onepage checkout it give me 404 Not Found.

You can check this link what i actually face.

https://www.screencast.com/t/Osd2FSFcm


texts:
I want to force login on category page i have use below reference
Ref: https://magento.stackexchange.com/a/188208/68695

Above reference link good work for product detail page but not category page.


texts: Quick Change and Edit Stock QTY simple product

texts: is there any methods to change easily and directly all simple products of a configure product? without having to open and edit one by one inventory on simple product. But edit directly on manage product QTY column.... is it possible? pic attached.


texts: Magento 2: How to disable caching for the header block?

texts:
I just go through other similar questions but they didn't help much. As per suggested in some answers to put the cacheable="false" in block will disable it.

But it will disable whole page caching as per this documentation and here if that block is exist in any page.

I have an issue that after customer login in system, in header still showing the login link and showing wrong user name due to caching.

Is there any way I can exclude the header block from caching?


texts:
I'm extending the blank theme and adding styles to an _extend.less file located in

/app/design/frontend/neil/mytheme/web/css/source/_extend.less

Inside the file iv've got the following code

// common & mobile styles
& when (@media-common = true) {
    .header.panel > .header.links > li {
        margin: 0;
        a {
            color: @dark-grey;
            display: inline-block;
            font-size: 13px;
            padding: 0 5px;
        }
        &:hover > a {
            color: @primary__color;
        }
    }
}

// Should be everything above the screen_m breakpoint (768px) - but still doesn't work
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .header.panel > .header.links > li {
        margin: 133px !important;
    }
}

My problem is that my desktop styles aren't being applied, I've tried a whole load of ways of getting this to work but nothing is working.

I tried wrapping them in a normal media query like this...

// desktop
@media all and (min-device-width : 768px) {
    .header.panel > .header.links > li {
        margin: 133px;
    }
}

Which loaded the styles in, but it was getting overridden by a style defined in...

/app/design/frontend/neil/mytheme/Magento_Theme/web/css/source/_module.less

Could somebody please point me in the right direction with this because I feel like I'm going round in circles.


texts: How to alter the customer checkout/login popup or process in Magento 2.4.1?

texts:
I am needing to alter the way the checkout process works on a Magento 2 site because the site offers quotes only and therefore I do not want any mention of the term "Checkout" in the traditional sense. So basically I am trying to either alter what is displayed in the default checkout popup (screenshot below) or show different content altogether.

I have been searching for a module/extension to achieve the results I am looking for but I have found nothing.
It has also been suggested that I remove everything within the click function in the login-popup.js (see code below) and add this:
window.location.href = '/customer/account/login'
Can anyone explain exactly what and where I need to replace this in the code below?
define(
[
'jquery',
'Magento_Customer/js/model/authentication-popup',
'mage/url',
'mage/cookies'
],
function ($, authenticationPopup, url) {
'use strict';

return function (config, element) {
$(element).click(function (event) {
var date = new Date();
date.setTime(date.getTime() + 420000);
event.preventDefault();
$.cookie('login_redirect', url.build('quotation/quote'), {expires: date});
authenticationPopup.showModal();
return false;
});
};
}
);

Any other ideas or direction on how to change the content of the default popup would be greatly appreciated also.
I hope this makes sense.
Thank you,
Rob


texts: Issue in fedex maximum supported weight is 150 by default

texts:
i know maximum supported weight is 150 pound by default in magento.

when i am adding same product (weight 50 pound) four times (Now weight 200 pound). Fedex ground should not have appear in frontend (in checkout page)  but fedex ground method is appearing though weight is 200pound now.
What happen to "maximum supported weight" in this case ?
When i am adding product (weight 151 pound), fedex method is not appearing. It is working well in this case as maximum supported weight is 150 pound.
It is also working well if i add product (weight 149 pound), in this case Fedex is appearing.

------------**************--------------

I only want to know what happen to maximum supported weight in case 1.

If anyone know the exact reason, please sort out my problem.
Thanks in advance.


texts: Magento 2 How to get data from input fields with modal widget button

texts:
I want to get data from <input> and <textarea> fields and redirect to other URL controller but I'm stucking in writing logic for it
Here is my phtml file
Custom popup

            Name:
            <input type="text" name="name" id="name1">

            Content Invoice:
            <textarea name="content"></textarea>

and my js file in frontend/web folder
require(
    [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function(
        $,
        modal
    ) {
        var options = {
            type: 'popup',
            responsive: true,
            innerScroll: true,
            buttons: [{
                text: $.mage.__('Submit'),
                click: function () {
                    // get input data here and redirect to another page
                }
            },
            {
                text: $.mage.__('Close'),
                class: 'mymodal1',
                click: function () {
                    this.closeModal();
                }
            }
            ]
        };

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


texts:
I am trying to upload my extension to Marketplace. I'm using Magento 2.2 as a platform for my extension. However, whenever I upload my extension this error appears in my Test Report

Each class must be in a namespace of at least one level (a top-level vendor name)

Also, the next error is showing up in the Test Reports:

Direct use of $GLOBALS Superglobal detected.

A screenshot is shown below.

What thrills me the most is this error is only showing off for these two versions of PHP, also this kind of error seems to for the code generated not for the code I'm uploading itself.


texts:
I want to get product id from value id in configurable product detail page. I get product id easily from catalog_product_entity table but it gives me main configurable product id. But I want to know each associated product id from each associated product value_id. Currently I know that value id is coming from

catalog_product_entity_media_gallery

Media.phtml

        <?php foreach ($this->getGalleryImages() as $_image): ?>
            <?php //Skip, if no image
                if ($_image->getFile() == NULL)
                    continue; ?>

                <a href="<?php echo $zoomHelper->createImgUrl($this, $_product, $bigImageWidth, $bigImageHeight, 'image', $_image->getFile()); ?>" class="cloud-zoom-gallery lightbox-group" title="<?php echo $this->htmlEscape($_image->getLabel()); ?>"
                    rel="useZoom:'zoom1', smallImage: '<?php echo $zoomHelper->createImgUrl($this, $_product, $imgWidth, $imgHeight, 'image', $_image->getFile()); ?>'" <?php echo isset($cjm_colorselector_base[$_image->getId()])?'id="option_'.$cjm_colorselector_base[$_image->getId()].'"':''?>>

                    <img src="<?php echo $zoomHelper->createImgUrl($this, $_product, $thumbImgWidth, $thumbImgHeight, 'thumbnail', $_image->getFile()); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()); ?>"/>

            <?php endforeach; ?>

here $_image object i get value id and i am using cloud zoom extension.
Any help Will be appreciated. Thank you


texts:
I am trying to create a custom connection to my database through Magento 2.1.8.

I am trying to use the mysqli library.

The method I am using worked in Magento 1.9 but will not work in my current version.

$conn = new mysqli($servername, $username, $password, $database);

When i use this code, i am receiving an error:

  Uncaught Error: Class 'VendorName\Forum\Controller\Post\mysqli' not
  found in
  /domains/mywebsite.com/http/app/code/VendorName/Forum/Controller/Post/postMessage.php:28

How do i import the mysqli class to create this object?

Thanks.


texts: Magento 2 : Call to a member function getCustomerIsGuest() on null error

texts:
Call to a member function getCustomerIsGuest() on null at
/vendor/GuestStoreCredit/Model/Balance.php

   protected function _ensureCustomer()
    {
        try {
            if ($this->state->getAreaCode() != \Magento\Framework\App\Area::AREA_FRONTEND && $this->helper->canConvertGuest()) {
                if ($this->getOrder()->getCustomerIsGuest()) {
                    $customer = $this->helper->createNewCustomerFromOrder($this->getOrder());
                    if ($customer) {
                        $this->setCustomer($this->_customerFactory->create()->load($customer->getId()));
                        $this->helper->sendStoreCreditEmail($customer);
                    } elseif ($this->getOrder()) {
                        $websiteId = $this->_storeManager->getStore()->getWebsiteId();
                        $customer  = $this->_customerFactory->create();
                        $customer->setWebsiteId($websiteId);
                        $customer->loadByEmail($this->getOrder()->getBillingAddress()->getEmail())->getId();
                        if ($customer->getId()) {
                            $this->setCustomer($this->_customerFactory->create()->load($customer->getId()));
                        }
                    }
                }
            }
        } catch (\Exception $e) {
            throw new Exception("Error creating new customer for store credit.");
        }
        if ($this->getCustomer() && $this->getCustomer()->getId()) {
            $this->setCustomerId($this->getCustomer()->getId());
        }
        if (!$this->getCustomerId()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('Please specify a customer ID.'));
        }
        if (!$this->getCustomer()) {
            $this->setCustomer($this->_customerFactory->create()->load($this->getCustomerId()));
        }
        if (!$this->getCustomer()->getId()) {
            throw new \Magento\Framework\Exception\LocalizedException(
                __('Please specify a valid customer.')
            );
        }
    }

Any thoughts how to solve this error ?


texts: How to know which translation csv file(s) are used in the current phtml file

texts: Is there a method to know which translation CSV file(s) are used in the current phtml template file?


texts: Configurable not adding to cart in magento2.1.9

texts:
I am trying to add configurable product programatically in cart i can add simple product to cart but while adding configurable product it showing "you must select product option to add cart" error in console here is my controller file

<?php
    namespace Multiple\Addtocart\Controller\Index;
    use Magento\Framework\Controller\ResultFactory;
    use Magento\Framework\App\Action\Action;
    use Magento\Framework\App\Action\Context;
    use Magento\Framework\View\Result\PageFactory;
    use Magento\Checkout\Model\Sidebar;
    use Magento\Checkout\Model\Cart as CustomerCart;
class Upsell extends \Magento\Framework\App\Action\Action
{
    protected $resultPageFactory;
    protected $checkoutSession;
    protected $formKey;
    protected $request;
    protected $cart;
    protected $sidebar;

  public function __construct(
    Context $context,
    \Magento\Framework\Data\Form\FormKey $formKey,
    \Magento\Checkout\Model\Session $checkoutSession,
     CustomerCart $cart,
      Sidebar $sidebar,
    PageFactory $resultPageFactory,
    array $data = [])
    {
        $this->formKey = $formKey;
        $this->resultPageFactory = $resultPageFactory;
         $this->checkoutSession = $checkoutSession;
        $this->cart = $cart;
        $this->sidebar = $sidebar;
        parent::__construct($context);
    }

  public function execute()
  {

      $pid=$_POST['id'];
      $type=$_POST['type'];
      $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
      if($type=="configurable")
      {
          $size=$_POST['size'];
          $color=$_POST['color'];
          $colorid=$_POST['coloropt'];
          $sizeid=$_POST['sizeopt'];
      $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($pid);
      $resultPage = $this->resultPageFactory->create();
      $options = array(
               // $colorid =>$color,
                //$sizeid => $size
                356 => 5,
                357 => 29
            );
      $params = array(
                    'form_key' => $this->formKey->getFormKey(),
                    'product' =>$pid, //product Id
                    'super_attribute' => $options,
                    'qty'   =>1 //quantity of product
                    );
                  $this->cart->addProduct($_product, $params);
                  $this->cart->save();
      }
      if($type=="simple")
      {
      $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($pid);
      $resultPage = $this->resultPageFactory->create();
      $params = array(
                    'form_key' => $this->formKey->getFormKey(),
                    'product' =>$pid, //product Id
                    'qty'   =>1, //quantity of product
                    'price' => $_product->getPrice()
                    );
                  $this->cart->addProduct($_product, $params);
                  $this->cart->save();
      }
     $this->messageManager->addSuccess(__('Item has been successfully added to cart.'));
    echo "success";

  }
}


texts:
Magento 2.3.2 Single color variation auto selected on product list page, i have added this code in swatch-render.js after container append but it is selecting on all products instead of selecting only visible products so if you have 500 to 600 products in this category then it will trigger this action 500 or 600 products instead of 18 which are currently visible.
$('.product-items .product-item:visible').each(function () {
                    // console.log("item count ",$('.product-items .product-item:visible').length);
                        var index = $(this).index();
                        var itemcount=$(this).length;
                        var text = $(this).find('.swatch-attribute.color').find('.swatch-attribute-options').children().length;
                        //console.log(text);
                        if(text==2) {
                            console.log(text);
                            $(this).find(".swatch-option.color").trigger("click");
                        }
                    });


texts:
I have a page in which I want to add a block.  The block is located in design/frontend/default/<theme>/template/<folder>/test.phtml and at the moment contains nothing more than a simple <?php echo "Test"; ?> statement.

In my page Content in the Magento admin I have the following:

{{block type=”core/template” template=”<folder>/test.phtml”}}

But the block doesn't seem to be getting loaded.  Even when I put a die("test") in the block file I don't see the test string getting printed anywhere.

I'm sure I'm missing something simple...


texts: How can I override the Vendor with Custom module in magento 2

texts:
How can i override this path:
vendor/magento/framework/View/Element/Html/Select.php

with my custom module file?


texts:
We currently are setting up several stores, one of the stores needs to use the metric system and one needs to use the English system for weights...

Where can I specify Metric for one and English for the other?


texts: Adding Mobile Field on Customer create api in Magento2.1.12

texts:
I want to add telephone field in customer create API in MAGENTO 2.1.12.Please tell me.

I created customer using api,passing this information:

  { "customer": { "email": "jdoe@example.com", "firstname": "Jane",
  "lastname": "Doe", "addresses": [{ "defaultShipping": true,
  "defaultBilling": true, "firstname": "Jane", "lastname": "Doe",
  "region": { "regionCode": "NY", "region": "New York", "regionId":43 },
  "postcode": "10755", "street": ["123 Oak Ave"], "city": "Purchase",
  "telephone": "512-555-1111", "countryId": "US" }] }, "password":
  "Password1" }


texts: How to remove comment from sales order in magento1.9.3.6

texts:
I want to remove Comment from sales order in magento admin panel.This is comment saved after payment successful/declined etc from Authorize.Net .i don't want to save this messages into the order comment.

Thank you


texts: How to use nested array in email template

texts:
I have a nested array that I am passing as templateVar.

setTemplateVars(['details' => $arr])

The array($arr) is

[0] => [
        ["key1"]=>value1
        ["key2]=>value2
]
[1]=>[
        ["key1"]=>value1
        ["key2]=>value2
]
.
.
.
All arrays have same keys.

I have tried both updates mentioned in How to show array in email template file?

In the template file, I'm trying to use it as -

<?php foreach($details as $detail) : ?>
           <p>{{trans ' %val' val=$detail.key1}}</p>
  <?php endforeach; ?>

I cannot pass it as a string as the array can be an array of 100s of arrays with same keys.


texts: how to create order programmatically without applying price rules

texts:
How to skip applying price rules while creating an order programmatically?

Code looks like this (shortened)

/** @var $quote Mage_Sales_Model_Quote */
$quote = Mage::getModel('sales/quote')
         ->setStoreId(Mage::app()->getStore('default')->getId());
$quote->assignCustomer($customer);
$quote->addProduct($product, new Varien_Object(['qty' => 1]));
$quote->getBillingAddress()->addData([..]);
$quote->getShippingAddress()->addData([..]);
$shippingAddress->setCollectShippingRates(true)
            ->collectShippingRates()
            ->setShippingMethod('my_own_shipping_module')
            ->setPaymentMethod('payment_method');

$quote->getPayment()->importData(array('method' => 'payment_method'));

$quote->collectTotals()->save();

Skipping collectTotals() didn't help.


texts: Is magento compatible for GDPR compliance

texts:
I want to know is magento compatible for GDPR compliance because from May 25, 2018 GDPR Act is applied in all EU countries.

What should we need to do to run our magento e-commerce site under this rule.


texts: Which file is responsible for off the canvas menu in mobile view in rwd theme?

texts: Where does off the canvas menu comes from in Magento 1.9.2? Which file is responsible for it? How can I make off the canvas menu default in desktop view?


texts: Google fonts issue as per new URL format

texts:
I have added google font in default_head_blocks.xml file like this:

<link rel="stylesheet" type="text/css" src="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" src_type="url" />

And I am facing an error as per below screenshot:

Kindly help me to resolve this error.


texts: Layout and admin don't work after first install in local VM

texts:
I've created an Ubuntu 16.04 VM in Virtualbox with MySQL, Apache 2.4 and PHP 7.0, everything default. Then I installed Magento 2.0 via de CLI, using this Linode manual. At the end of the script, it gave an admin URL, which didn't work. If I open the homepage, I see text, but CSS and pictures are not loaded. Access and error log don't show anything.

I reverted to a previous snapshot, before installing Magento, and reinstalled it. Nothing changed. I tried this in a Centos 7 VM, same story.

Is there a way to repair this?


texts:
I've tried to rewrite a Helper class from a theme we are useing with the following in our modules config.xml

<global>
    <helpers>
        <util>
            <class>Hoi_Util_Helper</class>
        </util>
        <themeoptionsblacknwhite>
            <rewrite>
                <data>Hoi_Util_Helper_ThemeOptionsBlacknwhite_Data</data>
            </rewrite>
        </themeoptionsblacknwhite>
    </helpers>
</global>

I've then created the new helper class which includes our override getProductLabels() function:
app/code/local/Hoi/Util/Helper/ThemeOptionsBlacknwhite/Data.php

<?php
class Hoi_Util_Helper_ThemeOptionsBlacknwhite_Data extends Meigee_ThemeOptionsBlacknwhite_Helper_Data
{
    public function getProductLabels ($_product, $type) {
        switch ($type) {
            case 'new':
                if (Mage::getStoreConfig('meigee_blacknwhite_general/productlabels/labelnew')):
                    if (Mage::getStoreConfig('meigee_blacknwhite_general/productlabels/labelnew')):
                        $from = new Zend_Date($_product->getNewsFromDate());
                        $to = new Zend_Date($_product->getNewsToDate());
                        $now = new Zend_Date(Mage::getModel('core/date')->timestamp(time()));
                        if ($from->isEarlier($now) && $to->isLater($now)):
                            return ''.$this->__('New').'';
                        else:
                            return false;
                        endif;
                    else:
                        return false;
                    endif;
                else:
                    return false;
                endif;
                break;
            case 'sale':
                if(Mage::getStoreConfig('meigee_blacknwhite_general/productlabels/labelonsale')):
                    exit;
                    $_finalPrice = MAGE::helper('tax')->getPrice($_product, $_product->getFinalPrice());
                    $_regularPrice = MAGE::helper('tax')->getPrice($_product, $_product->getPrice());
                    if ($_regularPrice != $_finalPrice):
                        if (Mage::getStoreConfig('meigee_blacknwhite_general/productlabels/salepercentage')):
                            $getpercentage = number_format($_finalPrice / $_regularPrice * 100, 2);
                            $finalpercentage = 100 - $getpercentage;
                            return '
'.number_format($finalpercentage, 0).'% '.$this->__('off').'
';
                        else:
                            return '
'.$this->__('Sale').'
';
                        endif;
                    else:
                        return false;
                    endif;
                else:
                    return false;
                endif;
                break;
        }

    }
}

But still Magento is using the origional helper class when it is called with:

<?php echo MAGE::helper('ThemeOptionsBlacknwhite')->getProductLabels($_product, 'sale'); ?>

I have also made sure that our Module is depending on the Meigee_ThemeOptionsBlacknwhite module.

<?xml version="1.0"?>
<config>
    <modules>
        <Hoi_Util>
            <active>true</active>
            <codePool>local</codePool>
            <version>0.1.0</version>
            <depends>
                <Meigee_ThemeOptionsBlacknwhite/>
            </depends>
        </Hoi_Util>
    </modules>
</config>


texts: How to automatically add a comment on order when is placed

texts:
I have the following situation:

I am on the checkout page, and i have 3 Shipping methods.
If i select a specific method form all 3 and i finish the order, i want a comment to be added automatically on the orders view from backend in this area:

Does anyone have any idea how can i do this?


texts: How to display catagories in cms page magento 2.2

texts: How to display all catagories in  grid format in cms page magento 2.2 ?


texts: I have put my theme in fresh magento 1.9.2.2. And I added product at the backend. It is listed in frontend. The problem is that the details page is not displayed when I click the product link instead 404 error is diplayed. But when I open the Madison island products,the details page is available.Only the products which i add at the backend is not opening. Please help me to resolve this issue.


texts:
I am updating the cataloginventory_stock_item custom quanty values based on stock ids by using custom api.

I written a update table query in custom api module model file:

Like below:

 public function hello() {

$new_quantity='586';
$id='5949';
$stock_id='3';
$conn = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "UPDATE cataloginventory_stock_item SET qty = '{$new_quantity}' WHERE stock_id = '{$stock_id}' and product_id = $id";
$update=$conn->query($sql);
return true;
  }
}

But here in this file iam passing the values in this file only, but I want to pass the values from api file which is running from root folder.

How to pass the values from api file which is in root folder.

Root folder api file:

<?php

$soap = new SoapClient('http://127.0.0.1/magento/api/soap/?wsdl=1', array('exceptions' => 0));
$sessionId = $soap->login('test','test@123');

$result = $soap->call($sessionId, 'customapi.hello',array($myhellomsg));

?>

Thanks


texts: How to disable shipping method on checkout page Magento 2.0.7

texts:
I want to remove shipping calculation on checkout page. If i disable all shipping methods from configuration > Sales > Shipping Method, then it will not allow me to proceed to payment section. Is there a way to disable shipping calculation from checkout?

Thanks in advance.


texts: FEDEX "Customer not eligable for service"

texts:
I'm trying to implement FEDEX on my e-commerce system but in the fedex logs I get the error:

        [HighestSeverity] => ERROR
        [Notifications] => stdClass Object
            (
                [Severity] => ERROR
                [Source] => crs
                [Code] => 750
                [Message] => Customer not eligible for  service.
                [LocalizedMessage] => Customer not eligible for  service.
            )

        [Version] => stdClass Object
            (
                [ServiceId] => crs
                [Major] => 10
                [Intermediate] => 0
                [Minor] => 0
            )

This only seems to happen for certain countries so I'm pretty sure the credentials I've passed in are correct.

Under "Ship to allowed countries" it's set to "All allowed countries" and I have a valid shipping from address setup.

I've contacted FEDEX and they said it's to do with something that has been setup on Magento but I have no idea what else it could be. I'm thinking it has something to do with the shipping zones, any ideas?


texts: changing the product attributes place to top after sku

texts: how can we change the position of only two product attributes not all product attributes . i want to move it from bottom to top after sku or after price please see the screenshots attached .


texts: Is Magmi import is compatible with Magento2.2? Is it compatible with grouped and simple products import? Where I can find the Latest version of Magmi?


texts: How to Limit Total Number of Items in Cart

texts:
Been looking for something in this regard for a while, but have not been able to find a solution with a clean implementation guide. I just need to be able to limit the total number of items in the shopping cart - for example, a maximum of 7 total items, anything greater would throw an error message to the user (or something along those lines).

Any help would be much appreciated. Thank you!

P.S. - I'm a relative beginner when it comes to modifying Magento code on the back-end, so please do not be put off by what may seem to be a stupid question in response to any suggestions.


texts: Products not showing on site after reindex!

texts:
I just ran manual reindexing of some indexes on my magento site, from /ROOT/shell/ using

php indexer.php -reindex catalog_product_flat

php indexer.php -reindex catalogsearch_fulltext

php indexer.php -reindex catalog_product_attribute

Now most of my products are missing from the site! For example I'll go to a category, it will show a count of 14 items but only 4 are listed. My layered nav also will show proper counts, for example 5 items between $0-$250, but when I filter by it I only see 1 item, even though the count at the top shows 5 results.

If I go to the backend, go into an item, and then save it, it will then show up again on the site. But with 7000+ products I can't feasibly re-save each one manually. I am on a time crunch here to get this fixed asap. Any ideas?


texts: Sort by Best Seller on Category Page occur issue on Paging(Shows 1 item)

texts:
I have an issue from last three days.I make a sorting option by Best Seller on Category listing Page.

Here You See three Products but item shows 1 which occurs issue on paging.

I used aroundSetCollection for Best Seller Sorting.Here This:

public function aroundSetCollection(
    \Magento\Catalog\Block\Product\ProductList\Toolbar $subject,
    \Closure $proceed,
    $collection
) {
    $currentOrder = $subject->getCurrentOrder();
    $result = $proceed($collection);
    $collection = $subject->getCollection();

    if ($currentOrder == 'best_selling') {
        $year = date("Y-m-d H:i:s", strtotime('-1 year'));
        $now = date("Y-m-d H:i:s");
        $collection->getSelect()->joinInner(
            'sales_order_item',
            'e.entity_id = sales_order_item.product_id',
            array('total_orders' => 'SUM(sales_order_item.qty_ordered)')
            )->where(
                'sales_order_item.created_at >= ?',
                $year
            )->where(
                'sales_order_item.created_at <= ?',
                $now
            )->group('e.entity_id')
            ->order('total_orders '.$subject->getCurrentDirection());
    }
    return $result;
}

And di.xml :

<type name="Magento\Catalog\Model\Config">
        <plugin name="add_bestselling_option" type="NameSpace\ModuleName\Plugin\Model\Config" />
    </type>
    <type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
        <plugin name="set_bestselling_collection" type="NameSpace\ModuleName\Plugin\Product\ProductList\Toolbar" />
    </type>

Please help me i am stuck here from last three days.


texts: Upgrade schema not running in one environment

texts:
This is a really odd one I haven't come across before and can't seem to find anyone else saying they have come across it either (no ticket with Magento I can find either).  In one environment only upgrade scripts are just not running were before they were running fine.  In all other environments they are running fine.

So the setup_module table reports a module version well behind what is in the codebase, but the site loads fine which it shouldn't - it should flag a mismatch in module version and prompt you to run setup:upgrade but it doesn't.  It's like Magento can't 'see' the new module version.  In fact, removing a relevant entry from setup_module makes no difference, equally commenting the upgrade schema code makes no difference.  No errors in the Magento or server logs, but all modules load and are reported by the setup:upgrade command.  Doesn't seem to make a difference in what the mode is, both developer and production mode shows the same issue.  Also worth noting that the same server runs another instance of the same site and all upgrades run fine there.  The codebase is also identical to other environments where upgrades are running fine.

I've cleared all caches including things like opcache.  Anyone come across this kind of oddity before?


texts: Magento 2 Category page add custom view mode

texts:
On category page I want to add addition view mode as "expand" with "grid" and "list" mode.

If any one has created custom view mode for category page then help.


texts: Not redirecting depending on the storeview code

texts:
We have different store views: Spanish (es_es), French (fr_fr) and English (en). And we have a RMA extension where you can create them. Once you create a RMA you redirect to the same RMA page; we assume it works for the english storeview because of the code of the storeview is "en", not like the spanish and the french ones which have respectively (es_es) and (fr_fr) which redirect to the homepage.

This is the condition that redirects:

if ($result[0] == self::HTTP_CODE_OK) {
                                $this->sendEmailSuccessCreateRma($result[1]);
                                $this->messageManager->addSuccessMessage(__('RMA was created successfully'));
                                $this->_redirect('sap/rma/index');
                            } else {
                                $this->messageManager->addErrorMessage($result[1]);
}

And this statement in the phtml:

        <button type="submit" class="action primary" data-role="rma-submit">
            <?= __('Submit Request') ?>
        </button>

We have tried doing another class class like:

\Magento\Store\Model\StoreManagerInterface $storeManager

with this code:

$url = $this->_storeManager->getStore()->getUrl('sap/rma/index');
$this->_redirect($url);

But it leaves us a blank page and we can't see anything wrong in the logs.


texts: Product Pages - "Error processing request" Error Logs=

texts: When trying to access product pages, I'm getting an error processing request. I've checked the var/report log and it showed the following. Any ideas what might be going on?


texts: What is the event after total calculation of cart item in Magento 2 using Plugin

texts:
I want to know the event after total calculation occurs in cart using plugin in Magento 2.

Here is my app/code/NAMESPACE/MODULE/etc/di.xml file.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Model\Cart">
        <plugin name="cache_price_cart" type="NAMESPACE\MODULE\Plugin\Product" sortOrder="10"/>
    </type>
</config>

app/code/NAMESPACE/MODULE/Plugin/Product.php

<?php
namespace NAMESPACE\MODULE\Plugin;
use Magento\Framework\Exception\LocalizedException;

class Product
{
    protected $cart;

    public function __construct(
        \Magento\Checkout\Model\Cart $cart)
    {
        $this->_cart = $cart;
    }

    public function afterAddProduct($subject, $productInfo, $requestInfo = null)
    {
        $productInfo = $this->_cart->getQuote()->getItemsCollection();
        print_r($productInfo);die;
    }
}

it gives me cart item information after adding product to cart but I want to get cart item information whenever item price is calculated or whenever cart item is calculated. I am doing this because I have to add custom price (From third party) whenever cart item is calculated.

I don't want to add my custom price (From third party) on afterAddProduct event but want whenever cart item is calculated. Is there any plugin event that provides that works on after cart item is calculated?


texts: Can Someone explain how single sign on can be done programmatically in magento2. Or the application logic of single sign on? We have multiple site these sites are in different technology for example one site is in wordpress another in java. So when a customer signed in either wordpress or java application then the same customer when he move to store should be signed in automatically. How this can be implemented?


texts: Is there anyway I can force Magento to create a log file that contains the offending script path that is causing a redirect to no-route?


texts: I have created several attribute set which are based on Default attribute set.Now when i make changes in the default attribute set its not getting reflected in the new attribute set which was created using 'Default' attribute set as base. Due to this i have to manually update each and every new attribute set.Is there a way to overcome this. For example i have created a new attribute set called 'A' which is based on 'Default' attribute set. Now i have added a new attribute called 'customer_code' in the 'Default' attribute set. So when i check 'A', the new attribute 'customer_code' should come automatically since its based 'A' is based on 'Default'.Thanks in advance.


texts:
Delete mass action for admin grid not working
<?php

namespace Vendor\First\Controller\Adminhtml\Post;

use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Vendor\Module\Model\ResourceModel\Post\CollectionFactory;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\App\ResponseInterface;

class MassDelete extends \Magento\Backend\App\Action
{
    /**
     * @var Filter
     */
    protected $filter;

    /**
     * @var CollectionFactory
     */
    protected $collectionFactory;

    /**
     * @param Context $context
     * @param Filter $filter
     * @param CollectionFactory $collectionFactory
     */
    public function __construct(Context $context, Filter $filter, CollectionFactory $collectionFactory)
    {
        $this->filter = $filter;
        $this->collectionFactory = $collectionFactory;
        parent::__construct($context);
    }

    /**
     * Dispatch request
     *
     * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
     * @throws \Magento\Framework\Exception\NotFoundException
     */
    public function execute()
    {
        $collection = $this->filter->getCollection($this->collectionFactory->create());
        $collectionSize = $collection->getSize();

        foreach ($collection as $item) {
            $item->delete();
        }

        $this->messageManager->addSuccess(__('A total of %1 element(s) have been deleted.', $collectionSize));

        /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        return $resultRedirect->setPath('*/*/');
    }
}


texts: How to use sub-select query in Magento 1.x collection (Admin Grid)

texts:
I have created a MySQL query for Magento table.

SELECT account_id,
count(session_id) as sessions,

(SELECT count(event_code) from my_custom_table where event_code = 4
group by account_id) as review_design,

(SELECT count(event_code) from my_custom_table where event_code = 5
group by account_id) as pdf_created,

(SELECT count(event_code) from my_custom_table where event_code = 2
group by account_id) as email_sent

FROM my_custom_table
group by account_id;

I have tried changing this plain query to Magento convention for  protected function _prepareCollection() in admin grid. However, I am not able not to convert. I have gone through many answers on the internet, but most are related to the join query.


texts: Embed video on product page below description using attribute

texts:
I've created attribute product_video with scope global, type text field and used in product listing turned on.

Now I've added this code in view.phtml

<iframe src="https://player.vimeo.com/video/<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_videoId, 'product_video') ?>
?color=ba9344&badge=0" width="100%" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

But the number (video-id) I add in the back-end at a product, doesn't get loaded on front-end. Anybody know a fix?


texts: Magento 2 - How to know all valid attributes to use in addAttributeToSelect?

texts:
I often see code like this where the developer just inserts * into addAttributeToSelect("*") instead of selecting only the necessary attributes.
public function toOptionArray()
{
    $optionArray = [];
    $arr = $this->collectionFactory->create()->addAttributeToSelect("*");

    foreach ($arr as $key => $value) {
        $optionArray[] = [
            'value' => $value->getId(),
            'label' => $value->getName(),
        ];
    }
    return $optionArray;
}

As you can see, only the attributes id and name are getting used, so the developer should configure addAttributeToSelect accordingly for better performance.
So I tried to improve the code by using this addAttributeToSelect("id, name"); but now the name is not available in the data anymore, because name does not seem to be the right column identifier.
How do I know all valid available attributes which I can use?
I looked up the database table catalog_category_entity and catalog_category_product but they do not even contain a column with name "id" and there is no information about the category name.

I also tried to output an element from $arr to see if it contains interesting information:
public function toOptionArray()
{
    $optionArray = [];
    $arr = $this->collectionFactory->create()->addAttributeToSelect("*");

    // Debug ------------------------------------------
    echo "<pre>";
        print_r($arr[0]);
    echo "</pre>";
    exit();
    // ------------------------------------------------

    foreach ($arr as $key => $value) {
        $optionArray[] = [
            'value' => $value->getId(),
            'label' => $value->getName(),
        ];
    }
    return $optionArray;
}

But I get

"Error: Cannot use object of type
Magento\Catalog\Model\ResourceModel\Category\Collection as array in
/home/x/y/app/code/Company/Shipping/Model/Source/Category.php:30"

... even though the same $arr is later used in the foreach with no problem, so the error makes no sense.


texts: Function call to Gift message capturing, no message entered by the customer: how to handle simple scenario?

texts: Good Evening: The event being used here is sales_order_place_after. I want to collect message our customer enter when placing the order. It is noticeable that this event doesn't handle when customer doesn't want t to leave a gift message. In this scenario, this event does nothing but ends up in a mess. Please advise


texts:
I have a problem I've been struggling for a couple of days and I would really like you to point me in the right direction. I am developing a module to track basic stuff like addToCart and ViewContent for the Facebook pixel.

The problem is, my module cannot track Ajax addToCart event using extensions like this. I would really like you to give me some proper directions cause I feel like I am really lost in this one.

I tried updating layouts, adding my block on my observer event and much more. I'll pass some of my code below so you can get an idea of what I'm trying to do.

  config.xml

 <frontend>
<routers>
  <advertising>
    <use>standard</use>
    <args>
      <module>My_Advertising</module>
      <frontName>my</frontName>
    </args>
  </advertising>
</routers>
<events>
  <checkout_cart_product_add_after>
    <observers>
        <advertising>
            <class>advertising/observer</class>
            <method>myAddToCart</method>
        </advertising>
    </observers>
  </checkout_cart_product_add_after>
</events>
<layout>
  <updates>
    <advertising>
      <file>advertising.xml</file>
    </advertising>
  </updates>
</layout>

Observer function that I'm setting a variable for the product that has been added to cart

public function myAddToCart($observer)
{
    $product = Mage::getModel('catalog/product')
                    ->load(Mage::app()->getRequest()->getParam('product', 0));
    if (!$product->getId()) {
        return;
    }

    Mage::getModel('core/session')->setProductToShoppingCart(
        new Varien_Object(array(
            'id' => $product->getSku(),
            'name' => $product->getName(),
            'brand' => $product->getAttributeText('manufacturer'),
            'price' => $product->getPrice(),
            'qty' => Mage::app()->getRequest()->getParam('qty', 1),
            'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
        ))
    );
}

  layout file

<?xml version="1.0" encoding="UTF-8"?>
 <layout version="0.1.0">
   <checkout_cart_add>
      <reference name="content">
        <block type="advertising/Mytracking" name="advertising_mytrackingcart" template="advertising/mytrackingcart.phtml">
        </block>
         </reference>
      </checkout_cart_add>
      </layout>

  mytrackingcart.phtml

<?php $product = Mage::getModel('core/session')->getProductToShoppingCart(); ?>
   <?php if ($product && $product->getId()): ?>
        <script type="text/javascript">
        echo $this->myGetAddToCartFacebook($product);
       </script>
<?php Mage::getModel('core/session')->unsProductToShoppingCart(); ?>
  <?php endif; ?>

  My block function

 public function myGetAddToCartFacebook()
    {
        $id = $product['id'];
        $price = number_format($product['price'], 2);
        $currency = $product['currency'];
        $code = "fbq('track', 'AddToCart', { value: \"{$price}\",currency: \"{$currency}\",content_ids: [\"{$id}\"],content_type: 'product' });";
        return $code;
    }


texts: Minicart starts Spinning after few days on adding product

texts:
I am Using my Own custom theme extended from LUMA theme and in that I have extended checkout module, done some modifications like bringing CHECKOUT button in the bottom as it comes at the top.

Added minicart auto_open functionality when a customer click on add to cart button, it works as follow:

Now, I keep spinning as below image and can't figure out the problem:

Everything works great for few days and then minicart stops working and start spinning after clicking on add to cart button.

I had tried few things to resolve this issue:

Roll back the changes I have made to Checkout module ( problem don't go away)
Restored the previous working backup and works fine and after few days again the same problem.

how can I solve this problem?


texts: Share login details on multiple websites in Magento 2

texts:
I have two websites on one Magento with two different domains. Now, when customers log in to one domain and they go to the rest domain, they must log in again. Is there any way to share log in, So, they don't need to log in again?
Thank you for your advice!


texts: How can I remove some content from RWD default home page

texts:
I have chosen to develop a child thee based on RWD parent theme. How can I remove some garbage that I actually don't need. I marked the piece of html that I want to remove, in the attached screenshot. It is not in any block, as I can see in my template hints (see attached image)

I want that COMPANY, ABOUT US, CONTACT US, CUSTOMER SERVICE, PRIVACY POLICY links removed so that I can isnert something more useful in their place. How can I do that?


texts: Is it possible for human being to re-design checkout in Magento2?

texts:
I am creating magento2 online store for our client, I got the design, everything went okay with some small bumps. But when I got to checkout. I really wish I never born on this planet.

I cannot find any tutorial other than how to add field to default luna theme in checkout or a static plain text message above the shipping form.

What I need to achieve is a one-step checkout that looks like this

First part is the billing form, second is the password form for account creation, third one is the shipping form if it differs from the billing. Then on the sidebar is summary of items in cart, grand total, and payment method (and now as i am writing i have noticed that there is no shipping method selection...)

on the bottom of the page is checkbox for accepting terms and conditions and a button to finish the order.

In Magento 1 this would be not easy but not hard to do also. I have no clue how to even start. All tuts I have found considers only adding some field, or moving the billing above the shipping, etc. One step checkout is even not mentioned anywhere.

Can someone provide any good resource? Magento devdocs was not enough for me to understand how that works. MAgeplaza and other blogs does not mention things i need.

Thank you