texts: how to display product sku through product id in admin grid in magento2

texts:
everyone, I want to display product SKU in admin grid I have the product name .
 code for a display product name is below

  ui_componeny/index.xml

<column name="entity_id"
 class="Magneto\SampleRequest\Ui\Component\Listing\Column\Products">
        <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
        <item name="visible" xsi:type="boolean">true</item>
        <item name="label" xsi:type="string" translate="true">Products
    name</item>
        </item>
        </argument>
        </column>

  product.php

<?php
namespace Magneto\SampleRequest\Ui\Component\Listing\Column;
use \Magento\Catalog\Api\ProductRepositoryInterface;
 use \Magento\Framework\View\Element\UiComponent\ContextInterface;
 use \Magento\Framework\View\Element\UiComponentFactory;
 use \Magento\Ui\Component\Listing\Columns\Column;
 class Products extends Column
   {
  protected $_ProductRepository;
public function __construct(
ContextInterface $context,
 UiComponentFactory $uiComponentFactory,
 ProductRepositoryInterface $ProductRepository,
  array $components = [],
  array $data = [])
   {
   $this->_ProductRepository = $ProductRepository;
    parent::__construct($context, $uiComponentFactory, $components,
   $data);
    }
     public function prepareDataSource(array $dataSource)
       {
     if (isset($dataSource['data']['items'])) {
    foreach ($dataSource['data']['items'] as $key => $items) {
        $product = $this->_ProductRepository-
      >getById($items["entity_id"]);
        $dataSource['data']['items'][$key]['entity_id'] = $product-
       >getName(); //to get product name
       }
      }
       return $dataSource;
      }
       }


texts: Default Stock Status & Quantity | Default Swatch Images

texts:
Roadblocks for newbies are endless in Magento 2 and we are not exceptions. At this moment, we are stuck in the following problems. Any suggestions are welcome.

After importing each product using Webkul Aliexpress Importer, we are
setting stock status and quantity manually since by default there is
"out of stock" in stock status and "0" in quantity. The developer
didn't help much. Is there any way to set them by default "In Stock"
and with some quantity?

While importing products with swatch images, they appear in dropdown    box on our website. Any suggestions how to set swatch by
default?


texts: Fetching the missed orders during development after migration

texts:
I have upgraded magento1.x website to magento2. Actually, I upgraded DB using data migration tool. After the data migration, worked with theme setup in development server. Now the website is ready. And during the development of theme, I placed some orders too.

But now, the problem is, after theme and modules setup which is nearly after two months, website has to be made live. So the problem is, for these two months, there were some orders in the old site. We need to fetch those too.

As the upgraded DB has lot of content changes, It's not able to go back with the migration tool. How can we fetch the missed orders during the development period?


texts: Is there any easiest way to make changes CSS & JS, and show changes without setup:static-content:deploy & without disabling static content generation?

texts:
Can anyone suggest the easiest way to make changes CSS & JS without

setup:static-content:deploy

every time.

And without disabling static content generation.


texts: How to remove the product_list_toolbar from a specific catalog page?

texts:
How do can you remove the product_list_toolbar from a specific category page??

I've tried adding the below to the Custom Layout Update of the the category in Catalog -> Manage Categories  under the Custom Design tab from the Magento Admin Panel.

<reference name="product_list">
  <remove name="product_list_toolbar" />
</reference>


texts: Delivery costs are not being added to total

texts:
I find that when i add some products too my basket the delivery costs are no being called in the totals block

But when i add more products and go back to the cart then the delivery charges have been added, i have turned on the template hints and I can see the template shipping.phtml isn't being called when i view the basket first but is being called once i go off the cart adn add another product.

The .phtml file that is calling the shipping.phtml is totals.phtml

<?php if ($this->canApplyMsrp()): ?>

<?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?>

<?php else: ?>

        <col />
        <col width="1" />

            <?php echo $this->renderTotals('footer'); ?>

            <?php echo $this->renderTotals(); ?>

<?php endif; ?>

But i cant see anything which calls the shipping, So i am stuck as to where to look or what is going on, if someone could shed some light on my situation or know how to fix this problem could you let me know.

Thank you


texts: Magento2: Multiple stores (groups) under single website

texts:
I want to have a single website with a single domain/URL. Under that website I want to have two stores, each of which will have one single store view.

One store is intended for regular browser clients, and the other store is for clients which use a specific mobile app which has its own browser with a unique user agent. The people I'm building this for want to showcase different products in that app.

I'm running Magento2 with nginx 1.8 and php-fpm 7.0

I thought I could set this up by modifying my index.php as seen in numerous examples. Even the official documentation shows this, saying that I need to set MAGE_RUN_TYPE to either store or website and MAGE_RUN_CODE to the one that I want.

My problem is that I cannot figure out what to set as value for MAGE_RUN_CODE! Looking in the backend and database, stores (db table store_group) don't have a code! Only websites and store views have a code, and every single example I can find on the internet uses MAGE_RUN_TYPE='website' which doesn't help me.

How do I tell Magento which store I want to show?


texts: Load visible and invisible products at once?

texts:
This is my code:

$visibility = array(
   Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
   Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG,
   Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE
);

 $_productCollection = Mage::getSingleton('catalog/category')
    ->load($_categoryId)
    ->getProductCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('visibility', $visibility);

I want to get all products, no matter what visibility they have. The code above skips those that are not visible though. Whats wrong? Is there another way to do what I want?


texts: How to change tab order on product page?

texts:
I added some custom tabs to magento, but I can't change order of that. I tried do it by xml by set priority and I even tried overwrite table in details.phtml in fona core, but it don't work. I want do it something like this
PRODUCT TAB | CUSTOM TAB | REVIEWS, but now it's PRODUCT TAB | REVIEWS | CUSTOM TAB


texts:
How to export only all category & all product data from one site and import in another site.
Export and import both site magento version is same(1.9)


texts: Magento 2: How to unset existing custom option and set new custom option and add product in cart programmatically

texts:
I am using Magento 2.3.1, and I have products which have one custom option that is required.
Now I have create a custom controller to add product in cart without existing custom options as sample Order, when I add product in cart it give me error "The product's required option(s) weren't entered. Make sure the options are entered and try again". So I want to unset the existing custom option and set my custom value as custom option and add product in cart.
I am using below code to add product in cart:
<?php
namespace Vendor\Module\Controller\Index;

use Magento\Framework\App\Action\Context;
use Magento\Framework\Data\Form\FormKey;
use Magento\Checkout\Model\Cart as cartModel;
use Magento\Catalog\Model\Product;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Catalog\Model\ProductRepository;
use Magento\Framework\Controller\Result\RedirectFactory;
use Magento\Framework\App\Request\Http;
use Magento\Catalog\Model\Product\Option;

class Cart extends \Magento\Framework\App\Action\Action
{
    protected $formKey;
    protected $cart;
    protected $product;

    protected $serializer;

    protected $_productRepository;

    protected $resultRedirectFactory;

    protected $request;

    protected $productOptions;

    public function __construct(
        Context $context,
        FormKey $formKey,
        cartModel $cart,
        Product $product,
        SerializerInterface $serializer,
        ProductRepository $productRepository,
        RedirectFactory $resultRedirectFactory,
        Http $request,
        Option $productOptions

        ) {
            $this->formKey = $formKey;
            $this->cart = $cart;
            $this->product = $product;
            $this->serializer = $serializer;
            $this->_productRepository = $productRepository;
            $this->resultRedirectFactory = $resultRedirectFactory;
            $this->request = $request;
            $this->productOptions = $productOptions;
            parent::__construct($context);
    }
    public function execute()
     {
        $productId = $this->request->getParam('productid');

        $_product = $this->product->load($productId);

        $customOptionss = $this->productOptions->getProductOptionCollection($_product);

        $additionalOptions[] = array(
            'label' => "Is order Sample",
            'value' => "Yes",
        );

        $params = array(
                'form_key' => $this->formKey->getFormKey(),
                'product' => $productId,
                'qty' => 1,
            );

        $_product = $this->_productRepository->getById($productId);
        $_product->addCustomOption('additional_options', $this->serializer->serialize($additionalOptions));
        $customPrice = 0.0;
        $_product->setPrice($customPrice);
        $_product->setIsSuperMode(true);
        $this->cart->addProduct($_product, $params);
        $this->cart->save();

        $resultRedirect = $this->resultRedirectFactory->create();
        $resultRedirect->setPath('checkout/cart');
        return $resultRedirect;
     }
}

Please let me know how to do this.
Thanks


texts: Magento2 Configurable product stock management

texts: What configuration should I do to decrement corresponding child product that have been sold (invoiced and shipped) of a configurable product?


texts: Changing attribute type (dropdown to textfield)

texts:
I'm wondering if there is a simple way to change an attribute from dropdown to text field? We had a development shop set up our Magento website but they made the fields dropdown and we have entered considerable data and would like to change it to text field now that dropdown is proving to be a considerable hassle... even if the data isn't imported during the change... I'm sure we can reimport it. But I'd like to avoid having to delete the attributes.

I've seen Magento Code for Text to Dropdown and Dropdown to Multiselect... but I haven't found any for Dropdown to Textfield.


texts: Magento 2. Copy files from elastic search map to custom theme in Magento

texts:
Has someone worked this out?

I would like to copy the css file located in

/app/code/Wyomind/Elasticsearch/view/frontend/web/css/autocomplete.css

to my custom theme folder (app/design/frontend/... map).

What should be the right location in my custom theme to save the file? I tried

app/design/frontend/XX/theme-frontend-default/Wyomind_Elasticsearch/styles/autocomplete.css

but that did not work. Do you have any tips?


texts: Adding billing_phone to sales_order_invoice_grid.xml in magento 2.3.2

texts:
I was trying to add billing phone to sales_order_invoice_grid.xml.how to do that. i added this code in app\code\Magento\Sales\view\adminhtml\ui_component\sales_order_invoice_grid.xml.
<column name="telephone">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Phone Number</item>
                <item name="sortOrder" xsi:type="number">6</item>
            </item>
        </argument>
    </column>

app\code\Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection.php
namespace Magento\Sales\Model\ResourceModel\Order\Invoice\Grid;

use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Sales\Ui\Component\DataProvider\Document;
use Psr\Log\LoggerInterface as Logger;

class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
{
    /**
     * @inheritdoc
     */
    protected $document = Document::class;

    /**
     * Initialize dependencies.
     *
     * @param EntityFactory $entityFactory
     * @param Logger $logger
     * @param FetchStrategy $fetchStrategy
     * @param EventManager $eventManager
     * @param string $mainTable
     * @param string $resourceModel
     */
    public function __construct(
        EntityFactory $entityFactory,
        Logger $logger,
        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        $mainTable = 'sales_invoice_grid',
        $resourceModel = \Magento\Sales\Model\ResourceModel\Order\Invoice::class
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
    }
     protected function _renderFiltersBefore()
    {
    $joinTable = $this->getTable('sales_order_address');
    $this->getSelect()->joinLeft($joinTable, "main_table.entity_id =
    {$joinTable}.parent_id AND {$joinTable}.address_type = 'billing'",
      ['telephone']);
       parent::_renderFiltersBefore();
   }
}

but phone fields are wrong.how to correct it
how to take value from database. can anyone show the exact file and code.


texts: Set special from date and special to date in Magento 2

texts:
I want set special from date and special to date in Magento 2, i tryed this code but it not work. please help me.

foreach ($collection as $products) {
        $_product = $objectManager->create('\Magento\Catalog\Model\Product')->load($products->getProductId());
        $_product->setSpecialFromDate(date('Y-m-d', strtotime($products->getStartDate())));
        $_product->setSpecialToDate(date('Y-m-d', strtotime($products->getEndDate())));
        $_product->save();
    }

$products->getStartDate() = string(19) "2019-10-20 00:00:00"

$products->getEndDate() = string(19) "2019-10-20 00:00:00"


texts: Magento 1.6.2 Change attributes of multiple products in product grid

texts:
I added some custom attributes that will be run as a promotion (2x1, 3x1) and now I want to update several products at once.

Is this possible using the product grid in backend? I already modified the visibility of the grid to be able to show the attribute, but would like to avoid edit / save each product.

If not possible by default, what would be the reccommended way to do it?

Regards.


texts: Where is the config.local.php in magento 2.1

texts:
According to the magento 2 upgrade to 2.1.7 to 2.2 they highlighted "config.local.php" file. I cant find it, can anyone know where is it ?
http://devdocs.magento.com/guides/v2.2/cloud/project/project-upgrade.html


texts: When child product visibility is set to 'Not visible individually' don't redirect to 404

texts:
For my store I want to create the situation where children of Configurable Products that are set to 'Not Visible Individually' are accessable anyway, when the direct URL is provided. Currently it returns a 404-error.

The purpose of this is, so we can only load the direct URLs in Google Shopping using Product Feeds, but not display the products in either Search or Catalog on the site.

I have no idea where to start. Can anyone help me out?

Update:

Using Marius' code from another question I created a module with the following code in /Namespace/Modulename/Model/Observer.php

<?php
     class Namespace_Modulename_Model_Observer {
        public function redirectToUrl($observer) {
            $id = Mage::app()->getRequest()->getParam('id');
            $_product = Mage::getModel('catalog/product')->load($id);

            $urlKey = $_product->getProductUrl($id);

            if (isset($urlKey)) {

            Mage::app()->getResponse()->setRedirect($urlKey, 301);
            Mage::app()->getResponse()->sendResponse();
            exit;
        }
        return $this;
    }
} ?>

This (obviously) sends the server in a loop, as I'm trying to send it to the simple product's page and Magento is trying to send it back to 404.

I think I'm very close to a solution, because all that needs to be done now (I think) is a way to overwrite Magento's default behavior of sending it to 404.

Any ideas?

Update #2

It's starting to seem that what I want is impossible and I can't find anything on the internet that can help me out.


texts: Magento2 Documentation Suggestions or Issue Raising

texts:
Is there any way to make Suggestions or Raise Issues regarding the official Magento 2 docs?

If so where and how is the best way to go about it?


texts: How to add out of stock product to cart programmatically in Magento 2.3

texts:
I'm using Magento v2.3, I want to add out of stock products to cart without changing any configuration from backend.

I'm using following function to add product to cart

addProduct($productInfo, $requestInfo)

from following class

  Magento\Checkout\Model\Cart

But it checks for saleable quantity.

Is there any way to ignore saleable check and add out of stock products to cart?


texts: Magento 2 How to get Product details in CMS block using product id or SKU?

texts: How to get product details in CMS Block using product Id or SKU in Magento 2.


texts: Magento 2.3.4 low stock report only showing items when stock level is 0 and marked as in stock then saved manually

texts: When the qty of a product is 1 and is sold it doesn't show up in the low stock report, when that same product is marked as shipped it doesn't show up in the low stock report but when I manually save the product as qty 0 and in stock it changes to out of stock and it shows up in the low stock report. Out of stock threshold is set to 0 Anyone had this issue or knows how to fix it?


texts: Configurable products Show "From" next to price in category/product page

texts:
Magento 1.9 Community. Im trying to show a "From" next to price of configurable products in category/product view page. My template "Milano" has a file list.phtml for categories and i have changed the code to the following :

<?php if ($_product->isConfigurable()) { ?>

<?php echo $this->__('From ') ?>
<?php echo $this->getPriceHtml($_product, true) ?>
                    <?php } else { ?>
                    <?php echo $this->getPriceHtml($_product, true) ?>
                    <?php } ?>

The problem is that the "from" is also visible to configurable products that they don't have different prices. I also used the next code that checks min and max

$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$_product);
                    $childPriceLowest = "";
                    $childPriceHighest = "";
                    foreach($childProducts as $child){
                        $_child = Mage::getModel('catalog/product')->load($child->getId());

                        if($childPriceLowest == '' || $childPriceLowest > $_child->getPrice() )
                        $childPriceLowest =  $_child->getPrice();

                        if($childPriceHighest == '' || $childPriceHighest < $_child->getPrice() )
                        $childPriceHighest =  $_child->getPrice();

and added a the end the if childpricelowest = childpricehighest then show only price but the page goes white screen.

Perhaps someone can put the together correctly or give another solution?


texts:
This is my inefficent code for searching for an attribute group. Can anyone help me come up with a more efficient method. I know I want to use a model that supports addAttributeToFilter or similar.

function Group_Exists($group_name, $set_magento_id)
{
    $attributeSetCollection =
         Mage::getResourceModel('eav/entity_attribute_group_collection')
                                   ->load();

    foreach ($attributeSetCollection as $id=>$attributeGroup) {
        if ( $attributeGroup->getAttributeGroupName() == $group_name &&
             $attributeGroup->getAttributeSetId() == $set_magento_id )
        {
             return $attributeGroup->getAttributeGroupId();
        }
    }

}


texts: Magento 2.3 - Transactional email remove time from order date

texts:
How can we remove the time in the order created date inside the transactional email?

We now load it like this; {{var created_at_formatted}} and displayed as: 9 apr. 2020 11:17:59

We want to remove the time and change the format to 9 April 2020.


texts:
We're on 2.1.0 Community, but I think this problem has existed since 2.0.
When I try to view tracking on FedEx tracking # (am using an actual live tracking #), I get an error.  Am I doing something wrong, or not doing something?  Thanks in advance.

Neither FedEx nor UPS shipping methods are enabled for checkout in the Store > Configuration since we're using ShipperHQ extension.
UPS tracking has no problems.
UPS tracking works without the shipping method being enabled and without credentials.

As a test, I thought maybe FedEx may require credentials.

So, after applying the FedEx's (production) credential, but shipping method still disabled for checkout, then I get the following error message.

1 exception(s):
Exception -0 (Exception): Notice: Undefined property: stdClass::$ActualDeliveryAddress in /var/www/magento2/vendor/magento/module-fedex/Model/Carrier.php on line 1085

Exception -0 (Exception): Notice: Undefined property: stdClass::$ActualDeliveryAddress in /var/www/magento2/vendor/magento/module-fedex/Model/Carrier.php on line 1085
-0 /var/www/magento2/vendor/magento/module-fedex/Model/Carrier.php(1085): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined prope...', '/var/www/magent...', 1085, Array)


texts: Rename a default product type in magento

texts: I want to just rename 'Simple Product' into  'Car Parts' in Magento product type.


texts: Display a custom text at the top of order grid

texts:
I have saved AWB no.s in my database and it is alloted according to a particular algorithm.
I have specified a range of AWB no.s. From my order grid, I select the orders and allot AWB no.s to them.

I want to display the limit attribute of the AWB table in my orders grid.

How can I do this ?


texts: Disabling a UI component field upon condition in Magento 2

texts:
I have a UI component defining some fields. How do I disable the field upon a certain condition? In other words, use <item name="disabled" xsi:type="boolean">true</item> only when a condition is met. Here's my field.

<field name="name">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Profile Name</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">profile</item>
                <item name="dataScope" xsi:type="string">name</item>
            </item>
        </argument>
    </field>


texts: Product Imports using ho-nl/Ho_Import not displaying in frontpage until I choose an additional category and save

texts:
Im working with Catalog_Product Import using extension ho-nl/Ho_Import. My current import procedure place the product with a checkbox in its category as you can see on the image.

But the problem is that the product is not displayed until I go to categories and select another one like Root Catalog and save again the product.

In that moment the product appears in the frontend. Is this a code problem or do I need to setup additional information on the lightweight module?. my current info for category is:

<_category field="_category" />

and in import options:

        <import_options>
            <partial_indexing>1</partial_indexing>

any help appreciated.


texts: Don't upgrade the price when customer select options in dropdown

texts:
I want to remove the price upgrade when customer select an options in dropdown menu.

IE: If normal price is 100$, and the customer selects a color ( +20 $ ) the price increases to 120$. I don't want the price to change, I'd like it to stay 100$

I'm use Magento 1.9.0.1 with Rwd theme.


texts: how do I make customer order numbers in magento 2.3?

texts:
I want to make Magento custom order ids.
I see Magento 2 system order number starts from 1,2 etc.. I want to make it customer like
OD-010121-5001.
I see many extensions are available in market but they costs high. I wanted to do it on my own to learn things as much as possible.
I can do DB and xml editing.


texts: add an observer when save in system->configuration

texts:
I need to add an observer in my module's config.xml file, the event is when the user press the button Save Config in System->Configuration->MyModule section of the Admin-panel.
I've this in config.xml:

<global>
...
        <events>
            <admin_system_config_changed_section_sectionname>
                <observers>
                    <module_name>
                        <class>module_name/observer</class>
                        <method>handle_adminSystemConfigChangedSection</method>
                    </module_name>
                </observers>
            </admin_system_config_changed_section_sectionname>
        </events>

And this is what i have in Model/Observer.php :

<?php
class Modulename_Model_Observer
{
    public function handle_adminSystemConfigChangedSection(Varien_Event_Observer $observer)
    {
        Mage::log('Test: oberver is working!');
    }
}

When i check var/log/system.log there's nothing there. So the observer is not working. What's wrong?.

EDIT (SOLVED):

I managed to add the observer correctly.

config.xml file:

<admin_system_config_changed_section_sectionaname>
    <observers>
        <modulename>
            <type>singleton</type>
            <class>modulename/observer</class>
            <method>observersection</method>
        </modulename>
    </observers>
</admin_system_config_changed_section_sectionaname>

Observer.php:

<?php
class Modulename_Model_Observer extends Mage_Core_Model_Session_Abstract
{

    public function observersection(Varien_Event_Observer $observer)
    {
        die("");
    }
}


texts: List configurable products with certain criteria

texts:
Is it possible to list all configurable products either on page or in SQL most likely to display any configurable products that have NO associated simple products on them.

For example - I have ~ 1,000 configurable products and to ensure none have been missed out having simple products assigned to them I want to be able to check without going through each one.

Also - the other way round is it possible to list simple products that have not been added to any configurable products at all?


texts: Using Magento API(REST) via IXMLHTTPRequest COM Object

texts:
We have downloaded Magento Community Edition ver 1.9.1.0 and installed it in XAMPP ( PHP Version 5.5.15 ). Also we have included "php_oauth.dll" in php.ini and copied file(dll) to PHP/ext directory.

Our problem is that we cannot access to for example "magentohost/api/rest/products"(it throws "Access Denied"), in a result we cannot connect to oAuth for getting Accesss Token.
In API documentation the examples are only in PHP. But we have throuble with it, because we are using "XMLHTTPRequest.6.0" COM object and with it we are able only
to GET/POST on specified host and retrive data, not more.

We have no library to use "OAuth" object as shown in documentation.

Our question is to clarifiy where is the end point of oAuth in Magento. URL that we need to POST data ( secret and key ) to get Access Token.

And Also if it is possible give us example code.

Thanks.


texts: How to Add class in Magento 2 checkout page?

texts:
I want to add class in magento 2 checkout page for designing.
Is it Possible to do.?

Thanks.

If I add a class in New Address button like below code in shipping.html file.

<button type="button"
            data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
            class="action action-show-popup primary s2">
        </button>


texts: Can multiple customers use the same account?

texts:
I want to give the employees in the company where I work a fixed 20% discount and special prices on some products.
The problem is that the company has over 40.000 employees, so I can't make an account for everyone. Instead my idea was to make a single account that everyone could use. But is it possible to do it this way?

Some of the problems I ran into was this address book that automatically filled out the shipping information. Furthermore there won't be any email field, when they are logged in, so they wont received an order confirmation, as it would be send to the email the account is registered with. Anyone who have an idea of how to solve this?

Cheers


texts:
Can't seem to enable back orders.

User Flow;

Stores > Settings > Configuration > Catalog > Inventory > Product Stock Options > Backorders > Set to: "Allow Qty Below 0"

Error;

"Something went wrong while saving this configuration: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'qty' cannot be null, query was: INSERT INTO `cataloginventory_stock_status` (`product_id`, `website_id`, `stock_id`, `qty`, `stock_status`) VALUES (?, ?, ?, ?, ?)"

Trouble Shooting;

re-indexed all indexes
cleared all caches
Toggled all other values to non-default values under "Product Stock Options"


texts:
If you change the name of a category on Magento and enter a new URL underneath and tick the box: Create Permanent Redirect for old URL then does this mean that all URL's which contain the old URL will redirect to the new name of the category & URL?

Would this be ok from an SEO perspective?

Thanks a lot


texts:
I just noticed that order details are not being displayed on the admin side of my Magento site.  Everything within the following div appears blank.

  <div class="entry-edit" id="sales_order_view">

The only recent change to my site was applying SUPEE-7405 v1.1

Update: I  noticed that the 'information' tab is not highlighted when I load an order, but if I click on the 'Information' link everything displays fine.  I have no idea why the order information is not selected by default, especially when literally the same code running on a dev server behaves properly.


texts: Magento2: Invalidate Particular Product Page Cache From Observer

texts:
Hi I have a Observer written on save before event on catalog my events.xml is

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_save_after">
        <observer name="mynamespace_mymodule_observer" instance="MyNameSpace\Mymodule\Model\Observer"/>
    </event>
</config>

What i want is to invalidate this product page cache if Data is changed

 public function execute(\Magento\Framework\Event\Observer $observer ){}


texts: in magento 2 (2.2.6) email template css not working

texts:
How to integrate css in email template? I tried and got this error:

  CSS inlining error: DOMXPath::query(): Invalid expression in selector 100% in E:\xampp\htdocs\newmetal\vendor\pelago\emogrifier\Classes\Emogrifier.php on line 372


texts: Edit search terms for all shops? (Or how to improve search)

texts:
Our products are named with the following system:

XX #

Where XX is a two letter code followed by a space and a number.

Unfortunately this is causing our search results to be less than optimal because, for example, searching for AB 1 will result in everything with the number 1 to appear as well as, from what I can tell, AB.

We tried implementing search synonyms so that AB 1 will instead return the results for AB1 (minus whitespace), which works, but is now an issue because we have four shops (multilingual) and Magento doesn't seem to allow the scope of search term editing to span all the shops.

Is there any work around to this, or any suggestions for improving our results in this particular case? Other terms are working quite well (colour, product type etc)


texts: How to retrieve a customer by phone number?

texts:
I need to retrieve the customer object belonging to a certain (mobile) phone number. How can I do this in Magento?

And how can I get a customer by phone number when a phone number was entered by end users and can be written in different ways?

For instance:

+1 310-954-8012
1 (310) 954-8012
1-310-954-8012
13109548012


texts:
In Magento 2.1.0, I have a custom attribute named brand, which has swatch images.
So far I've managed to do this:

$attribute = $this->eavConfig->getAttribute('catalog_product', 'brand');
$options = $attribute->getSource()->getAllOptions();

now i can go through them and get the label and value like this:

 foreach ($options as $option) {
    echo $brand->getValue();  // Value
    echo $brand->getLabel(); // Label
 }

but I'm not able to get the image corresponding to the attribute.

Can someone please help? I'm banging my head to the walls for two days now.


texts:
I created one website app for facebook login, I added site url and App Id and Secret key but it getting error like

      You are not logged in: You are not logged in. Please log in and try again.


texts: Magento2: Open new window on button onclick

texts:
I have added a new button to order view action buttons:

class ReturnButton
{
    public function beforePushButtons(
        \Magento\Backend\Block\Widget\Button\Toolbar\Interceptor $subject,
        \Magento\Framework\View\Element\AbstractBlock $context,
        \Magento\Backend\Block\Widget\Button\ButtonList $buttonList
    ) {

        $this->_request = $context->getRequest();
        if ($this->_request->getFullActionName() == 'sales_order_view'){
              $buttonList->add(
                'returnButton',
                ['label' => __('New return request'), 'onclick' => 'setLocation(\'http://foo.bar\')', 'class' => 'reset'],
                1
            );
        }

    }
}

However, I would need to open a new window, setLocation naturally sets new location for current window. What is the correct way to do this in Magento 2?


texts: Error while opening order in magento 2.3

texts: I am getting this Error when i open order in magento admin panel https://prnt.sc/opk7u3


texts: 'Area code not set' issue in my UpgradeData Script

texts:
i've written some upgrade-scripts for the database. When I'm running
    setup:upgrade
from the CLI, I'm getting following error:

[Magento\Framework\Exception\SessionException]
Area code not set: Area code must be set before starting a session.
[Magento\Framework\Exception\LocalizedException]
Area code is not set

I tried the following areacode stuff in my UpgradeData-File with all possible area codes:

<?php
namespace ***\Catalog\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;

class UpgradeData implements UpgradeDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;
    private $_product;
    private $_productAction;

    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct( EavSetupFactory $eavSetupFactory, \Magento\Catalog\Model\Product $product, \Magento\Catalog\Model\Product\Action $action, \Magento\Framework\App\State $appState, $name=null )
    {
        $appState->setAreaCode('admin');
        parent::__construct($name);
        $this->eavSetupFactory = $eavSetupFactory;
        $this->_product = $product;
        $this->_productAction = $action;
    }

    public function upgrade( ModuleDataSetupInterface $setup, ModuleContextInterface $context )
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create( [ 'setup' => $setup ] );
        $setup->startSetup();

        if( $context->getVersion() && version_compare( $context->getVersion(), '2.0.6' ) < 0 )
        {
            $eavSetup->updateAttribute( 4, 133, 'hide_price', 0 );
        }

        if( $context->getVersion() && version_compare( $context->getVersion(), '2.0.5' ) < 0 )
        {
            $attrData = array( 'hide_price' => 0, );

            $productIds = $this->_product->getCollection()->getAllIds();
            $this->_productAction->updateAttributes( $productIds, $attrData, 0 );
        }

        if( $context->getVersion() && version_compare( $context->getVersion(), '2.0.4' ) < 0 )
        {
            $eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, 'hide_price', [ 'type' => 'varchar', 'backend' => '', 'frontend' => '', 'label' => 'Preis verstecken', 'input' => 'boolean', 'class' => '', 'source' => '', 'global' => \Magento\Store\Model\ScopeInterface::SCOPE_STORE, 'visible' => true, 'required' => false, 'user_defined' => false, 'default' => '', 'searchable' => false, 'filterable' => false, 'comparable' => false, 'visible_on_front' => false, 'used_in_product_listing' => true, 'unique' => false, 'apply_to' => '' ] );
        }

        $setup->endSetup();
    }
}

But nothing helps.

When I'm running the upgrade, the schema-version in the database gets updated but not the data_version.

Any thoughts?

Thanks in advance
- Ali


texts: Unique Products in Product Collection Filtered with Category Array in Magento 1.9

texts:
I have tried below 3 method but it is not giving correct products as per cateory id array.
First Way
$_productCollection = Mage::getResourceModel('catalog/product_collection')
                    ->addFieldToFilter('status',Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
                    ->joinField('is_in_stock', 'cataloginventory/stock_item', 'is_in_stock', 'product_id=entity_id', 'is_in_stock=1', '{{table}}.stock_id=1', 'left')
                    ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
                    ->addAttributeToFilter('condition', array('eq' => 814))
                    ->addAttributeToFilter('ep_status',array('in'=>array(820,822)))
                    ->addAttributeToFilter('manufacturer',array('in'=>$manufactId))->addAttributeToSelect('*');
$_productCollection->addAttributeToFilter('category_id', array('in' =>  array('finset' => $catManufacturers )));
$_productCollection->getSelect()->group('entity_id')->distinct(true);

Second Way
$_productCollection = Mage::getModel('catalog/product')->getCollection()
                    ->addAttributeToFilter('condition', array('eq' => 814))
                    ->addAttributeToFilter('ep_status',array('in'=>array(820,822)))
                    ->addAttributeToFilter('manufacturer',array('in'=>$manufactId))->addAttributeToSelect('*');
if(!empty($catManufacturers)){
    foreach ($catManufacturers as $k => $index) {
        $name = 'category_id_'.$k;
        $_productCollection->joinField($name, 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left')
            ->addAttributeToFilter($name, array('eq' => $index));
    }
}
$_productCollection->getSelect()->group('entity_id')->distinct(true);

Third Way
$_productCollection =  Mage::getResourceModel('catalog/product_collection')
                    ->addFieldToFilter('visibility', 4)
                    ->addAttributeToFilter('ep_status',array('in' => array(820,822)))
                    ->addAttributeToFilter('manufacturer',array('in'=>$manufactId))
                    ->addAttributeToSelect('*')
                    ->joinField('is_in_stock', 'cataloginventory/stock_item', 'is_in_stock', 'product_id=entity_id', 'is_in_stock=1', '{{table}}.stock_id=1', 'left')
                    ->addFieldToFilter('condition', array('in' => array(814)));
                $_productCollection->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')
                    ->addAttributeToFilter('category_id', array('in' => $catManufacturers));
                $_productCollection->getSelect()->distinct(true);
                $_productCollection->getSelect()->group('entity_id');


texts:
I am programatically creating order for regsitered user but I keep on getting error. How can I fix it? Below is my code:

Error:

  Fatal error: Call to a member function getTypeInstance() on a
  non-object in
  D:\wamp\www\mournewcs3\app\code\core\Mage\Sales\Model\Quote.php on
  line 968

$quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore('default')->getId());
if (1) {
    // for customer orders:
    $customer = Mage::getModel('customer/customer')
        ->setWebsiteId(1)
        ->loadByEmail('gaurav.mishra@abc.com');
    $quote->assignCustomer($customer);
}

$product = Mage::getModel('catalog/product')->load(363);
$buyInfo = array(
    'qty' => 2,
);
$quote->addProduct($product, new Varien_Object($buyInfo));
$quote->addProduct($product2, new Varien_Object($buyInfo));
$addressData = array(
    'firstname' => 'Test',
    'lastname' => 'Test',
    'street' => 'Sampl',
    'city' => 'fff',
    'postcode' => '123456',
    'telephone' => '123456',
    'country_id' => 'IN',
);
$billingAddress = $quote->getBillingAddress()->addData($addressData);
$shippingAddress = $quote->getShippingAddress()->addData($addressData);
$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
    ->setShippingMethod('flatrate_flatrate')
    ->setPaymentMethod('checkmo');
$quote->getPayment()->importData(array('method' => 'checkmo'));
$quote->collectTotals()->save();
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$order = $service->getOrder();
printf("Created order %s\n", $order->getIncrementId());


texts: M2: Cannot add products to product collection in category list

texts:
My client requested to show 3 random products (from a known list of products) in a specific category for marketing purpose.

I tried to put an Observer using the event catalog_product_collection_load_after and add 3 items using:
$collection->addItem($item); and it worked, bringing all these products into product list.

But after that i am facing a problem with the pager.

At first i had 10 products (2 pages showing 9 products / page) and now i have 13, but instead of having 2 pages: (1st page 9/13 products and 2nd page 4/13), now the pages are: (1st page 12/10 products and 2nd page 1/10).

Does anyone have an idea how to fix this or how to implement this functionality more efficient?

Thank you in advance.


texts: Best way to bulk update stock and price for 50+ thousands of products?

texts:
We have well over a hundred thousand products in our magento CE 1.9.2.4. Many are drop shipped from a number of suppliers. Several suppliers can provide the same product. Naturally they will all have different stock and provide different pricing. Anyone has a custom script that parses all the feeds from all the suppliers and create a single feed that contains the new stock and pricing for all the products? With this volume of products what importer we should use -magmi or store manager or something else? For product content(image, description etc) what should we do - take etilize/icecat (full or open) paid service or web scraping? We also like to have live stock & price update via xml since our supplier also supports xml live update. We also want order, RMA integration with our suppliers through xml. Is there any one can help us to move to the right direction?

Waited for answer, but no response. So, here is project. Anyone can complete the project with pay, please contact us

Project: Integration with Distributors and Product Content Provider Etilize

Main Task:

Download the distributors (currently 3 distributor) flat file from their respective ftp site to our server. Daily basis. Automation through crone job. Also able to import manually.
Sub-Task: At admin panel there should be Top Menu like Focaas Distributors>Manage Distributors. Clicking Manage Distributors will open up grid. Able to add as many distributor by clicking "Add Distributor Button" at the top. Open up form will have text field to input both ftp and xml credentials. After save it will go back to grid view. Grid view column will include Name of Distributor, Downloaded at, Imported At, Total Product, In Stock, Action. Under Action column Edit button will be there in order to modify the ftp & xml credentials if needed
Import above those data to database. Daily basis. Automation through crone job. Also able to import manually to database
Download product content data from Etilize to the server and  then import those to the database. Daily Basis. This task has ALREADY BEEN COMPLETED. Mentioned just for reference.
Process above all data sets through mysql query (mostly joining) and make a single csv file ready to import for magento via magmi
Configure Magmi for Price & Special Price and others.
At the admin panel on Product edit tab, there will be a tab called Supplier. This tab will have a table. It will include the columns named Supplier, Stock, Price and Supplier SKU. The table will show each suppliers info for that particular product. At the bottom of the table or the top there should be a button called Update. Hitting the update button it will update stock, price and supplier sku through xml request. We have a script. We can share that.
Order Entry and Tracking automation for all 3 distributors. We will purchase xtento extension. All you need to write an xml script. We will provide the xml guide link/pdf file given by our distributors.
Might need to customize media.phtml file in order to adapt image url


texts:
I have one problem. Is there a way to set custom attributes to my products when the product is in a category.

Example:
I have two Categories. When I add a product in the first category, I will show the custom attribute brand.
When I add a product in the second category I will show the attribute material.

Has anyone a idea?


texts: How to prevent "Call to a member function getValue() on null" when using getCustomAttribute()->getValue()?

texts:
My colleague wrote some code, which is hidden behind an interface:

$myCustomValue = $customer->getCustomAttribute('my_custom_attribute')->getValue();

Working on integrations now, I invoke his code via an API and just came across customers who do not have a value set for that attribute.

The error message I get is:

Call to a member function getValue() on null

How can I modify his code best, so that it checks first if the value is set for the specific customer?


texts:
I have a problem with our production database, I think 2 or 3 tables are corrupted. It just came out of nowhere, no major Magento upgrades or big changes made this week, just a few extensions installed.
It is currently not possible to backup the database or create a copy of it (it was possible until one week ago).
My questions are two:
1) How could have this happened?
2) How to proceed? I though about running the Magento database repair, but not having a working backup to make a test first (if not an old one) scares me

The tables which seem to be corrupted are sales_flat_order_item and sales_flat_order_payment. They're not big at all, less than 10MB in total, around 9k rows.


texts: I want to override the checkout page for Guest user without KnockOut Js in my custom theme, Is there any way I can customise it the way I want. Checkout process is different than the other pages so far.


texts: Add to cart query string keeps going to product page

texts:
I'm using magento 1.9.1 and on a custom listing page I'm trying to add an add to basket form. This is supposed to add to the basket using a query string.

<?php $formKey = Mage::getSingleton('core/session')->getFormKey();?>
<form action="/shop/checkout/cart/add?product=4149&qty=1&super_attribute[136]=147?super_attribute[240]=1636" method="post">
<input type="hidden" name="form_key" value="<?php echo $formKey; ?>" />

<input type="submit" value="Add to basket" />
</form>

I've tried a few variations on how the url is formatted and I will look at Un-hardcoding it once ,i have got a working format.

But for now it just keeps directing to the product page and asking me to select options.

I've read this, this and this about formatting a query string for this. I'm certain that I've done this on older versions of magento in the past with the format given in the code above.

FYI -

I need to add it as a config product and set the options rather than add the simple directly.

All help welcome.


texts:
With this parameter in the xml I can add a top link

                    <action method="addLink" translate="label title">
                        <label>Registrati</label>
                        <url>customer/account/create/</url>
                        <title>Registrati</title>
                        <prepare>true</prepare>
                        <position>1</position>
                    </action>

How do I add the top link only to users logged on or only for users not logged in?


texts: Magento 2 : How to Disable/Enable Custom Shipping Method Based on State / Region

texts: I want to show my custom shipping method based on state/region.


texts: Magento 2: How to increase link expire time for Reset Password

texts:
I have 5K Customers. Previouly link expire time is set to 2 hours. I already send email to all customers for "Reset Password".

Now i want to change their Link Expire Time. I think only way to do via DB Table Change.

Table 'customer_entity', Fields rp_token & rp_token_created_at fields

How to achieve this?


texts: Failed to load resource: the server responded with a status of 404 (Not Found). How to solve this issue?

texts:
I am running Magento 2.3 with NGINX, PHP7.1 and MariaDb.
This is a fresh instalation with pre-loaded data.
I am getting these follow error:

$ tail var/log/system.log
[2019-01-09 16:36:24] main.ERROR: Error: Application is not installed yet.  [] []
[2019-01-09 16:36:24] main.ERROR: Error: Application is not installed yet.  [] []
[2019-01-09 16:36:24] main.ERROR: Error: Application is not installed yet.  [] []
[2019-01-09 17:33:08] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 100000; Allocated memory size: 50000000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []
[2019-01-09 17:33:08] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 100000; Allocated memory size: 50000000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []
[2019-01-09 17:33:09] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 100000; Allocated memory size: 50000000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []
[2019-01-09 17:33:10] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 100000; Allocated memory size: 50000000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []
[2019-01-09 17:33:11] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 100000; Allocated memory size: 50000000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []
[2019-01-09 17:33:11] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 100000; Allocated memory size: 50000000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []
[2019-01-09 17:33:36] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 3334; Allocated memory size: 40008000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []

And these are screenshots:

How can I solve these errors?
Any idea?


texts: Mass replace SKU values from another attribute via mysql

texts:
I need to mass replace all my store SKU values. The values I want to set are from another attribute called InternalSKU.

Attribute SKU is contained in table catalog_product_entity and the Attribute Internal SKU is contained in table catalog_product_entity_varchar.

Can you please help me to write a direct SQL query to correctly replace the attribute SKU with the values from attribute InternalSKU?


texts: How to add a star rating in custom form in magento 2

texts:
I have created the feedback form in list page. Now I wish to add custom star rating as a new form field.

Please suggest any solution to add rating field in my form.


texts: Any examples on how to use requisition_lists API Endpoint?

texts:
ORIGINAL POST

Trying to use the save requisition list REST API endpoint. The API docs are not very clear on what the values should be and currently don't have access to the B2B module code to see what it exactly needs for the JSON input.

So, has anyone used this endpoint before? What would be a working example JSON? Am I even supposed to use this endpoint?

Doc link: https://devdocs.magento.com/redoc/2.3/async-admin-rest-api.html#operation/requisitionListRequisitionListRepositoryV1SavePost

Endpoint Example (POST method): https://magento-store.com/index.php/rest/V1/requisition_lists

Example of what I have used:

{
  "requisitionList": {
    "id": 0,
    "customer_id": 215120,
    "name": "My List A",
    "updated_at": "2019-05-06T15:49:00",
    "description": "None",
    "items": [
      {
        "id": 1,
        "sku": 20410320,
        "requisition_list_id": 0,
        "qty": 10,
        "options": [],
        "store_id": 1,
        "added_at": "2019-05-06T15:49:00",
        "extension_attributes": {}
      }
    ],
    "extension_attributes": {}
  }
}

Example Responses (2 of them):

{
    "message": "Could not save Requisition List"
}

{
    "message": "Internal Error. Details are available in Magento log file. Report ID: {error-id}"
}

UPDATE

It seems that not all the JSON fields are required as pointed out in the comments. I am now able to update an existing requisition list if I have the requisition list ID. I guess now does anyone know how to create a brand new list for a customer?

Request:

{
  "requisitionList": {
    "id":755,
    "customer_id": 215120,
    "name": "My List E",
    "items": [
      {
        "sku": 16740700,
        "qty": 3,
        "store_id": 1
      }
    ]
  }
}

Response:

{
    "id": 755,
    "customer_id": null,
    "name": "My List E",
    "updated_at": "1557246976",
    "description": null,
    "items": [
        {
            "id": 1316,
            "sku": "16740700",
            "requisition_list_id": 755,
            "qty": 3,
            "options": [],
            "store_id": 1,
            "added_at": null
        }
    ]
}


texts: Min Max Slider for two attributes not price

texts:
We sell board games and need a filter that makes it possible to search for minimum players and maximum players.

When using built in filters we run into a logic problem, that maybe someone else was able to find a solution.

Lets say you have to products.

Product A

(min_players) 2 (max_players) 6

Product B <br>
(min_players) 3 (max_players) 5

If someone wants to list all products with (min_players) 3 and (max_players) 4 both should show up.

If someone wants to list all products with (min_players) 2 and (max_players) 5 only product A should show up.


texts: Wrong attribute set ID Mage_Eav_Model_Entity_Setup

texts:
I have been receiving this error.

Error:

  mysql4-install-1.0.php" - Wrong attribute set ID";i:1;s:1016:"#0 /Applications/MAMP/htdocs/flicdes/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')

Code:

<?php

$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$attributeSetCollection = Mage::getResourceModel('eav/entity_attribute_set_collection')->load();
foreach ($attributeSetCollection as $id => $attributeSet) {
    $setup->addAttributeGroup('catalog_product', $attributeSet->getAttributeSetName(), 'Product Brand', 1000);
}
$setup->addAttribute('catalog_product', 'mgs_brand', array(
    'group' => 'Product Brand',
    'label' => 'MGS Brand',
    'type' => 'int',
    'input' => 'select',
    'frontend_class' => '',
    'source' => '',
    'backend' => '',
    'frontend' => '',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'searchable' => false,
    'filterable' => false,
    'comparable' => false,
    'visible_on_front' => false,
    'visible_in_advanced_search' => false,
    'unique' => false
));
$setup->updateAttribute('catalog_product', 'mgs_brand', 'is_filterable', 0);
$setup->updateAttribute('catalog_product', 'mgs_brand', 'is_filterable_in_search', 0);
$setup->updateAttribute('catalog_product', 'mgs_brand', 'is_visible_on_front', 0);
$setup->updateAttribute('catalog_product', 'mgs_brand', 'used_in_product_listing', 0);
$installer->run("
DROP TABLE IF EXISTS {$this->getTable('mgs_brand')};
CREATE TABLE IF NOT EXISTS {$this->getTable('mgs_brand')} (
  `entity_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `url_key` varchar(255) NOT NULL DEFAULT '',
  `icon` varchar(255) NOT NULL DEFAULT '',
  `image` varchar(255) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `meta_keywords` text NOT NULL,
  `meta_description` text NOT NULL,
  `status` smallint(6) NOT NULL DEFAULT '1',
  `is_featured` smallint(6) NOT NULL DEFAULT '0',
  `priority` int(11) NOT NULL DEFAULT '0',
  `number_of_products` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY (`url_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS {$this->getTable('mgs_brand_products')};
CREATE TABLE IF NOT EXISTS {$this->getTable('mgs_brand_products')} (
  `entity_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `brand_id` int(11) unsigned NOT NULL,
  `product_id` int(11) unsigned NOT NULL,
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    ");
$installer->endSetup();


texts: How to create REST API for customer profile update?

texts:
Since, I have worked with magento get method api calls but yet didn't work on post or put method. I am trying to update customers to update their profile in mobile app.

public function update($id){

    $customer = $this->customerRepository->getById($id);

    $customer->setWebsiteId(1);

    $customer->setEmail('alt@gmail.com');

    $customer->setFirstname('ramesh');

    $customer->setLastname('kr');

    $customer->setGroupId('1');

    //printing result
            echo "<pre>";
   print_r($customer);
   $this->customerRepository->save($customer);

    }

I need to change customers details themeseleves. I don't want to add addmin token I want to add customer token


texts:
I've managed to import >200,000 SKUs and am now struggling to index them running the command line indexer.

It's basically running for more than 12 hours now and I don't even don't know if it's doing anything or not. I got 4 errors in the meantime telling me "The total number of locks exceeds the lock table size'". I've already found out that this has to do with the innodb_buffer_pool_size.

Is there any way to see if the process is still doing anything? Typing in php indexer.php --status gives me:

Product Attributes:                 Require Reindex
Product Prices:                     Require Reindex
Catalog URL Rewrites:               Running
Category Products:                  Require Reindex
Catalog Search Index:               Require Reindex
Stock Status:                       Pending
Tag Aggregation Data:               Pending

Also: Is it possible to show products on the Frontend without having the indexer run through everything? It's currently giving me a very old list of articles on one store and nothing on any of the 3 others.

One last thing: Is there any way to speed up the indexer? My "top" looks like there's much potential left because MySQL is only running at 1% CPU and 0.4% MEM. The PHP script isn't even listed.


texts:
Send data from controller to jquery after ajax in Magento 2

I using ajax send data to controller, how to send data return from controller to js, please help me

My js

jQuery("document").ready(function(){
    jQuery("input[name$='general[product_id]']").change(function() {
        var productId = jQuery("input[name$='general[product_id]']").val();
        jQuery.ajax({
            url: "index/index/searchnameproduct",
            dataType: 'json',
            type : 'post',
            data: {productId: productId},
            showLoader: true,
            success: function(data) {
                console.log(data);
            }
        });
    });
});

My controller

public function execute()
{
    // echo 1;exit;
    $productId = $this->getRequest()->getPost('productId');
    // var_dump($productId);exit;
    $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
    $resultJson->setData($productId);
    return $resultJson;
}


texts: /newsletter/manage/ and /sales/order/history/ blank

texts:
I have a site under development, and at some point the My Orders and Newsletter pages under My Account stopped working, and I cannot figure out why.

I turn on template hints, and it doesn't seem to be trying to load anything.

I'm at a loss for how to identify where the conflict is.  I've disabled any new modules but nothing helps.  Any advice on how to debug this?

Edit: PHP memory_limit is 512M, tried 1024M but didn't change anything.  I don't see anything in the apache log, or exception.log or system.log.

I installed Commerce Bug, and when I view Page Layout, I see that it doesn't have a 'content' area.  On an older staging server (that works), I see:

<reference name="content">
  <block type="page/html_wrapper" name="my.account.wrapper" translate="label">
    <label>My Account Wrapper</label>
    <action method="setElementClass"><value>my-account</value></action>
   </block>
</reference>

The site where the page is broken doesn't have this block.


texts:
I can't checkout anymore on Magento 2.1.9 and whenever I try to make a payment I get error:

  An error occurred on the server please try processing the order again

and below error in the console:

  VM6525:1 POST http://
  domain/rest/english/V1/carts/mine/payment-information 400 (Bad
  Request)

Any Advice how to fix this or debug?

Thanks


texts: How Magento add the shipping amount in orders while creating in backend

texts:
Recently i am facing one issue while creating order in back end

In backend while creating new order on choosing shipping method it's adding shipping amount in totals.

But on submit the order it's not showing up in order details page.

I tried checking with order info.

$_order->getShippingDescription(); (showing Table Rate as i selected)

$_order->getShippingAmount(); (Showing 0.00 not expected)

/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

I saw core files also the above file used to set shipping_method name. No where i found the shipping amount is being set.

Any help?


texts:
I only have one TAX option but when entering new product I'm forced to set the TAX option.

Is there a way set a TAX value to default?


texts:
First I am new to magento development and theme integration. As reading forum  on the magento theme, created custom theme folder structure with listed file as below....

Magento\app\design\frontend\drEcom\tQCustometheme

composer.json
registration.php
theme.xml
/media
/web

But can't got which and where the phtml files are located, so i can overwrite it???

Can someone please help/guide on this?


texts:
I am currently building a custom customer account management module. In the dashboard, I want to display the recent product reviews made by the logged in customer. I just can't find my way in getting those reviews made by specific customer.

I am getting reviews by product this way:

public function getProductReviewDetails($product){
    $reviewDetails = array();
    $rf = $this->reviewFactory->create()->getEntitySummary($product, $this->store->getId());
    $reviews = $this->review->getResourceCollection()->addStoreFilter($this->store->getId())->addEntityFilter('product', $product->getId())->setDateOrder()->addRateVotes()->getItems();
    $rating_summary = $product->getRatingSummary()->getRatingSummary();
    $reviewDetails = array(
        'count' => count($reviews),
        'list' => $reviews,
        'ratingSummary' => ($rating_summary == null || !$rating_summary) ? 100 : $rating_summary
    );
    return $reviewDetails;
}

So I tried editing that into :

public function getProductReviews(){
        $reviewDetails = array();
        $customerId = $this->customerSession->getCustomer()->getId();
        $reviews = $this->review->getResourceCollection()->addStoreFilter($this->store->getId())->addEntityFilter('customer', $customerId)->setDateOrder()->addRateVotes()->getItems();
        $reviewDetails = array(
            'count' => count($reviews),
            'list' => $reviews
        );
        return $reviewDetails;
    }

But still I can't get those reviews.


texts: Contact form: Getting error even though email is sent

texts:
we moved our magento shop to another hosting and now visitors, who use the contact form, get an error message, even though the e-mail is sent successfully.
We didn't change anything in the core files or the template files of the contact form.
The hosting provider told us, that is has to be an error or bug in magento.
I thought about editing the core files, which produce that error, but that would not be a good idea in my opinion, because there is obviously something going wrong.
Did anyone of you run into a similar problem?
Thank you!
Error Message (English):
Unable to submit your request. Please try again later.
Solution:
Thanks to the hint from Fabian Blechschmidt, I found the exact exception:
Unable to send mail. mail(/var/log/mail.php.log): failed to open stream: Permission denied

Even though chmod 777 was set for the log-folder, magento can't create the "mail.php.log"-file on the server. But why?
It turned out that the path "/var/log/" does not mean the path from the magento root, but from the apache root. Therefore, the folder "/var/log" does not exist and can not be created by PHP.
This path is defined by the "mail.log" value in the php.ini. Because I don't need any tracking of mails sent by the server, I just removed this value and everything is working as expected now!
It was no magento-problem, but a wrong server configuration.
Once again, thanks everyone!


texts: Image resizing not working if height and width values are different

texts:
I am trying below code to resize height and width of image. If i give resize(350 ,250) instead of resizing ,  its displaying image 350px away from left and 250px away from top from its original position.

If i give same value for both height and width [ resize(250 ,250) ] , than only resize will work properly.

<?php $imageUrl = Mage::helper('catalog/image')->init($_product, 'image')->resize(250 ,250)->setQuality(100); ?>

Update

Issue is if we resize the Image with Different height & Width , than its adding background image to Product image.

1) resize(150 ,750) Image with differnet height and width: link

2) resize(750, 750) Image with same height and width: link2


texts: Magento 2.3.2 custom email send createAttachment() method is not working

texts: custom email send createAttachment() method is not working how to solve?


texts: Error with virtualType collection construct

texts:
I am upgrading from Magento 2.2.4 to 2.3.5. I have this collection using virtualTyp made by someone else. I don't understand what's going on.
Anyone can help ? THanks !!
<virtualType name="Intelipost\Pickup\Model\Resource\Items\Collection"
type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">intelipost_pickup_items</argument>
        <argument name="resourceModel"
xsi:type="string">Intelipost\Pickup\Model\Resource\Items</argument>
    </arguments>
</virtualType>

Error message:
[2020-08-24 21:09:44] report.CRITICAL: Type Error occurred when creating object:
Intelipost\Pickup\Model\Resource\Items\Collection\Interceptor, Argument 5 passed to
Intelipost\Pickup\Model\Resource\Items\Collection\Interceptor::__construct() must implement
interface Magento\Framework\DB\Adapter\AdapterInterface or be null, string given, called in
.../vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121 [] []

This is the collection code:
<?php

namespace Intelipost\Pickup\Model\Resource\Items;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection
{

    protected function _construct()
    {
        $this->_init(
            'Intelipost\Pickup\Model\Items',
            'Intelipost\Pickup\Model\Resource\Items'
        );
    }

}


texts:
I wanted to do a simple MySQL search for the "Custom Options" that customers input when making product purchases but I wasn't sure where to look. Most of what we use is the "Text Field" custom option
What Select Query should I use to return all the "custom option" data from products purchased on my site?
I.E. Product Custom Option header = "your notes" return "my custom text".
Edit: the personalization information seems to be in the sales_flat_order_item.product_options column but I have yet to find an effective way to parse out just the "custom options" results from it.


texts: Configurable Swatches: Error Processing Request: "SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

texts:
I have enable Configurable Swatches, but I encounter a problem it shows me a page (There has been an error processing your request) Exception printing is disabled by default for security reasons.

Error log record number: 164106845

Here's what my file contains :

a:5:{i:0;s:269:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was: SELECT `main_table`.* FROM `design_change` AS `main_table` WHERE (store_id = :store_id) AND (date_from <= :required_date or date_from IS NULL) AND (date_to >= :required_date or date_to IS NULL)";i:1;s:2618:"#0 /home/hairqualkn/www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/hairqualkn/www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/hairqualkn/www/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/hairqualkn/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 /home/hairqualkn/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 /home/hairqualkn/www/lib/Zend/Db/Adapter/Abstract.php(756): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home/hairqualkn/www/app/code/core/Mage/Core/Model/Resource/Design.php(179): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select), Array)
#7 /home/hairqualkn/www/app/code/core/Mage/Core/Model/Design.php(62): Mage_Core_Model_Resource_Design->loadChange('1', NULL)
#8 /home/hairqualkn/www/app/code/core/Mage/Core/Model/App/Area.php(162): Mage_Core_Model_Design->loadChange('1')
#9 /home/hairqualkn/www/app/code/core/Mage/Core/Model/App/Area.php(124): Mage_Core_Model_App_Area->_initDesign()
#10 /home/hairqualkn/www/app/code/core/Mage/Core/Model/App/Area.php(92): Mage_Core_Model_App_Area->_loadPart('design')
#11 /home/hairqualkn/www/app/code/core/Mage/Core/Model/App.php(774): Mage_Core_Model_App_Area->load()
#12 /home/hairqualkn/www/app/code/core/Mage/Core/Controller/Varien/Action.php(512): Mage_Core_Model_App->loadArea('frontend')
#13 /home/hairqualkn/www/app/code/core/Mage/Core/Controller/Front/Action.php(64): Mage_Core_Controller_Varien_Action->preDispatch()
#14 /home/hairqualkn/www/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Core_Controller_Front_Action->preDispatch()
#15 /home/hairqualkn/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#16 /home/hairqualkn/www/app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /home/hairqualkn/www/app/code/core/Mage/Core/Controller/Varien/Front.php(172): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 /home/hairqualkn/www/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#19 /home/hairqualkn/www/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#20 /home/hairqualkn/www/index.php(87): Mage::run('', 'store')
#21 {main}";s:3:"url";s:14:"/peruvien.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:2:"fr";}


texts: Email Not Sending after newsletter subscription

texts:
I am using BigRock server for magento site. I set the smtp setting from system->Mail Sending Setting. and also create mail account on bigrock server.
but magento not sending any email.
log error : Zend_Mail_Transport_Exception' with message 'Unable to send mail
can any one help me for that.

Host : name.domain.com
Port : 25.

My Magento Version :1.9.3.4.


texts: How to correctly create a configurable product with multiple attributes and images

texts:
I'm trying to create some configurable products programmatically, but I think I'm missing a step somewhere. I'm basing my code mostly off of inchoo's tutorial, but also off of about 2 dozen other questions/articles.

At this point in my code, I have all of the attributes and simple products containing each combination of variations already created. I'm just trying to create the configurable product:

// Do the normal product creating bit:
$prod = Mage::getModel('catalog/product');
$prod->setWebsiteIds([1])
    ->setAttributeSetId($set_id)        // Ex: 100
    ->setTypeId('configurable')
    ->setCreatedAt(strtotime('now'))
    ->setUpdatedAt(strtotime('now'))
    ->setSku($sku)                      // Ex: 'foo_bar'
    ->setName($name)                    // Ex: 'Foo Bar'
    ->setWeight($weight)                // Ex: 11.22
    ->setStatus(1)
    ->setTaxClassId(4)
    ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
    ->setPrice($price)                  // Ex: 19.49
    ->setDescription($description)      // Ex: 'Description Here!'
    ->setShortDescription($name)        // Ex: 'Foo Name'
    ->setCategoryIds($categories)       // Ex: [200, 201, 202, 203]
    ->setStockData([
        'use_config_manage_stock' => 0,
        'manage_stock' => 1,
        'is_in_stock' => 1,
    ]);

// This seems a bit silly to me, but it's the only way I've found to both add an image
// to a product AND give it a label at the same time.
foreach ($attributes as $attribute) {
    $prod->addImageToMediaGallery($attribute['image_url'], null, false, false);
    $gallery = $prod->getData('media_gallery');
    $lastImage = array_pop($gallery['images']);
    $lastImage['label'] = $attribute['text'] . '-swatch';
    array_push($gallery['images'], $lastImage);
    $prod->setData('media_gallery', $gallery);
}

// The main image gets added last or it messes everything up.
$prod->addImageToMediaGallery($main_image, ['image', 'small_image', 'thumbnail'], false, false);

// $attr_ids contains the attributes used in the configurable attributes from $set_id
$prod->getTypeInstance()->setUsedProductAttributeIds($attr_ids);
$config_data = $prod->getTypeInstance()->getConfigurableAttributesAsArray();
$prod->setCanSaveConfigurableAttributes(true);
$prod->setConfigurableAttributesData($config_data);
// Shown below
$prod->setConfigurableProductsData($variation_infos);
$prod->save();

The $variation_infos array looks like this: [product_id] => [ 0 => [data] ]:

Array
(
    [141] => Array
        (
            [0] => Array
                (
                    [label] => Red
                    [attribute_id] => 158
                    [value_index] => 307
                    [is_percent] => 0
                    [pricing_value] => 0
                )

        )

    [142] => Array
        (
            [0] => Array
                (
                    [label] => Green
                    [attribute_id] => 158
                    [value_index] => 308
                    [is_percent] => 0
                    [pricing_value] => 0
                )

        )
)

Using this code, the configurable product is created, however, when logging into the back-end and clicking on the configurable product that was just made, I'm greeted with this:

I thought the whole $prod->getTypeInstance()->setUsedProductAttributeIds($attr_ids); line was supposed to select those attributes.

Anyways, I check color and hit continue, and everything else looks right at first glance. Going through the 'images' tab shows all of the images as being added correctly. Going to 'associated products' also shows that all of the simple products I selected are there. However, when going to the front end of the site, the default placeholder image is used and I'm not given any dropdowns to select the different attributes.

I've been stuck on this for a few days. Any help would be appreciated.

Thanks!


texts: Error in posting image through REST Api Magento 2

texts:
I am trying to post image via the REST Api using the catalogProductAttributeMediaGalleryManagementV1 service, but getting error in base64_encoded_data. The error is "The string is not a valid base64 encoded data"

{
  "entry":{
    "type":"image",
    "label":"Image",
    "media_type":"image",
    "disabled":false,
    "content":[
      {
        "type":"image/jpeg",
        "name":"abc.jpg",
        "base64_encoded_data":"\/9j\/4AAQSkZJRgABAQAA..."
      }
    ],
    "position":1,
    "file":"abc.jpg"
  }
}

How can I resolve this?


texts: Magento 2.3.5-p. can we click on disabled configuration and force change the available options instead of unchecking(screengrab video link)

texts:
Screen Recoding video to show exactly what is happening and what I am Looking for
If you look at the video. There is a configurable product.
It has attribute 1TB drive and 1TB fusion drive
Above that 3 variants.
So in 1TB only 1 of the variant is available.
While the rest 2 variants are on available in 1TB Fusion Drive.
So when user clicks on 1TB then the other two variants and the 1TB Fusion Drive gets disabled.
Now I cannot click on the other two variants or 1TB Fusion drive Until I unclick(or Click) on the 1TB size again.
My concern is many users might not know that they have to "uncheck" one of the configurations to be able to click on the next.
I have seen it on some websites. So when they click on 1TB fusion drive the 1TB and the Variant above it gets disabled.
So you can click on the disabled or crossed out variant and it will get selected and "cross out" the unavailable variants and show the available ones.
Is that possible by default in Magento 2.
Or does that have to be coded into the template.
I am using a Themeforest Template and in this it doesnt have the option.
I was trying to find LUMA installation but could not find anything with the Attributes not available.
Like all the sizes are available in all colors for the Demo products in the Sample data.
So could not check it online.

IS this default. Has the Theme decided not to use it?
If this is not default and not configurable then how can this be enabled? By editing the Theme or does it require a custom extension.

Thanks


texts: SUPEE-9767 : Patch can't be applied/reverted successfully

texts:
I'm trying to Install SUPEE-9767 but i get this error message:

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

checking file app/code/core/Mage/Admin/Model/Session.php
checking file app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php
checking file app/code/core/Mage/Adminhtml/Block/Notification/Symlink.php
checking file app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php
checking file app/code/core/Mage/Adminhtml/Model/Config/Data.php
checking file app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php
checking file app/code/core/Mage/Checkout/controllers/MultishippingController.php
checking file app/code/core/Mage/Checkout/controllers/OnepageController.php
checking file app/code/core/Mage/Checkout/etc/system.xml
checking file app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
checking file app/code/core/Mage/Core/Controller/Front/Action.php
checking file app/code/core/Mage/Core/Controller/Request/Http.php
checking file app/code/core/Mage/Core/Model/File/Validator/Image.php
checking file app/code/core/Mage/Core/etc/system.xml
checking file app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php
checking file app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php
checking file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
checking file app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php
checking file app/code/core/Mage/ImportExport/Model/Import/Uploader.php
checking file app/code/core/Mage/Sales/Model/Quote/Item.php
checking file app/code/core/Mage/Widget/Model/Widget/Instance.php
checking file app/code/core/Mage/XmlConnect/Helper/Image.php
checking file app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php
checking file app/design/adminhtml/default/default/layout/main.xml
checking file app/design/adminhtml/default/default/template/notification/formkey.phtml
checking file app/design/adminhtml/default/default/template/notification/symlink.phtml
checking file app/design/adminhtml/default/default/template/page/head.phtml
checking file app/design/frontend/base/default/template/checkout/cart/shipping.phtml
Hunk #1 succeeded at 109 with fuzz 2.
checking file app/design/frontend/base/default/template/checkout/multishipping/billing.phtml
Hunk #1 succeeded at 91 with fuzz 2.
checking file app/design/frontend/base/default/template/checkout/multishipping/shipping.phtml
Hunk #1 succeeded at 126 with fuzz 2.
checking file app/design/frontend/base/default/template/checkout/onepage/billing.phtml

How can i resolve this problem?


texts: create a list of images related to product on product listing page

texts:
I want to show show a list of all product images of that specific product below description in a loop.

use Magento\Catalog\Model\Product\Gallery\ReadHandler as GalleryReadHandler; class Gallery

{ protected $galleryReadHandler; public function __construct( GalleryReadHandler $galleryReadHandler ) { $this->galleryReadHandler = $galleryReadHandler; } /** Add image gallery to $product */ public function addGallery($product) { $this->galleryReadHandler->execute($product); } }

iam still confused that where i have to get these coding and in which particular files...like where to use these coding in which files
 This is what i want


texts: Help me on CORS Access Control Allow Origin

texts:
I have one domain having mywebsite.com and there would be multiple subdomains like subdomain.mywebsite.com , subdomain1.mywebsite.com , subdomain2.mywebsite.com and so on.

In htaccess file I have added

<IfModule mod_headers.c>
   Header add Access-Control-Allow-Origin  "http://subdomain.mywebsite.com"
   Header add Access-Control-Allow-Origin  "http://subdomain1.mywebsite.com"
   .... and so on it will be there.
   Header add Access-Control-Allow-Credentials true
</IfModule>

When I add this code to htaccess then I don't get any CORS error but now I don't want any errors for all the subdomains as above. I need dynamic code for multiple subdomain. So i don't need to add these lines often and often.


texts: After changing Base URL & Base Link URL in Magento 1.9.2 Admin (System > Configuration > Web > ebsite is stuck in redirect loop

texts:
After changing Base URL & Base Link URL in Magento 1.9.2
Admin

System > Configuration > Web > Unsecure,

website is stuck in redirect loop.


texts: Magento 2 calling addHandle() on template with

texts:
I've tried to add a Js layout in sales_order_create_index.xml in which I override Magento_Sales::order/create/shipping/method/form.phtml
There's not much I did but to call
    <script type="text/x-magento-init">
        {
            "#cc-ts-trigger": {
                "Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
            }
        }
    </script>

its working fine when the page is being reloaded which is calling sales_order_create_index.xml.
My problem is when a you select another shipping method, this will create an ajax call in
Magento\Sales\Controller\Adminhtml\Order\Create\LoadBlock
so i also need to put the same jslayout config in sales_order_create_load_block_shipping_method.xml
they're both using Magento_Sales::order/create/shipping/method/form.phtml as their template. but for some reasons the ajax call cannot render sales_order_create_load_block_shipping_method.xml if the template has the type="text/x-magento-init" script.
It works fine if i remove it.
here is the code of Magento\Sales\Controller\Adminhtml\Order\Create\LoadBlock
public function execute()
{
    $request = $this->getRequest();
    try {
        $this->_initSession()->_processData();
    } catch (\Magento\Framework\Exception\LocalizedException $e) {
        $this->_reloadQuote();
        $this->messageManager->addErrorMessage($e->getMessage());
    } catch (\Exception $e) {
        $this->_reloadQuote();
        $this->messageManager->addExceptionMessage($e, $e->getMessage());
    }

    $asJson = $request->getParam('json');
    $block = $request->getParam('block');

    /** @var \Magento\Framework\View\Result\Page $resultPage */
    $resultPage = $this->resultPageFactory->create();
    if ($asJson) {
        $resultPage->addHandle('sales_order_create_load_block_json');
    } else {
        $resultPage->addHandle('sales_order_create_load_block_plain');
    }

    if ($block) {
        $blocks = explode(',', $block);
        if ($asJson && !in_array('message', $blocks)) {
            $blocks[] = 'message';
        }

        foreach ($blocks as $block) {
            $resultPage->addHandle('sales_order_create_load_block_' . $block);
        }
    }

    $result = $resultPage->getLayout()->renderElement('content');
    if ($request->getParam('as_js_varname')) {
        $this->_objectManager->get(\Magento\Backend\Model\Session::class)->setUpdateResult($result);
        return $this->resultRedirectFactory->create()->setPath('sales/*/showUpdateResult');
    }
    return $this->resultRawFactory->create()->setContents($result);
}

I think the error $resultPage->addHandle() cannot process template with type="text/x-magento-init" but im not sure how to fix this


texts: where are static blocks used, and what potential values in eav_attribute

texts:
I am about 3 months into Magento at this point.  I have worked with static blocks core_blocks being used in a store for categories to either supplement or replace the category list.  I know these are referenced in table eav_attribute as value='landing_page'.

I would like to find out our "orphaned" static blocks.  Where else can static blocks be used, and what are the possible values in the eav tables that would identify them?


texts:
I'm trying to exports products programatically with their category names. Here is my code to export it.

 <?php
require_once 'app/Mage.php';
umask(0);

// output headers so that the file is downloaded rather than displayed
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=data.csv');
// create a file pointer connected to the output stream
$output = fopen('php://output', 'w');

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(0);

$collection = Mage::getModel('catalog/product')
 ->getCollection()
 ->addAttributeToSelect('*');

foreach($collection as $product) {

  $_cat = array();
  $categoryName = array();

  foreach ($product->getCategoryIds() as $Id) {
    $_cat = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($Id);
  $categoryName = $_cat->getName();
  }
    fputcsv($output, array(
            $product->getSku(),
            $categoryName
                     )
    );
}
?>

Products are associated to multiple categories. Though the code exports only one of the category names. How I can export all the category names associated to them programmatically?


texts: Magento 2 - Move homepage cms content after a custom div

texts:
I have a custom phtml file that I've included on the homepage, this has several divs that call in static blocks. Here is a simplified version:

    <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('my_block_1')->toHtml();?>

    <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('my_block_1')->toHtml();?>

And here is how I've called it in on the homepage:

<referenceContainer name="main">
  <block class="Magento\Framework\View\Element\Template" name="homepage_content" template="Magento_Cms::homepage-content.phtml" />
</referenceContainer>

In my cms_index_index.xml I want to move the cms content block between .my-div-1 and .my-div-2 but I'm struggling to get the right reference. I currently have it wrapped in a div as follows:

<referenceContainer name='content'>
  <container name='homepage-section' as='homepage-section' htmlTag='div' htmlClass='homepage-section cms' />
</referenceContainer>
<move element='cms_page' destination='homepage-section'/>

Can someone help me with moving this between my 2 divs please, or can it not be done?


texts: Internal server error while creating invoice

texts:
I am getting a blank page while submitting invoice and when I am checking this in firebug to find some issue it is saying internal server error.
But when I am clicking back button on browser, it is taking me to the order invoice page and showing two messages.
Invoice has been created.
The order does not allow creating an invoice.
It is creating invoice but showing blank page and two contradicting messages.
I have checked Magento and server logs but didn't find anything related to it.
Please let me know if somebody faced this issue earlier and how it has been fixed or any related stuff that I can check.


texts: Magento 2 Default to Production mode (Command returned non-zero exit code:) unknown memory error

texts:
I am trying to enable production mode on Magento 2.3.3

[user@cpa public_html] $bin/magento deploy:mode:set production
Enabling maintenance mode
Starting compilation
Something went wrong while compiling generated code. See the error log for details.
Disabling maintenance mode
Command returned non-zero exit code:
`/opt/cpanel/ea-php72/root/usr/bin/php.cagefs -f /home/user/public_html/bin/magento setup:di:compile`

Error log:

[2020-06-02 10:48:06] main.INFO: /opt/cpanel/ea-php72/root/usr/bin/php.cagefs -f
/home/user/public_html/bin/magento cache:flush 2>&1
Flushed cache types:
config
layout
block_html
collections
reflection
db_ddl
compiled_config
eav
customer_notification
config_integration
config_integration_api
google_product
full_page
config_webservice
translate
vertex [] []
[2020-06-02 10:48:19] main.ERROR: /opt/cpanel/ea-php72/root/usr/bin/php.cagefs -f /home/user/public_html/bin/magento setup:di:compile 2>&1
Compilation was started.
%message% 0/7 [>---------------------------]   0% < 1 sec 78.5 MiB%message% 0/7 [>---------------------------]   0% < 1 sec 78.5 MiBProxies code generation... 0/7 [>---------------------------]   0% < 1 sec 78.5 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% < 1 sec 82.5 MiB
Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec 82.5 MiB
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors. [] []

php memory limit is set to 2G in cpanel MultiPHP INI Editor
i also tried php -d memory_limit=5G bin/magento deploy:mode:set production wich did not help

I am unable to follow the error


texts: In magento the save credit card feature needs to function similar to Amazon. They allow you to save you credit card on file so you don't have to enter it every time you come back and place an order.


texts: How to use Product Chooser Widget with UI Component Form

texts:
I want to have a field in my UI Component form and a "Select Product..." Button where I can choose a product and it gets inserted into the input.
Similar to the "Catalog Product Link" Widget.

Started by adding this to my ui_component form.xml but without desired result:

<fieldset name="assign_products" sortOrder="40">
    <settings>
        <collapsible>true</collapsible>
        <label translate="true">Products</label>
    </settings>
    <container name="assign_products_container" sortOrder="160">
        <htmlContent name="html_content">
            <block name="my_assigned_products" class="Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser">
                <arguments>
                    <argument name="button" xsi:type="array">
                        <item name="open" xsi:type="string" translate="true">Select Product...</item>
                    </argument>
                </arguments>
            </block>
        </htmlContent>
    </container>
</fieldset>

Any tips?


texts: Can I override or extend a Magento 2 module?

texts:
My question is very simple but I couldn't find any answers so far.

Is it possible to properly override or extend a Magento 2 module ? (Without duplicating the module sources).

Here is an example:

Let's say I want to add a new attribute to the Review object from the module Magento_Review. I know how to extend EAV objects like Product, Customer, ... but is it possible to extend the Review object.

So far I've created a module with a setup adding a column to the Review table. But the problem now is that I dont know if I can properly override ui components to display it in my admin views without editing the module source files.

Thanks for your answers.


texts: Magento2.3.3 File Validation failed error

texts:
I am facing error while uploading image in description unde category > Description  in Admin.

I have checked fileinfo is already installed

[04-May-2020 09:12:13 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function mime_content_type() in /mnt/data/home/hostes68/public_html/vendor/magento/module-cms/Model/Wysiwyg/Images/Storage.php:362
Stack trace:
#0 /mnt/data/home/hostes68/public_html/vendor/magento/module-cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php(60): Magento\Cms\Model\Wysiwyg\Images\Storage->getFilesCollection('/mnt/data/home/...', NULL)
#1 /mnt/data/home/hostes68/public_html/vendor/magento/module-cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php(74): Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files->getFiles()
#2 /mnt/data/home/hostes68/public_html/vendor/magento/module-cms/view/adminhtml/templates/browser/content/files.phtml(13): Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files->getFilesCount()
#3 /mnt/data/home/hostes68/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/mnt/data/home/...')
#4 /mnt/data/home/hostes68/public_html/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\Templat in /mnt/data/home/hostes68/public_html/vendor/magento/module-cms/Model/Wysiwyg/Images/Storage.php on line 362

I am totally confused as this error never occurs in my local setup & occurs only on stage setup. Also, it occurs some time on stage & other time it is fine. I am not able to get any proper fix solution for this


texts: How to check if user is logged into the admin

texts:
I'm trying to create a script then trigger it from time to time to check "who" is logged in in admin (users), so I created this:

$adminUser = Mage::getModel('admin/user');
$users = $adminUser->getCollection()->load();
echo '
';
foreach($users as $user){
$name = $user->getUsername();
Mage::getSingleton('core/session', array('name'=>$name));
    if(Mage::getSingleton('admin/session')->isLoggedIn()){
        echo $name.' is logged in
';
    }else{
        echo " go away bad boy
";
    }
}
echo '
';

?>

Simplified code .... still no positive results ....


texts: How to Filter Products Based on Attribute Value "Yes"

texts:
I have an attribute for a custom module which defines if a user can comment on the products or not.
Now I need to filter products depending on the attribute value and only display those with attribute value "Yes".
(It's a select attribute with values "Yes", "No")

Tried this code, but it only displays those products, which are NOT allowed for commenting and have the attribute value "No":

      <?php
      $optionId = "Yes"; // this should be option id
      $products = Mage::getModel('catalog/product')
      ->getCollection()
      ->addAttributeToSelect('*')
      ->addAttributeToFilter('product_comment', array('eq' =>$optionId));
      foreach($products as $_data1){
      echo '<pre>'; print_r($_data1->getName());
      }
      ?>


texts: How to change product zero prices to text in magento 2?

texts: I need to change all product zero prices to custom text - free and enable/disable this function from admin?