texts: Full reindex extension for backend doesn't work. How to run a full reindex for 13.1 in backend?

texts:
Since Magento EE 13.1 doesn't allow a full reindex in backend I developed an extension which provides a "Shell reindex" button in backend (on index management page) and suppose to run a full reindex. But it seems the "full reindex" will not be triggered, only product attributes seemed to be updated. Can anyone help me? Whats wrong with my module?

Thank you for everyone's help.

app/code/local/MyModule/ShellIndexer/controllers/Adminhtml/ProcessController.php

require_once 'Mage/Index/controllers/Adminhtml/ProcessController.php';
class MyModule_ShellIndexer_Adminhtml_ProcessController extends    Mage_Index_Adminhtml_ProcessController {
public function shellAction() {
    $process = Mage::getSingleton('index/indexer');
    $collection=$process->getProcessesCollection();

    $indexingProcesses = Mage::getSingleton('index/indexer')->getProcessesCollection();

    foreach ($indexingProcesses as $process) {
        $process->reindexEverything();
    }

    Mage::app()->getCacheInstance()->flush();
}
}

app/code/local/MyModule/ShellIndexer/Block/Adminhtml/Process.php

    class MyModule_ShellIndexer_Block_Adminhtml_Process extends Enterprise_Index_Block_Adminhtml_Process {
    public function __construct()
    {
    $this->_blockGroup = 'enterprise_index';
    $this->_controller = 'adminhtml_process';
    $this->_headerText = Mage::helper('index')->__('Index Management');

    parent::__construct();

    $this->_removeButton('add');
    $url = Mage::helper("adminhtml")->getUrl("/process/shell");
    $script = "new Ajax.Request('".$url."',{method:'post'});";
     $this->_addButton('Shell ReIndex', array(
                      'label' => Mage::helper('index')->__('Shell Re-Index'),
                      'onclick' => $script,
                      'class' => 'save',
            ), -100);
}

}

etc/config.xml (not relevant for the issue, but if anyone wants to rebuild the extension)

   <?xml version="1.0"?>
<config>
<modules>
    <MyModule_ShellIndexer>
        <version>1.0.0.0</version>
    </MyModule_ShellIndexer>
</modules>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <MyModule_ShellIndexer before="Mage_Index_Adminhtml">MyModule_ShellIndexer_Adminhtml</MyModule_ShellIndexer>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

<global>
    <blocks>
        <mymodule_shellindexer>
            <class>MyModule_ShellIndexer_Block</class>
        </mymodule_shellindexer>
        <enterprise_index>
            <rewrite>
                <adminhtml_process>MyModule_ShellIndexer_Block_Adminhtml_Process</adminhtml_process>
            </rewrite>
        </enterprise_index>
    </blocks>
</global>
</config>


texts: Magento Production Custom theme custom css file is not loading

texts:
My custom theme is not loading the compiled Less CSS file. In the theme layout XML, I am loading the CSS files as below in default_head_blocks.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/responsive.css" />
    <css src="css/custom.css" />
    <link src="js/custom.js"/>

</head>

then I have a custom.less file also. In my local everything is fine. But when I pushed my code to the production server and run all the setup: upgrade, indexer, static deploy commands this "custom.css" file is not loading. The files get generated in pub/static folder but CSS files are not loading in head section.

Only upto responsive.css is loading in Head section. the custom.css and custom.js are not loading.

Anyone knows what is the reason and how to solve this?


texts: Magento 2 tabs - change programmatically

texts:
I'm wondering how to exactly change tab (core mage/tabs widget) programmatically. Docs say that I can use both activate and enable functions for that: http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/widgets/widget_tabs.html

Unfortunately, no one is recognized.

Tabs are initialized as follows:

var tabs = $('.tabs');
tabs.tabs({
    openedState: 'active-tab'
});

Initialization and other base things work fine. The issue occurs when I would like to change tab programmatically:

tabs.activate('3'); // Uncaught TypeError: tabs.activate is not a function

I'm not sure what I am doing wrong.


texts: Magento 2.3.0 - Newsletter subscription message not on homepage

texts:
When I submit the newsletter subscription form on the homepage, the page will reload but no message will be shown. When i go to an other page the message is visible for 8 seconds and fades away (that's okay).

But how can i get the message also visible on the homepage, I prefer beneath the input field where you fill in your emailaddress.

Can someone help me with that?

Regards,


texts: How do I determine if a widget is being used?

texts:
I'm cleaning up an extension which appears to effectively do nothing; the one remaining component to be removed is a widget, but I'm unsure how I would determine if the widget is used.

What tactic would I need to follow to confirm whether or not the widget is in use in the system?


texts: magento 2 - How to add column to grid of customers in admin

texts:
In magento 2, How to add column to grid of customers in admin ?
Please show me step by step if you can.


texts: SUPEE-8788 in Magento 1.9.3.7 Failed by curl.php

texts:
I upgraded a Magento shop from 1.8.1.0 to 1.9.3.7.

I upgraded in Steps 1.8.1.0 -> 1.9.01 -> 1.9.2.4 -> 1.9.3.7

The shop is running and it really fits.

I did a test on magereport.com and everything is green.
Only a patch is displayed as not installed: SUPEE-8788 - This is not good.

I then downloaded and installed the last version of the patch from Magento.
Almost everything was skipped (hunk ignored).

This one is failed:

checking file downloader/lib/Mage/HTTP/Client/Curl.php

Hunk #1 FAILED at 373.

1 out of 1 hunk FAILED

I tried different solutions.
I used a completely new "downloader" folder from the current Magento 1.9.3.7 and tried again to patch. It just does not work.
It is only the file curl.php that is causing problems.
Unfortunately I can not find a v1 version of the patch 8788 (1.9.2.4). To patch first v1 and then v2. That would be worth a try.

What can I do to patch a 1.9.3.7 shop with SUPEE-8788?

Thanks in advance


texts: In the database, what is the relationship between the customer_entity table and sales?

texts:
I'm trying to merge Magento orders between two different stores and I'm tracking down all of the relationships. The one I'm currently trying to figure out is the customer_entity table and the sales_* tables. I don't see a foreign key or entity_id that would line the two up.

How does Magento associate customer tables with sales?


texts: call two images in list.phtml in magento 1.9.2.4

texts:
onmouseout I want to display the second image of the product.

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image'); ?>"  onmouseover="this.src = '<?php echo $this->helper('catalog/image')->init($_product, 'small_image'); ?>';"
                 onmouseout="this.src = '<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>';" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />

i used this code but it will display two images consectively and i am unable to seperate them for onmouseover and onmouseout.

<?php
$product = Mage::getModel('catalog/product')->load($_product->getId());

foreach ($product->getMediaGalleryImages() as $image) {
    echo var_export($image->getUrl());
}
 ?>


texts: Why Order tab of Customer Information Section is not showing in Magento-2.2.7?

texts:
Order Tab is showing Blank when i click on the following path in admin panel:

Customers->Edit(Particular Customer)->Click on Order Tab of Customer

Information Section. This is the  screenshot  Blank Order Tab

Please help me for solve this issue in Magento-2.2.7


texts: How to add custom message to certain products on both checkout and product page?

texts:
I'm trying to create a custom message appear for certain products that are flagged as so from the admin panel. These products will create a message on both the checkout and product page. For example some products will have to give an alert saying "This product does not give free shipping." in a red box.

I've attempted to create a module for this with an event handler however I can't seem to figure it out.

Can anyone point me in the right direction as to how to solve this issue?


texts: How load only the required JS based on page?

texts:
I created a cms blank page and i found that it loads 179 js scripts, that slow down page loading. I assume that the problem is the theme i'm using.

I want that pages loads only the stricly necessary scripts, how i could achieve this without rewriting a custom theme?


texts: How can I remove b2b module links in the header?

texts: I have made a child theme off Luma and am on 2.2.6. Company Structure, Requisition Lists, and Send Invitations are all links on the drop down in the header. I tried this- How to add or remove header.links in magento2? and it works for other links but not these b2b links. How can I find the name to remove or is there a different way?


texts: How do I enable card save future as braintree credit card payment option in Magento2 on checkout page?


texts: After configuring live site on my localhost(Xampp) getting error

texts:
Please visit here to see the issue :-

http://nimb.ws/3hQZbP

On my live site memcache, Redis etc was running, to remove this settings for my localhost i've modified app/etc/local.xml.
I've also take a fresh .htaccess file, removed var folder still getting same problem.

here is my local.xml :-
====================Start of local.xml==============

<config>
    <global>
    <install>
        <date><![CDATA[Tue, 19 Jan 2016 05:05:05 +0000]]></date>
    </install>
    <crypt>
        <key><![CDATA[cd6448749aa393de861a60b125221c15]]></key>
    </crypt>
    <disable_local_modules>false</disable_local_modules>
    <resources>
        <db>
            <table_prefix><![CDATA[mg]]></table_prefix>
        </db>
        <default_setup>
            <connection>
                <host><![CDATA[127.0.0.1]]></host>
                <username><![CDATA[root]]></username>
                <password><![CDATA[]]></password>
                <dbname><![CDATA[benoit2]]></dbname>
                <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                <model><![CDATA[mysql4]]></model>
                <type><![CDATA[pdo_mysql]]></type>
                <pdoType><![CDATA[]]></pdoType>
                <active>1</active>
            </connection>
        </default_setup>
    </resources>
    <session_save><![CDATA[files]]></session_save>
    </global>
    <admin>
    <routers>
        <adminhtml>
            <args>
                <frontName><![CDATA[storeadmin]]></frontName>
            </args>
        </adminhtml>
    </routers>
    </admin>
</config>

===============End of local.xml===================

Thanks in advance...!!!


texts: Magento - "Create Permanent Redirect for old URL" in bulk

texts: We have 20,000 listings and had to bulk update Name (title) for all of them. We want the URL to be in accordance with new Name, but we want to keep the old URL's as well and have them 301 redirected to new URLs. If we want to do it 1 by 1, it is easy: open a new listing, erase URL key and checkmark "Create Permanent Redirect for old URL", but this option isn't available for mass updating. Is there a workaround for this? Thank you!


texts:
The project is using the Bluefoot plugin to add the block in cms_index_home. I created a static block in Magento Admin with the follow content:

{{block class="ProductsRegulars\Block\Recommendation\Lists" name="product-recommendation" template="recommendation/list.phtml}}

But in my cms_index_home.xml I have some arguments essentials to block.

<arguments>
    <argument name="jsLayout" xsi:type="array">
        <item name="components" xsi:type="array">
            <item name="recommendation-list" xsi:type="array">
                <item name="component" xsi:type="string">ProductsRegulars/js/view/recommendation/list</item>
                <item name="config" xsi:type="array">
                    <item name="template" xsi:type="string">ProductsRegulars/recommendation/list</item>
                </item>

                <item name="children" xsi:type="array">
                    <item name="messages" xsi:type="array">
                        <item name="sortOrder" xsi:type="string">0</item>
                        <item name="component" xsi:type="string">Magento_Ui/js/view/messages</item>
                        <item name="displayArea" xsi:type="string">messages</item>
                    </item>
                </item>
            </item>
        </item>
    </argument>
</arguments>

When I run the page, occur the following error:

Uncaught SyntaxError: Unexpected token u in JSON at position 0

I believe that this error occurs because of the Magento not found the arguments.


texts: Whats the purpose of lockedLoadData / uncached page build takes around a minute, spent in usleep

texts:
I think since the update to Magento 2.3.1 I have problems with uncached page loads (during development).

I did a blackfire.io trace and it turns out that 42 seconds are spent in usleep here.

Now I am wondering what the purpose of this is. I guess I am running in some kind of race condition?

Did anybody experience something like this before?

EDIT: The call stack seems to involve commercebug.


texts: Magento 2 - how to use jquery for attribute input fields which has special characters

texts:
I have three product attributes named gross_weight,stone_weight & net_weight. While entering stone_weight the net_weight should be calculated using jquery. But jquery is not recognizing input field by its name. input field names are like name="product[net_weight]".

Please suggest any solution for this problem.


texts: Install via cli but exclude some core modules

texts:
I'm installing Magento 2.2 via command line using

  php bin/magento setup:install --backend-frontname="my-admin-value" --db-host=my.db.host --db-name=dbname --db-user=dbuser --db-password=dbpass --base-url="http://example.com" --language=en_US --timezone="Europe/Bucharest" --currency="EUR" --use-secure=1 --base-url-secure="https://example.com/" --admin-user=adminUser --admin-password=AdminPass --admin-email="me@example.com" --admin-firstname=John --admin-lastname=Doe --use-rewrites=1

And it works fine, but now I want to install it and skip the at least 2 core modules because I don't need them. Let's say they are Magento_Bundle and Magento_BundleImportExport.
(Ignore the fact that there might be dependent module on these. I don't care for now. Let's say I can disable the modules when installing via UI wizard).
How can I do that? Is it even possible? Is there a parameter I need to pass to the command?
I've tried running the command with -h but nothing comes up related to modules.


texts: How to make checkout page 2columns-left on magento 2

texts:
I try to make the checkout page 2columns-leftlayout, but i can't.

If i add this code in checkout_index_index.xml

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 layout="2columns-left"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

the page is not loading

by default this layout is like this:

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

so if i change layout="checkout" to layout="2columns-left" the page is not loading

I sucesfull changed the checkout cart page in this way and is working, but not for checkout page.'

Does anyone know how to change checkout page to 2columns-left layout?


texts: Magento2: How to remove compared product and recently ordered section from my account sidebar?

texts: How to remove compared product and recently orderd section from my account sidebar as shown below


texts:
how can I access the Magento DB with phpMyAdmin?

I'm learning programming and wrote everything on a local version of Magento 1.9.2.4, on the local version I entered localhost and could see the DB in phpMyAdmin.

Now the company im doing an apprenticeship at gave me a URL for the Magento Backend and the information to access the FTP server, but how do I open the DB?
/app/etc/local.xml says <connection> <host>localhost</host>.

What do?

Thanks.


texts: How do I sort all of the multiple shipping addresses associated with a customer

texts:
We have a single customer who ships to 100+ ship to addresses.  It appears as if they are listed in random order when selecting a previous ship to address when entering orders on the backend of Magento.  We enter the majority of our orders through the admin backend as we receive purchase orders via fax and/or email.

We run Magento 1.9.1.1 in production and 1.9.2 in a test environment (testing the latest patch).

I can't find much on this topic.  Any pointers are greatly appreciated.


texts: Magento 2.1 upgrade error: Table 'sequence_salesrule' already exists

texts:
I upgraded to Magento 2.1 and now I'm getting the following error doing bin/magento setup:upgrade:

$ bin/magento setup:upgrade --keep-generated
Cache cleared successfully
[...skip...]
Module 'Magento_SalesRuleStaging':
Installing schema...

  [Zend_Db_Statement_Exception]
  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'sequence_salesrule' already exists, query was: CREATE TABLE sequence_salesrule (
                       sequence_value integer UNSIGNED NOT NULL AUTO_INCREMENT,
                       PRIMARY KEY (sequence_value)
              ) AUTO_INCREMENT = 1

  [PDOException]
  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'sequence_salesrule' already exists

I remove the database table by running this SQL:

SET FOREIGN_KEY_CHECKS=0; DROP TABLE sequence_salesrule; SET FOREIGN_KEY_CHECKS=1;

Now I get the following error when running bin/magento setup:upgrade again:

$ bin/magento setup:upgrade --keep-generated
Cache cleared successfully
[...skip...]
Module 'Magento_SalesRuleStaging':
Installing schema...

  [PDOException]
  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'row_id'

I can't find that column anywhere. If I knew where that column would be, then I could remove it and try to run the command again...


texts:
When I click on "proceed to checkout" button getting error time to implement custom payment method.

config.xml

  app\code\local\Excellence\Pay\Model\Pay.php

class Excellence_Pay_Model_Pay extends Mage_Payment_Model_Method_Abstract
{

    protected $_code = 'pay';
    protected $_formBlockType = 'pay/form_pay';
    protected $_infoBlockType = 'pay/info_pay';
    public function assignData($data)
    {
        if (!($data instanceof Varien_Object)) {
            $data = new Varien_Object($data);
        }
        $info = $this->getInfoInstance();
        $info->setCheckNo($data->getCheckNo())
        ->setCheckDate($data->getCheckDate());
        return $this;
    }

    public function validate()
    {
        parent::validate();

        $info = $this->getInfoInstance();

        $no = $info->getCheckNo();
        $date = $info->getCheckDate();
        if(empty($no) || empty($date)){
            $errorCode = 'invalid_data';
            $errorMsg = $this->_getHelper()->__('Check No and Date are required fields');
        }

        if($errorMsg){
            Mage::throwException($errorMsg);
        }
        return $this;
    }
}

The Error is:-


texts: Magento2: Save Product Data for global scope using Rest API

texts:
I am trying to add product using Rest API. Adding product is working fine.

But I am facing issue in assign in the product information only for Default values instead of copying data for store view. When we select store view Use Default Value checkbox must be checked. Only one attribute value must save in database with scope 0 instead of copying same values for each store.

How can I achieve the above scenario using Rest API ? Below is what I have tried so far:

Case 1:

I tried to call API using the below URL, But It replicate the product values for store view.

POST   /rest/V1/products

Case 2:

I tried to call API using the below URL, But It also replicate the product values for store view.

POST   /rest/{store_code}/V1/products

Case 3:

I tried to call API using the below URL

POST   /rest/all/V1/products

using the above website not assigned to product. so I called catalogProductWebsiteLinkRepositoryV1 to assign product in website as below, but it also replicate the product values for store view.

POST   /rest/V1/products/{sku}/websites

Please suggest how can we save product data for global scope only ?

Note: only have one website, one store and one store view in magento installtion.


texts: Magento 2. Sales -> Invoices - add column to grid

texts: How may i add column to Sales -> Invoices grid?


texts: Products exist in the database but are not showing in backend or frontend

texts:
In the Magento back-end interface, when viewing Catalog / Manage Products, the list of products is empty.

In addition, in the Magento front-end interface, when viewing any list of products, such as a category, the list of products is empty:

http://example.com/category.html

However, I am able to view individual products in the front-end interface by typing in the url for the individual product:

http://example.com/product.html

In addition, I am able to verify that the correct number of products exist in the database using:

select count(*) from `catalog_product_entity`;

Between when the products were showing and when they disappeared, I had done a System / Import / Dataflow Profiles / Import All Products from a CSV containing data like the following:

sku, status
101, enabled
102, disabled

The import did not throw any errors, but the status field did not understand the use of enabled / disabled, so I imported again from a CSV containing data like the following:

sku, status
101, 1
102, 0

Again, the import did not throw any errors, but the values for the status field were still not correct, so after reference to http://www.magentocommerce.com/knowledge-base/entry/working-with-product-csv-files I imported again from a CSV containing data like the following:

sku, status
101, 1
102, 2

Once again, the import completed without throwing any errors. But even after indexing, none of the products now display in any list of products.

I also tried setting visibility by importing from a CSV containing data like:

sku, visibility
101, 4
102, 4

Again, the import completed without throwing any errors. But still, none of the products display in any list of products.

Running System / Import / Dataflow Profiles / Export All Products to CSV shows that the visibility for most records is currently Catalog / Search but for the subset of records where visibility was explicitly set to Catalog / Search by importing a CSV as above, the visibility is now set to Not Visible Individually. It appears that explicitly setting the visibility performs some internal validation that fails and then defaults the visibility to Not Visible Individually. What could cause this import validation to fail?

I believe this is not a duplicate of Products not showing up in frontend or backend but are enabled and stored correctly in flat table because the symptoms of the issue (not displaying in back-end vs not displaying in back-end or front-end) and the versions of Magento (1.5 vs 1.9) are significantly different.


texts: allow any php script instead of 404 page?

texts:
I am trying a new local development method on windows using magento 2 on vagrant on windows and it's up and running.  Now I'm trying to add xdebug with PHPstorm but it's unable to "see" an uploaded phpinfo.php file because all PHP files are disabled.

The phpinfo.php file is in pub but when viewing http://myinstall.local/phpinfo.php I get the 404 page and I'm trying to figure out where it is and to remove this as it's only a test system on my localhost.

I have commented out the last lines of magento\nginx.conf:
(note magento is the root folder on the installation)

# Banned locations (only reached if the earlier PHP entry point regexes don't match)
#location ~* (\.php$|\.txt$|\.phtml$|\.htaccess$|\.git) {
#    deny all;
#}

I've tried adding phpinfo to (what I believe are exclusions to being sent to eh main script) exclusion:

# PHP entry point for main application
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check|phpinfo)\.php$ {

And of course I have restarted nginx:

vagrant@magento2-test:~/magento$ sudo /etc/init.d/nginx restart

  [ ok ] Restarting nginx (via systemctl): nginx.service.

I have confirmed that the error page is severed from /errors/404.php and so I've commented out the lines of magento\.htaccess and magento\pub\.htaccess that would use this:

# For 404s and 403s that aren't handled by the application, show plain 404 response
#ErrorDocument 404 /errors/404.php
#ErrorDocument 403 /errors/404.php

In general the .htaccess seems to be allowing any specific file...

############################################
## Never rewrite for existing files, directories and links

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

...so I am now quite confused - can anyone please advise what else I could try to allow a random PHP file, or even a specific one like phpinfo.php, to serve from the pub folder please?


texts: In Magento 2.3.4, Maximum Sales Quantity validation is not working based on cart items

texts:
I have simple products with custom options, where I can add the products with different options on cart. In cart page, its show different cart items.

For Example: Simple product with cutom options (color and size)

Cart Item 1: Black with small size
Cart Item 2: Green with small size

I added cart item 1 with maximum quantity. While adding the cart item 2 with maximum quantity it throws an error message as

The requested qty exceeds the maximum qty allowed in shopping cart

Excepted results: It should add the item without throwing an error.


texts:
No Summary is getting generated when configuring a bundled product on my Magento installation. I have been debugging the /vendor/magento/module-bundle/view/frontend/web/js/product-summary.js file but all I can tell is that it is getting fired on each event. I can get the file to log the names of the products added to the bundle ect just nothing is added to the bundle summary.

The bundle-summary container is present and there are no errors in the console. Has anyone else experienced this?


texts: static block is doubling when update Layout Update XML

texts:
I am trying to update the layout of the right sidebar on a CMS page, and the block is doubling, I have created a Static Block and then called using the following method:

<reference name="right">
<block type="cms/block" name="right.permanent.callout">
<action method="setBlockId"><block_id>about-right</block_id></action>
</block>
</reference>

After creating this, the Static Block doubled the content on the page, as you can see in this link

Does anyone know what might be causing this?

This is the code related to the sidebar in my local.xml:

    <remove name="catalog.compare.sidebar"/>
    <remove name="left.reports.product.viewed" />-->
    <remove name="right.reports.product.viewed" />
    <remove name="right.reports.product.compared"/>
    <remove name="wishlist_sidebar"/>
    <remove name="tags_popular"/>
    <remove name="right.poll"/>
    <remove name="paypal.partner.right.logo"/>
    <remove name="reorder"/>

    <!--<remove name="right.permanent.callout"/>-->
    <remove name="left.permanent.callout"/>

Many thanks in advance,


texts: Magento 2 Get data to admin UI Form without key and collection

texts:
Is there a way to get data from a DataProvider to my UI Form component, without having a collection or a key?

My DataProvider currently only has a "getData" function and the form is rendered, but I can't get any values to my form.

My objective is to connect to an API to get the values to be used in the form.
This is my DataProvider:

<?php

namespace Invoicing\Moloni\Model\Settings;

class DataProvider extends \Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider
{
    public $loadedData;

    public function getData()
    {
        return [];
    }

}

And this is my UI Component:

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="provider" xsi:type="string">moloni_settings_edit.settings_data_source</item>
        <item name="deps" xsi:type="string">moloni_settings_edit.settings_data_source</item>
    </item>
    <item name="label" xsi:type="string" translate="true">Settings</item>
    <item name="layout" xsi:type="array">
        <item name="type" xsi:type="string">tabs</item>
    </item>

    <item name="buttons" xsi:type="array">
        <item name="save" xsi:type="string">Invoicing\Moloni\Block\Adminhtml\Settings\Buttons\SaveButton</item>
    </item>

</argument>

<dataSource name="settings_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">Invoicing\Moloni\Model\Settings\DataProvider</argument>
        <argument name="name" xsi:type="string">settings_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">id</argument>
        <argument name="requestFieldName" xsi:type="string">id</argument>
    </argument>
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
        </item>
    </argument>
</dataSource>

<fieldset name="general">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">General settings</item>
        </item>
    </argument>

    <field name="document_set_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Document set</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">document_set_id</item>
            </item>
        </argument>
    </field>
</fieldset>

After exploring the Magento code, I got to the form.php that has the following:

$id = $this->getContext()->getRequestParam($this->getContext()->getDataProvider()->getRequestFieldName(), null);

This $id in my case is null because I don't need to have any id.

Then I end up with a empty $dataSource

if (isset($data[$id])) {
        $dataSource = [
            'data' => $data[$id]
        ];
    } elseif (isset($data['items'])) {
        foreach ($data['items'] as $item) {
            if ($item[$item['id_field_name']] == $id) {
                $dataSource = ['data' => ['general' => $item]];
            }
        }
    }

In my form I will need to have data from a external API (options) and selected values (those are stored in a database table).

What's the best way to achieve this? Thank you in advance.


texts: Countdown Timer not working in Magento 2

texts:
I tried to display the Festive offer banner in Top of the page, but it's not working. For these, I tried below code.

countdownTimer.phtml file

  <?php /** @var $block ABCSolutions\OfferBanner\Block\OfferBanner */?>

<?php $from_Date = $this->helper('ABCSolutions\OfferBanner\Helper\Data')->getFromDate(); ?>
<?php $to_Date = $this->helper('ABCSolutions\OfferBanner\Helper\Data')->getToDate(); ?>
<?php $title = $this->helper('ABCSolutions\OfferBanner\Helper\Data')->getTitle(); ?>
<?php $Days = $this->helper('ABCSolutions\OfferBanner\Helper\Data')->getDays(); ?>

        <?php echo $title; ?>
        Days
        Hours
        Minutes
        Seconds

<?php
$f = $from_Date . " 00:00:00";
$fromDate = date("M/d/y h:i:s A", strtotime($f));
$t = $to_Date . " 23:59:59";
$toDate = date("M/d/y h:i:s A", strtotime($t));

$jScriptFunction = "";

echo $jScriptFunction;
?>

After printing these it looks like below image.

Well formatted in Javascript. but it's not working.

Suggest us where I went wrong?

Results are showing below image.

It's showing above image, but not countdown the time. I mean timer is not running.


texts:
I have created Rest API for getting product collection for learning purpose , I wanted to convert it in GraphQl Api.
My question is below code valid for GraphQl or there is something else? My rest APi code:

<?php
namespace Kanika\Myapi\Model;

use Magento\Framework\Exception\InputException;
class Productapi implements \Kanika\Myapi\Api\ProductapiInterface
{

     protected $_productCollection;
     public function __construct(
             \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $_productCollection
        ) {

            $this->_productCollection = $_productCollection;
        }
     public function getlist($category_ids,$is_featured,$special_price,$brands,$product_type,$page=1,$pagesize=10){
        $collection = $this->_productCollection->create();
        $collection->addAttributeToSelect('name');
        $collection->addAttributeToSelect('price');
        if(!empty($category_ids)){
            $collection->addCategoriesFilter(['in' =>[$category_ids]]);
        }
        if($is_featured==1){
            $collection->addAttributeToFilter('is_featuredproduct', array('eq' => 1));
        }
        if($special_price==1){
            $todayDate = date('m/d/y');
            $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));
            $tomorrowDate = date('m/d/y', $tomorrow);

            $collection->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
                ->addAttributeToFilter(
                        'special_to_date', array('or'=> array(
                        0 => array('date' => true, 'from' => $tomorrowDate),
                        1 => array('is' => new \Zend_Db_Expr('null')))
                        ), 'left'
                    );
        }
        if($product_type=='bundle'){ // bundle | simple | configruable
            $collection->addAttributeToFilter('type_id','bundle');
        }
        $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        $data=[];
        $collection->setPageSize($pagesize)->setCurPage($page)->load();
        foreach ($collection as $product) {
           $data[] = [
                'id'=>$product->getId(),
                'sku'=>$product->getSku(),
                'name'=>$product->getName(),
                'brand'=>$product->getBrand(),
                'price'=>$product->getPrice(),
                'special_price'=>$product->getSpecialPrice(),
                'product_type'=>$product->getTypeId()
           ];
        }
        $pagination=[
            'current_page'=>$page,
            'last_page'=>$collection->getLastPageNumber(),
            #'total_product'=>$collection->count()
        ];
        return [
            'items'=>$data,
            'pagination'=>$pagination
        ];
    }
}


texts: Add class when search results into no products in magento 2.3

texts:
I want to add one css class when on search of a particular product we does not get any result see https://prnt.sc/oyh8h9 and https://prnt.sc/oyh90w.
I want to add class in footer block based on the result for product search.
Any idea.


texts: Magento resize different size images to unique size. Read description.

texts:
I am having a catalog with different sized images. Some will be 200x300 some will be 300x150. But All i want to do is to resize all the image to one size which makes me to show in my home page listing.

I am trying the normal magento resize to crop tp 160x210 as follows,

   <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(false)->keepAspectRatio(true)->keepFrame(false)->resize(160, 210); ?>" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />

But its cropping images in different size, The images are in random height and widths 160x135, 160x156, 159x210, 150x210

Detailed answers are highly appreciated.


texts: No simple products in order object due to grouped product extension

texts:
We are using an extension that allows us to add configurable products to a grouped product. This way all the simple variations are nicely displayed per configurable product on the grouped product product page.

The problem is that when customers order simple variations from the grouped product page they are added as a configurable product to the order instead of a simple product.

Our partner which handles delivery of the products looks at the order and tried to take out all the simple products but since the products where added as a configurable products it doesn't find any and can't process the order.

Is there a way to set these products to simple products when they are ordered from a grouped product page?


texts: How can we add/update a image path with own code without using addImageToMediaGallery()

texts:
Can we update a own defined product image path to database, I am adding products with own custom code.I want to add image database  without help of

->addImageToMediaGallery()

Is it doable??
without using  this line i want to add direct path // external url to database

# media gallery initialization
->setMediaGallery(array('images' => array (), 'values' => array ()))
# assigning image, thumb and small image to media gallery
->addImageToMediaGallery('xxx/my.jpg', array('image', 'thumbnail', 'small_image'), false, false)


texts: Magento2 simple store switcher for UI grid

texts:
Is it possible to add simple store switcher for magento2 UI grid like in magento1:

(Store switcher must be located not in "Filters" tab)


texts:
I've been searching a kind of extension to upload customers in a bulk but I didn't find anything.
Do you have any system to upload a lot of customers via csv, xls.. etc? Or there's an option that I didn't find?

Thanks!


texts:
I'm trying to add some parts of a homepage to the cache to try and improve the load time of a site. I'm pulling in phtml files into the home page using my local.xml.

<cms_index_index>
    <reference name="content">
        <block type="core/template" name="home.carousel" as="carousel" template="page/home-carousel.phtml">
            <action method="setCacheLifetime"><lifetime>3600</lifetime></action>
        </block>
    </reference>
<cms_index_index>

I thought i was able to add any block to the cache by just setting <action method="setCacheLifetime"> but so far my testing has found that this block is not being added to the cache. To test i have been searching through the cache files to find any element in the phtml in the cache. I have also been doing speed tests, but those are not proving conclusive.

This is a enterprise site running full page cache, which might be caching the page, but i have found little information about how to test that.

So my question is two fold, how do i add a block to the cache and how do i test that the block is getting cached.


texts:
I'm having trouble to configure the profiler in Magento 2 (version 1.0.0-beta). I want to apply a specific configuration, I want to set a timer threshold to 0 because the default settings prevent from seeing timer below 0.001s.

$config = [
    'baseDir' => BP,
    'drivers' => [
        ['output' =>
            [
                'type' => 'html',
                ['thresholds' => ['sum' => 0.00000001]],
            ]
        ]
    ],
    'driverFactory'
];
Magento\Framework\Profiler::applyConfig($config, BP);

Can someone help me with that ?

Thanks !


texts: Why Varien_Cache_Core doesn't override Zend_Cache_Core::getIdsMatchingAnyTags()?

texts:
Varien_Cache_Core overrides both Zend_Cache_Core::getIdsMatchingTags() and Zend_Cache_Core::getIdsNotMatchingTags() to transform passed $tags before passing them to Zend_Cache_Core methods. However Zend_Cache_Core::getIdsMatchingAnyTags() doesn't get the same treatment and is not overriden which results in not cache not being flushed properly (unless the class that extends Varien_Cache_Core does it itself). Is this a bug or is there some reason behind it?

For example while saving a product through backend Mage_Catalog_Model_Product::CACHE_TAG tag should be flushed, however due to use of vanilla Zend_Cache_Core::getIdsMatchingAnyTags() the tag isn't properly handled and nothing is found.

Sample code

Tested using Cm_Cache_Backend_Redis as cache backend.

<?php
require_once 'app/Mage.php';
Mage::app()->setCurrentStore(0);

$cache = Mage::app()->getCache();

$cache->save("test", "test_id_1", ["ALL_TEST_THINGS"]);

$ids = $cache->getIdsMatchingTags(['ALL_TEST_THINGS']);
echo "
Calling getIdsMatchingTags()
";
echo "
" . var_export($ids, TRUE) . "
";

$ids = $cache->getIdsMatchingAnyTags(['ALL_TEST_THINGS']);
echo "
Calling getIdsMatchingAnyTags()
";
echo "
" . var_export($ids, TRUE) . "
";

Result

Calling getIdsMatchingTags()

array (
  0 => 'test_id_1',
)

Calling getIdsMatchingAnyTags()

array (
)


texts: Help - Magento 1.9 - How to do Observer should be trigger before place an order?

texts:
After calculated grand total in checkout page observer not trigger,

Observer :

  app\etc\modules\Gta_RestrictProductByCountry.xml

<?xml version="1.0"?>

<config>

    <modules>

        <Gta_RestrictProductByCountry>

            <codePool>local</codePool>
            <active>true</active>

        </Gta_RestrictProductByCountry>

    </modules>

</config>

  app\code\local\Gta\RestrictProductByCountry\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Gta_RestrictProductByCountry>
            <version>1.0.0</version>
        </Gta_RestrictProductByCountry>
    </modules>
    <global>
        <models>
            <gta_restrictproductbycountry>
                <class>Gta_RestrictProductByCountry_Model</class>
            </gta_restrictproductbycountry>
        </models>
    <frontend>
        <events>
            <sales_order_place_before>
                <observers>
                    <Gta_RestrictProductByCountry_Observer>
                        <type>singleton</type>
                        <class>Gta_RestrictProductByCountry_Observer</class>
                        <method>cartevent</method>
                    </Gta_RestrictProductByCountry_Observer>
                </observers>
            </sales_order_place_before>
        </events>
    </frontend>
    </global>
</config>

  app\code\local\Gta\RestrictProductByCountry\Model\Observer.php

<?php
class Gta_RestrictProductByCountry_Observer
{
    public function cartevent($Observer)
    {
        // $order = $Observer->getEvent();
        // $shipping = $order->getShippingAddress()->getShippingMethod();
        // Mage::log($shipping->getName(),null,'event.log');

        $cart_product_check = $Observer->getEvent();
        Mage::log($cart_product_check->getName(), null, 'shipping_country_not_matching.log');
    }
}


texts: Call an overriden function from an Abstract class

texts:
I'm creating a new module for allowing me to work with currency exchanges.
For doing this I'm extending this class:

Mage_Directory_Model_Currency_Import_Abstract

Overriding this method:

abstract protected function _convert($currencyFrom, $currencyTo);

Now that my module is installed, I don't know how I can call this method from my checkout classes. I want to convert some prices.

I could call it using:

Mage::getModel('my_currencyconverter/my_model')->_convert('USD', 'EUR');

But I had to change first that previous function visibility, from protected to public.

How do I use this new function?


texts:
I want to rewrite some dynamic urls like:

https://www.test.com/my-custom-url.html/?o=price&dir=asc&new=1

to

https://www.test.com/my-custom-url.html/o/price/dir/asc/new/1

Thanks.


texts: Magento 2.2.2 - RequireJS domReady! not working with Slick Product Slider

texts:
Issue

  Slick slider breaking/not loading properly on page load and eventually
  breaking the product slider

Solution:

  Load slick slider script after entire document is loaded and parsed

domReady! vs domReady

  If you include it in the the requirements array w/a trailing ! your    module won't execute until it's "safe" to interact w/ the DOM.
  If you omit the !, then it's just a normal module that happens to    be a function, which can take a callback that won't execute before
  the DOM is safe to interact with.

Reference - http://requirejs.org/docs/api.html#pageload

Using below script for domReady!

slider: function () {
    require([
        'jquery',
        'domReady!',
        'slider'
    ], function ($, slider) {

        slider({"class": "slick-slider-recently-viewed", "number": 4, "tablet": 3, "landscape": 2, "portrait": 1});
        slider({"class": "slick-slider-recommended", "number": 4, "tablet": 3, "landscape": 2, "portrait": 1});

    });
}

Exception - Uncaught TypeError: slider is not a function

Tried below using domReady and it is working

slider: function () {
    require([
        'jquery',
        'domReady',
        'slider'
    ], function ($, domReady, slider) {

        domReady(function () {

        slider({"class": "slick-slider-recently-viewed", "number": 4, "tablet": 3, "landscape": 2, "portrait": 1});
        slider({"class": "slick-slider-recommended", "number": 4, "tablet": 3, "landscape": 2, "portrait": 1});

        });
    });
}

How do I use domReady! instead of domReady ? What I understand is domReady is not a method but a RequireJS module.

Do I have to use in define instead of require like below as used in \vendor\magento\module-admin-notification\view\adminhtml\web\toolbar_entry.js

define([
    "jquery",
    "jquery/ui",
    "domReady!"
], function ($) {
    'use strict';


texts: Images in /media/catalog/product/cache are created as root:root and hence give 403 errors?

texts:
Images in /media/catalog/product/cache are created as root:root.

These images give 403 errors.

What file creates these cache files, is it Mage.php?

I have checked the root directory and all the files are root:root except /media.

I am hosting with apache


texts:
In magento 2 project, it provides 3 options by default.

Position
Product Name
Price

I need to change these options to sort as,

Most Popular
Price high to low
Price low to high

I can add from backend some other sorting options like color and product attributes as sorting options.
But I need to add above options.
Can anyone help me with that please?
How do I add new values in sorter? can it be done in backend or have to do by code?
Update
Sorter is the dropdown that has the option visible-> Position


texts: Best Practice Magento 2 / Composer / Custom Module

texts:
Can you tell me what are the best practice when you create a custom module for a project. I would say to put the custom module related to the project in app/code/MyNamespace/MyModule and all Generic Module should be in vendor.
Or should I put all in vendor folder and call my modules with composer ?

Thanks


texts: Magento 2 how to get info_buyRequest in rest result rest/V1/orders/105"

texts:
Hi can any one tell me how to get addition information (info_buyrequest) in rest api result
https://mainwebsite.com/index.php/rest/V1/orders/$order_id.
but here not getting product options getting remaining data
$order_id=42678;
$accessToken = "accesstoken";
$setHeaders = array('Content-Type:application/json', 'Authorization:Bearer ' . $accessToken);
   $ch = curl_init("https://website.com/index.php/rest/V1/orders/$order_id");
   curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($ch, CURLOPT_HTTPHEADER, $setHeaders);

   $result = curl_exec($ch);
   $result = json_decode($result, 1);
    echo '<pre>';
//    echo '************************************************** Order **************************************************************';
    print_r($result);

i need below info in order rest api result how to get
 [product_options] => Array
        (
            [aw_gc_amount] => 100.00
            [aw_gc_sender_name] => Aaron, Amy and Anna
            [aw_gc_recipient_name] => Don and Naomi Hazlett
            [aw_gc_headline] =>
            [aw_gc_message] => Enjoy
            [aw_gc_delivery_date] =>
            [aw_gc_delivery_date_timezone] =>
            [aw_gc_type] => 2
            [aw_gc_created_codes] => Array
                (
                    [0] => F3VDD9S7K09JVHOP
                )

            [info_buyRequest] => Array
                (
                    [uenc] =>
                    [product] => 8680
                    [aw_gc_amount] => 100.00
                    [aw_gc_recipient_name] => Don and Naomi Hazlett
                    [aw_gc_sender_name] => Aaron, Amy and Anna
                    [aw_gc_message] => Enjoy
                    [qty] => 1
                )

        )


texts: tab_group_code field in the eav_attribute_group table

texts:
in the table eav_attribute_group there is a column called tab_group_code that has the values null, basic, advanced.
What is this column used for and how does the value influence the product add/edit page in admin?


texts:
So I have this script:

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require('app/Mage.php');
umask(0);

Mage::app();

/* Set our dates */
$fromDate = '2016-05-30 00:00:00';
$toDate = '2019-05-31 00:00:00';

/* Get the collection. Here we set a date range, and ignore cancelled orders.
   You can filter the collection however you prefer */
$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate))
    ->addFieldToFilter('status', array('nin' => array('canceled')));

/* Here you can build an array, write to a CSV etc */
foreach($orders as $order){
    /* get order details (e.g. ID) like this: */
     echo $order->getIncrementId().'<br/>';
    $id = $order->getIncrementId()

    /* you can load the order items, if you need them */
    $items = $order->getAllVisibleItems();
}

I am trying to place this in the root of my server so I can run it and print orders to the screen. What should the file extension be .js .php .sh? Also once it's on the root of the server, how can I run it?


texts: Magento 2 : Is there any way to disable Welcome Email after signup

texts:
What is the right approach to disable Welcome Email after completes registration process. I'm using magento2.1. We have an integration with a customer management system and which will sent email to customer after registration. So we need to disable customer welcome email sent by Magento.

I created a custom module to disable mail communication.
di.xml

<type name="\Magento\Customer\Model\Customer">
        <plugin name="disable-email-confirmation" type="Company\Customer\Model\Plugin\Customer" sortOrder="1"/>
    </type>
</xml>

Model/Plugin/Customer.php

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Company\Customer\Model\Plugin;

class Customer
{
    public function aroundSendNewAccountEmail(\Magento\Customer\Model\Customer $subject, \Closure $proceed)
    {
        //$result = $proceed();

        return $subject;
    }
}

This is not working. I'm still getting emails.
I see some email communcation refereces inside AccountManagementInterface.


texts: Ajax redirecting to system configuration page in admin custom module

texts:
Hello I have made a custom admin module, in which I am uploading image using using Ajax and for this I am using ajaxfileupload library.

this is my edit.php file code which uses ajax code-

<?php
class Assel_Character_Block_Adminhtml_Character_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {

    public function __construct()
    {
        parent::__construct();
        $this->_objectId = 'id';
        $this->_blockGroup = 'character';
        $this->_controller = 'adminhtml_character';
        $this->_mode='edit';

        $this->_updateButton('save', 'label', Mage::helper('character')->__('Save Character'));
        $this->_updateButton('delete', 'label', Mage::helper('character')->__('Delete Character'));

        $this->_addButton('saveandcontinue', array(
            'label'     => Mage::helper('adminhtml')->__('Save And Continue Edit'),
            'onclick'   => 'saveAndContinueEdit()',
            'class'     => 'save',
        ), -100);

        $pathToMethod=$this->getUrl('*/*/fileUpload'); /*url of method in controller file to process on file or image*/

        $this->_formScripts[] = "var pathToMethod="."'".$pathToMethod."'";/*assign url of controller method in js variable to use in ajax below*/
        $script  =
<<<EOD

            function saveAndContinueEdit(){
                editForm.submit($('edit_form').action+'back/edit/');
            }

            jQuery(function($){
                var btnUpload=$('#upload');
                var status=$('#status');

                new AjaxUpload(btnUpload, {
                    action:'pathToMethod', /*call the method in controller file in custom module*/
                    name: 'uploadfile',
                    onSubmit: function(file, ext){
                         if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){

                            status.text('Only JPG, PNG or GIF files are allowed');
                            return false;
                        }
                        status.text('Uploading...');
                    },
                    onComplete: function(file, response){

                        status.text('');

                        if(response==="success"){
                            $('

').appendTo('#files').html('
'+file).addClass('success');
                        } else{
                            $('

').appendTo('#files').text(response).addClass('error');
                        }
                    }
                });

            });
EOD;

        $this->_formScripts[] = str_replace(array("\r\n", "\r", "\n"), "", $script );

    }

My problem is this Ajax call is giving the HTML of whole page of System->configuration in admin in response instead of calling method defined in controller.

What is wrong there in my code, somebody there to help me.?


texts: Magento 2 Magento\Framework\Exception\LocalizedException through exception, but didn't track anything in error log

texts:
When applying laygered navigation filter in my Magento 2, In Developer Mode I got this error,

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): sorry, something went wrong. You can find out more in the error log

But the problem is that nothing is tracked in whether the Apache error log or the Magento log. So I don't know how to diagnose the issue.

Any ideas on how to debug when seeing errors like this?

Update,

If I turn Production Mode on, the Exception #0 (Magento\Framework\Exception\LocalizedException): error mesesage is gone, and it displays an empty page, but I in developer tools in my browser it says "JavaScript seems to be disabled in your browser".

But I'm sure it's nothing to do with Javascript on my browser. I've tried with different browsers on different computers, I got the same error.


texts:
i have array in phtml template ,want pass it to web/html template
any help? magento 2
send  names arrat to web/html/template

$names=  $blockObj->getRuleName($val);


texts: Issue - Multi-Store Category Disable Not Working

texts:
I have disabled one of my categories, but still the category display on my menu bar in the website.

How can I solve this issue?

Menu Extension :

https://web-experiment.info/webandpeople-custom-menu-extension

Backend :

Website:

How can I solve the issue?


texts: magento 1.9.0.1 no order mails with store email, what could cause this?

texts:
when placing an order, the customer does receive the order confirmation. also the e-mail copy is received at the correct address (all configured in sale emails)... but for some reason i don not receive the order confirmation (nor the invoice) at the addresses configured.

What could cause this issue?


texts:
I am using Magento v2.3.4. and I am getting the following error while search. The query from the error page as follows
 SELECT `e`.*, IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) AS `is_active`, IF(at_include_in_menu.value_id > 0, at_include_in_menu.value, at_include_in_menu_default.value) AS `include_in_menu` FROM `catalog_category_entity` AS `e`
 INNER JOIN `catalog_category_entity_int` AS `at_is_active_default` ON (`at_is_active_default`.`entity_id` = `e`.`entity_id`) AND (`at_is_active_default`.`attribute_id` = '43') AND `at_is_active_default`.`store_id` = 0
 LEFT JOIN `catalog_category_entity_int` AS `at_is_active` ON (`at_is_active`.`entity_id` = `e`.`entity_id`) AND (`at_is_active`.`attribute_id` = '43') AND (`at_is_active`.`store_id` = 1)
 INNER JOIN `catalog_category_entity_int` AS `at_include_in_menu_default` ON (`at_include_in_menu_default`.`entity_id` = `e`.`entity_id`) AND (`at_include_in_menu_default`.`attribute_id` = '66') AND `at_include_in_menu_default`.`store_id` = 0
 LEFT JOIN `catalog_category_entity_int` AS `at_include_in_menu` ON (`at_include_in_menu`.`entity_id` = `e`.`entity_id`) AND (`at_include_in_menu`.`attribute_id` = '66') AND (`at_include_in_menu`.`store_id` = 1) WHERE (IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) = '1') AND (IF(at_include_in_menu.value_id > 0, at_include_in_menu.value, at_include_in_menu_default.value) = '1') AND (())

How do I debug this? Please help me in resolving this issue.


texts:
I have a Shipping Method for Free Shipping if price is >= $100. "show method if not applicable" is set to no..

I have a shopping cart price rule coupon. 10% discount. Free Shipping is set to No.

When a customer makes a purchase over $100, enters the discount code, and begins the checkout...the option for Free Shipping is still there!

I think it doesn't let the transaction actually happen, but showing it as an option is confusing customers, and causing transactions to be "cancelled".


texts: Website Down ::> Accidentally dropped visitor_log and visitor_log_info tables in Database Admin

texts:
Getting this error in the logs:

  2015-04-13T06:22:52+00:00 ERR (3): Warning: PDO::__construct() [pdo.--construct]: [2002] Connection refused (trying to connect via tcp://mysqlv112:3306)  in /data/14/1/150/111/1313763/user/1407123/htdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 129

Can I just create the table in the Database Admin to resolve this issue? What fields are in the tables for visitor_log and visitor_log_info? Please help!

Is this what I add to the log_visitor table?


texts: Magento 2 Overriding template is not working

texts:
I have created a new theme and i'm trying to override a template (same example as Magento Developer guide

http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/templates/template-sample.html)

so i just added this file

  magento2/app/design/frontend/Plata/platatheme/Magento_Checkout/web/templates/minicart/content.html

and changed something as they suggest. Then i reloaded and nothing changed, it always load the old version.

I removed all files from pub/static, run magento setup:static-content:deploy and flushed both magento and browser cache.

I checked in

  pub/static/frontend/Plata/platatheme/en_US/Magento_Checkout/templates/minicart/content.html

and there is my version of the file.

Should i run some more commands from the terminal?


texts: Bulk Ordering a Product with Many Possible Configurations

texts:
I am building a website that sells different types of fasteners (nuts, bolts, screws, etc).

The issue is that each product has many, many different variations.  For instance, a hex head cap screw has the following variations:

Grade:  3 types
Thread:  2 types
Plating:  3 types
Diameter:  12 types
Length:  29 types

Furthermore, we sell it in different quantities.

100 / box
500 / box
1000 / box, etc.

What I would like is a single page where I can filter the results so that ONLY those configurations that a customer wants appear.  For instance, only Grade 5 and 8, coarse thread, zinc plated and non-plated with 3 different diameters and 4 different lengths

Then, I want a customer to be able to go down that list and add the different amounts that they want to the cart.

So, 2 boxes at 100 per box for one configuration; 3 boxes at 500 per box for another, etc.

Is this possible with Magento?  If so, how so?

I thank you in advance for any help you can offer.


texts: Product images are not showing on front end working fine in admin

texts:
I have created a product and assigned an image to it but on fronend it still showing the demo magento image not mine updated image.

List.phtml Image part:

   <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>" class="product-image">

   <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($size['width'], $size['height']) ?>" alt="<?php echo $this->stripTags($_product->getName(), null, true) ?>" class="img-responsive"/>

   <?php if(basename($_product->getData('image')) != basename($_product->getData('small_image'))): ?>

   <img src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize($size['width'], $size['height']) ?>"

   alt="<?php echo $this->stripTags($_product->getName(), null, true) ?>" class="img-responsive img-two"/>

             <?php endif ?>

Admin panel product image:

Front end not showing actual image but the dummy magento image:

Indexes are updated cache is cleared:


texts: Stuck on "Update Pending" when trying to install an extension, or update Magento version, M2 2.2.1

texts:
I'm using Magento 2.2.1, and I've been trying to install an extension, and I've tried to do that from Web Setup Wizard, but when I select my extension to install, and do the check before installing it, I get a dependency error, I try again a few times, and the third time doesn't give any dependency error anymore. I proceed, but then it gets stuck on Update Pending, with the console log saying this:

[2018-02-21 21:49:39 UTC] Job "setup:maintenance:enable []" has started
Enabled maintenance mode

[2018-02-21 21:49:39 UTC] Job "setup:maintenance:enable []" has been
successfully completed
[2018-02-21 21:49:39 UTC] Job "setup:cache:disable []" has started
Changed cache status:
config: 1 -> 0
layout: 1 -> 0
block_html: 1 -> 0
collections: 1 -> 0
reflection: 1 -> 0
db_ddl: 1 -> 0
eav: 1 -> 0
customer_notification: 1 -> 0
full_page: 1 -> 0
config_integration: 1 -> 0
config_integration_api: 1 -> 0
translate: 1 -> 0
config_webservice: 1 -> 0

[2018-02-21 21:49:39 UTC] Job "setup:cache:disable []" has been successfully
completed

I though it might be something about the extension, but then I've tried to do a Magento version upgrade, from 2.2.1 to 2.2.2, from System Upgrade, and I get stuck on the same point, with the same error.. Any ideas?


texts: Magento Shopping Cart Price Rule Disable COD Charges

texts:
if a customer purchase with a specific coupon code, i wanted to disable the COD Charges

COUPON CODE -> Applied -> Payment method -> COD : NO COD Charges ,
  COUPON CODE -> Not Applied -> Payment method -> COD : COD will be Charged ,

How can i do this ?


texts: Displaying the store credit of an user on the order confirmation

texts:
I would like to display the user store credit in an order confirmation email. I think that I have to add the right @var code in the template in "app/locale/en_US/template/email/sales/order_new.html".

At the top of the template file I have this vars:

{"store url=\"\"":"Store Url",
"var logo_url":"Email Logo Image Url",
"var logo_alt":"Email Logo Image Alt",
"htmlescape var=$order.getCustomerName()":"Customer Name",
"var store.getFrontendName()":"Store Name",
"store url=\"customer/account/\"":"Customer Account Url",
"var order.increment_id":"Order Id",
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
"var order.getBillingAddress().format('html')":"Billing Address",
"var payment_html":"Payment Details",
"var order.getShippingAddress().format('html')":"Shipping Address",
"var order.getShippingDescription()":"Shipping Description",
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
"var order.getEmailCustomerNote()":"Email Order Note"}

I see that these methods are defined in "app/code/core/Mage/Sales/Model/Order.php", but I don't see any "getCustomerStoreCredit" or similar method.

So my first question is, is it possible to display the user store credit on the order confirmation?

Second, how can one add a user store credit to a template?


texts: “Telephone” is a required value not working in customer edit form

texts:
In my customer edit form, for telephone phone, required field validation is not working when I leave the telephone  field blank.
The required validation works for every field except for the telephone field.

When I save the form without telephone field, after the backend call it gives me a notification message " telephone" is required. Enter and try again.

This is code for password field in my form

        Phone Number

    <input type="text" name="telephone" id="telephone" value="" title="Phone Number" class="input-text " sr-only="INPUT" for="INPUT" aria-required="true">

I even checked eav_attribute table. It has is_required=1 for attribute_code='telephone'

I don't want notification, it should be like other fields inline validation.


texts: Add phtml to Customer Account Edit in Adminhtml

texts:
I tried to add phtml to customer account edit in backend like this:

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

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Namespace\Module\Block\Adminhtml\Customer\Edit" name="customer_block_adminhtml_index_edit_custom" cacheable="false" template="Namespace_Module::customer_index_edit.phtml" />
        </referenceContainer>
    </body>
</page>

app/code/Namespace/Module/Block/Adminhtml/Customer/Edit.php

<?php

namespace Namespace\Module\Block\Adminhtml\Customer;

use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Controller\RegistryConstants;

class Edit extends \Magento\Backend\Block\Widget\Form\Container
{
    public function __construct(
        \Magento\Backend\Block\Widget\Context $context,
        \Magento\Framework\Registry $registry,
        AccountManagementInterface $customerAccountManagement,
        CustomerRepositoryInterface $customerRepository,
        \Magento\Customer\Helper\View $viewHelper,
        array $data = []
    ) {
        $this->_coreRegistry = $registry;
        $this->customerAccountManagement = $customerAccountManagement;
        $this->customerRepository = $customerRepository;
        $this->_viewHelper = $viewHelper;
        parent::__construct($context, $data);
    }
}

app/code/Namespace/Module/view/adminhtml/templates/customer_index_edit.phtml

<h1> This is new section </h1>

but this is not working at all


texts: Styles aren't being applied on some pages. No errors

texts:
Some css styles aren’t applying on some pages, but applying everywhere else.

I’ve removed view_preprocessed, cache, static/frontend and static/admin, run setup:upgrade, setup:di:compile, static-content:deploy -f, and both cleared and flushed the cache

This is CSS only, no issues with XML


texts: How do add css, js in customview.phtml in view magento2?

texts:
I have custom view.phtml. I Want add my.css and my.js in <head></head>
2 file in app\code\Test\New\view\frontend\web\css.

How do it?


texts: Cart, login, one step checkout slow before cleaning cache

texts:
I have a very rare problem. The cart, the backend, the one step checkout takes a lot of time, more than a minute and only can be solved if I cleaning all the cache... but I do and after 30 minutes the same, other time slow. I dont know what can I do, I cant find a solution.
You can test in https://www.espamoto.com


texts: How to create custom plugin for TinyMCE 4

texts: I'm trying to add ability to create custom forms with TinyMCE 4 but can't understand how to do it properly. I should create my custom plugin and then connect it to editor, but can't find any useful information. Tried answer from this thread Magento 2.3 - TinyMCE4 Toolbar and Plugin Configuration but i can't add my custom plugin by this way. Magento devdocs also don't give me any useful information.


texts: How to give a * (asterisk) near to the price of each product?

texts: I need to give a * (asterisk) near the price for each product. As per in the image it will be show like as indicated in the red color.


texts: I am using magento 2.2.3 with custom theme i wanted to add payment using composer when try to install its showing magento/framework not found

texts:
Do I Have Install Framework?
I Have Installed Magento using Installtron


texts: How to Pre-select a custom option on a simple product

texts: I need to pre-select certain custom options on a Simple product. They will be either drop downs or checkboxes.


texts: how to save decimal value in flat table?

texts:
How to properly save decimal data in magento flat table ?

I created table via magento install script:

    mysql> describe my_geo_table;

    +-------------+------------------+------+-----+---------+----------------+
    | Field       | Type             | Null | Key | Default | Extra          |
    +-------------+------------------+------+-----+---------+----------------+
    | entity_id   | int(10) unsigned | NO   | PRI | NULL    | auto_increment |

     ...

    | Longitude   | decimal(10,0)    | NO   |     | NULL    |                |
    | Latitude    | decimal(10,0)    | NO   |     | NULL    |                |
    +-------------+------------------+------+-----+---------+----------------+

in my test script, I try to save model:

    $address = Mage::getModel('Mymodule/my_geo_table')
                            ->setData(...)
                            ->setLatitude(53.5586509)
                            ->setLongitude(9.6469548)
                            ->save();

It saves without error, but when i see mysql table contents, these values are differs :

    +-----------+-----------+----------+----------+
    | entity_id | ...       |Longitude | Latitude |
    +-----------+-----------+----------+----------+
    |         1 | ...       |        54 |       10 |
    +-----------+-----------+----------+----------+

How to save decimal value in magento table correctly ?

UPDATE

Thanks to Marius, figured out how to correctly add decimal columns for longitude and latitude. Maybe one can find it useful:

    $installer->getConnection()
        ->addColumn('my_geo_table', 'longitude', array(
            'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
            'scale'     => 7,
            'precision' => 10,
            'nullable' => false,
            'comment' => 'Longitude'
        ));

    $installer->getConnection()
        ->addColumn('my_geo_table', 'latitude', array(
            'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
            'scale'     => 7,
            'precision' => 9,
            'nullable' => false,
            'comment'   => 'Latitude'
    ));


texts:
I used this for after login

System > Config > Customer > Costumer Redirect Customer to Account Dashboard after Logging in > NO

But after that it redirects to this

https://domain.com/customer/account/loginPost/referer/aHR0cHM6Ly9maXRmdXJuLmNvbS8,/

How to i fix this?


texts: How to add text Fieldin catalog category

texts: How to add text field after image for the category  in catalog category tried to copy app/code/core/Mage/Catalog folder to local code pool but not find out where to add a field.


texts:
I am working on a custom module that is creating quotes using the Magento quote module.

It is using the \Magento\Quote\Model\QuoteFactory for creating the quotes.

Now I want to checkout the items that are added to the quote and add them to the cart and the checkout page should be displayed to the user with those items that were in the quote.

Here I am creating the quotes as:

$quote = $this->quoteFactory->create()->load($quoteId);

I am adding the products to cart as below,

$quote->setIsActive(1);
if ($quote) {
     try {
     $this->cart->setQuote($quote);
     $this->cart->saveQuote();
     $this->messageManager->addSuccess(__('Added to cart successfully.'));
       } catch (\Magento\Framework\Exception\LocalizedException $e) {
     $this->messageManager->addException($e, __('%1', $e->getMessage()));
        }
     }

However, this gives me an exception as:

  No such entity with customerId =

I am not sure why am I getting this. Is there any other way to implement this?

Please, can anyone help?


texts: Magento Shopping Cart Price Rule For Total Items Quantity 1

texts:
i need some Customize into the shopping cart rule
for ex: i want to set the 100%  discount for 1 Quantity into cart

i have created it and working fine.

but when i am try to 2nd qty into cart then Discount coupon remove automatically and remove discount on 1st qty as well.

i need set discount only for 1 qty if i will add more then discount coupon not delete from the cart

Thanks


texts:
I am trying to add custom options in my product programmatically with a observer when I save an custom product in admin:

<catalog_product_save_before>
    <observers>
        <fourward_comprandoforaproduct>
            <type>singleton</type>
            <class>comprandoforaproduct/observeradmin</class>
            <method>catalogProductSaveBefore</method>
        </fourward_comprandoforaproduct>
    </observers>
</catalog_product_save_before>

and this is my observer:

public function catalogProductSaveBefore($observer) {
    $product = $observer->getProduct();

    if ($product->getTypeID() == "cartaovirtual") { //this is my custom product type
        //here I am failing to delete old custom option
        $product->setCanSaveCustomOptions(true);
        $oldOptions = $product->getOptionInstance()->getOptions();
        foreach ($oldOptions as $key => $option) {
            if ($oldOptions[$key]['title'] == "Número do Cartão") {
                $oldOptions[$key]['is_delete'] = 1;
            }
        }
        $product->getOptionInstance()->setOptions($oldOptions);

        //here I create my custom option (this works fine!)
        $option = array(
            "title" => "Número do Cartão",
            "type" => "field",
            "is_require" => 1,
            "sort_order" => 1,
            "price" => 0,
            "price_type" => "fixed",
            "sku" => ""
        );

        $product->getOptionInstance()->addOption($option);
        $product->setHasOptions(true);
    }
}

I can only delete the "Custom Options" when I'm editing the product and I click on the tab "Custom Options".

Eg.

If I open this product type, change the product name and save, the product creates new attributes and does not delete the old attributes.
If I open this product type, change the product name, open "Custom Options" tab (without making any changes) and save. This works correctly deleting the old attributes and create the new attribute.

Thanks


texts: Layered navigation is missing on search results after Magento upgrade

texts:
Having just completed an upgrade from CE v1.9 to EE 1.14, I find that the layered navigation (left block) is missing from the search results page.

The problem is that several modules and layout XML files seem to reference this block (catalog/layer/view.phtml) and I'm not sure which module removed this block.

Is there a way I can determine the layout files which were used to render the page, and the order in which they were parsed? I tried Commercebug but it doesn't actually say which XML files are used.


texts: restoring database mysqldump (good practice?)

texts:
I always worked on my projects with GIT and major frameworks can do the migrations through the code, so the problem of database dependency is solved.

But here in Magento2 I don't know if I'm going on the good way.

I configured all the stuff that only is saved on database like stores configuration, locate, etc. So I did a mysqldump.

Then for testing, I created a production environment and I uploaded the code, installed magento and restored this mysqldump.

I figured out I had to change the base_url: on the table core_config_data the line 2 web/unsecure/base_url.

And that's all I changed for now, but I think I'm missing something. For example when I enter to admin panel, it disconnects me from another page like is the same user, but they are on different pages.


texts:
Error:

Order View
Information Changes have been made to this section that have not been saved. This tab contains invalid data. Please resolve this before saving.

How to solve the problem?


texts:
I am developing a custom theme for Magento 2.1.x which should use the LightGallery jQuery plugin. I tried to include the plugin script but I am getting error.

This is my require-config.js placed under the folder app/design/frontend/Vendor/Theme/require-config.js:

var config = {
    "map" : {
        "*" : {
            custom: "js/custom.js",
            lightgallery : "js/lightgallery"
        }
    }
};

the lightgallery.js I downloaded is under the folder app/designfrontend/Vendor/Theme/web/js/lightgallery.js

Then I wrote a custom custom.js:

define([
        'jquery',
        'lightgallery'
    ],
    function($) {
        console.log("Test");
    }
);

and eventually I created a phtml file included in every block which requires the custom.js module in this way:

require(['jquery', 'lorante'], function($)
{
});

Refreshing the page, after having ran the command bin/magento setup:static-content:deploy, throws javascript error:

Uncaught Error: Mismatched anonymous define() module: function (a0) {
  return (factory(a0));
}

What am I doing wrong?

Edit

Taking a look at the lightgallery script I noticed that it is slightly different from other jQuery plugin, such as slick for example which I can include without errors:

this is the lightgallery script:

(function (root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module unless amdModuleId is set
    define(['jquery'], function (a0) {
      return (factory(a0));
    });
  } else if (typeof exports === 'object') {
    // Node. Does not work with strict CommonJS, but
    // only CommonJS-like environments that support module.exports,
    // like Node.
    module.exports = factory(require('jquery'));
  } else {
    factory(root["jQuery"]);
  }
}(this, function ($) {
...

This is slick:

(function(factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else if (typeof exports !== 'undefined') {
        module.exports = factory(require('jquery'));
    } else {
        factory(jQuery);
    }

}(function($) {
...

What are the differences between this two declarations?


texts: I've looked into trying to edit some of the title links in the client account drop down menu?  I've looked in the links.phtml but the links themselves are being called elsewhere...


texts: How to update the order email id from admin in Magento2

texts: I want to update the order email id from the admin when you see the order detail, note I don't want to update the customer email id, Just want to update the email address for order only.


texts:
Suppose if I want to join product repository and orderItem repository, then how can do that?

There is way to join multiple collections (methods like join, joinRight, joinLeft, ...), how to do same with repositories?


texts: Magento 2 set product image role programmatically

texts:
Hello and this is my code:
$imgURL = 'path/to/my/image.png';
$fileSystem = $objectManager->create('\Magento\Framework\Filesystem');
$mediaPath = $fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath();

$product->addImageToMediaGallery($mediaPath.'catalog/product'.$data['thumbnail_image'],['thumbnail', 'swatch'], false, false);
$product->setThumbnail($mediaPath.'catalog/product'.$imgURL);
$product->save();

What I want to achive, is to assign programmatically and image and set it as a thumbnail.
The above code, uploads the image, but it's role: the thumbnail and swatch are not selected. Not sure why ? See img:

Can you tell me  what am i doing wrong ? thank you


texts: How to disable customer login popup on clicking checkout button in magento 2

texts:
I would like to remove the login popup when we click on the Proceed to checkout button from the mini cart(any page). So whenever a person clicks on this button will redirect to the normal login page. I saw so many tutorials, but that's not working with Magento 2.3.5p.
Note: I have disabled guest checkout option.
Please advise


texts: Creating a Grouped Product with a max quantity for all sub-products

texts:
I'm currently doing a food-package website in Magento 2 & I would like to be able to create a Grouped Product (or relevant alternative) where you have a maximum quantity of sub-products you can select before checking out.

An example would be, like a special offer for a takeaway where you can pick like 8 sides. If I select one, I want the maximum amount I could purchase for every side to go down to 7.

I'm aware of the maximum quantity in cart, but that only affects that one product.

Is there a way I can achieve this, or a possible work-around?


texts: Magento 1.9 Display Track order info in user account

texts: i am new to magento. i want to display track order info in users account.same as how flipkart is having.but here delivery of the product is done from the same shop itself.


texts: Magento2 - After upgrade 2.2.4 to 2.3.4 facing issue with url key

texts: In Magento2.3.4, I upgrade magento2.2.4 to 2.3.4 facing issue with category url key showing blank in category edit page in admin. Please check screenshot


texts:
Need help/idea's for the following:
We have products which can be applied to different car models and car manufacturers.

So field manufacturer is multi-select, populating this field is not a problem as well as selecting correct values for a product.
The main issue is selecting the correct values for the model.

Was thinking about creating a controller and on manufacturer choice repopulate model field with applicable data.

Is this the only way or there is another solution?

Edit:
Created 2 Custom attributes with own source.
One contains all Manufacturers, second contains all Models.
Main problem is for example we have Ferrari - model 412 and we have Volkswagen model 412 as you can see both have same model name.

This problem can be solved if we add Manufacturers name before model name.
But listing through all available models to find right one is pain. So we need possibility to show only those models which are based on chosen Manufacturers.


texts: What's the field name required when save product price data in magento 2?

texts:
I have save custom product in magento 2 via my custom code. But when I save product the field qty not be save. please let me know in my data lost an field.

$new = array( "product" => Array(
            "name" => "Camera Car",
            "short_description" => "
highlights des
",
            "price" => 700,
            "type" => "simple",
            "status" => "1",
            "qty" => "60",
            "sku" => "v322",
            "attribute_set_id" =>"4",
            "quantity_and_stock_status" => Array(
                "is_in_stock" => "1",
                "qty" => "60"
            ),

            "website_id" => Array("1" => "1" ,"2" => "2"),

            "image" => "/h/t/camera-car-9749-01764366-4d34586f0dfb7371a939592effd332cd-catalog.jpg.tmp",
            "small_image" => "/h/t/camera-car-9749-01764366-4d34586f0dfb7371a939592effd332cd-catalog.jpg.tmp",
            "thumbnail" => "/h/t/camera-car-9749-01764366-4d34586f0dfb7371a939592effd332cd-catalog.jpg.tmp",
            "swatch_image" => "/h/t/camera-car-9749-01764366-4d34586f0dfb7371a939592effd332cd-catalog.jpg.tmp",
            "media_gallery" => Array(
                "images" => Array(
                    "1" => Array(
                        "position" => "1",
                        "file" => "/h/t/camera-car-9749-01764366-4d34586f0dfb7371a939592effd332cd-catalog.jpg.tmp",
                        "media_type" => "image",
                        "label" => '',
                    ),
                ),
            )
        ));

Debug:

  product->getPrice() // return 100  after call product->save() I check product->getPrice() // return nothing


texts:
I want to add the following code to my htaccess but it does not work.

# ----------------------------------------------------------------------
# | Brotli pre-compressed content                                      |
# ----------------------------------------------------------------------

# Serve brotli compressed CSS, JS, HTML, SVG, ICS and JSON files
# if they exist and if the client accepts br encoding.
#
# (!) To make this part relevant, you need to generate encoded
# files by your own. Enabling this part will not auto-generate
# brotlied files.
#
# Note that some clients (eg. browsers) require a secure connection
# to request brotli-compressed resources.
# https://www.chromestatus.com/feature/5420797577396224
#
# https://httpd.apache.org/docs/current/mod/mod_brotli.html#precompressed

 <IfModule mod_headers.c>

     RewriteCond %{HTTP:Accept-Encoding} br
     RewriteCond %{REQUEST_FILENAME}\.br -f
     RewriteRule \.(css|ics|js|json|html|svg)$ %{REQUEST_URI}.br [L]

     # Prevent mod_deflate double gzip
     RewriteRule \.br$ - [E=no-gzip:1]

     <FilesMatch "\.br$">

         <IfModule mod_mime.c>
             # Serve correct content types
             AddType text/css              css.br
             AddType text/calendar         ics.br
             AddType text/javascript       js.br
             AddType application/json      json.br
             AddType text/html             html.br
             AddType image/svg+xml         svg.br

             # Serve correct content charset
             AddCharset utf-8 .css.br \
                              .ics.br \
                              .js.br \
                              .json.br
         </IfModule>

         # Force proxies to cache brotlied and non-brotlied files separately
         Header append Vary Accept-Encoding

     </FilesMatch>

     # Serve correct encoding type
     AddEncoding br .br

 </IfModule>

h5bp/html5-boilerplate:dist/.htaccess@master#L897-L949

Does not work in root and also not in pub.


texts: Magento 2 upgrading from V 2.1.3 to V 2.2.6 Error

texts:
I am trying to upgrade my website from Magento V2.1.3 to Magento V2.2.6 and it's successfully upgraded. But when I'm opening website it's returning error shown below image.

Any help on this to resolve.


texts: How can I get products with specified attribute value

texts:
In my project trying to pull product from selected category which have a specific attribute value.

$currentCategory = Mage::getModel('catalog/layer')->getCurrentCategory();

$products = Mage::getModel('catalog/product')
    ->getCollection()
    //->addFieldToFilter(???????) //category id ????
    ->addAttributeToSelect('name','price','special_price')
    ->addAttributeToSelect('showme',array('eq' => 'Yes'))
    ->load();

or within whole categories tree (I mean category and its childrens)

I stuck and don't really have an idea.

How to achieve it ?

Then check if there is more than one then pick the first one and "show".

EDIT:

I just forgotten to add: two parameters must be checked, "if showme and category" then show :)


texts: Magento 2 : Remove product attribute programmatically when install extension

texts:
I want to remove product attribute when I install extension. I found some solution using controller remove product attribute.

But, I want to remove it when install extension.

In magento 1 it's work like :

$setup = Mage::getResourceModel('catalog/setup','catalog_setup');
$setup->removeAttribute('catalog_product','my_attribute');

But, How to do in Magento 2.2.3?


texts:
Currently I am working in magento2 theme part. And I have a main.js file which I have added via default_head_blocks.xml . But its having jquery conflict. I removed jquery conflict using noConflict. When I do this my testimonial section which consists of owl carousel doesnt work. Please tell me how to add my 'main.js' file.

or
Can someone tell me how to include the functions in 'main.js' on header to display the banner and drop-down menu?


texts: Payment module redirect to payment website url in magento2

texts: How to create payment module in Magento 2 with redirection to a payment gateway website?


texts:
I have create one module for displaying latest product review, module works perfectly and reviews are display on frontend side.

But what I have requirement is admin can select where to display this block on frontend side, either on right sidebar or left sidebar or in main content area.

I have provided dropdown selection for admin to select one layout for display, but on frontend how we can determine which layout to use for display of block, can we put condition in layout xml? Or there is another method to detect?

We can give ifconfig in action tag but its not suitable for my requirement.

What I have do right now is display block in left bar, and block is display in left side bar.

<reference name="left">
<my block />
</reference>


texts: why message queue consumer never exiting when --max-messages specified?

texts:
I'm using Magento 2.3.4 with RabbitMQ configured in the env.php to process my message queues, I start consumer using:

bin/magento queue:consumers:start ConsumerName --max-messages 1

But the consumer keeps listening forever, never exits.

It seems to be a native issue in Magento, how could I solve it?


texts: Magento 2 : Ui form element enable/disable on store switcher

texts:
In Magento 2.3.1, I want to do like :

If all store view, then input text should be enable. Othervise, input text should be disable.

I follow this answer : click here

But, still I'm not getting output.

How to do that?

Any help would be appreciated.

Thanks.


texts: how to get visible products filter by catalog,search magento 2?

texts:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');

$collection = $productCollection->create()
            ->addAttributeToSelect('*')
             ->setPageSize(4) // only get 10 products
    ->setCurPage(1)  // first page (means limit 0,10)
    ->setOrder('entity_id','desc')
    ->addFieldToFilter('visibility', 'catalog_search')
            ->load();


texts: What triggers the partial re-index on attribute mass update?

texts:
I'm having a hard time figuring out what fires off the flat table update (partial re-indexing) when a attribute mass update is done from the Manage Catalog page in the admin.

When you mass-update attributes from the admin, the following methods are called in order.

Mage_Adminhtml_Catalog_Product_Action_AttributeController::saveAction
Mage_Catalog_Model_Product_Action::updateAttributes
Mage_Catalog_Model_Resource_Product_Action::updateAttributes

You can go straight to 3 to use the mass-update functionality, but the update doesn't propagate to the flat table. So, one would think it's something before 3 that triggers the re-indexing, but it's not clear what.

At first glance, 2 has

// register mass action indexer event
Mage::getSingleton('index/indexer')->processEntityAction(
    $this, Mage_Catalog_Model_Product::ENTITY, Mage_Index_Model_Event::TYPE_MASS_ACTION
);

which looks like the answer, but the flat table is updated even with this commented out. I've even tried reducing Mage_Catalog_Model_Product_Action::updateAttributes down to
the following, but it still re-indexes.

public function updateAttributes($productIds, $attrData, $storeId)
{
    $this->_getResource()->updateAttributes($productIds, $attrData, $storeId);

    return $this;
}

Any idea what actually updates the flat table when attribute mass update is done in the admin?


texts: Best Practices Way to Edit Magento Top-Links

texts:
Let's say we want to add a shopping cart icon right before the "My Cart" link on Magento's top links (see top links below).

What is the best way to do this?

Do something to toplinks.php?
Do something to links.phtml?
An xml file?
Any other options?

I understand that this can be done with CSS, but as my needs for customization grow, I want to know how this can be done without CSS so I am able to customize more difficult things.


texts:
After doing some system upgrades, many product links on my site are broken.

The links that DON'T work, look like this:
http://merkazhasofrim.com/sofrus/quills/pre-shaped-plastic-quill-tips.html

The links that DO work, look like this:
http://merkazhasofrim.com/sofrus/powders-whiteners/white-art-pastel-chalk.html#.VrOf4vGMlvU

For some reason, the system is adding characters to the original URL rewrite and only then does the link work.

I already flushed the table called core_url_rewrite and reindexed Category URL Rewrites in the admin, but it doesn't seem to help.

I am running Magento V 1.9.2.2
How can I fix this?


texts: Unable to Install Magento 2.3 Via Composer

texts:
I have php7.2 and composer installed via apt-get

When I try to install Magento 2.3 via composer...
composer create-project --repository=https://repo.magento.com/ magento/projec
t-community-edition

I have this issue:

our requirements could not be resolved to an installable set of packages.
  Problem 1

    - magento/inventory-composer-installer 1.0.3 requires composer-plugin-api ^1.1 -> no matching package found.
    - magento/product-community-edition 2.3.0 requires magento/inventory-composer-metapackage ^1.0.3 -> satisfiable
 by magento/inventory-composer-metapackage[1.0.3].
    - magento/inventory-composer-metapackage 1.0.3 requires magento/inventory-composer-installer ^1.0.3 -> satisfia
ble by magento/inventory-composer-installer[1.0.3].
    - Installation request for magento/product-community-edition 2.3.0 -> satisfiable by magento/product-community-
edition[2.3.0].

  Potential causes:

A typo in the package name
The package is not available in a stable-enough version according to your minimum-stability setting
   see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.


texts: Changing aprox 12000 image positions in magento automaticly?

texts:
I have a question.
i have a magento webshop (1.9.2.2) containing aprox 12000 products.
all these products have multiple images.

Now we have the folowing problem:
a lot of images have a wrong sort order.
(Base_image should be 0, the small_image 1 and the media_image 2)
Also the base_image should also be set as thumbnail.

Now some Base_images have the right position and are set as base and thumb
but there are also base_images with a wrong position (3 or 4) and are not set as thumb aswell.
manually sorting out 12000 products is a lot of work so im looking for a way to import the sort order for all these products.
(We use magmi v0.7.22 for importing our csv files into magento)

Does anyone know a way to "set things straigt" ?


texts: Magento include phtml file within another phtml file

texts:
I am making a custom home page for my magento website in a phtml file named home_banner.phtml, which in turn i have referenced in the CMS->Pages->Home Page content by the following code

{{block type="core/template" template="theme/home_banner.phtml"}}

In my home_banner.phtml I have called tags/popular.phtml to display the popular tags.

<div class="last-posts-grid clearfix">

     <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('tag/popular.phtml')->toHtml(); ?>

</div>

However the tags are not being displayed even though the anchor tag which says "view all tags" id getting called correctly. The ul class="tags-list" is also visible in the page source but the tags themselves are not visible. Any suggestions?


texts: What are the difference between magento 1 and magento 2 databases?

texts:
I want to know what are the difference between a magento 1 and a magento 2 database table?

Are there any changes in table names ?


texts: Manually define product page canonical tag

texts:
Can a product pages canonical tag be manually changed?

I have products which are all the same apart from colour, which is causing duplicate content. So I would like to canonical the other product pages to one single canonical page.


texts: Catalog price rules disappear after 24 hours in Magento 1.9.2.2

texts:
We used two suggestions from https://stackoverflow.com/questions/25280095/ to solve this problem.

We applied the "line 121" fix to app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php
We also installed AOE scheduler and used the settings suggested by Lakshin Karunaratne at the end of the post.

Neither of these are working. After manually running all rules, all discount prices are reverted back to full price after 24 hours.

AOE is running successfully. However, catalogrule_apply_all is the only rule not running successfully. I see this has been quite an ongoing issue. Anyone have a fix?


texts: Upper limit for the weight in "Table Rates" shipping method

texts:
In Magento 2.1. How can I set upper limit for the weight when using "Table Rates" shipping method?

If the highest weight I can ship is 7 KG, having that record as the highest in my Tables Rates means that any item ( or items total) weight is 7 KG will cost X amount for shipping, AND ALSO higher than that, for example 90 KG will cost the same X amount for shipping! ... how can I put limit for that?!