texts: Uncaught TypeError in Sales Shipment view

texts:
Running Magento 2.2.9.  After the upgrade from 2.2.8 this has started and I can't seem to figure it out. This happens when you try to view the shipment:
You see the formatted data and then this error:

Fatal error: Uncaught TypeError: Argument 1 passed to
Magento\Framework\DataObject::__construct() must be of the type array,
null given, called in
/var/www/vendor/magento/module-shipping/view/adminhtml/templates/order/packaging/packed.phtml
on line 14 and defined in
/var/www/vendor/magento/framework/DataObject.php:38 Stack trace: #0
/var/www/vendor/magento/module-shipping/view/adminhtml/templates/order/packaging/packed.phtml(14):
Magento\Framework\DataObject->__construct(NULL) #1
/var/www/vendor/magento/framework/View/TemplateEngine/Php.php(59):
include('/var/www/vendor...') #2
/var/www/vendor/magento/framework/View/Element/Template.php(270):
Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Shipping\Block\Adminhtml\Order\Packaging\Interceptor),
'/var/www/vendor...', Array) #3
/var/www/vendor/magento/framework/Interception/Interceptor.php(58):
Magento\Framework\View\Element\Template->fetchView('/var/www/vendor...')
4 /var/www/vendor/magento/framework/Interception/Interceptor.php(138):
Magento\Shipping\Bloc in
/var/www/vendor/magento/framework/DataObject.php on line 38

I'm not sure what's going on. Any help would be great.


texts: Magento2 programmatically adding a custom option

texts:
I'm trying to programmatically add a custom option to a product, there are no errors being returned, but the custom option doesn't get added. I've tried a few methods to achieve this, without much luck.

Here's my code as it stands:

$product = $this->objectManager->get('Magento\Catalog\Model\Product')->load($productID);

$productOption = $this->objectManager->get('Magento\Catalog\Model\Product\Option');
$productOption->setProduct($product);
$productOption->setTitle('Text');
$productOption->setType('area');
$productOption->setIsRequire(1);
$productOption->setValues([
    'title' => 'Text',
    'price' => '1.00',
    'max_characters' => '50',
    'price_type' => 'fixed',
    'sort_order' => '1'
]);
$product->addOption($productOption);
$product->save();

Any ideas what I'm doing wrong?

UPDATE

I've now tried a different method:

$product = $this->objectManager->get('Magento\Catalog\Model\Product')->load($productID);
$product->unsetOptions();
$product->setHasOptions(1);
$product->setCanSaveCustomOptions(true);
$product->getOptionInstance()->addOption([
    'title' => 'Text',
    'type' => 'area',
    'is_require' => 1,
    'values' => [
        [
            'title' => 'Text',
            'price' => '1.00',
            'price_type' => 'fixed',
            'max_characters' => '50'
        ]
    ]
]);

But this gives me the following error:

[Magento\Framework\Validator\Exception] Invalid option value

However, I cannot figure out what's invalid.


texts: How can I prevent Magento from changing permissions of my files after a Backup?

texts: I have a big problem. Everytime I backup my magento store I have to re-set up the permissions for my folders and files. This consumes much time in which my store isn't reachable. Anyone got a solution for this? I only saw changing the permissions via FileZilla ect. but this is sooo time consuming. Thank you for the help.


texts: Multi Select UI Field in user form magento2

texts:
I am showing multiselect dropdown in user form in admin panel(System->All user->Add User)
I have created a plugin for creating field in that form. Here is the code, I am using:

public function aroundGetFormHtml(
    \Magento\User\Block\User\Edit\Tab\Main $subject,
    \Closure $proceed
) {
    $_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $registry = $_objectManager->get('Magento\Framework\Registry');
    $model = $registry->registry('permissions_user');
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $form = $subject->getForm();
    if (is_object($form)) {
            $fieldset = $form->addFieldset('user_attribute_fieldset', ['legend' => __('User Category')]);
            // Gather our existing categories
            $currentCategories = $this->_getExistingCategories($model);
            $fieldset->addField(
                'user_fields',
                'multiselect',
                [
                    'name' => 'user_fields',
                    'label' => __('user fields'),
                    'id' => 'user_fields',
                    'title' => __('user fields'),
                    'value' => $currentCategories,//for selected value
                    'values' => $objectManager->create('{namespace}\{module}\Helper\Data')->getOptions()//for all options
                ]
            );
             $subject->setForm($form);

    }
    return $proceed();
}

Now I want to create this as a Multi Select UI Field, shown below:

how I can implement ui select component in existing magento forms not made with ui components?

Thanks in advance:)


texts: How to add extra attributes specific to a product?

texts:
I am trying to figure out how could I achieve the same structure as: http://catalog.uk.toolstore.com/#/?search=0349-0109

The table below the description varies from product to product and it has different attributes. Some of the attributes (like 'Art. no.' or 'Weight') are always there while others vary from product to product (one product has a 'Bits for hex holes' attribute while another does not).

The question is, how could I add extra attributes, specific to a particular product, so on the product page I could see a list of attributes similar to the one in the example?


texts: Getting user_defined attributes for a product

texts: Is it possible to get all user-defined attributes for a product? Input: product_id, Output: a list of all user_defined attributes, excluding the system_attributes.


texts: Unknown column 'e.category_ids' in field list in product list

texts:
We have an error in product list page, we trying to update product details page we getting the following error.
exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.category_ids' in 'field list'' in

After migrating database Magento 1.9 to Magento 2.0 we did reindex after that we got this above error.


texts: Customer Module not working in local codepool

texts:
I want to make some minor changes in AccountController.php.
So I have copy AccountController.php from
app/code/core/Mage/Customer/controllers/AccountController.php
to
app/code/local/Mage/Customer/controllers/AccountController.php

But it's not working any idea?


texts: Magento2 Base,Small & Thumbnail image is not setting by Programmatically

texts:
I am using below code to set the image as base,small and thumbnail, but it is not working.

$productRepository = $this->_objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface');
$product = $productRepository->get($sku);
$product->addImageToMediaGallery($imagePath, array('image', 'small_image', 'thumbnail'), true, false);

Can anyone suggest, what is wrong with the code


texts: How to get video url in product list page in magento 2?

texts:
I want to get product video url in product list page.I am try below code but its not works for my end

<?php if($_product->getVideo()): ?>`

            <iframe width="560" height="315" src="http://www.youtube.com/embed/<?php echo $_product->getVideo() ?>" frameborder="0" allowfullscreen></iframe>

        <?php endif; ?>


texts:
I want add product_options to API V1/orders in items, how to do this?
please help me! Im a freshman use magento2. have any easy way to do this？


texts: Find what cookies are creating in browser

texts:
we have a domain www.xyz.com 1.9.0 site.

we are facing some problems with cookies.

is magento set 2 types of cookies, one for xyz.com and another for .xyz.com?

I want to know how to check what cookies are creating for site in browser, we are using chrome, firefox and opera browsers.


texts: 503 backend fetch failed common bugfix does not work - path not applicable

texts:
I get the 503 Backend fetch failed error when I try to connect to my Magento backend that is hosted on a AWS Lightsail Instance - 2 GB RAM, 1 vCPU, 60 GB SSD. I found the general tutorial on how to fix it https://devdocs.magento.com/guides/v2.3/config-guide/varnish/tshoot-varnish-503.html, but the path described there does not exist on my instance.

However, I found another tutorial https://community.bitnami.com/t/error-503-backend-fetch-failed-megenta-after-installation-extension/59593 that states it would also work to take the path /opt/bitnami/varnish/scripts/ctl.sh (that applied to my configuration), open the file and add to the VARNISH_OPTIONS parameter string i.e. "-p http_resp_hdr_len=65536". Still, I get the 503 Backend fetch failed error. This seems to be a common problem, I would appreciate any help with it!

I cannot even SSH into my console as the connectivity is so weak (or lost) that I cannot run the bitnami support tool.


texts: Magento2: Remove Category path from product URL is not working for all products

texts:
I have a Magento2 store. I don't want to add the category path into products URLs for that I set “Use Categories Path for Product URLs” as "NO" in magento2 Admin, but It still add the category path in some products, not in all products.
Could you help me?


texts: Display Custom Attribute Of Simple Product Within A Configurable Product

texts:
When selecting product options within a configurable product I want to show some custom attributes of the simple product.

I have created a dropdown attribute called "my_delivery_method" with Two values "Parcel Delivery" and "Pallet Delivery"

I have set up two products;

a small product, with "Parcel delivery"
a large product with "Pallet Delivery"

These are now part of a configurable product. I want to display this attribute under the header (which I have done) but I cannot make them change depending on the option selected. e.g. when someone chooses the small item refresh to show "parcel delivery"

Can someone explain how to make custom attributes for a simple product display depending on the option within a configurable product that is selected?

Many Thanks!


texts: What is the equivalent of request_processors in Magento 2

texts: Anyone know where the equivalent of request_processors is in Magento 2?  In Magento 1 this was used in EE being defined in app/etc/enterprise.xml - it was the starting point for loading FPC content.


texts: Magento 2 : Uncaught Error: Class 'Mage_Customlogo_Helper_Data' not found

texts:
I just installed a new magento theme and I got this error:

  Uncaught Error: Class 'Mage_Customlogo_Helper_Data' not found in /var/www/unilinxx.com/public_html/magento/app/Mage.php:547

So I opened that file.
This is the content:

 public static function helper($name)
 {
    $registryKey = '_helper/' . $name;
    if (!self::registry($registryKey)) {
        $helperClass = self::getConfig()->getHelperClassName($name);
        self::register($registryKey, new $helperClass); // line 547
    }
    return self::registry($registryKey);
 }

I don't know what to do to fix this error.
My theme isn't working until this is fixed.


texts: Move Sign in section under search button

texts:
I have Magento 2.1.4 and I want to remove entirely the top block and move the Sign in and create account links below the search bar.

How can I do that?


texts: Custom Module is not appearing in Admin Panel in Magento 2.2.0

texts:
I am following this article(https://www.mageplaza.com/magento-2-module-development/) and creating a custom module in Magento 2.2.0 but when i reach the step where i have to check my custom module in admin panel

Store >> Advanced >> Advanced i don't see anything there.

Module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
<module name="Connextar_CXMageMods" setup_version="2.0.1" />
</config>

Registration.php

<?php
/**
 * Created by PhpStorm.
 * User: Iftikhar uddin
 * Date: 10/22/2017
 * Time: 8:54 AM
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Connextar_CXMageMods',
    __DIR__
);

Code Directory Stucture is \app\code\Connextar\CXMageMods\


texts: Can someone tell me the file where sort order of "Tagged" pages can be changed. Somehow, my tag pages are ranking better in SEO and I would like to change the sort order of products that are displayed for better user experience.


texts: Redirect to login page triggering even after customer logs in

texts:
I have a CMS page with content that can only be seen by logged in users.
I have an if statement that checks
$this->_sessionFactory->create()->isLoggedIn();

and if they're not logged in, this code gets run
$this->_redirectInterface->redirect($this->_http, 'customer/account/login');

If customers log in first and then try to access the page, they see the content.
If customers don't log in and try to access that page, they're redirected to the login page.
The problem is that once they log in, they still can't access the page. Instead, they're redirected to their account page.
How can I get this to work?
Thanks


texts:
It is not good way to override core class of Magento. But I have to do this because I am in way that class is abstract and method is protected so I think preference and pluginshould not work. I found couple of answers about Override abstract class in Magento 2 and this one but both are not useful for me. So is there any other way to achieve this ? I want to override this class

\Magento\Sales\Model\Order\Pdf\AbstractPdf

Thanks


texts: How to display link of video url in details menu?

texts:
This is seriously basic but I'm having trouble to achieve it.
I need to add some link inside the menu details as you can see in the following image:

There are :

 - Loose fit
 - Refectivity
 - ect...I need to add some link here like videos of youtube or some other link.

I want to create this link in a new column in the table like video_url. so that all product can have this field.

I'm using magento 2.1 fresh installation, with sample data.

Hopefully someone can explain step by step to do this. Programmatically


texts: Magento 1 - Create own adminhtml theme (to override templates from adminhtml)

texts:
I need to override the file app\design\adminhtml\default\default\template\catalog\product\edit\options\option.phtml.

What steps are required?


texts: Access mage.php magento using soap client

texts: I am trying to access some functions in mage.php magento using soap client because i'm working in two different servers how can i do that.


texts: Hosted Credit Card Options for Admin and Frontend

texts:
I'm searching for a hosted 3rd party credit card entry form (iframe) that works on both the admin order management screen and the frontend checkout. Something similar to how the payment bridge works in Enterprise Edition.

I reviewed the hosted page options "Paypal Payflow Link" and "PayPal Advanced Payments", but they only work on the frontend checkout.

Is there a hosted PCI Compliant credit card entry form that works in both areas? Or are there full service companies that host the Enterprise Payment Bridge that a merchant can connect to for processing?


texts: Magento 2 : Rest Api for get customer id with token number

texts:
I need customer id and token number when login customer account in Magento2
I used this API for customer login:

  Method: Post  rest/V1/integration/customer/token

Body

{
"username" : "abc@gmail.com",
"password" : "abc12345!";
}


texts: I am trying to add a video on banner of my home page but the video doesn't appear, it shows a message no video with supported format. I uploaded a mp4 format and mov format but it shows the same message .. I added the video with a block on home page. what should I do to get it to work properly


texts:
Magento 2.3,  VPS hosting. I want to ask the question about this website https://www.marketplace.jawadditaksal.org

when the order comes, the customer receives the email very late after two hours,
and admin even not receive the email after order. Even I set the SMTP settings. What other setting required for this.

and also how to change the display name of the email when the customer receives the email.

please look at the screenshot of admin panel:
https://ibb.co/zVGtFMG
https://ibb.co/THzZn7P
https://ibb.co/3yjXpLC


texts:
i have this code:

if(isset($_FILES['featured_image']['name']) and (file_exists($_FILES['featured_image']['tmp_name']))) {
   try {
      $uploader = new Varien_File_Uploader('featured_image');
      $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
      $uploader->setAllowRenameFiles(false);

      // setAllowRenameFiles(true) -> move your file in a folder the magento way
      // setAllowRenameFiles(true) -> move your file directly in the $path folder
      $uploader->setFilesDispersion(false);

      $path = Mage::getBaseDir('media') . DS ;

      $uploader->save($path, $_FILES['featured_image']['name']);

      $data['featured_image'] = $_FILES['featured_image']['name'];
   }catch(Exception $e) {

   }
}

// handle delete image
else {
   if(isset($data['featured_image']['delete']) && $data['featured_image']['delete'] == 1)
      $data['image_main'] = '';
   else
      unset($data['featured_image']);
}

i want change this line

$path = Mage::getBaseDir('media') . DS ;

and how can i change media directory to media/blogpic

i will thankful if you experts answer this


texts:
How to use for loop in phtml page i want to use the for loop in phtml page to complete my functionality

<php?
    for(i=1;1<=3;i++):

    //My code

endfor:

?>

I used as above code.


texts: Magento 2.3 - Create Category from Backend getting error - Fatal error: Uncaught Error: Call to a member function setActive()

texts:
After creating a Custom theme(Parent Theme Blank) whenever add a new category from the backend getting following error,
Fatal error: Uncaught Error: Call to a member function setActive() on bool in C:\xampp\htdocs\mage\vendor\magento\module-backend\Model\View\Result\Page.php:27
Stack trace:
#0 C:\xampp\htdocs\mage\generated\code\Magento\Backend\Model\View\Result\Page\Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Catalog...')
#1 C:\xampp\htdocs\mage\vendor\magento\module-catalog\Controller\Adminhtml\Category\Add.php(81): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Catalog...')
#2 C:\xampp\htdocs\mage\vendor\magento\framework\App\Action\Action.php(108): Magento\Catalog\Controller\Adminhtml\Category\Add->execute()
#3 C:\xampp\htdocs\mage\vendor\magento\module-backend\App\AbstractAction.php(231): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#4 C:\xampp\htdocs\mage\vendor\magento\framework\App\FrontController.php(159): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#5 C:\xampp\htdocs\mage\ve in C:\xampp\htdocs\mage\vendor\magento\module-backend\Model\View\Result\Page.php on line 27

How to solve this?
Note: If i run di:compile temporarily okay, then try to add a category again getting the same error.


texts: CPanel detects Default Magento files as virus

texts:
We are facing an issue. Where Cpanel is detecting certain files as virus and blocking the site. The files detected as virus are:

/home/mysite/public_html/lib/Mage/Archive/Bz.php
/home/mysite/public_html/lib/Varien/Event/Observer/Collection.php
/home/mysite/public_html/lib/Zend/Measure/Illumination.php
/home/mysite/public_html/lib/Zend/View/Helper/Translate.php

We have currently changed back the permission of these files and site is up and working. We had done this thrice in past two days. Is it a template issue or issue from hosting end and what can be possible solution. Please guide.


texts: Magento 2 : call product assigned attribute info in static block

texts:
I have a static block position in my product detail page.
what i want to do is call the content inside more information tab data of attributes to show in that static block.
any help would be great
waiting for your replies
this is magento2 i am referring to

explanation if this helps - i am trying to move this data of attributes info http://awesomescreenshot.com/0b2639uq25 to a static block on product view page , static block already exists just need to call this tab information in static block


texts: How can I program a common URL for AW blog extension?

texts:
I'm using tje AheadWorks blog extension and the URL for a post when linked from the main blog page vs a category page is different.

For example, from the main blog page:

domain.com/blog/blog-post-title

From a category page:

domain.com/blog/cat/category-name/blog-post-title

This obviously creates duplicate content issues.

I would like to force all URLs to be the same as from the main blog page, i.e.

domain.com/blog/blog-post-title

I don't know enough about Magento to try any options, otherwise I would have posted what I've already done.

Any advise would be appreciated.


texts:
How to add Header links to category section?
i have some header links like new category , Brand , Contact Us. i have to show this header links in Main category section also.


texts: How to catch exeption in unit test and check it

texts:
I have a model class, that throw exception if some value is null.
How I can test, that it condition is ok.

 $contact = $this->contactFactory->create()
            ->setEmail('testdelete@test.com')
            ->setFirstname('Pasha')
            ->setLastname('Doe')
            ->setPhone(1236547);
 $this->contactRepository->save($contact); //exception is here


texts: Magento 2.3.4: Not able to search admin grids

texts:
Recently upgraded from 2.3.1 to 2.3.4-p2 and now we're not able to use the keyword search above admin grids like Catalog > Products, Sales > Orders, etc.
We can still use the filter boxes, but the keyword search is not working and receive the following console errors:

Uncaught ReferenceError: focused is not defined

We've tried running the following but still does not work:
bin/magento s:d:c
bin/magento s:s:d -f
bin/magento i:rei
bin/magento c:f

Any ideas what else this could be?


texts: How to create expiry date attribute without time in Magento1?

texts: I have created an expiry_date attribute in Magento admin.I have display expiry_date in sales order in admin.It is successfully displayed.But I have a problem with time.My requirement is the only date will display without time.Please check my screenshot.https://prnt.sc/hgngyb.Can you please help me?


texts: Custom customer attribute not being created

texts:
I have written the following script to create a custom customer attribute in Magento 2.2.3. When I run setup:upgrade magento tells me data was installed but the attribute does not appear in eav_attribute table.

<?php

namespace MyNameSpace\StoreName\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Config;
use Magento\Customer\Model\Customer;

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory, Config $eavConfig)
    {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig       = $eavConfig;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
        \Magento\Customer\Model\Customer::ENTITY,
        'store_real_name',
            [
            'type'         => 'varchar',
            'label'        => 'Store Name',
            'input'        => 'text',
            'required'     => false,
            'visible'      => true,
            'user_defined' => true,
            'position'     => 999,
            'system'       => 0,
            ]
        );
        $storeName = $this->eavConfig->getAttribute(Customer::ENTITY, 'store_real_name');

        $storeName->setData(
        'used_in_forms',
        ['adminhtml_customer', 'customer_account_edit']

        );
        $storeName->save();
    }
}

I have used an identical script to create other attributes without issue, but for some reason this one won't save. I have tried to disable and enable the module and re-run setup:upgrade but nothing seems to work.


texts: how i set the checkout cart xml file in magento 2?

texts:
This is my code in magento1

<checkout_cart_index translate="label">
    <label>Shopping Cart</label>
    <remove name="right"/>
    <remove name="left"/>
        <reference name="root">
                <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
    <reference name="checkout.cart">
        <action method="addItemRender">
            <type>simple</type>
            <block>checkout/cart_item_renderer</block>
            <template>designtool/checkout/cart/item/default.phtml</template>
        </action>
    </reference>

</checkout_cart_index>

<checkout_onepage_review translate="label">
    <reference name="root">
        <action method="addItemRender">
            <type>simple</type>
            <block>checkout/cart_item_renderer</block>
            <template>designtool/checkout/onepage/review/item.phtml</template>
        </action>
    </reference>
</checkout_onepage_review>

<sales_order_view translate="label">
    <reference name="my.account.wrapper">
        <block type="sales/order_view" name="sales.order.view">
            <block type="sales/order_items" name="order_items" template="sales/order/items.phtml">
                <action method="addItemRender"><type>default</type><block>sales/order_item_renderer_default</block><template>designtool/sales/order/items/renderer/default.phtml</template></action>
                <action method="addItemRender"><type>grouped</type><block>sales/order_item_renderer_grouped</block><template>designtool/sales/order/items/renderer/default.phtml</template></action>
            </block>
        </block>
    </reference>
</sales_order_view>

<!--<sales_email_order_items>
    <reference name="items">
        <action method="setTemplate">
            <template>designtool/email/order/items/order/default.phtml</template>
        </action>
    </reference>
</sales_email_order_items>-->

how can I set this xml file in magento 2?


texts: Magento 2: Product Attributes Option unable to use &

texts:
I am unable to use "&" in option of product attributes. Below is attached screenshot.

If we add & to Default Store View   or Admin it get auto removed on save, is there any fix it ?


texts: Magento2 : Cron script readiness check failed

texts:
I am trying to install the extensions and I am getting following errors. I have already set the crontab as well.

Check Cron Scripts

Cron script readiness check failed. Hide detail

Error from Updater Application Cron Script:

Found non-writable path(s):

/opt/lampp/htdocs/magento2/generated/code/Magento/Analytics/Controller
/opt/lampp/htdocs/magento2/generated/code/Magento/Analytics/Controller/Adminhtml
/opt/lampp/htdocs/magento2/generated/code/Magento/Analytics/Controller/Adminhtml/Reports
/opt/lampp/htdocs/magento2/generated/code/Magento/Analytics/Controller/Adminhtml/Reports/Show
/opt/lampp/htdocs/magento2/generated/code/Magento/Analytics/Controller/Adminhtml/Reports/Show/Interceptor.php

For additional assistance, see cron scripts help.

How can be solved this?


texts: Magento 2.3.5 Product Search Error: Something went wrong with processing the default view and we have restored the filter to its original state

texts:
I have tried to search a product in common search field of Product list in admin panel, but it throws error message like 'Something went wrong with processing the default view and we have restored the filter to its original state' in Magento Admin. I've analysed the solution for this issue and found only temporary fix as 'Empty/Truncate ui_bookmark' table. I have tried this, actually it worked but not as permanent fix.
In future, if user search any string and face the same error, how can we prevent this issue? Please suggest a permanent fix to resolve or prevent from occurring this issue.
Please see the screenshot below.


texts: How to hide menu 'Credit Memos' in sale order page, Magento 2

texts:
Using Magento 2.2, admin page. I need to hide menu 'Credit Memos'  in order page of status 'Pending'.

Thanks


texts: I have installed Magento CE on my private server, dont know how to setup email

texts: I have installed Magento on herbrishi.life  how can I send and retrieve automatic email from my email address info@herbrishi.life which I got from gsuit.


texts:
For some purpose (something like popup) I'm trying to fetch cart details in minicart.phtml from Magento2\vendor\magento\module-checkout\view\frontend\templates\cart\minicart.phtml.

I directly modified core file just for checking purpose only. The point is cart details (from below code) are displaying only in cart page. It is not displaying in other pages like home page, product, category pages.I'm using default Magento EE 2.2.5 Luma theme. Any suggestion will be appreciated...

Below is my code (It's dirty, just for checking purpose),

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

// get quote items collection
$itemsCollection = $cart->getQuote()->getItemsCollection();

// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();

// get quote items array
$items = $cart->getQuote()->getAllItems();

foreach($items as $item) {
    echo 'ID: '.$item->getProductId().'
';
    echo 'Name: '.$item->getName().'
';
    echo 'Sku: '.$item->getSku().'
';
    echo 'Quantity: '.$item->getQty().'
';
    echo 'Price: '.$item->getPrice().'
';
    echo "
";
}

I tried with block also through the constructor (like proper way) magento2ee\vendor\magento\module-checkout\Block\Onepage.php But same like working only in cart page. Not in other pages..

Update:

I'm just wondering below piece of code for fetching product details is working but not for cart.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
/** Apply filters here */
$collection = $productCollection->addAttributeToSelect('*')
            ->load();

foreach ($collection as $product){
     echo 'Name  =  '.$product->getName().'
';
     break;
}


texts: Is the session table supposed to be cleaned up automatically?

texts:
So we have a 20 Mio rows, 20 GB size session table.

Is this supposed to be cleaned up automatically and that is a bug in our customization or is this a feature?

I will run

DELETE FROM session WHERE session_expires < UNIX_TIMESTAMP();

DELETE FROM session WHERE session_expires < UNIX_TIMESTAMP() - max_live_time_goes_here;

now and see how long it takes

EDIT: Warning this query is dangerous .. session_expires needs to add the max live time.


texts: In ui-select how to select all child and sub-child categories when parent category is clicked?

texts:
I have a field with ui-select for categories in my custom form.

I have this piece of code in ui_component form for generating the ui-select

  <field name="categories">
            <argument name="data" xsi:type="array">
                 <item name="options" xsi:type="object">Magento\Catalog\Ui\Component\Product\Form\Categories\Options</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Categories</item>
                    <item name="componentType" xsi:type="string">field</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                    <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                    <item name="dataScope" xsi:type="string">categories</item>
                    <item name="filterOptions" xsi:type="boolean">true</item>
                    <item name="showCheckbox" xsi:type="boolean">true</item>
                    <item name="disableLabel" xsi:type="boolean">true</item>
                    <item name="chipsEnabled" xsi:type="boolean">true</item>
                    <item name="multiple" xsi:type="boolean">true</item>
                    <item name="levelsVisibility" xsi:type="number">1</item>
                    <item name="sortOrder" xsi:type="number">50</item>
                     <item name="tooltip" xsi:type="array">
                        <item name="description" xsi:type="string">Select the categories.</item>
                    </item>
                    <item name="required" xsi:type="boolean">true</item>

                </item>
            </argument>
        </field>

Which gives the the ui-select field with categories loaded in tree view.

The problem i am facing is,

example::

when i select gear parent, the child categories are not auto selected by default.

How do i do this? ie. Auto select all child categories when parent category is selected, and uncheck all when parent category is unchecked. I need this in backend form.
Any suggestion is helpful.


texts: M2E sycn & Debug/Test (Xdebug/Local enviroment)

texts:
I need to debug the process that sync data from Magento to Ebay/Amazon in order to do some customization in the code.

In particular the aim is to change the way shipping tax are calculated in the imported order anyway the main point here is how to debug/trace the entire process and found code entry point.

There is already a similar question but doesn't contains the info that I need, any way it has some info you may be interested to understand better the scenario in case you are facing a similar challenge :
How to test/debug Ess_M2ePro Amazon integration?

So question is how can I trace the process using Xdebug on my local environment ?


texts: nginx stopping people from hacking our admin url

texts:
We use nginx and in an effort to stop all thos IP's trying to find our secret admin url we wanted to add a nginx location rule:

Looking in location
Where the first directory/folder contains the word admin (or others)
followed by anything after that
but not excluding /xxxx/adminhtml/ where the word admin is found in the second folder or route

Our code so far

Drop people trying to access admin
location ~* /.*admin.*\/.*/ {
  return 444;
}

or maybe

location ~* /.*admin[^\/]*\/.*/ {
  return 444;
}


texts: Magento default zoom for product image is not working properly

texts:
I'm using Magento 2.2.3. The issue I'm facing is that the default zoom functionality is not working properly in the Product Image.

Here's the link to our development site:

http://37.152.57.114/min-bok-om-faglar

Please check the above product, when you double-click the product image, the zoom functionality is not working for some pages. For example, the zoom is working for the first page for the above-said product but the zoom is not working for other pages for the same product when you double click on the product image.

Could you please help me to resolve this issue?

Looking for your suggestion.

Regards,


texts: Magento customer login and admin login session/cookie issue

texts:
I know this questions asked many times but solutions were used for some people not all.
I am running Magento 1.9.2.4 community version. We are facing an issue like whenever the customer tries to log in, it's redirecting to the same page. This same issue happening for admin login also. If I do it in incognito mode in the browser then some time works but not all the time.

I have tried with following settings,

Our main domain is, for example, is mydomain.com and we are running different subdomain like abc.mydomain.com bcd.mydomain.com etc. I did below settings for my all domains with respective domain names but it not helped.
Setting cookie domain and path in admin backend at System > Configuration > Web > Cookie and Session Management

Cookie Life Time: 3600
Cookie Path: /
Cookie Domain : abc.mydomain.com
Use HTTP Only : YES
Cookie Restriction Mode: No
My session storage option is file system
Clearing browser cookies all the time to just login is not working out.
when I see the view page source for my webpage I got following code which is set by Magento default

Mage.Cookies.path     = '/';
Mage.Cookies.domain   = '.abc.mydomain.com';

why magento setting domain name is ".abc.homestudio.com" because we have set in backend domain name as "abc.mydomain.com"?

I'd very much appreciate some feedback.


texts:
I'm following the MagentoU course of basic development(full of errors...) and in some point I must create a controller that allows acces only if the GET parameter secret is set.

I configure the etc/adminhtml/routes.xml as follows:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="test" frontName="test">
            <module name="Training_Test" before="Magento_Adminhtml" />
        </route>
    </router>
</config>

And then make the controller Controller\Adminhtml\Action\Index.php

<?php
namespace Training\Test\Controller\Adminhtml\Action;

class Index extends \Magento\Framework\App\Action\Action
{
    public function execute()
    {
        $content = $this->getRequest()->getParam('content');
        $this->getResponse()->appendBody($content);
    }

    protected function _isAllowed()
    {
        $secret = $this->getRequest()->getParam('secret');
        return isset($secret);
    }
}

The thing is, when I call the controller with base_url/admin/test/action/index/content/hello it prints hello on the screen without check the _isAllowed() function.

I'm missing something?


texts: Magento 2 - How Can I Send Success and Error in JSON and from Frontend update product price and enable/'disable?

texts:
Ajax runs on page load i want to run it on button click.
I create one Module and make a custom tab which is display some product with name and price and if the product is enable/disable.
I want that user update that price from front-end and enable and disable that product from front-end.[![enter image description here][1]][1]
This is my Controller File
<?php
namespace Deal\Val\Controller\Valuation;

use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\App\Action\Context;
use Magento\Catalog\Model\Product\Attribute\Source\Status;
use Magento\Catalog\Model\ResourceModel\Product\Action;

class Index extends \Magento\Framework\App\Action\Action
{
protected $customerSession;
protected $urlInterface;
protected $customer;
private $productAction;

public function __construct(
    Action $productAction,
    \Magento\Customer\Model\Session $customerSession,
    \Magento\Framework\UrlInterface $urlInterface,
    \Dealers\Validation\Model\Customer $customer,
    \Magento\Framework\App\Action\Context $context
) {
    $this->urlInterface = $urlInterface;
    $this->customerSession = $customerSession;
    $this->customer = $customer;
    $this->productAction = $productAction;
    parent::__construct($context);
}

public function execute()
{
    if(!$this->customerSession->isLoggedIn()) {
        $this->messageManager->addErrorMessage("You must be logged in to view product");
        $this->customerSession->setAfterAuthUrl($this->urlInterface->getCurrentUrl());
        $this->customerSession->authenticate();
        return;
    }
    /*$data = $this->getRequest()->getPost();
    $this->customer->saveproduct($data);*/
    $productIds = [47];

    $storeId = 0;

    $attributes = [
        //'status' => Status::STATUS_ENABLED,
        'price' => 70
    ];

    $this->productAction->updateAttributes($productIds, $attributes, $storeId);
    $this->_view->loadLayout();
    $this->_view->renderLayout();
}
}

This is my Model File
<?php
namespace Deal\Val\Model;

use Magento\Catalog\Model\Product\Attribute\Source\Status;
use Magento\Catalog\Model\ResourceModel\Product\Action;

 class Customer
{
/**
 * @var Action
 */
private $productAction;

public function __construct(
    Action $productAction
) {
    $this->productAction = $productAction;
}

public function execute()
{
    /** Array of product ids */
    $productIds = [47];

    /** Contains the id of the store in which you would like to enable/disable the product */
    $storeId = 0;

    /**
     * You can put any number of product attributes here. However, in the scope of this code we are going to
     * only enable/disable the product.
     */
    $attributes = [
        'status' => Status::STATUS_ENABLED
    ];

    $this->productAction->updateAttributes($productIds, $attributes, $storeId);
}
}

This is my JS file
require(["jquery"],function($) {
$(document).ready(function() {

    $( "#price" ).click(function() {
        let customurl = "<?php echo $this->getUrl().'customer/valuation/index'?>";
        let dataid = $(this).data('id');
        $.ajax({
            url: customurl,
            type: 'POST',
            dataType: 'json',
            data: {
                dataid: dataid
            },
            complete: function(response) {
                console.log(response);
            },
        });
    });

});
console.log('aa');
});

How can i send response success or error in JSON format.


texts: Magento add Image Slider getting unserialize(): Error

texts:
I have tried to add Image Slider into my home page using following the steps using the following link
https://magenticians.com/customize-homepage-magento-2-add-image-slider/

When I clicked save after configuring the things, I an gettting an error

Notice: unserialize(): Error at offset 0 of 1208 bytes in C:\xampp\htdocs\magento\app\code\Ves\Productlist\Model\Magento\Widget\Instance.php on line 35

Please llok instance.php code below

class Instance extends \Magento\Widget\Model\Widget\Instance
{
    /**
     * Getter
     * Unserialize if serialized string setted
     *
     * @return array
     */
    public function getWidgetParameters()
    {

        if (is_string($this->getData('widget_parameters'))) {
            $params = unserialize($this->getData('widget_parameters'));

            $field_pattern = ["pretext","pretext_html","shortcode","html","raw_html","content","tabs","latestmod_desc","custom_css","block_params"];
            $widget_types = ["Ves\BaseWidget\Block\Widget\Accordionbg"];

            $is_custom_params = false;

            foreach ($params as $k => $v) {
                if(0 < strpos($k, 'class') || 0 < strpos($k, 'Class')) {
                    continue;
                }
                if(is_array($params[$k]) || !$this->isBase64Encoded($params[$k])) {
                    if(in_array($k, $field_pattern) || preg_match("/^tabs(.*)/", $k) || preg_match("/^content_(.*)/", $k) || (preg_match("/^header_(.*)/", $k) && in_array($type, $widget_types))) {
                        if(is_array($params[$k])){
                            $params[$k] = base64_encode(serialize($params[$k]));
                        }elseif(!$this->isBase64Encoded($params[$k])){
                            $params[$k] = base64_encode($params[$k]);
                        }
                        $is_custom_params = true;
                    }
                }

            }
            if($is_custom_params) {
                $this->setData('widget_parameters', $params);
            }

        }

        return parent::getWidgetParameters();
    }
    public function isBase64Encoded($data) {
        if(base64_encode(base64_decode($data)) === $data){
            return true;
        }
        return false;
    }
}

I am new to Magento. Kindly help me to resolve this issue.


texts: upload multiple files with Varien_File_Uploader

texts:
This question is related to my previous question where I'd created a tab form in admin using a template file. The content of template file is:

Images

                        <input type="file" name="images[]"/>

                        Remove

            <input type="button" class="add" value="Add Image"/>

for uploading multiple files.

But as my input type name is images[] that's why in my controller's saveAction() I'm unable to upload file using Varien_File_Uploader as:

$uploader = new Varien_File_Uploader('images');

what value should I pass in Varien_File_Uploader constructor in order to be able to upload file?

Update
I tried logging and found this warning:

  Warning: file_exists() expects parameter 1 to be a valid path, array given  in /var/www/mageqb/lib/Varien/File/Uploader.php on line 150

Code in my controller is:

foreach ($_FILES['images']['name'] as $key => $image) {
    Mage::log('looping');
    if (empty($image)) {
        Mage::log('continue');
        continue;
    }
    try {
        Mage::log('uploading');
        $uploader = new Varien_File_Uploader('images');

        // Any extention would work
        $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
        $uploader->setAllowRenameFiles(true);

        $uploader->setFilesDispersion(false);

        $path = Mage::getBaseDir('media') . DS . 'authors' . DS;
        $img = $uploader->save($path, $_FILES['images']['name'][$key]);
        Mage::log($img['file']);
    } catch (Exception $e) {
        echo $e->getMessage();
        Mage::log($e->getMessage());
    }
}


texts:
I have a web in a server, but I want update magento. To update I want copy the original magento in localhost, but I am having problems by redirect.

I explain my process:

I downloaded all content magento in my server.
I upload to my server in localhost all content.
I create in /etc/apache/sites-available a file to run my web.
I comprobe that it ran (with an error but ran).
I copy my sql script and run the script in my local database.
When I load my web in localhost it redirect to original magento.

I think that exists something in database that redirect my localhost to original because if I don't import the database, It redirect me well. But I don´t know that is the problem.


texts:
I have some issues with saving products on back-end, esp on the images. The issues occur right after I have enabled Redis. On front-end, however, Redis is working well.

Is it possible to enable Redis only on front-end and disable it on Admin?


texts: How to add condition in add-to-cart button function? Magento 1.9

texts:
How to Add PHP script in add-to-cart function like if other products are trying to add add-to-cart, supposed selected id based products[restricted products] already available in add-to-cart here restrict and show message like not allowed to add-to-cart, please purchase alone, if already some other products available in cart condition like you need to purchase this product alone.

Using Magento add-to-cart button Function how to achieve my above condition?


texts: Can not display products of a category in the frontend.


texts: Magento 1.7 + Apache + 2GB RAM super slow with new theme

texts:
We have a low traffic Magento 1.7 on a 2GB RAM VPS, and when we changed to a new theme (a SNS theme) the CPU to 100% usage almost all the time, even with very little traffic, and the site is almost unusable.

On a development server we had no problem, and when we rollback to the previous theme (quite outdated) there is no problem, but with this theme/server it's very bad.

We changed the  part to only 15 servers/maxclients because with the default (8-50) we had downtime when the traffic was up. That change, suggested by this StackOverflow post was good because we don't have downtime anymore, but the server still is very slow (like 10sec-40sec each call slow).

I know 2GB of RAM is very low, but that's the server we got and we can't do anything about it. We can't upgrade Magento either :(

Would you give us any suggestion?

Here is a gist with httpd conf files and htaccess

Versions

Magento version: 1.7.0.2
Apache version: Apache/2.2.15 (Unix)
PHP version: 5.3.26 (cli)
MySql version: 5.5.31-log

System Info

Processor   : AMD Opteron(tm) Processor 4332 HE
CPU Cores   : 2
Frequency   : 3000.112 MHz
Memory      : 1998 MB
Swap        : 1953 MB
OS      : CentOS release 6.4 (Final)
Arch        : x86_64 (64 Bit)
Kernel      : 2.6.32-358.11.1.el6.x86_64


texts: Add to Cart overlapping Product Price - How to fix? (Magento Product List Widget)

texts:
This is regarding a default MAGENTO WIDGET -
"Add to Cart" is overlapping price.

I edited Styles.css, but it only changed Category Page Product Positioning.

Need to know which file to edit to change Positioning of the "Add to Cart"

More information: I added the widget through CMS -> Widgets and put it on the homepage.
The CSS and how products look for Category pages are perfect, and don't seem to be related to the Widget Product grid.

CSS of the Widget found, but did not find "Add to Cart" positioning:

  /skin/frontend/base/default/css -> Widget.css
  /* Widget: Catalog New Products List */

    .widget-new-products { display:block; }

    .col-main .widget-new-products { margin:7px 0; }

    .widget-new-products .products-grid .product-image,

    .widget-new-products .products-list .product-image { width:85px; height:200px; }

    .widget-new-products .products-list .product-shop { margin-left:100px; }

    .sidebar .widget-new-products .block { font-size:11px; line-height:1.25; }

    .sidebar .widget-new-products .block-title strong { background:url(../images/widgets
    /i_widget-new.gif) 0 1px no-repeat; padding-left:21px; color:#dc5033; }

How do I move the Add to Cart to stay inside the product box, and set the box to be a specific height (all 1 size)?(and remove "Add to Compare")

This is specific to the homepage Magento New Products List Widget - style.css doesn't seem to be changing the widget products
 (Website)


texts:
I am trying to check out through paypal, I have put all the details in the paypal configuration in magento like username password etc.

The issue is when i login through paypal and then click continue when checking out i am getting following error, Here is sc shot.

https://prnt.sc/mkjvxd

Edit: I am using paypal sandbox account configuration


texts: Magento 2 why always need to run static content deploy every after upgrade?

texts:
I'm using Magento 2.2.6 version, I already set to developer mode, but when I ran setup:upgrade, and when I open my Magento project the css and js not loaded.
 But after I ran setup:static-content:deploy -f ,it backs to normal.


texts:
I need to export sales/order list from magento to an external DB.
I use this:

    Mage::app()->getStore()->setId(20);
    $orders = Mage::getModel('sales/order')
        ->getCollection()

I used print_r($orders->getData());  to see all the fields that I need to export but in this list there aren't all the fields that magento show me in the admin panel.
where/how  can I find them ?


texts:
i have default.xml in frontend.

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Addon_Faq::css/faq.css"/>
        <link src="Addon_Faq::css/bootstrap.min.css"/>
    </head>
</page>

when i load page notthing result.  In system.log  show:

[2015-10-23 10:33:37] main.INFO: Theme layout update file 'C:/localhost/magento_beta/app/code/Addon/Faq/view/frontend/layout/default.xml' is not valid.
Input is not proper UTF-8, indicate encoding !

everyone can help.


texts: Magento 2 Facebook Product Feed script in CSV format

texts:
I am looking for script to run on Magento root which will dynamically generate csv file for facebook product feed.

if anyone have generated script please help me.


texts: how to move switch store to header on magento 2.3

texts:
I created a child for the luma theme and created  multi store for change language.
how to move store switcher from footer to a header ( i am using magento 2.3)


texts:
How to apply loader script to my code,
Loader : https://meetanshi.com/blog/magento-2-show-loader-till-ajax-call-not-completed/
My code:
define([
    'jquery',
    'Magento_Customer/js/model/authentication-popup',
    'Magento_Customer/js/customer-data',
    'Magento_Ui/js/modal/alert',
    'Magento_Ui/js/modal/confirm',
    'underscore',
    'jquery/ui',
    'mage/decorate',
    'mage/collapsible',
    'mage/cookies'
], function ($, authenticationPopup, customerData, alert, confirm, _) {
    'use strict';
    return function (widget) {

        $.widget('mage.sidebar', widget, {

            _updateItemQty: function (elem) {
                var itemId = elem.data('cart-item');

                var btnplus = elem.data('btn-plus');
                var btnminus = elem.data('btn-minus');

                this._ajax(this.options.url.update, {
                    'item_id': itemId,
                    'item_qty': $('#cart-item-' + itemId + '-qty').val(),
                    'item_btn_plus': btnplus,
                    'item_btn_minus': btnminus
                }, elem, this._updateItemQtyAfter);
                this._customerData();
            },

            /**
             * Update content after update qty
             *
             * @param {HTMLElement} elem
             */
            _updateItemQtyAfter: function (elem) {
                var productData = this._getProductById(Number(elem.data('cart-item')));

                if (!_.isUndefined(productData)) {
                    $(document).trigger('ajax:updateCartItemQty');

                    if (window.location.href === this.shoppingCartUrl) {
                        window.location.reload(false);
                    }
                }
                this._hideItemButton(elem);
            },

            _customerData : function ()  {
                var sections = ['cart'];
                customerData.invalidate(sections);
                customerData.reload(sections, true);
            }

        });

        return $.mage.sidebar;

    }

});

How to apply the loader?


texts: Readiness Check gives Found non-writable path(s): /home/USER/DOCROOT/php.ini.sample

texts:
Want to update Magento 2.1.1. to new 2.1.2. for security

Readiness check gives:

  Check Cron Scripts Cron script readiness check failed. Hide detail

  Error from Updater Application Cron Script:

  Found non-writable path(s): /home/USER/DOCROOT/php.ini.sample

  For additional assistance, see cron scripts help.

But when I check php.ini.sample doesn't exist

Nowhere really good to find this answer

Who knows and can help?

Thanks


texts: How I can Get Best Seller Products also all catalog products in grid Magento2.3.3?

texts:
I want to Get bestseller report in Product first show all filter getting then rest of it in grid.

I want in magento2.3.x version in. Any one have idea? Thanks in advance!!


texts: Magento 2 - JS to fire once checkout page has fully loaded

texts:
I have the following if statement where I want to check to see whether the postcode input is empty however it fires before the input is loaded on the page and was wondering whether anyone could please advise on how to do this?

I have the following js file that I load to the checkout page:

define([
    'jquery',
],function($){
    $(document).ready(function (){

    //check if postcode is empty
        if( !$('input[name="postcode"]').val() ) {
            $('#checkout-step-shipping_method .no-quotes-block').html('Sorry, no shipping quotes are available for this order at this time. Please ensure you have filled out your shipping details above.');
        }

    });
});

How I can ensure that the code in ran once the page has been loaded?


texts:
Cant drag back product Attribute to unassigned attribute in Magento 2.2

I am not removing a default attribute, its created by me Manufacturer.


texts: magento 2 get credit card full name based on 'cc_type' code

texts:
Inside of my payment class in

public function capture(\Magento\Payment\Model\InfoInterface $payment)

object $payment has method $payment->getCcType() which returns short code 'VI' or 'AE'for example. And I need to get full name of credit card brand, which $payment doesn't has (I've looked at realization of InfoInterface - there is nothing about it).
The name should match one of this list AMEX, DISCOVER, DINERSCLUB, VISA, MASTERCARD, JCB, UNIONPAY, VOYAGER, CARTEBLEUE, DANKORT, MAESTRO, VPAY, VISAELECTRON, TOKEN, VISADELTADEBIT, MASTERCARDDEBIT (doesn't matter whether it is lower or uppercase).
How it could be converted using magento framework or payment modules?


texts: Magento get Configurable option sort by min price

texts:
I have created on configurable product A  with   attribute Unit  which contains  following Value:

Option A: 500$
  Option B:  300$
  Option C:  1500$

On the frontend, it's showing as drop-down line  Option A, Option B, and Option C.

I want to show Option B,  Option A, and Option C.    It should be sort by min price of the option.

Using Following code getting child product id but this is we want to sort by using super attribute pricing value.
$_children = $_product->getTypeInstance()->getUsedProducts($_product);

Is there any way we can sort the array bu super attribute pricing?

Is there any way we can sort by super attribute pricing on the frontend?

On the front it should display:

500ml X 6
24X 500ml

As per the above screenshot.


texts: I am trying to update Welcome text in theme configuration, but when i am saving changes it giving me "An error occurred while saving the configuration. Area is already set". I am using meigeeteam's universal theme.


texts: Varnish And Magento Redirecting Admin Routers

texts:
After Varnish Configuration some of admin customer routers are redirecting to Dash Board.

I look to console, and saw that first I try to get to my costume controller, but it redirecting with Status 302 to Admin Home page.

If disable Varnish, everything works fine. Magento log and N-ginx log are clear.
So, I'm sure this is Varnish.

Any advice?


texts:
I have a new version of SOLR 3.6 with Magento 1.14. I am getting search suggestions with the correct number but I do not get results. I have tried cache clearing, re-indexing etc.

One side note: I do have a version of SOLR running as port 8983 for Magento version 1.12 (And it works)

I am running this version of SOLR under port 8984

I used the tutorial on Magento to setup the server.
http://devdocs.magento.com/guides/m1x/other/ht_magento-solr.html

EDIT: I did get both sites to work by putting the SOLR dev server on a separate box. I would like to run everything on the same box.


texts: checkout_onepage_controller_success_action event save entry in custom table on order success in magento2

texts:
i have created event and observer checkout_onepage_controller_success_action
now I want to save data in the custom table of order success when order is placed
event.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="checkout_onepage_controller_success_action">
    <observer name="checkout_controller_success_action"
 instance="Magneto\Hometryon\Observer\AfterPlaceOrder"  />
</event>
</config>

AfterPlaceOrder.php

<?php
namespace Magneto\Hometryon\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;

class AfterPlaceOrder implements ObserverInterface
{
protected $_order;
public function __construct(
    \Magento\Sales\Api\Data\OrderInterface $order
) {
     $this->_order = $order;
}

/**
 *
 * @param \Magento\Framework\Event\Observer $observer
 * @return void
 */
public function execute(\Magento\Framework\Event\Observer $observer)
{
  $orderids = $observer->getEvent()->getOrderIds();

    foreach($orderids as $orderid){
        $order = $this->_order->load($orderid);
    }
}

}

now on order success, I have to save entry in custom table


texts:
I need to remove all text from url before last slash /

$url = https://example.com/aaa/bbbb/ccc/ttt/img.jpg

The output must be img.jpg

Also note /aaa/bbb/ccc/ttt in not the same

must use regular expresion
must be php 7 compatible


texts: Get base currency scope in Magento 2 Programmatically

texts:
I have created dynamic rows in Product edit form using dataProvider as per my custom requirements. I want to have Catalog Price Scope dropdown with amount option as in screen shot:

I have got amount field with currency symbol.
In dynamic rows children I added:

'children' => [

                static::FIELD_PRICE_NAME => $this->getPriceFieldConfigForSelectType(30)

            ]

and defined function as:

private function getPriceFieldConfigForSelectType(int $sortOrder)
{
    $priceFieldConfig = $this->getPriceFieldConfig($sortOrder);
    $priceFieldConfig['arguments']['data']['config']['template'] = 'Magento_Catalog/form/field';

    return $priceFieldConfig;
}
protected function getPriceFieldConfig($sortOrder)
{
    return [
        'arguments' => [
            'data' => [
                'config' => [
                    'label' => __('Amount'),
                    'componentType' => Field::NAME,
                    'component' => 'Magento_Catalog/js/components/custom-options-component',
                    'formElement' => Input::NAME,
                    'dataScope' => static::FIELD_PRICE_NAME,
                    'dataType' => Number::NAME,
                    'addbefore' => $this->getCurrencySymbol(),
                    'addbeforePool' => $this->productOptionsPrice->prefixesToOptionArray(),
                    'sortOrder' => $sortOrder,
                    'validation' => [
                        'validate-number' => true
                    ],
                ],
            ],
        ],
    ];
}

I just wanted to know how to add base/catalog Price Scope in Dynamic rows.
Thanks


texts: How to make required to select configurble option before Add to Wishlist Magento 2 product page?

texts:
I have size attribute as configurable options swatches. I want to select configurable product option size  when I want to add the configurable product to wishlist. Currently, It is not required to select any option.
How can I do? Please help!


texts: In which way I can set multiple stores in my sub domain in Magento version 2.1.7?

texts:
In which way i can set multiple store in my sub-domain Magento version 2.1.7?
In Which way I can show multi store option on front page?


texts:
I have recently upgraded a client to Magento 1.9.3.3 using a fresh install but I am finding an issue when uploading product images.

In admin panel I receive a successful upload message but no image.... I can see the image in the media/tmp directory but it doesn't seem to be getting past this stage.

When I use console there are no errors. I can see a request is sent on clicking "Upload Files" to

  index.php/admin/catalog_product_gallery/upload/key/2d462e56ab5f1b53daf320d83e47314f/?SID=1b80b8af93e6f4790e27bab5ab360ea3

Any ideas what could be causing this?


texts: Read input csv file and convert it to array

texts:
I have an input file form in phtml to import data from csv file type like this:

CSV File:

  <form class="import-shipping-form" action="<?= $postUrl ?>" method="POST" enctype="multipart/form-data">
    <?php echo $block->getBlockHtml('formkey'); ?>
    <input type="file" required class="required-entry" name="csv" />
    <button type="submit">Import</button>
  </form>

How can i read   the csv file and turn it into an array, and validate the file input file type is csv in my controller?

for example my csv file look like this:


texts: /V1/categories REST API petition retunring only 1 record

texts:
I'm using magento 2.1.2 and for some reason the GET petition to rest/V1/categories in my platform only returns "Default category" , but if i do a POST petition with an ID of other category it shows the category details , even when it doesnt appears in the list tree of all categories.

I've already flush the cache and same output.

What can i do?


texts: Authorize.net in magento version 1.9.2.1 not making an ajax call to validate the credit card data. Authorize.net is enable from admin panel as well.I don't know what is wrong with it.I am new to this.Below is my screen shot


texts: Allow products to be bought by specific users

texts:
I've a configurable product with options every option has its own sku I need to let this sku to be available to buy only by a specific USER or USER GROUP.

Is this possible to do in some way? With cart rules or any other way?


texts: How to always get the attribute label from "default store"?

texts:
I'm trying to improve an extension. Currently it returns attribute labels from the store that the item was purchased, but I need it to always return the labels from the default store.

This is a generalization of the script they are using to request the attributes, labels. (from what I understand)

 $config    = Mage::getModel('eav/config');
$attribute = $config->getAttribute(Mage_Catalog_Model_Product::ENTITY, $options['options'][$i]['label']);
$label_ar    = $attribute->getStoreLabels();
$options['options'][$i]['label'] = $label_ar[$specific_store_id];

Could you perhaps make a guess of what I would need to change for it to always return default store attribute labels?
(I understand that there is not a lot of info to work with, but I don't want to expose too much of the code)


texts: Magento 2.3 Upgrade - SagePay - Card Payments not working PI integration

texts:
We were upgrading our store from Magento 2.2.8 to Magento 2.3.3 and encountered some issues with the SagePay Suite PI integration.

On the checkout, when trying to load the form, the loading never finishes. In the console, we are seeing the following errors:

  GET https://live.sagepay.com/api/v1/js/sagepay-dropin.min.js net::ERR_ABORTED 404 (Not Found)

  Uncaught Error: Script error for:https://live.sagepay.com/api/v1/js/sagepay-dropin.js

We are running Magento ver. 2.3.3 and Ebizmarts Sage Pay Suite 1.3.7

Check the below screenshot for more information.


texts: Has anyone tried to do a preauth for x amount?

texts:
I have an issue where a client wants to do an initial authorization of $1.00 before the actual amount gets authorized.

So, we have an order total of $50, I want to change the payment amount to $1.00, have that get authorized first. If that is successful, then we authorize the full amount.

I've tried changing the payment sent, the order totals..etc and nothing is working. When I changed the payment sent to the gateway, I kept getting fraudulent errors.


texts: After return parent::_prepareCollection() store filter not working in product collection

texts:
I have override \Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser Block and I have added Store filter to Product Collection in _prepareCollection function. I am returning parent::_prepareCollection(); in my override block but it is not filtering my product as product wise. If I return $this->setCollection($collection); than it working fine but if I return  parent::_prepareCollection(); than it does not filter my product collection.

Anyone have idea why this does not work when I return parent::_prepareCollection().


texts: How to cache a custom block on each product in the category view?

texts:
I would like to add caching for a block on a per product basis.

I tried just adding:

protected function _construct()
{
    //cache for half a day
    $this->setCacheLifetime(43200);
}

The problem is a single cache entry is used for every product.
So if I load the first page with products that has specific html in it. Then on all other products the same html is shown.

So it is caching the entire block using a default block tag.

How would I cache the block for the page/url as well as per product?

Update:

$this->getProduct()->getId() to the getCacheKeyInfo() function I get the following error:

PHP Fatal error:  Call to a member function getId() on null

Update: Add Block Code

class Module_Sticker_Block_Badge extends Mage_Core_Block_Template
{

    protected function _construct()
    {
        //cache the stickers for half a day
        $this->setCacheLifetime(43200);

        // Add cache tags
        // cache tags are used as handles for clearing certain caches
        $this->setCacheTag(array(
            Mage_Core_Model_Store::CACHE_TAG,
            Mage_Cms_Model_Block::CACHE_TAG,
            Tengisa_Sticker_Model_Sticker::CACHE_TAG
        ));
    }

    // Cache key is unique per bit of HTML
    public function getCacheKeyInfo()
    {
        return array(
            Module_Sticker_Model_Sticker::CACHE_TAG,
            $this->getNameInLayout(),
            Mage::app()->getStore()->getId(),
            Mage::getDesign()->getPackageName(),
            Mage::getDesign()->getTheme('template'),
            //Product id
            // $this->getParentBlock()->getProduct()->getId()
            // Mage::registry('product')->getId()
            $this->getProduct()->getId()
        );
    }


texts: Facing Error while Setting up Cron job in Magento 2.1.3 from cpanel

texts:
In error_log:
[26-Feb-2017 03:28:01 America/New_York] PHP Fatal error:  Class 'Magento\Update\Status' not found in /home/-/public_html/-/update/cron.php on line 15


texts: Magento2 Contact Form Emails Not Received

texts:
We're experiencing an issue with one of our Magento 2 sites where the contact form emails are not being received.

Order emails are being received - it's only the contact form that is failing.

There is nothing in the exception log, the server says they've been sent, there are no errors I can find at any level... but it's only the Contact form emails that don't work.

It does work on our development server - it's only the live one that is experiencing issues.

Does anyone know if the contact form emails work differently from order emails in some subtle way that might mean it doesn't work?

I'm out of ideas on how to debug this further, and I can't really understand why one set of emails (order/customer emails) would work while another set (contact form) don't. There must be some difference, but I haven't found it.

Magento 2.2.2 Open Source


texts: if no child categories then return categories of same level

texts:
In magento CE 1.7.0.2 Mage_Catalog_Block_Layer_View function _getCategoryFilter() $this->getChild('category_filter') returns list of child category.

protected function _getCategoryFilter()
{
    return $this->getChild('category_filter');
}

What I want is, if '$this->getChild('category_filter')->getItemsCount()` returns zero then I want list of categories of same level.

Say following is category structure:

1.root
|-- 2. cat1
    |--2a. subcat1
    |--2b. subcat2

How I can modify _getCategoryFilter() as 2a has not child category ( '$this->getChild('category_filter')` will return zero) then it will return what its parent had return ie '2a, 2b'


texts: Magento2 : Grouped Product's child product add to cart issue

texts:
I have an issue in grouped product's child product add to cart validation issue. In one grouped product have three (3) child products while click on add to cart button of last child product without adding QTY validation appear good but it should display for selected product add to cart button of product not to appear this validation message for all child product.

Please see below image for more information:


texts:
So, I have subscribers collection:

$subscribersCollection =  Mage::getModel('newsletter/subscriber')->getCollection();

I want to join customer collection to it by email, so I did next:

$subscribersCollection->getSelect()
     ->join(array('cus'=>'customer_entity'),'cus.email=main_table.subscriber_email');

But in this way I only join customer_entity table, but not all the customer collection.
I think about also join other customers tables. Is there any better way to join customer collection?

UPDATE:

I have tried

$customerCollection = Mage::getResourceModel('customer/customer_collection');
$customerCollection->getSelect()->join(array('cus'=>'newsletter_subscriber'),'cus.subscriber_email = e.email');
$customerCollection->getItems()

Now it work, thanks


texts: how to get custom attribute value on my order page

texts:
I have overridden phtml files and respective block, i.e. defaultRendere.php file and where I created getCustomAttribute class its return successfully any test data, But I want return Custom Attribute value for that I tried the following Code.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')
                  ->load($this->getItem()->getId());
$test=$product->getData('attribute_name');
return $test;

but its return nothing .. $this->getItem()->getId()) return product id.


texts:
I need to get the quantity of products sold on my report module.
Actually I'm only getting the ordered quantity, but I need to get the quantity of all finished orders.

Here is my actual code:

public function _prepareCollection()
{
    $collection = Mage::getResourceModel('reports/product_collection')->addAttributeToSelect('*')->addOrderedQty();

    $this->setCollection($collection);
    parent::_prepareCollection();

    return $this;
}

protected function _prepareColumns()
{
    $this->addColumn('name', array(
        'header' => $this->_getHelper()->__('Name),
        'type' => 'text',
        'index' => 'name'
    ));
    $this->addColumn('ordered_qty', array(
        'header' => $this->_getHelper()->__('Quantity Sold'),
        'type' => 'number',
        'index' => 'ordered_qty'
    ));

    return parent::_prepareColumns();
}

How can I get the desired result? Thanks in advance.


texts: Need suggestions about slower loading time of product page because of configrable swatch


texts:
Ive tried to override the module-newsletter/view/frontend/templates/subscribe.phtml file and copied it to my <theme-dir>/Magento_Newsletter/templates/subscribe.phtml.
But after refreshing i get an exception:

Invalid method Magento\Newsletter\Block\Subscribe::escapeHtmlAttr

Ive tried clearing my cache and manually remove cache directories but it still doesnt work.

I am using Magento 2.1.9


texts: Magento can't programatically create configurable product

texts:
I'm trying to import my products form a .csv. The import script for the simple products works like a charm, but the script for the configurable product returns the following error:

 SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`sendb`.`catalog_product_super_link`, CONSTRAINT `FK_CAT_PRD_SPR_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DEL)

Configurable.php

if(($handle = fopen("werkbladvoorraad.csv", "r")) !== FALSE){
    while(($data = fgetcsv($handle, 1000, ";")) !== FALSE){
        if(!$product->getIdBySku($data[2])){
            $product = Mage::getModel('catalog/product');
            $product ->setStoreId(1)
                     ->setWebsiteIds(array(1))
                     ->setAttributeSetId(4)
                     ->setTypeId('configurable')
                     ->setCreatedAt(strtotime('now'))
                     ->setSku($data[2])
                     ->setName($data[1] . " " . $data[10])
                     ->setStatus(1)
                     ->setTaxClassId(2)
                     ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
                     ->setCanSaveConfigurableAttributes(true)
                     ->setCanSaveCustomOptions(true)
                     ->setPrice($data[6]);

             $product ->setCategoryIds(array(2,11,12, $categories[$data[13]]))
                      ->getTypeInstance()->setUsedProductAttributeIds(array(139));
             $attribute_ids = array(139);

             $sql = "SELECT * FROM sku WHERE sku LIKE '$data[2]%' ";

             $result = $con->query($sql);

             $configurableProductsData = array();

             while($row = mysqli_fetch_array($result)){
                echo $row['sku']."<br>";
                $sproduct = Mage::getModel('catalog/product')->load($row['product_id']);
                $configurableProductsData[$sproduct->getId()] = $sproduct->getData();
             }

             $productTypeInstance = $product->getTypeInstance();
             $productTypeInstance->setUsedProductAttributeIds($attribute_ids);
             $attributes_array = $productTypeInstance->getConfigurableAttributesAsArray();

             foreach($attributes_array as $key => $attribute_array){
                $attributes_array[$key]['use_default'] = 1;
                $attributes_array[$key]['position'] = $y;

                if(isset($attribute_array['frontend_label'])){
                    $attributes_array[$key]['label'] = $attribute_array['frontend_label'];
                }else{
                    $attributes_array[$key]['label'] = $attribute_array['attribute_code'];
                }
                $y++;
            }

            $product->setConfigurableAttributesData($attributes_array);
            $product->setConfigurableProductsData($configurableProductsData);
            $product->setStockData(array('use_config_manage_stock' => 1, 'is_in_stock' => 1, 'is_salable' => 1));

            if($product->save()){
                echo "yay";
            }else{
                echo "nay";
            }

        }
    }
}

Note i've stored the information from the simple products in the database so that explains the query in the script.

Edit
I found the error occurs on this line:
$product->setConfigurableProductsData($configurableProductsData);


texts: Magento 2 on shared hosting how to deploy static content. There is no Commend line for shared hosting Or Any other way to use Commend line.


texts:
I installed one page checkout extension but I need to edit some of the templates.
I already found some of the templates that used in extension but I can't find for the payment

This is the code

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

Does anybody know here where I can find this template? Is this a native template in magento?

Please. Thank you.


texts:
This is my phtml file:

<form method="GET" action="<?php echo Mage::helper("adminhtml")
->getUrl('management/adminhtml_task/show')?>" name="commentForm" id="commentForm" enctype="multipart/form-data">

Comments:

<textarea name="comments1" id="comments1" rows="2" cols="70"></textarea>

File Upload:
<input type="file" name="files" id="files" >
&nbsp;&nbsp;<button type="submit" id="button23">Submit1</button>

</form>

this is my action:

if ($data = $this->getRequest()->getParams()) {

    if ((!empty($_FILES["files"]["name"])))
        {
        print_r($_FILES);exit;
        $uploader = new Varien_File_Uploader('files');
        $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
        $uploader->setAllowRenameFiles(false);
        $uploader->setFilesDispersion(false);
        $path = Mage::getBaseDir('media');
        $fileName = $_FILES['files']['name'];
        $uploader->save($path, $fileName);
        }}

n my o/p is

Array()

I can't get file in $_FILES how to solve this problem


texts: Magento blocking a href in topmenu with javascript

texts:
This might sound somewhat confusing, but it seems Magento is blocking certain a href tags with javascript. Let me explain:

In the topmenu, I have a few categories:

- shirts
- pants
- hats
- accessoires

The categorie 'accessories' contains 3 sub categories named:

- rings
- necklaces
- jewels

On mobile devices, the topmenu is loaded in the same way as normally. But, I have made a custom animation when you go to the subcategory menu. The normal menu slides left, and the subcategorie menu slides in from the right.

The trigger for this animation lies on the parent of the a href, the .parent li:

$('#header-nav .nav-primary li.level0.parent').click(function(e){
   // javascript animation
});

But now I have a problem. The a tag inside the .parent tag fills up like 90% of the space. To trigger the animation, I can only use the 10% of the space, the other 90% used by the a-tag blocks the animation:

I asked my colleagues here at my internship, and they said they had met the problem before. However, they don't remember how they solved it, but they think the problem lies within the /skin/frontend/enterprise/default/js/app.js file.


texts: Show static block only on catalogsearch page

texts: I want to show a static block only on the catalogsearch page. My catalogsearch page is the same layout as 2columns-left.phtml. I don't really want to make another layout for the catalogsearch. Is there a way that i can show the static block only on the catalogsearch page ?


texts: media css not reflect in mobile magento 2

texts:
I am making responsive design for mobile view. I have installed Porto Magento 2 theme. Porto theme provides css file custom design changes. I have made custom changes in custom.css file.
Porto theme put custom.css file in following path. Magento 2 hosted on nginx server.
/pub/media/porto/web/css/custom.css

and custom.css file imported via below code in app/design/frontend/Smartwave/Porto/Smartwave_Porto/templates/html/head.phtml
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $_helper->getPortoWebDir().'css/custom.css'; ?>">

Now the problem is if I do changes in custom.css its not refecting in my mobile. It just reflect on my PC in responsive view(sometimes I have to do hard refresh on PC to check made chages). When I checked in my mobile it's not reflect changes made in custom.css file.
Below operation I did to show reflected css changes,but no luck
I clear and flush cache
I disabled the cache and checked in my mobile but still show old changes.
I ran php bin/magento setup:static-content:deploy -f
I run index command but still in my mobile showing old css changes.
Currectly, Magento website mode is developer.
cleared generated folder
Why its not reflect on the custom.css
I have an doubt. This custom.css located in /pub/media/porto/web/css/custom.css path is correct according magento 2 standard ?
Please Give me solution.I am tired of this situation.


texts: Module translation - All store loses translation

texts:
Hi Magento friends.

I've installed Magento 1.9 with a brazilian translation.. It's working.. All Magento default pages was translated perfectly.

After this, I've created a vendor/seller module in Magento frontend. The module it's working, but when trying to "internationalize" the module, something strange is happening..

Please, look the images attached. In homepage, everything it's ok (in Portuguese) and the inline translate it's appearing (i've enabled it in admin). But in my module page (/seller), the inline translate doesn't appears and the WHOLE page is in English, including the words that appears in Portuguese in others store pages.

Anybody could help me? I'm completely lost..

Parts of code here: http://forum.escolamagento.com/index.php?/topic/13692-traducao-em-modulo/


texts: Magento 2 : Showing incorrect title and heading for certain pages

texts:
In Magento 2 some of the pages show incorrect title and heading, it is showing Create New Customer Account as Page heading and title for Contact page, advanced search page.

Any idea why ?


texts: Magento 1.9 - Mage->app()->getRequest()->getParam() not working

texts:
I am fetching the URL params as below.

Mage::app()->getRequest()->getParam('test');

Debugging with echo before the above statement, it works fine. But placing echo after this statement return nothing, only a blank page.

FYI,
one of the Mage::app() is working fine here.

Can anyone help me to sort out this issue?


texts: How to override template Magento_Sales::order/items.phtml in custom module?

texts:
I have to override Magento_Sales::order/items.phtml frontend template in custom module. I have added below code to sales_order_view.xml file of my module.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="order_items">
        <arguments>
            <argument name="template" xsi:type="string">Vendor_Module::order/items.phtml</argument>
        </arguments>
    </referenceBlock>
</body>
</page>

It throws below exception

  Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'arguments': This element is not expected.

How I can override mentioned phtml file ? I have followed this answer but it throws same exception.

Edit: As action node is deprecated, I do not want to use it.


texts: How to Set width for dropdown in magento2 system configuration?

texts:
I have created a custom configuration same like Magento\Braintree\Block\Adminhtml\Form\Field\Countrycreditcard.php
with some fields like

$this->addColumn(
            'field',
            ['label' => __('Field'), 'renderer' => $this->_getAttributesRenderer(),'style' => 'width: 1000px']
        );

Even if i set width in style its not working.

Please let me know how to set width.


texts: How to create Bestselller product and Related product and call it on the cms page in magento 2.2.0

texts: I want to display Related products and BestSeller products on two different pages.


texts: Performance problems - hosting company suggested to optimize our MySQL database

texts:
Magento 1.9.1
Porto theme
VPS server with the following:
**RAM: 6 GB
SSD Web Space: 150 GB
Bandwidth: 6000 GB
Cores: 8**

We've had this hosting account for years and it mostly worked fine. We are having perfomance problems (slow) for the last week or so. At one time, the tech at the hosting company wrote this to us:

"There was a temporary overload on the server caused by an abusive user hosted on the same environment. We had to suspend the user in question and the server performance is now back to normal. I have already tested your website and it is loading perfectly normal on our end."

Today, the hosting company tried to get us to upgrade to a dedicated server saying:

"By the moment, you are being hosted in a Virtual Server Linux environment, which is affordable, but definitely not the most powerful. If your website requires more resources to work smoother, you might want to consider checking our Dedicated Server offers here:"

I went back to them saying that is not an option we could afford at this time and they offered this suggestion:

"I checked the node hosting your server again here and it doesn't have high load at the moment. We are monitoring it to ensure this stays the case.

As I see that in most cases the slow loading of the site and the higher load originates from the MySQL, I noticed that your MySQL database is quite large:

6.1 GB

I see that the largest tables are mainly logs:

mg_log_visitor_info 1.7 GB
mg_log_url_info 1.6 GB
mg_log_url 1 GB
mg_log_visitor 1 GB

If the MySQL database is optimized and these logs cleared, this should significantly improve the service performance.

Also we can migrate your VPS to a different node, that is doable. I am not sure which user Rusi took action to limit, but at the moment, there is no resource abuse on the current node hosting your VPS. Still if you wish, we can schedule and do a migration."

The migration they are talking about is to another VPS server with the same specs within the same hosting company (we had to do that a few times in all them years we've been with them).

What would be the best course of action here? Migrate or not?

How to optimize the MySQL database? Does that involve deleting those log files as suggested above?

**

mg_log_visitor_info 1.7 GB
mg_log_url_info 1.6 GB
mg_log_url 1 GB
mg_log_visitor 1 GB

**


texts: Want to know about Exclude Sitemap Option in magento 2

texts: I have noticed Exclude Sitemap option is by default enabled as Yes. Does that mean it will not include that URL in the sitemap? If yes then how can I change that on all of my total URLs? Because that will put a negative impact on my site performance. Please help.


texts: Order Emails Marked as sent but not received

texts:
Copied the below question from another forum. Has anybody been able to solve this? My cron is set up and is working. Emails marked as sent in back end but is being queued in core_email_queue. Spent 7 days trying to fix this issue using every other suggestion on other posts with no solution. Any help would be appreciated.

Copied Former question:-
After installing the last patch 1.9.2.3 i can't send order notifications. When i run the cron it tries to send the E-Mail but i get the following error.

exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /xxxxxxx/lib/Zend/Mail/Transport/Sendmail.php:156
Stack trace:
#0 /xxx/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /xxx//lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /xxx/app/code/core/Mage/Core/Model/Email/Queue.php(241): Zend_Mail->send()
#3 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#4 /xxx/app/code/core/Mage/Cron/Model/Observer.php(326): call_user_func_array(Array, Array)
#5 /xxx/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#6 /xxx/app/code/core/Mage/Core/Model/App.php(1358): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#7 /xxx/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#8 /xxx/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#9 /xxx/cron.php(78): Mage::dispatchEvent('default')
#10 {main}

I have looked around and i know that this is a problem when you don't set the path to sendmail in backend back that is all correct. The mail function is active, too.

If i send an Email not over the queue so directly an forgotten Password its working well. Only the Queue functionality is broken. I have debugged a lot. The function _sendMail() in SendMail.php is called i write a text to the log files before and after but only the mail function isn't called its very strange.

Anyone an idea or have the same problem with that patch? I have seen in the other thread that there are a lot of problem with the new Patch.

Update:

The interesting thing is that my emails are queued in the core_email_queue with processed_at NULL. When i run the cron the processed date is set but the E-Mail isn't send. In the same Moment i get the error on top.

I have that problem only on my managed server. On my local machine the Email is sent what is very strange and i have no problems and no exception.


texts:
How to remove the field from where the condition in magento 2?

in error log : Column not found: 1054 Unknown column 'show_in_custom_assistance' in 'where clause'.

$collection = $this->_autoSearchCollection->create();
    $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds());
    $collection->addAttributeToSelect('*')
    ->setStoreToFilter($storeid)
    ->addStoreFilter($storeid)
    ->addSearchFilter($search_arr)
    ->addMinimalPrice()
    ->addUrlRewrite()
    ->addTaxPercents();
    $collection->addCategoryFilter($category);
    // echo $collection->getSelect();

    return $collection;

I have tried the $collection->removeAttributeToSelect('show_in_custom_assistance');
 and $collection->removeFieldFromSelect('show_in_custom_assistance'); but didn't worked.


texts: How to call the saveConfig function in Magento 1.9

texts:
I am working in Magento 1.9 . In some specific requirement i have to make a PHP file at Magento ROOT directory . Some API will hit that file and send some data to it . I have to save that data in DB in core_config_data . For this please see my code .

<?php class Response{
public function __construct() {
    umask(0); require "app/Mage.php";
    require "app/code/core/Mage/Core/Model/Config.php";
    $this->getResponse();}function getResponse(){
Mage::getConfig()->saveConfig("notification_data",json_encode($_GET));}}new Response();

  But it gave the error Fatal error: Uncaught Error: Call to a member
  function saveConfig() on null.

Any body please help to fix the issue .


texts: Multiple Server Indexing - Isolate Indexing Process

texts:
We run a multi-server magento install. 2 webservers, 1 MySQL server and 1 server for the magento admin. When I am running an indexing process via the command line using the admin server I am noticing that the indexing queries are being sent by our other 2 webservers in addition to the admin server. This is creating a real high load and takes a long time for the index to complete.

I have removed all the lock files from var/locks and it does not seem to make a difference.

any suggestions on how to isolate the indexing process to the single admin server?

Thank you for your help in advance!


texts: How to show all product image in product listing/list.phtml

texts:
I want to show all product images in product listing page(list.phtml file).

So to do so I've done following in list.phtml

var_dump($_product->getMediaGalleryImages());

But it returns with NULL.

Another way I found is as following

$mediaApi = Mage::getModel('catalog/product_attribute_media_api');
$mediaItems = $mediaApi->items($_product->getId());
foreach ($mediaItems as $image) {
    echo $image['file'] ."
";
}

But it return me half path like
                                                                /p/a/pawo.jpg.

So is there any better way to get all product images(Gallery) in product listing page??

NOTE : I also need to resize image like we do as following.

 <img id="product-image-<?php echo $_product->getId(); ?>" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(TRUE)->keepAspectRatio(FALSE)->keepFrame(FALSE)->resize($_imgSize,$_imgSize); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"/>


texts:
Is there a setting or a plugin for Magento 2 where I can,

Login to the admin
View pages in the frontend
Click on an admin link to take me to the edit the content for that page in the backend admin

Wordpress has similar functionality, when logged in to the admin a user has the option to follow an admin link in the header to edit the content of that page.


texts: How to completely delete EAV attribute and all its data from the database?

texts:
What is the correct way to completely remove category attributes from the database?

Attributes were added this way using setup script:

$setup->addAttribute('catalog_category', 'seo_text', array(
    'group'             => 'General',
    'label'             => 'Additional Text',
    'type'              => 'text',
    'input'             => 'textarea',

    'backend'           => '',
    'frontend'          => '',
    'visible'           => true,
    'required'          => false,
    'searchable'        => false,
    'user_defined'      => true,
    'visible_on_front'  => true,
    'wysiwyg_enabled'   => false,
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE
));
$setup->addAttribute('catalog_category', 'cat_icon', array(
    'group'             => 'General',
    'label'             => 'Category icon',
    'type'              => 'varchar',
    'input'             => 'select',
    'source'            => 'categoryseo/source_ico',
    'backend'           => '',
    'frontend'          => '',
    'visible'           => true,
    'required'          => false,
    'searchable'        => false,
    'user_defined'      => true,
    'visible_on_front'  => true,
    'wysiwyg_enabled'   => false,
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE
));

Later these attributes were removed in another setup script, I used the standard code which can be found in many tutorials:

$setup = $this;
$setup->startSetup();
$setup->removeAttribute('catalog_category', 'seo_text');
$setup->removeAttribute('catalog_category', 'cat_icon');
$setup->endSetup();

This deleted the attributes from my categories. I also checked in the database and attributes were also removed from the table eav_attribute.

But data of these attributes is still stored in other tables. E.g. in table catalog_category_entity_varchar there is still info about attribute "cat_icon" for many categories.

Shouldn't all this data be automatically removed when I delete the attributes with $setup->removeAttribute(...) method? Does it mean that I have some errors in my Magento so Magento doesn't fully remove the attribute data?

Or did I just delete the attributes incorrectly? If yes, then how to do it properly? How to delete eav attributes and all the data associated with deleted attributes?


texts: Cannot edit widgets in WYSIWYG editor anymore

texts:
Recently, editing widgets in the WYSIWYG editor does not work anymore.

The browser console shows the following error when I click on a widget:

Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.
    at Editor.<anonymous> (http://example.com/js/tiny_mce/tiny_mce.js:1:15327)
    at Dispatcher.dispatch (http://example.com/js/tiny_mce/tiny_mce.js:1:6000)
    at DOMUtils.c (http://example.com/js/tiny_mce/tiny_mce.js:1:184650)
    at j (http://example.com/js/tiny_mce/tiny_mce.js:1:58627)
    at HTMLDocument.y (http://example.com/js/tiny_mce/tiny_mce.js:1:58785)
(anonymous) @ tiny_mce.js:1
dispatch @ tiny_mce.js:1
c @ tiny_mce.js:1
j @ tiny_mce.js:1
y @ tiny_mce.js:1
tiny_mce.js:1 Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.
    at Editor.<anonymous> (http://example.com/js/tiny_mce/tiny_mce.js:1:15327)
    at Dispatcher.dispatch (http://example.com/js/tiny_mce/tiny_mce.js:1:6000)
    at DOMUtils.c (http://example.com/js/tiny_mce/tiny_mce.js:1:184650)
    at j (http://example.com/js/tiny_mce/tiny_mce.js:1:58627)
    at HTMLDocument.y (http://example.com/js/tiny_mce/tiny_mce.js:1:58785)

And the popup to create a new widget appears, instead of the one to edit the existing widget.

I found the behavior on different versions of Magento CE 1.x and EE 1.x, in Chrome, regardless of the OS. Can it be related to the recent security patch SUPEE-9767?


texts: I used Magento phone number validation validate-length maximum-length-11 minimum-length-11 validate-digits for phone number but i want to first digit starting with(7,8,9) and after that 9 digit will come how i restrict ?