texts: Magento 2.2.8 > 2.3.5 upgrade hangs on "Something's changed, looking at all rules again"

texts:
I'm trying to upgrade a Magento shop from 2.2.8 to 2.3.5 through composer. First, i've copied the shop from the live server to a local docker environment. Then I applied the upgrade on the local environment. The upgrade succeeded. However, when I tried to run the upgrade (composer update command) on the live server, composer seems to be stuck on "Something's changed, looking at all rules again".
I've checked composer versions and php versions but they are the same on local and live environment.
Anybody an idea what causes this issue?


texts: call Add specific Product to Cart and go to cart on phtml Static Template

texts:
Is there a way to Add a Specific product by ID on a phtml file on a click event and then go to the cart ?
I need this because i have a custom designed product page for a subscription product with 3 different discounts. so that you can add 1 of 3 different products to cart on this page.


texts:
I can get tags in a view.phtml file like this:

<?php
$_tags = new Mage_Tag_Block_Product_List();
?>

Product Tags:

<?php foreach($_tags->getTags() as $tag):?>

<a href="<?=$tag->getTaggedProductsUrl()?>"><?=$tag->getName()?>

<?php endforeach;?>

It works fine in a single product page.
But the code above doesn't work in categories; it returns error:

  Fatal error: Call to a member function getItems() on a non-object in
  /app/code/core/Mage/Tag/Block/Product/List.php on line 45

As I understand the tags class cannot be instantiated.

But how can I display tags list in a category instead of products?
When I click on a tag I should get all products with this tag.
Also one tag must not be repeated twice.

Any ideas how to solve this issue?

edited:
I'll try to give more details...

There's a layered navigation on my home page called "Gifts". This is a simple filter with attributes.

When I choose some attritube(for example "gender - male") and press "Search" I redirect to a category "Gifts" and get result with products which have an attribute gender "male".
But on the first step when I get result I need to display NOT products, I need to display their tags.

For example, a product with attribute "male" can contain some tags "creative, relaxation, father, husband" etc...
Another product with attribute "male" can contain the same tags as above, but these tags won't be displayed again.
So we see only unique tags from all products.

On the second step when we click on tag "creative" we'll get all products with this tag.

Hope this explanation was helpful.


texts: One website - Multiple Store Catalog Search Frontend Problem

texts: I am setting one website - multiple store website. My issue on catalog search on front end, when i search from any item in particular store then it returns other store products also.


texts: Magento 2 add customer address attribute to REST APIs response?

texts:
I have created customer address attribute "city_id" with setup script.
I am able to save the value. but want to display the city_id field to the below apis json response. how we can we add city_id in the response for existing apis?

GET /V1/carts/mine/billing-address

GET /V1/guest-carts/:cartId/billing-address

I found one reference link https://web4pro.net/blog-news/magento-2-add-custom-attribute-customers-address/ and is this suitable for this requirement?


texts:
I have created a event observer module that will trigger and remove any product that is out of stock from Upsell, but for some reason it is removing the products that are in stock. I have included the module code below and let me know if I am missing anything.

File name: kevz_upsellobserver.xml

<?xml version="1.0"?>
<config>
    <modules>
        <kevz_upsellobserver>
            <codePool>local</codePool>
            <active>true</active>
        </kevz_upsellobserver>
    </modules>
</config>

File name: config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <kevz_upsellobserver>
            <version>0.0.1</version>
        </kevz_upsellobserver>
    </modules>
    <global>
        <models>
            <kevzupsellobserver>
                <class>upsellobserver_Model</class>
            </kevzupsellobserver>
        </models>
        <events>
            <catalog_product_upsell>
                <observers>
                    <kevzupsellobserver>
                        <type>singleton</type>
                        <class>Kevz_Upsellobserver_Model_Observer</class>
                        <method>filterUpsells</method>
                    </kevzupsellobserver>
                </observers>
            </catalog_product_upsell>
        </events>
    </global>
</config>

File name: Observer.php

<?php

class Kevz_Upsellobserver_Model_Observer {
        public function filterUpsells($observer) {
            $collection = $observer->getEvent()->getCollection();
            foreach ($collection as $item) {
                if (!$item->getIsSalable()) {
                    $collection->removeItemByKey($item->getId());
                }
            }
        }
}
?>


texts:
I have tried installing Magento 2.3.2 with sample data on localhost(xampp) but not successful. In the exception log, I'm getting the below thing:

[2019-09-02 08:10:27] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magentosample.core_config_data' doesn't exist

Could anyone please help me on how to rectify this error?


texts: Is it possible to have a child of a child theme in Magento 2

texts:
I have a theme installed using Magento 2 and I then have a child theme which I am using to make customisations.

Is it also possible to then create a child them of that child which I can use to make a custom header design which will take everything else from the child theme.

I essentially only need to replace the header logo on some pages like the home page and a child > child theme seems like an easy solution but not sure how to make it work.


texts: Error while running API :Undefined Property

texts:
Magento 2.3, here is the stack trace:

  rk/App/ErrorHandler.php:61)"} []
  var//log/exception.log:[2019-12-12 07:26:41] main.CRITICAL: Report ID: webapi-5df1ebb139956; Message: Notice: Undefined property: SimplifiedMagento\Custom2\Model\OrderedRepository::$OrderedInterface in /Applications/MAMP/htdocs/Magento2_3/app/code/SimplifiedMagento/Custom2/Model/OrderedRepository.php on line 77


texts:
I am trying to update seller's group id in my multi-seller Magento website.

function becomesellerAction() {
$adminApproval = Mage::getStoreConfig('marketplace/admin_approval_seller_registration/need_approval');
$approval = 0;
if ($adminApproval == 1) {
    $approval = 0;
} else {
    $approval = 1;
}
$getGroupId = Mage::helper('marketplace')->getGroupId();
Mage::log($getGroupId,null,'logthis.log');
$customer = Mage::getSingleton("customer/session")->getCustomer();
$customer->setGroupId($getGroupId)->save();

In the log, I do see $getGroupId=4 which is what I want. But the database continues to have the default value of 1. Basically this is not saving the value to the database. The table in the database where this needs to be saved is 'customer_entity'.

I tried using a direct query:

$resource = Mage::getSingleton('core/resource');
$writeConnection = $resource->getConnection('core_write');
$getGroupId = Mage::helper('marketplace')->getGroupId();
$email = $customer->getEmail();
$query = "UPDATE customer_entity SET group_id = '{$getGroupId}' WHERE email = '{$email}'";
Mage::log($query, null,'query.log');

$writeConnection->query($query);

And this works fine in all environments.

Strangely the original code works fine in my local but not in test or production (local is WAMP and prod/test is Apache/Linux).

Any pointers to what am I doing wrong here? Is there a log that gets created when such save() operations fail?


texts:
I'm getting all products with this code:

$collection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->addStoreFilter()
->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
$collection->getSelect()->order('rand()');
$collection->getSelect()->limit(12);

Can I add price range? Like "price > 1000 && price < 5000" ?


texts: Error When Installing Data Migration Tool

texts:
I am getting the following error when trying to install the data migration tool

composer require magento/data-migration-tool:2.1

  Problem 1
- The requested package magento/data-migration-tool 2.1 exists as magento/data-migration-tool[2.0.0, 2.0.2, 2.0.5, 2.0.7] but these are rejected by your constraint.

Any ideas? There is an open issue on Github for this (https://github.com/magento/data-migration-tool/issues/104) but any help is appreciated.

Below is what I get when requiring data-migration-tool:2.0.7

  Problem 1
- Conclusion: don't install magento/data-migration-tool 2.0.7
- Conclusion: don't install magento/data-migration-tool 2.0.7
- Conclusion: don't install magento/data-migration-tool 2.0.7|remove magento/framework 100.1.0
- Conclusion: don't install magento/data-migration-tool 2.0.7|don't install magento/framework 100.1.0
- Conclusion: don't install magento/data-migration-tool 2.0.7|don't install magento/framework 100.1.0
- Installation request for magento/data-migration-tool 2.0.7 -> satisfiable by magento/data-migration-tool[2.0.7].
- magento/data-migration-tool 2.0.7 requires magento/framework ~100.0.0 -> satisfiable by magento/framework[100.0.2, 100.0.3, 100.0.4, 100.0.5, 100.0.6, 100.0.7, 100.0.8, 100.0.9].
- Can only install one of: magento/framework[100.1.0, 100.0.2].
- Can only install one of: magento/framework[100.1.0, 100.0.3].
- Can only install one of: magento/framework[100.1.0, 100.0.4].
- Can only install one of: magento/framework[100.1.0, 100.0.5].
- Can only install one of: magento/framework[100.1.0, 100.0.6].
- Can only install one of: magento/framework[100.1.0, 100.0.7].
- Can only install one of: magento/framework[100.1.0, 100.0.8].
- Can only install one of: magento/framework[100.1.0, 100.0.9].
- Can only install one of: magento/framework[100.1.0, 100.0.2].
- Can only install one of: magento/framework[100.1.0, 100.0.3].
- Can only install one of: magento/framework[100.1.0, 100.0.4].
- Can only install one of: magento/framework[100.1.0, 100.0.5].
- Can only install one of: magento/framework[100.1.0, 100.0.6].
- Can only install one of: magento/framework[100.1.0, 100.0.7].
- Can only install one of: magento/framework[100.1.0, 100.0.8].
- Can only install one of: magento/framework[100.1.0, 100.0.9].
- Installation request for magento/framework (locked at 100.1.0) -> satisfiable by magento/framework[100.1.0].


texts: Recurring Profiles - Ajust Trial Period Amount to Quantity

texts:
I have a recurring profile set up for a product with a 2-weeks trial period configured as follows:

Trial Billing Period Unit = 2 weeks
Trial Billing Frequency = 1
Maximum Trial Billing Cycles = 1
Trial Billing Amount = 9$

The product in itself costs 18$. So what I want is that the Trial Billing Amount always amounts to 50% of the product price. Eg: if you order 2 of that product, your Trial Billing Amount should be 18$ (out of a total price of 36$); if you order 4 of that product, your Trial Billing Amount should be 36$, etc.

And yet, it appears that Magento does not adjust the TBA according to the ordered quantity. So regardless of the number of products my customers order, their TBA is always 9$.

Would anybody happen to know how to make the TBA dependent on product quantity?

Cheers.

PD: I've tried to enter the TBA as a percentage (you never know...) but of course it did not work.


texts: Magento 2.4.1: Place order using stripe payment method through REST API

texts:
I am making the mobile app in andriod and IOS using Magento2 as backend. In our website we are using stripe payment method.
Now I am trying to place an order using stripe method.
I am using magento default API in order to place an order "http://XXXX.com/rest/V1/carts/36/order" (where 36 is my quote id). I checked many documents and they suggested to use following in body:
{
    "paymentMethod": {
    "method": "stripe_payments",
        "additional_data" : {
        "cc_save" : false,
        "cc_stripejs_token" : "pm_card_visa:visa:4242"
        }
    }
}

By using above in body order is placed successfully and I got the order id in response. But now I am trying to make "cc_stripejs_token" from request received from app team. They have following information:
 card =     {
        brand = Visa;
        country = US;
        "cvc_check" = unchecked;
        "exp_month" = 8;
        "exp_year" = 2023;
        funding = credit;
        id = "card_1ImFqhGpA1zE4WUlvS12Hl9m";
        last4 = 4242;
        name = test;
        object = card;
    };
    "client_ip" = "132.154.98.207";
    created = 1619864099;
    id = "tok_1ImFqhGpA1zE4WUl3Eg9UFpA";
    livemode = 0;
    object = token;
    type = card;
    used = 0;
}

Now I am trying to make "cc_stripejs_token" by using this formula:
token.id + ':' + token.card.brand + ':' + token.card.last4

My body looks like
{
           "paymentMethod": {
            "method": "stripe_payments",
             "additional_data" : {
                "cc_save" : false,
                "cc_stripejs_token" : "tok_1ImFqhGpA1zE4WUl3Eg9UFpA:visa:4242"
             }
        }

}

But I am getting error "TypeError: Return value of
Magento\InventorySales\Plugin\Sales\OrderManagement\AppendReservationsAfterOrderPlacementPlugin::aroundPlace() must
implement interface Magento\Sales\Api\Data\OrderInterface.
I also tried by placing order using stripe intent method.
       \Stripe\Stripe::setApiKey('MY SECRET KEY');
        $st_response = \Stripe\Token::create(array(
                    "card" => array(
                        "number" => "4242424242424242",
                        "exp_month" => 1,
                        "exp_year" => 2024,
                        "cvc" => "314"
                    )
        ));
       echo json_encode($st_response);
       $charge = \Stripe\Charge::create(array('amount' => 1000, 'currency' => "eur", 'source' => $st_response['id']));
      //echo json_encode($charge);
      $tokenCard = $st_response['id'] . ':' . $charge['payment_method_details']['card']['brand'] . ':' . $charge['payment_method_details']['card']['last4'];

Payment is successful as I can see entries in Stripe dashboard but when trying to place an order using $tokenCard then it again shows error.
Please help me how can I place an order.


texts:
I've inherited a large magento application with a huge number of extensions, and have been tasked with finding all accessible urls which match certain criteria (meaning I must look manually).

I'm trying to find a way of finding all urls exposed by modules as creating a sitemap didn't do this for me.


texts: Magento 2: how to get the hamburger menu @medias screen 1024px

texts: The current hamburger menu is shown @media screen 792px. How do I change it to 1024px?


texts: Magento set product list order by attribute values

texts:
I am trying to provide the custom attribute in sort-by, when am trying to fetching the products list order by custom attribute those are not in Ascending order.

  if ($attribute == 'paidship') {
        //$dir = 'ASC';
        if (isset($this->_joinFields[$attribute])) {

            $this->getSelect()->order($this->_getAttributeFieldName($attribute) . ' ' . $dir,'e.name'.$dir);

        }
    }

My custom attribute is "paidship", i want fetch them in first in Ascending order and remaining products should display after those products and those are also be in Ascending order


texts: from localhost auto moves to online server

texts:
Hi I made a copy of all the files and database of my online site.

I uploaded everything to XAMPP on localhost  because I wanted to test a few extension.

when I go to localhost/magento everything works properly. but when I click any link, it takes me to my online site, not localhost. I changed the page in the database (attachment). What could be wrong ?


texts: Product Page Image Gallery Config on Blank Theme Based Theme

texts:
I'm trying to style the gallery on the product page, and I am looking at theme/magento_catalog/templates/product/view/gallery.phtml and I am seeing
    {
        "[data-gallery-role=gallery-placeholder]": {
            "mage/gallery/gallery": {
                "mixins":["magnifier/magnify"],
                "magnifierOpts": <?= /* @noEscape */ $block->getMagnifier() ?>,
                "data": <?= /* @noEscape */ $block->getGalleryImagesJson() ?>,
                "options": <?= /* @noEscape */ $block->getGalleryOptions()->getOptionsJson() ?>,
                "fullscreen": <?= /* @noEscape */ $block->getGalleryOptions()->getFSOptionsJson() ?>,
                 "breakpoints": <?= /* @noEscape */ $block->getBreakpoints() ?>
            }
        }

}

I need to add to the "options" attribute, but I don't really understand where I do that. Is it safe to override what is there and add my own parameters in this file?
I am running Magento 2.3.5-p1


texts: How to keep advanced search in magento Home Page?

texts: I wish to keep an advanced search in my store. First a dropdown with two values should be listed like vehicle and dimension. The next details regarding either the vehicle or the dimension should be displayed only when the user select the value ( vehicle dimension ). If the user select the vehicle option then the associated dropdowns like brand & color should be shown . Can this be done in magento?


texts: Override Magento 2 JS file via requirejs-config.js not working

texts:
I'm trying to override the file vendor/magento/module-catalog/view/base/web/js/price-box.js in my theme using requirejs-config.js unsuccessfully.

Location of my requirejs-config.js:

  app/design/frontend/Mytheme/mytheme/requirejs-config.js

Contents of my requirejs-config.js file:

var config = {
map: {
     '*': {
            priceBox:'js/price-box',
     }
}
};

I placed my new file price-box.js in here:

  app/design/frontend/Mytheme/mytheme/web/js/price-box.js

I also tried placing it under:

  app/design/frontend/Mytheme/mytheme/Magento_Catalog/web/js/price-box.js

but none of those worked.

In the frontend the file that gets loaded is:

  pub/static/frontend/Mytheme/mytheme/en_US/Magento_Catalog/js/price-box.js

Which is the default vendor file, and not mine? My file is here:

  pub/static/frontend/Mytheme/mytheme/en_US/js/price-box.js

We are working in Developer mode and Cached Disabled.

I tried a few commands to see if that would actually help:

php bin/magento setup:static-content:deploy
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile

Any suggestions?

Related questions:

Magento2: How can I override core js module price-box.js
How to extend js class/method of checkout model class in magento 2
Magento 2 does not read my requirejs-config.js

Official documentation:

http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/custom_js.html

Update 1

Following suggestions of a StackExchange user I just did:

Move requirejs-config.js inside the web/ folder of my theme.
Manually remove everything under /pub/static/ except the .htaccess file
Execute this command: php bin/magento dev:source-theme:deploy

It didn't do any effects, the loaded file keeps being:

  pub/static/frontend/Mytheme/mytheme/en_US/Magento_Catalog/js/price-box.js

Update 2 - Solution

As suggested by David Verholen I did the following steps:

Remove the map from the requirejs-config.js file in the root folder of my theme.
Place my new files price-box.js in:

  app/design/frontend/Mytheme/mytheme/Magento_Catalog/web/js/price-box.js

Manually remove all the contents from /pub/static/ by doing:

  rm -rf pub/static/*


texts:
its been 2 days now all cron jobs and cron_schedual showing pending status.
Any solution to run them normally ?


texts: How to access Multidimensional Array in Magento Email Template?

texts:
Hi I am trying to pass multi-dimension array to email template Magento 1.9

CODE FOR SENDING EMAIL

$emailVariables['appointment']=$appointmentArray;  //it is appointment data array
$emailVariables['store_info']=$storeInfoArray; //it is store info array
$emailVariables['customer']=$appointmentCustomer; //it is customer info array

I have created this function for sending mail with Email Variables

$this->sendEmail($templateId,$sender,$email,$customer_name,$emailVariables);

CODE IN EMAIL TEMPLATE I AM USING

{{var customer.firstname}}

I tried this code for store info as well.
like

{{var store_info.store_id}}

It is not showing any information/first name only it is showing
Array


texts: I would link to remove all the layered navigation filters from left side of Magento 2, using xml Please guide me


texts:
Every time my home page loads it will scroll to the bottom of the page. How do I fix it?

  https://donvonapparel.com/


texts:
In my project we are using Magento Enterprise Edition 1.14.1. The prices in store are changed dynamically direct from Database. So the problem is Magento cache every thing (full page cache) so the changes are not affected in front end. So we are decided disable the cache for that particular block. I know it can done in layout files. I checked in layout catalog.xml and I found it the block

<block type="catalog/product_price_template" name="catalog_product_price_template" />

So here I don't know how to disable it. I have tried set fife time of cache to null in app/etc/local.xml ,

 <layout>
    <default>
         <reference name="catalog_product_price_template">
            <action method="setCacheLifetime" />
        </reference>
    </default>
    </layout>

and tried in layout/catalog.xml

<block type="catalog/product_price_template" name="catalog_product_price_template" >
         <action method="setCacheLifetime" />
        </block>

But no luck.

And I have found some other price blocks in layout/bundle.xml file. We are using bundle product as well. So we have to disable this cache also ? Any help would be appreciated. Thanks.


texts: Magento home page session issue with Venus Theme Magento 1.9

texts:
My session is lost on home page. Its working fine on all other pages, including all cms pages. Cart gets empty and customer information is not shown.

However, when I go away from home page, cart is repopulated.

If I click on preview link of home page inside CMS -> Pages it works fine there.

I am unable to resolve the issue.

What could be the reason? Any suggestions/tips?

Thanks


texts: How to Setup Multi Website With Visible Language Codes in Magento2?

texts:
I want to setup the below url structure in our website.

http://www.domain.com/en -> website: domain / storeview: domain_en

http://www.domain.com/de -> website: domain / storeview: domain_de

http://www.domain.com/es -> website: domain / storeview: domain_es

http://www.domain1.com/en -> website: domain1 / storeview: domain1_en

http://www.domain1.com/de -> website: domain1 / storeview: domain1_de

http://www.domain1.com/es -> website: domain1 / storeview: domain1_es

http://www.domain2.com/en -> website: domain2 / storeview: domain2_en

http://www.domain2.com/de -> website: domain2 / storeview: domain2_de

http://www.domain2.com/es -> website: domain2 / storeview: domain2_es

  I don't want to create domain and sub domain. Magento not allow to create storeview with same name like "en". because "en" in all three
  websites.

how i can acheive this.

Please help me!


texts: How to edit order programmatically in magento2?

texts:
I want to edit order programmatically in magento2.

How to do this.

Thanks.


texts: Comparission between multi website single store for each and multi store for one single website

texts:
I have requirement to create multi-store magento 1.8 app with single website.
where product is based on categories and each store owner can sell many products of all of the categories on demand,

each store owner need to request for product for sell.
I have created it two approach one is

single website multiple store
multiple website and single store for each website

first one is not allowing me to show only those product which are related to one store. I mean all the product are displayed on all the store or no product to display message.

second one is working fine and I am able get single product in single store or multiple store by checking the option here
Catalog->manage product->websites

I am confusing that which is the good way to implement above requirement?.
Is there any other way to implement this requirement?

If you not understand my requirement let's assume like this

one product or Catalog to many store on demand of store-owner

one store to many product or Catalog on demand of store-owner

one store to one product or Catalog by default

Thank you in advance


texts:
I am having some difficulty changing the layout of the Catalog View pages within our Enterprise installation.

The layout is currently set (somewhere) to 2-columns-left.phtml however I need to change this to 1column.phtml. I have successfully done this for a 'parent' category layout which is set in layout.xml via:

<catalog_category_default>
    <reference name="root">
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
    </reference>
</catalog_category_default>

<catalog_category_layered>
    <reference name="root">
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
    </reference>
</catalog_category_layered>

<catalog_category_search>
    <reference name="root">
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
    </reference>
</catalog_category_search>

However when I visit the following URL: /catalog/category/view/s/a-category-name/id/46/ it is just loading 2columns-left.phtml. My question is, how can I find out what XML file or method is setting this particular layout?

Many thanks in advance


texts: Show category slider on product listing page magento 2

texts:
I want to show sub-categories slider on category pages / product listing pages in magento 2.3.2.
Can anybody help me in this?


texts: Image CAPTCHA requires FT fonts support While Logging to Magento2

texts:
I installed a fresh copy of Magento2 Latest version (2.2.0) on my live site but when i try to login via admin panel it throws the below error

  There has been an error processing your request

  Image CAPTCHA requires FT fonts support Error log record number:
  1185338139961

I don't know why it is happening can anyone help?


texts: How to add manufacturer on module ves-Brand?

texts: can someone please show me how i can add manufacturer ? ; I have module Ves-Brand and i use magento 2


texts: Magento-2 Custom product price not working for multi-shipping checkout

texts:
Custom product price not working for multi shipping checkout.

Here is my code for the custom product price

app\code\Custom\Module\etc\frontend\events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
 <event name="checkout_cart_product_add_after">
     <observer name="customprice" instance="Custom\Module\Observer\Customprice" />
 </event>
</config>

app\code\Custom\Module\Observer\Customprice.php

<?php
namespace Custom\Module\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;

class Customprice implements ObserverInterface
{
 public function execute(\Magento\Framework\Event\Observer $observer) {
     $item = $observer->getEvent()->getData('quote_item');
     $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
     $price = 100; //set your price here
     $item->setCustomPrice($price);
        $item->setOriginalCustomPrice($price);
        $item->getProduct()->setIsSuperMode(true);
 }

}


texts: Magento hide attribute group if included attribute got no data

texts:
We use this way to display attribute group names on the additional information tab on product page.
Currently when a attribute got no data, the entire attribute will be hidden.
I want to do the same for the attribute group name. So that if the attribute group got no attributes with data, it needs to be hidden.

This is our code:

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct()
?>
<?php if($_additionalgroup = $this->getAdditionalData()): ?>

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

    <?php $i=0; foreach ($_additionalgroup as $_additional): $i++; ?>

<?php echo $this->__( $_additional['title'] )?>

        <table class="data-table" id="product-attribute-specs-table-<?php echo $i?>">
            <col width="25%" />
            <col />

            <?php foreach ($_additional['items'] as $_data): ?>
             <?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
    if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>

                    <?php echo $this->htmlEscape($this->__($_data['label'])) ?>
                    <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

            <?php } ?>
            <?php endforeach; ?>

    <?php endforeach; ?>

<?php endif;?>

How can I fix this?


texts: Get custom attribute in one step checkout

texts:
I'm trying to get a custom attribute (mgs_brand) in MagePlaza's One Step Checkout.

I've created a catalog_attributes.xml file like so -

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="quote_item">
        <attribute name="mgs_brand"/>
    </group>
</config>

Added this code to my details.js -

getBrand: function (parent) {
                console.log("details.js starts here");
                var itemProduct = this.getItemProduct(parent.item_id);
                return itemProduct.mgs_brand;
},

Added this to my details.html -

The closest I've managed to get is a value in the window.checkoutConfig object, but it's an ID rather than the actual attribute value.

Am I missing a step here?


texts: Parse error Unexpected token "match" while accessing magento

texts:
I am trying to install magento on MAMP server. I have downloaded magento zip file and extracted it to htdocs directory.
Installation is successful. However accessing magento throws parse exception
Deprecated: Method ReflectionParameter::getClass() is deprecated in /Applications/MAMP/htdocs/magento/vendor/magento/framework/Code/Reader/ClassReader.php on line 34

Deprecated: Method ReflectionParameter::getClass() is deprecated in /Applications/MAMP/htdocs/magento/vendor/magento/framework/Code/Reader/ClassReader.php on line 34

Parse error: syntax error, unexpected token "match", expecting identifier in /Applications/MAMP/htdocs/magento/vendor/magento/module-elasticsearch/SearchAdapter/Query/Builder/Match.php on line 20

Command used for installation
bin/magento setup:install \
--base-url=http://localhost \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password=magento \
--backend-frontname=admin \
--admin-firstname=admin \
--admin-lastname=admin \
--admin-email=admin@admin.com \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1

I am using elastic search 7 and it is up and running on port 9200.
curl -XGET 'localhost:9200/_cat/health?v&pretty'
epoch      timestamp cluster                status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1617940234 03:50:34  elasticsearch_dheerajo yellow          1         1      1   1    0    0        1             0                  -                 50.0%

Elastic search composer output
composer show elasticsearch/elasticsearch
name     : elasticsearch/elasticsearch
descrip. : PHP Client for Elasticsearch
keywords : client, elasticsearch, search
versions : * v7.7.0
type     : library
license  : Apache License 2.0 (Apache-2.0) (OSI approved) https://spdx.org/licenses/Apache-2.0.html#licenseText
homepage :
source   : [git] https://github.com/elastic/elasticsearch-php.git 1d90a7ff4fb1936dc4376f09d723af75714f6f05
dist     : [zip] https://api.github.com/repos/elastic/elasticsearch-php/zipball/1d90a7ff4fb1936dc4376f09d723af75714f6f05 1d90a7ff4fb1936dc4376f09d723af75714f6f05
path     : /Applications/MAMP/htdocs/magento2/vendor/elasticsearch/elasticsearch
names    : elasticsearch/elasticsearch

autoload
files
psr-4
Elasticsearch\ => src/Elasticsearch/

requires
ext-json >=1.3.7
ezimuel/ringphp ^1.1.2
php ^7.1
psr/log ~1.0

requires (dev)
cpliakas/git-wrapper ~2.0
doctrine/inflector ^1.3
mockery/mockery ^1.2
phpstan/phpstan ^0.12
phpunit/phpunit ^7.5
squizlabs/php_codesniffer ^3.4
symfony/finder ~4.0
symfony/yaml ~4.0

suggests
ext-curl *
monolog/monolog Allows for client-level logging and tracing

PHP version is 7.3
php -v
PHP 7.4.12 (cli) (built: Nov 30 2020 13:28:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

I am not expert of PHP But looks like in PHP8 Match is a keyword https://www.php.net/manual/en/control-structures.match.php
Any idea on what might be going wrong?


texts: Customer Login Page & Forgot password page are not working

texts: I have created a website called cravestore.in in magento2.4. I have registered myself by using Signup page, all works good, but when I tried to login with my correct credentials the customer login page just refreshes instead of completing the login process. Also, when I tried to reset the password the forgot password email is not coming on my registered mail id. Please fix these issues.


texts: How to show magento global message in pop up - Magento 2

texts: I have created an ajaxcart custom plugin but I want to show the global message in which appear behind the ajax pop up.


texts:
I am using Magento 2.2.6 on the product page, When you view a product, and then you go to Products Menu, once the mega menu is shown up, move mouse to the menu item over the product picture area, then you will see that you cannot move your mouse to a proper menu item.

I have tried solutions on below mentioned answered but it does not work:

Product image zoom issue on product details page when drop-down menu have overlap area with it


texts:
I have this e-commerce site, around 300 products. I came to this situation, where I need to increase the prices for all products if customers decides to buy a product on credit, let say 12 month. So the prices, for this situation, need to be increased by 5%. This price needs to be shown on view page? How can be this done.

For example, on my price.phtml file I use this formula to show the discount in price, not percentage.

<?php // Discount percents output start ?>
<?php if($_finalPrice < $_price): ?>
<?php
$_savePercent = 100 - round(($_finalPrice / $_price) * 100);
$_saveAmount = number_format(($_price - $_finalPrice), 2);
?>

            -<?php echo $_saveAmount; ?> KM

            ušteda

<?php endif; ?>

* updated *
with the following code I'm able to display final price:

echo number_format($_product->getFinalPrice(), '2', '.', ',')

is there I way to simply increase the final prices by 5%, and show it.

something like: (but this is not working)

echo number_format(($_product->getFinalPrice(), '2', '.', ',') * 1.05)


texts: Magento Order Id doesn't match Paypal invoice_id (IPN)

texts:
I have some IPN request failing.
We found out the issue is because the order Id sent to Paypal is, for some reason different (one behind) ex:

Paypal register ID: 1000010
( this id doesn't exist in magento, there is an 'hole' in order progression )
Magento real order ID is: 1000011

Does anybody experience something similar ? how can we track down the issue ?


texts: Image upload - JavaScript error TypeError: this.elements.container is null

texts:
I've looked through several posts and haven't found anything that has worked.

This is a Magento 1.7.0.2 install. Has had all patches. The problem is that when I browse for and select an image file to upload, as soon as I hit the "Close" button on the file selector, I get the following JavaScript error:

TypeError: this.elements.container is null

It has to do with the Javascript file js/mage/adminhtml/uploader/instance.js, specifically in the _handleUpdateFile function.

    _handleUpdateFile: function (file) {
        var replaceBrowseWithRemove = this.miscConfig.replaceBrowseWithRemove;
        if(replaceBrowseWithRemove) {
            document.fire('uploader:simulateNewUpload', { containerId: this.elementsIds.container });
        }
        this.elements.container
            [replaceBrowseWithRemove ? 'update':'insert'](this._renderFromTemplate(
                this.elements.templateFile,
                {d
                    name: file.name,
                    size: file.size ? '(' + this._getPluralSize(file.size) + ')' : '',
                    id: file.uniqueIdentifier
                }
            )
        );
    },

The client hasn't uploaded any new images in ages, so I don't know for sure when the problem started. I have a feeling it has to do with the 8788 patch.

I'm not sure how elements.container is getting set or why it's null. Any suggestions greatly appreciated.


texts: sales/guest/form rendering twice after form submit, stripping out error messages

texts:
I've been trying to track down a bug where error messages aren't appearing when submitting the sales/guest/form form.

From what I have found so far, on submitting the form, if you enter incorrect information or information for an order registered to a customer account, it's as if the request gets processed twice, where the second time through is the response that gets sent back, causing error messages to be stripped out.

Stepping through the code, it's as if the form data gets processed, an error message gets registered, sales/guest/form gets rendered (including error message), then the process gets redirected back to sales/guest/form and the standard form renders again w/o error messages.

If I submit the data by Ajax however the page only renders once, and the response has the error messages in it.

From what I can see the first time through Magento would run through line 125 of Mage_Sales_Helper_Guest, method loadValidOrder()

Mage::app()->getResponse()->setRedirect(Mage::getUrl('sales/guest/form'));

But I've tried stripping out this redirect which just causes sales/guest/view to be rendered as a blank page.

Is this redirect correct?  It's the only thing I can see that would be triggering the double render.

Edit: Stepped through code again, it goes through the sales/guest/view action which adds the redirect, then through the sales/guest/form action for the first time, then it goes through sales/guest/form AGAIN


texts: Unable to find topsearch template file in magento 1.9.2.4

texts:
I am making a custom theme from scratch in magento using bootstrap, i have already raised a question for that purpose i have received really helpful answers.

Now i am on my way to make theme, but currently i am stuck with finding the template .phtml file for top search bar in default theme. I have already searched base theme and google but did not reached anywhere.


texts:
I am creating a module that needs to do a check right before payment is made.  If the check fails, it needs to forward the user to the cart with an error.

I have an observer and have verified that it is loading and executing.    Right now, I have it  hooked into sales_order_payment_place_start.

In the observer function, I have the following code (and only this code for testing):

$url = Mage::getUrl('checkout/cart');//eg to redirect to cart page
$response = Mage::app()->getFrontController()->getResponse();
$response->setRedirect($url);
$response->sendResponse();
exit;

When I get to the final page on check and click the "Place Order" button to submit the order, the button disappears and the "submitting order" message appears and then the button re-appears.    If I click it a second time, it forwards to the cart page as expected.

It seems as though the call is ajax'ed, my forward sets a flag, then forwards the ajax request.    Upon re-submission the page finds the flag and actually forwards.

That's a guess, but is there any way to accomplish what I am trying to do?

What would be the preferred method of doing this check?  Overwriting some controller/model?


texts:
I have installed magento2.4 in ubuntu 20, after installation the home page is coming like this
<?php
/**
 * Application entry point
 *
 * Example - run a particular store or website:
 * --------------------------------------------
 * require __DIR__ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 * \/** @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright Â© Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
try {
    require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
    echo <<getMessage()}

HTML;
    exit(1);
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

For reference please find the attached image


texts:
I'm having an issue with Magento CE version 1.9.0.1 with admin session timeouts. It goes like this:

I log into the admin.
I go to the Catalog page.
I leave the window open, and after a while my session times out.
Later, I come back to the open window, and click on link to manage categories.
Because my session has timed out, I see the login screen. I put in my username and password and submit.
The page refreshes and requires me to login again. I put in my username and password and submit.
The second login works.

This is different from the infamous "can't log into the admin, page just refreshes" bug because it only requires two logins to work every time.

I think it might have something to do with an old key being left over in the URL on step 5, but I'm not sure. Any ideas?

Edit 1
To be clear, I am not looking to simply extend the lifetime of the session.

Edit 2
I should note that I have a different domain for the admin than I do the frontend. I can't find a way to set a different cookie domain for each.


texts:
we are saving the customer account information (like personal info, address etc) from the customer account section(frontend after login), it show the success message on same page. So this is right but after it persist on all page even if I reload the same page still it's come.

It come on all pages: cart pages, order history page, wishlist page etc.

we didn't make any customisation in customer module.

and we are using the same way to display the message in our template like magento do in default:

<?php echo $this->getChildHtml('global_messages') ?>


texts:
Is there any examples of using __call in a controller to replace a specific action method.

I have a situation where I need to provide different endpoints to the same controller. A reference to each of these end points is available in the database and so instead of hardcoding a method per endpoint I would like every request that hits the controller to be handled by one method.

The only way I have got this to come close to working is by sticking exit and other similar undesirable functions within the __call method. Surely it's possible to handle the request from here and tell magento not to look for a specific method?


texts: Sort products by their product id in the order they were imported

texts:
How do you sort the products in the catalog to sort in descending, of the order they were imported. The latest products imported be the first listed on the page / catalog?  I guess the product id is best method to sort by!
Note:
I just need to place the newest products first. MORE IMPORTANT is that they are placed along side each other! As most of the products are one style, but different color blends. So we import them in that order.
My preferred way of doing this would to place it in local.xml.


texts:
I am attempting to have sales tax calculated before shipping fees are added using Magento CE 1.8.1.0. Currently, the cart adds shipping to the subtotal, and then taxes are applied to everything in the subtotal, including shipping (this appears to be Magento's default behavior). The client wants shipping charges to be excluded from tax. The only option that I can locate in Magento's backend to change this is System > Configuration > Sales > Tax > Calculation Settings, where "Shipping Prices" is set to "Excluding Tax." This has no effect. I have also tried re-ordering the checkout totals under System > Configuration > Sales > Sales > Checkout Totals Sort Order, where I have placed shipping after tax. This also has no effect.

Seems like this should be a relatively straight-forward issue to fix, but I'm not seeing anything available. Am I missing the configuration? Or does this need to be solved programmatically? If so, guidance is appreciated. Thanks!


texts: update product websites on magento 2 programmatically

texts:
I have come across posts to update products websites programmatically for Magento 1. However, I do not find the same for Magento 2. Ideally, a command would really be useful.
Can somebody help with writing a command in M2 to add/remove websites to a product and ideally to a list of product ids


texts: Skin directive doesn't work in WYSIWYG editor when using custom template

texts:
I'd like to insert images from the theme folder to a static block, but the image URL looks to be invalid in the WYSIWYG editor.

The image properly loads in the front end, so we can say it works, but I'd like to know how to make these images accessible from the TinyMCE as well.

The interesting part is that if I change the package and theme to default/default, the skin directive looks to work pretty well.

Is something misconfigured (or not configured) in the custom theme XMLs?

Or is it the normal behaviour, and I should see only a placeholder image like this in TinyMCE when using {{skin url...}}?

Anyway, nor this placeholder image is not loaded in admin TinyMCE when using the custom theme.


texts: Adding block and creating unique class ID

texts:
we add blocks to cms/blocks and pages using this convention

{{block type="cms/block" block_id="my_block1"}}
{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="my_block2"}}

Now recently I had to specificall set the CSS styling to my_block1 (or my_block2 for that matter) when I saw that these blocks all have the same CSS CLASS widget widget-static-block. I was hoping to see something widget widget-static-block my_block1

My question: Now how can we add the block ID to the class? And would this not be a good idea to add to Magento core?

And as a side question: what exactly is the difference between the two cms/block calls? (1 widget and 1 block both under cms)

So the result would be something like widget widget-static-block my_block1 or cms_block my_block1

ps. I do understand there may be some caveats - because you might not want to always expose the exact block ID in your HTML. But I can imagine that for instance the name="" or as="" statement could in that case function as the name and it can be passed via the cms/block call and added as a CLASS element.


texts: When should i reindex Design Config Grid?

texts:
There are different types of magento indexers as mentioned in

https://devdocs.magento.com/guides/v2.3/extension-dev-guide/indexing.html

Whats is use of Design Config Grid Indexer? and when does it get invalidate?


texts: Set inline edit disable for certain field

texts:
I have created Inline editing in list using UI Component.
The Inline editing works fine.

Now I want to disable certain field from being updated.

  How can i implement this in magento 2?


texts: How to display brand name above the product name

texts: How can I display the brand name above the product name on the products card?


texts: My new theme in not translating its header and footer in magento 1.9

texts: I have installed a theme in my Magento 1.9. The store has four languages including Dutch and English. But the header and footer and the themes default slider part of all pages in all languages are showing only in Dutch. The content part is translating fine. How can I correct this issue ?


texts: Magento 2 - what is the difference between layout and page_layout?

texts:
I want to override page_layout file product-full-width.xml

I was trying to override this in

app/design/frontend/Company_Name/Theme_Name/app/design/frontend/Company_Name/Theme_Name/Magento_Theme/page_layout/product-full-width.xml


texts:
I want to develop custom shipping method in Magento CE 1.9 as per following functionality:
Either Flat Rate(< $49) or Free shipping(>= $49) will be applied on order automatically.
There will be another shipping method for faster shipping.
Customer can select whether to choose for faster shipping or not in shipping method block.
If customer opts for faster shipping then additional amount will be added to applied shipping charge and that method will be selected.
I tried with applying minimum total for Free shipping. But user is able to choose between Flat Rate or Free shipping. Please refer image for current settings:

Can anyone give some pointers how I can do this?
Thanks in Advance.. :)


texts:
Hi i created custom module with this structure :

Config file code in etc/config.xml

<config>
    <modules>
        <Shareino_Sync>
            <version>0.1.0</version>
        </Shareino_Sync>
    </modules>
    <frontend>
        <routers>
            <sync>
                <use>standard</use>
                <args>
                    <module>Shareino_Sync</module>
                    <frontName>sync</frontName>
                </args>
            </sync>
        </routers>
    </frontend>

</config>

app/etc/modules/Shareino_Sync.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Shareino_Sync>
            <active>true</active>
            <codePool>local</codePool>
        </Shareino_Sync>
    </modules>
</config>

And i just created controller like this :
app/code/community/Shareino/Sync/controllers/IndexController

class Shareino_Sync_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction(){
        echo "index Action";
    }
    public function testAction(){
        echo "index Action";
    }

}

Always I try to open index action i got 404 error.


texts: Magento 2 : Add Date Picker in 24 Hour Format in Admin Form

texts:
I want to add date picker in admin form which display 24 hour format. Currently , I select date then it will display like 4/25/17 5:21 PM

But I want to display like this 2017-04-25 17:21:00

How to do it?

Please help me....

Thanks in advance.... :)

$fieldset->addField(
        'from_date',
        'date',
        [
             'name' => 'from_date',
            'label' => __('From'),
            'title' => __('From'),
            /*'date_format' => 'yyyy-MM-dd',
            'time_format' => 'hh:mm:ss'*/
            'date_format' => $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT),
            'time_format' => $this->_localeDate->getTimeFormat(\IntlDateFormatter::SHORT),
        ]

    );


texts: "Product Type is invalid or not supported in rows" importing csv file

texts:
I’m new in using Magento.

I’m using Magento 1.9. My web site have to sell Paper books and Ebooks, so I set two kind of products in my catalogue: “simple” and “downloadable”. Now my need is to import automatically with a csv (or xml) file all my catalogue. But when I use the import function it works just for “simple product”.

When I import a csv file like this:

sku,_store,_attribute_set,_type,_category,_root_category,_product_websites,title_book […other attributes]
123456,,"paper books",simple,"Paper books","My category",base,"My paper book title" […other values]

Everything works fine. If I change the type value in downloadable, with something like the following:

sku,_store,_attribute_set,_type,_category,_root_category,_product_websites,title_book […other attributes]
123456E,,"ebooks",downloadable,"Ebooks"," My category ",base, ,"My ebook title" […other values]

I get the following message error:
Product Type is invalid or not supported in rows

I tried to import with System>Import/Export/Import root or using the Dataflow Profiles both.

If I change the type value in grouped or virtual or configurable it works. The problem is just for downloadable one.

It’s making me crazy!

Can someone help me, please?

Thank you,
Enzo

EDIT:

And is there a suggestion on how modify the ImportExport config file? I would just need to upload the metadata of my product (the same attributes that I use for my simple products). My will is to add the files manually after the upload of csv file.


texts:
I know no one should use magento 1 anymore, but I've got a client who didn't migrate and now his backoffice is not working anymore.
The problem is identified (and can be resolved) : in a third party module (French Chronopost), there is a call made to check the last release (and it's done on EVERY admin page !) on
http://connect20.magentocommerce.com/community/Chronopost/releases.xml
And since last friday at 14h30 UTC+2 time it gives a 404.
The following of the module is garbage as it assume that there will be something in the simplexml_load_file without testing and so throw an erro when trying to use the $xml it was suppose to return (and now returning false...)
I can't find any official announcement of the plug being pulled of for the site. Anyone know if there is one ?
Not announcement stating that Magento 1 won't be support anymore after june (we've repeated it several time to the customers), but one specific to the end of the connect20 site.
Thanks if you have more information !
Jean-Marc


texts: Adding a list of features to a product via the product's cms page

texts:
I want to display a list of product features on a product page via the Magento Product Information panel without using any HTML.

What's the best way customize the panel to let me do what I'm showing in the picture below. A plug-in or extension that you can recommend is a perfectly suitable answer.


texts: Can any one tell me that how can i publish my opencart extension in opencart marketplace?

texts: I have made extension in opencart 3, I want to publish this extension in opencart marketplace. I already have opencart marketplace account, So please help to publish my extension.


texts: Magento2.3.0 Getting error, when Import Group product via CSV

texts:
I am using magento2.3.0 when I import CSV through group product with associate product getting an error in back end side. If anyone has an idea please share your inputs.

{"error": "Invalid file upload attempt: You cannot define a correlation name 'oi' more than once"}


texts:
I have set up an Email Account in outlook. I sent from outlook to my self
 an email and it works fine

I use the same Settings in Magento Configuration- System in SMTP PRO EMAIL, but the contact form produce an error There has been an error processing your request

If I reproduce this with the other email it works fine


texts: how to add an image programmatically from any url in Magento 2?

texts:
I try this code but if the image doesn't exist in this path pub/media/catalog/product; it doesn't work. I want to add an image from any url; any ideas for that ?

    for ($i = 0; $i < count($productIds); $i++) {
                $productObj->load($productIds[$i]);
                //$productObj->addImageToMediaGallery('catalog/product/l/t/lt01.jpg', array('image', 'small_image', 'thumbnail'), false, false);
                $productObj->addImageToMediaGallery('catalog/product/'.$data['image'], array('image', 'small_image', 'thumbnail'), false, false);
                $productObj->save();
            }


texts: Is there a way of adding a link to a Product Page to Top Navigation?

texts:
I'm very new to Magento, so this might be VERY basic...

I've read about adding links to CMS pages in the Navigation Bar
http://www.magentocommerce.com/knowledge-base/entry/adding-page-links-in-the-navigation-bar

Is there a simple way of adding a link to a Product Page?


texts: Magento 2: Get all category products by category name

texts:
anyone knows how to load from my custom block.php all the products of a specific category,

I would like to get them by the name of the category and not by the id.

I tried to change the standard code used by magento \Magento\CatalogWidget\Block\Product\ProductsList

here is the code:

public function createCollection()
{
    $collection = $this->productCollectionFactory->create();
    $collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());

    $collection = $this->_addProductAttributesAndPrices($collection)
        ->addStoreFilter()
        ->setPageSize($this->getPageSize())
        ->setCurPage($this->getRequest()->getParam(self::PAGE_VAR_NAME, 1));

    $conditions = $this->getConditions();
    $conditions->collectValidatedAttributes($collection);
    $this->sqlBuilder->attachConditionToCollection($collection, $conditions);

    return $collection;
}

but this code get all categories products.


texts: How to show the cart products in email template - Magento 2.3.4

texts:
How to show the cart products in the email template i can't loop into email template, and i can't pass the products into email template, I want send mail with the current cart products so I'am working it but i can't show the car products.

Thanks


texts: check if template file exists before rendering block

texts:
for a given template file string, is it possible to check that it exists before the block is rendered and if not choose a different template to render.

my block therefore has a template set to customer/account/test.phtml

In the beforeToHtml i want to make sure that this can be found using the full fallback mechanism. i.e. that if it cannot be found in the current theme package that it can be found in base.  If both of these fail then i will set a different template.

I can not find any examples in core code that do anything similar.


texts: Magento: Custom file upload from product edit page

texts:
i have created a custom tab inside the product page (backend) and need to be able to upload a file from there.

Here is my code:

  Vendor/Module/UI/DataProvider/Product/Form/Modifier/Attachements.php

....

protected function getDataUploadField()
{
    return [
        'arguments' => [
            'data' => [
                'config' => [
                    'componentType' => 'fileUploader',
                    'formElement' => 'fileUploader',
                    'component' => 'Magento_Ui/js/form/element/file-uploader',
                    'dataScope' => 'file',
                    'fileInputName' => 'image',
                    'uploaderConfig' => [
                        'url' => $this->urlBuilder->addSessionParam()->getUrl(
                            'adminhtml/attachements_file/upload'
                        ),
                    ],
                ],
            ],
        ]
    ];
}

....

  Vendor\Module\Controller\Adminhtml\Attachements\File.php

<?php

namespace Vendor\Module\Controller\Adminhtml\Attachements;

abstract class File extends \Magento\Backend\App\Action
{

    const ADMIN_RESOURCE = 'Magento_Catalog::products';
}

  Vendor\Module\Controller\Adminhtml\Attachements\File\Upload.php

<?php

namespace Vendor\Module\Controller\Adminhtml\Attachements\File;

use Magento\Backend\App\Action;
use Magento\Framework\App\Filesystem\DirectoryList;

class Upload extends \Vendor\Module\Controller\Adminhtml\Attachements\File
{
    protected $UploaderFactory;

    public function __construct(
        \Magento\MediaStorage\Model\File\UploaderFactory $UploaderFactory,
        Action\Context $context

    ) {

        $this->UploaderFactory = $UploaderFactory;
        parent::__construct($context);
    }

    public function execute(){

        $uploader = $this->UploaderFactory->create(['fileId' => 'image']); //ERROR

        $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);

        $uploader->setAllowRenameFiles(false);

        $uploader->setFilesDispersion(false);

        $path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)
        ->getAbsolutePath('images/');

        $uploader->save($path);

    }
}

But I always get:

  File was not uploaded.

I even tried to change the error message in Magento/Framework/File/Uploader.php to

throw new \Exception('File was not uploaded. ' . $this->_file['error'], $code)

But $this->_file['error'] is always empty.


texts: How to add toolbar and pager to new.phtml?

texts:
How to add toolbar and pager to new.phtml ? I tried this code below but the toolbar/pager doesn't show up. Thankyou!!

<reference name="head">
    <action method="addItem">
        <type>skin_js</type>
        <name>js/jquery.elevateZoom-3.0.8.min.js</name>
    </action>
    <action method="addItem">
        <type>skin_js</type>
        <name>js/product-custom-list.js</name>
    </action>
    <action ifconfig="spp/setting/enableModule" method="addItem">
        <type>skin_js</type>
        <name>js/simple_product_pricing_quickview.js</name>
    </action>
</reference>
<reference name="root">
    <action method="setTemplate">
        <template>page/category-layered.phtml</template>
    </action>
</reference>
<reference name="content">
    <block type="catalog/product_new" name="just.catalog.product.new" template="catalog/product/new.phtml">
        <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
            <block type="page/html_pager" name="product_list_toolbar_pager"/>
        </block>
        <action method="setCategoryId">
            <category_id>2</category_id>
        </action>
        <action method="setToolbarBlockName"><name>product_list_toolbar</name </action>
        <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
    </block>
</reference>
<reference name="left">
    <block type="amshopby/catalog_layer_view" name="amshopby.navleft" before="-" template="catalog/layer/view.phtml"/>
</reference>
<cms_page_view>
    <update handle="infinitescroll"/>
</cms_page_view>
<reference name="before_body_end">
    <block type="infinitescroll/init" name="infinitescroll_init">
        <action method="setTemplate">
            <template>strategery/infinitescroll/init_notoolbar.phtml</template>
        </action>
    </block>
</reference>


texts: Place holder image instead of thumbnail product image in magento 2.1.9

texts:
I have installed Magento 2.1.9 and import product via csv. After import

I tried:

  clear Cache

  Static-content generate

  Reindex

  Setup upgrade

  catalog Image resize

  remove all /var/* content

  compile also

Still showing a thumbnail place holder image in  frontend and admin.

The Product Page "Images And Videos" is showing the image Correctly.

Suggest me, how to fix this


texts: displays the last added products on the first page

texts:
I want to display the latest products added to the site.
I use Magento 1.9
use the following code to display:
{{block type="catalog/product_new"  template="/catalog/product/new.phtml"  product_count="12" breakpoints="[0, 3]" pagination="1" centered="2" hide_button="1" block_name="Product New"}}

displays new products randomly.
how to sort the display of the last added products ?


texts:
I have Magento 2.1.4 CE installed. I have browsed the devdocs and forums on upgrading and I am confused.

What commands do I have to run exactly to do the upgrade? When I try to run

composer require magento/product-community-edition 2.1.7 --no-update

it asks for username/and pass but I do not have one. I downloaded the 2.1.4 archive from Magento docs.

Any help?


texts:
I have nearly 20k products and all images have been set to base only. If i go into backend and then set each image one by one to thumbnail and small as well, it will take me forever.
Is there any way to do it via programming or database?

Thanks in advance.


texts:
Been trying to figure out how to add some custom JS files with requirejs.

I've been successful in adding them via default_head_blocks.xml, however... in doing so... they get loaded before the jquery script that magento2 uses...

so I am wondering how I can use the requirejs to add a few .js files and make sure they are loaded AFTER the jquery library?

I read the documentation here:

http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js-resources.html

but it's talking about modules and such, I don't have a module, I am just trying to add some jquery scripts on product pages and the home page.


texts:
I’m trying to calculate a value by subtracting the magento subtotal of my cart from another value, let’s say 50.
This is the code:

<script type="text/javascript">
function minus_number() {
        var a  = document.querySelector("#spend");
        var first_number = '50.00';
        var second_number = '<?php echo Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal(); ?>';
        var result = parseInt(first_number).toFixed(2) - parseInt(second_number).toFixed(2);
        a.innerHTML = result.toFixed(2);
    }
window.addEventListener("load",minus_number());
</script>

Now it kind of works, but the result isn’t right. I think the issue is that the magento subtotal doesn’t include decimals? So if let’s say the subtotal is 6.98 the result is 44.00 so I assume it only subtracts the 6?


texts: How to delete a product programmatically in Magento 2.4

texts:
I've been checking different threads about how to delete a product programmatically in Magento 2. The different solutions proposed are:

Using the Registry to set after that the securedArea parameter
Overriding type RemoveAction arguments in our di.xml
Using Magento\Catalog\Api\ProductRepositoryInterface

This solutions are discussed in this thread: Delete operation is forbidden for current area
The only one that works fine is setting the isSecuredArea parameter to true. But in Magento 2.4, the use of the class Magento\Framework\Registry is deprecated.
What is the correct way to delete a product programmatically in Magento 2.4?
Thanks!


texts: Magento 2 Set Grid/List view on an individual category basis

texts:
I am looking for a way to individually set the default view for each category to grid/list as opposed to the sitewide option.
I have found this solution:
https://magento.stackexchange.com/a/251172/66845

Does anyone know if this still works in v2.3 and v2.4?

If so, how do I install the module provided by Himmat Paliwal


texts:
I am making a ajax call in folowing way:

require(['jquery'], function($){

$("#test1").change(function(){
    var test1Value = document.getElementById("test1").value;
    var test1Label = $("#test1 option:selected").text();

    $.ajax({
        url: 'test_controller_url',/* assume */
        data: ('test1='+test1Value+'&test1Label='+test1Label),
        type: 'get',
        dataType: 'text',
        showLoader: true,
    }).done(function (response) {
        alert("success");
        $("#test2").html(response);
    }).fail(function (error) {
        alert("failure");
  });
});

In controller:

public function execute()
{
    echo "test";exit;
}

Then ajax call completing after 5 sec.
How can I optimize that time.

Used latest jquery.
Magento version : 2.1.5.

Any help will be appreciated.


texts: How to get store data in transaction mails?

texts:
How do I get data like the store owners address from the stoer config in an email template?

Thanks!


texts: Magento 2 - How to get attribute of product?


texts: Magento 1.9.3.6 - menu Catalog -> Search Terms missing

texts:
I couldn't find anything about this on Google.

I have to work on search functionality in a Magento site I didn't install.

For some reason the Catalog -> Search Terms menu is missing:

Magento 1.9.3.6

Any cue/help?

EDIT: I found out that I can reach the page from the dashboard. I have to click on any of the Top 5 Search Terms and then click on <- Back

Anyway the issue is very strange and I didn't find a solution.


texts: Magento 2 - check if category have description

texts: I want to add a new text only if category have description. How I can check in phtml if category description contain text?


texts: Install fails: "Storage engine MEMORY is disabled (Table creation is disallowed)"

texts:
When installing Magento 2 (with `magento setup:install), I receive the following error:

...
[Progress: 16 / 557]
Module 'Magento_Catalog':
Installing schema...

  [Zend_Db_Statement_Exception]
  SQLSTATE[HY000]: General error: 3161 Storage engine MEMORY is disabled (Table creation is disallowed)., query was: CREATE TABLE IF NOT EXISTS `catalog_product_index_price_cfg_opt_agr_tmp` (
    `parent_id` int UNSIGNED NOT NULL COMMENT 'Parent ID' ,
    `child_id` int UNSIGNED NOT NULL COMMENT 'Child ID' ,
    `customer_group_id` smallint UNSIGNED NOT NULL COMMENT 'Customer Group ID' ,
    `website_id` smallint UNSIGNED NOT NULL COMMENT 'Website ID' ,
    `price` decimal(12,4) NULL COMMENT 'Price' ,
    `tier_price` decimal(12,4) NULL COMMENT 'Tier Price' ,
    PRIMARY KEY (`parent_id`, `child_id`, `customer_group_id`, `website_id`)
  ) COMMENT='Catalog Product Price Indexer Config Option Aggregate Temp Table' ENGINE=MEMORY charset=utf8 COLLATE=utf8_general_ci

  [PDOException]
  SQLSTATE[HY000]: General error: 3161 Storage engine MEMORY is disabled (Table creation is disallowed).

This appears to be because Alibaba Cloud has the MEMORY MySQL storage engine disabled.

Is there any way to set all table creations to use InnoDB?


texts:
How to change the checkout page address selection option box instead of dropdown?

Ex:

<option value="2" id="billing_address"></optio>
test Test
 Address1
 Chennai
Tamil Nadu
600001

 New Address


texts: Magento 2 Unique Constraint Violation Found On Product Save

texts:
While saving new product in admin panel I am getting this error "Unique constraint violation found"

Exception Log of this error:

  Unique constraint violation found {"exception":"[object]
  (Magento\Framework\Exception\AlreadyExistsException(code: 0):
  Unique constraint violation found at
  /chroot/home/hannahha/esto.co.uk/html/shop/vendor/magento/framework/EntityManager/Operation/Create.php:134,
  Magento\Framework\DB\Adapter\DuplicateException(code: 1062):
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '4294967295' for key 'PRIMARY', query was: INSERT INTO
  catalog_product_entity (entity_id, attribute_set_id, type_id,
  sku, has_options, required_options, created_at, updated_at)
  VALUES (?, ?, ?, ?, ?, ?, ?, ?)


texts:
I have created the custom admin module working fine.

but when my layout file(mca.xml) put on adminhtml->default->default->layout->mca.xml

it's working fine.

but when I put file into my package adminhtml->default->Course->layout->mca.xml
it's not working? showing empty page.

can anyone tell me where I went wrong?

thanks in advance.


texts:
Continuing previous question.

I successfully retrieved a URL of the next catalog page from catalog pager block (Mage_Page_Block_Html_Pager).
Now I'm trying to add this URL to the head block (e.g. <link rel="next" url="url-to-next-page" />).

-

public function core_block_abstract_to_html_before(Varien_Event_Observer $observer) {

  $block = $observer->getBlock();

  // Check if current block is pager block
  if($block instanceof Mage_Page_Block_Html_Pager) {
    // I'm getting head block
    $head_block = $Mage::app()->getLayout()->getBlock('head');

    // Trying to add  <link rel="next" url="path-to-next-page" /> to head
    // $block->getNextPageUrl() prints correct value
    // But nothing is added to head
    $head_block->addLinkRel( 'next', $block->getNextPageUrl() );
  }

}

Is it possible at least, or I'm doing this in wrong way?


texts: Magento 2: Disable Full Screen Gallery on Mobile

texts:
I'm trying to disable the full screen gallery on magento 2.2.1

The code below does not work. I tried everything,

<var name="breakpoints">
        <var name="mobile">
            <var name="conditions">
                <var name="max-width">767px</var>
            </var>
            <var name="options">

                <var name="options">
                 <var name="allowfullscreen">false</var>
                 <var name="arrows">false</var> <!-- Turn on/off arrows on the sides preview (true/false) -->
                 <var name="nav">thumbs</var>
                </var>
            </var>
        </var>
    </var>

The other part of the code such as thumbs or arrow do work.

It's this part :

 <var name="allowfullscreen">false</var>

This does nothing.


texts: Could not login to admin of my magento store

texts:
have changed my hosting few days back and realized my magento admin login stopped working. tried every possible solution provided by google but no luck. when i submit the credentials it return no errors just redirect me to the same admin login page with url -

http://www.mydomain.com/index.php/admin/index/index/key/c61d446704011292e96df5aa1f626cc7/

Any help would be highly appreciated.


texts: Call different footer.phtml file for homepage

texts:
How can I call footer.phtml only for magento homepage, for rest of the site call footer1.phtml file.
I am using magento version:1.9


texts: Updating Basket quantity using ENTER clears the basket entirely

texts:
Trying to update the quantity in the cart with the ENTER key, the entire cart is deleted. Viewing the form code I realized that in addition to the "update cart" button there are also the "Continue Shopping" and "Clear Shopping Cart" buttons (hidden with display: none).
Then when you click ENTER the Update and CLEAR commands are activated both and the cart is empty.
I am not yet very expert on Magento, can you tell me which file to mood to solve the problem?


texts: How to sort by (dropdown from toolbar.phtml) products which has special price comes first on product list (search or category) page?

texts:
On product list page want option in sort by dropdown discounted first products so all prodcuts in list with special price comes first.

How I can do that?


texts:
i'm working on a website which doesn't need product sku. Is it possible to set the sku=product_id whenever a new product is created? Any side effect doing that?

thanks


texts: Magento227 Maketplace Coding Standard Issue

texts:
When I run: phpcs /path/to/module --standard=MEQP2
It gives me the following error

  PHP Fatal error:  Trait 'MEQP\Utils\Helper' not found in
  /opt/marketplace-eqp/MEQP2/Sniffs/Classes/NameResolutionSniff.php on
  line 23

phpcs -i
The installed coding standards are PSR1, PEAR, Zend, MySource, PSR12, PSR2, Squiz, MEQP2 and MEQP1

class NameResolutionSniff

    <?php
/**
 * Copyright © Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace MEQP2\Sniffs\Classes;

use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
use MEQP\Utils\Helper;

/**
 * Class NameResolutionSniff
 * Dynamic sniff that detects the use of literal class and interface names.
 * Requires 'm2-path' to be configured.
 */
class NameResolutionSniff implements Sniff
{
    /**
     * Include Helper trait.
     */
    use Helper;

    /**
     * Violation severity.
     *
     * @var int
     */
    protected $severity = 8;

    /**
     * String representation of warning.
     *
     * @var string
     */
    protected $warningMessage = 'Literal namespace detected. Use ::class notation instead.';

    /**
     * Warning violation code.
     *
     * @var string
     */
    protected $warningCode = 'LiteralNamespaceFound';

    /**
     * Literal namespace pattern.
     *
     * @var string
     */
    private $literalNamespacePattern = '/^[\\\]{0,2}[A-Z][A-Za-z0-9]+([\\\]{1,2}[A-Z][A-Za-z0-9]+){2,}(?!\\\+)$/';

    /**
     * Class names from current file.
     *
     * @var array
     */
    private $classNames = [];

    /**
     * A bootstrap of Magento application.
     *
     * @var \Magento\Framework\App\Bootstrap
     */
    private $bootstrap;

    /**
     * @inheritdoc
     */
    public function register()
    {
        return [
            T_CONSTANT_ENCAPSED_STRING,
            T_DOUBLE_QUOTED_STRING,
        ];
    }

    /**
     * @inheritdoc
     */
    public function process(File $sourceFile, $stackPtr)
    {
        if (Config::getConfigData('m2-path') === null ||
            $sourceFile->findPrevious([T_STRING_CONCAT, T_CONCAT_EQUAL], $stackPtr - 1, null, false, null, true) ||
            $sourceFile->findNext([T_STRING_CONCAT, T_CONCAT_EQUAL], $stackPtr + 1, null, false, null, true)
        ) {
            return;
        }
        $tokens = $sourceFile->getTokens();
        $content = trim($tokens[$stackPtr]['content'], "\"'");
        if (preg_match($this->literalNamespacePattern, $content) === 1) {
            if (!$this->bootstrap) {
                $this->bootstrap = $this->getBootstrap();
            }
            if ($this->classExists($content)) {
                $sourceFile->addWarning($this->warningMessage, $stackPtr, $this->warningCode, [], $this->severity);
            }
        }
    }

    /**
     * Checks if class exists by class name.
     *
     * @param string $className
     * @return bool
     */
    private function classExists($className)
    {
        if (!array_key_exists($className, $this->classNames)) {
            $this->classNames[$className] = class_exists($className) || interface_exists($className);
        }
        return $this->classNames[$className];
    }
}

and line no 23 is :

  use Helper;

Any idea how to fix this issue?


texts: Catalog URL Rewrites stuck - core_url_rewrite empty

texts:
My catalog url rewrite has been stuck for days, the core url rewrite table was empty, but the url rewrites did show on the website.  we truncated the core url rewrite, the site url rewrite have gone, the reindex is still stuck and no rows showing in the core url rewrite.

any ideas please.


texts: Force a quote to take the default shipping methods, ignoring any site-specific settings

texts:
I need to intercept quotes and have them use the default shipping methods and not use the shipping methods defined on a website level.

Is this doable? I've dug through the code for hours and can't find anything useful.


texts: How make a custom variable to get Payment ticket bank (Boleto in PT-BR) in Magento 2

texts:
How can I get a payment ticket link in Magento 2  and set this value in a "Custom Variable" to use in my emails Templates?
I know how to get a transaction and I think the ticket is a string inside "transaction object"

Ex:
$transactions = $this->transactions->create()->addOrderIdFilter($orderId);
$transaction->exampleGetTiketLink();

But I don't know how to define this in my custom variable in this dashboard.


texts: After reset filter or search in grid searlizer. I am not able to do mass actions. Alert is coming with message "Please select the items"

texts: After reset filter in admin grid. Mass actions are not working. I am getting an alert message.


texts: onepage checkout not moving to next step after billing info

texts:
I'm new user of magento, & my domain Is www.zinzzy.com where having problem in onepage checkout page, Next step not moving after billing information , i have checked firebug i think it takes ajax uploader image/file path from base \app\design\frontend\base\default, while it takes my theme file \app\design\frontend{theme name}\default.Please help me any one.

Thanx in advance


texts: Old product url to new product url redirect in magento 1.x

texts:
Well this might be duplicate of others but it didn't got my answer...

Okay so I want to redirect user from old product url to new product url so by googling I've found following code....

Here I'm passing following variables in createRuleCommunity function.

$fromUrl = 'http://www.example.com/product-old-url.html';
$toUrl   = 'http://www.example.com/product-new-url.html';

public function createRuleCommunity($fromUrl, $toUrl)
    {
        // Create rewrite:
        /** @var Mage_Core_Model_Url_Rewrite $rewrite */
        $rewrite = Mage::getModel('core/url_rewrite');
        $this->storeIds = Mage::app()->getStores();
        // Check for existing rewrites:
        foreach($this->storeIds as $storeId)
        {
            // Attempt loading it first, to prevent duplicates:
            $rewrite->loadByIdPath($fromUrl);

            $rewrite->setStoreId($storeId);
            $rewrite->setOptions('RP');
            $rewrite->setIdPath($fromUrl);
            $rewrite->setRequestPath($fromUrl);
            $rewrite->setIsSystem(0);
            $rewrite->setTargetPath($toUrl);

            $rewrite->save();
        }
    }

After executing this function when I visit

http://www.example.com/product-old-url.html

It's not direceting me to new url which is http://www.example.com/product-new-url.html

And new url (http://www.example.com/product-new-url.html) is become 404 Error

I want when user visit following url

http://www.example.com/product-old-url.html

He/She should be redirected to new url

http://www.example.com/product-new-url.html

So in short by any visiting old url user should be redirect to new product url.

So is there any direct way to do so??

All I've is product old url and new url and I want to do this job programmatically.


texts: Newbie: Can't install magento 2.3.3 with nginx on Ubuntu 18.04 LTS

texts:
I'm relatively new with Magento, but I have already wasted many hours just to install Magento2 with nginx on Ubuntu 18.04 LTS on a cloud, AWS, Gcloud etc... In the end it doesn't work...

The result that I get is a page: Autoload error
Vendor autoload is not found. Please run 'composer install' under application root directory.

I did install composer, then I got some missing symfony/mime ^4.3, then everything got f-ed up.

What am I doing wrong? Do you know of any good tutorial on how to Install latest magento with nginx on ubuntu, I tried them all on the first and second page of google and only 2 videos on youtube. None of them worked for me.


texts: \StoreResolverInterface->getCurrentStoreId() taking huge amount of time to resolve current store ID in StoreManager.php

texts:
Running Magento 2.3.4 and encountering an issue with Magento core code.

For the past couple of days I've been battling terrible performance on my site, especially when serving uncached content via pub/static.

Investigating this by enabling Magento's profiler, I noticed that the store.resolve event was taking upwards of 12 seconds to process when fetching a single JavaScript file via pub/static:

Looking at the code, this event is located in the Magento\Store\Model\StoreManager class:

    public function getStore($storeId = null)
    {
        if (!isset($storeId) || '' === $storeId || $storeId === true) {
            if (null === $this->currentStoreId) {
                \Magento\Framework\Profiler::start('store.resolve');
                $this->currentStoreId = $this->storeResolver->getCurrentStoreId();
                \Magento\Framework\Profiler::stop('store.resolve');
            }
            $storeId = $this->currentStoreId;
        }
        if ($storeId instanceof \Magento\Store\Api\Data\StoreInterface) {
            return $storeId;
        }

        $store = is_numeric($storeId)
            ? $this->storeRepository->getById($storeId)
            : $this->storeRepository->get($storeId);

        return $store;
    }

storeResolver is an instance of Magento\Store\Api\StoreResolverInterface, the direct usage of which I notice has been deprecated by Magento, maybe because of performance issues.

Following the code further, it looks like Magento tries to determine the current store code from the current HTTP request, eventually ending up in Magento\Store\App\Request\StorePathInfoValidator->getValidStoreCode().

However I haven't been able to find out why the performance is so poor.

Does anyone have any ideas why this is happening?


texts: Migrating Joomla! users to Magento without losing their passwords?

texts:
We have tried to migrate our old Joomla! users to our new Magento platform , all the users information is migrated except their passwords !

Anyone have solution ?


texts: How to add featured products to product collection

texts:
I'm trying to modify some code to output products with a 'featured' attribute set to "yes"

here is what I am working with:

<?php

 class Mage_Catalog_Block_Product_Featured extends Mage_Catalog_Block_Product_Abstract{
    public function __construct(){
        parent::__construct();

        $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'featured');
        $attributeId = $attribute->getId();

        $storeId    = Mage::app()->getStore()->getId();
        $products = Mage::getResourceModel('reports/product_collection')
            ->addOrderedQty()
            ->addAttributeToSelect('*')
            ->addAttributeToSelect(array('name', 'price', 'small_image', 'featured'))
            ->setStoreId($storeId)
            ->addStoreFilter($storeId)
            ->addViewsCount();
        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);

        $products->setPageSize(16)->setCurPage(1);
        $this->setProductCollection($products);
    }
}

this does output products, but not the featured ones.

how do I alter the query so that it only selects featured products
it looks like it's adding all attributes to the select, is this correct & how do I output an attribute value in my phtml template?


texts: Any Upcoming SUPEE patches (1.x version)?

texts: To my knowledge last SUPEE update was in March/April 2016. Any ideas when to be prepared for another SUPEE update for 1.x versions?


texts:
I have used setup to create table but script is not creating the table. I have also removed the entry from setup_module table but still, it didn't work.

InstallSchema.php

<?php
namespace Vendor\Module\Setup;

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

/**
 * @codeCoverageIgnore
 */
class InstallSchema implements InstallSchemaInterface
{
    /**
     * {@inheritdoc}
     */
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;

        $installer->startSetup();

        /**
         * Create table 'rentals'
         */
        $table = $installer->getConnection()->newTable(
        $installer->getTable('rentals'))
         ->addColumn(
            'id',
            \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            null,
            ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
            'Id'
        )->addColumn(
            'name',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => false],
            'Name'
        )->addColumn(
            'phone',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => false, 'default' => '0'],
            'Phone'
        )->addColumn(
            'email',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            [],
            'Email'
            )->addColumn(
            'address',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            [],
            'Address'
            )->addColumn(
            'sku',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            [],
            'Sku'
            )->addColumn(
            'qty',
            \Magento\Framework\DB\Ddl\Table::TYPE_Integer,
            null,
            ['nullable' => false],
            'Qty'
        )->setComment(
            'rentals'
        );
        $installer->getConnection()->createTable($table);

        $installer->endSetup();

    }
}


texts: Magento 2 - Send 403 status and access denied content and redirect using Observer

texts:
I am using below function to send 403 status and "access denied" content and redirect user to some other website or custom page if user's IP is not in list of allowed IP's (whitelist)

protected function denyAccess($observer)
{

    /** @var \Magento\Framework\App\Action\Action $action */
    $action = $observer->getControllerAction();
    /** @var \Magento\Framework\App\Response\Http $response */

    $response = $action->getResponse();
    $response->clearBody()->setStatusCode(\Magento\Framework\App\Response\Http::STATUS_CODE_403);
    $this->actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);

    $redirectUrl = 'https://someotherwebsitestore.com';
    header("Location:".$redirectUrl);
    exit;
}

How do I redirect user from observer to some other page or website and keep on same website if IP is whitelisted?
Using header when IP is not allowed, the user still remains on website. Only when cache is cleared, user gets redirected?


texts: Give priority to certain products on list and search products in magento

texts: I want to give certain priority to some products like (some products comes first on listing or search page). For that purpose should i change the block of list and search ? What type of query it should be.I can call collection and know but don't know how to come up first certain products then others.So any hint or help will be appreciated.Thanks in advance


texts: After installing magento 2.3 admin login page cant open properly

texts: After installing Magento 2.3, When I am trying to open the admin panel login screen is blank and my console contains an error as shown in the image. if anyone has a solution then please let me know.


texts: Magento 2: New theme XML files not loaded on live site

texts:
My new theme works locally, but when once uploaded to live server, selected in the Admin, it shows some content, but it's not using my new XML files. The new default_head_blocks.xml defintely isn't being loaded.

Actually, some files are being loaded, but some aren't


texts:
I am working on Magento Go ver 1.0.0.37v. What am I trying to is that I want to edit the invoice pdf. I searched on google I found this link.

According to this doc there should be an option "template" under system but I am not able to find it. So does any one know why am able to see that menu. Is this because of version or my plan that i have opted.


texts: how to automatic update file `.less` in custom theme magento2?

texts: In custom theme i have create file custom.less  after  Flush JavaScript/CSS Cache and Fersesh cache it  compiling .less files to CSS. but after i change file custom.less this file not update. i tried set Client-side LESS compilation it not luck. So anysuggestion? Many thanks.


texts: Remove /pub/media/styles.css from theme in Magento 2.0

texts:
I installed Sample data on magento2.

How do I remove this stylesheet from my theme?

<link  rel="stylesheet" type="text/css"  media="all" href="http://example.com/pub/media/styles.css" />

I have tried this in my default_head_blocks.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <remove src="http://example.com/pub/media/styles.css/>"/>
    </head>
</page>


texts: Apostrophe inside magepage.csv makes SyntaxError

texts:
I'm confronting 2 Magento eCommerce, one is 1.9.2.1 and the other 1.9.3.2, they both have this translation inside Mage_Page.csv

 "- Use the %s, %s buttons to select year","- Usa i bottoni %s, %s per selezionare l\'anno"

Problem is with 1.9.2.1 I get this error on web console:

SyntaxError: missing ; before statement

What could be the difference between the two?


texts:
I need to override a less file in /lib/web/css/source/lib/ because _navigation.less contains a mixin .lib-main-navigation-desktop() which use some !important rules that brooke the submenu positioning.

What is the "right" way to do it?


texts: Different storeviews (languages) with different url's not working

texts:
We have a multilanguage store, was working fine. Now we changed the URL for every language but now the switch is not working anymore. Not even changing the language anymore.

compile, cleaning cache, even setting to production is not working.

  www.koperenpannen.com / www.copperpans.store


texts: Show currency switcher in custom template file Magento2

texts:
I am trying to show currency switcher in custom template file.

I referred some links and found for magento1.

Where they used below code in the template files.

  <?php echo  $this->getLayout()->createBlock('directory/currency')->setTemplate('directory/currency.phtml')->toHtml();?>

Same code i tried in magento2, which is not working.

I have tried this also in my template file.

 <?php echo  $block->getLayout()->createBlock('directory/currency')->setTemplate('directory/currency.phtml')->toHtml();?>

Which is not working.

Can anyone help me is there any other way to achieve this functionality.

Thanks!!


texts: How to get layer navigation category and Attributes in magento 2.1

texts:
Magento 2.1 category page will be get some filters with attribute code and value.

After applying attribute code filters, how to get remaining filterable attributes list by programmatically. please help me anyone see the previous post Get Remaining Filterable attributes after applying filters Magento 2.

am using this code see below

$filterableAttributes = $om->get(\Magento\Catalog\Model\Layer\Category\FilterableAttributeList::class);

$layerResolver = $om->get(\Magento\Catalog\Model\Layer\Resolver::class);
$filterList = $om->create(
    \Magento\Catalog\Model\Layer\FilterList::class,
    [
        'filterableAttributes' => $filterableAttributes
    ]
);

$filterItemFactory = $om->create('\Magento\Catalog\Model\Layer\Filter\ItemFactory');

$layer = $layerResolver->get();

 $layer->setCurrentCategory($categoryId);

 $filters = $filterList->getFilters($layer);

how to pass attribute code value as argument like category "$layer->setCurrentCategory($categoryId);".

Please help me through source code


texts: Rename website, store group, and store in setup script

texts:
Is it possible to have a setup script do:

Rename the default website
Rename the default store group
Rename the default store view
Add another store view to a store group
Add another store group to a website

We have vagrant boxes and when we on board a new developer we need these things to occur so that we don't have to create them manually.

This is what we've got so far:

Mage::register('isSecureArea', true);
// Remove default website, store, and store view
$defaultWebsiteModel = Mage::getModel('core/website');
$defaultStoreGroupModel = Mage::getModel('core/store_group');
$defaultStoreView = Mage::getModel('core/store');

Mage::unregister('isSecureArea');


texts: How to change "Shipping & Handling" label to "Order Shipping & Handling" in admin order create form?

texts: How to change "Shipping & Handling" label to "Order Shipping & Handling" in admin order create form and order success email in magento 2.2.3?


texts: How does low-quantity notification work?

texts:
In my test site (Magento CE 2.3) I've set the "manage stock" option to yes and set the "Notify for Quantity Below" option to 5.
As you can see my current Quantity is 1 but I haven't received any notification. Where should I look for it?
I've enabled RSS but the feed is empty.
I've ran indexer multiple times.
My MSI Inventory is not enabled since it was giving me problems.


texts: Setting a custom variable in magento transactional emails

texts:
What I want to achieve is to add a custom variable in the header, which displays me if I am on account related template to show "Account" or if I am on invoice template to show "Invoice" and so on.
I read this article and I didn't find this kind of variable.
Is there a way to create this kind of variable:

{{ var custom_email_name }}

?

Thx in advance


texts: Magento 2 di.xml Parameter configuration inheritance explanation with example

texts:
I read about the Parameter configuration inheritance in Magento documentation but not able to understand the concept properly!

https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/di-xml-file.html#parameter-configuration-inheritance

Can anyone please guide and provide a detailed explanation with an example?
Many many thanks!


texts: Magento2: Move an element inside an existing element with catalog_product_view.xml

texts:
In catalog_product_view.xml file, i need following output like in product details page

```


texts: How to add CSV Import/Export Functionality

texts:
I have created custom gallery extension but I need to implement an import and export or gallery data in the CSV Format.

I did too much research but couldn't find any useful link to find solution so please let me know if anybody had idea for this.


texts:
Im using a code to get a product collection from a specific category, but if the category is inactive it returns empty to me.

Is there a way to retrieve the products even if the category is inactive?

Here is the code:

$category = new Mage_Catalog_Model_Category();
$category->load(111); //cat_id
$collection = $category->getProductCollection();
$collection->addAttributeToSelect('*');

It works fine on active categories.

Thanks,


texts: Magento2: How to add cart summery(tax,discount,shipping etc) in minicart popup

texts: I want to display Shopping cart summery in mini-cart popup Like below screenshot can anyone help me out to display cart summery in minicart.


texts: Magento 2 sort category programmatically by alphabet ascending order

texts: I want to sort  category programmatically by alphabet ascending order. I am able to append category programmatically by below code. But I can not able to sort category by code.