texts: Magento 2 InstallSchema : Is my assumption correct?

texts:
I'm creating table with reference key of catalog_product_entity, here I'm little bit of confusing while converting Magento 1.0 to Magento 2.0.

Can you clarify it.

In magento 1.0 simply I can run the below script it will execute and create the table right?

<?php

$installer = $this;
/* @var $installer Mage_Core_Model_Resource_Setup */

$installer->startSetup();

$installer->run("

-- DROP TABLE IF EXISTS `{$this->getTable('custom_info')}`;
CREATE TABLE `{$this->getTable('custom_info')}` (
  `id` INTEGER unsigned NOT NULL auto_increment,
  `product_id` INTEGER unsigned NOT NULL,
  `email` TEXT NOT NULL default '',
  `is_active` ENUM('0','1') NOT NULL DEFAULT '0',
  `date` DATETIME default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`),
  KEY `FK_custom_PRODUCT_ID` (`product_id`),
  CONSTRAINT `FK_custom_PRODUCT_ID` FOREIGN KEY (`product_id`) REFERENCES `{$this->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

");

$installer->endSetup();

In Magento 2.0 I have written code as below is it correct procedure or else wrong?

<?php

namespace Learning\Custom\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface
{

    /**
 * Installs DB schema for a module
 *
 * @param SchemaSetupInterface $setup
 * @param ModuleContextInterface $context
 * @return void
 */
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $installer = $setup;
    $installer->startSetup();

    $table = $installer->getConnection()->newTable($installer->getTable('outofstocksubscription_info'))
        ->addColumn(
            'id',
            Table::TYPE_INTEGER,
            10,
            ['identity' => true, 'nullable' => false, 'primary' => true],
            'Post ID'
        )
        ->addColumn(
            'product_id',
            Table::TYPE_INTEGER,
            10,
            ['unsigned' => true, 'nullable' => false, 'default' => '0'],
            'Product Id'
        )
        ->addColumn(
            'email',
            Table::TYPE_TEXT,
            null,
            ['nullable' => false,],
            'E Mail'
        )
        ->addColumn(
            'is_active',
            Table::TYPE_BOOLEAN,
            null,
            ['nullable' => false, 'default' => '0'],
            'Is Active'
        )
        ->addForeignKey(
            $installer->getFkName('outofstocksubscription_info', 'product_id', 'catalog_product_entity', 'entity_id'),
            'product_id',
            $installer->getTable('catalog_product_entity'),
            'entity_id',
            Table::ACTION_CASCADE
        )
        ->addColumn(
            'date',
            Table::TYPE_DATE,
            null,
            [],
            'Date'
        )
        ->setComment(
            'Out of Stock Subscription'
        );

    $installer->getConnection()->createTable($table);
    $installer->endSetup();
}

}

If it is wrong please correct me.

When I ran command: php bin/magento setup:upgrade error is came.

Error

  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key
  constraint, query was: CREATE TABLE IF NOT EXISTS
  custom_info (
      id smallint NOT NULL auto_increment COMMENT 'Post ID' ,
      product_id smallint UNSIGNED NOT NULL COMMENT 'Product Id' ,
      email text NOT NULL COMMENT 'E Mail' ,
      is_active bool NOT NULL default '0' COMMENT 'Is Active' ,
      date date NULL COMMENT 'Date' ,
      PRIMARY KEY (id),
      CONSTRAINT CUSTOM__INFO_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID
  FOREIGN KEY (id) REFERENCES catalog_product_entity (entity_id)
  ON DELETE CASCADE   ) COMMENT='Custom Table'
  ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci


texts: How to manually set some products are bestsellers

texts: Is there anyone know how to set some products are bestsellers by hand? I mean by default, customers have to buy a product a lot, then that product will appear in bestseller section. I want to fake some data here because the website I'm working on is just for showing the product


texts: Category url always has wrong store in path

texts:
How can i get a category url rewritten for a specific store in magento?

I have 2 stores: us and uk.

Store codes:  en_gb and en_us.

If i load a category in code

$store = Mage::getModel('core/store')->load(3);  // 3 is the uk store
$categoryUrl = Mage::getModel('catalog/category')->load($store->getRootCategoryId())->setStoreId($store->getId());

The url that comes back always has the default website code in the path i.e. and also never the seo friendly url.  It is the category/view url

http://mysite/us/catalog/category/view/ukbase/id/3

EDIT:

By setting the store in the script the correct country is added to the url:

 Mage::app()->setCurrentStore($store);

Why is this needed?

Also it still doesnt give the seo friendly url


texts: Add CMS Block to Sidebar in whole magento 2 site

texts:
When I create a static page with 2columns-left layout in magento, it has the space of sidebar on the left.
How can I put a static block in this sidebar so it can appear in every page with 2 columns?


texts:
var billingAddress = quote.billingAddress();
            var billingCountryId = (billingAddress.countryId);
            // console.log(billingCountryId);
            console.log({billing: billingCountryId});

            if (billingCountryId == shippingCountryId) {
                alert("shipping and billing matches");
            }
            else {
                alert("shipping and billing different error");
            }

            shippingRates(ratesData);
            shippingRates.valueHasMutated();
            checkoutDataResolver.resolveShippingRates(ratesData);

I want to add the tax rate back in on GrandTotal if the country is different for shipping and billing. is this possible through the same JS file


texts: Redirection Problem. From ‘My Account’ as well as from ‘Checkout Page’

texts:
I have store on which i am having the category for my product . on Home page my link to product is
www.example-site.com/product_sold.html but when i go to my cart and from there i open category menu it will display  www.example-site.com/mycart/product_sold.html which will give me result not found can any tell me how to solve it


texts: Magento 2 Add error/success message with knockout

texts:
I get error:

  Cannot read property 'addSuccessMessage' of undefined

When I want to add a success or error message via knockout js to magento 2. I did:

    define([
      'jquery', 'Magento_Ui/js/model/messageList', 'ko'
    ], function($) {
      "use strict";
      return function(config, element, messageList) {
        $(element).click(function() {
          var form = $(config.form);
          if ($('#h_estimate_amount').val()) {
            messageList.addSuccessMessage({
              message: 'Message to be shown.'
            });
          } else {
            messageList.addErrorMessage({
              message: 'Message to be shown.'
            });
            return false;
          }
        });
      }
    });

Any idea?


texts: Add a static URL prefix for product and category Magento 2

texts:
I need to specify a prefix static string for all URLs of my Products and Categories. Just like Wordpress Woocommerce permalinks.

For example all of Categories should have product-category prefix in their URL:

Cat One: domain.com/product-category/cat-one
Cat Two (child of 'Cat One'): domain.com/product-category/cat-one/cat-two

and all of Products should have product URL prefix, no matter what their Category is:

Product One: domain.com/product/product-one
Product Two: domain.com/product/product-two

I tried to do this solution, but It's for 3 years ago and not working in Magento 2.

Also this extension is for Magento 1.x as you see.

By the way, I'm using Magento 2.1.9 with PHP 7.0.22 and XAMPP 3.2.2.

Thanks.


texts: How to filter bestseller collection with a product attribute

texts:
You can addAttributeToFilter for product collection;

$this->_productCollectionFactory->create()->addAttributeToFilter('att_x', ['eq', $att_x_value]);

How can we do this with bestseller collection (\Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory)

And the attribute value is entity id of my custom table. I couldn't figure out how to join which tables.

Thanks in advance.


texts:
In my site there are products like curtains and customer can choose different color for curtains, for color we are using custom options so customer can choose different color, but there are we have requirement that customer can order sample color to look and feel before buying actual product, so how we can give sample order functionality.

Colors are not actual product so we can't use magento checkout functionality but if customer order sample product then how we can handle this sample order?

Looking for great idea from magento folks.


texts: Custom Report - Configurable Product - Formula Choice - Multiple Entries in sales_flat_invoice_item

texts:
I am writing a sales by product by day (based on invoice create date) report.

I am getting two result rows in a custom report for a configurable product with formula choice attribute i.e. 1 pound of peppers, red (red contains the formula choice and is a markup in price $2 over the base price of $5 for 1 pound of peppers).

The product id for 1 pound of peppers is 123 and the product id for 1 pound peppers, red is 124 (labeled as 'Not visible individually' because it is a configurable product).

When querying the sales_flat_invoice_item table both rows are returned, looking like two products, even though they are the same product, one is just configured, as such:

Product Name            product_id          price
1 pound peppers           123                $7
1 pound peppers, red      124                NULL

but I only want one row returned, a combination of the two above, to be:

Product Name            product_id            price
1 pound peppers, red     whatever              $7

My sql for the report can be stripped down to:

SELECT *
  FROM sales_flat_invoice A
  INNER JOIN sales_flat_invoice_item B
   ON A.entity_id= B.parent_id
  WHERE DATE_FORMAT(A.created_at,'%Y-%m-%d') = '2015-01-19'

so long as the only product sold on that day is the configurable pepper product (then you will see both rows in sales_flat_invoice_item).

How can I get only a combined, single row in the output as I mentioned above?  One problem is the price is on the generic item but the product name, specifically including "red" (for inventory purposes) is on the specific item and not the generic.


texts: Magento DB : sales_flat_quote_item_option table has value column, how to get its value?

texts:
Actually I was exploring the tables required for addToCart feature. Just came across this 'value' column in sales_flat_quote_item_option, it has some json value but not sure from where its getting populated and what all value it holds. For eg. 'a:4:{s:4:\"uenc\";s:124:\"aHR0cDovL21hZ2VudG8tMS42LjAuMC1yYzIubG9jYWwvaW5kZXgucGhwL2VsZWN0cm9uaWNzL2NlbGwtcGhvbmVzL2JsYWNrYmVycnktODEwMC1wZWFybC5odG1s\";s:7:\"product\";s:2:\"17\";s:15:\"related_product\";s:0:\"\";s:3:\"qty\";s:1:\"1\";}' .

Can somebody explain the values json holds ? Like what is 'uenc','s:124' etc.

Thanks


texts: Order success page as a tab in Magento 2 one page checkout

texts: Can we set checkout page like below mentioned format in magento 2.


texts:
I saw this method as efective to detect if the user is using a mobile device:

$isMobile = Zend_Http_UserAgent_Mobile::match(
    Mage::helper('core/http')->getHttpUserAgent(),
    $_SERVER
);

But I was wondering where would be best to add this?


texts: How to add a custom helper in my module?

texts:
How to create new Helper or override/rewrite Core Helper in Magento 2 module?

I tried adding dependency into my module.xml of Custom Module, but it doesn't load Helper class at all.

Below is my module.xml;

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  <module name="Company1_Module1" schema_version="1.0.0" setup_version="1.0.0">
        <sequence>Magento_Directory</sequence>
  </module>
</config>


texts: how do addButton in grid admin magento2?

texts: in grid admin magento2 i want add button new. how do it?


texts: Search never completes, but only with *some* terms

texts:
Only for some terms that we have discovered (eg "backpack", etc., for other terms everything is fine) our Magento store search seems to time out after about 10s and returns a blank page saying:

"Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request."

What could explain such a selective and weird behavior and how could I avoid it?

I already tried modifying the configuration parameters in System > Configuration > Catalog > Catalog Search. I tried the 3 types of search (Like, Fulltext, Combine) and tested permitting layered navigation for any number of results, but nothing helped...


texts:
I am having problem of magento not clearing cart after checkout.
This only happens with logged in users and with bank transfer payment. Guest user do not face this problem, also with other payment paypal and credit card both guest & logged in user do not face this problem.

Seems it only happens when a logged in user, use bank transfer payment.

Hope someone can advise on how to solve this

I have magento 1.9.2.4


texts: Is there any callbacks for admin ui grid ? For example, I need to call some js function after grid was fully loaded.


texts: Catalog price rule is not getting applied

texts:
I have set a catalog price rule for a specific product using Sku. I scheduled the rule, but when I check catalogrule_product & catalogrule_product_price table both are empty. Can someone guide me on how to debug this issue

Even when I check content staging dashboard it is showing Upcoming

According to AEST it is 17th date


texts:
On https://climb-europe.com I don't have Denmark listed in the country dropdown at checkout NOR in the list of allowed countries in the backend
In the directory_country table is listed as country_id DK, iso2 DK and ISO 3 DNK
It is also listed in en.xml - Denmark
The locale for the store is UK so en_gb and it has multi stores
Anyone have any ideas as to how to get Denmark showing up in the lsit of countries


texts: How to create newsletter subscriber programmatically magento2

texts:
How to create newsletter subscriber programmatically ? I have email id I want to save that email id in newsletter subscriber how can I do that ?

<?php

/**
 * Copyright 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace vendorname\moduelname\Model;

use Sapient\CustomApi\Api\CustomInterface;

/**
 * Defines the implementaiton class of the calculator service contract.
 */
class Custom implements CustomInterface
{

    protected $subscriberFactory;

    public function __construct(

    \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory
) {
    $this->subscriberFactory= $subscriberFactory;

}
    /**
     * Return the sum of the two numbers.
     *
     * @api
     * @param int $num1 Left hand operand.
     * @param int $num2 Right hand operand.
     * @return int The sum of the two values.
     */
    public function add($num1, $num2) {
        return $num1 + $num2;
    }

    /**
     * Sum an array of numbers.
     *
     * @api
     * @param string[] $email The array of numbers to sum.
     * @return string The sum of the numbers.
     */
    public function newsletter($email) {

           //$data ="sssssssss";
          // print_r($data);
           //die;
        $this->subscriberFactory->create()->subscribe($email);
        return $email;
    }
}


texts: Magento 2.3: If click edit product it generates an error

texts:
I'm using Magento2.3. if click edit product it throws this error

  [ There has been an error processing your request Exception printing
  is disabled by default for security reasons.

  Error log record number: 536178908660 ]


texts: Sending the same item to multiple recipients

texts: We want to allow our customers to send a gift in quantities higher than 1, (for example, 20 of the same set of candles,) to multiple recipients, (in our case, 20 unique recipients for the candles.)


texts: I am facing error #10548, how can I solve this error?


texts:
Does anybody know how to solve this problem:

i'm trying to add custom field validation. Chrome console does not have any errors.

app/code/Company/Module/view/frontend/web/js/view/payment/script.js

define(
    [
        "jquery",
        "mage/validation"
    ],
    function ($) {
            console.log('fire1');
        $.validator.addMethod('test-req', function(v) {
            console.log('fire2');
            return false;
        }, 'The amount you entered is too low.');
    }
);

src/app/code/Company/Module/view/frontend/web/template/payment/form_additional.html

<input class='required test-req' type='text'  data-bind="value: checker" placeholder='Enter the value' minlength='10' maxlength='10'/>

On page loading fire1 always works. But fire2 is never called. What could be a problem here?


texts: Any change to default.xml breaks homepage layout

texts:
Fairly new to Magento 2.  Working from a cloned version of another site and trying to make simple, cosmetic changes to the custom theme homepage here:

app/design/frontend/Vendor/Theme/Magento_Theme/layout/default.xml

Any change I make manifests immediately, but unrelated parts of the page break at the same time.  Most of what's in page-header disappears, and a new div called nav-sections appears with all our categories in it.

These exact changes occur regardless of how I alter default.xml -- even adding a character to a string causes them.

My hunch is it's a question of workflow, and I'm still unclear about when and how Magento 2 decides to create and serve files from pub/static, generated, and var/generated.

I should also note that I'm making these changes in production mode, and that running deploy doesn't fix anything.

What am I doing wrong here?


texts: How can i add Custom Print button on Managed products Grids and print those details?

texts:
I need to print my products details like name, SKU, price, image.

Code :

<?php
set_time_limit(0);
//THIS SCRIPT JUST INITIALS THE PROFILE TO BE RUN VIA MAGENTO ADMIN "RUN PROFILE IN POPUP". Its the same thing as click just via this file that you can run via Cron
$profileId = 1; // SYSTEM - IMPORT/EXPORT - DATAFLOW PROFILES PROFILES <-- you need to go into your Magento admin and grab the exact profile ID

require_once 'app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$sku = 10; //this sku you get it from your text box.
$_product = Mage::getModel('catalog/product')->getCollection()
                  ->addAttributeToSelect(array('name', 'sku', 'price', 'thumbnail'))
                  ->addAttributeToFilter('status', 1)
                  ->addAttributeToFilter('sku', array('in' => $sku));

$imageHelper = Mage::helper('catalog/image');
foreach($_product as $prod){
    $name      = $prod->getName();
    $price     = $prod->getPrice();
    $thumbnail = $imageHelper->init($prod, 'thumbnail')->resize(150,220);

}

  echo "Name:   ", $name;
  echo "
";
  echo "Sku:    ", $sku;
  echo "
";
  echo "Price:  ", $price;
  echo "
";
  echo "";
?>

Everything Okay..

How can I add this to managed products grid, like if I click print, the above details should get them printed?


texts: Cleaning up a parent theme and creating a child theme.

texts:
We are in the process of creating a child theme for a theme that is being used: Ultimo. A number of customisations were made to the parent theme which should have been made to a child theme. We do not have a comprehensive list of those changes.

Is there a means of comparing the Original files of the theme and the customised theme to highlight the changes so that we can transfer these across from parent to child theme?

Thanks


texts:
If you can not tell by this question I will out right tell you I am still trying to figure out the Magento layout.

I need to modify the footer links but under CMS > Static Blocks, in the wysiwyg, I find footer_links enabled but the content is of default settings + it is commented out:

    ``

The links that exist in the footer, such as "SITE MAP, SEARCH TERMS, ADVANCED SEARCH, ORDERS AND RETURNS, CONTACT US", I can not find anywhere.

I have searched many of the xml files but I am not even sure if that is where I need to find them. Am I going down the correct path? app/design/frontend/[template-name]/default/layout/ or .../template/?

I am baffled. Can anyone help point the way here?


texts:
I am still a newbie in Magento. I am looking for a way to read csv file for automating product upload to Magento. I will be receiving the csv file that contains the product attributes (data and images) via SFTP. I am wondering how can I read this csv file?
I read this post on how to connect Magento 2 with SFTP:  How to connect SFTP in magento 2. I am not sure where to even put that code, do I need to create a new module, etc...?
Any advice on how to approach this will be appreciated. Thank you.


texts: Magento 2 - sample data typo package name error version 2.2.0-dev

texts:
I have setup magento 2 in linux by Clone the Magento repository method.

cloned magento 2 form this github repository.
https://github.com/magento/magento2

Branch - develop (Here all magento modules available in app/code/Magento folder not in vendor/magento folder)

Magento 2(version - 2.2.0-dev) working fine and run without sample data.

But now when I run php bin/magento sampledata:deploy command it gives me error.

root@root:/var/www/html/magento2# php bin/magento sampledata:deploy

I am using develop branch where all magento modules by default available in app/code/Magento directory.

please help me ASAP. I am new to magento 2.


texts: How to display Banner in list page dynamically?

texts: I want to keep banner images in list page. Creating a static block for that and selecting that static block for each category will work and I tried that. But I have more number of categories & subcategories like 50+. So should I create a static block for each and every category or is there any way to fetch that banner images dynamically?


texts: Magento API error while creating gost account

texts:
When i'm pasing $customerObject->newsletter  = $wantToSubscribe; in magento API in log there is error LogicException: Property "Newsletter" does not have corresponding setter in class

public static function createGhostCustomer($email,$websiteId,$wantToSubscribe)
{
    self::auth();

    $websiteData = self::extractWebsiteAndStore();
    //print_r($websiteData);exit;

    if(!isset($websiteData[$websiteId]))
    {
        throw new Exception('Website does not exists');
    }

    $customerObject = new \stdClass();
    $customerObject->group_id   = 1; //Retail
    $customerObject->email      = $email;
    $nameToken = explode('@',$email);
    $customerObject->firstname  = '.';
    $customerObject->lastname   = '.';
    $customerObject->customAttributes[] = ['attributeCode'=>'contact_preference','value'=>"50"];
    $customerObject->customAttributes[] = ['attributeCode'=>'created_from_track','value'=>"53"];

// New object
      $customerObject->newsletter  = $wantToSubscribe;
//
    $customerObject->store_id = $websiteData[$websiteId]['store_id'];
    $customerObject->website_id = $websiteData[$websiteId]['website_id'];

    $body = json_encode(['customer'=>$customerObject]);
    $result = self::call('POST',self::$_url.'V1/customers',$body);

    return json_decode($result);
}


texts: Programmatically duplicated product not getting displayed in frontend

texts:
I use the following script (inside a controller - action for now) for duplicating a product programatically.
public function createAction(){
    $data = $this->getRequest()->getParams();

    $product = Mage::getModel('catalog/product');
    $_product = $product->load($data['prod_id']);

    $clone = $_product->duplicate();
    $clone->setSku($data['dup_prod_sku']);
    // $clone->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);

    $clone->setPrice($data['dup_prod_price']);
    $clone->setSpecialPrice($data['dup_prod_sp_price']);
    $manage_stock = $data['dup_manage_stock'];
    $qty = ($data['dup_prod_stock'] == "") ? 0 : trim($data['dup_prod_stock']);
    $is_in_stock = $data['dup_is_in_stock'];
    if($manage_stock == 1){
        $stockArray = array(
                        'use_config_manage_stock' => 0,
                        'manage_stock' => 1,
                        'qty' => $qty,
                        'is_in_stock' => $is_in_stock,
                    );
    } else{
        $stockArray = array(
                        'use_config_manage_stock' => 0,
                        'manage_stock' => 0,
                    );
    }
    $clone->setStatus(1);
    $_idArray = Mage::helper('marketplace/vendor')->getVendorIdFromUserId();
    $_vendor = Mage::getModel('marketplace/vendorcode')->getCollection()
                            ->addFieldToSelect('attr_opt_id')
                            ->addFieldToFilter('vend_user_id', array('eq' => $_idArray['user_id']))
                            ->getFirstItem();
    $clone->setVendor($_vendor->getAttrOptId());
    $clone->setTaxClassId(4);
    $image_url = $this->getBaseImagePath($_product->getImage());
    $clone->setMediaGallery(array());
    $clone->setStockData($stockArray);
    try{
        $clone->getResource()->save($clone);
        $new_product = $product->load($clone->getId());
        $new_product->addImageToMediaGallery($image_url, array ('image', 'small_image', 'thumbnail'), false, false);
        $new_product->save();
        $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($clone->getId());
        foreach($stockArray as $key => $val){
            $stockItem->setData($key, $val);
        }
        $stockItem->save();
    } catch(Exception $e){
        Mage::log($e->getMessage());
    }
    $this->_redirect('*/*/productgrid');
}

This works well and the product gets duplicated with supplied SKU and overwritten prices from a form.

I can see the product in product grid in admin panel.
Visibility is set to Catalog, Search
Product is in stock
Enabled and tagged to correct category and website.

But still I cant get it to display in the category page in the frontend, whereas I can see the products duplicated from admin panel without any problem.
Moreover If I try to reindex, Product Flat Data isn't getting reindexed and is throwing SQL foreign key constraint error.
NOTE:
Vendor is a custom attribute


texts: Magento2: Programmatically create bundle product

texts:
I'm trying to programmatically create a bundled product using the following link as a reference:
https://github.com/magento/magento2/blob/develop/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php

I'm adding the bundle product first, without any options, then loading it out of the database in order to add the linked products.

Here's an example of the array I'm using:

Array
(
    [0] => Array
        (
            [title] => Test option
            [required] => 1
            [type] => radio
            [position] => 0
            [product_links] => Array
                (
                    [0] => Array
                        (
                            [sku] => test-simple
                            [qty] => 1
                            [position] => 0
                            [is_default] =>
                            [price] => 0
                            [price_type] => 1
                            [can_change_quantity] => 0
                        )
                )
        )
)

And here's my code to add the relation:

    $bundleProduct = $this->objectManager->get('Magento\Catalog\Model\Product')->load($productID);
    $bundleProduct->getExtensionAttributes()->setBundleProductOptions($bundleOptions);
    $bundleProduct->save();

However, this does not add any linked product to the bundle product. Doesn't anyone have an idea what I'm missing? As the documentation for Magento2 is very limited at the moment.


texts: Set column admin grid become the first one to be sorted

texts:
I have a column in my custom admin grid like this:

<column name="delivery_date_to" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
            <settings>
                <filter>dateRange</filter>
                <dataType>date</dataType>
                <label translate="true">ETA To</label>
                <sorting>desc</sorting>
            </settings>
        </column>

i'd like this column to be sorted first, so it will look like this when everytime i load the grid:


texts:
Magento 2 Auto Redirect To Product Details Page If Category Have Only One Product

only one product in a category, just go to product detail page when clicking that category menu

i'm use Mage::app()->getFrontController()->getResponse()->setRedirect($url); in Magento 1.

this working in  Magento 1 but not working in  Magento 2

How to change the code.


texts: How can I add breadcrumbs in content CMS page from backoffice Magento 2?

texts:
I have already tried this solution but with no result! I want to display image then breadcrumbs and finally a paragraph
[{block class="Magento\Theme\Block\Html\Breadcrumbs" template="Magento_Theme::html/breadcrumbs.phtml"}}


texts:
I am working with the Magento 2.3, and using the PHPStorm as a IDE. Recently I've configured the xdebug in my local for identify some process flow. But it does not helped me to checked the flow.
Then I hit the website in local, I am facing
the Uncaught Error: Call to undefined function xdebug_disable() in vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php on line 73
I've checked with google bug I couldn't find any proper solution for this.
Right now I am using the nginx with PHP7.2
I am looking forward to your support to fix the problem.


texts:
When I try to create a customer in frontend I get a error page (404 not found) and I´m being redirected to this link: customer/account/createpost/.
I´d looked some similar posts problems and found a solution by adding

<?= $block->getBlockHtml('formkey'); ?>

after my  tag.
I´d done and it didn´t worked for me.

Any ideas ?


texts:
I was able to get the shipping fee using the below code on product page. But shipping fee were different from the checkout page. Please help? What is wrong with the code?

UPS shipping fee on product page: 16.08

UPS shipping fee on checkout page: 29.78

 $quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore('default')->getId());
        $_product = Mage::getModel('catalog/product')->load(8344);;
        $country = "US";
        $zipId = "91203";
        $qty = 12;
        $quote->addProduct($_product, $qty);
        $quote->getShippingAddress()->setCountryId($country)->setPostcode($zipId);
        $quote->getShippingAddress()->collectTotals();
        $quote->getShippingAddress()->setCollectShippingRates(true);
        $quote->getShippingAddress()->collectShippingRates();
        $_rates = $quote->getShippingAddress()->getShippingRatesCollection();
        $shippingRates = array();
        foreach ($_rates as $_rate):
                if($_rate->getPrice() > 0) {
                    $shippingRates[] =  array("Title" => $_rate->getMethodTitle(), "Price" => $_rate->getPrice());
                }
        endforeach;


texts: Magento2 - Same Product is appending twice from product review page

texts: I'm facing a issue when user is LogIn and adds One product to cart and Logout and adds same product to cart  from category page when user Login again two products gets append in cart.Old cart quantity has to be updated with newer one


texts:
While i create a router in magento 2.2.6 module i face the following error

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file /var/www/html/magento/app/code/Bz/Bcs/etc/frontend/routes.xml:
Element 'config', attribute '{http://www.w3.org/2001/XMLSchemainstance}noNamespaceSchemaLocation': The attribute '{http://www.w3.org/2001/XMLSchemainstance}noNamespaceSchemaLocation' is not allowed.
Line: 2

Element 'config': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 2

Element 'router': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 3

Element 'route': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 4

Element 'route': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 4

Element 'router': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 3

My routes.xml code is

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="blaze" frontName="blazeaccess">
            <module name="Bz_Bcs" />
        </route>
    </router>
</config>


texts:
I'm having problems with programmatically configuring Magento 2.1. How can I add data to core_config_data?

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

    $config = $this->mutableScopeConfig;
    $config->setValue('design/footer/copyright', 'Copyright © 2016 swiatksiazki.pl');

    $setup->endSetup();
}


texts: Magento 2.2.6 configurable product page load slow!

texts:
I have one Magento website with a few configurable products.Each configurable product associated with minimum 12 simple products..Those simple products are showing in swatch so user need to select when open that configurable product.But when user open the product details page in front end side it is loading very slow first time (approx 31 sec).But  when open second time it is taking 3.8 sec.I am using out of the box Magento profiler and it says

  Timer Id =
  "../view_preprocessed/pub/static/vendor/magento/module-swatches/view/frontend/templates/product/view/renderer.phtml"
  Time = 31.185969

Avg = 31.185969
Cnt =1
Emalloc = 671,624
RealMem = 0
please suggest me how to optimize loading time for first time page open.

Thanks : )


texts:
I am trying to schedule prices for 24-26th on Max Motorsport but a SALE tag appears with no sale price.

Can I remove this tag automatically and enable it on Friday morning but have all sale prices changed as they are scheduled?


texts: Creating a custom homepage template in Magento2.1.5

texts:
i know this question is already here.But i have tried all things. And nothing works for me.i need help, i am new to magento i have created a custom theme as default theme. Now i am trying to create a custom page template like app\design\frontend\accu\accu-theme\magento_theme and create the layout like

app\design\frontend\sample\sample-theme\magento_theme\page_layout\custom_home.xml

  <?xml version="1.0"?>
  <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
      <update handle="empty"/>
      <referenceContainer name="page.wrapper">
          <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
          <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
          <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
      </referenceContainer>
  </layout>

app\design\frontend\accu\accu-theme\magento_theme\layouts.xml

  <?xml version="1.0" encoding="UTF-8"?>
  <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
      <layout id="custom_home">
          <label translate="true">Custom Home</label>
      </layout>
  </page_layouts>

this is my code. In my admin panel Content->Pages in Home-Page not showing the custom-home page. Any one help me.


texts: How do I make my custom module pages use SSL?

texts:
I've created a Module with some pages and I'm wondering how do I force this pages to use SSL on the url, like the customer login page. Not all of the pages need it, but some do.

What comes to mind (though I haven't tried it) is to evaluate the url in the action controller and redirect to https:// if SSL is enabled in magento config and the current URL is not using it.

Is this approach correct? Or does this kind of setting go in the configuration file?


texts:
Odd one, we have an SKU that is 063.665.

Frontend however under additional information it shows as 63.67.

So it strips the leading 0 and rounds the end.

Does anyone know how I can stop this rounding under additional information?


texts: How to override template in newsletter/manage?

texts:
I try to override the following template which is under www.example.net/newsletter/manage with my own

/vendor/magento/module-customer/view/frontend/templates/form/newsletter.phtml

Block class: Magento\Customer\Block\Newsletter

I already asked the question Override template and block from a module?, and I understood it. But I struggle to find out, how to override this one.

I added my custom template file newsletter.phtml to my module:

  app\code\Black\Newsletter2Go\view\frontend\templates\form\newsletter.phtml

What step is required next? I guess I need to add a layout file too, but how do I know how it has to be named?

I need a walkthrough for this one please so that I can understand how this all works together.


texts: How to add additional product on order summary when customer click on specific shipping method

texts:
I want to add additional product on the checkout page with the already added product through add to cart in the order summary.

how can I achieve that is there anyone have an idea??


texts: Price wrong on certain products when added to cart

texts:
I am having a bit of an issue with my site at the moment and I just wanted to see if anybody knows what might be the cause of the symptoms going on.

Certain products seem to have different prices once they are added to the cart. The price displays correctly on the actual product page but then once added the total changes (both up and down for different products by varying amounts).

All of the ~100k products on the site have a stock/price updated each morning and so I guessed that it could be a re-indexation issue, however I checked and straight after each import the product price index is re-indexed + cache is cleared.

Most products seem to work just fine as normal but every once in a while an odd one will pop up. If I get news from a customer about a product with the wrong pricing on the cart then simply re-saving the product in the back-end changes it straight back to the normal price without any trouble. Although re-indexing the product price index doesn't change it back.

The nature of the problem and the fact that imports overwrite data each morning means it is quite hard to track down the issue as some days I notice no products like this and other days I'll find one or two.

Any help or direction is greatly appreciated, thanks!

Magento CE v 1.9.1
Running on a debian EC2 instance on AWS.

NOTE: RE-INDEXING DOESN'T RESOLVE THE ISSUE - ONLY MANUAL SAVE OF AFFECTED PRODUCTS


texts: Can I upload SVG images to the products on Magento 2.2.3?

texts:
Is it possible to upload SVG images to the products on Magento 2.2.3. I have read many topics related to my issue, but I didn't get a clear solution on that. Please let me know whether it's possible or not.

Is this possible, how to do that?. Please comment.


texts: AJAX category page navigation and going back from product page (Magento 1.9.3)

texts:
I'm wondering if this is even possible to do:
I have ajax category pages navigation and url stays the same no matter what page you are on. Is it possible to redirect to that certain page where the product was chosen and when clicking browser "back" button on product page.

For example I choose product on the 4th page and click back, and I will be on that 4th page again? I know i could do this when there is no ajax navigation, but can I combine these two?
Thanks!


texts: ClassName::class vs FQN (eg '/Magento/Catalog/Model/Product')

texts:
In magento2's code style its mentioned to use ::class. see: http://devdocs.magento.com/guides/v2.0/coding-standards/code-standard-php.html

however in objectManager or resource model initialization i never see this code style in magento's core files. So what is the conclusion here?
Either:
* using ::class is not allowed here, why?
* magento2 is not following their own guidelines


texts: Does anyone have any insight on how Magento handles Grouped Products in search? For example, if a site has products 1, 2, 3 inside of grouped product 4, when searching for a search term that is contained it product 3's description, would product 4 be returned by the search? If not, is there a way to alter this behavior?


texts: How to get product count by rating collection in magento1.9

texts: I need to show star rating list in Layered Navigation in magento1.9 and also need to add custom filter function in layered navigation like Magento default filter functionality.So, before that, I want to know how to get product count by rating collection, by which it will be easy to show product count besides each Star Rating in Rating list. If any one knows about it, please reply back. Thank You


texts: I want to disable Cash on delivery(COD) for all the other countries other than one. for example, if I select India in the address field the COD should be enabled and if I select any other country it should get disabled. Kindly let me know how can I do this.


texts: magento 2 Required PHP extension 'Imagick' was not loaded

texts:
I get this error when upgrading my back up Magento 2.

How I can fix this error ? and which module need Imagick ?

My server's OS is CentOS


texts: Image category attribute - Image is not saving in magento 2

texts:
I have created an image category attribute in admin panel.And i found there is an magento default bug in internet.it said need to overwrite module-catalog core files..I used di.xml to edit core files but it doesn't response...

Anyone knows alternative way to edit core files?


texts: Content > Design > Configuration Blank on new installation

texts:
I did a fresh setup of magento2 and upon completion, I couldn't set any configuration options in Content > Design > Configuration.  The table rendered with no available results.

After trying numerous troubleshooting steps, I finally deleted my custom theme out of the app/design/frontend/vendor/template folder.  Once app/design/frontend/ only contained the Magento folder and nothing else, the install properly set a default configuration for the stores and the Content > Design > Configuration renders perfectly normal.  I am then able to copy my custom theme back into the frontend design folder and set it as active.

Apparently, Magento2 completely falls apart and can't set the default Luma theme if you have theme files installed.  Has anyone else encountered this bug?  Could there be something in my custom theme that causes a fresh install to fail when setting the default theme?


texts: How to use template methods fetchView() and renderView()?

texts:
I want to know how these two methods from the "core/template" block work and in wich case we need to use them, which we practically don't use often.

This is the code from app/code/core/Mage/Core/Block/Template.php:

    /**
     * Retrieve block view from file (template)
     *
     * @param   string $fileName
     * @return  string
     */
    public function fetchView($fileName)
    {
        Varien_Profiler::start($fileName);

        // EXTR_SKIP protects from overriding
        // already defined variables
        extract ($this->_viewVars, EXTR_SKIP);
        $do = $this->getDirectOutput();

        if (!$do) {
            ob_start();
        }
        if ($this->getShowTemplateHints()) {
            echo <<<HTML

{$fileName}

HTML;
            if (self::$_showTemplateHintsBlocks) {
                $thisClass = get_class($this);
                echo <<_viewDir . DS . $fileName);
            if (strpos($includeFilePath, realpath($this->_viewDir)) === 0 || $this->_getAllowSymlinks()) {
                include $includeFilePath;
            } else {
                Mage::log('Not valid template file:'.$fileName, Zend_Log::CRIT, null, null, true);
            }

        } catch (Exception $e) {
            ob_get_clean();
            throw $e;
        }

        if ($this->getShowTemplateHints()) {
            echo '
';
        }

        if (!$do) {
            $html = ob_get_clean();
        } else {
            $html = '';
        }
        Varien_Profiler::stop($fileName);
        return $html;
    }

    /**
     * Render block
     *
     * @return string
     */
    public function renderView()
    {
        $this->setScriptPath(Mage::getBaseDir('design'));
        $html = $this->fetchView($this->getTemplateFile());
        return $html;
    }


texts:
I would like to know the best method for adding additional data to the sales order screen.

I would like to add an additional line below 'Purchased From'

Not sure if I should be editing the templates, editing blocks or extending some logic - thanks!


texts: Toggle button in Magento 2 in frontend Form

texts:
In frontent customer edit form, I need to show toggle button as below

In admin it is showing using component JS. Not able to use HTML and component in frontend.
Can anyone help me on this. Thanks.


texts: Magento 1.7.0.2 mail notification not working

texts:
I had developed a ecommerce portal using magento 1.7.0.2, portal was working great and there is no problem with backend. But, i am facing a big trouble with email notification.

When user register, order confirmation, order updates etc. For any process, email notification not functioning.

Looking for the best support to fix this one.

thanks


texts: Why is Magento still showing old version in backend after installing Patch?

texts:
I installed the Patch SUPEE-11086 but my Magento Version still shows 1.9.4.0 instead of 1.9.4.1

Why is the version not changed?


texts: Magento2.3.0: On checkout page first time loader loading non stop after refresh its working on it loader hide

texts:
When I go to checkout page there loader loading non stop loading this issue comes on chrome browser only normal and private browser.

I have to check it log but not getting any error related to js.


texts: Magento 2 how to make group attribute in customer info multiselect?

texts: How to make it to allow customers belonging to multiple groups? Any suggestions will be appreciated. Thanks.


texts: Why my billing address is repeating in the order success page?

texts:
After successful placed order, the success page contains a repetitive billing address like ..

james dohg
riverside lane
56 arches park
56 arches park
56 arches park
56 arches park
sulket, ph5 3np
united Kingdom
T: 02045698630
F: 02055555630

It doesn't appear all the time but sometimes it is coming like this.
I can't understand what is the problem.
Is it at the time of customer address entry during the checkout process ?


texts: Missing one section group in admin configuration in store view only

texts:
Hi I'm looking to the file native vendor/magento/module-tax/etc/adminhtml/system.xml
My issue is that I want the calculation group to be shown in store view. (This seems to be native in that file). But in my project; the group calculation is not in the store view, he is on the website view (while for example, the classes one is on my store view).
So I guess I have some modification somewhere that broke the showInstore...but I don't know where to look at this. I guess there should be a config in core config data that overides this...but I can't find it.
There is a lot but here is a simplification of the core file
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>

        <class>separator-top</class>
        Tax
        <tab>sales</tab>
        <resource>Magento_Tax::config_tax</resource>
        <group id="classes" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
            Tax Classes
            <field id="shipping_tax_class" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                Tax Class for Shipping
                <source_model>Magento\Tax\Model\TaxClass\Source\Product</source_model>
            </field>
            <field id="default_product_tax_class" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                Default Tax Class for Product
                <source_model>Magento\Tax\Model\TaxClass\Source\Product</source_model>
                <backend_model>Magento\Tax\Model\Config\TaxClass</backend_model>
            </field>
            <field id="default_customer_tax_class" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                Default Tax Class for Customer
                <source_model>Magento\Tax\Model\TaxClass\Source\Customer</source_model>
            </field>
        </group>
        <group id="calculation" translate="label" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
            Calculation Settings
            <field id="algorithm" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                Tax Calculation Method Based On
                <source_model>Magento\Tax\Model\System\Config\Source\Algorithm</source_model>
            </field>
        </group>


texts: blank page after upgrading from 1.8 to 1.9.3.10

texts:
I'm updating a Magento 1.8 to 1.9.3.10 with the Magento connect.
Everything worked fine (or at least with no visible errors during the process), but now I have all the site as a blank page, and no access to admin (blank page also).

I've followed the guide to update Magento with the connect, and everything seems to work fine, but now what is happening is:

Any frontend page is loading "for a while" then display a blank page, but the HEAD section of HTML is printed (not all, but most).

While if I try to access a backend resource, a blank page (with only one byte) is displayed.

What I have actually is this, in the system.log there are these two lines:

2018-11-06T12:44:23+00:00 ERR (3): Warning: include(/home/ggservice/ivsanbernard/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php): failed to open stream: No such file or directory  in /home/ggservice/ivsanbernard/lib/Varien/Autoload.php on line 94
2018-11-06T12:44:23+00:00 ERR (3): Warning: include(): Failed opening 'Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php' for inclusion (include_path='/home/ggservice/ivsanbernard/app/code/local:/home/ggservice/ivsanbernard/app/code/community:/home/ggservice/ivsanbernard/app/code/core:/home/ggservice/ivsanbernard/lib:.:/usr/share/php:/home/ggservice/ivsanbernard/app/code/local/TypoStores/Less/Model')  in /home/ggservice/ivsanbernard/lib/Varien/Autoload.php on line 94

No error.log is created.

Interesting thing: if I misspelled a page, the 404 page is shown perfectly, with menu, footer, images, everything, no links is working from there.

do you have an clues? idea?


texts:
Magento ver. 2.2.0-dev

I want to make changes in style.css which is located at "pub/static/frontend/mytheme/mytheme_default/en_US/css/style.css".

If I make any changes in this folder directly no changes are taken place.

There is a file style.less in /app/design/frontend/theme/theme2/web/css

Update:
i created a file style.css in  /app/design/frontend/theme/theme2/web/css/style.css

and called the same class as defined in "pub/static/frontend/mytheme/mytheme_default/en_US/css/style.css"**

with some changes and run
php bin/magento setup:static-content:deploy from putty still it caches old styles.

then flushed cache also

Flushed cache types:
config
layout
block_html
collections
reflection
db_ddl
eav
customer_notification
config_integration
config_integration_api
full_page
translate
config_webservice

Update:

CSS is not merged from admin panel.

I commented old pub and run deploy - f, still CSS not updated and all the images are not showing. In the console, they are showing 404 for all images.

image path
http://website.in/pub/media/Plazathemes/brandslider/images/2/_/2_2.png
what to do.

Any suggestions.

Thank You.


texts: $attribute_string = $this->product->getResource()->getAttribute('attribute_code') returns null

texts:
why the following code:

$attribute_string = $this->product->getResource()->getAttribute('attribute_code');

gives me null although the attribute exist.

and following code:

$attribute_string = $this->product->getAttributeText('layeredmake')

gives me false


texts: Set default filter for Customer grid during order creation in Magento2

texts:
I added a Customer Group column in Customer grid during order creation for Magento2, Then I filtered this grid base on Customer Group.

Customer grid filtered and it is working fine but module affected on some other grids of admin. For example "Customer Groups" grid in Customer menu doesn't load. Also "Themes" grid and "Configuration" grid in "Content" menu are not loading.

Layout file is

[vendor]\[module]\view\adminhtml\layout\sales_order_create_customer_block.xml

Like this

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="adminhtml.customer.grid.container">
            <arguments>
                <argument name="dataSource" xsi:type="object">\[vendor]\[module]\Model\ResourceModel\Order\Customer\Collection</argument>
            </arguments>
        </referenceBlock>
        <referenceBlock name="adminhtml.customer.grid.columnSet">
            <block class="Magento\Backend\Block\Widget\Grid\Column" as="group" after="name">
                <arguments>
                    <argument name="header" xsi:type="string" translate="true">Group</argument>
                    <argument name="index" xsi:type="string">customer_group</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

dataSource class is

\[vendor]\[module]\Model\ResourceModel\Order\Customer\Collection.php

Like this:

<?php
namespace \[vendor]\[module]\Model\ResourceModel\Order\Customer;
class Collection extends \Magento\Sales\Model\ResourceModel\Order\Customer\Collection
{
    protected function _initSelect()
    {
        parent::_initSelect();
        $this->joinField(
            'customer_group',
            'customer_group',
            'customer_group_code',
            'customer_group_id=group_id',
            null,
            'left'
        );
        return $this;
    }
}

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Backend\Block\Widget\Grid" type="\[vendor]\[module]\Block\Adminhtml\Custom\Grid" />
</config>

and this class is for filtering:

Grid.php

<?php
namespace [vendor]\[module]\Block\Adminhtml\Custom;
use Magento\Backend\Block\Widget\Grid as WidgetGrid;
class Grid extends WidgetGrid
    {
         protected function _construct()
         {
             parent::_construct();
         }

         protected function _prepareCollection()
         {
             if(!$this->getParam($this->getVarNameFilter(), null)) {
                  $this->getCollection()->addFieldToFilter('customer_group', array('in' => ['retailer','wholesale']));
              }
              parent::_prepareCollection();
         }
    }


texts: Products are disabled after reindexing in magento2

texts:
I having two websites with two domains are pointed to a shared IP address and managed in different folders with different login credentials, DB, Domains, c-panel, etc to each project.
Ex:
domain1: example1.com            home directory:home/example1
domain2: example2.com            home directory:home/example2
If I logged in to c-pnael and run reindex command to domain2 it will disable all the products in the domain1 and vice verse.
How this issue happen, How could we solve this?
Thanks in advance.


texts: Which files needs to be edited for implementing custom design for top menu

texts:
I have been struggling in Magento for "How to implement custom Menu design" and which all files needs  to be edited for the same. Menu design is simple.

Here is what i am trying to replicate in Magento.

Please let me know guys which all files it is need to customize top menu.

Can any one please share any good tutorial or article on how Magento builds Top Menu navigation?

Thanks


texts: the following error as seen in the screenshot came up during the data migration from M1 to M2 using data migration tool. Please share your views as to how I go about eliminating this error with a brief explanation. Thank you.


texts: Plugin class doesn't exist for plugins of type virutal

texts:
I have a base plugin which accepts blockName(String) as a parameter.
Based on that value I have created three virtual type plugins and used them.
Below are the codes.
di.xml
 <virtualType name="Vendor\ModuleName\Plugin\FirstPlugin"
              type="Vendor\ModuleName\Plugin\BasePlugin">
     <arguments>
         <argument name="blockName" xsi:type="string">dummyone</argument>
     </arguments>
 </virtualType>

 <virtualType name="Vendor\ModuleName\Plugin\SecondPlugin"
              type="Vendor\ModuleName\Plugin\BasePlugin">
     <arguments>
         <argument name="blockName" xsi:type="string">dummytwo</argument>
     </arguments>
 </virtualType>

 <virtualType name="Vendor\ModuleName\Plugin\ThirdPlugin"
              type="Vendor\ModuleName\Plugin\BasePlugin">
     <arguments>
         <argument name="blockName" xsi:type="string">dummy</argument>
     </arguments>
 </virtualType>

 <type name="Some\Core\Class">
     <plugin name="Vendor_ModuleName::FirstPlugin"
                type="Vendor\ModuleName\Plugin\FirstPlugin" sortOrder="1"/>
 </type>

 <type name="Some\Other\Core\Class">
        <plugin name="Vendor_ModuleName::SecondPlugin"
                type="Vendor\ModuleName\Plugin\SecondPlugin" sortOrder="1"/>
 </type>

 <type name="Some\Another\Core\Class">
        <plugin name="Vendor_ModuleName::ThirdPlugin"
                type="Vendor\ModuleName\Plugin\ThirdPlugin" sortOrder="1"/>
 </type>

BasePlugin.php
class BasePlugin
{
    public $blockNames = [];
    public $layout;
    public $resultJsonFactory;

    public function __construct(JsonFactory $resultJsonFactory, Layout $layout, string $blockName)
    {
        $this->resultJsonFactory    = $resultJsonFactory;
        $this->layout               = $layout->getLayout();
        $this->blockNames        [] = $blockName;
    }

    public function afterExecute($subject, $result)
    {
     //After plugin code.
    }

The code is executing as expected, in the front end there are no errors. The Base plugin code is being execute every time with the correct constructor parameters for the three virtual plugins.
But when I run setup:di:compile, I am getting the error stating Plugin class Vendor\ModuleName\Plugin\FirstPlugin doesn't exist.
Why is that happening? Is there something wrong in my way of declaring the virtual types?
Any help is appreciated.


texts: Magento 2 : Upgrade Existing Custom Customer Attribute

texts:
I have created custom customer attribute and use at registration process. Its working fine.

Now I want update attribute like - previously its 'required'=> false. Now I want to set it as 'required'=> true.

But don't know how to upgrade it using UpgradeData.php

Plz help to solve this.

I tried with below code -

if (version_compare($context->getVersion(), "1.0.6", "<"))
        {
            /** @var CustomerSetup $customerSetup */
            $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

            $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
            $attributeSetId = $customerEntity->getDefaultAttributeSetId();

            /** @var $attributeSet AttributeSet */
            $attributeSet = $this->attributeSetFactory->create();
            $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

            $customerSetup->updateAttribute(\Magento\Customer\Model\Customer::ENTITY, 'netz_allowed', [
                'visible_on_front' => 1,
                'input' => 'select',
                'require' => true,
                'source' => 'Magento\Config\Model\Config\Source\Yesno',
            ]);

            $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'netz_allowed')
            ->addData(['used_in_forms' => ['customer_account_create','customer_account_edit']]);

            $attribute->save();
        }

        $setup->endSetup();


texts:
I have a client how is looking for an import extension, as he has about 6 or 7 feeds a day from different suppliers with different and same products.

These he uploads into his current website, or may even be automated feeds!!

Anyway, is there a 'feed import' extension for magento? as I have found alot of export to third party selling platforms, but nothing importing product feeds from wholesalers.

Any help would be most appreciated.


texts: Add B2B Company Name in Sales Order create customer grid

texts:
I want to display B2B company name in customer grid while we create sales order from admin. For temporary changes I added my code in below class
Magento\Sales\Model\ResourceModel\Order\Customer\Collection

Please check my added code in below function
protected function _initSelect()
    {
        parent::_initSelect();
        $this->addNameToSelect()->addAttributeToSelect(
            'email'
        )->addAttributeToSelect(
            'created_at'
        )->joinAttribute(
            'billing_postcode',
            'customer_address/postcode',
            'default_billing',
            null,
            'left'
        )->joinField(
            'store_name',
            'store',
            'name',
            'store_id=store_id',
            null,
            'left'
        );
        /**Custom added code**/
        $tableName = 'company';
        $this->getSelect()->joinLeft(
                $tableName,
                $tableName . '.super_user_id = e.entity_id',
                $tableName . '.company_name'
            );

        return $this;
    }

And after adding this I am able to display Company name in grid check attached screenshot

but while I am trying to filter company name I am getting below error.

Exception #0 (Magento\Framework\Exception\LocalizedException): The
"company_name" attribute name is invalid. Reset the name and try
again.
Exception #0 (Magento\Framework\Exception\LocalizedException): The
"company_name" attribute name is invalid. Reset the name and try
again. #1
Magento\Eav\Model\Entity\Collection\AbstractCollection->_getAttributeConditionSql('company_name',
array('like' => &Zend_Db_Expr#000000002083056200000000795ea168#),
'left') called at
[vendor\magento\module-eav\Model\Entity\Collection\AbstractCollection.php:380]

Please suggest that how can I filter company name


texts: Get data directly from block in a shell script

texts:
Is there anything wrong with getting data directly from Block, and not from Model or resource? If yes, what are the threats? I mean, like this:

$block = Mage::app()->getLayout()
    ->getBlockSingleton('adminhtml/catalog_product_attribute_edit_tab_options');

$label = $block->getLabelValues();

Many thanks!!


texts: Least convoluted way of putting payment method objects in collection

texts:
So, for various reasons I really kind of need to put a bunch of different payment method objects into a collection, not an array, a collection.

Unfortunately it seems there's no such thing as a Mage_Payment_Method_Collection class to rely on.

More specifically I'm trying to put the output of Mage_Payment_Config::getActiveMethods() into a collection rather than the array that it returns because, reasons.

Now, I know of a few incredibly clunky ways I could still get the data I need into a collection of my own construction but it would also involve creating my own model class and "converting" the payment method objects into that type (carrying over the bare minimum of data required to actually do what I want to do) but that whole setup would be painfully contrived and from my point of view it just seems odd that there's no way to just say "hey Magento, give me a generic collection object that is able to hold a bunch of random objects" so I can feed this into another part of Magento that absolutely insists on taking a collection as input (more specifically a method in one of the Adminhtml block classes).


texts: Trying to understand require.js usage in Magento 2

texts:
I've been trying a few suggested way to load my own js into a custom Magento theme and have not been successful.

In requirejs-config.js in root of my custom theme directory, I have this:

  var config = {
    map: {
        "*": {
          "customBootstrap": "js/bootstrap.min",
          "customLocal":     "js/local"
        }
    },
  shim: {
      "customLocal": {
          deps: [
              "customBootstrap"
          ]
      },
      "customBootstrap": {
          deps: [
              "jquery"
          ]
      }
  },
};

The js files are in [theme]/web/js/bootstrap.min.js and [theme]/web/js/local.js

What needs to change so it loads correctly in the order of:
jquery
-> customBootstrap
-> custom Local

The local.js seems to be loading, but bootstrap.min.js is not.


texts: Magento MultiStores but only 1 site is index by Google?

texts:
There are two websites sharing in one Magento admin.
Two sites have their respective Magento Store
I added both of the sites on Google Webmaster Tools so Google can see that they are different sites.

Problem:
When I search on Google: siteB2.com, Google will display siteA1.com
I checked the cache and I am sure that Google is using the siteA1.com instead of the other.

Even if I tried search using: site:siteB2.com, still Google uses siteA1.com information.
Basically, you will see the siteB2.com uses the correct URL but the title and the description are from siteA1.com - on search results.

What setting or code do I have to do to restrict Google from accessing the other website?

I tried searching on various pages but seems there are few documentation about this issue.


texts: Wishlist not working for login customer in magento2 with caching if once i add product then wishlist icon remove by KO wishlist().counter?

texts:
How can I set my wishlist for logged on customer and log gout customer with knockout JS
if I logged on then I only add product once then wishlist icon remove because of knockout JS
how to write knockout JS for wishlist i m unable to add multiple product if I logged on with caching website

helper('Magento\Catalog\Helper\Output');
$_product = $block->getProduct();
?>

**** ko ifnot: wishlist().counter
helper('Magento\Wishlist\Helper\Data')->getAddParams($_product) ?>' title="Wishlist" class="action towishlist" data-action="add-to-wishlist">

### /ko
### ko if: wishlist().counter
helper('Magento\Wishlist\Helper\Data')->getAddParams($_product) ?>' title="Wishlist" id="hasitem-wish"  data-action="add-to-wishlist">

### /ko

{
    "*": {
        "Magento_Ui/js/core/app": {
            "components": {
                "wishlist": {
                    "component": "Magento_Wishlist/js/view/wishlist"
                }
            }
        }
    }
}


texts: Magento 2.0 - Multiple Simple Products redirecting to the same Configurable product in different Categories

texts:
I am not sure the best and cleanest way to do this, preferable from the admin panel.  However, I sell different sports products with different teams.  Right now, each team has it's own product page.  There are a couple of problems with this though.  First, I believe this can cause some duplicate product issues with SEO/PPC, because they are all very similar titles and descriptions, the only thing really changing is the team name.  Second, it makes it harder for the customer to go find the same product for a different team, so I think it affects the customer experience.

My thought is to have it so customers can still go to the subcategory with the team they are mainly shopping for, click on that, see a list of products for that team with those team pictures and then click on it and it would go to the main configurable product page, preferable with that option picked.  I realize this may be a lot to ask, so I am open.

Right now in my demo store I setup, I can have the configurable broader product in the main category for example and then have the simple team product in a sub category.  The problem is that the simple product doesn't redirect to the configurable product, so it doesn't really help me with my duplicate content issues.

Any thoughts on this? I have seen clothing stores do it for different colors, because customers may not click it unless it is the color they were looking for.  A 301 redirect from the simple product may work, but I am not sure that is really the best way to go about it especially for SEO purposes.


texts: Is there a way to export static blocks and cms pages in mass from local to online?

texts:
I have a localhost version of Magento and another which is already in Hostgator. My changes on files I can ftp quick and easily, of course. But I would like to know if there is some faster way to "upload" my static blocks and cms pages I've created in localhost instead of having to create all them again, manually (it would be a very painful task, for sure), maybe through phpmyadmin or through an awesome "free-preferred" extension.

Thank u


texts: How to set a start and end time for Product Status

texts:
Am I able to set a start and end time for product status?

I'm running an ecom store and would like to know if I can set a date & time for product to enable/disable.

For example, if I am scheduling sending an email to send out at 6am, and I would also like to schedule products to enable at the same time...


texts:
I'm setting up a copy of a client's M2 site to use as a dev environment on a different server.  I've copied all the files, set up the DB blah blah.
The frontend works as intended but the admin area has no style.  Looking at the source it looks like it's trying to load its style from a folder that doesn't exist.

/static/version1522232216/_cache/merged/503fa0dfba01298acb5220a0df5638de.min.css

The version1522232216 doesn't exist.

I've run static-content deploy, reindexed, cleared cache etc.  All permissions on the server have been double checked.

Thanks


texts: How to make the "Ship to different address" default? (the radio button) in STEP 1 of the CHECKOUT (under BILLING INFORMATION)

texts:
It seems that many of our customers are not smart enough to figure this out so we have to make the "Ship to different address" option default (checked - the radio button). This is in STEP 1 of the Checkout (1 BILLING INFORMATION)

What is the best way to do that? Thanks for any suggestions! :-*

Edited on June 1st, 2018:

I have implemented the solution below and it worked great.

Now, however, all of sudden - it reverts back to "Ship to this address" again. I went into the billing.phtml file in

/public_html/app/design/frontend/base/default/template/persistent/checkout/onepage

and the code is still the correct one (the changed one). Would anyone know why this just stopped working all of a sudden by itself? (the file was not overwritten)


texts:
Now I am upset on the Cron job of Magento 2.0.

I have just installed Magento 2.0.4 and set the cron job using xampp.

I know if the cron job is working, I can see the schedule at 'cron_scehedule'.

But I cannot any internal cron job.

At the same time I tested with same ways using magento 1.0.

It works well.

Please let me know how can I test Magento 2.0 cron job is working or not.


texts: How to translate html content in magento 2

texts: I am having some content in .html file in checkout page, I want to translate that content to french but I am unable to translate. I tried many methods but still not getting.I translate all phtml files by placing the text in echo and placed the word in csv file.


texts: Magento isn't upgradable through Magento Connect Manager

texts:
I have another store, where I can update Magento through Magento Connect. But this store is strange. There aren't the package names to upgrade Magento. Someone has a clue?

Magento Version 1.9.1.0


texts: Magento 2.1 : try to remove products images programmatically but got error

texts:
Try to Remove Products Images but got error in magento2

Error : "Product with SKU '12553' is not linked to product with SKU '12552'" in

My code is:

$get_ids = array(12551,12552,12553,12554);

foreach($get_ids as $ids){
    $product = $objectManager->get('Magento\Catalog\Model\Product')->load($ids);
    $productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface');

    $existingMediaGalleryEntries = $product->getMediaGalleryEntries();
    foreach ($existingMediaGalleryEntries as $key => $entry) {
        unset($existingMediaGalleryEntries[$key]);
    }
    $product->setMediaGalleryEntries($existingMediaGalleryEntries);
    $productRepository->save($product);
}


texts: Override sales_order_grid.xml to remove print options from mass action drop down in sales orders

texts:
Hello everyone,
I'm trying to override the file sales_order_grid.xml to remove some print options from the mass action drop down in sales orders. I'm using Magento 2.4.2.
The original file is located here:
\vendor\magento\module-sales\view\adminhtml\ui_component\sales_order_grid.xml

Where should I put the file to override it?
Do I need to to create a module?
Can I just make a copy of the file somewhere in my custom theme?

Thank you very much,


texts: How to add exist image to simple product by REST API

texts:
My case is:
I'm creating a configurable product by API <-- in this proces I'm adding a new image by:
                var newImage = new CatalogProductAttributeMediaGalleryManagementV1CreatePostBody();
                newImage.entry.label = image.FileName.RemoveAfterLast(".");
                newImage.entry.disabled = false;
                newImage.entry.media_type = "image";
                newImage.entry.position = image.Order.HasValue ? image.Order.Value : index;
                newImage.entry.types = new List<string>() { "image", "small_image", "thumbnail", "swatch_image" };
                newImage.entry.file = "/" + image.FileName[0] + "/" + image.FileName[1] + "/" + image.FileName;
                newImage.entry.content.base64_encoded_data = Convert.ToBase64String(image.FileContent, 0, image.FileContent.Length);
                newImage.entry.content.type = GetMimeType(image.FileName.RemoveBeforeFirst("."));
                newImage.entry.content.name = image.FileName;
                var newImageId = _restRepository.CreateProductImage(product.sku, newImage);

then in the different place of code I want to create a simple products with added earlier image. I have all information, but without base64. While I'm adding a image by:
        var productImage = new REST.JsonObject.Request.CatalogProductRepositoryV1SavePostBody.MediaGalleryEntries();
        productImage.id = image.id;
                productImage.media_type = image.media_type;
                productImage.label = image.label;
                productImage.disabled = image.disabled;
                productImage.position = image.position;
                productImage.types = image.types;
                productImage.file = image.file;
                productImage.content = new REST.JsonObject.Request.CatalogProductRepositoryV1SavePostBody.Content();
                productImage.content.type = GetMimeType(image.file.RemoveBeforeLast("/").RemoveBeforeFirst("."));
                productImage.content.name = image.file.RemoveBeforeLast("/");
                product.media_gallery_entries.Add(productImage);

I receive
{"message":"The image content must be valid base64 encoded data."}
How to add EXIST image in magento to product without sending image file every time.
Magento ver. 2.3.3


texts: Coupon Codes not working on Hotmail and Live accounts

texts:
My coupon codes doesn't work when a customer is logged in, and have a hotmail.com or live.com account.
Anyone any idea or solution?
edit:
I've checked the settings, expire date, prioritys and conditions. And the are correct.
It's not just one coupon code, all (the most) off the coupon codes doesn't work.


texts:
I have customers from an other shop system I need to import into Magento. Those customers come as SQL table.

I found this old question. Where clockworkgeek advices to import the user using Mage function:

$newCustomer = Mage::getModel('customer/customer');
$newCustomer->setFirstname('Foo')
            ->setLastname('Bar')
            ... // Set all the various details here
            ->save();

Since this is from 2010 I wonder: Is this still a legit way?

In other projects I have worked with AvS_FastSimpleImport. Would that be the preferred
method?


texts: Magento 2 - Search title/product name only

texts:
Magento 2.1.2

We disabled the default Search value (YES/NO) of "Description" and "Short Description" to "NO", we will search only in the "Product Name" - but if the Search Keyword is "live" it does not find any products, if you use the keyword "livevest" it does return products.

How can I see the results for following example?

Product Name: "Red Livevest Model 2017"

Keyword: "vest"
OR
Keyword: "Live"

Thanks for any help.


texts: Added addditional fee to sample product(price 0) not shows payment method magento 1.9.2.4

texts: I have some sample products which are free but have some additional fee applied to total cart. If I order the sample product alone, it does not show any payment method so I can't able to choose payment method. How to show payment methods if the cart contains sample products alone with additional fee applied.


texts: How to expand both sides to fit browser window?

texts:
 width:100%; background:grey;

 width:940px; background: grey;

 width:940px; background: white;

is there any option in css to expand the both sides?
The "content" should be in center as width:940px and then I need to expand both sides to fit browser window.

Example:

if it is a 1440 screen then "content" = 940px and left & right side should be expand to 250px.

if it is a 1640 screen then "content" = 940px and left & right side should be expand to 350px.


texts:
The goal is that we want to be able to change the url under some conditions for all product URLs.  It seems that the solution would be to add a function to our module Observer.php.  I can't quite get it to run.  The original function is

public function getProductUrl($product, $additional = array())
{
    if ($this->hasProductUrl($product)) {
        if (!isset($additional['_escape'])) {
            $additional['_escape'] = true;
        }
        return $product->getUrlModel()->getUrl($product, $additional);
    }

    return '#';
}

What I tried to do is just put in our Observer.php

/**
 * Set the url to be based from it's store not based on the location it's currently showen
 *
 * @return String url
 */
public function getProductUrl($product, $additional = array()) {

    if ($this->hasProductUrl($product)) {
        $pstore_id = array_shift(array_values($_product->getStoreIds()));
        if(Mage::app()->getStore()->getStoreId() == $pstore_id){
            $purl = $product->getUrlModel()->getUrl($product, $additional);//$this->getProductUrl();
        }else{
            $base = Mage::app()->getStore($pstore_id)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
            $purl = $base.$product->getUrlPath();
        }
        if (!isset($additional['_escape'])) {
            $additional['_escape'] = true;
        }
        return $purl;
    }
    return '#';
}

But I'm not seeing any change as of yet.  What am I missing here.  Thank you.
Cheers -Jeremy


texts: Sidebar next to CMS block on category page

texts:
I'm somewhat new to Magento 2 but most of it is going just fine. There is a minor issue I'm experiencing and I can't seem to figure out how I can fix this.

I've added a CMS block to a category containing information about that category.
Then I've added a sidebar content trough Layout Update XML.

All this works fine, but the one problem is that the the sidebar pops under the content of the page. And I just want it to stick to the right like a sidebar should.

I'm probably missing something in the Layout Update XML for this not happening.

Any thoughts on how I would be able to fix this?


texts: magento 2 update Total Paid after payment manually

texts:
how can I update the total paid amount Magento 2 sales order? invoice is already generated  and
  generate the credit memo button.

I want to like total due to converting to total paid


texts:
I would like to remove the tool bar from my theme since I don't have that many products.

So far I have tried this in my /app/design/frontend/VENDORNAME/THEME/Magento_Theme/layout/default.xml

    <referenceBlock name="product_list_toolbar" remove="true"/>

Also I tried to replace /app/design/frontend/VENDORNAME/THEME/Magento_Theme/templates/html/pager.html with a empty file.


texts:
I have issue with missing some products on frontend.
I noticed that reindexig catalog_product_category is fixing this issue.
In observer triggered after import I just add reindexing script:

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $productId = $observer->getEvent()->getId();
    $this->getIndexer(\Magento\Catalog\Model\Indexer\Product\Category::INDEXER_ID)->reindexRow($productId);
    return $this;
}

/**
 * @param string $indexerId
 * @return \Magento\Framework\Indexer\IndexerInterface
 */
protected function getIndexer($indexerId)
{
    return $this->indexerFactory->create()->load($indexerId);
}

Importing script changes products one by one.
Unfortunately this doesn't works fine. However if I do:

 public function execute(\Magento\Framework\Event\Observer $observer)
{
    $this->getIndexer(\Magento\Catalog\Model\Indexer\Product\Category::INDEXER_ID)->reindexAll();
    return $this;
}

it will reindex all catalog_product_category for every imported product.
Is it possible to reindex one product?
Generally first script should works fine, but it doesn't - all imported products are missing.


texts: Get Product List with more details in Magento2 API

texts:
I am working on a native application and need to get the a list of products based on category.

Like when a user clicks on a category I have to show a list of products inside that category.

I tried an API but it's only giving three fields in return:

http://localhost/magento/index.php/rest/V1/categories/21/products

Response

[
    {
        "sku": "WH01",
        "position": 10001,
        "category_id": "21"
    },
    {
        "sku": "WH02",
        "position": 10001,
        "category_id": "21"
    },
    {
        "sku": "WH03",
        "position": 10001,
        "category_id": "21"
    },
    {
        "sku": "WH04",
        "position": 10001,
        "category_id": "21"
    }
]

I need more information like name, image, price and more.


texts: Newsletter signup not showing on one page checkout

texts:
We are using the one page checkout on a customer site, but it's not showing the "click here to subscribe to newsletter" checkbox, which is a standard option in Magento themes.

Does anybody know how to enable that?


texts: Magento 2.2.6 How to UPDATE attribute (Mass Action), don't REPLACE attribute that already exist?

texts:
All it is in the title of the topic.

I want to update product that already exist with different attributes.

it's impossible to me to add a bulk operation because when I use the product update of magento2 it replace the attribute that already exist...

For example:

Product 1: Attribute A
Product 2: Attribute B

I want simply add attribute C to product 1 and 2 like this :

Product 1: Attribute A,C
Product 2: Attribute B,C

When I use Update product of Magento when I only check Attribute C, the result is:

Product 1: Attribute C
Product 2: Attribute C

Is it possible to UPDATE and don't replace the attributes ?

I hope I was clear !


texts: How to display Magento cart button on blank page?

texts:
Magento has a default bar that has two buttons: Account and Cart. I would like to display this bar on my homepage which has a blank layout but I can't figure out how to do this. I came across this code snippet:

Mage::getUrl('checkout/cart')

I am unsure of whether this is the code I need, or if there is a better way to do it. I'm new to Magento and not yet comfortable with using it. Should I be trying to do this from Magento CMS or somewhere in the backend?

Any help would be greatly appreciated. Been stuck on this for a while.


texts: How do I retrieve an ajax friendly phtml file?

texts:
I have created a custom front end module that allows a user to go through a wizard like process. I would like to make this AJAX.

I am loading my layout block with the following

<batch_index_index>
    <reference name="content">
        <block type="batch/batch" name="batch" template="batch/batch.phtml"/>
    </reference>
</batch_index_index>

However the default template is being returned with that phtml file, how do I get magento to return just the contents of the phtml file?


texts: Magento 2 getting error: ( ! ) Parse error: syntax error, unexpected 'T_PAAMAYIM_NEKUDOTAYIM' (T_STRING), expecting ')'

texts:
While installing custom module at server i'm getting this error at frontend. My php version at server is 5.6. But same module at my localhost with php 7.0 version is working fine. I'm not able to understand this why this error showing. The error line code is below:

array(
    $this->_productVisibility::VISIBILITY_BOTH,
    $this->_productVisibility::VISIBILITY_IN_CATALOG
);

Any single help would be appreciated. Thanks in advance.


texts: Magento 2 - Category Listing in Left Column

texts:
I need to list out categories and child categories in the left nav of the category page and I'm trying to use this extension:

https://github.com/Sebwite/magento2-category-sidebar

As of now all that it is doing is showing the to root category and not pulling in any of the child categories:

Is there another solution to this?  Or does someone have experience with this particular extension and would know what is going on?


texts: Magento 2: Load Payment Method while Checkout using Event Observer

texts:
I have referred all  Event's list

https://cyrillschumacher.com/magento2-list-of-all-dispatched-events/

https://www.mageplaza.com/magento-2-module-development/magento-2-events.html

I have below issue

Magento 2: How to show/hide payment method on basis of amount

Can i manage through Event Observer? If Yes then what will be name? I'm not able to find on above links

<event name="controller_action_predispatch_XXXX_XXX_index">
        <observer name="check_checkout_page" instance="Custom\Module\Observer\MyObserver" />
</event>

When user on http://localhost/magento2/checkout/ before it loads payment method i would like to call my observer.


texts: Block Content set to "no-display" on smaller screens

texts:
I have been working on a site and noticed that some blocks disappear when I resize the screen. A closer look at the code shows that at a certain size, the class "no-display" has been added to the div, making the css set the display to none.

Any idea where this is coming from?

Here is my site:

http://greenlivingaustralia.com.au/shop

I am using the rwd theme with a few minor tweaks, including the Codnitive Sidebar Navigation Menu Professional extension to move my menu from the top to the left sidebar.

The sidebar menu was disappearing altogether when the screen size was below 770px. I have removed the style definition for "no-display" for now but that is not a permanent fix.


texts: Magento 2: customer account edit verification mail

texts:
I want to send verification link to customer when he changes his account email from customer dashboard edit account, is there inbuilt feature for same, please help me on way for this.
I want once user approve email verification link only his email id showing be updated.


texts:
How can I determine if I should go with LAMP or LEMP (Apache or Nginx)? Considering Magento's software requirements list both.

Should I prefer SSD storage or more RAM?


texts: Magento2 admin edit form prepare form registry error

texts:
I have created Magento2 admin edit form but on my edit form I got the error as below:

  Fatal error: Uncaught Error: Call to a member function getId() on null in /app/code/Custom/Module/Block/Adminhtml/Product/Edit/Tab/Main.php:110

code is $formObject->getId() Is there something missing?

In my Main.php which is reside on "app/code/Custom/Module/Block/Adminhtml/Product/Edit/Tab/Main.php"

my function is as below:

protected function _prepareForm()
{
    $formObject = $this->_coreRegistry->registry('thoscene_product');
    $isElementDisabled = false;

    $form = $this->_formFactory->create();
    $form->setHtmlIdPrefix('product_');
    $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Product Information')]);

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

    $fieldset->addField(
        'name',
        'text',
        [
            'name' => 'name',
            'label' => __('Name'),
            'title' => __('Name'),
            'required' => true,
            'disabled' => $isElementDisabled
        ]
    );

    $fieldset->addField(
        'sku',
        'text',
        [
            'name' => 'sku',
            'label' => __('Sku'),
            'title' => __('Sku'),
            'disabled' => $isElementDisabled
        ]
    );

    $form->setValues($formObject->getData());
    $this->setForm($form);

    return parent::_prepareForm();
    }

Thanks in advance!...


texts: Get param : Controller of custom product interface

texts:
I've created a page where I have a list of products. In each row (1 row = 1 product), I have a button "add to cart" :

<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="POST" id="form-<?php echo $numArticle; ?>">
    <input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
    <input type="hidden" name="qty" value="<?php  /* @escapeNotVerified */ echo $derniereQuantite; ?>" class="qty">
    <?php echo $block->getBlockHtml('formkey')?>
    <?php $storeManager = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Store\Model\StoreManagerInterface'); ?>
    <button type="submit" title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>" class="action tocart primary cadencier">
        <?php /* @escapeNotVerified */ echo __('Add to Cart') ?>
    </button>
</form>

The product is indeed added to the cart. But I need to get a data (like the sku of the product). So I did :

if('POST' == $this->getRequest()->getMethod()){
    $post = $this->getRequest()->getParams();
    ...

But the POST is empty, even if the form is a POST form. Then I tried with GET.

if('GET' == $this->getRequest()->getMethod()){

An empty array, but this is giving me a white page (I'm already on debug mode), but the condition is always true (I believe that's because what's next).

Then I tried to print $_REQUEST... And I have a result. I have a success message saying that my product is indeed added to the cart. It's like there was an intermediary step between the post and the data send to the controller. So how can I get data from this intermediary step to the controller, and than passed is to the block phtml?

EDIT : or, if it's possible, remove/improuve this form by using ajax, it would be even better.


texts: Magento 2 : Admin Create Order and Custom Option Type

texts:
I have created new product custom option type and everything is working well except when creating an order from admin. When product has native product options such as file, configure link permit to define product options. But when it has my custom option type, configure link does not work.

I may have forgotten a declaration somewhere, but do not manage to find where.

Thank you for your help,


texts:
There are a number of ways to flush Magento cache, with slight differences. I have always been a bit confused about these and often end up overdoing it when deleting the cache. This my understanding of it as it is but maybe someone could correct this and answer my questions. I am hoping this question could be a source covering all aspects of cache ... I haven't found another question here which answers all questions in one.

Selecting individual lines using checkboxes and selecting refresh
Surgically deleting a particular area of cache.

Pressing "Flush Magento Cache"
Same as selecting and refreshing ALL from above
(BTW anyone know why this operation is referred to as flush and the previous as refresh?)

Flush Cache Storage
Same as last option but also includes some cache which may be shared 'by other applications'
What applications for instance?

Flush Catalog Images Cache and Flush Javascript/CSS Cache
As the name suggests ...
Is this included in either of the last 2 options?
BTW I think it must be important to also flush browser cache if using this. Correct?

Deleting contents of /var/cache and /var/sessions
The nuclear option ? ... Does this delete absolute everything including javascript/css and catalog images cache; or what is not covered by this?
Is there any other folders which should be included when doing a manual delete. I seem to remember hearing about another folder but I can't remember which one.

If anyone else has any other questions they might want to edit this and add the questions.


texts: Filter Shipping Methods Based on chosen region/city from address book

texts: is there any way to filter shipping methods based on customer chosen region/city from address book in checkout process? for example: there are two shipping methods (A & B). "A" is available for all cities and "B" is available for just one city. can it be done programmatically or other ways?


texts: Is this possible to add Sort By Toolbar in Layer Navigation?

texts:
I want to create new filter like Sort By in Sidebar Layer Navigation which currently display on the product listing page above the products grid.

Want to add like below image:

Is it possible in Magento 2?


texts: Magento 2.3.3 after upgrade address not rendering

texts:
i just upgrade Magento store to latest version after upgrade every where address formatting printing instead of address

anyone have idea how to debug same...?


texts:
My problem is as follows:

I have one Magento community site, hosted on a virtual machine. I have two environments: PROD and DEV.

1,400 + products have been deleted from my PROD store.

My question is - are there activity logs that provide information (i.e. IP address of computer) that have actioned events from the Administration login?

I appreciate that there are some modules available that provide this information, but only going forward, not retrospectively.

Any help would be very much appreciated.


texts:
I am trying to create a Payment Method in Magento for Internal Use. Basically it is to track inventory for company expenses for products removed from the inventory internally.

Can a checkout payment method be null or skipped so I can create an order on the frontend without requiring payment? Or should I just use the "Other" payment method without authorization?


texts: system.log main.CRITICAL( imagepng) Permission denied in/public_html/vendor/zendframework/zend-captcha/src/Image.php on line 588 []

texts:
this is from system.log. where should i look into to fix this problem?

  [2019-05-19 08:57:03] main.CRITICAL: Warning: imagepng(/home/user123/public_html/pub/media/captcha/base/6ee2xxxxxxxxxxxxxxxxxxxxxxxxxxx.png): failed to open stream: Permission denied in /home/user123/public_html/vendor/zendframework/zend-captcha/src/Image.php on line 588 [] []
    [2019-05-19 08:57:04] main.CRITICAL: Warning: imagepng(/home/user123/public_html/pub/media/captcha/base/e079xxxxxxxxxxxxxxxxxxxxxxxxxxx.png): failed to open stream: Permission denied in /home/user123/public_html/vendor/zendframework/zend-captcha/src/Image.php on line 588 [] []
    [2019-05-19 08:57:20] main.CRITICAL: Warning: imagepng(/home/user123/public_html/pub/media/captcha/base/ae84xxxxxxxxxxxxxxxxxxxxxxxxxxx.png): failed to open stream: Permission denied in /home/user123/public_html/vendor/zendframework/zend-captcha/src/Image.php on line 588 [] []
    [2019-05-19 08:57:21] main.CRITICAL: Warning: image


texts:
I got a strange problem in my multiwebsite store. When a random user do login at frontend, the page keeps continuously and user doesn't get my account page and in after few minutes it shows memory limit exhausted error. Memory limit is already very high there 20000M.

after this problem, no other pages of website works as well and keep loading.

But Now as I clear site cookie and data from browser, it works fine for all other pages for site but as I try again to login with same username and password as I used before, it creates same problem.

So may be it is a cookie or session related issue since after clearing it site works fine.
But I don't know how to resolve it and where to amend it in site files.

if anyone has any idea please suggest me the possible ways to resolve it or ask me for any details.

Thanks