texts: What happens when you run Magento on an empty database?

texts:
If you drop all the tables in your Magento database, and navigate to your Magento site, what happens next?

The reason I ask is I assume that Magento would just check the local.xml settings, and rebuild the database with default/blank values.

The problem is I have an extension that uses the Composer autoloader for some of it's classes and therefore doesn't follow the Magento class naming convention. There are observers for that extension that bootstrap the composer autoloader but it seems like those observers aren't ran in the scenario of a Magento site having no tables yet.

Hope that makes sense, any help would be appreciated.


texts:
I have created under app/code/vendor/theme/view/frontend/layout/defaul.xml an file called default.xml and i have following content in it:

<?xml version="1.0"?>
<page xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <head>
        <!-- Add js using link tag-->
        <script src="js/main.js"/>
   </head>
<referenceContainer name="content">
    <block class="Steiner\Josef\Block\Mage" template="Steiner_Josef::contact_right.phtml"></block>
</referenceContainer>
</page>

It shows me the PHTML file correctly but the js/main.js it cant be found.
I put the js file under app/code/vendor/theme/web/js/main.js and I have the following content:

    define(["jquery"], function($) {
    "use strict";

    // Here your custom code...
    console.log("Hola");
  });

after clearing cache, flush, etc. nothing seems to work what I am doing wrong?


texts: Shopping cart "loop" issue after upgrading to 1.9.3.6

texts:
I just upgraded from Magento 1.9.3.2 to 1.9.3.6 with the connect manager, now there is an issue with the Shopping cart.
After entering the customer address and clicking the "Next" button, it redirects back to the shopping cart view. So it's impossible to complete an order.

Also, "system.log" and "exception.log" show nothing particular beside a small PHP notice.

Is there a way to fix/debug this ?

EDIT: "formkey" field is not missing


texts:
I have a client running Magento 1.7.0.2 and I have a question about the order display on the backend.

Some of the orders that have had discounts applied to them are showing the relevant discount code, and others aren't.

My question is: what would cause Magento to not display the coupon code next to the discount? Does this mean the coupon's been deleted?

I'ave attached a screenshot of the order rows and total boxes.


texts: Change "Edit Address" Template Layout with local.xml

texts:
I want to change the Edit Address Template Layout with local.xml.

/customer/address/new/
/customer/address/edit/

Here is my relevant part in local.xml:

<customer_address_edit translate="label">
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
</customer_address_edit>
<customer_address_new translate="label">
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
</customer_address_new>

What have I done wrong?


texts: Magento 2 : Custom dropdown for city and state not loading in IE

texts:
I created custom city and state dropdown all working fine but in the IE it is not loading.

Can anyone please help.?


texts: Magento 1.xx can easily make a coupon for specific SKU, why the SKU disappear on Magento 2.xx


texts: varnish not working after applied turpentine settings

texts:
I am running CE1.7 and have a nginx cluster(x3 nginx) running behind a dedicated varnish server.
After the initial varnish installation, I can see the varnish info in the header which means its running fine.
And then I cleared magento cache and enabled turpertine cache in the admin panel, and put in the right IPs for varnish and backend server(using a separate load balance IP) settings and clicked "save", it applied successfully and saved;however, the varnish doesn't seem to be working normally, as I can cannot find any varnish names in the header anymore.

Attached are my turpentine setting screenshots.

Thanks very much for the help.

these are the other settings I used. looks like varnish is bypassed everytime.


texts:
i want to redirect all my customers after login or registration to Dashboard if their cart is empty and to Checkout if they have products in cart. I use extension to do this redirection after login but is work only if is a product in cart. How I can sort this? This is my code:

   if (Mage::helper('customerredirect')->isEnabled() && !Mage::getSingleton("core/session")->getRedirectregister()){
       $lasturl = Mage::getSingleton('core/session')->getLastUrl();
     if (strpos(Mage::helper('core/http')->getHttpReferer(), 'checkout') === false){
         if (! preg_match("#customer/account/create#", $lasturl) && Mage::helper('customerredirect')->isoptionEnabled('login_customerredirect')) {
                  if($this->_CustomerGroup()) {
                   $_session = $this->_getSession();
                   $_session->setBeforeAuthUrl(Mage::helper('customerredirect')->setRedirectOnLogin());
                 }
        }
    }


texts: My javascript doesn't run in a custom magento1.9 module

texts:
I try to use javascript for a dropdown list I've implemented into a grid as shown in the image.

The renderer I use for this dropdown list is like

<?php

class Ns_Thorleif_Block_Adminhtml_Commerciaux_Edit_Form_Renderer_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    public function render(Varien_Object $row)
    {
        $category = Mage::getModel('thorleif/category')->getCollection();
        $category_rows = $category->getData();

        $html = '<select id="select_category" name="select_category">';
        $sep = '';
        foreach ($category_rows as $rows) {
            // put the correct key here
            if (!$rows['level']) {
                $html .= $sep . "<optgroup label='{$rows['name']}'>";
                $sep = '</optgroup>';
            } else {
                $nbsp = str_repeat('&nbsp;', ($rows['level'] - 1)* 5);
                $html .= "<option value='{$rows['id_linio_category']}' title='{$rows['name']}'>
                $nbsp {$rows['name']}</option>";
            }
        }
        $html .= '</select>';

        return $html;
    }
}
?>
<script src="https://code.jquery.com/jquery-1.12.3.js"></script>
<script>
    var data = $( "#select_category option:selected" ).text();
    console.log(data);
</script>

and the Grid code is

<?php
...
$this->addColumn('linio',
    array(
        'header' => 'Linio Category',
        'align' => 'left',
        'index' => 'linio',
        'filter'    => false,
        'sortable'  => false,
        'renderer' => 'Ns_Thorleif_Block_Adminhtml_Commerciaux_Edit_Form_Renderer_Category'
    )
);

$this->addColumn('action',
    array(
        'header'    =>  Mage::helper('customer')->__('Action'),
        'width'     => '100',
        'type'      => 'action',
        'getter'    => 'getId',
        'actions'   => array(
            array(
                'caption'   => Mage::helper('customer')->__('Sync'),
                'url'       => array('base'=> '*/*/sync'),
                'field'     => 'id',
                'target'=>'_blank'
            )
        ),
        'filter'    => false,
        'sortable'  => false,
        'index'     => 'stores',
        'is_system' => true,
    )
);

return parent::_prepareColumns();

So I try to get the value/text of the dropdown selected value, but I cannot do this maybe the way to do it is different that the other CMS.
My Layout

<?xml version="1.0"?>
<layout version="0.1.0">
    <routeuradmin_adminhtml_index_index>
        <reference name="content">
            <block type="thorleif/adminhtml_commerciaux" name="blocktest" />
        </reference>
        <reference name="head">
            <action method="addLinkRel"><rel>text/javascript</rel><href>https://code.jquery.com/jquery-1.12.3.js</href></action>
        </reference>
    </routeuradmin_adminhtml_index_index>
</layout>

Any Idea or suggestion to implement or get those values please?


texts:
Due to problems encountered and/or bugs, I have already learned that things like 'dotmailer' and 'facebook store' which appear to be built into the v2.2.2 magento CE we installed aren't necessary if you don't plan to use them.  I'm wondering if there are any other modules in that list that might be disabled if not used? (such as the amazon modules, tax modules - we use taxjar, specific shipping modules - we're using Magento_shipping now with temando, etc.)
I'm just wondering if there are any that can be turned off without 'breaking' magento as a whole.


texts: How to call static block in knockout template file?

texts:
I am Using Magento 2.1.

Want to show some custom shipping message for shipping method on checkout page, I have done it by editing directly to the knockout template file.

  Magento_Checkout/web/template/shipping.html

but I want this setting on backend. So, is is possible to call a static block in knockout template file, if yes, how can I do it.

I want the contant in red box to come form static block.


texts: How to get details of single products of a grouped product in observer

texts:
I wrote

    public function catalogProductTypePrepare($observer)
     {
    $quote = Mage::getSingleton('checkout/session')->getQuote();
    $product = $observer->getEvent()->getProduct();
    $productid = $product->getId();
    $buyRequest = $observer->getEvent()->getBuyRequest();
    $productqtty = $buyRequest->getQty();

it returns the last product of the grouped product I want to get each one of the single product of the grouped product


texts: Can anyone explain how wishlist mage-cache-storage data update on every add product on wishlist in magento2?

texts:
I want to refresh wishlist mage-cache-storage data (for remove product from wishlist on product detail page)same like does on add product on wishlist.

Has anyone know how data refresh of mage-cache-storage of wishlist?

Can you please explain.


texts: Magento 2 not spawning consumer processes i DB (RabbitMQ)

texts:
I have setup Magento 2.4 with RabbitMQ. You can see my configuration here.
'queue' => [
    'amqp' => [
        'host' => 'rabbitmq.host',
        'port' => '53003',
        'user' => 'username',
        'password' => 'password',
        'virtualhost' => '/'
    ],
    'consumers_wait_for_messages' => 1
],
'cron_consumers_runner' => [
    'cron_run' => true,
    'max_messages' => 20000,
    'consumers' => [
        'async.operations.all',
        'product_action_attribute.update',
        'product_action_attribute.website.update',
        'inventory.source.items.cleanup',
        'inventory.mass.update',
        'inventory.reservations.cleanup',
        'inventory.reservations.update',
        'inventory.reservations.updateSalabilityStatus',
        'inventory.indexer.sourceItem',
        'inventory.indexer.stock'
    ]
],

Magento 2 cron is running. You can see log here.
main.INFO: Cron Job consumers_runner is run [] []
main.INFO: Cron Job consumers_runner is successfully finished. Statistics: {"sum":0.0011739730834961,"count":1,"realmem":0,"emalloc":2960,"realmem_start":176685056,"emalloc_start":162316640} [] []

Any bulk actions that are added into table magneto_bulk are never executed. All product bulks updated stays pending.
All entries in queue_message_status stays with status code 2 (pending)
This is my consumer list.
$ bin/magento queue:consumers:list
product_action_attribute.update
product_action_attribute.website.update
exportProcessor
inventory.source.items.cleanup
inventory.mass.update
inventory.reservations.cleanup
inventory.reservations.update
media.storage.catalog.image.resize
codegeneratorProcessor
inventory.reservations.updateSalabilityStatus
inventory.indexer.sourceItem
inventory.indexer.stock
media.content.synchronization
media.gallery.synchronization
async.operations.all

Nothing happens when i try and run manuel with $ bin/magento queue:consumers:start product_action_attribute.update
I see no errors in logs.
If i use default MySQL message queues, i am supposed to see some idle procceses in DB, correct? I do not see any processes at all.
Where should i start to debug this issue?
halp!


texts: How to add new attributes to existing simple products?

texts:
I added some products as simple products. Later on i created certain attributes. Is there anyway to make these attributes applicable to the products i added before creating the attributes. I checked out certain links and found ways to do it for configurable products but nothing about simple products.

Any help will be appreciated.
Thanks.


texts: How Can i directly redirect products landing page from sales order page

texts: I need to directly redirect products landing  page from order page,


texts:
I updated magento table rates using CSV,

but in checkout it applies old rates.

because the site is live i cannot flush the cache.

Anyone know magento cached those rates or not


texts: Magento 2 product is "in stock" and saleable qty is zero 'add to cart' still showing in category page

texts:
Using Magento 2.3.5-p1 version
Product stock status is "in stock" and saleable qty is zero 'add to cart' still showing in category page
but the "add to cart" button not showing in the product details page which is perfect.
How to remove the "add to cart" button from the category listing page?


texts:
I installed magento 1.7 and test for rest api according to this link.
http://www.aschroder.com/2012/04/introduction-to-the-magento-rest-apis-with-oauth-in-version-1-7/

When I request to this

http://demo.io/oauth/authorize?oauth_token=mbmuatb1a9704p94pfpqy48i2uv8s2vg
It redirect to home page and return nothing.

If anyone know, help me plz. Thanks for your time.


texts: In which file/class, Magento checks if the coupon code is already used by the logged in customer or not?


texts:
I'm trying to override the round method in \vendor\magento\module-directory\Model\PriceCurrency.php. This is the method:
/**
 * @inheritdoc
 */
public function round($price)
{
    return round($price, 2);
}

And this is the code I have in a plugin to override the above method:
class PriceCurrency
{
    public function aroundRound(\Magento\Directory\Model\PriceCurrency $subject, callable $proceed, $price) {
        return round($price, 4);
    }
}

My code doesn't work. I can easily override other public methods in the PriceCurrency file! Can that method be overridden?


texts: Why is my csv file not importing successfully in the Dataflow Profile even when it was verified as valid in Check Data?

texts:
Hi I am trying to create simple products and a configurable product, then associate those simple products to the configurable product using one csv file. I went to System > Import/Export > Import and Check Data of this file. I got this result:

Checked rows: 9, checked entities: 4, invalid rows: 0, total errors: 0
File is valid! To start import process press "Import" button

I went ahead and import the file and it was successful but the products are not showing in my catalog. I then tried importing in Dataflow-Profiles but when imported, I got several errors saying:

Skipping import row, required field "sku" is not defined.

Can anyone help me figure out why that error keeps on appearing? How can I import successfully? Please click here to download the file that I am trying to import. Please help. Thank you!


texts: How do I reindex catalogue on Magento 2? 'reindex' dropdown not available

texts:
New products are not appearing on the live page. I understand I have to reindex the catalogue and clear cache for them to appear.

  Selecting: system > Index Management

When setting all to 'update on save' the boxes are red and do not have a current date/time.

When setting all to 'update by schedule' the boxes are green and do have today's date/time but this does not make a difference to the live site - I'm not sure of the difference between these two options.


texts: Prevent products to be shipped to certain countries

texts: Is there a way, in Magento 1.9.1 CE default, to prevent certain products to be shipped to certain countries? Or should I use some custom extensions?


texts: Magento 2 trying to add column in installschema.php magento 2.3.5 p1

texts:
I am trying to make the length higher than 255

<?php

namespace []\[]\Setup;

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

class InstallSchema implements InstallSchemaInterface
{
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();

        if (version_compare($context->getVersion(), '0.0.1') < 0) {

            $tableName = $installer->getTable('review_comment');
            if ($installer->getConnection()->isTableExists($tableName) != true) {

                $table = $installer->getConnection()
                    ->newTable($tableName)
                    ->addColumn(
                        'id',
                        Table::TYPE_INTEGER,
                        null,
                        array(
                            'identity' => true,
                            'nullable' => false,
                            'primary' => true,
                        ),
                        'ID'
                    )

                    ->addColumn('comment', Table::TYPE_TEXT, '2M', [], 'Comment') //NOW this fixed don't know how

                    ->addColumn(
                        'enable',
                        Table::TYPE_INTEGER, null,
                        array(
                            'nullable' => false,
                        ),
                        'Enable'
                    )
                    ->addColumn(
                        'creator',
                        Table::TYPE_TEXT, 255,
                        array(
                            'nullable' => false,
                        ),
                        'Creator'
                    )
                    ->addColumn(
                        'created_at',
                        Table::TYPE_TIMESTAMP,
                        null,
                        ['nullable' => true],
                        'Created At'
                    )
                    ->addColumn(
                        'updated_at',
                        Table::TYPE_TIMESTAMP,
                        null,
                        ['nullable' => true],
                        'Updated At'
                    )
                    ->setComment('Custom');

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

but I get the following error ->
Syntax error or access violation: 1170 BLOB/TEXT column 'comment' used in key specification without a key length

But this didn't work

->addColumn(
    'comment',
    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    '2M',
    ['nullable' => false],
    'Comment'
)


texts: Unable to install magento 1.4 on xammp with PHP Version 5.6.34?

texts:
On installing magento 1.4 on localhost i am getting an error as shown below

and there is back end message generate for this #406715812 error :

a:5:{i:0;s:160:"Deprecated functionality: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated  in C:\xampp\htdocs\shop\lib\Zend\Validate\Hostname.php on line 438";i:1;s:1575:"#0 [internal function]: mageCoreErrorHandler(8192, 'iconv_set_encod...', 'C:\\xampp\\htdocs...', 438, Array)
#1 C:\xampp\htdocs\shop\lib\Zend\Validate\Hostname.php(438): iconv_set_encoding('internal_encodi...', 'UTF-8')
#2 C:\xampp\htdocs\shop\lib\Zend\Validate\EmailAddress.php(201): Zend_Validate_Hostname->isValid('gmail.com')
#3 C:\xampp\htdocs\shop\lib\Zend\Validate.php(212): Zend_Validate_EmailAddress->isValid('anilthakur.matr...')
#4 C:\xampp\htdocs\shop\app\code\core\Mage\Admin\Model\User.php(392): Zend_Validate::is('anilthakur.matr...', 'EmailAddress')
#5 C:\xampp\htdocs\shop\app\code\core\Mage\Install\Model\Installer.php(220): Mage_Admin_Model_User->validate()
#6 C:\xampp\htdocs\shop\app\code\core\Mage\Install\controllers\WizardController.php(390): Mage_Install_Model_Installer->validateAndPrepareAdministrator(Array)
#7 C:\xampp\htdocs\shop\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Install_WizardController->administratorPostAction()
#8 C:\xampp\htdocs\shop\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('administratorPo...')
#9 C:\xampp\htdocs\shop\app\code\core\Mage\Core\Controller\Varien\Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 C:\xampp\htdocs\shop\app\code\core\Mage\Core\Model\App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#11 C:\xampp\htdocs\shop\app\Mage.php(596): Mage_Core_Model_App->run(Array)
#12 C:\xampp\htdocs\shop\index.php(78): Mage::run('', 'store')
#13 {main}";s:3:"url";s:49:"/shop/index.php/install/wizard/administratorPost/";s:11:"script_name";s:15:"/shop/index.php";s:4:"skin";s:7:"default";}

Please help to install Magento 1.4 on xammp server with PHP Version 5.6.34


texts: Is there a way to apply one css file to all transactional emails?

texts: The question is quite self explanatory. I'm wondering if there is any way to apply a single CSS file to all emails? Magento is dependent on so many emails it's really daunting to imagine having to manually edit each one.


texts: Magento 2.1.0 How to create customer module registration with name,email,pwd field only?

texts:
I need create a account page with Name,password,email field only.

Please guide me that how to create that with custom module.


texts: How to create order programmatically with downloadable products

texts:
I am trying to make an order programmatically with downloadable products. I don't care about payment, the only thing I do care is that the products will be available without admin has to do anything with those orders.

    require_once 'app/Mage.php';

    Mage::app();

    $id=7; // get Customer Id
    $customer = Mage::getModel('customer/customer')->load($id);

    $storeId = $customer->getStoreId();

$quote = Mage::getModel('sales/quote')
    ->setStoreId($storeId);

$quote->assignCustomer($customer);

// add product(s)
$product = Mage::getModel('catalog/product')->load(186);
$buyInfo = array(
    'qty' => 1,
    'price'=>0
    // custom option id => value id
    // or
    // configurable attribute id => value id
);
$params = array();
$links = Mage::getModel('downloadable/product_type')->getLinks( $product );
$linkId = 0;
foreach ($links as $link) {
    $linkId = $link->getId();
}

//$params['product'] = $product;
$params['qty'] = 1;
$params['links'] = array($linkId);
$request = new Varien_Object();
$request->setData($params);
//$quoteObj->addProduct($productObj , $request);

/* [adamw] Bundled product options would look like this:

$buyInfo = array(
    "qty" => 1,
    "bundle_option" = array(
        "123" => array(456), //optionid => array( selectionid )
        "124" => array(235)
    )
);

*/
//$class_name = get_class($quote);

//Zend_Debug::dump($class_name);

$quote->addProduct($product, $request);

$addressData = array(
    'firstname' => 'Vagelis',
    'lastname' => 'Bakas',
    'street' => 'Sample Street 10',
    'city' => 'Somewhere',
    'postcode' => '123456',
    'telephone' => '123456',
    'country_id' => 'US',
    'region_id' => 12, // id from directory_country_region table
);

$billingAddress = $quote->getBillingAddress()->addData($addressData);
$shippingAddress = $quote->getShippingAddress()->addData($addressData);

/*$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
    ->setShippingMethod('flatrate_flatrate')
    ->setPaymentMethod('checkmo');*/

/* [adamw] Free shipping would look like this:
*/
$shippingAddress->setFreeShipping( true )
    ->setCollectShippingRates(true)->collectShippingRates()
    ->setShippingMethod('freeshipping_freeshipping')
    ->setPaymentMethod('checkmo');

$quote->setCouponCode('ABCD');
$quote->getPayment()->importData(array('method' => 'checkmo'));

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

$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$order = $service->getOrder();

printf("Created order %s\n", $order->getIncrementId());

That's the code that finally did it BUT: The downloadable products are not available instantly. If you invoice the order manually the products are available.If you invoice the order programmatically the products are not available.

Any idea why and how to bypass that? Am I doing something wrong here?


texts: Why there is a unsubscribe from product in a product stock alert e-mail?

texts:
A product stock alert is a "single e-mail sent" notification.

Nevertheless, I wonder why in the e-mail message there is a link to unsubscribe from the product, although the record in product_alert_stock is already flagged when the e-mail is sent ?


texts: Continue Shopping Button to category of product in same store view or same parent category

texts:
There are answers all over the internet of how to alter the 'Continue Shopping' button to the last category.

However none of them take into consideration that the product may be in multiple categories or store views.

I've tried numerous ways to filter the below snippet to get the last category from either the current store or from a specific parent category, but nothing seems to work .

Any suggestions on how to refine the results further?

<?php
    $lastProductAddedToCartId = Mage::getSingleton('checkout/session')->getLastAddedProductId();
    if($lastProductAddedToCartId) {
        $productCategoryIdsArray = Mage::getModel('catalog/product')->load($lastProductAddedToCartId)->getCategoryIds();
        $continueShoppingCategoryUrl = Mage::getModel('catalog/category')->load($productCategoryIdsArray[0])->getUrl();
    }
?>

Reference:
https://stackoverflow.com/questions/12222601/make-magento-continue-shopping-button-redirect-to-the-last-added-to-cart-produ


texts: Every link is working fine except the menu links saying "There has been an error..." in magento 1.8

texts:
I have transferred the magento files from live server to localhost.
Every thing is working fine but when I am clicking to any menu links,it gives an error saying
"There has been an issue..."

I am using magento 1.8

Please look at this issue and provide me any hint..
Thanks in advance.

Below is the error log file

a:5:{i:0;s:163:"Cannot send headers; headers already sent in C:\xampp\htdocs\baby_demo\app\code\local\Magentothem\Layerednavigationajax\controllers\CategoryController.php, line 15";i:1;s:1013:"#0 C:\xampp\htdocs\baby_demo\lib\Zend\Controller\Response\Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)

**#1 C:\xampp\htdocs\baby_demo\app\code\core\Mage\Core\Model\App.php(1246): Zend_Controller_Response_Abstract->setHeader('Content-Type', 'text/html; char...')

**#2 C:\xampp\htdocs\baby_demo\app\code\core\Mage\Core\Controller\Varien\Front.php(80): Mage_Core_Model_App->getResponse()

**#3 C:\xampp\htdocs\baby_demo\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(202): Mage_Core_Controller_Varien_Front->getResponse()

**#4 C:\xampp\htdocs\baby_demo\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))

**#5 C:\xampp\htdocs\baby_demo\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()

**#6 C:\xampp\htdocs\baby_demo\app\Mage.php(684): Mage_Core_Model_App->run(Array)

******#7 C:\xampp\htdocs\baby_demo\index.php(87): Mage::run('', 'store')


texts: Block data are not shown in PHML magento 2

texts:
I am new to Magento 2 module development.

I have a custom table sample_data(id,sample_text,sample_number)

I want to fetch a listing of this custom table.But unfortunately when I type www.magentolocalhost.dev/sample/sample/sampledata,
I am getting a blank page.

Controller
---------------->Sample
                    -->SampleData.php
Model
--------ResourceModel
    --------------SampleData
                        Collection.php
        SampleData.php
Sampledata.php
Block
Sampledata.php
view
-------->frontend
        ----->layout
                sample_sample_sampledata.xml
        ----->templates
                Samplelist.php

SampleData.php (Action)

namespace Packt\SampleData\Controller\Sample;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
class SampleData extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;
    public function __construct(Context $context,PageFactory $pageFactory)
    {
        $this->_pageFactory = $pageFactory;
        parent::__construct($context);
    }

    public function execute()
    {

       return $this->_pageFactory->create();
    }
}

Sampledata.php(model)

namespace Packt\SampleData\Model;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\DataObject\IdentityInterface;
class Sampledata extends AbstractModel implements IdentityInterface
{
    const CACHE_TAG = 'Packt_SampleData';
    protected function _construct() {
        $this->_init("\Packt\SampleData\Model\ResourceModel\Sampledata");
    }
    public function getIdentities() {
         return [self::CACHE_TAG . '_' . $this->getId()];
    }
}

ResourceModel\SampleData.php(ResourceModel)

namespace Packt\SampleData\Model\ResourceModel;
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
class Sampledata extends AbstractDb
{
 public function _construct()
    {
     $this->_init("sample_data", "id");
    }
    public function getSampleTextById($id)
    {
        $adapter =  $this->getConnection();
        $select =$adapter->select()->from($this->getMainTable(), "sample_text")->where("id=:id");
        $binds = ["id"=>(int)$id];
        return $adapter->fetchOne($select, $binds);
    }
}

ResourceModel\Sampledata\Collection.php(Collection)

namespace Packt\SampleData\Model\ResourceModel\Sampledata;
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
class Collection extends AbstractCollection
{
    public function _construct()
    {
        $this->_init("Packt\SampleData\Model\Sampledata", "Packt\SampleData\Model\ResourceModel\Sampledata");
    }

}

Block

namespace Packt\SampleData\Block;
class Sampledata extends \Magento\Framework\View\Element\Template
{

    protected $_SampledataFactory;
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Packt\SampleData\Model\SampledataFactory $SampledataFactory, array $data = []
    ){
        $this->_SampledataFactory = $SampledataFactory;
        parent::__construct($context,$data);
    }
    public function _prepareLayout()
    {
        parent::_prepareLayout();
    }
    public function getCollection()
    {
        return $this->_SampledataFactory->create()->getCollection();
    }

}

Layout.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="content">
        <block class="Packt\SampleData\Block\Sampledata" name="Packt_SampleData" template="Packt_SampleData::Samplelist.phtml" />
    </referenceContainer>
</page>

Samplelist.phtml(Template)

<?php var_dump($block->getCollection())?>


texts:
The default design templates for magento (i.e 1/2/3-columns) located in app/design/frontend/base/default/template/page/ all specify the DOCTYPE attribute as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

When using validation services, such as:

http://app.validator.pro/ or
http://validator.w3.org/

app validator in specific gives the following error message:

  Error: Legacy doctype. Expected e.g. !DOCTYPE html.

As a result there are additional, non-valid errors displayed on the page because the doctype specified is not seen as valid, so it default to HTML 4.01 Transitional.

Changing the template source as follows:

<!DOCTYPE html>

Gets rid of these errors & now the validator services now display fewer & more relevant errors.

Anybody know why Magento is still doing this, even in 1.9?
Is this detrimental from an SEO perspective?
Why is the page being declared as XHTML?


texts: display product price with exclusive of tax in magento 2

texts:
I want to get product price (exclusive of tax) in catalog pages in Magento 2

vendor\magento\module-catalog\view\base\templates\product\price\amount\default.phtml

I override this file for custom text to my theme.

  I override that file but I want to get the product price (Exclusive
  of Tax) in Magento 2

how I can do this??

I don't know


texts: display Text, Textfield & Button in one line using phtml code

texts:
visit  link1

search for "check" using CTRL + F, than you can see :

I wanted to display like this as link2

we are using following code :

Phtml

<?php if ($this->isFieldVisible('postcode')): ?>

            <label for="search"<?php if ($this->isFieldRequired('postcode')):?> class="required" <?php endif;?>><?php if ($this->isFieldRequired('postcode')):?>*<?php endif;?><?php echo Mage::helper('webdevlopers_productpageshipping')->__('') ?>

                <input placeholder="Enter your PIN Code" class="input-text validate-postcode<?php if ($this->isFieldRequired('postcode')):?> required-entry<?php endif;?>" type="text" id="estimate_postcode" name="estimate[postcode]" value="<?php echo $this->htmlEscape($this->getFieldValue('postcode')) ?>" />

   <?php endif; ?>

css

    li.item {
  align-items: center;
  display: flex;
}
li.item img {
  opacity: .3;
  height: 20px;
  width: 40px;
}
li.item label {
  color: #aaa;
  font-family: 'ubuntu';
}
li.item .search {
  margin-left: 6px;
}
li.item .search input {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: .5rem;
}
li.item .search button {
  background-color: #00bfff;
  border: none;
  border-radius: 3px;
  color: #fefefe;
  padding: .5rem .5rem;
}


texts:
How do you exclude all product images of a product, i.e. the Exclude box of every image being ticked on the Images tab in the Magento backend.

I'm bulk adding new images to products using $product->addImageToMediaGallery() but before adding the new pictures I want to exclude the already existing images.

I want exclude them and not remove them so they can easily be restored in the future if needed.


texts: Create customer with default addresses via API

texts:
Is it possible to create customer via API and set default billing and shipping address at once ?

I know that in customerCustomerRepositoryV1 and
customerAccountManagementV1  are fields like default_billing and default_shipping but there is required to set addressId.
In case when we are creating customer there is no id for sending addresses.

I am using Magento 2.3.1


texts: Magento 2.3.1 Incompatible argument type

texts:
I have an issue on compile on customs extension:

  ImaginationMedia\SocialOrder\Ui\DataProvider\Sales\Order\Donation\DataProvider
        Incompatible argument type: Required type: string. Actual type:
  \ImaginationMedia\SocialOrder\Ui\DataProvider\Sales\Order\Donation\name;
  File:
  /var/www/html/app/code/ImaginationMedia/SocialOrder/Ui/DataProvider/Sales/Order/Donation/DataProvider.php

  Total Errors Count: 1

  In Log.php line 92:
                                 Error during compilation

<?php

namespace ImaginationMedia\SocialOrder\Ui\DataProvider\Sales\Order\Donation;

use ImaginationMedia\SocialOrder\Model\Helper;
use Magento\Backend\Model\Session;
use Magento\Framework\Api\Filter;
use Magento\Ui\DataProvider\AbstractDataProvider;
use Magento\Ui\DataProvider\AddFieldToCollectionInterface;
use Magento\Ui\DataProvider\AddFilterToCollectionInterface;

class DataProvider extends AbstractDataProvider
{
    /**
     * @var Helper
     */
    private $helper;

    /**
     * @var AddFieldToCollectionInterface[]
     */
    protected $addFieldStrategies;

    /**
     * @var AddFilterToCollectionInterface[]
     */
    protected $addFilterStrategies;

    /**
     * @var int
     */
    private $productId;

    /**
     * DataProvider constructor.
     * @param $name
     * @param $primaryFieldName
     * @param $requestFieldName
     * @param Helper $helper
     * @param Session $session
     * @param array $addFieldStrategies
     * @param array $addFilterStrategies
     * @param array $meta
     * @param array $data
     */
    public function __construct(
        $name,
        $primaryFieldName,
        $requestFieldName,
        Helper $helper,
        Session $session,
        array $addFieldStrategies = [],
        array $addFilterStrategies = [],
        array $meta = [],
        array $data = []
    ) {
        parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
        $this->addFieldStrategies = $addFieldStrategies;
        $this->addFilterStrategies = $addFilterStrategies;
        $this->helper = $helper;
        $this->productId = $session->getCurrentDonationProduct();
    }

    /**
     * @return \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection|\Magento\Sales\Model\ResourceModel\Order\Item\Collection
     */
    public function getCollection()
    {
        return $this->helper->getDonationOrders($this->productId);
    }

    /**
     * Get data
     *
     * @return array
     */
    public function getData()
    {
        $items = $this->getCollection();

        $items = $this->helper->getItemsInArray($items);

        $result = [
            'totalRecords' => $this->getCollection()->getSize(),
            'items' => array_values($items),
        ];
        return $result;
    }

    /**
     * Add field to select
     *
     * @param string $field
     * @param string $alias
     * @return void
     */
    public function addField($field, $alias = null)
    {
        if (isset($this->addFieldStrategies[$field])) {
            $this->addFieldStrategies[$field]->addField($this->getCollection(), $field, $alias);
        } else {
            parent::addField($field, $alias);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function addFilter(Filter $filter)
    {
        if (isset($this->addFilterStrategies[$filter->getField()])) {
            $this->addFilterStrategies[$filter->getField()]
                ->addFilter(
                    $this->getCollection(),
                    $filter->getField(),
                    [$filter->getConditionType() => $filter->getValue()]
                );
        } else {
            parent::addFilter($filter);
        }
    }


texts:
Code:

class MinimalTierPriceCalculator extends \Magento\Catalog\Pricing\Price\MinimalTierPriceCalculator
{

 private $calculator;

 public function __construct(CalculatorInterface $calculator)
{
    $this->calculator = $calculator;
}

public function getAmount(SaleableInterface $saleableItem)
{
    $value = $this->getValue($saleableItem);

    return $value === null
        ? null
        : $this->calculator->getAmount($value, $saleableItem,['weee', 'weee_tax', 'tax']);
}

}

i add $this->calculator->getAmount() 3rd parameter after adding 3rd parameter tax my price issue fix but styling not good price-including-tax class not adding auto as before.


texts: Remove ui-menu-icon from main navigation

texts: I am trying to find where this menu Icon is generated in the magento system. I would like to remove it. This menu is generated based on my product categories. When its clicked it shifts the word Rental  to the right. If anyone knows where its coming from that would be helpful!


texts: Order emails not sending to customer or admin magento 2.1.8?

texts:
I am facing an issue with sending the email.

When I triggered email then server log shows below information:

  pr  4 11:11:35 ip-172-31-3-44 postfix/smtp[90393]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400e:c03::1b]:25: Network is unreachable
    Apr  4 11:11:35 ip-172-31-3-44 postfix/smtp[90390]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400e:c03::1b]:25: Network is unreachable
    Apr  4 11:11:35 ip-172-31-3-44 postfix/smtp[90386]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400e:c03::1b]:25: Network is unreachable

What are the means by that or how can I fix the issue?


texts:
I'm using the luma demo for practicing.
I want to create and add a new block in my homepage like this:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="page.wrapper">
            <block name="myblock"/>
        </referenceContainer>
    </body>
</page>

It worked but I want to change this block's order before the tag "main" which class name is "page-main".

I've tried this code :

<referenceContainer name="page.wrapper" before="main"> or
<referenceContainer name="page.wrapper" before="page.main"> or
<referenceContainer name="page.wrapper" before="page-main">

None of this works.
Even I put a move tag like this:

<move element="myblock" destination="page.wrapper" before="main" /> or
<move element="myblock" destination="page.wrapper" before="page.main" /> or
<move element="myblock" destination="page.wrapper" before="page-main" />

How can I put my block before that?


texts: How to restrict Shipping Method Based on Product in the add-to-cart?

texts: I have couple of shipping methods DHL & FedEx, if selected products exits in cart show only selected shipping method, how to achieve using shopping cart pricing rule  or any other way to do this?


texts: I am using Magento 2.3.0 and Porto theme. On my product page, the image is loading very slowly. How can I load it fast?


texts: Magento 1.9 version Custom discount is not working

texts:
I am using these 2 observers -

1 - sales_quote_collect_totals_after

2 - sales_order_place_before

Custom discount(which is 3%) is working fine when customer do order from Cash on delivery but customer pay via online then it is not working.

I am using USAePay payment method.

Note:Discount(10% using coupon code) is working fine for both cash on delivery and USAePay payment.


texts:
we're trying to send a soap request to the purolator shipping API. We are stuck at the header portion.

This is what we are sending the shipping API:

  // Probleme ICI

        try {
  //Define the SOAP Envelope Headers
  $headers[] = new SoapHeader ( 'http://purolator.com/pws/datatypes/v1',
                                'RequestContext',
                                array (
                                        'Version'           =>  '1.4',
                                        'Language'          =>  'en',
                                        'GroupID'           =>  'xxx',
                                        'RequestReference'  =>  'Rating Example'
                                      )
                              );
                   \Magento\Framework\App\ObjectManager::getInstance()
            ->get('Psr\Log\LoggerInterface')->debug('soapHeader created');

        } catch (\Exception $e) {
                //$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];
                $this->_logger->critical($e);
                \Magento\Framework\App\ObjectManager::getInstance()
            ->get('Psr\Log\LoggerInterface')->debug($e);
        }

  //Apply the SOAP Header to your client
  $client->__setSoapHeaders($headers);

            \Magento\Framework\App\ObjectManager::getInstance()
            ->get('Psr\Log\LoggerInterface')->debug('soapclient2');

                return $client;

    }

It's simply not catching the error with the trap we made. What are we doing wrong?

Thanks!


texts: Code quality issues: CPD: This extension contains duplicated code. in Magento 2

texts:
We made a module & submitted in marketplace & they gave the main issue :-
Code quality issues: CPD: This extension contains duplicated code.

Here is one of them :-
File: Vendorname/module-name/Vendorname-module-name-2.0.0.0/Controller/Adminhtml/Myitems/MassDisable.php
Line: 11
File: magento/module-cms/magento-module-cms-102.0.0.0-RC21/Controller/Adminhtml/Page/MassDisable.php
Line: 11

Can anyone please suggest what to do in such case?


texts: I want to change code for text swatches that render on the list page in Magento 2 in the configurable products. I have changed files in Magento_Swatches but no change is applying on the frontend.


texts: Customers having a problem logging onto our website

texts:
We are having some customers face an issue when loading our website and they are receiving this message.

I have tried to type the link that it says but nothing is coming up. Can anyone suggest what I can do to help this?


texts: Is it ok for Magento 2 to have 35k categories and 300k products

texts: I'm going to migrate a website to Magento 2 that have 35k entities that really close to categories functionality. So I'm wondering is there any issue to have such amount categories? Is there any problem places should be kept in mind? Also, there are 300k products, but they would be simple and shouldn't be a problem, I think.


texts: How to get Review & Ratings by Product Id In Magento 2

texts:
I am trying the below code but not working can you please help what i am doing wrong

class classname implements classnameInterface
{

          protected $subscriberFactory;
            protected $reviewFactory;
            protected $storeManager;
            protected $product;

      public function __construct(

    \Magento\Review\Model\ReviewFactory $reviewFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager

) {
    $this->subscriberFactory= $subscriberFactory;
    $this->reviewFactory = $reviewFactory;
        $this->_storeManager = $storeManager;

}

    public function review($reviewId) {

 $this->reviewFactory->create()->getEntitySummary($product, 1);
    $ratingSummary = $product->getRatingSummary()->getRatingSummary();

    return $ratingSummary;

    }

}

Should i need to $product Declaration anywhere ?


texts:
i am using magento to sell jewelry products , i want my weight to be set in grams , not in kg or grams , i tried searching and found only two kg and pounds.

weights are important is used by fedex for calculation .

please guide me where can i find setting to edit it .


texts: Magento2 - Radio button group on checkout page

texts:
On the checkout page I want to add a radio button group with these options:

Individual
Company

Based on these options additional fields will be show. How can I add a radio button group to the checkout page?

I already created an InstallData.php file that can add fields:

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

    /** @var CustomerSetup $customerSetup */
    $customerSetup  = $this->customerSetupFactory->create([ 'setup' => $setup ]);

    // Todo: add Radio button group
}

I already inserted other fields with this function, but I cannot find out how to add a radio button group.


texts: Magento1: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

texts:
getting the error while uploading the media files to the products, I have tried repairing the tables and also tried increasing the INT value in table structure still giving the following error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db-4.catalog_product_entity_media_gallery_value, CONSTRAINTFK_CAT_PRD_ENTT_MDA_GLR_VAL_STORE_ID_CORE_STORE_STORE_IDFOREIGN KEY (store_id) REFERENCEScore_store(store_id) ON DELE), query was: INSERT INTOcatalog_product_entity_media_gallery_value(value_id,store_id,label,position,disabled) VALUES (?, ?, ?, ?, ?)

Is it fine to truncate the media table and then run the re-indexer or it will loose all the media?


texts: How to create custom cache and store/get something in Magento 2

texts:
I want to store any dummy data in custom cache and get that data in my own custom cache.
I have followed this link but not telling much explanation.


texts: Magento2 image file in ui component form

texts:
I have ui component layout for an image field

     <field name="image">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Showcase Image</item>
                <item name="formElement" xsi:type="string">fileUploader</item>
                <item name="componentType" xsi:type="string">fileUploader</item>
                <item name="notice" xsi:type="string" translate="true">Allowed file types: ico, png, gif, jpg, jpeg, apng, svg. Not all browsers support all these formats!</item>
                <item name="maxFileSize" xsi:type="number">2097152</item>
                <item name="allowedExtensions" xsi:type="string">jpg jpeg gif png svg</item>
                <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="string">newstart_showcase_backend/showcase_image/upload</item>
                </item>
            </item>
        </argument>
    </field>

I have an save.php to save image name to database and another controller newstart_showcase_backend/showcase_image/upload to actually save the uploaded image to media folder. All these functions are working fine so far in "add new item" edit page. The real problem I have is image does not show when I open the existing item that I created. All other files are showing as expected, but not the image field. Any suggestion are appreciated. I can post more code here on demand if you need to check it. Thanks in advance.

Following is my main table A, and reference table B which stores  store ID for each item in table A by referring the id

id  smallint(5) unsigned Auto Increment Entity ID
image   varchar(255)    Image Name
url varchar(255) [] Image Destination Url
caption varchar(255) NULL   Image Caption
start_date  date NULL
end_date    date NULL
order   smallint(6) [1] Image Ordering
status  tinyint(1) [1]  1 - Banner Enabled, 0 - Banner Disabled
created_at  timestamp [CURRENT_TIMESTAMP]   Created time
updated_at  timestamp [0000-00-00 00:00:00] Update time

At "add new item" page, there is uploader

Edit Page doesn't show image, and HOW CAN I MAKE IT SHOW HERE


texts: Magento 2 After login redirect user to referrer

texts:
In my magento instance guest checkout is enabled and configuration is set as follows:

System > Config > Customer > Redirect Customer to Account Dashboard after Logging in > NO

I want to redirect user to page he is requesting. Like if user has added some products to cart without logging in and if he clicks on go to checkout button, a login popup displays. Now when he logs in, he should be redirected to checkout page. Basically he should be redirected to the page based on which button is clicked (Go to checkout or View Cart)


texts:
I use following code,

public function execute()
{
    //do your custom stuff here
    $fileName = 'file name for download here';
    $this->fileFactory->create(
        $fileName,
        null, //content here. it can be null and set later
        base dir of the file to download here
        'application/octet-stream', //content type here
        content lenght here...can be null
    );
 }

What would be the base dir for this file?

  /magento/pub/media/downloadable/files/links/l/e/learn-magento.jpg


texts: Magento 2 Get Shipping Rates of All active shipping methods

texts:
I have a special case where I want to show all active shipping methods with applied estimated shipping cost to login customer if customer has default shipping address set in address book.

The following link describe how to show all active shipping methods in a custom module.

Magento 2 How to get all active shipping methods?

But I did not find any code that also display shipping rate of each method. So I need to show shipping rate of each shipping method to login customer. These customer already has some shipping address.


texts: How to turn on Template Path Hints in Magento2 Through Code edit

texts:
I know that you can turn template path hints on in Magento2 through the Admin Panel at Stores > Configuration > ADVANCED > Developer.

Although in Magento 1 I find it much quicker to temporarily edit a single line of code in app/code/core/Mage/Core/Block/Template.php.  At line 200 I simply change:

return self::$_showTemplateHints;

to

return true;

It saves a lot of time than going through the admin panel.  Is there somewhere in Magento 2 where I can similarly turn on Template Path hints by editing a line of code this way?


texts: DI compilation error when referenced module is not installed

texts:
I have a module that integrates with other modules from other developers. These other modules may or may not be installed, it is different for each user.
As an example, the MSG_InstantSearch module takes an array of search item objects. By default it has an item for products, categories, blog etc but it's possible to inject additional items into this array using DI. This works in the same way you can inject Router objects in using DI.
This works great because I inject the object via DI so if the module is not installed then nothing happens.
The issue occurs when compiling the DI. Each search item has to implement an interface provided by the MSG_InstantSearch module and if the module isn't installed then the interface isn't available and the DI throws an exception and won't compile.
My questions are:

Is there a way to provide a fallback for a class that doesn't exist? I could specify an empty interface if the module isn't installed and the DI would compile
Is there a way to exclude certain files from DI compilation?
Is there anything else I can do or something I have missed?


texts: "Setup version for module 'xxx' is not specified"

texts:
I've been trying to get up to speed on how to build Magento 2 modules using the merchant beta but when building a module I'm getting stuck at the error message in the title.

From what I've understood this error message should be showing up if I've forgotten to add setup_version="x.y.z" to my <module>element in etc/modules.xml but I already have that. So, what other "magic" causes of this error exist?


texts: Magento 2 CMS page add custom breadcrumbs

texts:
I have tried the below code for Magento 2 cms page custom breadcrumbs, but I got this error :

  Please correct the XML data and try again. Element 'action': This
  element is not expected. Line: 3

Admin login -> Content-> Pages -> Add New Page -> Design -> Layout Update XML

    <referenceContainer name="breadcrumbs">
        <action method="addCrumb">
            <argument name="crumbName" xsi:type="string">Home</argument>
            <argument name="crumbInfo" xsi:type="array">
                <item name="title" xsi:type="string">Home</item>
                <item name="label" xsi:type="string">Home</item>
                <item name="link" xsi:type="string">/</item>
            </argument>
        </action>
        <action method="addCrumb">
            <argument name="crumbName" xsi:type="string"></argument>
            <argument name="crumbInfo" xsi:type="array">
                <item name="title" xsi:type="string">XXXXXX</item>
                <item name="label" xsi:type="string">XXXXXX</item>
                <item name="link" xsi:type="string">/xxxxxx</item>
            </argument>
        </action>
        <action method="addCrumb">
            <argument name="crumbName" xsi:type="string">YYYYYY</argument>
            <argument name="crumbInfo" xsi:type="array">
                <item name="title" xsi:type="string">YYYYYY</item>
                <item name="label" xsi:type="string">YYYYYY</item>
            </argument>
        </action>
    </referenceContainer>


texts: Magento 2 : Search page has not showing exact result

texts:
I have two products

Product name : Test Product and sku: dp-2200
Product name : Test Product2 and sku: dp-3000

When I search for: "dp-2200 test" then it will return both products in the results. After some RnD I changed search_request.xml file and changed the clause="must" instead of "Should" in the XML file but after that I have showing no result.

So this above solution is check full string but I need to check all attribute value in product.

I just need to show first product only when searching for "dp-2200 test" keyword.

Any idea please share.


texts:
I've created a Catalog Products Lists widget to use my own template when the items are displayed on the frontend. When I insert the widget via Content > Widgets > 'Add Widget' and set it to be displayed on a specific page (CMS Home Page) and in the Main Content Area – everything works fine... The products are displayed as I'd like them to be.

Now, if I try to add the same widget via Content > Blocks > 'Add New Block' > 'Insert Widget', the following is added to the CMS Block content:

{{widget type="Mike\ProductList\Block\Catalog\Product\ProductList" title="Widget from CMS Block" category_id="26" template="product/list/productlist.phtml"}}

Unfortunately, my widget isn't being displayed in the CMS Block I created. Any ideas why the widget is displaying fine when added via the Widgets page and not being displayed when added to a CMS Block?

UPDATE:
In response to Aaron Allen's suggestion

My current etc/widget.xml file looks like the below:

<?xml version="1.0" encoding="UTF-8"?>
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget_file.xsd">
<widget
    id="category_product_list"
    class="Mike\ProductList\Block\Catalog\Product\ProductList"
    is_email_compatible="false"
    placeholder_image="Magento_Widget::placeholder.gif" >
    Catalog Product List
    <description translate="true">Displays a list of products in a block using my new template</description>
    <parameters>
        <parameter name="title" xsi:type="text" required="true" visible="true">
            Title (frontend)
        </parameter>
        <parameter name="category_id" xsi:type="block" visible="true" required="true">
            Category
            <block class="Mike\ProductList\Block\Adminhtml\Catalog\Category\Widget\Chooser">
                <data>
                    <item name="button" xsi:type="array">
                        <item name="open" xsi:type="string">Select Category...</item>
                    </item>
                </data>
            </block>
        </parameter>
        <parameter name="template" xsi:type="select" required="true" visible="true">
            Template
            <options>
                <option name="default" value="product/list/mikeProductList.phtml" selected="true">
                    Product  Template
                </option>
            </options>
        </parameter>
    </parameters>
</widget>

As you can see, this is telling my widget to use Mike\ProductList\Block\Catalog\Product\ProductList as my class.

<?php

namespace Mike\ProductList\Block\Catalog\Product;

use Magento\Catalog\Block\Product\ListProduct;

class ProductList extends ListProduct {

}

How would I tell the widget to extend Template and implement BlockInterface, if I'm already extending Magento\Catalog\Block\Product\ListProduct to pull in the products?

Do I need to create another class (the one you posted) Magento\Widget\Block\BlockInterface and tell the widget somewhere in the XML to use that too somehow?


texts: Customer address data not showing all countries

texts:
We have two sites running on one installation of Magento 1.8.1. The .com is for USA orders (separate fulfillment in US) and the .ca is for Canadian orders (separate fulfillment in CA).

The .com site (the "Default Config") has a default country (in System/Configuration/General) of only United States, and the .ca site has a default country of only Canada. See below screenshots...

The problem is when we try to edit or create a new customer record (Customers/Manage Customers/Edit or Add New Customer) the Addresses country pulldown is only showing "United States" and not "Canada".

If we also select "Canada" as a default country (in System/Configuration/General) it will add "Canada" to the pulldown list. The problem is that if we do this our shopping cart (and checkout) gives the visitor the option of selecting "United States" or "Canada" from both the .com and .ca sites. We only want "United States" in the .com site and "Canada" in the .ca site.

Is there a setting or something that will get "Canada" and "United States" to show in customer address country pulldown without adding both to shopping cart and checkout?

Thanks for your help in advance!


texts: Create order with cron job with SKU and customer_id given

texts:
Is there a way where we can create an order with a cron job? I need this because, the product which I sell is a prepaid subscription(a simple magento product).

Which after payment, I convert it into 6 products(again simple magento product) in case it is a six month subscription and put the first month's order into the cart and remaining 5 products SKUs into a separate table, along with customer_id, some foreign_id for identification and the respective shipping dates.

I could do the above by hooking on to the event

sales_model_service_quote_submit_before

Then I program the cron to run each day and match today's date with the shipping dates in the above created table, fetch those SKUs, customer_id and process the order.

How to go about in making a CRON job to order on behalf of the customer.

NOTE:

The reason I am using the above method is because,

1) The payment is prepaid. NO RECURRING PAYMENTS. I could not use magento's in-built recurring profiles or Aheadworks' subscription and recurring payments plugin. As all are based on billing agreement and are recurring based on paypal/ authorize.net 's call. Thus this is not the solution for the problem

2) If I use a bundle product and put all the 12 sub products (incase of 12 month subscription) into it and sell, the orders will be translated as a single order. It will be pending for 12 months as the shipping will take place 1 sub-product per month.

3) I need to manage inventory on the sub products

If there is some other way to go about in this, please let me know.

If there is a plugin to do all these stuff and you could point that out to me, I owe you a beer!

Help me out. I am literally 5 days old in Magento


texts: Magento 1: adminhtml controller rewrite and module dependencies

texts:
Explanation

So I have a module, I'll call it Hello_World with the following code in config.xml

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Hello_World before="Mage_Adminhtml">Hello_World_Adminhtml</Hello_World>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Under the controllers/Adminhtml folder I have two controllers which DO NOT EXTEND any core Magento controllers.

On the other hand, I have another module called Bye_World with the same code in config.xml:

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Bye_World before="Mage_Adminhtml">Bye_World_Adminhtml</Bye_World>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Under the controllers/Adminhtml folder I have one controller which DOES EXTEND a core Magento controller

Problem

If I try to make Bye_World depending on Hello_World by adding the following to my app/etc/modules/Bye_World.xml :

<depends>
    <Hello_World />
</depends>

Then my Bye_World adminhtml controller core rewrite won't be called anymore even though there's no Hello_World adminhtml controller that rewrites the same core controller.

So I'm wondering what I'm doing wrong ?


texts: General error: 2013 Lost connection to MySQL server during query in Magento

texts:
when I search any product in top search I get error in Magento.I searched lot in stack over flow and  Magento stack exchange but all that solution is not worked in my case.

for ex : if I search "dell laptop" and hit enter it go to error page and error is below.

  a:5:{i:0;s:494:"
      SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server during query, query was:
      INSERT INTO catalogsearch_result
      SELECT 2992 AS query_id, s.product_id,
      MATCH (s.data_index) AGAINST (:query IN BOOLEAN MODE) AS relevance
      FROM catalogsearch_fulltext AS sINNER JOIN catalog_product_entity AS e ON e.entity_id = s.product_id
      WHERE (s.store_id = 1) AND (MATCH (s.data_index) AGAINST (:query IN BOOLEAN MODE)) ON DUPLICATE KEY UPDATE relevance =
  VALUES(relevance)
      ";i:1;s:4001:"`

I also truncate all log tables but it's also not working in my case.

so if you guys have any other solution please share with me.


texts: How one user can access two different websites with automatic login to both different instance Magento 2?

texts:
I have two different instances for Magento 2. If the user is logged in on Site1 and access it, then after the user goes to the Site2 then it should automatically be logged in for Site2. I need that kind of functionality.

One user can access two different Magento instance with a single site login.

The user doesn't need to filled login details for site 2 it will automatically be logged in with same details which used for site 1.

Is there any another way or best option to manage a single account with both Magento instance? is it possible?

How can we achieve this?

Does anyone have an idea about it?


texts: I cannot upload a spreadsheet to enable me to set the postage settings as the sheet is not recognised

texts:
When I try and upload an excel spreadsheet in order to set the postage rates the spread sheet will not upload.
I go to stores - configuration - sales - shipping methods. I choose table rates then price v destination. I have a box called 'export' and next to it is a box called 'export csv'. I click that and a file downloads in excel on my computer. The automatic headings are country, region/state, zip code, order subtotal and above and shipping price. I filled these all in with UK as the country as I only ship to UK. I put * in  the next 2 columns and the prices in the last column. I then have problems saving as the only csv options I have are comma delimited, MS-DOS, Mackintosh,UTF-8( comma delimited) and I think this is where there might be a problem. Whatever i choose it says 'some features might be lost but I save it anyway as I can't see what else to do. I then  next to 'Import' 'Choose File' and click on the saved file in Excel on my computer. It shows up besides the 'choose file' option in magento. I then save the configuration.
I then get the message 'The "UK" country in row number "2" is incorrect. Verify the country and try again.' There are other identical messages for the rows with Uk in the first column.
What am I doing wrong? I have tried changing UK to United Kingdom, GB but nothing
makes any difference.


texts: Magento 2 Modify search result collection

texts:
What is the proper way of changing what is in a search and category product colleciton?  Interceptors?  I've kinda tried this but it messes with the pagination of the search result.

For context.   I created an extension that has its own table that holds data for year, make, and model.  Each row has fields: year, make, model, product_ids (Which holds IDs of compatible products).

In the front end the user can select year make model from drop downs which is stored in their session.  When the user does a search I would like to only show products that are compatible.

As a bonus I would also like for the auto complete in the search bar to take these into account as well but that's more of a bonus and not the main issue I am trying to resolve.


texts: can i add more than 1 pages in a module in magento?

texts:
I already have a module and i want to create new page which redirected from 1st of my module.
I want to know how to create more than 1 page in a module and also how to link pages.


texts:
I would create a dynamic category "special offers" that contains all discounted products:

discounts of single products;
global discounts (menu "promotions" / "catalog price rules").

How I can copy, automatically, discounted products to "special offers" category?

I thought to crontab process.. or plugin (ok, but which event for global discounts?)


texts: Upsell : get parent product from child product id

texts:
i am looking for code which can help me get parent product id from child product Id and this both products are related using upsell feature

so far i was able to retrieve child products id from parent id by using below code

   //Get product detail using product id  (Suppose you have product id is : $product_id)
   $_product = Mage::getModel('catalog/product')->load($product_id);

   // Fetch list of upsell product using query.
   $upsell_product = $_product->getUpSellProductCollection();

but i want to do reverse

This solution also worked

$childProductId = 17;//edit this value, or get it by $product->getId()
$productsLinkedAsUpsell = Mage::getModel('catalog/product_link')->getCollection()
        ->addFieldToFilter('linked_product_id', $childProductId)
        ->addFieldToFilter('link_type_id', Mage_Catalog_Model_Product_Link::LINK_TYPE_UPSELL);
foreach ($productsLinkedAsUpsell as $upsell) {
    $parentId = $upsell->getProductId();
}


texts: magento filter product collection by category name

texts:
I am using magento 1.9.3.6. In magento how to filter the product Collection by catery Name also.

Note: Am already Filtered the product byname and some Custom attributes.
My Code is

$collection->addAttributeToFilter(array(array('attribute' => 'name', array('like' => '%' . $query . '%')), array('attribute' => 'brand', 'finset' => $brandCollection), array('attribute' => 'model', 'finset' => $modelCollection),));


texts: Magento 2.3.5 : Call custom block before layered navigation

texts:
I am using Magento 2.3.5 and I need to call custom block before layered navigation. How can I call that?
I used this below code
<?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>
        <referenceContainer name="sidebar.main">
            <block class="Magento\Framework\View\Element\Template" name="my_block" as="my_block" template="Vendor_Module::test.phtml" before="-"/>
        </referenceContainer>
    </body>
</page>

But, it's call after layered navigation. How to call my block before layered navigation. (sidebar main class)
Any help would be appreciated.
Thanks.


texts: How to import images from the external URL in Magento2

texts:
After Adding this code
    $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
     $currentStore = $storeManager->getStore();

    $mediaUrl = $currentStore->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
    $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
    $currentStore = $storeManager->getStore();
    $image_url  = $importData['addtional_image'];
    $image_type = substr(strrchr($image_url,"."),1);
    $filename   = md5($image_url .$image_type;
    $filepath   = $mediaUrl . $filename;
    file_put_contents($filepath, file_get_contents(trim($image_url)));
    $mediaAttribute = array (
            'thumbnail',
            'small_image',
            'image'
    );

Facing the issue failed to open stream: HTTP wrapper does not support writeable connections


texts: How to get Recently Viewed Product Widget without using widget or static block. Magento 2.3.1

texts:
I want to get the Recently Viewed Products without using Widget or static Block I tried this

namespace PME\Hideprice\Block;

class getTestingData extends \Magento\Framework\View\Element\Template
{
    protected $recentlyViewed;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Reports\Block\Product\Viewed $recentlyViewed,
        array $data = []
    ) {
        $this->recentlyViewed = $recentlyViewed;
        parent::__construct( $context, $data );
    }

    public function testing(){
        return $this->recentlyViewed->getItemsCollection()->getData();
        //return "Asad Khan";
    }
}

I also tried

<?php echo $this->getLayout()->createBlock("Magento\Reports\Block\Product\Widget\Viewed")->setDisplayType("recently.view.products")->setProductsCount("5")->setTemplate("widget/viewed/content/viewed_list.phtml")->toHtml(); ?>

but both of these does not return me anything

but these classes does not return me anything. How to get all the recently viewed product?


texts: Magento2 Seller Sub Domain Configuration

texts:
We are using multivendor marketplace in magento2. Now i we have login for seller as http://mystore.com/marketplace/vendor/login , I want to make it as seller.mystore.com that means when ever seller.mystore.com opened by any one it will show the vendor login page.

How can i configure my subdomain here.?

I am using apache2. Is there any way by using htaccess with out redirect? I just needs to load /marketplace/vendor/login form when user enters seller.mystore.com


texts: Get Customers email address on custom adminhtml customer tab

texts:
I create a custom tab on the admin customer edit page. However what I want to do is get the customers email address to display on the page.

I tried to look for the code that produces the Account information tab but could not find it.

I tried something like in my
app/design/adminhtml/default/default/template/customertab/tab.phtml
however this seems to just break the page meaning just the first tab loads the rest of the page is blank white.

Contact Customer

<?php echo $this->htmlEscape($this->getCustomer()->getEmail; ?>


texts:
We are getting the Color-Picker error in the console randomly. We don't know where it's coming from. We have read several posts but not got a satisfied answer.

Below is the screenshot for your reference:

Herewith I attached the script. Please have a look at it.

Could anyone please help me to resolve this issue?


texts: Get all purchased skus of customers in Magento 2

texts:
I have created a Magento 2 module that downloads a csv file from a controller but I need to get all the purchased skus (no duplicates) of each customer in the csv.
The csv file is going to have the following details
customer_email  | sku_bought
123@example.com | sku_a, sku_b
234@example.com | sku_b, sku_c


texts:
From a working (layout, block, etc) webpage, I want to change the

<action method="addItem"><type>skin_js</type><name>js/script.js</name></action>

To something like

<block type="core/text" name="script_js">
    <action method="setText">
        <text><![CDATA[<script src="/skin/frontend/the_template/default/js/script.js?v=1"></script>]]></text>
    </action>
</block>

I even tried just putting a random string side the <text> node and it still doesn't work, it doesn't show anything.

The reference is a custom (working) block.


texts: Enable Require Customer's Billing Address in Paypal

texts:
I need paypal express to provide me address information and I am trying to enable this option in magento paypal express module.
Require Customer's Billing Address - Yes
There is a little note under the select field:

  This feature needs be enabled first for the merchant account through
  PayPal technical support.

I try to find that option in my sandbox account, but I am not able to find it.

In that post https://community.magento.com/t5/Payments-PayPal/Shipping-address-is-set-to-the-customer-s-Paypal-shipping/td-p/45557
I found that it is possible to be done in sandbox by myself and techincal support is reuired only for production environment.

I would appreciate if someone can help me with that issue?


texts: Properly convert Magento's returned object to JSON

texts:
I made a customer log-in to the site programmatically... I am properly returned the session values in form of an object.

Now i want this data carried over and returned from the function in JSON format.

I know magento has its own encoding and decoding functions... But this conversion does not some how take place properly.

I mean session object contains customer's email, first, last name,etc. But these are not reflected in converted json... So how do I convert this properly??

Thanks in advance

Here is my code..

<?php

function loginUser( $email, $password )
{
    require_once ("../../app/Mage.php");
    umask(0);
    ob_start();
    session_start();
    Mage::app('default');
    Mage::getSingleton("core/session", array("name" => "frontend"));

    $websiteId = Mage::app()->getWebsite()->getId();
    $store = Mage::app()->getStore();
    $customer = Mage::getModel("customer/customer");
    $customer->website_id = $websiteId;
    $customer->setStore($store);
    try {
        $customer->loadByEmail($email);
        $session = Mage::getSingleton('customer/session');
        $session->login($email, $password);
        $session->setCustomerAsLoggedIn($customer);
        $jsonData = Mage::helper('core')->jsonEncode($session);
        var_dump($jsonData);

    }catch(Exception $e){
        return $e->getMessage();
    }

  }

    $test = loginUser("test1.igex@gmail.com","testigex");
    //var_dump($test);
?>


texts: Recommended patch for Magento 1.9.2.4 to date

texts:
Trust me, I googled this and every time, I am redirected to https://magento.com/tech-resources/download
But the link is focused on Magento 2, then I switched to the "security" tab and some patches are listed there. Still, I don't know which one do I need, which is not required (I read somewhere one has to uninstall a given patch to apply a certain one).
So, could you please point me in the right direction?

How do I list the available patches for a given version (say 1.9.2.4 for my case)
How do I safely install them?

Thanks


texts: Magento 2.1: How to get Guest billing address on success.phtml

texts:
I need to get the guest billing address on the success.phml so I can send to a third party app.

I have managed to use this:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$orderData = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($block->getOrderId());
echo "<pre>";
print_r($orderData->getData());
echo "</pre>";
echo $orderData->getData('customer_email');

But the billing address is blank - so I assume that the addresses from the code above is only for registered customers or customers that have registered an address at least.

So my question is how do I get the guest address/data?

It must be able to be pulled as its on the page "checkout/#payment"

My PHP knowledge is pretty basic when it comes to OOP.

Thanks in advance


texts: React Router Breadcrumbs use page titles instead of url dynamically

texts:
I've got a magento 2.3.1 site with venia storefront a react front end and I'm trying to get the breadcrumbs to pull the page titles dynamically rather than pulling the url.

My current code for the breadcrumbs is as follows

import withBreadcrumbs from "react-router-breadcrumbs-hoc";
import React, { Component } from 'react';
import { Link } from 'src/drivers';
import defaultClasses from "./breadcrumbs.css";
import classify from 'src/classify';
import { BrowserRouter } from "react-router-dom";

const urlSuffix = '.html';

class Breadcrumbs extends Component {

    url(url){
        if(url ==='/')
        {
            return `${url}`
        }else {
            return `${url}`
        }
    }

    render () {

        const Breadcrumbs =  withBreadcrumbs()(({ breadcrumbs }) => (

                {breadcrumbs.map(({match, breadcrumb }) => (

                        <Link to={this.url(match.url)}>{breadcrumb}</Link>

                ))}

        ));

        return (<Breadcrumbs />)

    }
}

export default classify(defaultClasses)(Breadcrumbs);

I've tried to do something as long the lines of:

    const routes = [
        {
            path: {match.url}, breadcrumb: {page.title}
        }
    ]

But I don't seem to be having any luck achieve what I need.
At the moment it currently pulls the breadcrumbs using the URL of the pages and I need it to ideally use the Page titles instead, but it needs to happen dynamically as I can't add a route for every single page when there's thousands of product pages.

I've had a look for other react extensions but can't seem to find anything that does what I need.
Can anyone help? Any help would be greatly appreciated.


texts: After migration from magento 1 to magento 2. All customer page problem

texts:
After migrating from M1 to M2 everything seemed to function fine, but when I press the "All customers" page from backend, there is an exception.

This is what it spit out:

[2020-04-13 21:58:05] main.CRITICAL: Type Error occurred when creating object: Magento\Eav\Model\Entity\Attribute\Source\Config {"report_id":"b21f29b28df4c317f0498d14e0dbd03d40db342d62a38b603f94557c07d993a4","exception":"[object] (Magento\\Framework\\Exception\\RuntimeException(code: 0): Type Error occurred when creating object: Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Config at /var/www/bla/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:131)"} []

Does anyone know how I could solve this problem?

Thanks.


texts: Magento2 disable newsletter success mail

texts:
I did google how to do it, I found one solution online
https://www.metagento.com/blog/magento-2-disable-newsletter-subscription-success-email

https://github.com/metagento/magento-2-disable-newsletter-success-email

however I don't know why I can't install, I did check the module status, it not showing in the list. even I follow from their website, still no success.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

can anyone tell me how to get this thing install?

thanks


texts: Magento 2.4.2: How to add Canadian flag and a phrase in the footer?

texts: Somewhere in the footer we need a small Canada flag and the phrase "We ship to Canada". We are doing this because we decided to ship our products to Canada too besides within USA. Please share links to some Magento documentation explaining how template overriding is done.


texts: Magento 2: "Memory limit has been reached" when resizing images

texts:
After migrating from Magento 1.7.0.2 to Magento 2.1.7 I needed to resize images. I did with

php_cli bin/magento catalog:images:resize

That throws an exception "Memory limit has been reached" after a while. Studying the web I found that GD2.php is responsible for image manipulation. And I found a hint, that in earlier versions of Magento there was a problem with PHP-cli limit set to -1. But that seem to be fixed in GD2.php of Magento 2.

But where comes the error in Magento 2 from? Can someone explain that to me?

Thank you


texts: Error after creating boolean attribute magento2

texts:
I have created a boolean attribute using below code.

  $setup = $this->_objectManager->get('Magento\Framework\Setup  \ModuleDataSetupInterface');
        $eav_setup_factory = $this->_objectManager->get('Magento\Eav\Setup\EavSetupFactory');
        $setup->startSetup();
        $eavSetup = $eav_setup_factory->create(['setup' => $setup]);
        $AttributeCode = "test_attribute";
        $AttributeName = "Test Attribute";
        $type = 'int';
        $input_type = 'boolean';

            $eavSetup->addAttribute(
                 \Magento\Catalog\Model\Product::ENTITY,
                 $AttributeCode,
                 [
                     'type' => $type,
                     'backend' => '',
                     'frontend' => $AttributeName,
                     'label' => $AttributeName,
                     'input' => $input_type,
                     'class' => '',
                     'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
                     'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                     'visible' => true,
                     'required' => false,
                     'user_defined' => true,
                     'default' => '0',
                     'searchable' => false,
                     'filterable' => false,
                     'comparable' => false,
                     'visible_on_front' => true,
                     'used_in_product_listing' => true,
                     'unique' => false,
                     'apply_to' => ''
                 ]
            );

Attribute created but when try to open I am getting this error.

Class "Test Attribute" does not exist.

can anyone look into this issue and update me please.

I need to create Yes/No attribute for product.


texts:
I'm trying to get quote but It return me empty(null).

I'm trying to get this is addToCart.phtml file where it returns empty.
and i tried at Magento_Checkout where it works pretty great.

Dont know what's wrong below:

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

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

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

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

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

Any Help would be appreciated.


texts: How can I change the default product images sizes on Magento 2?

texts:
In magento 1.x.x, we could change default thumbnail images in admin :

System > Configuration > Catalog

But in magento 2.0, how can I change theses value I can not seem to find any configs to allow this? The problem is that my product images are displaying with large white stripes and I would like to prevent this.


texts:
Im new to this whole Magento stuff and was wondering, we have had a few issues of where a customer clicks a product twice and it buy two of the same product, is there a way of bringing a pop up saying you have two items in the cart the same?

Any suggestions would be very helpful


texts: Magento update GST value from 10.0000% to 10% on sales invoice PDF

texts:
I've been trying to update this GST value from 10.0000% to 10% from the invoice pdf. I couldn't find it on script. I wanted to know if there is a way to update this or to rewrite the module who handle the GST value.
The attached image  is the print button in sales invoice from Admin area.

Hope that anyone could experienced this before.


texts: Where is address formatting set in the back end applied?

texts:
I've installed the very helpful EA Design Free Invoice PDF extension and it's working a treat - except for one area.

The variables used in the editor are drawn from the backend, which means that

The locale is taken from the backend setting, which means that I - working in English on a Japanese storefront - get the wrong language for country and region in addresses, and the wrong names for the payment method.
The formatting set up in System>Config is ignored

I think I've tracked the fetching of the addresses down to the following bit of code deep in the Models folder

public function getTheAddresInfo()
{
    $order = $this->getOrder();
    $billingInfo = $order->getBillingAddress()->getFormated(true);
    if ($order->getShippingAddress()) {
        $shippingInfo = $order->getShippingAddress()->getFormated(true);
    } else {
        $shippingInfo = '';
    }
    $variables = array(
        'billing_address' => array(
            'value' => $billingInfo,
            'label' => Mage::helper('sales')->__('Billing Address'),
        ),
        'shipping_address' => array(
            'value' => $shippingInfo,
            'label' => Mage::helper('sales')->__('Shipping Address'),
        )
    );

The only other model I've found with similar content is in app/code/core/Mage/Customer/Model/Address/Abstract.php

/**
 * @deprecated for public function format
 */
public function getFormated($html=false)
{
    return $this->format($html ? 'html' : 'text');
    //Mage::getModel('directory/country')->load($this->getCountryId())->formatAddress($this, $html);
}

public function format($type)
{
    if(!($formatType = $this->getConfig()->getFormatByCode($type))
        || !$formatType->getRenderer()) {
        return null;
    }
    Mage::dispatchEvent('customer_address_format', array('type' => $formatType, 'address' => $this));
    return $formatType->getRenderer()->render($this);
}

/**
 * Retrive address config object
 *
 * @return Mage_Customer_Model_Address_Config
 */
public function getConfig()
{
    return Mage::getSingleton('customer/address_config');
}

This looks like the sort of thing I should introduce to the shipping/billing address variables to get them to come out in the defined HTML format, but I can't quite tie the ends together. Any pointers?


texts:
I have large store in Magento 2 with 1000+ attributes. So it's take very long time to reindex all data.

So I want to know that which indexer I need to run for which changes.

catalog_category_product                 Category Products
catalog_product_category                 Product Categories
catalog_product_price                    Product Price
catalog_product_attribute                Product EAV
cataloginventory_stock                   Stock
catalogrule_rule                         Catalog Rule Product
catalogrule_product                      Catalog Product Rule
catalogsearch_fulltext                   Catalog Search

Can anyone help me to know that which indexer I need to run for which changes like If i change product stock then I need to run cataloginventory_stock indexer. But I don't know about other indexer.

So anyone give me full description about these indexers?


texts: Bulk import and redirect 301 (over 14K url) in core_url_rewrite or on server

texts: I have to redirect over 14K urls from another system to magento core_url_rewrite. What is the preferred method, to place these urls in database, or to redirect the ursl from .htaccess file ?


texts: Magento 2.3 - How to move menu ( catalog.topnav ) after logo ( header.panel )?

texts: I have created a custom which is inherited from the blank theme, I want to move my menu ( catalog.topnav ) after the logo ( header.panel ) ?


texts:
I'm using Magento 2.0.2, I have this series of errors:

In the Sign in page when I type in a wrong password I get redirected to the same page BUT I didn't see the expected "Invalid login" error message.
After I log in, the top menu bar didn't update with the name of the customer and if I had items in my cart from previous sessions I didn't see the the amount in the little orange square to the right of the icon cart.
If I add a product to the cart, then I get the message telling "You added xxx to your shopping cart" and ALSO I get the previous "Invalid login" error message. Additionally I get the items from previous sessions. BUT if I click on the cart icon and click on "Go to checkout" button I get the login popup...
Then, if I go back to my dashboard, now the top menu bar shows the name of the customer and also I can go normally to the checkout process.

Any ideas? Thanks!


texts: Assign products to a category that are not assigned to any category

texts: Is there any way to assign products to a category that are not assigned to any category? I have around 1000 products that are not assigned to any category so I would like to assign them to one single category.


texts: Magento2: Insert and update operation in custom module Admin-side(through Admin panel)

texts:
I have create a database-table.

I displayed(grid view with toolbar) the table-records in Admin-pannel.

Now I need to know the Insert,Updata and Delete process through admin-side process.Please Give any sample code's or Link...


texts: How to import product images in bulk into Magento 2?

texts:
I'm moving my store from ver 1.7.2 to 2.0.2.

Since I have less than 200 products I will export/import them using CSV files, however I'd like to know how to import product images.


texts: How to add new column to sales_flat_order_grid with default value

texts:
I used following method and it's working fine for me.

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

 $installer->addAttribute("order", "barcode", array("type"=>"varchar","default"=>"N/A"));
 $installer->addAttribute("quote", "barcode", array("type"=>"varchar","default"=>"N/A"));

 $installer->endSetup();
 ?>

But How I can achieve it with following method ?

 <?php
 $installer = $this;
 $installer->startSetup();
 $installer->run("ALTER TABLE  sales_flat_order ADD COLUMN barcode  VARCHAR(255) NOT NULL;");
 $installer->run("ALTER TABLE  sales_flat_order_grid ADD COLUMN barcode  VARCHAR(255) NOT NULL;");
 $installer->run("ALTER TABLE  sales_flat_quote ADD COLUMN barcode  VARCHAR(255) NOT NULL;");

 $installer->endSetup();
 ?>


texts: Magento 2 - How to know which .less file I have to change and what I have to change

texts:
I want to change the background color of a certain button in the customer area.
It is the "Compare Product" Button at the left sidebar.

How do I know which .less file I have to change?

The selector is .actions-toolbar .primary

        Vergleichen

            Alles löschen

Normally I would just override styles-l.css or styles-m.css and make my change. But I heard that these files are generated by .less files, so this would be stupid.


texts: When adding simple product in cart getting the customer-data.js

texts:
Error: {"message":"The product that was requested doesn&#039;t exist. Verify the product and try again."}

When adding the product to the cart getting this what is the purpose and how can we rectify it. We didn't customize any customer data. Also done run the command

php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile
php bin/magento indexer:reset
php bin/magento indexer:reindex


texts: Magento2 - duplicate quote item to new row and new price

texts:
Is it possible to add the same product (with same configurable options) with different price based on some custom values present in the product page to the shopping cart, but have it appear as different line items?

Steps I want to follow :

Add product A with configurable option C, Qty=1
Add product A with configurable option C, Custom Value = 20, Qty=1

Both above mentioned quote item should be in different row. Currently it is updating Qty to 2 and adding my Custom Value = 20 to same quote item.

I am using event checkout_cart_product_add_after And below is the code of my observer. Please suggest what should i do to achieve required result.

namespace Ids\SizeCalculator\Observer;

use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\App\ObjectManager;

class CheckoutCartAddObserver implements ObserverInterface {

protected $_layout;
protected $_storeManager;
protected $_request;
private $serializer;
public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\View\LayoutInterface $layout, \Magento\Framework\App\RequestInterface $request, Json $serializer = null
) {
    $this->_layout = $layout;
    $this->_storeManager = $storeManager;
    $this->_request = $request;
    $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
}

public function execute(EventObserver $observer) {
    $item = $observer->getQuoteItem();
    $additionalOptions = array();

    if ($additionalOption = $item->getOptionByCode('additional_options')) {
        $additionalOptions = (array) $this->serializer->unserialize($additionalOption->getValue());
    }

    $post = $this->_request->getPost();

    if (isset($post['sc_custom_length']) && $post['sc_custom_length'] > 0) {
        $additionalOptions[] = [
            'label' => 'Length',
            'value' => $post['sc_custom_length'] . " " . $post['sc_custom_unit']
        ];

        if (isset($post['sc_custom_width']) && $post['sc_custom_width'] > 0) {
            $additionalOptions[] = [
                'label' => 'Width',
                'value' => $post['sc_custom_width'] . " " . $post['sc_custom_unit']
            ];
        }

        if (count($additionalOptions) > 0) {
            $item->addOption(array(
                'product_id' => $item->getProductId(),
                'code' => 'additional_options',
                'value' => $this->serializer->serialize($additionalOptions)
            ));
        }
    }

    /* Set custom price */
    if (isset($post['sc_custom_price']) && $post['sc_custom_price'] > 0) {
        $item->setCustomPrice($post['sc_custom_price']);
        $item->setOriginalCustomPrice($post['sc_custom_price']);
        $item->getProduct()->setIsSuperMode(true);
    }
}
}


texts: 404 error when trying to change configuration locale options

texts: I keep getting a 404 error after updating stores/configuration anyone have any ideas? I have no idea where to start with this one as i'm new to hosting and magento.


texts: ios Safari - Click on level 0 category menu would cause the background page shifted up unexpectedly

texts:
I found an issue that occurs with iphone and iMac using Safari, running on Magento v2.3.1

Steps to reproduce the problem:

1. Visit webpage with iPhone/iMac with Safari browser
2. Tap on Responsive Menu
3. Responsive Menu Opens
4. Tap on Category (i.e "How to buy" in my case), the background page shifted up unexpectedly (see the second screenshot attached below, yellow bordered)
(expected result: the background page should remain as top position)

Any clue to fix this problem? thanks.


texts: Magento 2 coupon code : DIscount maximum up to x amount

texts:
i want to create coupon code in magneto something like below
1:discount 1% of sub-total up to a maximum of Rs. 300

i can not find any such way to do via magento backend


texts: How to make a copy of my magento site to my computer

texts:
I am making a copy of our Magento website using FTP file transfer. My goal is to set a copy of the website and start making changes offline and start using git to keep the site backed up and updated.

I am looking for direction on how to complete this task correctly and successfully.

Any help is greatly appreciated.