texts: How To Upload Images and Show Their Thumbnails From Custom Module Admin Form

texts:
I have a custom grid. Need to upload product images from admin form of the custom module.

Here is the grid Edit file at:

  app\code\local\Crud\Banner\Block\Adminhtml\Banner\Edit\Form.php

    $fieldset = $form->addFieldset('banner_form', array('legend'=>Mage::helper('banner')->__('Banner information')));

    $fieldset->addField('title', 'text', array(
        'label' => Mage::helper('banner')->__('Title'),
        'class' => 'required-entry',
        //'required' => true,
        //'readonly' => true,
        'name' => 'title',
    ));

    $fieldset->addField('filename', 'image', array(
        'label' => Mage::helper('banner')->__('Upload Banner'),
        'class' => 'required-entry',
        //'required' => true,
        //'readonly' => true,
        //'renderer' => 'banner/adminhtml_banner_renderer_image',
        'name' => 'filename',
    ));

    $fieldset->addField('status', 'select', array(
        'label' => Mage::helper('banner')->__('Status'),
        'name' => 'status',
        'values' => array(
            array(
                'value' => 1,
                'label' => Mage::helper('banner')->__('Desabilitado'),
            ),

            array(
                'value' => 0,
                'label' => Mage::helper('banner')->__('Habilitado'),
            ),
        ),
    ));

    if ( Mage::getSingleton('adminhtml/session')->getBannerData() )
    {
        $form->setValues(Mage::getSingleton('adminhtml/session')->getBannerData());
        Mage::getSingleton('adminhtml/session')->setBannerData(null);
    } elseif ( Mage::registry('banner_data') ) {
        $form->setValues(Mage::registry('banner_data')->getData());
    }

    $this->setForm($form);

    return parent::_prepareForm();
}

  Here is the controller SaveAction:

public function saveAction()
{
    if ( $this->getRequest()->getPost() ) {
        try {
            $postData = $this->getRequest()->getPost();
            $bannerModel = Mage::getModel('banner/banner');

            $bannerModel->setId($this->getRequest()->getParam('id'))
            ->setTitle($postData['title'])
            ->setStatus($postData['status'])
            ->save();

            Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Data was successfully saved'));
            Mage::getSingleton('adminhtml/session')->setBannerData(false);

            $this->_redirect('*/*/');
            return;
        } catch (Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
            Mage::getSingleton('adminhtml/session')->setBannerData($this->getRequest()->getPost());
            $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
            return;
        }
    }
    $this->_redirect('*/*/');
}


texts: Magento migration 1 to 2 [PDOException] SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

texts:
I am trailling to migrate Magento 1 to magento 2, I'm using migrate data tool but this returned a SQL error:

[2017-02-13 10:38:35][INFO][mode: data][stage: integrity check][step:

EAV Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:35][INFO][mode: data][stage: integrity check][step: Customer Attributes Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:35][INFO][mode: data][stage: integrity check][step: Map Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: integrity check][step: Url Rewrite Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: integrity check][step: Log Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: integrity check][step: Ratings Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:37][INFO][mode: data][stage: setup triggers][step: Stage]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:43][INFO][mode: data][stage: data migration][step: EAV Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:46][INFO][mode: data][stage: volume check][step: EAV Step]: started
100% [============================] Remaining Time: 1 sec
[2017-02-13 10:38:46][INFO][mode: data][stage: data migration][step: Customer Attributes Step]: started
50% [==============>-------------] Remaining Time: 2 mins

  [PDOException]
  SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match the number of tokens

This error occurred during customer_address data migrate.

Does someone have a similar problem?


texts:
Need help on one issue we are facing :

We want to use a downloadable product (ie digital product) but along with the product file, we also want to take input from users on Product details page.

For this, we can create the TextArea or Upload File options on the product detail page. Now the final output which users can download will not be the file that was uploaded for Product by admin but a custom file depending on the user inputs provided on the Product Details page and this will vary for each customer.

On order submission, the custom product file will be created offline and uploaded back to My Order page from where the user can download it. How can we achieve this using Magento?


texts: Magento 2 - Rounding Float Values to Currency Precision

texts:
Currently I have stored values based on percentages of order subtotals out to a precision of 4 decimal places in the database. I need to show a balance as a total sum of those percentages. I have an account with two calculated percentage totals, both equaling 2.8430. So to create a display price I add them up 2.8430 + 2.8430 = 5.6860 and send that value to the toCurrency() function of the \Magento\Framework\Locale\CurrencyInterface class.

<?php

/*
* @var $store \Magento\Store\Model\StoreManagerInterface
* @var $currency \Magento\Framework\Locale\CurrencyInterface
*/
$store = $this->storeManager->getStore();
$currency = $this->currency->getCurrency($store->getBaseCurrencyCode());
$value = $currency->toCurrency(sprintf("%f", $value), $options);

However, that's displaying $5.69 when it should be displaying $5.68 in currencies with a precision of 2. I can't find a method in the currency class that will round numbers based on currency precision and I need to do that in order to display the price correctly as well as run some conditional checks on the values to make sure customer requests for withdrawals aren't greater than the sum (5.68).

I've resorted to sending the values to the toCurrency() function, removing the symbol, and running the string result through floatval(), but I feel like this is a hack and I'm wondering if there's a more appropriate way?

$currencyPrecision = $currentAccount->convertToPrice($value, ['display' => \Zend_Currency::NO_SYMBOL]);
$availableAmount = floatval($currencyPrecision);


texts: How can we display product based on more than one select attribute?

texts:
I am new in Magento i want to filter product on the basis of attribute such as
year, make, model so how can it will done.

on home page i call one template file i.e filter.phtml

In this file i create simple form for filter product from its attribute
 year: to get year i call block method
$this->getYear() in year dropdown list. like wise for model and make.
On form action i called controller as
Mage::getUrl('ymm/index/filter'). So now i am getting post data in block using
getRequest()->getPost() or getParam() mothod. So now my question is how can we filter product on the basis of post data attribute?

Thanks for reply...........


texts: product is showing free shipping eventhough the coupon is not enter

texts:
I have set up a cart price rule: if coupon "freeshipping" is enter, and any of the product A/B/C is in the cart, the shipping will be free, plus 5% discount.

The issue i'm having now is that without using the coupon code, the product A/B/C still showing free shipping when added to cart.

Also, even if i disabled all the cart price ruls on the site, the product A/B/C still shows free shipping, even though it does not meet the free shipping minimum set on the site.

======================================================

below is the setting for the cart price rule:

Condition: left blank

Actions:
Apply Discount Amount 5
Maximum Qty Discount is Applied To 0
Discount Qty Step (Buy X) 0
Apply to Shipping Amount
Discount amount is applied to subtotal only
Discard subsequent rules
Apply the rule only to cart items matching the following conditions (leave blank for all items).

If ANY  of these conditions are TRUE :
SKU  is  ProductA
SKU  is  ProductB
SKU  is  ProductC

Free Shipping "For matching items only"


texts: Get product in stock proucts when manage stock enabled

texts:
I'm doing some customization on magento 1.9.x website. I need to get all products with in stock and manage stock enabled

I'm using this code

$stockCollection = Mage::getModel('cataloginventory/stock_item')
        ->getCollection()
        ->addFieldToFilter('is_in_stock', 1);

    $productIds = array();

    foreach ($stockCollection as $item) {
        $productIds[] = $item->getOrigData('product_id');
    }

    $productCollection = Mage::getModel('catalog/product')->getCollection()
->addFieldToFilter('entity_id', array('in'=> $productIds));
    $productCollection->load();

    $i=0;
    foreach ($productCollection as $_product) {
        $i++;
        echo $i.'-'.$_product->getId().'<br/>';
    }

But the problem is this list shows the items which not enable manage stock like this

I only need to get products which manage stock enabled and in stock

like below

Anyone know how to get that with my code or using another code, Thank You


texts: Magento2: issue with located module config backend magento2-module-url-data-integrity-checker

texts:
I have installed via composer module:
https://github.com/baldwin-agency/magento2-module-url-data-integrity-checker
and enable. Now I run command and check all duplicates url key.
Module print in var/tmp in .json
In module documentation config module in backend should be in:
for Magento 2.2.0 and higher: Catalog > Data Integrity Checker
In my case empty:
https://prnt.sc/weadei
Can any one help me to locate this config module directly in panel admin?


texts: Skipping import row, required field "sku" is not defined. when import product

texts:
when I try to import my product from my old site to the new one, when I run the CSV file from admin panel it's show me "Skipping import row, required field "sku" is not defined. ".
Could you please help me with that
magento 1.9.2


texts: Magento 2 - dynamically update the currency symbol

texts:
I am trying to dynamically update the currency symbol (based on a users custom customer attribute).
I have a plugin afterGetCurrency which is loading correctly, and I can get the current symbol but how do I override it?
<?php
namespace Sulman\MyModule\Plugin;

class CurrencySymbolSwitch
{
    /**
     * @param \Magento\Framework\Locale\Currency $subject
     * @param \Magento\Framework\Currency $result
     * @return mixed
     */
    public function afterGetCurrency(
        \Magento\Framework\Locale\Currency $subject,
        $result,
        $currency
    ) {
        var_dump($result->getSymbol()); // this is working
        // but how do I change it?
        $result->setSymbol('O'); // Uncaught Error: Call to undefined method Magento\Framework\Currency::setSymbol()
        return $result;
    }
}

I don't want to change the currency, just change the symbol.
Any ideas? Thanks


texts: How To Add Magento2 Dynamic Rows DeleteAction?

texts:
I am Generating Form using <DynamicRows>
All Fields Are Properly generating.
Now I want to Add DELETE Action in that Dynamically Generated Rows.
Like this

My Ui Component Structure is

Which field did I forget to add in uicomponent.?


texts:
I am making users programmatically (weird system that a company wants, where users send their details to company's email, they then create user in their CRM, and upload users data to server, where I pick it up and create user from it), and the problem is, that password shorter than 6 characters are not allowed. I've updated this in administration, and that seems to only work when users register in the frontend.

How can I set minimum password length for users I am making in the backend?

Example of code that creates user:

    $CustomerModel = $objectManager->create('Magento\Customer\Model\Customer');

    $CustomerModel->setWebsiteId(1);
    $CustomerModel->loadByEmail($email);

    if (!$CustomerModel->getId()) {
        $customer = $customerFactory->create();
        $customer->setWebsiteId($websiteId);

        $customer->setEmail($email);
        $customer->setFirstname($name);
        $customer->setPassword($password);
        $customer->save();
    }


texts: Magento 2: products collection with multi-selected values of multiple attributes

texts:
I have numbers of custom attributes with multiple selected values in magento catalog. I need to filter products by multiple attributes having multiple selected values.

eg: Attribute set having a custom color attribute with red, black, blue and shape round,rectangle etc. Now I have to list products with color red, black and shape round.

What attributes filter and selector I need to use for create a listing of products with red, black, round values?


texts: magento 2.3 - Get cart info after user login

texts:
my goal is to modify info on cart after user has logged in, either from account page or cart popup.
So, I created a new module for this, using the event "customer_login" but it does not seem to work.
Could you please let me know if this is the right event to use to intervene on cart after login?

Thank you very much for your help

events.xml

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

module.xml

---
<sequence>
     <module name="Magento_Checkout" />
</sequence>
---

Observer

<?php

namespace Vendor\Module\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Checkout\Helper\Cart;

class CustomObserver implements ObserverInterface
{

    protected $cartHelper;

    public function __construct(
      \Magento\Checkout\Model\Session $checkoutSession,
      \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
    ) {
      $this->checkoutSession = $checkoutSession;
      $this->quoteRepository = $quoteRepository;
    }

    public function execute(Observer $observer)
    {
      $customer = $observer->getEvent()->getCustomer();
      $customerId = $customer->getId();
      die(print_r($customerId));
      if($customerId){
         $customerQuote = $this->quoteRepository->getForCustomer($customerId);
         $cartItems = $customerQuote->getAllItems();
         die($cartItems);
      }
    }
}


texts: magento2 - Study of ui component xml tags

texts:
magento2 use of ui component tags

I gone through UI component explanation link
Explanation of UI Component Grid in Magento 2

its explains lot.

Also in core ui component, I have found the item tag with observers

<item name="observers" xsi:type="array">
    <item name="filters" xsi:type="object">Magento\ConfigurableProduct\Ui\Component\Listing\AssociatedProduct\Filters</item>
</item>

I like to use observers item node in my model.

Is that any source available to get more information about item node declaration


texts:
Whenver I turn on FPC(Full Page Cache) feature in my Magento CE 2.0.2 site (doesn't matter if default theme or custom theme is running.) and when I open the Homepage of this site, then it gives "Internal Server Error 500" in the Firefox console, and the page is blank.

What could be the possible issue ?


texts:
I am overriding the catalog/product/view/type/options/configurable.phtml file, but I notice how frustrating it is to change the style of the <select> and <option> elements.

Is there a way to change this <select> and <option> combination to, for example, an <ul> and <li> combination?


texts: Get Phone number info including '-' when customer type without '-'

texts:
If a customer type phone number like 2319272918,

Is there any way the phone number data is save like 231-927-2918? including - as I want


texts: On click of add to cart button the button text is not changing to 'adding' and 'added'

texts: After clicking on add to cart button the button text is not changing to adding or added.In some places its working but in product description page and we have created a featured product widget in home page in both of these places its not working.where i need to change the code for this.


texts:
I have two websites.

On one site I have 4000 products and on the new site I only have 1500.

How can I export the attributes/settings of "selectable options" and update my new site, instead of going into each listing and manually clicking each and every single one of these?
I have to manually find and click each of the flavor/size for every product. I just want to export from the old site and upload to the new site without exporting entire product listings.

http://i.imgur.com/jouEDuE.jpg


texts: Magento 2.2: assign bundle product to configurable product

texts:
I tried to assign bundle products to the configurable product, but I cannot assign bundle product.

In configurable product, I can see the bundle product, but when I clicked on save button Magento automatically remove the bundle Product.

1. Product selection in configurable product

2. After Product selection in configurable product

3. After configurable product save


texts: Magento 2 Uncaught TypeError: Argument 1 [...] \DataSetup::__construct() [...] must be an instance [...]

texts:
I have an Ubuntu Server 18.04 with PHP 7.0.33 and a working Magento 2.1.7 installation with a working (up to yesterday) module for credit card payment

after adding some new modules, compiling and deploying without any problem the system still works fine

but when I try to checkout and confirm on credit card payment the checkout page reloads, it's not redirecting anymore to the credit card portal for entering my information:

This is my credit card selection

When I click on the Completa ordine button (Complete Order)

The loading spinner appears and then disappears again on the same page.

in my browser console I see this error:

  VM16995:1 POST http://domain.com/rest/store/V1/carts/mine/payment-information 500 (Internal Server Error)

This is the network trace

and in my error.log I see this message:

  [Sat May 25 10:20:14.839259 2019] [proxy_fcgi:error] [pid 4427] [client XX.XX.XX.XX:13271] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\Setup\Module\DataSetup::__construct() must be an instance of Magento\Framework\Module\Setup\Context, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /var/www/domain/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/domain/setup/src/Magento/Setup/Module/DataSetup.php:57\nStack trace:\n#0 /var/www/domain/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Magento\Setup\Module\DataSetup->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))\n#1 /var/www/domain/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Setup\\M...', Array)\n#2 /var/www/domain/vendor/magento/framework/ObjectManager/Factory/Compiled.php(130): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\S...\n', referer: http://domain.com/checkout/

In the stack trace on error.log I can't find any reference to one of my modules, even if the presence of create('Magento\\\\S... at the end of the trace make me think that the trace has been cut for some reason

I've searched for such errors on DataSetup::__construct() but it seems that this error could happen during modules installation, I couldn't find anything about this error on an API call

the rest of the system seems to work fine and I don't have other messages on error.log

how can I solve this?

EDIT
I Just noticed that the error happens on any payment method, not only on credit card, every time I click on complete order on any payment method


texts: Adding tel number field to new acount page "create account" page

texts: Is there a way to add "Tel Number:" input field to create account page in Magento 1.7?


texts: Magento 1.9.0 Why Is Event sales_order_save_after Triggered Twice

texts:
I have a custom function that creates a PDF file, which is triggered for the event sales_order_save_after. But why this function is triggered twice, I got 2 PDFs everytime for the same order.

If I use sales_order_place_after, then the function is only triggered once. So this fix my problem.

But my question is why sales_order_save_after is triggered twice in Magento?


texts: Save config.xml value on install/upgrade

texts:
I have just created system.xml and config.xml for my project - they work ok after implementation:

The values don't get written to the database unless I press save in admin though - ran setup:upgrade and setup:di:compile after implementation and it didn't save it to core_config_data- are these defaults written after any cli commands?


texts: Product images in multiple stores using JSON API

texts:
I have four stores created, and I'm trying to upload a single image for the same product in each of the stores.

My issue is that to get an image to show in the category front end view, I need to specify "small_image" in the  "types" field:

{
  "entry": {
      "mediaType": "image",
      "position": 0,
      "disabled": false,
      "types": ["small_image"],
      "content":{
        "base64_encoded_data": "ENCODED_IMAGE",
        "type": "IMAGE_MIME",
        "name": "IMAGE_FILENAME"
    }
  }
}

However, when viewing the items in each store, it shows four of the same image.

I have tried loading a single image to the default store, and it shows when viewing the item in each store, but the categories in the stores show no images except for the default store.

I have tried loading a single image to the all store ID (rest/all/V1/products/{{SKU}}/media), and that just shows once when viewing the item, but has no category image.

I have spent a loooong time on this, using all the different images types, and can't find a combination that works.

So, my question is, how do I load a single image that shows in the categroy view, and only once for each item in each store?


texts: I'm looking for a specific Magento 1 extension for 'custom options' including dependencies (children), images & price/delivery time table

texts:
I am looking for a very specific Magento 1 extension for 'custom options', including dependencies (children), images & price/delivery time table.
As of now I have 2 individual extensions which offer dependencies en images but they do not work together. So I am looking for one extension which can add the following properties to my Magento website:

Addition of custom option dependencies (children for specific choices).
Addition of placing pictures as customer choices/preferences for products.
Adding a table to a product page for combination of amount (1000, 2000, etc) and delivery time (5 day delivery, 30 day delivery). Below a picture of this specific option.

A nice extra would be a mouseover information button/image, but not really necessary.
What is absolutely important is that all extensions need to work with one another without scrambling up all custom options in the back end, or just the one extension for all options would be great.
I am relatively new to Magento and am not sure where to look for such an extension and don't really know how to find this one specifically. I hope to find one with your help!
Thanks in advance.


texts: Magento 2 - Custom Maintenance Page Error - Unable to proceed: the maintenance mode is enabled

texts:
Steps

Go into the pub/errors
Create a copy of the local.xml.sample and rename it as local.xml
Edit the  with custom name. Ex – mytheme

local.xml

<?xml version="1.0"?>
<config>
<skin>mytheme</skin>
</config

Create a copy of the 'default' folder and rename it with skin name. Ex – mytheme

Locate the 503.phtml inside the newly created folder and add custom code. Add the styles inside css/styles.css and relevant images under images folder.

Enable maintenance mode

php bin/magento maintenance:enable

Error

Exception #0 (Exception): Unable to proceed: the maintenance mode is enabled.

Is this the correct approach to display custom maintenance page. Magento ver. 2.2.0 ?


texts: How to add new column to existing module table?

texts:
How can I add a new column to existing Magento core table via install script? (without using pure SQL)

$installer = $this;
$installer->startSetup();

$installer->getConnection()
->addColumn($installer->getTable('sales/order'),'custom_value', array(
    'type'      => Varien_Db_Ddl_Table::TYPE_TEXT,
    'nullable'  => false,
    'length'    => 255,
    'after'     => null, // column name to insert new column after
    'comment'   => 'Title'
    ));
$installer->endSetup();

and also I am updating version as per upgrade version
I have created mysql4-upgrade-0.1.0-0.1.1 in sql folder and added above code. and change version in config.xml and cleared caches too,
but its not working.


texts: Magento 2 admin grid first row empty issue

texts: I have custom module and implemented custom grid. Everything working fine as expected. only issue with while export data, i am getting first row as empty. From second row on words showing  column header and from third row on words showing table data. All table records are showing in grid and csv file. There is no data miss. Only issue with export csv file first row have empty. I am using UI component for admin grid implementation and using export tags for export i.e.


texts: AJAX request in backend template is redirecting to login page

texts:
I am working with Magento2.

I've created some backend controllers, which are accessible in backend.

In my backend template file, I want to call the controller function with jQuery like this:

require( [ 'jquery', 'js/Services' ], function ( $, Services )
{
    $( document ).on( 'change', '.entry-edit #sku', function ()
    {
        Services.getProductName( $( "#sku" ).val());
    } );...

The implementation of the service method is like this:

    Services.getProductName = function (sku)
{
    var request = $.ajax( {
        url: "/admin123/backend/Product/showName?sku=" + sku,
        type: 'GET'
    } );

    request.done( function ( result )
    {
        $( "#name" ).val( result );
    } );

    request.fail( function ( error )
    {
        console.dir(error);
        $( "#name" ).val( "Produkt nicht gefunden" );
    } );

};

My backend controller:

class ShowName extends \Magento\Backend\App\Action
{
    const ADMIN_RESOURCE = 'Ruck_Restclient::showName';

/**
 * {@inheritdoc}
 */
protected function _isAllowed()
{
    return true;//$this->_authorization->isAllowed(self::ADMIN_RESOURCE);
}

/**
 * @return void
 */
public function execute()
{
    try
    {
        $sku = $this->getRequest()->getParam( 'sku' );
        $helper = new Data();
        $productName = $helper->getKundenArtikelNumberByProductNumber( $sku );
        $this->getResponse()->setBody( $productName );
    }
    catch ( Exception $ex )
    {
        $this->getResponse()->setBody( $ex->getMessage() );
    }
}

}

I'm not able to to proceed the getProductname() function. After the call is fired in adminhtml/product/edit/tabs, I'm getting immediatly redirected to backend login page.

After my research, I figured out, that the dispatch method from \Magento\Backend\App\Action checks the login status and redirects to login page if status is not logged in.

My expectation is, that if I fire an request from an admintemplate (adminhtml/product/edit/tabs) which is inside backend scope, I could consume the controller action.

Do I need to add some additional login headers or is my proceed basically wrong?


texts:
I'm looking for a feature or extension that would require a customer to upload an image as part of an order.

Searching around all I can find are extensions that let users upload alternative images for existing products.

Is there a core feature or extension that takes an image from a customer as part of their order?


texts: Magento2: Can we add current URL in "Scripts and Style Sheets"?

texts:
I want to add Dynamic URL in Admin->Content->Design->Configuration->HTML Head->Scripts and Style Sheets?

Actually, I want to add canonical tag throughout the website.

Here is the code:

<link rel="canonical" src="CurrentUrl here" />

Another way to add this is the XML file.

<head>
  <link rel="canonical" src="CurrentUrl here" src_type="url"/>
</head>

Please give me the clue if anyone used this approach.


texts: How to add new product to particular customer's wishlist in Magento2?

texts: Can anyone help me out? I want to add new products to the particular customer's wishlist automatically.


texts: Magento 2 - How to pass parameter from menu.xml

texts:
Is there any way to pass a parameter to controller from menu.xml file?

Actual URL :

http://127.0.0.1/mg231/admin/vendor/module/index/key/2c0a132c4b44051ec129440f763a45327b53b5ed09706c4f8d86b9a56c1d7c60/

Expected URL :

http://127.0.0.1/mg231/admin/vendor/module/index/key/2c0a132c4b44051ec129440f763a45327b53b5ed09706c4f8d86b9a56c1d7c60/customparam/value


texts: Magento 2 How to add grid/phtml file on Slide out panel [ popup modal ] in custom grid action?

texts:
Here is the link of what I expected to do in my custom module

http://admin-actions-log-m2.demo2.amasty.com/_router/redirect/admin-actions-log-m2/index.php/admin/amaudit/actionslog/index/

just open the link and go to

  System -> Actions Log

click on the Preview Changes in grid

I'm attaching a screenshot please have a look,

It will show you slide out panel. In Core Magento, you will see this under

  Catalog -> Products -> Advanced Inventory

I want to implement in my module grid, Let me know if anyone has a solution.

EDIT 1

I tried to refer this solution in link below

https://www.magestore.com/magento-2-tutorial/how-to-create-multiple-layers-of-modal-in-magento-2/

but it doesn't work since it's not a full code and have not mentioned where to define code and how it should be called.


texts: Magento 2: After migration, I get "No such entity with cartId" on old orders

texts:
I migrated from Magento 1 to Magento 2.3
My site has multiple websites and stores.
But now when I go to old orders in the admin panel and want to add a note to an order I get the error:
No such entity with cartId = XXXX

This is regarding whether I chose the option Notify Customer by Email or not. But if I click on send email, the email is not sent and gives me the same error anyways.
I don't have anything on my logs so I am not sure what is happening.
Note: If I do the same process but for newer orders (orders that were made after the migration), there is no error at all. All running fine.
Any ideas?
Thank you in advance


texts: Magento 2 get Current page Browser url in phtml?

texts:
How can I get the current page URL from browser ?

Actually I wants to highlight the current category Name by giving some class or id to it.So for that based on browser URL I will put some condition for adding class to current category.

How can I achieve this in magento 2 ?


texts: Export Product IDs with Magento export functionality

texts:
I have an extension that works with product Ids instead of product SKUs for import for which i need to export product ids along with the SKUs to match the products. As far i have checked there is no option to export product entity_id from magento 2 backend and also the script examples available are with magento 1.9 or lower version.
Please suggest if there i a way to accomplish this with custom coding or extension.

Thanks


texts: Is there any builtin way to add datatable in custom module admin panel?

texts:
I want to use datatable for custom module phtml in the admin panel. Should i use bootstrap datatable as mentioned in this link.
Or, there is any standard builtin feature to add datatable in Magento 2 admin panel.


texts:
There is 12GB worth of something in the 'captcha' folder of this Magento 2 install.

I cannot browse the folder in cPanel's File Manager. Can anyone elaborate as to what is in this folder, why it might be so large, and how one might go about making it smaller?


texts: Magento 1.9 multi countries multi langues

texts:
I want to configure magento to support multiple countries and languages without creating stores for countries only stores by language knowing that a language can belong to several countries:

Example:
I created a subfolder /de/ which contains an index.php which points to the german language, on the other hand I want to add the country code as follows:
www.website.com/de-countrycode/product-or-category-or-cms-page

Can someone help me on this topic please?


texts: Change value of text field in admin form based on option selected in dropdown

texts:
I have made a custom admin form which has a drop-down. Based on the option selected in the dropdown, I want to change the value of the text field below using AJAX.

In the above pic, I want to change value of Order State field based on option selected in Order Status field.

Edit/Tab/Main.php:

    protected function _prepareForm()
    {
        /* @var $model \Iksula\Orderitemstatestatus\Model\BlogPosts */
        $model = $this->_coreRegistry->registry('orderitemstatestatusmapping');

        $isElementDisabled = false;

        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create();

        $form->setHtmlIdPrefix('page_');

        $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Item Information')]);

        if ($model->getId()) {
            $fieldset->addField('id', 'hidden', ['name' => 'id']);
        }

        $fieldset->addField(
            'item_state_id',
            'select',
            [
                'label' => __('Item State'),
                'title' => __('Item State'),
                'name' => 'item_state_id',
                'required' => true,
                'options' => $this->grid->getItemState(),
                'disabled' => $isElementDisabled
            ]
        );

        $fieldset->addField(
            'item_status_id',
            'select',
            [
                'label' => __('Item Status'),
                'title' => __('Item Status'),
                'name' => 'item_status_id',
                'required' => true,
                'options' => $this->grid->getItemStatus(),
                'disabled' => $isElementDisabled
            ]
        );

        $orderStatus = $fieldset->addField(
            'order_status',
            'select',
            [
                'label' => __('Order Status'),
                'title' => __('Order Status'),
                'name' => 'order_status',
                'required' => true,
                'options' => $this->grid->getOrderStatus(),
                'disabled' => $isElementDisabled
            ]
        );

        $fieldset->addField(
            'order_state',
            'text',
            [
                'name' => 'order_state',
                'label' => __('Order State'),
                'title' => __('Order State'),
                'required' => true,
                'disabled' => true,
            ]
        );      $model->setData('order_state', self::getStateValue());
        if (!$model->getId()) {
            $model->setData('is_active', $isElementDisabled ? '0' : '1');
        }
        $form->setValues($model->getData());
        $this->setForm($form);
        return parent::_prepareForm();
    }

    /**
     * Prepare label for tab
     *
     * @return \Magento\Framework\Phrase
     */
    public function getTabLabel()
    {
        return __('Item Information');
    }

    public function getStateValue(){
        return "value dependent on dropdown select";
    }

    /**
     * Prepare title for tab
     *
     * @return \Magento\Framework\Phrase
     */
    public function getTabTitle()
    {
        return __('Item Information');
    }

    /**
     * {@inheritdoc}
     */
    public function canShowTab()
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function isHidden()
    {
        return false;
    }

    /**
     * Check permission for passed action
     *
     * @param string $resourceId
     * @return bool
     */
    protected function _isAllowedAction($resourceId)
    {
        return $this->_authorization->isAllowed($resourceId);
    }

    public function getTargetOptionArray(){
        return array(
                    '_self' => "Self",
                    '_blank' => "New Page",
                    );
    }


texts: How to solve this "Item (Mage_Catalog_Model_Product) with the same id "5" already exist" error

texts:
public function productDataToJson(Varien_Event_Observer $observer)
{
    $categoryModel = Mage::getModel('catalog/category');
    $treeModel = $categoryModel->getTreeModel();
    $categoryIds = $treeModel->getCollection()->getAllIds();
    $file = new Varien_Io_File();
    $jsonData = [];

    $productCollection = Mage::getResourceModel('catalog/product_collection');
    $productCollection->joinField(
        'category_id', 'catalog/category_product', 'category_id',
        'product_id = entity_id', null, 'left'
    );

    $productCollection->addAttributeToSelect('*')
        ->addAttributeToFilter('category_id', [
            ['in' => $categoryIds]
        ]);

    /**
     * Collect all the products we need to generate the required JSON
     */
    foreach ($productCollection as $product) {
        $productData = $product->getData();

        foreach ($productData as $attrCode => $attrVal) {
            if ($attrText = $product->getAttributeText($attrCode)) {
                $productData[$attrCode] = $attrText;
            }
        }

        $jsonData[] = array_merge(
            $productData,
            [
                'category_ids' => $product->getCategoryIds()
            ]
        );
    }

    /**
     * Split the results back out into the format you need
     */
    foreach ($categoryIds as $categoryId) {
        $categoryProducts = [];
        array_filter($jsonData, function ($item) use($categoryId, &$categoryProducts) {
            if (array_search($categoryId, $item['category_ids']) !== FALSE) {
                $categoryProducts[] = $item;
            }
        });

        $jsonResult = Mage::helper('core')->jsonEncode($jsonData);

        $file->open([
            'path' => Mage::getBaseDir() . '/jsondata/'
        ]);

        $file->write('/c_' . $categoryId . '_node.json', $jsonResult);
    }
}

I am getting all product details of particular category in different json files, need attribute texts of all attributes also dynamically created attributes. now it shows me this error :

  Item (Mage_Catalog_Model_Product) with the same id "5" already exist

how can I solve this and get attribute labes and values in my json file?


texts: Plugins - is it bad habit to inherit from modified class in order to use protected properties

texts:
If I make plugin it is not neccessary to inherit from class I override. But, sometimes method I change uses properties that has protected access and they can't be used by plugin class.

But if I declare in plugin inheritance after modified class it's possible then to use protected properties. Is it ok to do it? Or is it better to declare own __construct() and inject required classes (I am not sure about difference in states of objects used in plugin and modified class).

EDIT
Maybe I wasn't clear anough - I modify public method, using (for this question, mostly) aroundMethod and for different cases I use proceed() or inject custom logic - and for this custom logic I have to use protected properties of modified class. And the question is - should I put inheritance in order to make it possible

NOTE: I don't change any protected/private - just use it.


texts: How can i add new custom field into customer form and then save it into database in magento 2

texts:
hi i need to add new custom field in customer registration in magento 2, i was created one module

Kratos/Sellers/registration.php

<?php \Magento\Framework\Component\ComponentRegistrar::register(\Magento\Framework\Component\ComponentRegistrar::MODULE,'Kratos_Sellers',__DIR__);

Kratos/Sellers/etc/module.xml

<?xml version="1.0" encoding="UTF-8"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">

Kratos/Sellers/view/frontend/layout/customer_account_create.xml

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

    <referenceContainer name="form.additional.info">
        <block class="Magento\Framework\View\Element\Template" name="my_form_additional_info_customer" template="Kratos_Sellers::additionalinfocustomer.phtml"/>
    </referenceContainer>

Kratos/Sellers/view/frontend/templates/additionalinfocustomer.phtml

<fieldset class="fieldset create account" data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>">
<?php /* @escapeNotVerified */ echo __('Shop Name') ?>
<input type="text" name="shop_name" id="shop_name" value="" title="<?php /* @escapeNotVerified */ echo __('Shop Name') ?>" class="input-text" data-validate="{required:true}">

</fieldset>

it's working show the text field in customer registration page but if i submit form the custom text field data did't store in database i was try so many time what i did mistake in my module code


texts: how to ignore Notice and warning in system.log?

texts: I am using Magento 1.9.2. I need to disable warning and notice in a system.log file.


texts: Magento 2.3.5 - Data Migration - Products out of Stock Criteria (Configurable Products mostly)

texts:
Another issue regarding data migration from Magento 1.7.0.2 to Magento 2.3.5.

Question:

What are the conditions for products to display 'out of stock' in Magento 2?  I am clearly missing something!

Description:

I see that all the configurable products now show 'out of stock' when going to the product page on Magento 2.  I am unable to figure out what conditions are used for displaying 'out of stock'.

Basically, I want to ensure that the configurable products show their simple related products in the dropdown options (Magento default themes).  The options are not currently shown because of this issue.

I tried the following:

Checked Tables inventory_stock, inventory_stock_1, cataloginventory_stock_item, cataloginventory_stock_status, inventory_stock,cataloginventory_stock_status.
Only cataloginventory_stock_status has qty of 0.
None of the tables that use stock_status are ever set to 0, everything is always 1.
I even ran update quantity on cataloginventory_stock_status:

UPDATE cataloginventory_stock_status SET qty = 999999 WHERE qty = 0;

Refreshing after clearing cache still showing out of stock, then immediately after reindexing bin/magento indexer:reindex I check cataloginventory_stock_status again, the qty value is set back to 0!

Also:

I noticed that the cataloginventory_stock_status_idx table is always empty even reindexing.  Is this table even used?
I have also tried to see the effect of Manage Stock = 0, but even then those products still show 'Out of Stock'.

I would really appreciate a solution where I can run MySQL queries (since this is a data migration) if possible.

Thanks!

[Update - 2020/05/28]:

Does anybody have any advice regarding this please.

I have been unable to get migrated configurable products to work (still remains out of stock).
The issue: I cannot just delete/reimport products - I need to eventually bin/magento migrate:delta so changing the ID sequences will break delta migration later on from the source database.

(The screenshots here are because of the comment below from @LitExtension Magento Migration).  Only two configurable products are shown - one with 'simple', other with 'virtual' products, because they appear first in my SQL results.

I do not know what is wrong.  Please see if there is anything I'm missing, or what else I need to supply information for.

NOTE:
- I do not have is_in_stock attribute mentioned.  The query returns no results.

    SELECT * FROM eav_attribute ea
    WHERE ea.attribute_code = 'is_in_stock';

[Update Images]:

Image 1 - catalog_product_entity- Filtered products 2x different configurables (one with simple products / other with virtual products)

Image 2 - inventory_source_item - same SKUs and their status.

Image 3 - inventory_stock_1 - This is a View, so I assume as you mentioned when reindex happens cataloginventory_stock_status gets impacted, so the view data return quantity = 0.

Image 4 - Joined data for attribute = 'status'


texts:
I am trying to move top menu after the search bar but its moving into wrapper section.
Code used:

<move element="top.links" destination="header-wrapper" />


texts: call_user_func_array() expects parameter 1 to be a valid callback,class 'Mage_Checkout_Helper_Data' does not have a method in Core\Model\Layout.php

texts:
I updated a Magento shop from 1.7.0.2 to 1.9.2.2 version and now I can't add products to cart and I receive warning every time I reload product page. It's in the function  _generateAction($node, $parent) in Mage\Core\Model\Layout.php and when I add log I get for helper checkout

Mage_Core_Model_Layout_Element Object
(
    [@attributes] => Array
        (
            [helper] => checkout/
        )

)

I am confused, don't know really how to look for solution and where to start from.


texts: How to dispay error message in checkout page when place order

texts:
I'm develop a custom payment method module.When I click place order buttom,page always is loading,can't go to next step.

When I use other paymen method,I can get error message "Some addresses can't be used due to the configurations for specific countries" like picture.

I know the error message is from domain.com/rest/default/V1/carts/mine/payment-information.How to display this kind error message in my payment method?


texts:
My sales order table has total 17000 records. Need to select and show only last 300 records in sales order grid.
I have tried the below code, but it's not working

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $collection->getSelect()->limit(300);
    $this->setCollection($collection);
    return parent::_prepareCollection();
}


texts: Paypal Standard Order Status Shows Pending Payment

texts:
I have upgraded Magento from ver 1.4 to 1.7.0.2. I have placed order successfully from Paypal Standard but order status still show Pending Payment.

I am facing the following issues:

Order status showing Pending Payment.
Orders that have pending payment status not displayed in member account.
No order confirmation email send to customer. other email are working fine on site.

I have found so many questions related to this no clue work for me. Please Help !!

Please Help !!


texts: Suddenly started using another logged in user's session - Magento 2

texts:
This might be too broad of a question but it is a gigantic security issue and I have no idea where to start debugging this.

I was testing some features on my dev server while someone else was logged in on the frontend as well. At one point after refreshing I saw that I was suddenly logged in as the other user's account, I did not even know which email they were using and had never logged in with that account before but I could now do everything from change his password to place orders with his account.

As far as I know I'm not doing anything weird with sessions, but the most likely place I could see this going wrong is a Helper class that is used in various places but that is only used for getting the current user's customer group ID.

It is a fairly standard and clean Magento 2.1.9 installation on a LAMP stack, we started developing two weeks ago so we have one custom module that we are working on right now and no third party modules.


texts: Magento 1.9.2.4 Order Emails Not Working

texts: I am facing a problem with new order emails with magento. I am working on Website Link and I am facing a problem when any customer place a order the order confirmation emails not working and emails are not received by customer and website admin. AOE Scheduler is already configured on the website and there are no errors in the error log. Please assist me to fix this issue. I have already search almost everything on google.


texts: Magento 2 install problem MultipleStoreViewPricing error

texts:
I have a problem in Magento 2 installation. It shows  MultipleStoreViewPricing error
I run the below command php bin/magento setup:upgrade
I have attached screenshot of error here

Can any one help me


texts:
1.I m adding a configurable product in magento ,with some price
and after adding sale tag over it for a particular duration it still shows up after the end of the date.
Price is showing different on the page where all products are listed and different when I open it.

2.Sale product price do not update to back to normal after sale ends.


texts: Fresh Magento installation gives empty response (all browsers)

texts:
I even cant see the install-page!

No PHP-Errors. Just ERR_EMPTY_RESPONSE on Chrome for Example.

Somebody have clue what could cause this?

It seems to me like some type of miss configuration on the webserver itself but want to get 100% sure.

Thx in forward


texts:
I was testing my online store and got this error when I used paypal to checkout:
PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details).

I have searched here but they relate to version 1.7 or 1.8.  Is there a solution for 1.9.1?


texts: Magento Security Tool False Positive? prototype.js identified as compromise injection

texts:
Is anyone else having issues with Magento Security Tool Scanner?
https://account.magento.com/scanner/

Your site is compromised with injected JavaScript. (79)
The malicious code signature(s) has been found in resources:

/js/prototype/prototype.js
/js/prototype/validation.js
/js/scriptaculous/controls.js

I am getting this scan failure on 12 different magento sites so it must be a false positive.  Yesterday all sites were passing the scanner.  Today they all say they are compromised injected with malware.

All warnings on all sites are pointing to prototype.js


texts: sales_order_shipment_save_after fires before shipment actually saved?

texts: I am facing this weird thing: I am using sales_order_shipment_save_after event and in the execute() function calling $order->getShipmentsCollection()->count() which returns number of order shipments at that time. It returns 0 at first time shipping created, and 1 on second and so on. So looks like when it is called, the current shipping actually not yet saved. Just wondering how this can happen. Maybe this is because of transaction but in staging copy of the same site everything works fine and as expected


texts:
I am trying to update Magento from version 2.2.6 to 2.3, but i get this errors:

sh-4.2# composer require magento/product-community-edition 2.3.0 --no-update
./composer.json has been updated

sh-4.2# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
    - The requested package magento/magento-cloud-metapackage could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

This is the composer version:

sh-4.2# composer --version
Composer version 1.7.3 2018-11-01 10:05:06

And this is the composer file.

sh-4.2# more composer.json

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.1.7",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/product-community-edition": "2.3.0",
        "composer/composer": "@alpha",
        "codeko/redsys": "3.0.6",
        "eusonlito/magento2-language-es_es": "^0.0.8",
        "mageplaza/magento-2-spanish-language-pack": "dev-master",
        "lcbrq/magento2-dateformatpatch": "^1.0",
        "magento/magento-cloud-metapackage": "2.3.0"
    },
    "require-dev": {
        "phpunit/phpunit": "~6.2.0",
        "squizlabs/php_codesniffer": "3.2.2",
        "phpmd/phpmd": "@stable",
        "pdepend/pdepend": "2.5.2",
        "lusitanian/oauth": "~0.8.10",
        "sebastian/phpcpd": "~3.0.0",
        "friendsofphp/php-cs-fixer": "~2.10.1"
    },
    "config": {
        "use-include-path": true
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": "app/code/"
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "alpha",
    "prefer-stable": true,
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "magento": {
            "type": "composer",
            "url": "https://repo.magento.com/packages.json"
        }
    },
    "extra": {
        "magento-force": "override"
    }
}

Any idea?

Regards,
JOINSO


texts: Implement Amazon API. Proper way to include files?

texts:
I'm working on a Magento extension and I need to implement Amazon Merchant fullfillment API(https://developer.amazonservices.co.uk/doc/merchantfulfillment/merchantfulfillment/v20150601/php.html/275-1952245-7686132).
And since I'm new in developing extensions(mostly edited existing ones), I'm wondering what is the best way to do this.
Do I just place the files in a separate folder(in the Model dir f.e?) folder and then use require_once to call the ones I need or there's another approach?

I'm sorry if my question is somehow incomplete or unclear. Will do my best to clarify something if needed.


texts: Trouble trying to select a large amount of Attributes for a Product

texts:
I am a newbie with Magento and am having trouble setting up a store and using Attributes. I've created an Attribute of "Compatible Models" to select which "models" each product in my store can work with / fit on. I have 92 different "models" in this Attribute for a product to possibly fit and while most only fit 10-15 models, there are some universal products that essentially can fit every "model." I've tried to select all 92 "models" in this Attribute and Save the product but each time it only selects some - but not all. In my case, it's 51 of the 92. I've found some solutions that make me think this is a database issue due to the total # of characters when you combine all of the 92 "models" being too large for a query but cannot be sure.

I came across this solution which seemed to semi-work but not really solve my issue. Instead it just created another issue:

https://stackoverflow.com/questions/12520702/maximum-of-selected-options-in-multiple-select-attribute-in-magento/

I just tried changing the attribute from "varchar" to "text" and it seemed to work however now these mapped attributes are not showing up in the Layered Navigation nor with my Attribute Splash Page extension which creates unique pages based on a selected Attribute option. While this solution seems to allow the individual product to display all of selected Attributes in the "Additional" tab of the individual product - it does not seem to allow for the filtering, sorting, etc by using the Attribute after changing from "varchar" to "text."

Any update on how I could accomplish this? I managed to get my Product to select up to 92 "models" using my Compatible Model Attribute before switching over the entity from "varchar" to "text" -- Is this due to some sort of MySQL database limit? I honestly need to use the Attributes for Filtering more than I need them to display in the "Additional" tab of the individual product.

Tips?


texts: Magento 2 JS not getting updated in en_CA language view

texts:
I'm facing the weird issue with JS, in my website we are using en_CA as Locale Options where we are generating the static content for en_CA. A few days back it works well, but don't know why it is not working now.

When generating the static content the JS and CSS are generating well and we are able to see them under the pub/themefolder/..

But, when we are browsing the website we are unable to see the changes made in the JS. We even removed the complete code from the JS in pub folder but even then we are unable to see the change in the frontend.

We have tried in private browser, removing the cache from the browser stil the JS modifications are not getting reflected in the frontend.

I have run the following commands, the current mode setting is the default.

setup upgrade
static content
compilation
cache flush
indexing

Also, there is no JS,CSS merging set.

Is any body faced this type of weird issues in Magento2? please share valuable your inputs or suggestions to narrow down the issue.

PS: We are using redis and Varnish cache.

Thanks.


texts: Hide {{var comment}} when field empty in email

texts:
I'm creating new order emails for my company and need some help with the variables. I want to include an order comment in the email, but only if there actually is one. When the field is left empty at customer checkout, I still get this (yellow bar)...

How do I hide the row in the email when the field is left empty? If at all possible.

In the default emails it hides the row and the styling on when the field is left empty, and the code isn't that different.

Here's the code for the row in my email...

        {{var comment}}


texts: Magento2 error Not registered handle mpimageoptimizer_grid_data_source

texts:
I am getting following error Not registered handle mpimageoptimizer_grid_data_source
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="mpimageoptimizer_grid_data_source" xsi:type="string">mpimageoptimizer_grid_collection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="mpimageoptimizer_grid_collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">mageplaza_image_optimizer</argument>
            <argument name="resourceModel" xsi:type="string">Mageplaza\ImageOptimizer\Model\ResourceModel\Image</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="mpimageoptimizer_command_optimize" xsi:type="object">Mageplaza\ImageOptimizer\Console\Command\Optimize</item>
                <item name="mpimageoptimizer_command_scan" xsi:type="object">Mageplaza\ImageOptimizer\Console\Command\Scan</item>
            </argument>
        </arguments>
    </type>


texts:
In the category page I would like to show its corresponding alt for each product image, but by default my theme Claue show the product name in the alt label.

In the phtml file /design/frontend/Mgs/claue/Magento_Catalog/templates/product/list.phtml

 stripTags($_product->getImageLabel(), null, true); ?>

The problem is that for some images  it shows the alternative text and for others it does not and show the alt="".

Somebody could help me?


texts: Magento 1.9 with no security patches got hacked. How to install the security patches without Magento Connect?

texts:
Magento 1.9.1
Porto theme

Our Magento got hacked. The hacker deleted our user accounts and created one for themselves with the user ID of shopmanager1. I had to connect to the database, delete his user account and recreate our user accounts. I had trouble actually re-gaining access to all the Admin features in the Admin panel but I managed to do that. This is the second time this happened in the last 2 weeks so I think I need to figure how they are able to do this?

One of the possible causes I guess is - I didn't install any security patches on top of the 1.9.1 version. I think I should do that. Is there a way to install all the necessary patches without using the Magento Connect tool? The reason I don't want to use the Magento Connect tool is - I disabled it because someone was attacking it few months ago. Also, everytime I used it for anything at all - it just ended up crashing the entire system.

Any suggestions on how I can beef up security will be much appreciated! I already reset all passwords - my Email account, server, account and Admin.


texts: Magento 2 Custom Admin Sub Menu Redirects to White Blank Page!

texts:
I created a Module and I am getting this 404 page error after I hit the submenu link.

Here is the code. I can not figure out what is wrong.
acl.xml
<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="UpperLimits_QuantityToShip::parent" title="QuantityToShip" translate="title" sortOrder="30">
                    <resource id="UpperLimits_QuantityToShip::child" title="Child" translate="title" sortOrder="10">
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

routes.xml --- in app/code/UpperLimits/QuantityToShip/etc/adminhtml/routes.xml
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="productlisting" frontName="productlisting">
            <module name="UpperLimits_QuantityToShip"/>
        </route>
    </router>
</config>

menu.xml -- app/code/UpperLimits/QuantityToShip/etc/adminhtml/menu.xml
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="UpperLimits_QuantityToShip::catalog_productlisting" title="Product Listing" module="UpperLimits_QuantityToShip" sortOrder="200" parent="Magento_Catalog::inventory" action="productlisting/product/index" resource="UpperLimits_QuantityToShip::product"/>
    </menu>
</config>

index php in --- app/code/UpperLimits/QuantityToShip/Controller/adminhtml/Product/index.php

<?php

namespace UpperLimits\QuantityToShip\Controller\Adminhtml\Product;
use Magento\Backend\App\Action;
use Magento\Cms\Model\PageFactory;
use Magento\Framework\App\ResponseInterface;

class Index extends Action
{
  protected $_publicActions = ['index'];
  private $pageFactory;
  public function __construct(
    PageFactory $pageFactory,
    Action\Context $context)
  {
    $this->pageFactory = $pageFactory;
    parent::__construct($context);
  }
  public function execute()
  {
    return $this->pageFactory->create();
  }

      /**
     * IsAllowed go to this page
     *
     * @return bool
     */
    protected function _isAllowed()
    {
        return $this->_authorization->isAllowed('UpperLimits_QuantityToShip::parent');
    }
}

I am not sure what is wrong.
UPDATE:  NOW I AM JUST GETTING A BANK WHITE PAGE, when I hit submenu link.


texts: Setting Default on Varien_Db_Ddl_Table::TYPE_SMALLINT

texts:
I'm using the following for an mysql update. It is adding the column correctly however it is not defining the default. It keeps it setting default to NULL. Any suggestions on where I am going wrong would be greatly appreciated.

<?php
$installer = $this;
$installer->startSetup();

$installer->getConnection()->addColumn($installer->getTable('admin/user'), 'enable_subclass', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
        'nullable'  => false,
        'default'   => '0',
        ), 'Admin Sub-Class Status');

$installer->endSetup();


texts: Add extra column to new order product select

texts: I want to add extra column to search product under new order. How do I do it?


texts: Cant save Price for Bundle product magento

texts:
I'm create new product " bundle " and when choose price is fixed click save ,but product cant save price type is "fixed", product just save is " dynamic ", im create product in localhost save normal but im create on host server product cant save price type is fixed(just Dynamic).
pls help me.Thanks You


texts:
Hi all and nice to meet you.

Some days ago I've modified vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml in order to add a static phrase to every product page.
I know it's not the right way and i should rather override in app/design/ but it worked and it was only for few days.
I regenerated di, static and cache:

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

Everything worked and the phrase was online.

Now I've removed the phrase from vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml. I do the regeneration of everything (di, static and cache) and the phrase is still there. I search for the phrase in the filesystem and it's only inside var/page_cache files.
Why regenerating the cache put the phrase in if it's not present in my templates?
What I'm doing wrong?


texts:
I have created one event for triggering an api on method "sales_order_shipment_save_after". But another 3rd party module is also triggering a same event but I want to call event of 3rd party module first and than call my module's event.
Is it possible ? If yes so can you please guide me how ?


texts:
I am using Sky net extension in Magento as a shipping method but getting this error.

  SkyNet Error: COULD NOT FIND THE TARIFF DETAILS FOR THE PROVIDED CRITERIA, PLEASE REDEFINE YOUR CRITERIA


texts: What is the correct way to create Mock input interface in Web-Api functional test?

texts:
I've already write successfully a Web-Api unit test for a Custom API. But I'm wondering if there is a way to automatically create a Mock for input data for the API?

For example, AccountManagement have:

 /**
     * Create customer account. Perform necessary business operations like sending email.
     *
     * @param \Magento\Customer\Api\Data\CustomerInterface $customer
     * @param string $password
     * @param string $redirectUrl
     * @return \Magento\Customer\Api\Data\CustomerInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function createAccount(
        \Magento\Customer\Api\Data\CustomerInterface $customer,
        $password = null,
        $redirectUrl = ''
    );

There a way to create a Mock for the CustomerInterface using PHPUnit?


texts: Out of stock products still appear in the frontend

texts:
I don't want out of stock products to be appeared in my magento website. I have done the following to ensure I don't see my configurable product in the frontend.

Configurable product inventory - out of stock
Associated products inventory - out of stock, qty - 0
config settings -> quantity to become out of stock - 0
config settings -> display out of stock items - No
config settings -> backorder - No

Inspite of all these settings, I just see "Add to cart" being disabled for this product. But the product still appears in the site when I access it via URL. I don't want this product to be seen in my website anymore by whatever means it may be.

Is showing product without "add to cart" magento default when it means "display out of stock products - No"?

Please clarify this setting? And how should I remove this product from my website using magento default settings? (I don't want the product to be disabled in backend, just hide in frontend). Thanks.


texts:
In Internet Explorer, I am getting this JavaScript error:

Message: Expected identifier, string or number
Line: 42
Char: 17
Code: 0
URI: http://example.com/pub/static/version1537326701/frontend/joe/magento-luma-child-theme/en_US/Magento_Ui/js/modal/confirm.js

My question is, http://example.com/pub/static/version1537326701/frontend/joe/magento-luma-child-theme/en_US/Magento_Ui/js/modal/confirm.js is obviously a cached file, so where is the original file located so I can edit it?


texts: Magento 2 frontend and admin pages are not rendering often

texts: I have installed Magento 2.1.0 with url http://127.0.0.1/magento-2.1.0-blank, then i have enabled developer mode, run static deploy command and compiled command its working fine for sometime. after sometime when i tried front end and back end pages, its continuously loading and not rendering anymore. I'm facing this problem often. What could be the solution? I'm using xampp with windows. I'm running magento 2 in developer mode so please suggest solution accordingly.


texts: magento 2.3 is that posible to upload file in graphql mutation

texts:
i wondering is there any way to upload file in magento 2.3.5
via graphql mutation
is there way suggest the way ?

For REST API how we can upload file in magento 2.3?


texts: custom REST Api - access denied - programmatically solution

texts:
I'm trying to create an extension with a custom REST Api and I created the api2.xml and the model that will retrive my data. The only problem is that in order to access my endpoint I need to go to the admin dashboard and give permissions to access the resources for the guest role otherwise I will recieve an Access denied message when accessing it.

The thing is I'm looking for a programmatically solution, where the user doesn't need to go to the dashboard and do this configurations, does anyone have some idea about this?
Thank you.


texts: daily deal extension - creating empty schedules automatically

texts:
I'm working on Magento 1.9 and I have installed the ( magegiant ) daily deal extension but I noticed this behavior of creating empty schedules, I'm trying to explore to understand the extension but did not succeed on that.
Can anyone help me with that.
Thank you !


texts:
I am new to magento.

I want to create a new forms in my magento website. Some form have to add in the cms pages.

I got reference from This Question

I tried to create pages same like it. but it is not displaying anything.May b its beacause I am using Luxury theme. Help me placing files.

This is my theme path app\design\frontend\mgstheme\luxury

I tried placing file here app\design\frontend\mgstheme\luxury\templateeasylife_customform/form.phtml as Marius told in that answer

What i am doing wrong?

Thankyou


texts: Error while editing product from backend

texts:
I don't know why this is happening. when i click edit/add product button i got error

  Exception #0 (ReflectionException): Class
  Mageplaza\Productslider\Model\Slider\Source\FeaturedProducts does not
  exist

I have downloaded Product slider but it is not working properly so i remove it today.
I have upgrade my magento 2 setup.


texts: Magento customers add new address and edit address problem

texts:
I have added 1 more page to add and edit address (custom address) of Magento.
but adding a new address ( my custom address) is working but edit address it not working.

here is my code

<customer_address_form translate="label">
        Customer My Account Address Edit Form

        <update handle="customer_account"/>
        <reference name="my.account.wrapper">
            <block type="customer/address_edit" name="customer_address_edit" template="customer/address/edit.phtml"/>
        </reference>
    </customer_address_form>

<customer_address_formstaff translate="label">
        Customer My Account Address Edit Form

        <update handle="customer_account"/>
        <reference name="my.account.wrapper">
            <block type="customer/address_editstaff" name="customer_address_editstaff" template="customer/address/editstaff.phtml"/>
        </reference>
    </customer_address_formstaff>

I have block and controller for both type add and edit address. but

Add Default new address is working
project_url/index.php/customer/address/new/

Add Default Edit address is working
project_url/index.php/customer/address/edit/5/

Add Custom new address is working
project_url/index.php/customer/address/newstaff/

Add Custom Edit address is not working ( 404 page not found )
project_url/index.php/customer/address/editstaff/57/

Can anyone help me please?


texts:
I built a module that supposed to solve the following issue:
A multi-site setup with some CMS pages that are shared across the different websites. The problem that we are having is that this is causing duplicate content issues and affecting the SEO rankings. As well I have to add a new config in the admin area which will be filled with store language that is different than magento language for example "en-us" and "en-gb" this because the meta tag must have specific values for each country.

The meta tag will be structures as follows:

link rel="alternate" hreflang="' . $storeLanguage . '" href="' . $baseUrl . $cmsPageUrl . '" /

I have uploaded the code to GitHub repo:

https://github.com/AAbbadi/M2-Language

I want someone to let me know if this repo will solve the issue ? as well what is the best practice to solve this.

P.S: I'm Magento self learner. and I was unable to find someone close to me that can help me!


texts: Elastic search was not working in Magento 2.3.2 (Enterprise edition)

texts:
Here I have configured the elastic search 6.0 in Magento 2.3.2 (Enterprise Edition).
Backend configurations are done and it shows Successfully connected.

FYR, I have attached the screenshot for backend configuration,

After configuring Elastic search 6.0 configurations, I did the following steps,

In Admin panel refresh the Page cache in Cache Management
Clean the cache in server.
After that run the following command in the server

php bin/magento indexer:reindex

But in frontend normal search only working.

Is there any method to check the Elastic search is working or not?

How can we know it's working properly? Suggest me some ideas if anything is missed.

Thanks in Advance :)


texts: Patch SUPEE-6788 - Error after applying this patch to 1.9.1.0

texts:
Most of the site works fine after applying this patch. One exception is that when going to admin->system->cache management->refresh cache, I got the following error. It was just an one-time error. I refreshed the cache again and no error shown. I have no idea what this error means. Should I have any concern?

a:5:{i:0;s:745:"Error in file: "/home/frcb/public_html/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'permission_variable' already exists, query was: CREATE TABLE `permission_variable` (
  `variable_id` int UNSIGNED NOT NULL auto_increment COMMENT 'Variable ID' ,
  `variable_name` varchar(255) NOT NULL default '' COMMENT 'Config Path' ,
  `is_allowed` bool NOT NULL default '0' COMMENT 'Mark that config can be processed by filters' ,
  PRIMARY KEY (`variable_id`, `variable_name`),
  UNIQUE `UNQ_PERMISSION_VARIABLE_VARIABLE_NAME` (`variable_name`)
) COMMENT='System variables that can be processed via content filter' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci";i:1;s:954:"#0 /home/frcb/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/frcb/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.1.1', '1.6.1.2')
#2 /home/frcb/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.1.1', '1.6.1.2')
#3 /home/frcb/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/frcb/public_html/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/frcb/public_html/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /home/frcb/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/frcb/public_html/index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:23:"/index.php/admin/cache/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}


texts:
I am creating a new Magento2 extension, and I want a way to restrict buyers, so that they can install it on one domain.

As I understand, the Magento2 marketplace is not a reference of extensions as it was in Magento 1, but now it stores the extensions and send them to the buyers when someone buys it.

If that is the case, I cannot add license to my extension since I have to provide the extension files to Magento marketplace in advance.

Is my assumption correct?

If yes, how do I license my extension? i.e. how to add license key or put license checks for the extension?


texts:
I created a custom cron job in my custom module. But, when I check the cron schedule, it's all in pending and don't work at all like in the picture below. Does that mean there's error on my cron job?

Cron Job schedule :

crontab.xml :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="custom_crongroup">
        <job name="custom_cronjob" instance="Test\Show\Cron\Test" method="execute">
            <schedule>* * * * *</schedule>
        </job>
    </group>
</config>

Cron/Test.php :

<?php
namespace Test\Show\Cron;
use \Psr\Log\LoggerInterface;

class Test {
    protected $logger;

    public function __construct(LoggerInterface $logger) {
        $this->logger = $logger;
    }

/**
   * Write to system.log
   *
   * @return void
   */

    public function execute() {
        $this->logger->info('Cron Works');
    }

}


texts: How to add default head block in default.xml

texts: I want to add default head block in default.xml file. so if anyone have idea about it then please send me the solution.


texts: Magento 1.9 Hide Taxes in Checkout and Cart

texts:
How can I hide taxes in Checkout and cart?
The taxes should be still calculated in total, but not shown to the customer


texts: Don't show attribute image if there is no

texts:
I set a custom image role, after uploading and selecting the image as "auszeichnung_1" it will appear on the product page.
However if I do not select an image, I get on frontend this error:
Fatal error: Uncaught Error: Call to a member function getValue() on null in /var/www/hifistudio/hsstage/app/design/frontend/TemplateMonster/theme007/Magento_Catalog/templates/product/view/auszeichnungen.phtml:13 Stack trace: #0 /var/www/hifistudio/hsstage/vendor/magento/framework/View/TemplateEngine/Php.php(59): include() #1 /var/www/hifistudio/hsstage/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Attributes), '/var/www/hifist...', Array) #2 /var/www/hifistudio/hsstage/vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template->fetchView('/var/www/hifist...') #3 /var/www/hifistudio/hsstage/vendor/magento/framework/View/Element/AbstractBlock.php(668): Magento\Framework\View\Element\Template->_toHtml() #4 /var/www/hifistudio/hsstage/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Element\AbstractBlock->toHtml() #5 /var/www/hifistudio/hsstage/vendor/magento/framew in /var/www/hifistudio/hsstage/app/design/frontend/TemplateMonster/theme007/Magento_Catalog/templates/product/view/auszeichnungen.phtml on line 13

Can someone help me with the right "if-clause"? I used this code in my phtml:
<?php
$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_product = $block->getProduct();
$productImageAttr = $_product->getCustomAttribute( 'auszeichnung_1' );
$productImage = $this->helper('Magento\Catalog\Helper\Image')
->init($_product, 'auszeichnung_1')
->setImageFile($productImageAttr->getValue());
?>
<img src="<?php echo $productImage->getUrl() ?>"width="50" alt="<?php echo $block->escapeHtml($productImage->getLabel()) ?>" />


texts: Image in grid is not showing up in magento 1.9.3.9

texts:
I am trying to add Image column in the existing module. but images are not showing up. here is the screenshot.

8 and 9 are having the image because I added it in MySQL.

here is my code.
Grid.php

   $this->addColumn('file', array(
    'header'    => Mage::helper('tv_faq')->__('Image'),
    'align'     =>'left',
    'index'     => 'file',
    'renderer' => 'tv_faq/adminhtml_renderer_image',
    'width'     => '150px'
    ));

form.php

    $fieldset->addField('file', 'image', array(
        'label'     => Mage::helper('tv_faq')->__('Image'),
        'class'     => '',
        'required'  => false,
        'name'      => 'file',
        ));

TV/Faq/Block/Adminhtml/Renderer/Image.php

    public function render(Varien_Object $row){
    if($row->getFile()!=''){
        $image = Mage::getBaseUrl('media').$row->getFile();
        return sprintf('<img src="%s" width="150px" alt="%s"/>',$image, $this->escapeHtml($row->getTitle()));
    }
}

FaqController.php

    public function saveAction()
{
    // check if data sent
    if ($data = $this->getRequest()->getPost()) {

        // init model and set data
        $model = Mage::getModel('tv_faq/faq')
        ->setCreationTime(Mage::getSingleton('core/date')->gmtDate())
        ->setImage($data['file'])
        ->setData($data)
        ->save();

        // try to save it
        try {
            // save the data
            $model->save();

            // display success message
            Mage::getSingleton('adminhtml/session')->addSuccess(
                    Mage::helper('cms')->__('FAQ Item was successfully saved')
            );
            // clear previously saved data from session
            Mage::getSingleton('adminhtml/session')->setFormData(false);
            // check if 'Save and Continue'
            if ($this->getRequest()->getParam('back')) {
                $this->_redirect('*/*/edit', array (
                        'faq_id' => $model->getId() ));
                return;
            }
            // go to grid
            $this->_redirect('*/*/');
            return;

        }
        catch (Exception $e) {
            // display error message
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
            // save data in session
            Mage::getSingleton('adminhtml/session')->setFormData($data);
            // redirect to edit form
            $this->_redirect('*/*/edit', array (
                    'faq_id' => $this->getRequest()->getParam('faq_id') ));
            return;
        }
    }
    $this->_redirect('*/*/');
}

src of image


texts: Upgrade to 2.2.6 missing static JS files

texts:
When I upgraded my Magento 2.2.2 to 2.2.6.

I got one critical error in pub/static missing one file named trim-input.js

  "pub/static/version1540806968/frontend/{...}/{...}/pl_PL/mage/trim-input.js"

I try add this to requirejs-config.js:

var config = {
    map: {
        '*': {
            'trimInput': 'mage/trim-input'
        }
    },
};

How can I add this to static content?

I cant add it in pub/static/... because after bin/console exec setup:static-content:deploy -f file was deleted.


texts: Magento customise PDF and add product attribute data in payment block

texts:
I want to add the product(configurable) attribute value in payment block

I tried to edit below file

  app/design/adminhtml/default/default/template/payment/info/default.phtml

but no luck


texts:
I have uploaded product through csv and upload images through FTP and allocate the path folder path into csv for images. but images not shown or allocated for product.

How could i upload bulk product images ?


texts: How to allow uploading ZIP files(.rar) in wysiwyg editor

texts:
I tried on the wysiwyg editor  to upload zip files but it's not allowed.
I created a folder where I uploaded a picture, and then I added manually some zip files inside. But when I open that folder in editor, I can't see my zip files, i can see only the picture.

It there any way to allow uploading a zip files?


texts: Maintenance mode without maintenance.flag

texts: I have a problem. My magento puts itself to maintenance mode without maintenance.flag. At this time i did not do any installations or backups. Last time this happened i restore the database to last day and all was ok, but now i cannot restore database to the day when magento is working.


texts:
I need to add a field that I did to the customer, but also to the admin user.  I have the customer one working,

$installer->addAttribute('customer', 'ldap_user', array(
    'type'         => 'int',
    'input'        => 'select',
    'source'       => 'eav/entity_attribute_source_boolean',
    'label'             => 'Has AD account',
    'visible'           => true,
    'required'          => false,
));
$attr = Mage::getSingleton( 'eav/config' )->getAttribute( 'customer', 'ldap_user' );
$attr->setData( 'used_in_forms', array( 'adminhtml_customer' ) );
$attr->save();

But I can't seem to find anything on how to do one for the admin user and all attempts so far to convert this to the admin/user model has failed.  Any ideas on the correct way to add this field?

*UPDATE
Base on @Marius answer I'm closer.  The install part works, and the column was added.  The tab prepare Form is not yes right.  I put

\app\code\local\Wsu\NetworkSecurities\Block\Adminhtml\Permissions\User\Edit\Tab\Main.php

<?php
class Wsu_NetworkSecurities_Block_Adminhtml_Permissions_User_Edit_Tab_Main extends Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Main {

  protected function _prepareForm() {

        parent::_prepareForm();
        $form = $this->getForm();
        $fieldset = $form->getElements()->searchById('user_base_fieldset');

        $fieldset->addField('ldap_user', 'select', array(
            'name'      => 'is_active',
            'label'     => Mage::helper('adminhtml')->__('LDAP user'),
            'id'        => 'is_active',
            'title'     => Mage::helper('adminhtml')->__('LDAP user'),
            'class'     => 'input-select',
            'style'     => 'width: 80px',
            'options'   => array('1' => Mage::helper('adminhtml')->__('Yes'), '0' => Mage::helper('adminhtml')->__('No')),
        ));
        $this->setForm($form);

        return $this;

  }

}

But I am not seeing it.  I can see also I think I need to rewrite system_account/index too I would think?

/etc/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Wsu_NetworkSecurities>
            <version>0.1.0</version>
        </Wsu_NetworkSecurities>
    </modules>
    <global>
        <blocks>
            <wsu_networksecurities>
                <class>Wsu_NetworkSecurities_Block</class>
            </wsu_networksecurities>
    <adminhtml>
        <rewrite>
            <permissions_user_edit_tab_main>Wsu_NetworkSecurities_Block_Adminhtml_Permissions_User_Edit_Tab_Main</permissions_user_edit_tab_main>
        </rewrite>
    </adminhtml>
        </blocks>
    </global>
</config>

That is what I have for the blocks.

UPDATE

So this works to add a new fieldset and add the field, but it never could get in the main fieldset, but it works.

  protected function _prepareForm() {

        parent::_prepareForm();
        $form = $this->getForm();

        $fieldset = $form->addFieldset('LDAP', array(
            'legend' => Mage::helper('adminhtml')->__('User Info'),
            'class' => 'fieldset-wide'
        ));

        $fieldset->addField('ldap_user', 'select', array(
            'name'      => 'is_active',
            'label'     => Mage::helper('adminhtml')->__('LDAP user'),
            'id'        => 'is_active',
            'title'     => Mage::helper('adminhtml')->__('LDAP user'),
            'class'     => 'input-select',
            'style'     => 'width: 80px',
            'options'   => array('1' => Mage::helper('adminhtml')->__('Yes'), '0' => Mage::helper('adminhtml')->__('No')),
        ));

        return $this;

  }

}


texts: Magento 2 call url param in Model Collection filter

texts:
I'm trying to get some data that matches the id in the URL. I have a param in admin URL like below.
seller/items/index/id/9/

I'm using the admin UI component which is working fine.
My model code below.
protected function _initSelect() {

$urlInterface = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\UrlInterface');
$getId = explode("/",$urlInterface->getCurrentUrl());
$idString = $getId[9];
//$id = (int)$idString;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$request = $objectManager->get('Magento\Framework\App\Request\Http');
$id = $param = $request->getParam('id');
$this->addFilterToMap('increment_id', 'main_table.increment_id');
$this->addFilterToMap('status', 'main_table.status');

$this->getSelect();
parent::_initSelect();
$this->addFieldToFilter('main_table.seller_id', ['eq' => $id]);

return $this;
}

I'm getting the Id in this model page when I var_dump. But it is not filtering. It is showing zero records, but if I give static id in the condition it works. Seems like the model starts loading before the page rendered.


texts: Magento 1.9.0.1 CE Product Image Upload - File was not uploaded

texts:
I recently installed a new installation of Magento CE 1.9.0.1.

I am attempting to upload my product images Catalog->Manage Products->Edit Product->Images

Then I Browse Files and choose my .jpg file.

I then click the Upload Files button.

I get a red box that says, "File was not uploaded."  I checked the code and modified this section:  throw new Exception('File was not uploaded. Error='.$this->_file['error'], $code); in lib/Varien/File/Uploader.php

The error code I get is 0

Which I thought meant success....so I am very confused.

I have my tmp dirs all set to 777 including the one listed in phpinfo()

Any ideas where I am going wrong or what I need to do to upload image files?

Thanks,

Jim Nickel


texts:
How can i hide empty attributes from compare product? is it possible ? if yes how ?
For better understanding i attached image please look in it.

Thank you in advance.


texts: How to create a repeater field (like Minsaleqty, Regexceptions) inside admin form in Magento 2?

texts:
I've created a module that adds a custom form inside magento which is similar to the create order or create product forms. The form is used to create requests for marketing material from our art department.

I have successfully created my form partly thanks to this tutorial but one piece is missing. What I'm trying to do is add a field with two side-by-side items (a select box and a text input).

Magento has the exact functionality I need built in, two examples include Magento\CatalogInventory\Block\Adminhtml\Form\Field\Minsaleqty:

Magento\Config\Block\System\Config\Form\Field\Regexceptions:

However, I can't figure out how to alter these for use in an admin form. In case my terminology is unclear, the above fields are added using system.xml like so:

#file module-catalog-inventory/etc/adminhtml/system.xml
<field id="min_sale_qty" translate="label" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
    <label>Minimum Qty Allowed in Shopping Cart</label>
    <frontend_model>Magento\CatalogInventory\Block\Adminhtml\Form\Field\Minsaleqty</frontend_model>
    <backend_model>Magento\CatalogInventory\Model\System\Config\Backend\Minsaleqty</backend_model>
</field>

Whereas my fields are built by extending Magento\Backend\Block\Widget\Grid\Container and creating tabs that add fields using php methods. Here is one tab:

namespace Vendor\Module\Block\Adminhtml\SaleSheets\Edit\Tab;
class Info extends Generic implements TabInterface
{
    protected function _prepareForm()
    {
        /** @var $model \Vendor\Module\Model\SaleSheets */
        $model = $this->_coreRegistry->registry('vendor_salesheets');
        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create();
        $form->setHtmlIdPrefix('salesheets_');
        $form->setFieldNameSuffix('salesheets');

        $fieldset = $form->addFieldset(
            'base_fieldset',
            ['legend' => __('General')]
        );

        if ($model->getId()) {
            $fieldset->addField(
                'id',
                'hidden',
                ['name' => 'id']
            );
        }

        // ...additional fields for this tab

        $data = $model->getData();
        $form->setValues($data);
        $this->setForm($form);
        return parent::_prepareForm();
    }

}

Result:

My end result will be an additional field to my form that is repeatable with the Add and Delete action, and which includes a select box and an empty text field for additional details. How can I get this functionality in my admin form? Any help for this would be appreciated, including tutorials or even pointing me to a plugin that does something similar that I can buy just to reference.


texts: Enterprise Rewards, how to specify the points to be used in quote

texts:
Magento EE have the Reward module but the problem is that it's designed for the client to use all of his points everytime, if he have more than quote total, it uses all the necessary points and stay in the remaining points linked to the client. Example:

(To illustrate, 1000 points = U$ 15)

Client points: 11000
Current quote Subtotal: U$ 50
If client opt to use the rewards will be
4000 points used (U$ 60)
quote subtotal 0
remaining points 7000

What i need is to make able for the client to choose how many points to use in the case he could use: 1000=15,2000=30,3000=45, 4000=60(turns the order free)

I made some tests and in the Reward module, CartController, added an addAction() (reward/cart/add) where i call something like this:

 $quote->setUseRewardPoints(true)
                ->collectTotals()
                ->save();

And i edited the totals from reward in a test purpose Enterprise_Reward_Model_Total_Quote_Reward  forcing in the collect method this:

        $amount = 15;
        $points = $reward->getPointsEquivalent($amount);

        $quote->setRewardPointsBalance($points);
        $quote->setRewardCurrencyAmount($amount);
        $quote->setBaseRewardCurrencyAmount($amount);

        $address->setRewardPointsBalance($points);
        $address->setRewardCurrencyAmount($amount);
        $address->setBaseRewardCurrencyAmount($amount);

        $address->setGrandTotal($address->getGrandTotal() - $amount);
        $address->setBaseGrandTotal($address->getBaseGrandTotal() - $amount);

This works great in cart and saves correctly in sales_flat_quote table:
use_reward_points: 1
reward_points_balance: 1000
base_reward_currency_amount: 15.0000
reward_currency_amount: 15.0000

The problem is that in checkout(checkout/onepage native in CE and EE) after i choose the payment method(generally check money order for test purpose) my total is not there anymore with the rewards and the grand total is 55 (50 + 5 from the fixed flat rate) normally...

I was looking in the Observer to see if is there any "shenanigans" that maipulates the quote final value...

But in the end what i really need is to have a way to the client use partially his reward ponits...