texts:
I found a solution in this forum to change the paypal logo and text in the checkout of http://www.cellar2door.com to show the logo with all the credit cards on it.
The solution I found was…………
The only place in the admin I see that seems related is: System -> Configuration -> Payment Methods -> Paypal -> Basic Settings -> Frontend Experience Settings -> PayPal Product Logo

An easier option may be to edit: app\design\frontend\base\default\template\paypal\payment\mark.phtml

from:

<?php echo $this->escapeHtml($this->getPaymentAcceptanceMarkSrc())?>

to:

<?php echo $this->getSkinUrl(‘images/custom-paypal.png’); ?>

Then in your skin/frontend/package_name/theme_name/images/ create a custom-paypal.png
I did this and edited the text but am not sure where this folder is skin/frontend/package_name/theme_name/images

I have ended up with this code

<img src=”<?php echo $this->getSkinUrl(‘images/custom-paypal.png’); ?> alt=”<?php echo Mage::helper(‘paypal’)->__(‘Acceptance Mark’) ?>” class=”v-middle” />&nbsp;
<a href=”<?php echo $this->getPaymentAcceptanceMarkHref()?>” onclick=”javascript:window.open(‘<?php echo $this->getPaymentAcceptanceMarkHref()?>’,’olcwhatispaypal’,’toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=0, top=0, width=400, height=350′); return false;”>
<?php if($this->getPaymentWhatIs()) {echo Mage::helper(‘paypal’)->__($this->getPaymentWhatIs());} else {echo Mage::helper(‘paypal’)->__(‘Pay By Credit Card’);} ?>

When I click on the logo that is there now which is a blue ? the path is http://www.cellar2door.com/skin/frontend/base/default/images/custom-paypal.png%20alt= So am not sure why the logo is not showing.

Any ideas would be greatly appreciated.

Jim


texts: Stop decreasing stock quantity when an order is placed

texts:
I need to stop decreasing the stock quantity when an order is placed and reduce the stock only on successful payment because there are lot abandoned transactions on my site. I found an article to do this link, which says how to credit back the quantity to the product on redirect action and the decrease it on successful response action. Is there any other way to do this?

Also I am running a cron to cancel the abandoned orders. When the orders are cancelled the quantities get added back to product stock.

My problem is if I follow the above link to decrease stock only on successful payment, how do I skip the product stock being updated when an abandoned order is cancelled?


texts: Broken image is displaying for the attribute value not selected

texts:
I have created a attribute newsale with two value New and sale with Catalog Input Type for Store Owner as dropdown and added it to a attribute set. And then I have added images into the media with same name as the added value (new.png, sale.png)

My code at frontend to call the attribute in product category page is:

         <?php
           $Feature = explode(",",$_product->getResource()
           ->getAttribute('newsale')->getFrontend()
           ->getValue($_product));
            foreach($Feature as $key => $value): ?>
              <a href="<?php echo $_product->getProductUrl() ?>" ?>
                  <?php echo ""; ?>

            <?php endforeach; ?>

My problem here is even when I didn't select any value for this attribute at admin panel, a broken image is getting displayed.

Help me to resolve this issue.


texts: Core URL re-write table - delete URL entries for deleted products

texts:
We are on Magento Version 1.9.3.7 and have been using Magento for a few years now. When we moved our site to the live site from the development site, we deleted all the development products but looks like the URL's created in the development site in the URL re-write table did not get deleted and are in the live site's table.

Over a period of time, this table as you all know has grown and now as 1.5 million records in it.

In our live site, I see that the system generated product ID (under Catalog --> Manage Products) starts at 2800. I assume that 2800 products were added during development and testing.

Using the SQL query below - shows that there are 500,000 records
SELECT * FROM core_url_rewrite WHERE product_id <> 'NULL' AND product_id < 2800 AND product_id > 0;

My question is, is it safe to go ahead and delete these 500,000 records from the URL re-write table as these URL's are of no use since there are no associated products related to the URL. Will there be any SEO impact or any other issues that you foresee?

At least it will solve part of the problem for us.

Your advice and suggestions would be very helpful.


texts: Filter Category Options are differente when I change from one page to another?

texts:
I am facing something weird in one project that I don't know if is normal (I hadn't seen this behavior in another project). The customer reports to me that when you enter to Category first page, products and filters are displayed right. However, they detected that when to open the filters and see the options, this doesn't show all the desired. In the category are products with valid values in that filter, but that values are not displayed in the filter.
I know this could happen by cache or indexer. However, something weirder happened when I tried to change to another page, change the number of products by page, or change the product order. On each occasion, the filters options change.
For example, in Page 1 I see:
Filter 1
-Option 1
-Option 3
-Option 4

Filter 2
-Option 2
-Option 3
-Option 4

And when I change to Page 2, the options changes to:
Filter 1
-Option 2
-Option 4
-Option 5

Filter 2
-Option 1
-Option 4
-Option 5

It is like the filter show only the options corresponding to the products that are on the current page. But is it normal? I had never seen this before. I this configurable in some way?
Thank you for your help.


texts: Carrier with such method not found: matrixrate_8723, matrixrate magento2

texts:
I am Using Magento 2.1.9

I have used the Webshop matrixrate extension for shipping method when I click the place order button, it's getting me

  "Carrier with such method not found: matrixrate_8723, matrixrate".

Please give the solution


texts: How to add a pay until date to invoice in Magento2?

texts:
Please excuse me if I am asking a dumb question, but I am new to Magento and frankly, my first impression is that it is over-designed and poorly documented. Maybe this is part of their business model, or maybe I am missing something. I hope I am missing something!

In my country, every invoice has to mention the date when was created and a date by which the client has to make the payment. The fact that (from what I can tell) Magento doesn't automatically generate an invoice for each order placed, tells me that these dates should be attributes of the invoice, and not attributes of the order.

I have made a plugin using the following code:

app/code/ideologic/RoInvoice/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Sales\Model\Order\Pdf\Invoice" type="ideologic\RoInvoice\Model\Order\Pdf\Invoice" />
    <type name="Magento\Sales\Model\Order\Invoice">
        <plugin sortOrder="1" name="setDueDate" type="ideologic\RoInvoice\Model\Order\Invoice" />
    </type>
</config>

app/code/ideologic/RoInvoice/Model/Order/Invoice.php

<?php
/**
 * Copyright © SC ideologic SRL, All rights reserved.
 */
namespace ideologic\RoInvoice\Model\Order;

class Invoice
{

    public function beforeSetCreatedAt(\Magento\Sales\Model\Order\Invoice $invoice, $createdAt){
        $invoice->addData(array('DueDateDelay'=>15));
        return $createdAt;
    }

}

But for some reason the addData() function call has no effect. When I am calling getData() from app/code/ideologic/RoInvoice/Model/Order/Pdf/Invoice.php I am getting a null value (or empty string).

From what I have read, I have to load the 'Model' before calling setData(). How do I do that? Any help will be appreciated!


texts: Change config file from magento 1 to magento 2

texts:
Facing this issue:

  1 exception(s): Exception #0 (ReflectionException): Class mygateway
  does not exist

Don't know where I find this class in my module
Please help.

Here's my code:

  /home1/dukaania/public_html/testing2/app/code/Myname/Mygateway/etc/config.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <payment>
            <mygateway>
                <debug>1</debug>
                <active>0</active>
                <model>mygateway/standard</model>
                <merchant_gateway_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
                <order_status>pending</order_status>
                <title>My Gateway</title>
                <payment_action>sale</payment_action>
                <allowspecific>0</allowspecific>
                <sort_order>1</sort_order>
                <currency>Darham</currency>
                <debugReplaceKeys>MERCHANT_KEY</debugReplaceKeys>
                <paymentInfoKeys>FRAUD_MSG_LIST</paymentInfoKeys>
                <privateInfoKeys>FRAUD_MSG_LIST</privateInfoKeys>
                <frontName>mygateway</frontName>
                <helpers>Myname_Mygateway_Helper</helpers>
                <models>Myname_Mygateway_Model</models>
                <blocks>Myname_Mygateway_Block </blocks>
            </mygateway>
      </payment>
    </default>
</config>


texts: 0% tax for customer group but normal added in checkout

texts:
I'm trying to set tax rates to 0% for a specific customer group ('business'). I configured all tax rates to apply only for customer group 'private', and set a new tax rate to 0% for group 'business'.

In the product view and the search, products are correctly shown with 0% tax. But after adding a product to the cart, it shows up with regular tax rates.

Do you have any idea of what I might be doing wrong? I disabled the automatic group change based on VAT id..

Thank you in advance


texts: Magento 2 - updating UI library javascript

texts:
How can i override default Mage 2 UI js functions? For example: I have setup accordion layered navigation to show/hide the filters in the sidebar (like the one in Luma theme). Default collapsible.js within UI library uses show() / hide(), but i wish to override this with jquery fadeIn / fadeOut methods.

Is there a way to override certain UI js parts without editing the core library, probably within template so the changes stay local?


texts: Magento admin panel is not loading properly

texts:
We moved the website from one domain to another domain.

but after moving, admin panel is not opening properly.

We changed the domain's secure and unsecure url's in core_ config_data.


texts:
I have transferred my magento website to another server now I am getting below error

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'ifConfig': The attribute 'ifConfig' is not allowed.
Line: 205

And my magento version is 2.2.3

I am stuck here from few days. So please help to solve this issue.

Thanks.


texts: Fatal error Upgrading to 1.9.1 related to ConfigurableSwatches

texts:
After installing 1.9.1 via Magento Connect (I know not the method of choice), I'm running into an issue when I turn Compilation back on I get this error on both Frontend and Admin side:

  Fatal error: Class 'Mage_ConfigurableSwatches_Helper_Data' not found in /home/devcirc/public_html/app/Mage.php on line 547

I went to System > Configuration > Catalog > Configurable Swatches to try and disable Swatched, but I get:
404 Error
Page not found.

I can seem to figure out what's missing from the Admin or how to disable the swatches? Any ideas?

Edit to Add System.log Errors:

  2015-05-09T00:52:42+00:00 ERR (3): Warning: include(/home/devcirc/public_html/includes/src/Mage_ConfigurableSwatches_Helper_Data.php): failed to open stream: No such file or directory  in /home/devcirc/public_html/includes/src/Varien_Autoload.php on line 93
  2015-05-09T00:52:42+00:00 ERR (3): Warning: include(): Failed opening '/home/devcirc/public_html/includes/src/Mage_ConfigurableSwatches_Helper_Data.php' for inclusion (include_path='/home/devcirc/public_html/includes/src:.:/usr/lib/php:/usr/local/lib/php')  in /home/devcirc/public_html/includes/src/Varien_Autoload.php on line 93


texts:
In magento 1.x I use the n98-magerun tool to get a log file for all DB Queries:

n98-magerun.phar dev:log:db [--on] [--off]

Is it possible to log database queries in Magento2?


texts:
I'm looking for a way to only secure the essential parts of my store.

From looking into the site I presume that the login and checkout page are the only real pages that need to be secured.

Currently I have check use store front SSL and Admin SSL however my page load speeds have decreased to much that I need to change this.


texts: Magento2: how to get guest informations in checkout?

texts: Please, how to get guest informations like email, address, phone ... in checkout?


texts: Magento 2: add magento widget button on product WYSIWYG editors

texts:
I am missing the "insert widget" button on all WYSIWYG editors on the product edit pages. The magento guys seem to not have thought this through properly.

I found a way to add them to categories: How to add 'Insert Widget' functionality to category WYSIWYG editors in Magento 2 ?

Does anybody know how to add this button to product editors as well? Must be rocket science...


texts: Magento 2 How can declare table in config.xml

texts:
I want to declare table in config.xml
I am put but that is not working

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <global>
        <models>
            <pwa_pay>
                <class>Pwa\Pay\Model</class>
                <resourceModel>Pwa\Pay\Model\ResourceModel</resourceModel>
            </pwa_pay>
            <pwa_pay_resource>
                <class>Pwa\Pay\Model\ResourceModel</class>
                <entities>
                    <demotable>

demo_table

                    </demotable>
                </entities>
            </pwa_pay_resource>
        </models>

    </global>

how can call in setup and modle in magento 2

And how can call in setup and model
please see: Magento 2 getTable behavior


texts: Prevent fatal error of non object ($o->getShippingAddress()) - only sometimes not available

texts:
I want to prevent a fatal error if object is not available.

Background: I wrote an observer to catch data from the shipping object.

$o = Mage::getModel('sales/order')->load($observer->getOrderIds());
    if (is_object($o->getShippingAddress()->getPostcode()))
        $zip = $o->getShippingAddress()->getPostcode()

But I get an fatal error if the Shipping Address object will not be loaded (i.e. for downloadable products).

Fatal error: Call to a member function getPostcode() on a non-object in /var/www/app/code/local/MyModule/Model/Observer.php on line 22

How can I get rid of it?

Thank you so much


texts:
I want to know please the right configuration to display the right title on google search.
I configured meta title,homepage title and image alt but still have a weird website title on google search.
That was not the case on M1.
Help please


texts:
Magento 2.2.6 Anchor setting (ON / OFF) does not work in category setting.

Please check the screenshot below.

I have not found a solution.

Could you please help me?

nice to meet you.


texts:
I have set the category products sorting by default to sort by name...

although, if you check here, that is not working properly.

Already first two items are supposed to show up later in the list.

What could cause this and is there a solution?


texts: Trying to access the admin backend in Magento2 throws a 404 not found

texts:
I migrated my Magento 2 test site to the actual site (which was already running Magento 2 with older data) and noticed, that everything seems to work - only "admin_adminkey" and "privacy-policy-cookie-restriction-mode" do not work. Product pages as well as cms pages seem to work without any issue.
I also redirected non-existing page requests to "home" - so typing random stuff after / also gets me to home - as expected. This in term means, that "admin_adminkey" and "privacy-policy-cookie-restriction-mode" is treated "specially" because those are not redirected to "home" but just give a plain:

404 Not Found
-------------
    nginx

The proxy_error_log shows:

2019/01/31 16:51:34 [error] 851#0: *15809 "/var/www/vhosts/mydomain.eu/httpdocs/privacy-policy-cookie-restriction-mode/index.html" is not found (2: No such file or directory), client: xxx.xxx.xxx.xxx, server: mydomain.eu, request: "GET /privacy-policy-cookie-restriction-mode/ HTTP/2.0", host: "www.mydomain.eu", referrer: "https://www.mydomain.eu/"

2019/01/31 16:52:36 [error] 851#0: *15809 "/var/www/vhosts/mydomain.eu/httpdocs/admin_mykey/index.html" is not found (2: No such file or directory), client: xxx.xxx.xxx.xxx, server: mydomain.eu, request: "GET /admin_mykey/ HTTP/2.0", host: "www.mydomain.eu"

The server is running Plesk 17 and the test-site, which is just living in a subdomain of the same domain works.

I tried re-deploying static files, runing upgrade, clearing cache per console as well as deleting all the var/cache, var/composer_home, var/page_cache, var/view_preprocessed and resetting all permissions per this post: Magento 2 folder/file permissions but this does not change my situation.

The migration process was:

Dump source (new) MagentoDB, clear out target (old) MagentoDB.
Populate target MagentoDB with said dump.
Change the core_config_data table entries web/unsecure/base_url and web/secure/base_url to the new domain.
Delete all target MagentoFiles.
Copy all source MagentoFiles to the target directory (and make sure the hidden . files are copied as well).
Change the credentials in app/etc/env.php
Delete cache directories and clear cache per console.

This made the frontend look "ok" except the cookie info page and the admin backend was also not accessible. Afterwards I tried many things suggested out there - but as redirects are working and a Magento of the same version was running just before I transfered the data (just with less extensions and older data) I am at a loss on what to do next / how to debug this.

Any hints are appreciated!
Thanks,
Tamashii


texts:
We are already know that How to get Admin page url in magento1 from this question How to get Admin page url?

But how to get it at magento 2?


texts: Running "bin/magento setup:static-content:deploy" gives "Permission denied"

texts:
When running:

  root@ubuntu:/var/www/Magento2# bin/magento setup:static-content:deploy

I got

  -bash: bin/magento: Permission denied

please note that I'm running the command using root user


texts: Actually i am imported Bulk products with price, after go to front end i faced error like  click for price, how can i solve this.


texts: Add Product to cart with required Options is impossible

texts:
I added a required customization option (not sure about the name in English, in French, it's "Option personalisable").

On the front, there is no problem until you try to add the product to the cart. At this moment it's printing you this message :

"The product's required option(s) weren't entered. Make sure the options are entered and try again."

I tried to get where the problem was happening in the code, and I found the place where the error was triggered :

vendor/magento/module-catalog/Model/Product/Option/Type/DefaultType.php
l216.

When I tried to print get type($value), it gave me a "null".

I tried to go further in the core but cannot find where the bug is happening.


texts: Is it safe to TRUNCATE tables (catalogsearch_query, catalogsearch_fulltext, catalogsearch_result) in Magento 1.9.x?

texts:
I have a problem with SEARCHING in a Magento store.
When I reindexing catalogsearch_fulltext, proccess is not completed I'm waiting more than 2 days and not result. The search not working correctly - don't return results.

I cheched the folowing tables in mysql

catalogsearch_query - ~3 000 000 records

catalogsearch_fulltext - ~300 000 records

catalogsearch_result - ~127 000 000 records

Is it safe to clear them?

TRUNCATE catalogsearch_query;
TRUNCATE catalogsearch_fulltext;
TRUNCATE catalogsearch_result;


texts:
We have a magento site with the URL (let's say) ourstore.com and also a wordpress hosted blog using the blog.ourstore.com url (we use an extra dns record here). For SEO purposes we would like to run our blog using the ourstore.com/blog url. Is there a way to achieve this other than installing wordpress on the magento instance? Because we do this for SEO, i think redirect (302) or any kind of url_rewrite solution does not really work now.
Thanks!


texts: How Catalog URL Rewrite works? Is this a bug?

texts:
I truncated core_url_rewrite table then in Index Management section I click on Reindex Data link for Catalog URL Rewrites.

In URL Rewrite Management section I get now 17 records found. See the bellow:

Let's Reindex Data again Catalog URL Management. Without making any changes in products I get more 3 records. See the images bellow:

After Reindexing Data two more times there are now 23 records found. Please note in the image bellow all these 6 records are "Custom" and RP to similarly links like pointers in programming.

Why is this happening? Normally if there are no changes I should get the same records. Why before Reindexing Data Magento doesn't truncate core_url_rewrite table? In this way always the data in here will be fresh? If you have 2000 records with every reindexing of your data you will get more and more records. Is this a bug?

Thank you


texts:
I am trying to upload Thumbnail image and image for category page but it is neither uploading nor showing any error.
I have cleared cache and also done indexing but still no output

Any solution??


texts: magento 2 - How to add new column to table customer_grid_flat

texts:
I want to add new column for table customer_entity and customer_grid_flat. please help me , how way to do it. thanks
my code :

    ...
    InstallSchema:
        $eavTable = $installer->getTable('customer_entity');
        $columns = [
            'custom_field' => [
                'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                'length' => '6',
                'nullable' => false,
                'default' => 0,
                'comment' => 'del flg',
                'after' => 'gender'
            ]
        ];
        foreach ($columns as $name => $definition) {
            $connection->addColumn($eavTable, $name, $definition);
        }
...
    InstallData:
...
            $customerSetup->addAttribute('customer', 'custom_field', [
                'type' => 'static',/* Data type in which formate your value save in database*/
                'label' => __('custom_field'),
                'input' => 'text',
                'visible' => false,
                'required' => false,
                'is_used_in_grid' => true,
                'is_visible_in_grid' => false,
                'is_filterable_in_grid' => false,
                'is_searchable_in_grid' => false
            ]);

            /**
             * @var EavSetupFactory $eavSetup
             */
            $attribute = $customerSetup->getEavConfig()->getAttribute('customer', 'custom_field');
            $attribute->setData('used_in_forms', [
                'adminhtml_customer'
            ]);
            $attribute->save();
    ...

I want to create the column customer_grid_flat.custom_field that get value from customer_entity.custom_field.


texts: Magento 2 + NGINX + REDIS + VARNISH + SSL Changing to Developer mode

texts:
in Production Mode everything is fine.
When i change to Developer Mode i have this Problem

because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

So i start the  php  bin/magento setup:static-content:deploy and everthing is fine frontend and backend.

The Problem is: when i login to my backend, i dont have developer rights. I cant see developer configuration and when i change something on my theme it does not apply the changes.

So what do i do wrong ?


texts: How to import product content different for each store view (translations/multilingual)?

texts:
In Magento 1.x you could import different content for each store view by having each store data in new line and empty sku field.
Unfortunately this seems not to work in Magento 2 and I could not find any information about it. The official docs are not very helpful on this matter.

I tried with following CSV:

sku,store_view_code,name
1111,,"Default name"
,et,"Translated name"

This results in error:

Please make sure attribute "sku" is not empty

I also tried to import translations separately, adding store_view_code with appropriate value:

sku,store_view_code,name
1111,et,"Translated name"

This actually did import content to correct store view, but it also deleted default name from database.

I do understand that I could just insert translations to catalog_product_entity_varchar and similar, with some custom script, but isn't there really no official/non-coding way of doing this in Magento 2?


texts: Results from search in Magento 2 relevance not correct

texts:
I've the problem that the results from an search query on frontend are in the wrong relevance. It is on an live webshop. For example, when i search 'Philips' or 'Grohe', the first product is in both search-queries always 'Creative SB Tactic 360 Sigma Headset'.
As you can see in the title, there is no 'Philips' in the productname, but it is always the first product.
My search attributes are


texts: Is it possible to change the magento product image background color white instead of another gray color

texts:
Is it possible to change the magento2 product image background color white instead of another gray color.

can anyone know the answer . please help me to do this.


texts: Redirect to different store view according to IP Magento 2.1.9

texts:
I have a 2 website in 1 installation with 2 store views each. The store views are GBP and USA and the difference is just the price.

I have manage to redirect each website properly using .htaccess. The problem is that I want to redirect now each customer to proper store view according to their IP.

I know how to get the proper store view by IP so lets ignore that part.

I am looking at \Magento\Store\App\Action\Plugin\Context where magento is doing something with a plugin. It looks promising but I still can't work out how to do it.

Any ideas?

PS: As I already explained above I know how to get the store view by IP. The part I m asking is on how to redirect the customer to the proper store view.

PS2: For the third time I ll point this:
I know how to get the proper store view by IP so lets ignore that part.

People please read the question before you say this is a duplicate.


texts: Magento keeps deleting canvas tag in CMS page

texts:
When I put a canvas tag into Magento (for example create a test page with <canvas></canvas> as content), Magento keeps removing it automatically. How do I prevent this?

Thank you in advance!


texts: Want to import all the categories and their products to new magento install from old one

texts:
I am creating a dev version of my magento store with new theme installation. The theme is configured perfectly but now I want to bring my all the inventory including Categories -> products

I have tried by using an extension but it is not working with the magento version 1.9.2.4, and I have also tried to move all the products but it giving me below error:

  error: "Categories not found"

Please suggest a solution. I am using magento version 1.9.2.4.


texts: Can Magento really handle asynchronous execution of events?

texts:
The Swiftotter Magento developer Study guide states concerning Observers:

  Event data should be able to be
  stored and then run in a queue at a later time.

Is this correct? Do I really have to assume that my events observers are ran in a asynchronous way at a later time?


texts: Magento Migration Tool: What should the database host, name, user and password be in config.xml?

texts:
I am hoping to migrate Magento 1.9.4.0 to 2.4.1 using the Magento Migration Tool. I have already installed the Migration tool and now I'm trying to configure the confix.xml file in:
<Magento 2 root dir>/vendor/magento/data-migration-tool/etc/opensource-to-opensource/<Magento 1.x version>
I already found and inserted the crypt_key, now I suppose to edit the following:
<source>
<database host="localhost" name="Magento1-DB-name" user="DB-username" password="DB-password"/>
</source>
<destination>
<database host="localhost" name="Magento2-DB-name" user="DB-username" password="DB-password"/>
</destination>

Localhost --> I've put the IP address of both the source and destination (they are both in the same hosting package but have different IP addresses) - Is this correct?

name --> I copied the database name from phpMyAdmin - Is this correct?

user --> what should this be? Is this the cPanel user name or the Magento Admin user name?

password --> again - cPanel password OR Magento Admin password?

After I get the correct settings in here, can I just run these 2 commands via SSH (Putty) to make the Migration tool migrate all the important data?
php bin/magento migrate:settings --reset <path to your config.xml>

php bin/magento migrate:data --reset <path to your config.xml>

Also, do I need to put the Magento 1 store in maintenance mode prior to doing the migration?


texts:
Magento block in before_body_end with form_key being cached

We use a block for login form data in the block before_body_end. Only since some time we have seen this block is cached and the form_key has a mismatch when wew submit it to Magento.

question: how can we (really) prevent the block below from being cached?

<catalog_category_default>
    <reference name="before_body_end">
    <block type="core/template" name="autologin" as="autologin">
        <action method="setTemplate" ifconfig="webmyneautologin/webmyneautologin_group/category"><template>autologin/autologin.phtml</template></action>
        <action method="setCacheLifetime" />
    </block>
    </reference>
</catalog_category_default>


texts: set shipping method from observer based on subtotal

texts: I am trying set shipping method based on subtotal from cart page. If subtotal is less than certain amount then customer will have Flat rate as shipping method else it will be free shipping.


texts: How to add custom field beside Export To button in Magento2?

texts: How to add custom field as shown in image in sales order admin grid in Magento 2?


texts: Product doesn't appear in store view (Info: There are no products matching the selection.)

texts:
Issue: The product is not appearing when browsing the catalog from the frontend.

Scenario:

Product status is Enabled
Product is Salable (In stock)
Product is configured under Websites and Categories of the product Edit menu to appear in the specified store views and catalogs.
Product is set to Visibility: Catalog,Search

Is there anything else that would affect the product scope?


texts: Is it safe to send admin credentials to rest API

texts:
I am getting data from magento2 REST api. I send admin credentials to get the token then I use the token to get the data and everything is working fine.

Is it a safe way to do that? Should I create another user with specific permissions for accessing REST api on magento? What is the recommended way to do it?

I am using the below code:

    //Authentication rest API magento2
    $adminUrl='http://domain.com/index.php/rest/V1/integration/admin/token';
    $ch = curl_init();
    $var =
    $data = array("username" => "username", "password" => 'password');
    $data_string = json_encode($data);
    $ch = curl_init($adminUrl);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'Content-Length: ' . strlen($data_string))
    );
    $token = curl_exec($ch);
    $token=  json_decode($token);
    $ch = curl_init( "http://domain.com/index.php/rest/V1/products?searchCriteria[pageSize]=10&fields=items[id,name,sku,price,status]" );

    $curlOptions = array(
        CURLOPT_CUSTOMREQUEST  => "GET",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER     => array(
            "Content-type: application/json",
            "Authorization: bearer ".$token
        )
    );

    curl_setopt_array( $ch, $curlOptions );

    $response = curl_exec( $ch );

    return $response;


texts:
How can i solve reindex error
How can i solve the reindex problem


texts: Magento-show custom attribute of a product only if that belongs to specific category

texts:
I am showing a specific attribute on product page directly under short description instead of additional information section. I am able to achieve that but I want to show particular attribute only for products from a specific category. Not for all products from other categories. I need some IF statement here to show this only for specific category, for example cat ID 7. Anybody can help?

<?php echo $_product->getAttributeText('fabric') ?>


texts: Stop Further Rules Processing not working

texts:
I am offering a free gift for people that place a certain minimum order. There are multiple items to choose from, but only 1 is free at a time. I made 2 separate Shopping Cart Price Rules with the Stop Further Rules Processing option set to YES. The problem is that both of the rules are being applied.

How to I get only one of the rules to apply?

See images below.

Thank you,

Both rules are set with different priories.

Rule MEC refers to the $600 minimum order free gift. This one takes priority over the other.

Rule 12FT refers to the $300 minimum order free gift. Should not be applied if rule MEC is applied.

You can see that both the $600 and $300 gifts are applied.


texts: Is there a way to add custom attributes to the Admin side product search?

texts:
I am looking to be able to search by a custom attribute's values on the Admin side in Catalog > Product search.

By default you can search by a range of product ID's, name, type, attribute set name, SKU, etc.

Is there a way to add my own attribute in that product search?


texts: Magento 1.9 change package folder and theme name

texts: could someone explain to me how can I change the package folder and the theme name of a Magento 1.9.3 theme that I downloaded and installed?


texts:
I'm using this code to export customers to CSV.

I would like to add an extra column that is the STORE NAME, and not the ID. "store_id" works but only shows the ID (a number). I would like to show the text.

<?php
require_once('app/Mage.php');
umask(0);
if (!Mage::isInstalled()) {
    echo "Application is not installed yet, please complete install wizard first.";
    exit;
}
// Only for urls // Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);
Mage::app('admin')->setUseSessionInUrl(false);
Mage::setIsDeveloperMode(true); ini_set('display_errors', 1); error_reporting(E_ALL);
try {
    Mage::getConfig()->init();
    Mage::app();
} catch (Exception $e) {
    Mage::printException($e);
}
ini_set('memory_limit','500M');
$customerCount = 0;
try{
    //configure the collection filters.
    $collection = Mage::getResourceModel('customer/customer_collection')
        ->addAttributeToSelect('firstname')
        ->addAttributeToSelect('lastname')
        ->addAttributeToSelect('email')
        ->addAttributeToSelect('store_id');

    $collection->getSelect()->join(array('cg' => 'customer_group'),
        'e.group_id = cg.customer_group_id',
        array('customer_group_code'));

    //Add a page size to the result set.
    $collection->setPageSize(50);
    //discover how many page the result will be.
    $pages = $collection->getLastPageNumber();
    $currentPage = 1;
    //This is the file to append the output to.
    $fp = fopen('customers.csv', 'w');
    $addedKeys = false;
    do{
        //Tell the collection which page to load.
        $collection->setCurPage($currentPage);
        $collection->load();
        foreach ($collection as $customer){
            //write the collection array as a CSV.
            $customerArray = $customer->toArray();
            $customerREquiredArray['First name'] = $customerArray['firstname'];
            $customerREquiredArray['Last name'] = $customerArray['lastname'];
            $customerREquiredArray['Email'] = $customerArray['email'];
            $customerREquiredArray['Store ID'] = $customerArray['store_id'];
            $customerREquiredArray['Customer Group'] = $customerArray['customer_group_code'];
            if($addedKeys == false){
                $keys = array_keys($customerREquiredArray);
                fputcsv($fp, $keys);
                $addedKeys = true;
            }
            //var_dump($customerArray); echo "\n\n";
            fputcsv($fp, $customerREquiredArray);
            //fwrite($fp,print_r($customerArray,true) . chr(10) );
            $customerCount++;
        }
        $currentPage++;
        //make the collection unload the data in memory so it will pick up the next page when load() is called.
        $collection->clear();
        //break; //DEBUG
        echo "Finished page $currentPage of $pages \n";
    } while ($currentPage <= $pages);
    fclose($fp);
} catch (Exception $e) {
    //$response['error'] = $e->getMessage();
    Mage::printException($e);
}
echo "Saved $customerCount customers to csv file \n";


texts: Magento 2 Admin URL only showing Text after Custom Admin URL

texts:
I tried to change the Admin URL from the Backend from Stores>Configurations>Admin>Admin Base URL.
I changed Use Custom Admin URL to YES and the text box opened to enter Custom URL where I entered the URL. I don't have PHPMyAdmin or anything. I can only access the database from SSH.
Magento Admin refreshed right away and now I only see the text-based version on Backend. I have tried going back to the same setting to disable it but "Save Config" (now simple text button) does not work either.
Please help, it is a live website and in production. Thank you in advance.


texts: How to disable Cash On Delivery on specific customers in using magento 2.1.3?

texts: Customer for COD and return order three time, make him as blacklist and for his new order COD should be disable.


texts: UPS: Getting warehouse's negotiated rates

texts:
This is the first time a client of us starts selling in the US, so we get to deal with US warehouses and US shipping carriers. My client has decided he wants to ship his packages using UPS.

All products are shipped from a US warehouse (Webgistix), we communicate to their systems via their API, that all goes well.

As you can imagine, Webgistix offers discounted shipping rates over the default UPS rates.

Since UPS offers a lot of methods with a lot of tiers we thought it would be a good idea to use the build-in UPS shipping method and configure it in such a way we can use the Webgistix shipping rates.

In the UPS module we have the ability to 'Enable Negotiated Rates', but we need to connect it with the rates of Webgistix.

The reason I though this might be possible is because I can enter a 'Shipper Number (Required for negotiated rates; 6-character UPS.)' in Magento. I though I'd enter my own API credentials and enter Webgistix Shipper Number to get their rates.

Of course we have already contacted webgistix about this, but they aren't too technical and they don't know how to set this up, they just provided a PDF with thousands of prices and expect us to manage that manually or something...

Is this even possible to use the UPS module? If not, is there another solution or should I enter everything manually.

Any ideas?


texts: How to change a template from magento 1 to magento 2

texts: I bought a template ma lavoro but it's not compatible with magento 2. can i do something to make it compatible with magento 2 ??? please any help and thanks


texts: How to update Magento 2.2.5 to Magento 2.3.1? possible issues?

texts:
I wanted to know is it possible to update Magento from 2.2.5 to 2.3.1? Or what is a solution to update all Magento 2.2.5 stores to Magento 2.3.1? If we will update it then what are the challenges for that we have to be prepared?

Please let me know if there any solution for this or not.
REF - How to Upgrade magento version from 2.2.X to 2.3.0?


texts: Why is Magento looking for this file as my resource model? 'Failed to open stream...No such file'

texts:
I am trying to create a model for the first time in Magento - the resource model is Mygroup_Mymodule_Model_Resource_Link

The model alias I have used is mygroup_mymodule/link

I am trying to call $myVar = Mage::getModel('mygroup_mymodule/link') but I am getting this error:

Warning: include(Mage/Mygroup/Mymodule/Resource/Model/Link.php): failed to open stream: No such file or directory  in /[root]/lib/Varien/Autoload.php on line 93

This is true: there is no file there, or in app/code/local/Mygroup/Mymodule/Resource/Model/Link.php, but I don't know why Magento thinks there should be.

My folder structure is:

...
- Model/
    - Link.php
    - Resource/
        - Link.php
        - Link/
            - Collection.php
...

app/code/local/Mygroup/Mymodule/etc/config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mygroup_Mymodule>
            <version>0.0.6</version>
        </Mygroup_Mymodule>
    </modules>

    <frontend>
        <routers>
            <downloadable>
                <use>standard</use>
                <args>
                    <modules>
                        <Mygroup_Mymodule before="Mage_Downloadable">Mygroup_Mymodule</Mygroup_Mymodule>
                    </modules>
                </args>
            </downloadable>
        </routers>
    </frontend>

    <global>
        <helpers>
            <downloadable>
                <rewrite>
                    <download>Mygroup_Mymodule_Helper_Download</download>
                </rewrite>
            </downloadable>
        </helpers>

        <models>

            <mygroup_mymodule>

                <class>Mygroup_Mymodule_Model</class>

                <resourceModel>mygroup_mymodule_resource</resourceModel>

            </mygroup_mymodule>

            <mygroup_mymodule_resource>

                <entities>

                    <link>

mygroup_mymodule_link

                    </link>

                </entities>

            </mygroup_mymodule_resource>

        </models>

        <resources>

            <mygroup_mymodule_setup>

                <setup>

                    <module>Mygroup_Mymodule</module>

                    <class>Mage_Core_Model_Resource_Setup</class>

                </setup>

                <connection>
                    <use>core_setup</use>
                </connection>

            </mygroup_mymodule_setup>

        </resources>

    </global>
</config>

app/code/local/Mygroup/Mymodule/Model/Link.php:

<?php
class Mygroup_Mymodule_Model_Link extends Mage_Core_Model_Abstract
{

    protected function _construct()
    {
        $this->_init('mygroup_mymodule/link');
    }
    ...

app/code/local/Mygroup/Mymodule/Model/Resource/Link.php:

<?php
class Mygroup_Mymodule_Model_Resource_Link
    extends Mage_Core_Model_Resource_Db_Abstract
{
    protected function _construct()
    {
        $this->_init('mygroup_mymodule/link', 'entity_id');
    }
}

app/code/local/Mygroup/Mymodule/Model/Resource/Link/Collection.php:

<?php
class Mygroup_Mymodule_Model_Resource_Link_Collection
    extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
    protected function _construct()
    {
        parent::_construct();

        $this->_init(
            'mygroup_mymodule/link',
            'mygroup_mymodule/link'
        );
    }
}

I also have a Helper and a controller in the module (as you can see in the config file), but I don't think that's relevant here.

Thanks very much for any help!

I am using CE 1.9.0.1


texts: How to customize product details page in magento 2?

texts: I have setup a Magento store using Magento 2.1.3 and I want to customize product details page. I have attached a screenshot. Can anybody give me some suggestion?


texts: Magento 2: I have a attribute of category collection. Need to sort the category ids

texts:
I created a category multiselect attribute in products in which I get the specific child categories of the parent category and select the category per requirement.
I just want to rearrange the order of fetching dynamically category ids on the frontend.

So I want to create an order number attribute filed where I will set the order for all categories and sort the categories from that attribute category.

Does anyone have any idea?

Thanks


texts: Backend edit customer: Cannot read property 'show' of undefined

texts: Getting this error when trying to configure a customer, after clicking OK it does load. But what causes this? Thanks for who can help me!


texts: Magento 2.3 API for get child category of specific category

texts:
I have tried with API:
/rest/V1/categories/3 get that give the only id of child category not name etc.
get response like : [children] => 4,5
not come: children_data


texts: The .NET NuGet Package `Magento.NetCore` Has No Sample Code - How to use it?

texts:
I want to use C# to call against the Magento 2 REST API. The NuGet package Magento.NetCore seems like it might be a fairly complete C# library, but there is no sample code. Even just to create a connection.

Can anyone post some code to show you this library works?


texts:
i'm trying to put my local database on a freewebhost but i keep having problems..

I've recently developed my website and im trying to put it to a free webhost. I have downloaded my sql database in the .gz, created a new database on my new webhost and imported it in. my page is still blanke, and the techsupport are telling me that i need to change my configuration file of my php script, to upload the new user name , database name etc.. but where is that config file? where i need to go to access it and replace my new users? is there any other step that i need to do?


texts: Magento 2.3 How to automate custom cron job from custom module?

texts:
I am working on Cron from custom module to send email from custom cron job, I created it as below but the cron job is nor working on the server.

<?php
namespace Name\Module\Cron;

use Magento\Framework\Mail\Template\TransportBuilder;
use Name\Module\Model\MyModule;
use Magento\Customer\Model\CustomerFactory;
use Name\Module\Helper\Data;

class RfqCron {

protected $_logger;
protected $customerFactory;
protected $transportBuilder;
protected $helper;
protected $_myFactory;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Framework\Escaper $escaper,
    TransportBuilder $transportBuilder,
    CustomerFactory $customerFactory,
    Data $helper,
    \Name\Module\Model\ResourceModel\MyModule\CollectionFactory $myFactory
) {
    $this->_logger = $logger;
    $this->helper = $helper;
    $this->_myFactory = $myFactory;
    $this->customerFactory = $customerFactory;
    $this->transportBuilder = $transportBuilder;
    $this->inlineTranslation = $inlineTranslation;
    $this->scopeConfig = $scopeConfig;
    $this->storeManager = $storeManager;
    $this->_escaper = $escaper;
}
public function execute()
{
    try {
        $myCollection = $this->_myFactory->create();
        foreach ($rmyCollection as $myData) {
            $customer = $this->customerFactory->create()->load($myData->getCustomerId());
            $customerInfo = array(
                'name' => $customer['firstname'],
                'email' => 'xxxxxx@gmail.com'
            );

            $currentDate = date('Y-m-d');
            $myExpireDate = $myData->getExpiryDate();
            if ($myExpireDate == $currentDate) {
                $templateId = $this->helper->getConfigValue('mysettings/my_customer_notification/customer_email_template_expire');
                $emailTemplateVariables = array(
                    'email' => $customerInfo['email'],
                    'name'   => $customerInfo['name'],
                    'msg'  => "email sent from cron"
                );
                $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
                $this->helper->sendEmailToCustomer(
                    $templateId, //email template id
                    $emailTemplateVariables, //variables
                    $customerInfo //receiver
                );

                $myData->setMyStatusId(4);
                $myData->save();
            }
        }
        $this->_logger->addDebug( "Message sent" );
        return;
    } catch (\Exception $e) {
        $this->inlineTranslation->resume();
        $this->_logger->addDebug( "Message not sent" );
        return;
    }
}

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="name_module_cron_group">
        <job name="mycron" instance="Name\Module\Cron\MyCron" method="execute">
            <schedule> * www-data PHP /bin/magento cron:run</schedule>
        </job>
    </group>
</config>


texts: Magento 2.1.3 Role Resource Tree Not Showing

texts:
I have a clean install of Magento 2.1.3 with sample data. No themes or plugins have been added.

When I create a new role, the role resource tree does not display, and there is no other error or warning on the page.

There are some posts related to earlier Magento releases that speak about the acl.xml file requiring change - and yet others claiming to have fixed the issue by changing folder permissions (no folders were listed, nor were we shown which permissions needed to be changed).

If I have to go through the entire Magento documentation I will, but the point of coming to any forum is to share information and hopefully save time.

Should I come across the solution, I will come back and post the answer. If anyone has already tackled this, a detailed response would be appreciated.

Disclaimer: I am very new to Magento 2.1x - the most recent Magento experience I had was CE 1.7.

Thank you in advance to all!


texts: layered navigation isn't populated by collection attributes -- CMS page

texts:
I'm attempting to add layered navigation to a CMS page containing a widget that contains a custom product collection (products that are 'new').  Within this widget are fuctions that, given the correct parameters, will filter this collection.  How do I pass this collection to the layered navigation block and have it's attributes show up?

This is how I am calling the layered navigation in the CMS custom layout XML:

<reference name="content">
        <!-- Layered Navigation Block -->
        <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml" >
        </block>
</reference>

This is how i'm calling the product collection onto the CMS page:

{{widget type="catalog/product_widget_new" display_type="new_products" show_pager="1" products_count="60" template="catalog/product/widget/new/content/new_grid.phtml"}}

This is how i'm generating the product collection in the widgets block:

protected function _getProductCollection()
{
    $todayStartOfDayDate = Mage::app()->getLocale()->date()
        ->setTime('00:00:00')
        ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
    $todayEndOfDayDate = Mage::app()->getLocale()->date()
        ->setTime('23:59:59')
        ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
    /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
    $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
    $this->_addProductAttributesAndPrices($collection)
        ->addStoreFilter()
        ->addAttributeToFilter('news_from_date', array('or' => array(
            0 => array('date' => true, 'to' => $todayEndOfDayDate),
            1 => array('is' => new Zend_Db_Expr('null')))
        ), 'left')
        ->addAttributeToFilter('news_to_date', array('or' => array(
            0 => array('date' => true, 'from' => $todayStartOfDayDate),
            1 => array('is' => new Zend_Db_Expr('null')))
        ), 'left')
        ->addAttributeToFilter(
            array(
                array('attribute' => 'news_from_date', 'is' => new Zend_Db_Expr('not null')),
                array('attribute' => 'news_to_date', 'is' => new Zend_Db_Expr('not null'))
            )
        )
        ->setPageSize($this->getProductsCount())
        ->setCurPage(1);
    return $collection;
}

The widget's template page is a standard practice way to display price, reviews, pictures, etc in a pagesize varient format.


texts: Magento 2 : Make customer name optional while creating customer & saving address?

texts:
Is their any way we can make customer lastname as optional while creating & saving customer,
also when we save customer address from $order->getBillingAddress()->getData() ?
code for reference -
 $billing_adress = $order->getBillingAddress();
        $store          = $this->storeManager->getStore();
        $storeId        = $store->getStoreId();
        $websiteId      = $this->storeManager->getStore()->getWebsiteId();
        $customer       = $this->customerFactory->create();
        $customer->setWebsiteId($websiteId);
        $customer->loadByEmail($billing_adress->getEmail());
        $customer_lastname = $billing_adress->getLastname();
        if (!$customer->getId()) {
            $password = bin2hex(openssl_random_pseudo_bytes(4));
            $customer->setWebsiteId($websiteId)
                ->setStore($store)
                ->setFirstname($billing_adress->getFirstname())
                ->setLastname(empty($customer_lastname) ? "." : $customer_lastname)
                ->setPrefix($billing_adress->getPrefix())
                ->setEmail($billing_adress->getEmail())
                ->setPassword($password);
            $customer->save();
            /* save billing Address */
            $address = $this->addressFactory->create();
            $address->setData($order->getBillingAddress()->getData());
            $address->setCustomerId($customer->getId())
                ->setIsDefaultBilling('1')
                ->setIsDefaultShipping('0')
                ->setSaveInAddressBook('1');
            $address->save();

            /* save shipping Address */
            if (!$order->getIsVirtual()) {
                $address = $this->addressFactory->create();
                $address->setData($order->getShippingAddress()->getData());
                $address->setCustomerId($customer->getId())
                    ->setIsDefaultBilling('0')
                    ->setIsDefaultShipping('1')
                    ->setSaveInAddressBook('1');
                $address->save();
                return $customer;
            }

Would be great to hear your thoughts.
Thanks


texts: Bring information from cart into edit product page?

texts:
All my items in the cart have an edit button. Upon clicking that edit button I would like to bring information from the cart to the edit page so I can display some things.

EDIT**
In the cart all my products are loaded in one by one with their attributes.
Each product has it's own $areasJson which is a php variable that is a long string which I use to create a custom image for each item.

However when I click the edit button it brings me to the simple product page of that item but I lose the $areasJson information because I don't know how to bring it with me.


texts: Bug with tax calculation and discount price

texts:
Hello,

After reading a lot of threads about problem with tax calculation with discount price I found no solution about what is happening to me.

As you can see in the screenshot joined the price total after discount is different between the 3 products. This is a 30% discount on each products. The first and the last seems good but the second one has a different total. I don't know why.
Thanks for your help !

EDIT :

Add a screenshot of my tax configuration settings


texts: How do I remove the "Delete" mass action from an observer

texts:
I want to remove the "Delete" mass action from the Products grid. I am trying to do this from my observer. Here is my observer class

class NameSpace_Module_Model_Observer {

public function isAddProductDeletePermitted($observer) {
    $block = $observer->getBlock();
    if( $block !== null ) {
        if( $block instanceof Mage_Adminhtml_Block_Cms_Block_Grid) {
            $block->getMassactionBlock()->removeItem('delete');
            // echo "DELETE";
        }
    }
    return $this;
}

And here is my config.xml

<?xml version="1.0"?>
<config>

    . . .

    <global>

        . . .

        <events>
            <adminhtml_block_html_before>
                <observers>
                    <is_add_product_form_permitted>
                        <class>Dotlocal_AdvProductGrid_Model_Observer</class>
                        <method>isAddProductDeletePermitted</method>
                    </is_add_product_form_permitted>
                </observers>
            </adminhtml_block_html_before>
        </events>
    </global>
</config>

I cannot seem to get this to work. I am pretty sure this doesn't work because I am trying to removing it before it is added. Then what event should I be observing?


texts: Magento 1: unset a previously set query parameter or reinit the request

texts:
So I've made an integration test where my setUp() method add a query parameter to the request like this:

Mage::app()->getRequest()->setQuery('entry', 'value');

However, the tests that run after this test will have their request still containing the query parameter.

The only way I managed to avoid that was by adding the following line in my tearDown() method :

unset($_GET['entry']);

I want to know what is the proper Magento way of doing that ?

I tried calling:

Mage::app()->getRequest()->setQuery('entry', null);

But I get the following error:

  Invalid value passed to setQuery(); must be either array of values or key/value pair

I also tried:

Mage::app()->getRequest()->setParam('entry', null);

No error but still does not remove the query parameter.

Even reinit the entire request would be fine if that's possible.


texts:
I'm trying to save some files after a form submission. Here's my function that currently saves the file(s):

  private function uploadFile($id) {
    $uploader = $this->_fileUploaderFactory->create(['fileId' => $id]);
    $uploader->setAllowRenameFiles(TRUE);
    $uploader->setFilesDispersion(TRUE);
    $uploader->setAllowCreateFolders(TRUE);

    $path = $this->_fileSystem->getDirectoryRead(DirectoryList::MEDIA)
      ->getAbsolutePath();

    $uploader->save($path . '/job/submissions');

    return '/job/submissions' . $uploader->getUploadedFileName();
  }

This get's saved as I expect, but the files are accessible for every visitor. So my question is how or where can I save a file that can only be accessed by an admin?


texts: Add a Datepicker in a Fancybox in Magento 2

texts:
I added a Datepicker in an ajax fancybox.
My Code is

 <a class="fancyboxlive" href="<?php echo $url; ?>?id=<?php echo $collectionData->getId(); ?>" > <?php echo __('Edit') ?>

How can I add the Datepicker inside the fancybox popup?


texts: What Triggers the Generation of a Factory in Magento 2

texts:
Magento 2 contains a number of class files that are either pre-generated, or are generated on the fly.  They live in

var/generated

These generated files include factory classes.  From the documentation, it's my understanding that a programmer uses factory classes to instantiate "non-injectable" objects.  A "non-injectable" object is an object that can't be added via __constructor dependency injection, usually because it requires user input to instantiate.

What's not clear from the documentation is how Magento 2 knows it needs to generate a factory class.  This bit

  If a non-existent factory is encountered by object manager in runtime mode or compiler, the object manager generates the factory.

makes it sound like if I use a factory class in the object manager (or, by extension, in the dependency injection __constructors), that Magento 2 will generate it for me.  But how does the object manager know the thing I'm requesting is a factory?

Also, there seems to be two commands for automatically generating (or "compiling") all the generated classes.  Running either of these commands generates a large number of Factory classes.  What configuration and/or code files are these commands looking at to generate the needed factory objects?

I know that tracing the object manager and/or command code all the way down would reveal this, but I'm hoping to avoid that long and arduous journey.


texts: Magento 2 - Switching currency only changing symbol on cart page

texts: I am using Magento 2.1.8, when we change currency fro INR to USD or USD to INR, it only changes symbol instead of complete calculation at Estimate Shipping and Tax box. See attached screenshot


texts: How do I show and hide cart items in the order summary sidebar of the magento 2 checkout?

texts:
I would like to display cart items in the order summary sidebar during the shipping stage with no show/hide toggle functionality.  Then on reaching payment methods stage display the cart items in the default collapsible and expandable drop down section.

Is there away of doing this?

I am referring to the code found in cart-items.html

            <translate args="maxCartItemsToDisplay" if="maxCartItemsToDisplay < getCartLineItemsCount()" />
            <translate args="'of'" if="maxCartItemsToDisplay < getCartLineItemsCount()" />

            <translate args="'Item in Cart'" if="getCartLineItemsCount() === 1" />
            <translate args="'Items in Cart'" if="getCartLineItemsCount() > 1" />

                <each args="items()">

                            <each args="$parent.elems()" render="" />

                </each>

    <div class="actions-toolbar" if="maxCartItemsToDisplay < getCartLineItemsCount()">

I am not sure how knockout handles the different stages and how I might pass that information to the order summary sidebar to display/hide this functionality.

Any ideas/information much appreciated.
Thank you.


texts: Magento 1: how to debug a "class not found" autoloader error?

texts:
So, I'm facing the almighty "Class Bla not found" error on one of my website.

The class file sits in the vendor folder and I'm using an event observer for the autoload:

<events>
    <resource_get_tablename>
        <observers>
            <composer_autoloader>
                <type>singleton</type>
                <class>module/observer</class>
                <method>addComposerAutoloader</method>
            </composer_autoloader>
        </observers>
    </resource_get_tablename>
</events>

Here's my observer:

class Vendor_Module_Model_Observer
{
    /**
     * @var bool
     */
    protected static $added = false;
    /**
     * Register the Composer autoloader
     * @param Varien_Event_Observer $observer
     */
    public function addComposerAutoloader(Varien_Event_Observer $observer)
    {
        if (self::$added === false) {
            /** @var $helper Vendor_Module_Helper_Data */
            $helper = Mage::helper('module');
            $helper->registerAutoloader();
            self::$added = true;
        }
    }
}

And here's my helper method:

public function registerAutoloader($path = null, $filename = null)
{
    if ($path === null) {
        $path = $this->getVendorDirectoryPath();
    }
    if ($filename === null) {
        $filename = self::AUTOLOAD_FILENAME;
    }
    if (file_exists($path . DS . $filename)) {
        require_once($path . DS . $filename);
    }
}

According to my tests using xDebug, the observer is properly triggered and the require_once leading to my vendor/autoload.php is called.

I've checked the namespace I use to call my custom class and I'm 100% sure there's no typo.

NB: please note that if I get rid of this composer code and if I patch the app/Mage.php directly with the following code, it does not work either:

/** AUTOLOADER PATCH **/
if (file_exists($autoloaderPath = BP . DS . '../vendor/autoload.php') ||
    file_exists($autoloaderPath = BP . DS . 'vendor/autoload.php')
) {
    require $autoloaderPath;
}
/** AUTOLOADER PATCH **/

So my question is: how do I debug that error ? Any usual suspects ?


texts: Is an extension in the local codepool without a config.xml capable of overriding a community extension?

texts:
I'm new to Magento and learning by adopting an existing system.

I've come across a case where we have an extension in the community codepool.  There appears to be overrides for this extension in the local codepool, however there is no config.xml in local.

Is there any way the code in local is actually having an effect, or should it be safe to remove without further review?


texts:
When I am installing Magento under a subdomain of my production domain, I cannot login to magento admin. For example, my domain name is example.com where I have installed magento and it is in production, I am ok with admin login.

However, I have a subdomain called test.example.com and I installed magento there for testing purpose. Now, if I try to login to the test site, I can't login. The username and passwords are correct. I see no error message. It just reloads the same login page. Same things happens when I try to login to my production site admin panel.

If I clear the cookies related to example.com and test.example.com and then try to login to the admin panel of example.com, I am fine. Now, when I try to login to test.example.com admin panel, the problem starts again. Below is the current configuration

Is there anybody who can help me solving this issue?


texts: I am trying to get color id $color_id in below code but here it is returning empty value ?? is anyone have any idea related it

texts:
if(count($productCollection_child['facets']['colour']['buckets']) >= 1)
{
    if(count($productCollection_child['facets']['colour']['buckets']) > 0)
    {
        foreach($productCollection_child['facets']['colour']['buckets'] as &$filetsclr)
        {
            $colorvalue[] = $filetsclr['value'];
            $colorcount[] = $filetsclr['count'];
        }
        $filterHtml .='

Colour

';
        for($i=0;$i<10; $i++)
        {
            $attributeCode = 'color';
            $attribute = Mage::getModel('eav/entity_attribute')->loadByCode(Mage_Catalog_Model_Product::ENTITY, $attributeCode);
            $collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
                ->setAttributeFilter($attribute->getId())
                ->setStoreFilter(Mage_Core_Model_App::ADMIN_STORE_ID)
                ->addFieldToFilter('tdv.value', $colorvalue[$i]);
            if ($collection->getSize() > 0) {
                $color_id = $collection->getFirstItem()->getId();
            }
            $clrUrls ='?color='.$color_id;
            $filterHtml .='
'.$colorvalue[$i].'('.$colorcount[$i].')
';
        }
        $filterHtml .='

show more

';
    }
}

In inspect element it is coming $color_id is empty :

005 Set (0.2mm Line)(1)

03 Set (0.35mm Line)(1)


texts: Magento 2: Products Aren't Showing up. But they exist in backend!

texts:
I've added products in the backend even a test one. But they will not show up no matter what we do.

We have already tried php bin/magento indexer:reindex in the SSH
We have cleared the cache, It worked on the local build but once we pushed it up it just refused to work. All the products have been manually added.

Im pulling my hair out at the moment.

They are visible in backend, But not in frontend, I cant see them in the products menu.

Does anyone have any ideas what on earth is going on?

I've editing the following files:
app\code\Modules\Catalog\etc\di.xml app\code\Modules\Catalog\Model\Indexer\Category\Product\Action\Full.php

As referenced in this stackoverflow link https://stackoverflow.com/questions/33927658/products-is-not-showing-up-on-magento2-subcategory#answer-44364827

We have also tried invalidating and then reindexing.

Any advice would be greatly appreciated.

  EDIT!

We decided to see if we could view the product its self by going to its direct url and we got an inventory_stoc_1 Error


texts: Add product programmatically magento 2: Unique constraint violation found

texts:
I added this script to add several products, but it appears this error:

  Unique constraint violation found

 $countallproduct = count($allproduct);
        for ($item = 1; $item < $countallproduct; $item++) {
            $product_data = $allproduct[$item];
            $objectManager =    \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
            $_product = $objectManager->create('\Magento\Catalog\Model\Product');
            $_product->setName($product_data->_source->name);
            $_product->setTypeId('simple');
            $_product->setAttributeSetId(4);
            $_product->setSku('test-SKU');
            $_product->setWebsiteIds(array(1));
            $_product->setVisibility(4);
            $_product->setPrice($product_data->_source->price);
            $_product->save();
        }

    }

Any help will be appreciated


texts: Custom multiselct product attribute not showing selected in admin

texts:
I have created a custom multiselct product attribute pro grammatically. Everything is working fine i.e values are
saving in databases and values also showing in product grid.But the selected values is not showing selected while editing the product.

However If I create multiselct attribute from admin it showing selected .


texts:
I am new to docker and devbox. I have setup DevBox Successfully and its working fine in a local system. I need information how to

run CLI ie. php bin/magento cache:flush
access phpmyadmin

My local setup details:

Windows 10 Pro
Magento Root files: D:\devbox\shared\webroot. I had created devbox in D drive.
Docker version 17.03.0-ce, build 60ccb22
local magento working at : http://127.0.0.1:32770/
and admin at: http://127.0.0.1:32770/admin/

Please comment if more information required.

Update:  Command "docker ps -a" displayed container then I executed the clean command but it's not working. Please suggest what path I am missing here:


texts: Could not find package * at any version for your minimum-stability (stable). Check the package spelling or your min imum-stability

texts:
Kindly help me on this error I get when I run this command:

The extension's composer.json:

{
"name": "veriteworks/m2-price",
"type": "magento2-module",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"description": "Magento2 extension for Price.",
"version": "1.0.4",
"authors":[
    {
        "name": "Hirokazu Nishi",
        "email": "nishi@veriteworks.co.jp",
        "homepage": "http://veriteworks.co.jp/",
        "role": "developer"
    }
],
"require": {
    "php": "~5.5.0|~5.6.0|~7.0.2",
    "magento/module-store": "~100.0",
    "magento/module-backend": "~100.0",
    "magento/module-media-storage": "~100.0",
    "magento/framework": "~100.0",
    "lib-libxml": "*"
},
"autoload": {
    "files": [
        "registration.php"
    ],
    "psr-4": {
        "Veriteworks\\Price\\": ""
    }
}

}


texts: How to create specific customer group to specific website in Magento 2

texts: Is there any way to create groups which are specific to the website. Has anyone worked on this?


texts: I proceed to connect 2 phtml files into one file to display. and it appears  2 buttons to save different to 2 action? I want only one button SAVE


texts: Magento 2: how to improve response time when changing colors?

texts:
Currently it takes around 4-5 seconds to update the product images when you click on a color swatch in Magento 2. Example:

https://youtu.be/AeOTEth4TOc

How can you improve this performance?

It seems all the image information is already available in the jsonConfig object, so it shouldn't take this long even when you're in developer mode.


texts: Magento 2. Diffrent menu options for different store views

texts:
Going through this. https://docs.magento.com/m2/ce/user_guide/catalog/catalog-scope.html

I found this

Because the specific menu options are defined at the store view level, each view can have a different main menu based on the same root category

Can someone tell me how can I have a different main menu, in two different store views under the same store based on the same root category?

Ty


texts: how can i uninstall sample-data-media in magento 2?

texts: how can I uninstall a component without a module name? I'm trying to look for a solution to remove the sample-data-media.


texts: Product collection has no name attribute how can I get it magento2?

texts:
I tried this code but :-

$product = $this->_objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection')
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('entity_id', array('in' => $productIds));

     echo '<pre>'; print_r($product->getData()); echo '<pre/>'; die();

             Array
    (
        [0] => Array
            (
                [entity_id] => 36
                [attribute_set_id] => 11
                [type_id] => simple
                [sku] => 24-MG04
                [has_options] => 0
                [required_options] => 0
                [created_at] => 2016-08-21 07:56:06
                [updated_at] => 2016-08-21 07:56:06
            )
    )

And I am getting this result except of all the attributes.


texts: How to add configurable product to current module?

texts:
Magento 1.9.2.4 using RWD theme.

Could anyone guide me on " How to add configurable products to existing marketplace plugin?" By using plugin I'm able to Create / Upload and manage sellers but it's working only for Simple Products.

I'm looking for a functionality, where Configurable Products also can be added. Could anyone guide me on the same.

Thanks in advance....


texts: Changing "Use Flat Catalog Category/Product" To Yes Changes The Head Of My Website

texts:
Recently we have decided to change the option of our website to use the flat catalogue category/product to speed up our website, which works!
But we have now come across a problem where when doing this it changes the header of the website back some part of the original theme which is strange:

We are running on magento version: 1.9.2.1


texts: NO INDEX, NO FOLLOW on Specific Category Magento 2

texts: Can I set a specific category to NO INDEX, NO FOLLOW in Magento 2? In the previous version I could use an updated layout XML reference to do this within a specific category.


texts: Magento how to get subtotal session value in custom module?

texts:
I am currenly working on one custom module for magento 1.9.1

I am stuck on getting the session value of the checkouts subtotal.

I know how to get it in a template file but i have to get in in a simple php file.

This is the code that i am tring to get the value:

<?PHP
require('app/Mage.php'); //Path to Magento

Mage::app();
echo Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();
?>

It's not returning the value. The module is located in /app/code/local if it is important.

Did i have to make any function or something ?

Thanks!


texts:
I am adding CSS to hide the custom module tab settings, abandoned cart settings but when I opening the general tab then CSS is removed at the same time.

.admin__page-nav.mkt-tab ._collapsible+.admin__page-nav-items .grazitti_settings { display: none; }

Any idea?

Thanks


texts:
How to move Magento 2.1.9 from bitnami to a similar bitnami box Azure but at Magento version 2.3.3

Also, If I upgrade Magento via composer or using the admin panel then will all of the third-party extensions work fine?


texts:
I am applying discount on cart by following the link

http://pradeepkumarrcs.blogspot.in/2011/12/applying-custom-discount-amount-in.html

discount apply on cart but my problem is that when i checkout using paypal it redirects back me to cart and print the following error

  PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details).

When i go through the log i found the following message

  exception 'Mage_Core_Exception' with message 'PayPal NVP gateway errors: Array Correlation ID: b1fffcad18843. Version: 72.0.'

Any help?


texts: I have a configurable product with a few associated simple products and have to set a weight for configurable so i go to associated products tab and manual set weight, save and ... after reload its still empty. Simple products have weight but cant set to configurable. Any idea why ?


texts: Magento search is not working after upgrade to latest version

texts: Does any one know how i can solve my problem ? . becuase my search is not workinig after upgrade magento version


texts: 'city' option not displayed in shopping cart page

texts:
I am using magento 1.9.2.3.

The problem I am facing is that when I was working in the local machine the city option in Estimate Shipping and Tax section in shopping cart page was perfectly displayed below 'country' option.

But when I move everything to the server with the same database, the code is there but the city option alone is missing.

Is there anything I should activate in the admin panel?


texts: Which of the following will instantiate a product collection?

texts:
$collection = Mage::getModel('catalog/product')->getProduct();
$collection = Mage::getModel('catalog/product')->getCollection();
$collection = Mage::getModel({'catalog/product'})->getCollection();
$collection = Mage::getModel('catalog/product')->getCollectionId();


texts: Show the content of other site in my system configuration in Magento 2

texts:
How do I show the content of other sites in my system configuration, Please provide me a solution

 <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0"
                   showInStore="0">
                abcd
                <frontend_model>xx\yy\Block\Adminhtml\System\Config\Extensions</frontend_model>
                <comment>
                <![CDATA[

                ]]>
                </comment>
</group>


texts: Can't install. Can't get past the License Agreement panel

texts:
I've FTPd all Magento files to my server twice now.   Tried a good cross section of browsers - but I can't get past the first step of installation.  Just unticks itself and resets the page.  See quick screencast:

http://screencast.com/t/7FYsuPko

It is a bug?  Magento was happy with my server etc.
Can't see anyone else having this problem.

Can I bypass this step with a simple link?
Any help much appreciated.


texts: Need Help To Connect Magento Rest Api using curl

texts:
I would like to use cURL to get all orders using rest API. Can I use cURL instead of Oath.

I tried with cURL but returns 403 Forbidden.

I have tried with below code :

$params = array(
    "oauth_callback" => $oauthCallback,
    "oauth_consumer_key" => $oauthConsumerKey,
    "oauth_nonce" => $oauthNonce,
    "oauth_signature_method" => $oauthSignatureMethod,
    "oauth_timestamp" => $oauthTimestamp,
    "oauth_version" => $oauthVersion,
);

$header = "";
foreach ($params as $key=>$value){
    $header .=  $key.'="'.$value."\", ";
}

$header .= "oauth_signature=\"".$oauthSignature.'"';
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, array($header));
curl_setopt($curl, CURLOPT_URL, $endpointUrl);

$response = curl_exec($curl);
echo "<pre>";
print_r($response);
curl_close($curl);


texts: Changes is working in core path but not in local path

texts:
I changed some coupon code error message in core file.its working fine.
but if i copy the file to local [below]  path , its not working for me.

app/code/core/Mage/Checkout/controllers/CartController.php - working

app/code/local/Mage/Checkout/controllers/CartController.php - not working

what else changes i need to do to fix this issue


texts: Display a custom field with Rendered in Product Grid UI Component in Magento 2

texts:
I want to add one custom field in Product Grid UI Component where It will display some text which will fetch from Product Custom Option.

I tried lots of solution but all are for other Grid system not the Magento 2 Product Grid UI Component. I found how to add an custom image but I want to display one of my Custom Option in the Product Grid UI Component.


texts: Magento 1 : Show lowest possible price on catalog using custom options

texts:
I am wanting to know the code to show the lowest possible price for an item as per their custom options without having to go into each item and make the lowest custom option price the default as this would be very time consuming for over 10,000 items.

eg. if an item has 2 custom options with varying prices then I want the calculation of the lowest price off the base or default price.

An example of this would be for smaller size but the smaller size is not the default option.

See here for understanding of product pricing. https://gilletts.com.au/a14064

base price = $2024
custom option 1 default =  Size T $0
custom option 2 default = width 5mm $0

But 2. custom option 1 lowest price is $ -378 for the smallest size.

I want the code to show the lowest price from the 2 lowest custom options.  so the price to show in catalog would be "from $1186"

**This is code for catalog only and not product page on CE1.9

Thanks in advance.


texts:
I'm strugling with disabling the cache for an individual block in Magento 1.9. I've enabled the "HTML Blocks" in cache management and the site is much faster although I have a static block on the product page that stays the same when it should refresh depending on the supplier of the product.

The Static block is called block_product_secondary_bottom and in that block is the following:

{{block type="core/template" name="supplier.delivery" template="myphp/delivery.phtml"}}

myphp/delivery.phtml contains the following code - basically it looks up info from a table:

<?php

$product_id = Mage::registry('current_product')->getId();
$attributeValue = Mage::getModel('catalog/product')
                            ->load($product_id)
                            ->getAttributeText('advertiser_name');

$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$query = "Select * from `smashingmagazine_branddirectory_brand` Where `name`='".$attributeValue."'";
$rows = $connection->fetchAll($query);

$output = 0;

foreach ($rows as $values) {
    $name = $attributeValue;
    $about = $values['about_supplier'];
    $discounts = $values['description'];
    $image = $values['url_key'];

}
if (!empty($name)) {
    $output = '
About '.$name.'

';
};

if (!empty($image)) {
    $output.= '

';
};

if (!empty($about)) {
    $output.= '
'.$about.'
';
};

if (!empty($discounts)) {
    $output.= '

'.$discounts.'

';
};

$output.= "
";
echo $output;

I've tried adding the following code into my local.xml, clearing Cache and refreshing - but this doesn't work:

<block name="supplier.delivery" template="myphp/delivery.phtml" type="core/template">
    <action method="unsetData">
        <key>cache_lifetime</key>
    </action>
    <action method="unsetData">
        <key>cache_tags</key>
    </action>
</block>

I wondered if anyone could tell me how I could fix this issue? Either by adding actions to the local.xml or by adding PHP to the .phtml file.


texts: How to create a frontend form and send the form fields data to a database in Magento 2

texts: How can I create a frontend form and save that data in a database in Magento 2?


texts:
I've a personalised board book business called www.bookywooky.ie.

I insisted my web dev co to force customers to create / sign in to an account prior to creating a book so they wouldn't lose any of their work while customising it.

This has turned out to be a huge mistake (based on analytics) and I need to remove it asap.

Can anyone give a step by step account of how to do this? I've looked in 'Customer Configuration under System' but I can't see it.

I'm new-ish to Magento's back end and I can't find how to disable this step. Any advice in plain talk would be appreciated.

Cheers
Ross


texts: All payment methods return a "Payment method not available" error

texts:
I'm programatically creating orders, and having problems on a single site setting the payment method.

Just before setting the method I am logging all available payment methods with:

Mage::log("All avaialable payment methods:" . print_r(Mage::getModel('payment/config')->getActiveMethods(), true), null, 'mycustom.log', true);

I've tried multiple methods that are shown in the log, and all return the error "Payment method not available".  Even things like checkmo and free aren't working (both are shown as active).

Multiple sites are working just fine with exactly the same code.

all countries are allowed, and the payment method is set to all allowed countries, on all levels
no errors in system or exception logs (other than the exception with the mentioned error, being thrown in app/code/core/Mage/Sales/Model/Quote/Payment.php(153) )
the payment method itself is enabled

If the line of code before shows it as active, why might the line setting the method return the error that it's not available?


texts: Where is Category Thumbnail Image Display in Magento Default Set up

texts:
In magento Default Setup when we click on

catalog >> Manage Categories

and go for editing any category then we found "Image" and "Thumbnail Image" File upload button.

When we upload image for "Image" Button that image display in Category Page above product listing.

But when we upload image for "Thumbnail Image" it is not display on category Page.

Where is magento display that Thumbnail Image in default set up. I want to know that.


texts: What is the proper way for unit testing PHP7 code with PHPUnit 4.1 in Magento 2?

texts:
When I'm writing my modules, I'm trying to supply them with unit-tests for the most critical parts of the application. However, there are at the moment (Magento 2.1.3) several ways on how to write unit tests:

Different ways of testing

Integrate it with bin/magento dev:tests:run unit and run it on top of the default phpunit settings bundled with Magento.
Write them separately, run them with vendor/bin/phpunit app/code/Vendor/Module/Test/Unit and mock everything that is Magento.
Write them separately, mock everything and use a system-global version of PHPUnit.
Write them separately, run them with vendor/bin/phpunit, but still make use of \Magento\Framework\TestFramework\Unit\Helper\ObjectManager.

Magento 2 and PHPUnit

Besides that, Magento 2 comes bundled with PHPUnit 4.1.0, which is not PHP7-compatible. Type-hinting natives (like string and `int) and declaring return types in your signatures will throw errors. For example, an interface / class with a method signature like this:

public function foo(string $bar) : bool;

... will not be able to be mocked by PHPUnit 4.1.0. :-(

My current situation

It's due because of this that I'm now mostly writing my unit tests in the third way (by calling a system-global PHPUnit version).

In my setup, I have PHPUnit 5.6 installed globally, so I can solve write proper PHP7-code, but I have to do some tweaks. For example:

phpunit.xml has to look like this so I can make use of the composer autoloader:

<?xml version="1.0"?>
<phpunit bootstrap="../../../../../../vendor/autoload.php"
         colors="true">
    <testsuites>
        <testsuite name="Testsuite">
            <directory>.</directory>
        </testsuite>
    </testsuites>
</phpunit>

...and in all my setUp()-methods, I have the following check so I can write my tests with forward-compatibility:

// Only allow PHPUnit 5.x:
if (version_compare(\PHPUnit_Runner_Version::id(), '5', '<')) {
    $this->markTestSkipped();
}

This way, when my tests are ran by Magentos' built-in PHPUnit, it doesn't throw an error.

My question

So here's my question: is this a 'healthy' way of writing unit tests? Because it doesn't seem right to me that Magento comes bundled with a whole bunch of tools to aid with testing and I can't use them because I'm using PHP7. I know there are tickets on GitHub that address this issue, but I'm wondering how the community is currently writing it's tests.

Is there a way to write unit tests in Magento 2 so I don't have to 'downgrade' my code and still can use Magentos' built-in helpers for mocking everything the object manager touches? Or is it even bad practice to use the object manager even in your unit tests?

I'm missing a lot of guidance / examples in what's the proper way on how to unit test your own custom modules.


texts:
Why does Magento add a .html suffix on the URLs?

I mean without this suffix it is better for SEO.


texts:
I've what seems like it should be a fairly easy fix... in Magento 1.7 CE, I just want to add title attributes to my primary navigation links. I attempted to duplication Navigation.php, as described here: http://seechrisblog.com/2010/05/28/how-to-add-title-attributes-to-magentos-main-nav/, however this has had no effect.

Can anyone tell me how I can override Navigation.php in this version of Magento?

-thanks!


texts: Switching Magento Database to Separate Server Completely Slows Down My Site

texts:
I'm following the guide at http://devdocs.magento.com/guides/v2.1/install-gde/prereq/mysql_remote.html and I completed all the steps which worked but now my website is extremely extremely slow. It went from loading pages in less than 4 seconds to now loading pages in over a minute. I changed the database information back to the local database on my web server and it went back immediately to loading the website in a few seconds.

How can moving the database server to a separate dedicated server make things so slow? Am I missing something?

The Old Database Server

Centos7
24 core processors
Plesk 12.5
48GB Ram for mysql

The New Database Server

Centos7
24 core processors
No Plesk
100GB Ram for mysql

Things I have checked so far

No slow queries or mysql errors when switched over to the new database
Mysql configuration is the same on both servers
Tested on a different system remotely and it performed well using the same configuration for magento with the difference of the mysql server it was pointed to.

UPDATE: Mariadb log is at https://pastebin.com/rvNDh4vW
        Mariadb slow query log is at https://pastebin.com/mVibiHMe


texts: Magento2: How to get shipping address for order in REST API?

texts: I can't seem to find a way to get the shipping address for an order though the REST API. Does anyone have an idea?


texts: How to Bulk Import product video using csv import sheet Magento 2

texts:
I'm trying to import product video using csv import.

Is there a way to import product videos..??

How can i achieve this using import..??

Thanks in Advance.


texts: Magento 1 - How to display static block based on dropdown selection of created attribute?

texts:
I am trying to display a static block based on the selection that has been made when adding a product in the magento backend.

So the situation is, I am adding the product and select a option from a dropdown attribute which has been created. The options are:

-Do not show table
-Show table 1
-Show table 2
and so on...

Static blocks have been created realated to the dropdown options:

-Static block table 1
-Static block table 2
and so on...

I am using the following code in the phtml file which I want to display it:

<?php if
($_product->getAttributeText('tableselect') == "Table 1"): ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('table_1_block')->toHtml() ?>
<?php endif; ?>

Its not working for me, what am i doing wrong here? Please help

Thanks in advance.


texts:
I am using Owebia Shipping extension for Magento 2. I entered a rule in that shipping method which says if the weight is > 0 the shipping will be $5.

This always gave me the "No shipping method available" message in the checkout. So I changed the rule to >= 0 and the $5 were shown.

I checked my products and they all have a weight > 0 in kilogram. I also tried other shipping methods / extensions, it all comes down to the same problem - weight is always 0 in my shop even though the products have a weight assigned.

Any idea what might be the problem here?

Magento 2.2.5


texts: Customize welcome message after registration

texts:
I need to customize the message that is presented to the customer after his registration.
I do not need to change only the message, but I need to show a different text if the user has checked a field in the registration form.


texts: Magento 2 : How to fire custom ajax before add to cart ajax fire in product detail page?

texts:
I have created custom extension and how to fire custom ajax before
 add to cart ajax fire in product detail page from my custom module.
 I don't want to override js in theme level. please suggest any
 solution


texts: import products using fast_simple_import

texts:
Anyone know a stable way to import thousands of products to magento using fast_ simple_import and syncing updates from external POS without relying on SKUs?

Thanks,
Rob


texts: Custom router URL using a string begning with "#" as a variable

texts:
I have a custom router that was built more or less using the method described in this post from Stack Overflow. It works quite well and I haven't had any problems with it until I decided that I wanted to use a variable that started with "#". Before my url structure would be:

mysite.com/gallery/variablehere

What I'm going for now is:

mysite.com/gallery/#variablehere

The problem is that magento is recognizing this as a link to an element with that ID on the page instead of that being the variable. Because of this, it routes to /gallery/index instead of the layout that I want. The function that checks for a match and sets the parameter:

public function match(Zend_Controller_Request_Http $request){
    $urlKey = trim($request->getPathInfo(), '/');
    $check = array();
    $parts = explode('/', $urlKey);
    ....
    ...
    ..
}

Doesn't even seem to get run. Does anyone know a way to get the router to recognize that as a valid variable and not just have it render the index layout automatically? Thanks for any help you might be able to give!


texts: Where is location of "Related Products" and "Cross-sells" collection of function

texts: I am working admin backend module. I want to know location of Related Products and Cross-sells product-collections which open when we add a new product from admin panel.


texts: Magento Admin Panel shows only header with menu?

texts:
When I login to the admin panel, only  header is displaying with menu. All the menu items are visible and every page shows only header section( footer is not showing too).

I checked the log files too..and there is nothing.

Can anyone help me ?


texts: Customer new address attribue not showing up in address book

texts:
I have created a customer address attribute but it is not showing up in front end ( Address Book ) , but it is showing up in admin panel.
I have cleared cache and reindexed the indexes also

Refer the images , I am I doing something wrong here or it is not possible in magento ?


texts: Magento 2 - How to use jQuery in a template?

texts:
I tried to use jQuery in a template (app\code\Black\Newsletter2Go\view\frontend\templates\account\dashboard\info.phtml) but I get jQuery is not defined.

Does Magento 2 not use jQuery?

Do I have to add:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

to the head template?


texts:
I'm having loads of weird issues on Magento CE 1.7.0.2. During normal operations, the site will occasionally produce a Magento Error Page (There has been an error processing your request) on both frontend and backend. Viewing the associated report, I see the following message:

"SQLSTATE[HY000] [2006] MySQL server has gone away"

Sometimes, but more rarely, the report message will read:

 Connection reset by peer

I have looked at the var > log > system.log and the MySQL has gone away error is accompanied by the following:

Warning: PDO::__construct(): MySQL server has gone away  in /var/www/html/domain.com/live/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 129
Error while reading greeting packet. PID=1863  in /var/www/html/domain.com/live/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 129

In addition to this, the following error seems to be happening on every request, as well as the MySQL has gone away errors:

 Warning: include(File.php): failed to open stream: No such file or directory  in /var/www/html/domain.com/live/lib/Varien/Autoload.php on line 93
 Warning: include(): Failed opening 'File.php' for inclusion

I have looked most of the articles I can find about this and tinkered with the database parameters till the cows came home but the error remains.

After following another QnA about the compiler, I notice that the admin page System > Tools > Compilation is completely blank. I think these are all related errors but any insight into debugging or causes would be so helpful.

I apologise if this is incoherent; I've been awake for about 42 hours, so please ask for any clarification. Thank you.

-- update --

My server stack for clarity:

PHP 5.5.4 (PHP-FPM)
Nginx 1.4.2
MySQL 5.5.33

-- update --

It occurs to me (after some sleep) that I never specified - the PHP codebase and the MySQL db are on separate hardware servers - very important to know if ya'll are going to help me!! I apologise.


texts: Magento 2.2.8 - Has Magento removed the Company field from the checkout?

texts:
For customers that have already saved their company information in their addresses, the company name does not show in the checkout.

Has anyone faced this issue before, with recent versions of Magento?
Are there any proposed fixes for this?