texts: I'm using Solr with Enterprise Edition 1.13.  When running a re-index on catalogsearch_fulltext from the command line about 15 minutes into the process the search on the site will start returning an error page with a MySQL error (1205: Lock wait timeout exceeded). Not long after that the indexer.php script dies.  Has anyone else run into this problem?  Seems like a bug in the core to me.  We have not made any modifications associated with search.  Running a re-index when using MySQL Fulltext for search works fine.


texts: Magento 1 : how to override/rewrite a core controller class?

texts:
Note: This is intended as a canonical question that fully explains how controller rewrites work and can be used as duplicate target for more
  specific "How do I override controller X" or "Why does my rewrite not work"
  questions.

  See also: Looking for canonical questions about Magento 1 overrides

Let's say, I have to make changes to a core controller class in a custom module (change methods or add methods). How do I do this, step by step?


texts: Magento2 Page jumps to top when click Menu Icon on mobile

texts:
How to Stop the top menu bar scrolling up the page in website
I have same issue facing like below website but  I am using Porto theme and I have checked with default luma theme this issue also coming on luma theme also
NOTE: my header is the sticky header on mobile
Example : https://outfitters.com.pk/pages/men


texts:
I am working at this tutorial in order to rewrite custom JavaScript

in my projet I have included in theses locations :

app/code/Magestore/CustomWidget/view/adminhtml/web/js/grid.js

... empty file  ...

app/code/Magestore/CustomWidget/view/adminhtml/web/js/requirejs.js

(function(require){
    (function() {
        var config = {
            map: {
                '*': {
                    'Grid': Magestore_CustomWidget/js/grid,

                    'mage/adminhtml/grid':Magestore_CustomWidget/js/grid

                }

            }

        };

        require.config(config);

    })();

})(require);

app/code/Magestore/CustomWidget/view/frontend/web/js/testJQ.js

console.log('here grid custom widget module');

define([
    "jquery"
],
function($) {
    "use strict";
    // Here your custom code...
    console.log('Hola');

    console.log("My name is "+$(".nom").html())

});

But when I open the home page and check the console I found nothing , anyone has an idea about that , this is from a tutorial but I don't have any idea about the rules concerning external links in order to post it .

Thanks in advance


texts:
Admin>Customers>Online Customers does not tell you much about users browsing the site.

Has anyone found a solution to see how many people from unique IPs are shopping the site? And what page they are on? What city / country they are from? Are the users real users or robots?


texts: Lost ability to edit CMS, products & attributes after upgrading from 2.1.2 to 2.1.3

texts:
After upgrading to Magento 2.1.3 using composer I have lost the ability to edit anything. When I click to edit or create products, CMS pages, attributes etc. it simply doesn't show anything to allow editing.

Everything worked perfectly before the upgrade and I have tried deleting cache & static files as well as compiling, redepolying static content, etc.

Other people also seem to have this issue, see GitHub:

https://github.com/magento/magento2/issues/7834

Any help greatly appreciated otherwise I am going to have to do a complete wipe and reinstall.


texts: Magento 2: LayeredNavegation filters with incorrect price

texts:
I have products that appear in the catalog view with the attribute "minimal_price" and the LayeredNavegation filters them for the "price" attribute. I want the filter to use the "minimal price" instead of price.

Atributes of the product:

[273]=> array(37) {
            ["entity_id"]=> string(3) "273"
            ["price"]=> string(7) "59.9000"
            ["final_price"]=> string(7) "59.9000"
            ["minimal_price"]=> string(7) "49.5074"
            ["min_price"]=> string(7) "59.9000"
            ["max_price"]=> string(7) "59.9000"
            ["tier_price"]=> string(7) "49.5074"
}

Filter: (I have tried changing the value "price" to "minimal_price" but it doesn't work.)

$this->getLayer()->getProductCollection()->addFieldToFilter(
        'price',
        ['from' => $from, 'to' => $to]
);

How to change this?


texts: Layout switcher for product view magento 2.3.5 (Custom layout update)

texts:
Since the update to Magento 2.3.x it is possible to change the layout of the product output using a product id or sku:

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/product-layouts.html
https://amasty.com/knowledge-base/how-to-add-the-custom-layout-update-on-magento-2.html

Unfortunately there is no possibility to give different designs generally for product types with custom layout update like:

catalog_product_view_selectable_<to-all-products>_<layout-name>.xml

Is there any other way to control the design of the product output in admin?

As an example I would need for the bundle product three different layouts in the frontend, which layout should be loaded controllable via admin in the product itself.


texts:
I installed 7405 and 8788 patches to my project.Patches applied succesfully in applied.path.list file but in mage report it shows "not installed".Why
Any idea?

What is the difference between "Unknown" and "Installed" in magereport patch status


texts: paypal express checkout for AED currency

texts:
My base currency is AED. But as per paypal supported currencies I cant pay in AED. So, I converted the currency to USD and changing the currency code to USD.

Now I can able to reach paypal with currency code as USD and converted currency. After competing payment I am being redirected to paypal/express/return/ Frmo returnAction forwarded to Paypal\Model\Express\Checkout.php but after executing the line $service->submitAll() in the method place i am getting error as below

  PayPal gateway has rejected request. The transaction currency
  specified must be the same as previously specified (#10444:
  Transaction refused because of an invalid argument. See additional
  error messages for details).

Unable to understand whats happening $service->submitAll()


texts:
How to use GridJsObject on grid ui component Magento 2 ( not grid layout )
Hi guy, I did research about it, but nothing related for use on grid ui component, can some one help me. I need use gridJsObject.doFilter there
I tried searching for the id of grid by console.log (window), but there's too much here, so, i can't find it


texts: CSV import: Problem with comma as multiple value separator (Magento 2)

texts:
I have to import products with CSV Products Import (System->Import) in Magento 2.

But I have problems with the Multiple value separator. If I choose the standard separator comma, it doesn't import product data completely. For example I have comma in description field, it is importing only the text until first comma. The rest of text is cut off. The same with additional_images where is only the first image imported. I have this problem with all product fields.
I tried to use quotation marks and apostrophes without any success.

Another Multiple value separator isn't working either because the fields categories and additional_images doesn't support another one.

So how can I prevent the problem with comma separator?


texts: Magento hangs when i click install, using wamp server

texts:
I'm trying to install Magento version 2.3.2 on a wamp server, Apache version is 2.4.39 PHP 7.1.29 MySQL 5.7.26 when i reach the install button after filling all my details it freezes on 0% and the console
log reads:

Starting Magento installation:

File permissions check...

Required extensions check...

Enabling Maintenance Mode...

Installing deployment configuration...

Installing database schema: Schema creation/updates:

Any help greatly appreciated


texts:
I've managed to get custom models to load before with the following code:

$model = Mage::getModel("banner/banner")
    ->getCollection()
    ->load();

But I need to now sort by an order value as well as limit the results to 6. So I wrote the following:

$home_blocks = Mage::getModel("homeblocks/homeblocks")
    ->getCollection()
    ->setOrder('order', 'ASC');
    ->setPageSize(6)
    ->setCurPage(1);
    ->load();

This however is causing werrors, specifically the following Magento error

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
  error in your SQL syntax; check the manual that corresponds to your
  MySQL server version for the right syntax to use near 'order ASC' at
  line 1

The column is defiantly called order. Adding data from the back end of magento works fine. it's just when trying to read out I'm having issues.

For reference I'm currently sticking the code directly into a custom layout file locate din the pages folder with the other default templates of my theme.


texts: Magento 2 Database Connection And Getting Info

texts:
I am new to Magento 2, it is normal to use the usual way

$servername = "localhost";
$username = "username";
$password = "password";

// Create connection
$conn = mysqli_connect($servername, $username, $password);

// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
?>

or is there anyway around to get informationfrom the database


texts:
Can anyone help me for payload of paypal standard we are trying two api's nothing works for us. We tried multiple payloads already but no success in order placement.

POST /V1/guest-carts/{cartId}/payment-information
Selected method


texts:
I have tried to load collection in custom grid Based on current product data

<?php
$redirectUrl = $this->helper->getCurrentProduct();
             $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $request = $objectManager->get('Magento\Framework\App\Request\Http');
            $param = $request->getParams();
            $productId =  $param['current_id'];
             $product = $this->helper->getLoadProduct($productId);
             $sku = $product->getSku();
             $TestData = $product->getTestData();
             $TestDatasarr = explode("|", $TestData);
             $TestDatavalues = "'" . implode("', '", $TestDatasarr) . "'";
            $this->getSelect()->orwhere("main_table.testdatas IN($TestDatavalues)");

In the above code i got $TestDatavalues like 'test','test1','test2' when I pass the values manually in getslect in like $this->getSelect()->orwhere("main_table.testdatas IN('test','test1','test2')");

It shows the collection data but when I pass the variable it shows empty data $this->getSelect()->orwhere("main_table.testdatas IN($TestDatavalues)"); when i print it shows the empty

Can anyone help on this.


texts: Magento 2 admin controller is not working

texts:
Here am added a admin controller, here is my code
etc/adminhtml/routes.xml

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

Here is the controller file
My/Orders/Controller/Adminhtml/Index/Index.php

<?php

namespace My\Orders\Controller\Adminhtml\Index;

    class Index extends \Magento\Backend\App\Action
    {
         public function __construct(
            \Magento\Backend\App\Action\Context $context,
            \Magento\Framework\Registry $coreRegistry,
            \Magento\Framework\View\Result\PageFactory $resultPageFactory
        ) {
            $this->resultPageFactory = $resultPageFactory;
            parent::__construct($context, $coreRegistry);
        }
        public function execute()
        {
           $result = $this->resultPageFactory->create(ResultFactory::TYPE_RAW);
           echo "save contoller";

        }
          protected function _isAllowed()
        {
            return true;
        }
    }
    ?>

When I try to access the Controller its giving Error:404
Url path is
http://magentowebsite.co/admin/my_orders/index/index

Where am doing wrong. Can I get help?
Thank you in advance.


texts: How can set new label Icon for selected category in menu popup

texts: I need to create New Label Icon for selected categories, How can I create new labels icons  like,


texts: Possible to hide admin menu if custom module is disabled?

texts:
I am working on a custom backend module that has an option in System > Configuration to enable or disable the module.

I would like to know if it is possible to hide the navigation item from the admin dashboard if the module is disabled?


texts: Magento 2: Get custom editor attribute by category id for category on frontend

texts:
I am not able to get custom editor attribute by category id.

Here is my code:

$categoryData = $objectManager->create('Magento\Catalog\Model\Category')->load($collection);
 $swatch_attribute = $categoryData->getData('swatch_icons');

I am not getting the result with this code.

Does anyone have any idea?

Thanks


texts: Import Multiple Category with Product CSV

texts:
I am trying to import product through Magento 2 Admin Panel using CSV file. My CSV file looks like below

I have categories like All Category/Bikes, Scooters & Ride-Ons and All Category/Fashion Accessories, All Category/Fashion Accessories/Ladies.

If I import this CSV file I got categories like.

All Category/Bikes
Scooters & Ride-Ons
All Category/Fashion Accessories
All Category/Fashion Accessories/Ladies

I tried with below CSV file.

I got below result.

How can I solve this issue ?


texts: Magento 2.2: AMP page is not working after installing varnish

texts:
I've installed 3rd party extension for AMP and it was working fine before installing varnish. After varnish, I am getting normal page and it starts fetching amp pages after opening 2-3 pages.

Has anyone any idea why this is happening?


texts: How to get base_discount_amount field in customer order invocies listing API?

texts:
Is there any way to get base_discount_amount field in customer order invoices listing API?
rest/V1/invoices?
What I am currently getting from the API is pictured below. However, individual record API seems fine. I know that more fields will cause overhead for server, but this is a requirement for my project.
rest/V1/invoices/1


texts:
I am showing Shop By Price on left sidebar. In Configuration → Catalog → Catalog → Layered Navigation i have Price Navigation Step Calculation to Manual and Default Price Navigation Step to 100and Maximum Number of Price Intervals is 5.
The anchor option in the Categories are Yes.
Also In Managed Attributes price -> Use In Layered Navigation is Filterable (with results).
But Shop By Price Not Showing.


texts: Configuring Design "Exception" Strings for "Mobile" Devices

texts:
What Exception strings are "state of the art" for redirecting iPhone, iPad, Android, tablet, etc. users to a different design?

That is, I realize in the

System -> Configuration -> Design

user interface, there's a feature that allows me to create a regular expression that's matched against the user agent string.  What I'm looking for is what specific strings people are using to redirect non-desktop computers to a different mobile and/or response theme?

Or is there a better approach than the "Exception" approach to take these days?


texts: I'm trying to disable the default UrlRewrite event observers in the magento-catalog-url-rewrite Module. I have extended the file under app/code/xyz/MagentoCatalogUrlRewrite/etc/events.xml, set the option disabled=true in the relevant observers but the events still fire. Is there something I'm missing?


texts: How to list tens of thousands of items from different vendors on our magento platform in a short period of time?

texts:
I have xls and csv files coming from the vendors (including products attributes) in different formats and different columns .

Each file includes 10000+ products
Is there is a way to enhance the data entry process to my magento store ?


texts:
I need to wrap .header.content in a . How can I do that using default.xml file?
I think using something like that:
        <referenceBlock name="header-wrapper">
            <container htmlTag="div" htmlClass="header-main-wrapper">
                <block name="??? />
            </container>
        </referenceBlock>

I cannot find the block name... how can I find it out?


texts: CatalogSearch Reindex causes some items to disappear

texts:
I deleted and updated multiple items in one of my categories. Previously, I had 20+ items across 3 different brands in my category. I deleted a number of them and now have 14 items across 2 brands. However, when I go to that category, it still shows "26 Item(s)" at the head of the results, and the layered nav still has product counts for attributes from the delted products. For example it still lists the brand that has been deleted completely as being returned with (6) products. If I then click to filter by it, no results are listed as the items have been deleted. I am assuming it is a caching or indexing issue but my indexes all show up to date and I have flushed and refreshed the cache.

EDIT: Update and some more information:

When I reindex catalogsearch_fulltext, it fixes the item counts. HOWEVER, it then causes many of my items not to show on the site any longer. So now the category will show the proper count of 14, but only 4 items will show up. The items still exist on the site and their item detail pages can be accessed directly, but they don't show up on list pages. This appears to only happen to items added somewhat recently. I am still pinpoiting the exact product ID that is the cutoff, but all after that cutoff fail to show on a reindex, but all before still show on a reindex.

To try to fix it, I disabled and re-enabled all items in the category, which caused them to show again. However, when I then did a mass disable/re-enable on the rest of the site, some items went missing again. I had to go through each category and do them that way to get them all to show again, but the counts are now off again as well.

Some relevent configuration info: there are two magento instances on the server, and running the indexer on one instance also runs it for the other, and I'm not sure why that is the case. They are configured for separate databases. The site also uses a SOLR instance running on the server.


texts: Magento Free extension for backup and restore content?

texts: i have installed Backup Guard of version 1.0.4 extension but it is not working at the time of import can any one suggest Magento1.9.2 Free extension for backup and restore content ?


texts:
Whenever I go to the checkout page I see the following specification:

Subtotal            € 39,95 (this is including tax)
Shipping Excl. Tax  €  5,00
Shipping Incl. Tax  €  5,00
Tax                 €  6,93
Endtotal            € 44,95

It should be:

Subtotal            € 39,95 (including tax)
Shipping Excl. Tax  €  4,13 *
Shipping Incl. Tax  €  5,00 (4,13 + 0,87)
Tax                 €  7,80 (6,93 + 0,87)
Endtotal            € 44,95

NB: The sums in parentheses are just to explain how these values are calculated. I don't need them displayed. Similarly this applies to "shipping excl. tax". I display it here to make things clear.

So in effect, the tax amount should be calculated for the subtotal including shipping

(39.95+5) - (39.95+5) / 1.21 = 7,80

How can I configure magento to do this?


texts: Inserted code in footer and product dissappere

texts:
I have a problem with some code deleting itself.
I have inserted an image in the footer, just below the newsletter subscribe button, and a code showing the stock lvl on the product pages.
But after a while, its gone. And when I look at the code, its deleted.

Anyone know why and how to fix it?

Footer code:

 <img src="<?php echo $this->getSkinUrl('images/betaling6.png') ?>" alt="betaling" />*

Product page code: Can't show whole code here, but I found it here:
http://www.toweringmedia.com/blog/?p=21


texts: how to correctly format a csv file for import in magento

texts:
I am currently trying to import products from a supplier however I get multiple errors which I assume have to do with the formatting of the csv file I am trying to import.
the column headers in the csv file are as follows.

    Name,SKU,UPC,Description,Weight,"Dimensions(length x width x eight)",Price,MAP

and the content is as follows

       "Product Name",SKGK,"6 16983 31439 5","inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam
 voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia
 consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
 Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
 consectetur, adipisci velit, sed quia non numquam eius modi tempora
 incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut
 enim ad ",10,"15"" x 12"" x 6""",27.2,38.99

however I get multiple different errors, how would I format this correctly so that I can import data into magento?


texts: Magento 2.1.1 Cart always empty | section-config.js error

texts:
In Magento 2 I've updated it to latest version to solve cart issue.

When I click on Add to Cart Button it redirect me to cart page(Even in backend "After Adding a Product Redirect to Shopping Cart" I've set it to No) and it always show Cart is empty and after click Add to cart button I'm getting following error in my console.

In my backend cookie setting is as follow ...

Also there is no session folder in var

How can I solve this issue??

Let me know if you want more information.


texts:
I'm trying to add a simple responsive grid into magento 2 by adding it into an additional stylesheet.

This does work on mobiles and when using inspect element in chrome however if I do not inspect element and resize the chrome window to test a narrow viewport below 767px the rule is not applied. This is making is very hard for me to diagnose because as soon as i click inspect element everything starts working as expected.

Example rule:

@media all and (max-device-width : 767px) {
    .col-4 {
        width: 100%;
        border-right:0px;
    }
}


texts: How can I reindex a particular index or table without SSH?

texts:
I need to reindex some tables, like catalog_product_flat Or whatever else, I don't have ssh access to my host, & I have to do it with Scheduler or something.
I checked so many answers, but I couldn't get them.
I'm using magento 1.9.2
Please help me!

EDIT:
How should I fill this?

Is it enough?


texts: updating sql row where condition1,condition2 in magento

texts:
I have a non Eav Table and I want to update an attribute in a row where param1=a and param2=b.
In sql terms :
update mytable column=ab where column1=a and column2=b;
I have tried this way:

$mymodel=Mage::getModel(test/test)->getCollection()
->addAttributeToFilter('column1',array('eq'=>'a')
->addAttributeToFilter('column2',array('eq'=>'b');
$var=(int)$mymodel->getData('column');
$var=+1;

Uptil here i am able to get my desired column and make change here

$mymodel=setColumn($var)->save();

but by using this i am unable to save the value back in db. Can anyone point me where I am doing wrong?What are the alternative ways to execute this query?

EDIT:
Another problem I am facing is in my getData line it's showing me the value 1
instead of value 5 which is stored in my DB.


texts:
I'm supposed to:

Receive payment tokenization from mobile.
Save tokenize for the customer.
Use tokenize to add an order.
Do payment process.

How can I achieve these steps?

Please help.


texts: Deactivate a list of SKUs for a two specific websites?

texts: How can I quickly deactivate a list of SKUs for a specific website?


texts: Print the index.php code instead of execute in magento 2

texts:
I have installed magento 2 in my ubuntu and I tried to run magento setup, it print the index.php code.

Help me.


texts: Magento Community Edition version 1.9.0 Signup not working

texts:
On Home page the signup option is not working,
when all details in signup page are submitted  and the submit button is clicked, i'm being redirected to customer/createpost link, But the page appears as blank. As i can see in the console log, i am getting an internal server error. What can i do about that?


texts: Create ConfigurableProduct programmatically, using Repository pattern

texts:
This is as far as it gets me trying to create product:

public function __construct(ProductInterfaceFactory $factory,
                            ProductRepositoryInterface $repository)
{
    $this->repository = $repository;
    $this->factory = $factory;
}

public function setEntity($source)
{
    $product = $this->factory->create();
    $product->setSku($source->getId());
    $product->setName($source->getDescription());
    $product->setPrice($source->getUnitPrice());
    $product->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
    $product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
    $this->repository->save($product);
}

Now, how do I create a configurable product and link it to this product? There is no ConfigurableProductRepository, so how do I achieve this?

For the record: I see lots of Google results do something like this, but it feels like less elegant than the Factory/Repository pattern to do CRUD. Mainly because I need to work directly against a concrete class rather than against an interface...

Is there no other way to create ConfigurableProduct?

I'm using version 2.2.3.


texts: Call to checkout URL redirecting to homepage

texts:
When adding a redirect to the checkout page in an Ajax done callback function, it seems to just go straight to the homepage instead:
}).done(function (data) {
    if (data.error) {
        console.log(data.error);
    } else if (data.success) {
        // take user to checkout if successful
        window.location = '<?= $this->getUrl("checkout", ["productid" => $this->getRequest()->getParam("productid")]); ?>';
    }
});

The thing is, this works as expected on a local environment and takes me to the checkout and I can access the productid parameter from there etc. but for some reason, on the release server it goes straight to the homepage.
The annoying thing is, there is nothing being reported in the server logs either so there is nothing to go off here.
Has anyone else came across this scenario before? and if so, how did you resolve it? :)
Cheers everyone!


texts: How can I view customer order on frontend with own form?

texts:
Guest and registered customers can see their order if they go to sales/guest/form/ on the frontend and fill in their order and email details into the form. On submit they get directed through to sales/guest/view/

I want to be able to go to the sales/guest/view from a route of my own, e.g. an option on the contact us page where I get the customer's email and order number.

From there I have tried loading the order and saving it in registry, to seeing if this works: $this->_redirect('sales/guest/view', array('order_id', $order->getId()));

but if I try that it just redirects me to the form.

Any ideas


texts: Magento 1.9 error Table 'magento_oldagain.adminnotification_inbox' doesn't exist

texts:
i am trying to import Magento database in PHPMYADMIN. I have exported the database using the PHPMYADMIN. I am receiving this error message when i try to import the magento database. How should i fix this error.  any help will be greatly appreciated. thanks

MySQL said: Documentation  #1146 - Table 'magento_oldagain.adminnotification_inbox' doesn't exist

INSERT INTO `adminnotification_inbox` (`notification_id`, `severity`, `date_added`, `title`, `description`, `url`, `is_read`, `is_remove`) VALUES
(1, 4, '2008-07-24 23:54:40', 'Magento 1.1 Production Version Now Available', 'We are thrilled to announce the availability of the production release of Magento 1.1. Read more about the release in the Magento Blog.', 'link is here', 0, 0),
(2, 4, '2008-08-02 00:00:16', 'Updated iPhone Theme is now available', 'Updated iPhone theme for Magento 1.1 is now available on Magento Connect and for upgrade through your Magento Connect Manager.', 'link is here', 0, 0),
(3, 3, '2008-08-02 00:10:27', 'Magento version 1.1.2 is now available', 'Magento version 1.1.2 is now available for download and upgrade.', 'link is here', 0, 0),
(4, 3, '2008-08-1[...]


texts: magento different prices for customer groups

texts: im creating a magento store for a B2B store. The issue im facing is that i need to have a different price for a different customer group. i have checked the built in group price feature in Magento but this is not what i need since it just shows a price for the specific groupo only when it is LOWER than the actual price and it shows it as a SPECIAL PRICE in the front end What i need is to have a different price for each customer group without showing it as a SPECIAL PRICE is that possible ? if yes how could i do that ? do i change some PHP code ?


texts: Subcategories overlapping with main category when added js for long dropdown list

texts:
I have added js script in my footer.phtml to display scrolling onhover for long drop down list, but alignment of the navigation bar is not proper.. I want it to display below main category with proper alignment
please guide me script which is responsive

if i give position:absolute then dropdown will align properly but the categories will overlap

below is the script for hover on long dropdown

<script>
var maxHeight = 100;
var maxwidth
jQuery.noConflict();
jQuery(function(){

    jQuery(".nav-primary > li").hover(function() {

         var jQuerycontainer = jQuery(this),
             jQuerylist = jQuerycontainer.find("ul"),
             jQueryanchor = jQuerycontainer.find("a"),
             height = jQuerylist.height() * 1.1,       // make sure there is enough room at the bottom
             multiplier = height / maxHeight;     // needs to move faster if list is taller

        // need to save height here so it can revert on mouseout
        jQuerycontainer.data("origHeight", jQuerycontainer.height());

        // so it can retain it's rollover color all the while the dropdown is open
        jQueryanchor.addClass("hover");

        // make sure dropdown appears directly below parent list item
        jQuerylist
            .show()
            .css({
                paddingTop: jQuerycontainer.data("origHeight")
            });

        // don't do any animation if list shorter than max
        if (multiplier > 1) {
            jQuerycontainer
                .css({
                    height: maxHeight,
                    overflow: "hidden"
                })
                .mousemove(function(e) {
                    var offset = jQuerycontainer.offset();
                    var relativeY = ((e.pageY - offset.top) * multiplier) - (jQuerycontainer.data("origHeight") * multiplier);
                    if (relativeY > jQuerycontainer.data("origHeight")) {
                        jQuerylist.css("top", -relativeY + jQuerycontainer.data("origHeight"));
                    };
                });
        }

    }, function() {

        var jQueryel = jQuery(this);

        // put things back to normal
        jQueryel
            .height(jQuery(this).data("origHeight"))
            .find("ul")
            .css({ top: 100 })
            .hide()
            .end()
            .find("a")
            .removeClass("hover");

    })});

    //Add down arrow only to menu items with submenus
    // jQuery(".nav-primary > li:has('ul')").each(function() {
    //     jQuery(this).find("a:first").append("<img src='images/down-arrow.png' />");
    // });
</script>


texts: Including static blocks in a product description

texts:
I'm trying to follow this article by Marius so that I can use {{block}} calls in a product description, as many of our products have the same detailed product description, with some minor capacity variations:

http://marius-strajeru.blogspot.co.uk/2010/01/problem-add-static-block-to-product.html

I don't have enough experience to know if I'm editing the correct files.

I pulled info from here:

https://code.tutsplus.com/tutorials/understand-overriding-in-magento-models--cms-23354

and here:

https://magentoexplorer.com/how-to-override-rewrite-magento-core-blocks-models-helpers-and-controllers

So far I did this...

Created /app/etc/HEKA.xml (just made the name up)

with content:

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

Then I created /app/code/local/HEKA/Catalog/etc/config.xml, including the folder structure HEKA/Catalog/etc/ (again making up the HEKA bit...)

Contents:

<?xml version="1.0"?>
<config>
<modules>
<HEKA_Catalog>
  <version>1.0</version>
</HEKA_Catalog>
</modules>

<global>
<models>
  <catalog>
    <rewrite>
      <product>HEKA_Catalog_Model_Product</product>
    </rewrite>
  </catalog>
</models>
</global>
</config>

Then I created /app/code/local/HEKA/Catalog/Model/Product.php with the content:

<?php
class HEKA_Catalog_Model_Product extends Mage_Catalog_Model_Product
{
function getDescription(){
$processor = Mage::getModel('core/email_template_filter');
$html = $processor->filter($this->getData('description'));
return $html;
}
}

I then added a static block with ID standard_series_general_description

Then added this to a product description

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

Unfortunately I must have got something wrong as the text "{{block type="cms/block" block_id="standard_series_general_description"}}" just appears in the product description.

Any help with this would be greatly appreciated. I'm fairly certain there are some basic errors in what I've done but I'm struggling to figure out what, despite much time on google!
thanks, Giles


texts: Magento2 - How do I add child item images to a grouped product - grouped.phtml

texts:
I am working on Magento 2 and would like to show images of the individual items that are part of a group.  I have gotten as far as figuring out that it is grouped.phtml that renders the list of child products, but I can't seem to get the image to work for me.

Can anyone help?


texts: Remove Item error from category page only

texts:
If I click Remove Item in the (RWD Theme) Minicart on the product view page, home page, other CMS pages, and cart page, I have no problem.

If I click Remove Item on the category page, I get an exception error:

Invalid form key

Trace:
#0 /var/www/sites/mbs/app/code/core/Mage/Checkout/controllers/CartController.php(604): Mage::throwException('Invalid form ke...')
#1 /var/www/sites/mbs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->ajaxDeleteAction()
#2 /var/www/sites/mbs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('ajaxDelete')
#3 /var/www/sites/mbs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /var/www/sites/mbs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 /var/www/sites/mbs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /var/www/sites/mbs/index.php(96): Mage::run('', 'store')
#7 {main}

It appears that the URL does have the form key present in the URL, but it is invalid for some reason.

Even if I copy the Remove URL from the product page and overwrite the category URL (with Inspect Element), it gives me the same error.

What could be causing this?


texts:
How to call Custom attribute in customer order conformation mail

i try lot of solution but no luck Please give me some solution on that


texts: Trouble overriding template using a module

texts:
I'm trying to override the vendor/magento/module-customer/view/frontend/templates/address/edit.phtml with a custom one but I can't get it to work.

The stock address/edit.pthml gets loaded in vendor/magento/module-customer/view/frontend/layout/customer_address_form.xml.

My custom customer_address_form.xml located at /home/roy/www/dremelonline/web/vendor/activeants/magento2-checkoutchanges/src/view/frontend/layout/customer_address_form.xml looks like this:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <referenceBlock name="customer_address_edit">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Roy_CheckoutChanges::edit.phtml</argument>
                </action>
            </referenceBlock>
        </referenceContainer>
    </body>
</page>

My custom edit.phtml file is located in vendor/roy/magento2-checkoutchanges/src/view/frontend/templates/edit.phtml

My module.xml looks as following:

<module name="Roy_CheckoutChanges" setup_version="1.0.0">
    <sequence>
        <module name="Magento_Checkout"/>
        <module name="Magento_Customer"/>
        <module name="Roy_Base"/>
    </sequence>
</module>

I've flushed my cache and I have ran the upgrade command.

According to reading other posts about related problems, this code should work, but as you already know, it doesn't :p

Thanks!


texts:
With no apparent reason, product pages do not show for me anymore.
Error text:

Warning: Illegal offset type in isset or empty in /path/to/project/vendor/magento/module-eav/Model/Entity/Attribute/Source/AbstractSource.php on line 74

I tried to xdebug it, here is what I found. Error happens in the following method of AbstractSource.php class:

public function getOptionText($value)
{
    $options = $this->getAllOptions();
    // Fixed for tax_class_id and custom_design
    if (sizeof($options) > 0) {
        foreach ($options as $option) {
            if (isset($option['value']) && $option['value'] == $value) {
                return isset($option['label']) ? $option['label'] : $option['value'];
            }
        }
    }
    // Error here
    if (isset($options[$value])) {
        return $options[$value];
    }
    return false;
}

The error occurs because $value is an array:
    $value = array("is_in_stock" => true, "qty" => 1); whereas Magento expects a scalar that can be used as array key.

All the trouble is caused by product attribute with code quantity_and_stock_status - but it is not my custom attribute, it comes out of the box, and I did not change any of its settings.

I reinstalled my entire app, still got the same result.

So it looks to me that it's a Magento internal bug - but it used to work fine, I did not update codebase in any way. What could be the reason that this bug occurs?


texts:
How to check if order confirmation and shipment emails were sent out successfully? Any way to track from the admin or through log file?

The "Order" and "Order Comments" setting in the System->Configuration->Sale Emails are Enabled.


texts: Cron not working sometimes after installed module

texts:
we set up cron job as below . it was working until we installed module to send Abandoned cart emails.

when we run http://sitename.com:81/cron.php, we get error as :

Fatal error: Call to a member function getTemplate() on a non-object in

$tpl = $this->getDesign()->getTemplate();

function , full code : http://pastebin.com/gewZSRrp

public function getProcessedTemplate($variables = null)
    {
        $tpl = $this->getDesign()->getTemplate();

        $result = $this->_render($tpl, $variables);

        if ($this->getDesign()->getTemplateType() == Extension_EmailDesign_Model_Design::TEMPLATE_TYPE_HTML) {
            $result = Mage::helper('emaildesign')->styleHtml($result);
        }

        return $result;
    }

Edit

public function getDesign()
    {
        if ($this->_design == null && $this->getDesignId()) {
            $this->_design = Mage::getModel('emaildesign/design')->load($this->getDesignId());
        }

        return $this->_design;
    }

Edit 2

sometimes below result

sometimes below result :

Strange is link : http://sbdev2.kidsdial.com:81/cron.php will show above Fatal error sometimes and no error after some times. But no abandoned cart email is sent.....


texts: What are the technical steps to upgrade Magento ver. 2.3.4 to Latest Magento ver.2.4.0?

texts:
I am trying to upgrade store from Magento ver. 2.3.4 to Latest Magento ver.2.4.0
Can anybody advise me what are the ideal steps to upgrade ?


texts:
I'm trying to display a "Free Gift" label on the product picture for any product that has the custom options label "Free Gift".

The code I have below works on the actual product page but if I try it on the product list page (list.phmtl) the "Free Gift" label isn't showing up.

I've been told to load my collection but I'm not sure how to do that, won't that also slow my site down if I'm loading my entire collection each time somebody goes on a product list page?

Maybe there's a different solution to my issue?

<?php

$theoptions = $_product->getOptions();
foreach($theoptions as $opkey=> $opval)

if(( $_product->getData('has_options')) && ($_product->getTypeID() == 'simple') && ($opval->getTitle() == 'Free Gift')): ?>

<?php echo "Free Gift" ?>
;
<?php endif; ?>


texts: How to translate " This is a required " in Magento 2

texts:
I want translate error message required field like this

I used de_DE.csv but the get fields from data it does not translate, please help me! Thanks all


texts:
Now I need,

Product A having maximum discount 3% discount.
(please tell me how can i set the maximum discount in percentage)

At the same the Customer Group members having couponcode for 5%

Now the Product should be discount upto 3% not above 3%
Even They Entered the Coupon code for 5%.


texts: USPS shipping not showing Magento version 1.9.1

texts:
I know this question has been asked several times for different versions of magento but still I cannot find the relevant information and answer. Many of the users haven't marked the comments as answer. Well if still you find this question irrelevant or repetitive you can mark it as close but please guide me in right direction.
Well I just finished my very first site using magento version 1.9.1 but I'm getting an error for the USPS and UPS shipment module.

I've tried every thing. I tried changing my zip code to zip4, I double rechecked my credentials, I checked on live and development mode, I checked on my localhost and on live site also, I changed the weight of the products also but nothing worked.

There is nothing in the error log that is var/log file.

Please help me friends. Thank you.


texts: using Header/Footer files into outside external file in magento

texts:
I want to include the header and footer of magento outside of it.I have CORE_PHP with some jquery functionality and php function,In that Files,I need to add default Header/Footer of magento into that core_php files.How is it possible? I used this code for called magento functionality.

 <?php
/**
 * @author      MagePsycho <info@magepsycho.com>
 * @website     http://www.magepsycho.com
 * @category    using Header / Footer outside of Magento
 */
$mageFilename = 'app/Mage.php';
echo $mageFilename;
require_once $mageFilename;
#Mage::setIsDeveloperMode(true);
#ini_set('display_errors', 1);
umask(0);
Mage::app();
Mage::getSingleton('core/session', array('name'=>'frontend'));

$block              = Mage::getSingleton('core/layout');

# HEAD BLOCK
$headBlock          = $block->createBlock('page/html_head');// this wont give you the css/js inclusion
// add js
$headBlock->addJs('prototype/prototype.js');
$headBlock->addJs('lib/ccard.js');
$headBlock->addJs('prototype/validation.js');
$headBlock->addJs('scriptaculous/builder.js');
$headBlock->addJs('scriptaculous/effects.js');
$headBlock->addJs('scriptaculous/dragdrop.js');
$headBlock->addJs('scriptaculous/controls.js');
$headBlock->addJs('scriptaculous/slider.js');
$headBlock->addJs('varien/js.js');
$headBlock->addJs('varien/form.js');
$headBlock->addJs('varien/menu.js');
$headBlock->addJs('mage/translate.js');
$headBlock->addJs('mage/cookies.js');
# add css
$headBlock->addCss('css/styles.css');
$headBlock->getCssJsHtml();
$headBlock->getIncludes();

# HEADER BLOCK
$headerBlock        = $block->createBlock('page/html_header')->setTemplate('page/html/header.phtml')->toHtml();

# FOOTER BLOCK
$footerBlock        = $block->createBlock('page/html_footer')->setTemplate('page/html/footer.phtml')->toHtml();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<?php echo $headBlock->toHtml(); ?>

        <?php echo $headerBlock; ?>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sit amet est lectus. Proin rhoncus faucibus mauris sit amet dictum. Donec auctor risus sed quam facilisis feugiat auctor augue mattis. Donec vitae ligula ac ligula scelerisque venenatis. Vestibulum vehicula sem nec justo aliquam lobortis. Vivamus malesuada lorem et diam consequat suscipit. Curabitur dui ante, semper eget imperdiet eu, elementum et leo. Duis id vestibulum lorem. Phasellus pulvinar condimentum urna et egestas. Sed eu orci turpis, sed facilisis lorem. Maecenas vel bibendum tortor. In congue, neque in placerat laoreet, sem lectus sagittis lorem, in pulvinar felis nibh a lorem. Proin viverra libero eu felis feugiat et porttitor enim aliquam. Cras a varius purus.

Integer accumsan ligula sed lorem vehicula vitae rhoncus dolor ullamcorper. Curabitur vestibulum diam ac diam tincidunt quis adipiscing nisi placerat. Ut convallis consequat quam id imperdiet. Morbi ac risus sem. Curabitur egestas neque hendrerit felis sollicitudin ut vehicula enim mollis. Suspendisse sed leo nec risus scelerisque porttitor sed eget urna. Fusce id erat leo.

        <?php echo $footerBlock; ?>

Here Above code will not working fine.my custom page located in [MAGENTO SITE]/tool/index.php.When i executed that file it results 404 redirect errors.How to render header/footer exactly into my custom page.Is it proper way for render header/footer into external file. Can please guide me..


texts: Magento 2: Unable to unlock catalogsearch_fulltext reindex

texts:
I already tried

Magento 2 How to unlock reindex process

But below one is not working. It pause for more than 15 minutes. Goes to infinite.

php bin/magento indexer:reindex catalogsearch_fulltext


texts:
I noticed something when looking over the source code and noticed that the catalog search indexer can fire for a specific store by accepting a $storeId parameter.
app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php

  /**
     * Regenerate search index for specific store
     *
     * @param int $storeId Store View Id
     * @param int|array $productIds Product Entity Id
     * @return Mage_CatalogSearch_Model_Resource_Fulltext
     */
    protected function _rebuildStoreIndex($storeId, $productIds = null)

Has anyone needed to specifically target the search indexer for a specific store? If so it doesn't look like Magento provides a decent way of calling this method as the rebuildIndex function itself just loops through the stores and calls it.

public function rebuildIndex($storeId = null, $productIds = null)
{
    if (is_null($storeId)) {
        $storeIds = array_keys(Mage::app()->getStores());
        foreach ($storeIds as $storeId) {
            $this->_rebuildStoreIndex($storeId, $productIds);
        }
    } else {
        $this->_rebuildStoreIndex($storeId, $productIds);
    }

    return $this;
}

Might be a neat n98-magerun feature.
n98-magerun.phar index:reindex catalogsearch_fulltext $store_id


texts:
When I run static content deploy on my local Magento2 instance I get this error message:

[PDOException]
  SQLSTATE[HY000] [2002] No such file or directory

Is this a etc/hosts and/or virtual hosts issue?


texts: Magento 1.14.1.0 and recommended nginx version

texts: Magento mentions here that the system requirements for nginx is version 1.7.x. But I'm wondering what is the recommended version? Is there a reason I should just update to 1.7 and not go to 1.8, 1.9, or 1.10? Is there any documentation on this?


texts: Order status changes after the 'sales_order_save_after' is executed

texts:
In Magento 2.3.0, I need to execute a specific function when the order is shipped (the Ship action is triggered).
Basically, I am using the 'sales_order_save_after' event to check what's the current status, but the results are different in two situations as follows:

For a new order, if I generate the invoice first and the shipping process, the observer that is executed following the 'sales_order_save_after' event says that the current status is complete which is correct.
For a new order, if I don't generate the invoice and I just hit the 'Ship' button, the observer that is executed following the 'sales_order_save_after' event says that the current status is processing and not complete.

Why is this happening and how can I get the complete event when I hit the 'Ship' button, without going through preliminary steps such as invoicing?


texts: Where is the code to fetch the 'more views` images?

texts: In magento1.9.2.4 where is the php code to fetch the thumbnail images in more view section in product details page?


texts: Magento 2.2.2 - Class not found in Factory

texts:
Namespace/Modulename/Model/WebService/ClientFactory.php

<?php

namespace Namespace\Modulename\Model\WebService;

use Magento\Framework\ObjectManagerInterface;
use Namespace\Modulename\Model\WebService\Config;

class ClientFactory
{

    protected $config;

    public function __construct(Config $config)
    {
        $this->config = $config;
    }

    /**
     * @param array $data
     * @return \Modulename\WebService\Client
     */
    public function create(array $data = [])
    {
        if (isset($data['options']) && is_string($data['options'])) {
            $data['options'] = ['host' => $data['options']];
        } elseif (empty($data['options'])) {
            $data['options'] = [];
        }

        $userId = !empty($data['userId']) ? $data['userId'] : $this->config->getUserId();
        $licenseKey = !empty($data['licenseKey']) ? $data['licenseKey'] : $this->config->getLicenseKey();
        $locales = !empty($data['locales']) ? $data['locales'] : ['en'];
        $options = $data['options'] + ['host' => $this->config->getHost()];

        $client = new \Modulename\WebService\Client($userId, $licenseKey, $locales, $options);
        return $client;
    }
}

Namespace/Modulename/Observer/Redirect.php

<?php

namespace Namespace\Modulename\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Namespace\Modulename\Model\WebService\Config;
use Namespace\Modulename\Model\WebService\ClientFactory;

class Redirect implements ObserverInterface {

    protected $clientFactory;

    public function __construct(Config $config, ClientFactory $clientFactory)
    {
        $this->config = $config;
        $this->clientFactory = $clientFactory;
    }

    public function execute(Observer $observer)
    {

        $client = $this->clientFactory->create();
        $record = $client->city('128.101.101.101');
        print($record->country->isoCode . "\n");
        return $this;
    }
}

  Fatal error: Uncaught Error: Class 'Modulename\WebService\Client' not
  found in Namespace/Modulename/Model/WebService/ClientFactory.php


texts: Region/State Select List not alphabetical

texts:
We are using Turkish cities in the Region field and the select drop down for region/state in the address field in admin customer new address is generating the list alphabetically but in the frontend the list is not listing alphabetical, actually the English letters are alphabetically listed but the Turkish characters such as İ,Ş are shown after the English letters.

How can I make it list all regions/States alphabetically?


texts: Invert 'My billing and shipping address are the same' checkbox functionality in checkout

texts:
I need to do a little customization in checkout:

I want to change the functionality of the checkbox My billing and shipping address are the same in this way:

The label will be Need Invoice (already managed to do this)

Then if the checkbox is

Not checked: I want to keep the same address for billing and shipping
Checked: I want to chose another address or insert a new one.


texts:
my site is http://shaadistore.in/ in this im having an issue in forgot password page http://shaadistore.in/customer/account/forgotpassword/  whenever i'm submitting the form it's showing below error:

Fatal error: Call to undefined function mb_convert_encoding() in /home/shaadistore/public_html/lib/Pelago/Emogrifier.php on line 556

And also i'm not getting any emails during this process.

Please can any body help me about this.


texts: Module development in enterprise edition

texts:
I have developed a module in community edition .
Inside the folder app/code/ i did my code it is working fine.
I have a doubt. is my module working fine in enterprise edition without any change ? or shall i need to change my module code to support enterprise edition?
If code need to change pls share url for module development for enterprise edition for magento 2.


texts: Magento2 Get a list of all cms static blocks

texts:
I have created a new widget programatically and i would like to create a custom source model with dropdown values all the cms static blocks.

Is that possible? How can i get a list of all the static blocks ?

  app/code/Ves/CustomWidget/etc/widget.xml

<parameter name="gender" xsi:type="select" source_model="Ves\CustomWidget\Model\Config\Source\StaticBlock" visible="true" sort_order="10" >
            <label translate="true">Static Block</label>
</parameter>

And my Source Model

  app/code/Ves/CustomWidget/Model/Config/Source/StaticBlock.php

namespace Ves\CustomWidget\Model\Config\Source;
class StaticBlock implements \Magento\Framework\Option\ArrayInterface
{

   public function toOptionArray()
   {
       // Get all cms static blocks and return them by id/Title
       // instead of hardcoded values
       return [
       ['value' => 'static_block_id_1', 'label' => __('Static block Title 1')],
       ['value' => 'static_block_id_1', 'label' => __('Static block Title 1')]];
   }
}


texts: Duplicate Order Incremented Order Number After Paypal Express

texts:
We have experienced a strange issue that is currently a one off whereby:

Customer placed an order using PayPal Express Checkout and was refused due to payment method.
They then amended the order, the order was accepted and created but within 30 seconds a duplicate order was created with the next order number but the customer was not charged twice.

I contacted PayPal and we have determined:

The correlation IDs attached to the two orders are related to the same Express Checkout token (EC-5D3489587B7519008)
The invoice number for this token was 100001411 but for some reason Magento generated two orders from this payment creating order 100001412 but not charging the customer again.
The orders are not related to the initial failed checkout at all.

Our Magento is version 1.9.0.1 and we are due to upgrade to 1.9.1 once the current batch of sales is complete in the next few days.
We are using the standard Magento Paypal Express integration.

Does anyone have any ideas as to why this happened and how we can avoid this in the future please.


texts: Adding a block (phtml file) to New Order page in admin via layout update

texts:
On the frontend, I can successfully add a block using this layout update for my module:

<?xml version="1.0"?>
<layout version="0.1.0">
    <customer_address_form translate="label">
        <reference name="my.account.wrapper">
            <block type="core/template" name="customer_address_edit" template="customer_address_edit.phtml" after="customer_address_edit"></block>
        </reference>
    </customer_address_form>
</layout>

And then my customer_address_edit.phtml is rendered just fine...

However, on the admin side I'm having trouble. I'm trying to add a block in a similar way, to the New Order page. My layout file looks like this:

<?xml version="1.0"?>
<layout version="0.1.0">
    <adminhtml_sales_order_create_index>
        <reference name="order_item_extra_info">
            <block type="adminhtml/template" name="admin_order_create" template="admin_order_create.phtml"></block>
        </reference>
    </adminhtml_sales_order_create_index>
</layout>

I've tried a couple variations of that, like using core/template and setTemplate. I just want a block to be added where I can add some custom HTML or JavaScript in a phtml file. Does anyone know what's different about adding a new phtml block to admin vs frontend?

UPDATE: This layout worked (before_body_end):

<?xml version="1.0"?>
<layout version="0.1.0">
    <adminhtml_sales_order_create_index>
        <reference name="before_body_end">
            <block type="adminhtml/template" name="admin_order_create" template="admin_order_create.phtml"></block>
        </reference>
    </adminhtml_sales_order_create_index>
</layout>


texts: Magento 2: Creating product with custom Options

texts:
I have tried several different ways that to add custom options programmatically to a new product in Magento 2. I am doing this from a CLI command and everything is working well except for the custom options which give me an error:

  SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento_ee.catalog_product_option, CONSTRAINT CATALOG_PRODUCT_OPTION_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ROW_ID FOREIGN KEY (product_id) REFERENCES catalog_product_entity (row_id) ON), query was: INSERT INTO catalog_product_option (type, is_require, sort_order) VALUES (?, ?, ?)

Here is the stripped down code:

function __construct(
    \Magento\Catalog\Model\Product $product,
    \Magento\Catalog\Model\Product\Option $option,
    \Magento\User\Model\UserFactory $userFactory,
    \Magento\Framework\App\State $state
)
{
    $this->product = $product;
    $this->option = $option;
    parent::__construct();

    /**
     *
     * Bug fix for known Magento issue where product status cannot be changed in custom CLI command without an admin session
     * https://github.com/magento/magento2/issues/5664
     *
     */
    $model = $userFactory->create()->loadByUsername('admin_username_here');

    $state->emulateAreaCode('adminhtml', function ($model) {
        $session = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Backend\Model\Auth\Session');
        $session->start();
        $session->setUser($model);
        $session->processLogin();
    }, array($model));

}

// Process some stuff here and call setOptions when necessary

// code goes here

private function setOptions(array $dealArray, $lang) {
    if(count((array) $dealArray['offerItems']) > 1) {
        $this->output->writeln('Multiple Options found, processing...');

        $values = [];
        $i = 1;
        foreach($dealArray['offerItems'] as $item) {
            $this->output->writeln('Setting option: '.$item->$lang->offerItemSKU);

            $values[] = array(
                'title'             => $item->$lang->offerItemValue,
                'price'             => $this->product->getPrice(),
                'price_type'        => "fixed",
                'sku'               => $item->$lang->offerItemSKU,
                'sort_order'        => $i
            );

            $i++;
        }

        $optionArray = array(
                "sort_order"    => 1,
                "title"         => "Options",
                "type"          => "drop_down",
                "is_require"    => 1,
                "values"        => $values
            );

        $this->output->writeln('Setting options for SKU: '.$this->product->getSku().PHP_EOL.print_r($optionArray, true));
        $this->option->addData($optionArray);
        $this->option->save();

        $this->product->setOptions([$this->option]);
        $this->option->clearInstance();

    } else {
        $this->output->writeln('No Options found.');
    }
}


texts: Magento 2 how to add custom tab in admin order view page left side

texts: Magento 2 how to add a custom tab in admin order view page left the side


texts:
In Magento 2.2
php 7.1

Everyday this cron email comes, but I don;t know how to fix it. Please help. Thank you!!!

  setup-cron: Please check var/log/update.log for execution summary.
  [2017-11-01 05:02:07] setup-cron.ERROR: SQLSTATE[42000] [1203] User XXXX already has more than 'max_user_connections' active connections [] []
  [2017-11-01 13:02:37] update-cron.WARNING: Update is already in progress. [] []
  [2017-11-01 13:02:37] update-cron.WARNING: Update is already in progress. [] []
  [2017-11-01 13:02:37] update-cron.WARNING: Update is already in progress. [] []
  [2017-11-01 16:09:35] update-cron.WARNING: Update is already in progress. [] []
  [2017-11-01 16:09:35] update-cron.WARNING: Update is already in progress. [] []
  [2017-11-01 16:09:35] update-cron.WARNING: Update is already in progress. [] []
  [2017-11-01 16:31:48] update-cron.WARNING: Update is already in progress. [] []
  [2017-11-01 08:38:22] setup-cron.ERROR: ".update_in_progress.flag" cannot be created. [] []
  [2017-11-01 09:18:23] setup-cron.ERROR: SQLSTATE[42000] [1203] User XXXX already has more than 'max_user_connections' active connections [] []
  [2017-11-01 09:19:23] setup-cron.ERROR: SQLSTATE[42000] [1203] User XXXX already has more than 'max_user_connections' active connections [] []
  [2017-11-01 09:20:15] setup-cron.ERROR: SQLSTATE[42000] [1203] User XXXX already has more than 'max_user_connections' active connections [] []
  [Zend_Db_Adapter_Exception]
  SQLSTATE[42000] [1203] User XXXX  already has more than 'max_user_connections' active connections
  [PDOException]
  SQLSTATE[42000] [1203] User XXXX already has more than 'max_user_connections' active connections
  cron:run [--group GROUP] [--bootstrap BOOTSTRAP]


texts: Change 'Choose an Option...' text Magento 2

texts:
On a configurable product I would like to change the text 'Choose an Option...' to 'Select an Option...'

I have attempted to change the i18n translation file within my theme, and cleared cache - however this has not worked.

Can anyone please advise of the file that needs updating to change this text?


texts: html_content not working for ui component

texts:
The Ui components the following tag works, but only onces. If i tried to use another htmlcontent tag then the new tag does not appear.

<htmlContent name="html_content">
    <argument name="block" xsi:type="object">Vendor\Module\Block\Adminhtml\Orders\Additional</argument>
</htmlContent>


texts:
In Magento 2.3 inside of a template for the admin area:

  Moduel\Vendor\view\adminhtml\templates\template.phtml

I'm trying to add a button to open up the MediabrowserUtility with the url.

Code suggests doing this:

require(['jquery','mage/adminhtml/browser'
], function($) {return function(config) {
    $('.some-button').on('click',function(){
        /** @type Object */
        var cc = config['coreConfig'];
        /** @type String */
        var url = cc['files_browser_window_url'] + 'target_element_id/' + config.id + '/';
        /** @type ?Number */
        var storeId = cc['store_id'];
        if (storeId) {
            url += 'store/' + storeId;
        }
        MediabrowserUtility.openDialog(url);
    });
};});

However config returns nothing. And clicking the button also does nothing. I don't fully understand where the config is coming from? How do I get that and action it?

I've not worked with admin area js before... so just wondering what the best thing to do is.


texts: How to control price visibility of product from Magento 2 admin panel?

texts: I want to control the price visibility of products from admin panel. actually, I create an attribute price-control as a display on the following image. if price control set to yes, the price of the product should not display, and instead of it a custom text on demand should display. I will be very thankful to you, if you give me some code related help


texts: How can I add critical JS on Magento 2.3.3?

texts:
Magento 2.3.3 has "Move JS code to the bottom of the page" function which moves all JS code to bottom of the page.

I need some JS code(Seal Verification Code which showing verification icon) not move to bottom.

How can I do this?


texts:
I got big issue on website. I have took over website for some changes from other company so I don't know where to look for the issue. The issue is:
Customer can create new account without any problem but when customer is logged in there is no dashboard at all. All you can see is header with navigation and below that where dashboard suppose to be is blank.

Anyone got any idea or any solution to fix it please ??

Regards,
William

Link to scree shoot here:

http://caveo-security.com/customer_login.png


texts: Allow Coupon only for customers with certain domain in email?

texts:
How can I check, when a coupon is being applied, if the customer's email is from a certain domain?

Here is the module code based on Raphael's code

<?php
class NA_LimitCoupon_Model_Observer
{
    protected $_domainsAllowed = array(array('COUPON1', 'email1.com'),
                                       array('COUPON2', 'email2.com')
                                      );

    public function validate(Varien_Event_Observer $observer)
    {

$timestamp = date("m-d-Y H:i:s");
$msg = "Timestamp:".$timestamp;
$fp = fopen("/var/tmp/".__FUNCTION__.".txt", 'a');
fwrite($fp, $msg . "\n");
fclose($fp);

        try
        {
            $this->validateRestriction($observer);
        }
        catch (Mage_Core_Exception $e)
        {
            Mage::getSingleton('checkout/session')->addError($e->getMessage());
        }
        catch (Exception $e)
        {
            Mage::getSingleton('checkout/session')->addError($this->__('Cannot apply the coupon code.'));
            Mage::logException($e);
        }
    }

    public function validateRestriction(Varien_Event_Observer $observer)
    {
        $errMsg = false;
        // Get the quote:
        $quote = $event->getQuote();
        // obtain the code being used
        $code = $quote()->getCouponCode();
        // Get the current quote email
        $currentEmail = $quote()->getCustomer()->getEmail();
        $explodedEmail = explode('@', $currentEmail);

        // Get the domain from the email address
        $domain = array_pop($explodedEmail);

$timestamp = date("m-d-Y H:i:s");
$msg = "Timestamp:".$timestamp."\nCode: ".$code."\nCurrentEmail: ".$currentEmail."\nDomain: ".$domain;
$fp = fopen("/var/tmp/".__FUNCTION__.".txt", 'a');
fwrite($fp, $msg . "\n");
fclose($fp);

        switch($code)
        {
            case 'COUPON1':
                // check if the email address is in the COUPON1 domain
                if ($domain !== $this->_domainsAllowed[$code])
                {
                   // Wrong domain
                   $errMsg = 'This coupon code is restricted to customers of email1 company';
                }
                break;
            case 'COUPON2':
                // check if the email address is in the COUPON1 domain
                if ($domain !== $this->_domainsAllowed[$code])
                {
                   // Wrong domain
                   $errMsg = 'This coupon code is restricted to customers of email2 company';
                }
                break;
        }
        // handle errors
        if ($errMsg)
        {
            Mage::getSingleton('checkout/session')->addError($errMsg);
            $quote->setCouponCode('');
            $quote->collectTotals()->save();
        }
    }
}

Wondering if this will work as designed. I want to limit use of certain codes for certain email  domains.

And the XML file:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <LimitCoupon>
            <version>0.0.1</version>
        </LimitCoupon>
    </modules>
    <global>
        <models>
            <module>
                <class>LimitCoupon_Model</class>
            </module>
        </models>
        <events>
            <salesrule_validator_process>
                <observers>
                    <LimitCoupon_validate>
                        <type>singleton</type>
                        <class>module/observer</class>
                        <method>validate</method>
                    </LimitCoupon_validate>
                </observers>
            </salesrule_validator_process>
        </events>
    </global>
</config>


texts:
I already lost many hours without success.
Does anyone know where we can increase admin products thumb grid?
By default it generates a cached picture with 75px but limited to 55px in grid.

Many thanks.


texts: How to show static block just below navigation?

texts:
I want to show a discount bar just below navigation

Created a static block and placed my content inside it .
Called block using below code

  {{block class="Magento\Cms\Block\Block" block_id="discount-bar"}}

Its appearing on front end but I want it to place just below navigation and then after my slider

I have gone through this Magento2 : display static blocks in home page

If possible without using XML then will be great help


texts: Magento2 : Add Category Attribute Dropdown

texts:
I want to Create Category Attribute With Drop down
Drop down options are all list of Product Attributes
like http://prntscr.com/juglsn :
I tried but it didn't works

1.In setup file

$eavSetup -> addAttribute(\Magento\Catalog\Model\Category :: ENTITY, 'cat_attr1', [
    'type' => 'int',
    'label' => 'Attribute 1',
    'input' => 'select',
    'source' => 'Xx\Yy\Model\Config\Source\ProductAttributes',
    'required' => false,
    'sort_order' => 130,
    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
    'group' => 'Product Attribute Info',
    "default" => "",
    "class"    => "",
    "note"       => ""
]);

2. Incategory_form.xmlfile

<field name="cat_attr1">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Xx\Yy\Model\Config\Source\ProductAttributes</item>
        <item name="config" xsi:type="array">
            <item name="sortOrder" xsi:type="number">130</item>
            <item name="dataType" xsi:type="string">string</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="label" xsi:type="string" translate="true">Attribute 1</item>

            <item name="notice" xsi:type="string" translate="true"></item>
             <item name="additionalClasses" xsi:type="string"></item>
        </item>
    </argument>
</field>

3. inProductAttributes.phpfile

  namespace Xx\Yy\Model\Config\Source;

class ProductAttributes extends
\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{

    protected $productModel;

    public function __construct(
        \Magento\Catalog\Model\Product $productModel
    )
    {
        $this->_productModel = $productModel;
    }

    public function getAllOptions(){

     $productAttributes = $this->_productModel->getAttributes();

     $productAttribute = [];
     foreach ($productAttributes as $attribute) {
        $productAttribute[$attribute->getAttributeCode()]= $attribute->getFrontendLabel();
     }
      return $productAttribute;
    }

}

When I check In backend I show Loader only when  I Open category Tab


texts: Can you redirect CMS page to custom frontend route magento 2.3.5

texts:
I am trying to redirect a cms page to a new route which I have created for frontend.
I am not sure if we can redirect to the new custom module route frontend with a config in admin area.
My aim is I have a contact page in CMS and I want to enable the custom module to show only if the module is enabled if not show the CMS page


texts: Getting error when using $messageCollection->getLastAddedMessage()->getText(); in magento 2

texts:
I created a module to add available qty to cart when customer request more than available qty.
below is my code set.

  app/code/E25media/MagentoCommunity/etc/frontend/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Quote\Model\Quote">
    <plugin name="sr_check_stock" type="E25media\MagentoCommunity\Plugin\Quote" sortOrder="1"/>
</type>
</config>

  app/code/E25media/MagentoCommunity/Plugin/Quote.php

<?php
namespace E25media\MagentoCommunity\Plugin;
use Magento\CatalogInventory\Api\StockRegistryInterface;
use Magento\Framework\Message\ManagerInterface;
use Magento\Framework\DataObject\Factory as DataObjectFactory;
class Quote
{
/**
 * @var StockRegistryInterface
 */
private $stockRegistry;

/**
 * @var ManagerInterface
 */
private $messageManager;

/**
 * @var DataObjectFactory
 */
private $objectFactory;

/**
 * Quote constructor.
 *
 * @param StockRegistryInterface $stockRegistry
 * @param ManagerInterface $messageManager
 * @param DataObjectFactory $objectFactory
 */
public function __construct(
    StockRegistryInterface $stockRegistry,
    ManagerInterface $messageManager,
    DataObjectFactory $objectFactory
) {
    $this->stockRegistry = $stockRegistry;
    $this->messageManager = $messageManager;
    $this->objectFactory = $objectFactory;
}

public function beforeAddProduct(
    \Magento\Quote\Model\Quote $subject,
    \Magento\Catalog\Model\Product $product,
    $request
) {
    if ($request === null) {
        $request = 1;
    }
    if (is_numeric($request)) {
        $request = $this->objectFactory->create(['qty' => $request]);
    }

    $messageCollection = $this->messageManager->getMessages(true);
    $messageCollection->getLastAddedMessage()->getText();   //Getting an error in this line.
    if ($product->getId() && $request) {
        $stockItem = $this->stockRegistry->getStockItem($product->getId(), $product->getStore()->getWebsiteId());
        if ($stockItem->getQty() < $request->getQty()) {
            $remainingQty = $request->getQty() - $stockItem->getQty();
            $request->setQty($stockItem->getQty());
            $this->messageManager->addSuccess(__('%1 item not available', $remainingQty));
        }
    }

    return [$product, $request];
}
}

as per requirement product is adding to the cart.
I want to concatenate the message and add some more part to the message to show in the product profile page.

$messageCollection->getLastAddedMessage()->getText();

above line my code is breaking. Any help to complete my task higly apreciated


texts: Magento 2 : I have add new field to cusotmer group but value not save

texts:
I have add new custom fields to customer group (adminhtml) but value not save.

For add new field into customer group I have override below file:

  Block/Adminhtml/Group/Edit/Form.php

$form = $this->getForm();
$fs = $form->getElement('base_fieldset');
//$groupId = $this->_coreRegistry->registry( RegistryConstants::CURRENT_GROUP_ID);
$fs->addField(
    'display_status',
     'select',
     [
         'label' => __('Status'),
         'title' => __('Status'),
         'name' => 'display_status',
         'required' => true,
         'options' => [
             '1' => __('Enabled'),
             '0' => __('Disabled')],
         ]
);
$this->setForm($form);

Is there any need to override any model for save value?

Please guide me
thanks


texts: Location of the translation 'All [category]' in submenu

texts: I want to find the location (or source) of the translation of the 'All [CATEGORY]' string in the submenu (All componenten in this situation):


texts: Product Page 404 - product re-save needed

texts:
After updating some products by importing csv file, there are some of them that display 404 error in frontend product view page.

Saving these products manually solves the issue.
Saving these products by using "update attributes" action, does NOT solve the issue
Re-indexing product data does NOT solve the issue
I have a single website/store/view in magento.

Does anybody know where does this issue come from and how can i fix it, without having to re-save products one by one?

-------- UPDATE ---------

I have noticed that these products have no records in "URL Rewrite Management".

The strange thing is that reindexing does not re-generate urls rewrites, but saving product does.


texts: Magento frequent database connection issue

texts:
My Magento website has a separate web server and the database server is different (so basically it's a remote connection). I have a test site as well that has a separate database on same remote database server. Oftentimes I see database disconnection issue in my main Magento store, however my test site works smoothly. What's the issue?

I see Cloudflare error 524 most of the times and when I restart the database server I get "Connection failed: SQLSTATE[HY000] [2002] Connection refused"

After some time, everything starts working fine on it's own. I get any reports in var/Log files.


texts:
I want to add shipping city wise and without zipcode.
I think to add dropdown for cities is important here.
I checked out this link

But couldn't understand what i will have to do in order to add shipping city wise.


texts: Magento 2 show Terms and Conditions at the time of Registration

texts:
Is there a way or I want a plugin that allows showing Terms and Conditions and Privacy and Policies showing Separate checkboxes so Customers have to check both checkboxes and complete the registration.

I have Magento CE 2.1.11 installed may need to change theme couple of times on the request of client so setting it into theme might not be a good idea.


texts: How can I get the products list block using getLayout()->getBlock()?

texts:
How can I get the block containing all the products using getLayout()->getBlock()? (or with another method, as long as I get the block).

And also - is there a list with all the options I can provide to getBlock()? or can I somehow find it from the XML files in a reasonable way?

I didn't find any decent docs for this function.


texts:
I want to display the price excluding tax of a single item in the cart.
Therefore I need to edit the app/design/frontend/theme/theme/template/checkout/cart/item/default.phtml

How can I display the price of a single item?
I tried <?php echo $item->getPrice();?> but that did not work.


texts: Magento 2 Rest Api - Is this searchCriteria filter correct?

texts:
I'm trying to retrieve

virtual products,
which have been modified before a certain date
and which still are in stock

I'm using this

  /rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=2019-05-25
  00:00:00
  &searchCriteria[filter_groups][0][filters][0][condition_type]=lt

  &searchCriteria[filter_groups][1][filters][0][field]=quantity_and_stock_status&searchCriteria[filter_groups][1][filters][0][value]=1&searchCriteria[filter_groups][1][filters][0][condition_type]=eq

  &searchCriteria[filter_groups][2][filters][0][field]=type_id&searchCriteria[filter_groups][2][filters][0][value]=virtual&searchCriteria[filter_groups][2][filters][0][condition_type]=eq

  &fields=items[sku]&searchCriteria[pageSize]=100

While this returns some results, I have picked one returned sku,
marked it as out of stock, and tried the above search again.

My problem is, my test sku which I marked out of stock, is again appearing in that search.

Is my search query correct?

--- edit ---

I'm setting the test sku as out-of-stock like this:

  PUT /rest/V1/products/test_sku/stockItems/1

  DATA {"stockItem":{"qty":0}}

I'm hoping this is the right way to mark an item as out of stock

---- edit 2 -----

FYI: the "Display Out of Stock Products" in my Stores>Configuration>Catalog>Inventory is set to default "No"


texts: How to add dropdown in checkout page after shipping method in Magento 2

texts:
I want to add custom fields on checkout page. I have already added delivery date using this extension. It's working fine.

Now i want to add one more dropdown after delivery date. I have already added that but i am not getting how i can add options of dropdown from database.

I have one database table with all data. I want to get that data on checkout page to set in new dropdown.

Update:

There is no issue with saving the selected option value in database. I am already done with this. Only issue is how i can display options from my custom database.


texts:
I'm trying to override the list product page. My objective is add certain information on each product above the add to cart button for example.

I already did with the single page product, just overrided catalog_product_view.xml and added my block where I wanted.

But with list product I'm watching the catalog_category_view.xml and I really don't know how to it.

<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">

product/list.phtml This template is doing all the work. So I only think to copy this template on my vendor's module and write my stuff where I want.

Is this the propper way? Can't I only write my block and indicate magento to use it? I don't like to copy all this 'core' template and write inside modifying it


texts: When I started working with Magento 2, that was the first time I came accross this abbreviation so I have no idea what does that word/abbreviation mean ?


texts: Magento 1.9 - Upload file from Product View page

texts:
I have this code to upload file/image but don't know in which file I need to add this code to work.

public function saveAction() {
if ($data = $this->getRequest()->getPost()) {
    if (isset($_FILES['image']['name']) && $_FILES['image']['name'] != '') {
            try {
                $uploader = new Varien_File_Uploader('image');
                $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
                $uploader->setAllowRenameFiles(true);
                $uploader->setFilesDispersion(true);
                $newDir = "YOUR_DIRECTORY_TO_UPLOAD";

                $newdirPath = Mage::getBaseDir('media') . DS . "YOUR_DIRECTORY_TO_UPLOAD";

                if (!file_exists($newdirPath)) {
                    mkdir($newdirPath, 0777);
                }

                $path = Mage::getBaseDir('media') . DS . $newDir . DS;
                $resizedPath = Mage::getBaseDir('media') . DS . $newDir;
                $uploader->save($path, $_FILES['image']['name']);
                $uploadedimage = $uploader->getUploadedimage();
                $_imgUrl = $resizedPath . $uploadedimage;

            } catch (Exception $e) {

            }
            $data['image'] = $uploader->getUploadedimage();
        }
    $model = Mage::getModel('menu/menu');
    $model->setData($data)
    ->setId($this->getRequest()->getParam('id'));

    try {

        $model->save();
        $menu_id = $model->getId();
        if(isset($data['links'])){
            $customers = Mage::helper('adminhtml/js')->decodeGridSerializedInput($data['links']['customers']); //Save the array to your database

            $collection = Mage::getModel('menu/grid')->getCollection();
            $collection->addFieldToFilter('menu_id',$menu_id);
            foreach($collection as $obj){
                $obj->delete();
            }
            foreach($customers as $key => $value){
                $model2 = Mage::getModel('menu/grid');
                $model2->setMenuId($menu_id);
                $model2->setCustomerId($key);
                $model2->setPosition($value['position']);
                $model2->save();
            }
        }

        Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('menu')->__('Item was successfully saved'));
        Mage::getSingleton('adminhtml/session')->setFormData(false);

        if ($this->getRequest()->getParam('back')) {
            $this->_redirect('*/*/edit', array('id' => $model->getId()));
            return;
        }
        $this->_redirect('*/*/');
        return;
    } catch (Exception $e) {
        Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
        Mage::getSingleton('adminhtml/session')->setFormData($data);
        $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
        return;
    }
}
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('menu')->__('Unable to find item to save'));
$this->_redirect('*/*/');

}

In which file I can place this code to work?


texts: Steps to upgrade from Magento 2.x.x to Magento 2.x.x

texts:
I have seen a lot of peoples are facing the problem when upgrade from Magento 2.x.x to Magento 2.x.x.

If upgraded successfully, then people are facing the problem

  Attention: Something Wrong

and

  Something went wrong with processing the default view and we have
  restored the filter to its original state.

and

  Unable to unserialize value

and

  Element 'remove': This element is not expected. Expected is one of (
  block, container, referenceBlock, referenceContainer, uiComponent ).

These are the common errors are coming. when googled a lot of threads are found, but still, there are no solutions found.

If anyone succeeds with upgrading from Magento 2.x.x to Magento 2.x.x. Please

post the answer you followed the steps here So that peoples will fallow the same to success.

Please comment if downgrade the thread.


texts: Error : Unable to send the cookie. Size of 'mage-messages' is 4155 bytes

texts:
I'm currently getting the following message in the logs over and over again currently on Magento 2.3.5-p1:
Unable to send the cookie. Size of 'mage-messages' is 4155 bytes at vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php
Can anyone help me in figuring out why this is happening and how to fix it?


texts: M2 - Markup changing when a product has been added to wishlist

texts:
For some reason adding a product to my wishlist changes the markup of my add to wishlist button.

Screenshots:

Before adding to wishlist

+ Add to wishlist

After adding to wishlist

        <button type="button" data-post="data-post-here" data-action="add-to-wishlist" class="label action split">
            + Add to wishlist
        </button>
        <button class="action toggle change" title="Add to:" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Add to:
        </button>

                            Wish List

                            Create New Wish List

The template used to render the wishlist and add to bag button is /var/www/vhosts/client-name/production/htdocs/app/design/frontend/**VENDOR**/**THEME**/Magento_Catalog/templates/product/view/addtocart.phtml.

Yet once a product has been added to my wishlist it appears to use this template - vendor/magento/module-multiple-wishlist/view/frontend/templates/behaviour.phtml.


texts: Setting Billing and Shipping address for Quote

texts:
I am trying to set the Billing and Shipping address for the Quote extracted from the Order like this,

$quote->setBillingAddress($order->getBillingAddress());
$quote->setShippingAddress($order->getShippingAddress());

But the address is picked up in the quote hence the order is not created on Magento

The following are the messages gathered from the logs

ERR (3): Recoverable Error: Argument 1 passed to Mage_Sales_Model_Quote::setBillingAddress() must be an instance of Mage_Sales_Model_Quote_Address, instance of Mage_Sales_Model_Order_Address given, called in app/code/localXmlConnect/controllers/CheckoutController.php and defined  in app/code/core/Mage/Sales/Model/Quote.php

ERR (3): Recoverable Error: Argument 1 passed to Mage_Sales_Model_Quote::setShippingAddress() must be an instance of Mage_Sales_Model_Quote_Address, instance of Mage_Sales_Model_Order_Address given, called in app/code/local/XmlConnect/controllers/CheckoutController.php and defined  in /app/code/core/Mage/Sales/Model/Quote.php

Any help is appreciated.


texts: Magento 2 catalog filter issue in frontend

texts:
I have filter catalog product collection based customer logged in frontend, Using event observer catalog_block_product_list_collection, Filter working fine. But the issue is found in Layered navigation and pagination count and won't be update or changes count based on filter applied.

Can anyone help me how can I resolved and what changes need to done further.


texts: I need only active website stores . Below code give all website

texts:
use Magento\Framework\View\Element\Template;
use Magento\Store\Model\StoreManagerInterface;
class Website extends Template
{

    public function getWebsites()
    {
        /* Use getWebsites(true) if you need to get websites with default */
        return $this->_storeManager->getWebsites();
    }
    public function getCurrentWebsiteId()
    {
        return $this->_storeManager->getWebsite()->getId();
    }


texts: How to mass update product attribute value using install script?

texts:
If we comment  Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); then its work fine, but product update not reflected.

 $installer = $this;
        try{
            $productTypes = array(
                Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
                Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE
             );
            $productTypes = join(',', $productTypes);

            $installer->startSetup();
        $installer->addAttribute('catalog_product', 'discount', array(
            'group'             => 'Prices',
            'type'              => Varien_Db_Ddl_Table::TYPE_VARCHAR,
            'backend'           => '',
            'frontend'          => '',
            'label'             => 'Discount',
            'input'             => 'price',
            'class'             => '',
            'source'            => '',
            'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
            'visible'           => true,
            'required'          => false,
            'user_defined'      => true,
            'default'           => '',
            'searchable'        => false,
            'filterable'        => true,
            'comparable'        => false,
            //'visible_on_front'  => true,
            'unique'            => false,
            'apply_to'          => $productTypes,
            'is_configurable'   => false
        ));

      Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
      $products = Mage::getModel("catalog/product")->getCollection()->addAttributeToSelect('*');

     foreach($products as $_product) {
            $product = Mage::getModel('catalog/product')->load($_product->getId());

          if($product->getFinalPrice() < $product->getPrice()){

            $diffAmt = $product->getPrice() - $product->getFinalPrice();
            $discountPer = ($diffAmt/ $product->getPrice()) * 100;
            $product->setDiscount($discountPer);
            $product->save();
          }
     }

        $installer->endSetup();
        }
        catch(Exception $ex){
            echo $ex->getMessage();
        }


texts: How to change the email template depending on shipping method?

texts:
I was wondering if it is possible to change the email template after the order is placed depending on a shipping or payment method. I built the observer here:

config.xml

<events>
                <sales_order_place_after>
                    <observers>
                        <send_dropshipping_email>
                            <type>singleton</type>
                            <class>Salamanda_Dropshipping_Model_Dropshipping</class>
                            <method>send_email</method>
                        </send_dropshipping_email>
                    </observers>
                </sales_order_place_after>
            </events>

And also in the model php file:

demo.php

public static function send_email($observermail)
    {

        $event = $observermail->getEvent();
        $order = $event->getOrder();
        $customer = $order->getCustomerName();
        $email= $order->getCustomerEmail();

        $templateId = 1;

        $senderName = Mage::getStoreConfig('trans_email/ident_support/name');
        $senderEmail = Mage::getStoreConfig('trans_email/ident_support/email');
        $sender = array('name' => $senderName,
            'email' => $senderEmail);

        $storeId = Mage::app()->getStore()->getId();

        $vars = array('customerName' => $email,
            'customerEmail' => $customer);

        $translate  = Mage::getSingleton('core/translate');

        Mage::getModel('core/email_template')
            ->sendTransactional($templateId, $sender,  $email, $customer, $vars, $storeId);

        $translate->setTranslateInline(true);

        Mage::log($customer);
    }

I was able to send another email template when the customer places an order. But the old transactional email template is also sent to the customer (the customer gets two different emails).

How can I get the original template on this event and change it to my template....or at least disable the old email template if this shipping/payment method is used?


texts: How not to display tax in english store view

texts: I have a site with 2 store views, one in my native language and the other in english. Is it possible not to display tax when in cart in the english store view?


texts:
I'm using wysiwyg editor to insert image but it return full URL path inserted of media URL in content area.

WYSIWYG is returning path like

but iI want a URL like

any help would be appreciate.


texts: Where can i use $('#elementId').trigger('contentUpdated') and how?

texts:
I have added my script as follows in template :

<script type="text/x-magento-init">
{
    "*":{
        "Vendor_Module/js/myscript":{
            "baseUrl": "<?php echo $quickshopHelper->getBaseUrl() ?>",
            "qsLabel": "<?php echo $quickshopHelper->getQuickShopLabel() ?>",
            "itemClass": "<?php echo (!empty($itemClass))?$itemClass:"" ?>",
            "target": "<?php echo (!empty($target))?$target:".product-item-info"; ?>",
            "autoAddButtons":<?php echo ($autoAddButtons==1)?"true":"false" ?>
            }
    }
}
</script>

I have called the template in default.xml cause I want it everywhere in frontend. Its working fine on page load but on certain pages when ajax call is made, my script doesn't work. I tried on the same template to trigger mage using below code but it's not working.

<script>
require([
    'jquery'
], function ($) {

        $('.main').trigger('contentUpdated');
});
</script>

And yes the selector is in another module and not my template. I have almost referred everything I could find related to this declarative notation but could not find the solution yet.


texts: Magento 2 : How to Add Currency Flag to Currency Switcher Dropdown?

texts:
I m working on Magento 2.3.5 p1,
can we add currency flag in currency switcher that appeared at top header?
if yes please let me help on this.
Thanks in advanced.


texts: How to save upload image file to a folder on product edit page in backend in Magento 2

texts:
I have added a custom tab on admin product edit page. And in that custom tab added a image upload field. I need to save the image while saveing the product.

Is it possible to do it via ajax and a controller?

Please give me a solution to save image.


texts: Does the name of sitemap.xml file matter for SEO (closed)

texts:
In our multi-store Magento, we have named the sitemaps as following and in Google webmaster tool we have no error. But when it comes to checking the SEO of our website through on-line tools, we get Sitemap.xml missing. Does the name of the sitemap.xml matter for SEO?

OurStoreViewName1_sitemap.xml
OurStoreViewName2_sitemap.xml
OurStoreViewName3_sitemap.xml


texts: Instock and out of stock issue in magento 2

texts:
Please help me to find out issue,I am using Magento 2.1.8 with custom porto theme. When change product stock status to outofstock it's not display in frontend.

In frontend product page there always show instock product label even I change status from admin.

but ,When i run reindex data command and it's working perfect. So how we solve this issue.
why i have every time run reindec command ?


texts: How to remove the main content area from home page?

texts:
How do I remove this section from homepage?

<main id="maincontent" class="page-main"></main>

All of my home page content is done in blocks and I'm now stuck with this large empty maincontent section on the homepage that I can't seem to get rid of.

I'm on Magento 2.2.1


texts: Display Advanced Search/Search on home page

texts: Currently  there is no search option on my home page, just categories are displayed. I tried to add search option by following Marius's post, on Home page I got search option as shown in 1st pic, when I perform some search, On result page, I am getting just counts of founds(that are also not correct), not actual products,as shown in pic2, my question is that Am I missing some thing here? or is there an other way to do this(please guide me), I have also tried Link, this just  shows option for search, return no result


texts: Two categories are loading every available product in category

texts:
Most of my categories are working fine and only loading 12 products per page. Two of my categories are loading in every product assigned to those categories causing a very high page load time.

The categories have the same relevant settings as other categories that are working correctly (Anchor -> Yes, Display: Products Only).

Products per page on grid default value is set to 12 and products per page on grid allowed values is 6, 12, 18.

List mode is set to Grid Only.

Flat catalog category and flat catalog product are set to no.

Update:
I've traced through the codebase and found that this category is deciding to be set to isLoaded before calling _loadEntities() so it never calls the $this->getSelect()->limitPage($this->curPage, $this->_pageSize); however other categories get into this function because isLoaded is false. You can see this functionality in Magento\Eav\Model\Entity\Collection\AbstractCollection


texts:
Is there a way to remove the shipping address for a specific product only? Right now there are solution that instruct the removal of shipping address for overall product. But I want it to be done for specific product only. There are product that needs this shipping address but there are also some that do not. Any idea on how to achieve this?

Note: I'm looking for Magento 2 way to do this