texts: Error after installing patch 7405 on Magento 1.4.0.1

texts:
The Magento patch 7405 adds a function to app/code/core/Mage/Adminhtml/Helper/Sales.php that is as follows:

/**
 * Escape string preserving links
 *
 * @param array|string $data
 * @param null|array $allowedTags
 * @return string
 */
public function escapeHtmlWithLinks($data, $allowedTags = null)
{
    if (!empty($data) && is_array($allowedTags) && in_array('a', $allowedTags)) {
        $links = [];
        $i = 1;
        $regexp = "/]*href\s*?=\s*?([\"\']??)([^\" >]*?)\\1[^>]*>(.*)<\/a>/siU";
        while (preg_match($regexp, $data, $matches)) {
            //Revert the sprintf escaping
            $url = str_replace('%%', '%', $matches[2]);
            $text = str_replace('%%', '%', $matches[3]);
            //Check for an valid url
            if ($url) {
                $urlScheme = strtolower(parse_url($url, PHP_URL_SCHEME));
                if ($urlScheme !== 'http' && $urlScheme !== 'https') {
                    $url = null;
                }
            }
            //Use hash tag as fallback
            if (!$url) {
                $url = '#';
            }
            //Recreate a minimalistic secure a tag
            $links[] = sprintf(
                '%s',
                htmlspecialchars($url, ENT_QUOTES, 'UTF-8', false),
                parent::escapeHtml($text)
            );
            $data = str_replace($matches[0], '%' . $i . '$s', $data);
            ++$i;
        }
        $data = parent::escapeHtml($data, $allowedTags);
        return vsprintf($data, $links);
    }
    return parent::escapeHtml($data, $allowedTags);
}

However, when trying to view an order, I'm getting a fatal error because the parent class does not have an escapeHtml() function. Here's the error:

Call to undefined method Mage_Core_Helper_Abstract::escapeHtml()

It seems the htmlEscape() may be what we need, but I haven't tried it yet.


texts:
If there are several errors, please specify all. Thank you

<?xml version="1.0" ?>
    <config>
        <modules>
            <RunwaySale_Merchandiser>
                <version>0.0.1</version>
            </RunwaySale_Merchandiser>
        </modules>
        <frontend>
            <routers>
                <merch>
                    <use>standard</use>
                    <args>
                        <module>RunwaySale_Merchandiser</module>
                        <frontName>merch</frontName>
                    </args>
                </merch>
            </routers>
        </frontend>
        <admin>
            <routers>
                <admin1112>
                    <use>admin</use>
                    <args>
                        <module>RunwaySale_Merchandiser</module>
                        <frontName>admin1112</frontName>
                    </args>
                </admin1112>
            </routers>
        </admin>
        <global>
            <blocks>
                <merch>
                    <class>RunwaySale_Merchandiser_Block</class>
                </merch>
                <adminhtml>
                    <rewrite>
                        <catalog_category_tree>RunwaySale_Merchandiser_Block_Adminhtml_Catalog_Category_Tree</catalog_category_tree>
                    </rewrite>
                </adminhtml>
            </blocks>
            <helpers>
                <runwaysalemerchandiser>
                    <class>RunwaySale_Merchandiser_Helper</class>
                </runwaysalemerchandiser>
            </helpers>
        </global>
        <adminhtml>
            <menu>
                <runwaysalemerchandiser module="runwaysalemerchandiser">
                    <title>runwaysalemerchandiser</title>
                    <sort_order>1</sort_order>
                    <action>admin1112/adminhtml_merch</action>
                </runwaysalemerchandiser>
            </menu>
            <layout>
                <updates>
                    <merch>
                        <file>runwaysale.xml</file>
                    </merch>
                </updates>
            </layout>
        </adminhtml>
    </config>

  controllers/Adminhtml/MerchController.php

class RunwaySale_Merchandiser_Adminhtml_MerchController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

  app/design/adminhtml/default/default/layout/runwaysale.xml

<?xml version="1.0" ?>
    <layout version="0.1.0">
    <admin1112_merch_index>
        <reference name="content">
            <block type="merch/adminhtml" name="runwaysale" template="index.phtml" />
        </reference>
    </admin1112_merch_index>
    </layout>

Path template:

  app/design/adminhtml/default/default/template/runwaysale/index.phtml


texts: Magento 2 data migration Destination documents are not mapped: TABLE 346

texts:
I'm doing data migration from magento 1 to magento 2 and it gives this error, can you please let me know the solution for this error

[2017-11-15 07:45:45][ERROR]: Destination documents are not mapped: TABLE 346,TABLE 347,TABLE 348,TABLE 359,TABLE 360

Thanks


texts:
Magento's SpecialToDate does not include a time stamp so any deal runs until midnight.

What I would like to do is to be able to set the time as well as the date.

I was thinking of changing the SpecialToDate date attribute to a text filed, would this work?

my second option is "If the special price didn't recognize the time" where would I hard code a new atttribute(.html) that the special Price uses to check the date?


texts: Magento Multi store with Multi language and Multi currency

texts:
I want to configure website for multi country – multi currency.

e.g. For USA /Canada , I want to set Select country – USA , Currency should auto switch to $ from base currency.

But product should should be limited compared to base website. Means limited products for country. How to configure please guide me..

Thanks in advance.


texts: Magento 2 : How to set images to product from a custom folder (Not to use pub/media folder) programmatically

texts:
There is a custom folder "productimages" in root path "localhost/magento/productimages". In this folder "productimages", there are lots of images. I want to save that images in products using object manager. So is there any way to do it ?

<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
use \Magento\Framework\App\Bootstrap;
include('app/bootstrap.php');
$bootstraps = Bootstrap::create(BP, $_SERVER);
$object_Manager = $bootstraps->getObjectManager();
$fileSystem = $object_Manager->create('\Magento\Framework\Filesystem');
$mediaPath = $fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath();

$state = $object_Manager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
$product_id = 19;
$product = $object_Manager->get('Magento\Catalog\Model\Product')->load($product_id);
$productRepository = $object_Manager->create('Magento\Catalog\Api\ProductRepositoryInterface');

$image =  $mediaPath.'imagiing.jpg';

$attributeImage = array('image', 'small_image', 'thumbnail');
// $productRepository->save($product);

$product->addImageToMediaGallery($image, $attributeImage, false, false);
$product->save();

Given code works only with the "pub/media" folder.

Any help will be appreciated...

Thank you.


texts: How to use template file for grid column renderer in magento?

texts:
If I have a method in my renderer class:

public function render(Varien_Object $row)
{
    $rowValue = $row->getData($this->getColumn()->getIndex());
    $data = unserialize($rowValue);

    $result = '';

    if (is_array($data) && count($data) > 0) {
        foreach ($data as $orderItemData) {
            $result .= $orderItemData['name'] . ' </br>';
        }
    }
    return $result;
}

How can I render a template file here and return it?


texts: How can I overwrite a layout file from admin? I am able to change template files but not layout files. I want to add in head jQuery because right now it is added after prototype and I have problems when merging js. I just want to add in main.xml from adminhtml to load first jQuery. I don't want to change directly in the default theme.


texts: Is there a performance loss with the improved layered navigation extension

texts:
I wanted to find out if the improved layered navigation extension significant reduces the loading speed of a shop. I have tested it in two local shops and had the extension installed in one of them.

For testing purposes i used the Magento sample data they provide. The problem is, there are only 120 products in this data sample. The performance loss was around 2% to 5%, which I thought was okay.

My question now is, if the performance reduces more if more products are in the shop-database.
Has anyone benchmarked this extension already?


texts: Magento & fputcsv strange empty row at beginning of file

texts:
I'm writing some info to a .csv file in Magento:

public function batch_update_attributeAction(){
    $attribute_id = $_GET['attribute_id'];
    $table_name = $_GET['table_name'];
    $input = $_GET['input'];
    $input = explode(';', $input);
    $connection = Mage::getModel('core/resource')->getConnection('core_read');
    #$connection_write = Mage::getModel('core/resource')->getConnection('core_write');
    $csv_array = array();
    array_push($csv_array, array('entity_id', 'name', 'previous_value', 'updated_value'));
    foreach ($input as $part){
        $parts = explode(",", $part);
        $entity_id = $parts[0];
        $value = $parts[1];
        $sql = 'SELECT `value` FROM ' . $table_name . ' WHERE `entity_id` = ? AND `attribute_id` = ?';
        $current_value = $connection->fetchOne($sql, array($entity_id, $attribute_id));
        $sql = 'SELECT `value` FROM `catalog_product_entity_varchar` WHERE `entity_id` = ? AND `attribute_id` = ?';
        $name = $connection->fetchOne($sql, array($entity_id, 56));
        array_push($csv_array, array($entity_id, $name, $current_value, $value));
        #echo "UPDATE `$table_name` SET `value` = $value WHERE `entity_id` = $entity_id AND `attribute_id` = $attribute_id<br/>";
    }
    $user = Mage::getSingleton('admin/session')->getUser()->getFirstname();
    $date = Mage::getModel('core/date')->timestamp(time());
    $date = date('Y-m-d', $date);
    header('Content-Type: application/csv');
    header('Content-Disposition: attachement; filename="$date $table_name update $user.csv";');
    $f = fopen('php://output', 'w');
    foreach ($csv_array as $line) {
        fputcsv($f, $line, ",");
    }
}

Other than the empty starting row, everything is perfect.

Interestingly enough, if I run this outside of the Magento code pool, i.e from a root script, it functions perfectly. Any input would be appreciated.


texts:
Magento 2.2.6

Have the main directory / and subdirectories like /germany, /france/, /poland etc.

each subdirectory has index.php file like:

<?php
/**
 * Application entry point
 *
 * Example - run a particular store or website:
 * --------------------------------------------
 * require __DIR__ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 * \/** @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

try {
    require __DIR__ . '/../app/bootstrap.php';
} catch (\Exception $e) {
    echo <<getMessage()}

HTML;
    exit(1);
}

$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'us';
$params['GEO_REGION'] = 'germany';

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

when I load http://site.lo/germany get normal result, but all static loads from:

http://site.lo/germany/media/image1.png
http://site.lo/germany/static/frontend/Theme/image12.png

etc

I also tried to add

$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [
    DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
    DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
    DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
    DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
];

but have no success.

I use nginx server. Maybe I can there adjust something?

Can give some help or advise? Thanks!


texts: Importing Customer Record via Customer ID

texts:
I'm working on a project at the moment and the client requires the import/export of customer records to/from their CRM. I've imported a fair few successfully however I've found something else that I might need help with.

The client said that they regularly change the email address assigned to customer records, so we will need to import those changes, however as far as I know, the only unique identifier for customer imports is the email address (there's no 'customer_id' or 'entity_id' columns present in the customer main file CSV export). As such, if the client were to change an email address and we imported an updated customer list, new customer will be created instead of updating the email address of existing ones.

Is there anything that I could use to overcome this issue? If we could import by the Customer ID, that would solve all issues, but as far as I'm aware, core Magento doesn't allow this?

Many thanks,
Joe


texts: import products csv file fails with 'Specified URL key already exists in row(s)' error

texts: I have the following error "Specified URL key already exists in row(s): 99, 124, 179, 190, 194, 222, 271, 297, 326, 328, 329, 332".  When I tried to import some 338 simple products with created categories into my local Magento 2.1.8 CE website. But the url_key column in my products csv file is empty.


texts: hide the text field and display the message for Delivery checking

texts:
please visit this link : http://hotwheelstoys.in/mobileapp2/funny-pets-wonder-teddy-1802.html

there is an option to enter the zip code and check there is

"delivery available or not to that zip code".

once we entered the zip code and click on  "check" button, it will display

the paticular message below the text field.

but once we entered the pin code and clickon "check" button, i want to hide the text field and want to display the message as like

: http://www.flipkart.com/peacock-basic-architect/p/itmdzdt44rzemzjf?pid=BLCDCYYHKPY9UVMG&ref=L%3A7578364719676933414&srno=p_1&query=peacock&otracker=from-search

we are using this code : http://pastebin.com/t6y6vyQe

please help me to find solution

thanks in advance


texts: 2 values are displaying when we try to edit textfield

texts:
we are using following code for quantity :

$selllermpassignproduct=Mage::getModel('mpassignproduct/mpassignproduct')->getAssignProDetails($products->getId());
//Zend_Debug::dump($selllermpassignproduct,null,true);
$stock_item=Mage::getModel('cataloginventory/stock_item')->loadByProduct($products);

$SellerQty=isset($selllermpassignproduct['sellerqty'])?$selllermpassignproduct['sellerqty']:$stock_item->getQty();
$assignqty=isset($selllermpassignproduct['assignqty'])?$selllermpassignproduct['assignqty']:0;
?>

<span id="valueqty_<?php echo $products->getId(); ?>"><?php //echo (int) $SellerQty; ?>
<input type = "text" id = "qty_<?php echo $products->getId(); ?>" onkeydown="validateNumbers(event)" name = "stock" class="ama1" value = "<?php echo (int) $SellerQty; ?>" />

<span class="label wk_action" id="edit_link_<?php echo $products->getId(); ?>">

<p id="updatedqty_<?php echo $products->getId(); ?>" style = "display:none;color:red;">Updated

<button id="update_button_<?php echo $products->getId(); ?>" class="buttons" onclick="updateField('<?php echo $products->getId(); ?>',<?php echo $assignqty;?>); return false;" style="display:none" >
<?php echo $helper->__('Update') ?>
</button>

<button id="reset_button_<?php echo $products->getId(); ?>" type="reset" class="cancel" onclick="hideReset('<?php echo $products->getId(); ?>'); return false;"  >
<?php echo $helper->__('Cancel') ?>
</button>

when we click on update button is displaying like this :

you can see 2 values , i want to remove the value which is present above.


texts: Custom Module custom block not loading the template in magento 2 admin

texts:
In the layout file the desired feature should be to call my custom Block but if I do that then the template doesn't load. You can check the line commented in the below layout file. The other line which does load the template is unable to communicate with the custom Block.

Could someone please help me with what I have done wrong it would be a great help. Also if any other code be required to provide please comment I will update the question.

The layout file    /app/code/Synlogics/PushNotification/view/adminhtml/layout

<?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">
        <head>
            <title>
                Push Notification - Configuration
            </title>
        </head>
        <body>
            <referenceContainer name="content">
                <!--<block class="Synlogics\PushNotification\Block\PushNotification" name="pushnotification_index_index" template="Synlogics_PushNotification::config.phtml"/>-->
                <block class="Magento\Backend\Block\Template" template="Synlogics_PushNotification::config.phtml"/>
            </referenceContainer>
        </body>
    </page>

the template file /app/code/Synlogics/PushNotification/view/adminhtml/templates

<?php
$collection = $block->getApiDetailsCollection();
//echo $collection[0]->getAndroidApiKey();
?>

the controller /app/code/Synlogics/PushNotification/Controller/Adminhtml/Index

<?php
namespace Synlogics\PushNotification\Controller\Adminhtml\Index;
class Config extends \Magento\Backend\App\Action{
    /**
    * @var \Magento\Framework\View\Result\PageFactory
    */
    protected $resultPageFactory;

    /**
     * Constructor
     *
     * @param \Magento\Backend\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
    }

    /**
     * Load the page defined in view/adminhtml/layout/notification_index_config.xml
     *
     * @return \Magento\Framework\View\Result\Page
     */
    public function execute() {

        return  $resultPage = $this->resultPageFactory->create();
    }
}

the block file /app/code/Synlogics/PushNotification/Block

<?php
namespace Synlogics\PushNotification\Block;

use Magento\Framework\View\Element\Template\Context;
use Synlogics\PushNotification\Model\Data;
use Magento\Framework\View\Element\Template;

class PushNotification extends Template
{
    protected $model;

    public function __construct(Context $context, Data $model)
    {
        $this->model = $model;
        parent::__construct($context);
    }

    public function getApiDetailsCollection() {
        $loadmodel =  $model->load(1);
        $apiCollection = $loadmodel->getCollection()->getData();
        return $apiCollection;
    }
}


texts: Magento2: How to check record before save record in table?

texts:
I am adding the barcode with product SKU and product ID in a table using below code:-

File Path: /app/code/[NameSpace]/[ModuleName]/Model/ResourceModel/Custom.php

public function generateBarcodes($object, $attribute, $barcode, $_product)
    {

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $barcodeModel = $objectManager->create('Vendor\Module\Model\Barcode');

        $data = array(
            'barcode' => $barcode,
            'product_id' => $_product->getId(),
            'qty' => 1,
            'product_sku' => $_product->getSku(),
            'supplier_code' => '',
            'history_id' => 0000
        );

        $barcodeModel->setData($data);
        $barcodeModel->save();
    }

but I want to stop duplicate record in table, Please let me know how to achieve this in above code.

My table structure:-


texts: Expand admin catalogue product block (`admin__collapsible-block-wrapper`) by default

texts:
I want to expand by default some of the blocks present on the product detail page in the admin part like Product Reviews or Images And Videos.
I see that some of the HTML attribute are changed when I expand the block. Before:

After:

I used grep to find in the source code for some help, but didn't find the file to edit to make it shows by default.
Thanks in advance


texts: Rebuild Index taking forever and not getting completed

texts:
I am trying to rebuild Indexes but it takes forever and does not complete the process. It gets stuck at Product Flat Data with a message PROCESSING with no other error log or message. I have tried cleaning up log and other DB tables as maintenance and optimization but did not help at all. We are on VPS with over 30000 SKUs. Please kindly look into below screenshot and do let me know if there are other options to fix this issue. I have already tried all the suggested option on various Forums.

Command: php indexer.php --status

[thestati@server shell]$ php indexer.php --status
Product Attributes:            Pending
Product Prices:                Pending
Catalog URL Rewrites:          Running
Product Flat Data:             Running
Category Flat Data:            Require Reindex
Category Products:             Require Reindex
Catalog Search Index:          Require Reindex
Stock Status:                  Pending
Tag Aggregation Data:          Require Reindex
Default Values:                Pending

Command: php indexer.php --reindex catalog_category_flat
[thestati@server shell]$ php indexer.php --reindex catalog_category_flat
I am getting following error:

PS: There is no table called catalog_category_flat_store_1 in the DB though I have catalog_category_flat_store_2 and catalog_category_flat_store_3.

SET FOREIGN_KEY_CHECKS=0;# MySQL returned an empty result set (i.e. zero rows). TRUNCATE TABLE catalog_product_flat_1;# MySQL returned an empty result set (i.e. zero rows). SET FOREIGN_KEY_CHECKS=1;# MySQL returned an empty result set (i.e. zero rows).

Category Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'thestati_magento.catalog_category_flat_store_1' (errno: -1)' in /home/thestati/public_html/catalog/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/thestati/public_html/catalog/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/thestati/public_html/catalog/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/thestati/public_html/catalog/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/thestati/public_html/catalog/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/thestati/public_html/catalog/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#5 /home/thestati/public_html/catalog/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#6 /home/thestati/public_html/catalog/lib/Varien/Db/Adapter/Pdo/Mysql.php(2039): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#7 /home/thestati/public_html/catalog/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(604): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))
#8 /home/thestati/public_html/catalog/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1418): Mage_Catalog_Model_Resource_Category_Flat->_createTable('1')
#9 /home/thestati/public_html/catalog/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1431): Mage_Catalog_Model_Resource_Category_Flat->_createTables()
#10 /home/thestati/public_html/catalog/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php(246): Mage_Catalog_Model_Resource_Category_Flat->reindexAll()
#11 /home/thestati/public_html/catalog/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Category_Indexer_Flat->reindexAll()
#12 /home/thestati/public_html/catalog/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#13 /home/thestati/public_html/catalog/shell/indexer.php(159): Mage_Index_Model_Process->reindexEverything()
#14 /home/thestati/public_html/catalog/shell/indexer.php(199): Mage_Shell_Compiler->run()
#15 {main}


texts: How to block cpanel link of my magento site

texts: I had created an ecommerce website named http://example.com. I want to block my cpanel link for users who are accessing my website. Link is example.com/cpanel. If any I.T. specialist user or general user go to my http://example.com/cpanel link then he should go on my homepage link.


texts: Magento Admin Panel turns into Text File

texts:
After I "accidently" changed the Interface Locale in my Magento Admin Panel > Account Setting, the page reloaded and became a text page.

When I tried to change the Interface Locale again, the Save Account Button doesn't work anymore.


texts: Magento2 : Product Updates Not Showing on Front End - store scope issue

texts:
Problem:
Certain product attribute updates are not being seen on the front end. Irrespective of re-indexing, cleaning and flushing the cache, etc.

If I change them via Update Mass Attributes, then that's ok, but not if I update each product individually. The update sticks but is not shown on the front end, nor in the product's Admin grid.

Cause:
Here's what I think has happened. The Magento 1.9 store had two websites, with products shared between both sites/stores. Some attributes (short description, etc) were maintained at a store level, others (SKU, etc) at the default level.

These were migrated to Magento 2.2.4 but then the decision was made to remove the second website. The decision was then to switch to Single Store Mode.

What I think has happened is that certain attributes like short description are now "set" to be udpated at store level scope -  but the Admin and the front end are showing "default" scope values. In Single Store Mode you can't see/change the "store" level attributes. Hence I can't see changes to the short description in the Admin product's grid nor on the front end.

Solution:
Is there a way to force all attributes back to the default store scope?

Any suggestions gratefully rec'd.

Thanks,
Eddie


texts: API call and observer on customer creation

texts:
I want to create an observer when a new customer is registered through the REST API (POST /rest/V1/customers). I have created an observer customer_register_success but it's only been triggered when a registration takes place from the website and not from the API call. Is it the correct behavior?

Should I create an observer for another event like customer_save_after?


texts: Fotorama thumbnail gallery is not smoothly scroll Mobile view in magento 2

texts:
I have change code in given path Themes\Yourtheme\etc\view.xml
Replace:
 <var name="nav">thumbs</var>

To:
 <var name="nav">dots</var>

After cache clean and check-in product view page in mobile and a scroll left to right and right to left of Fotorama thumbnail gallery but not scrolling smoothly.
So please give me any solution


texts: Using --no-tablespace option when backing up Magento 2 databases

texts:
I run a nightly cron job to back-up to backup my SQL databases using mysqldump.
This has started to display the following error on all my databases:
Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

One of the solutions for this is to run the mysqldump using the --no-tablespace option.
Is this a safe practice, and recommended practice, to implement with Magento 2 databases?


texts: Where are stored the group prices on magento database?

texts:
I'm developing a module in backend that displays the 'group prices' of the products, but I don't know where are them stored in the database in order to show them. If anyone has some idea I will appreciate it.

Thanks


texts:
In my site some customers are not able to login valid credentials.

Getting error An unspecified error occurred. Please contact us for assistance.


texts: unable to add css to checkout index page

texts:
i want to add custom css to only checkout index page but it seems not working

tried below steps

1: created css file
/usr/share/nginx/html/app/design/frontend/package_name/theme_name/Magento_Checkout/web/css/checkout.css

2: update code of checkout_index_index.xml
app/design/frontend/colora/colora_home2/Magento_Checkout/layout/override/checkout_index_index.xml

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

    <head>
        <css src="css/checkout.css"  src_type="url" rel="stylesheet" type="text/css"  />
    </head>

still checkout.css is not getting called on URL : checkout/#payment

please let me know what i am missing


texts:
I am trying to use the autocomplete code for N98-MageRun in my OS-X 10.9.2:
https://github.com/netz98/n98-magerun/tree/master/autocompletion/bash

I performed the following steps but without luck:

1> Copied the autocomplete file to home directory

sudo cp ~/autocompletion/bash/bash_complete ~/.n98-magerun.phar

2> Added the following code to the ~/.bash_profile:

if [ -f ~/.n98-magerun.phar ]; then
    . ~/.n98-magerun.phar
fi

Also tried with:

source ~/.n98-magerun.phar

3> Reloaded ~/.bash_profile

source ~/.bash_profile

Unfortunately the autocompletion for magerun command is not working.


texts: Undefined index - get key - on product page

texts:
I keep getting :

Notice: Undefined index: from in /app/design/frontend/default/theme246k/template/catalog/product/view.phtml on line 1
Notice: Undefined index: from in /app/design/frontend/default/theme246k/template/catalog/product/view.phtml on line 196

LINE 1: php if($_GET['from'] == "key") {

LINE 196: php if($_GET['from'] == "key") {

If I remove one of them, the page is broken. If I remove both of them, the page is broken.
What to do?


texts: Can you block Google from crawling filters?

texts:
Is there a way to block Google and other engines from seeing your filtered pages? We get emails talking about how Google is seeing "an extremely high number of URLs" and when I look, it's all the color options and other kinds of sidebar options we have - but it's useless content.

I tried robots.txt and nothing really is being blocked from the testing tools. I added shopby to be be disallowed and it seems to block individual pages but nothing after .com/category/shopby/ (anything else I wanted blocked)

Ideas?


texts: magento2 extends block from class have abstract

texts:
I have lass
<?php
namespace Mageplaza\RateProducts\Block\Frontend;

class FeaturedProduct extends \Magento\Framework\View\Element\Template
{
protected $_productloader;

public function __construct(
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productloader,
    \Magento\Framework\View\Element\Template\Context $context,
    array $data = []
)
{
    $this->_productloader = $productloader;
    parent::__construct($context, $data);
}

public function getProductCollection()
{
    $productCollection = $this->_productloader->create()->addAttributeToSelect('*');
    $productCollection->setPageSize(5)->addFieldToFilter('homepage_featured',1)->setCurPage(1)->load();
    return $productCollection;
}

}
now i want extends class Magento\Catalog\Block\Product\AbstractProduct
<?php

namespace Magento\Catalog\Block\Product;

class AbstractProduct extends \Magento\Framework\View\Element\Template
{
...
}

How can i extends it. I have try write but not working


texts: Magento 2.1: Errors during compilation - Incorrect dependency in class

texts:
On Magento 2.1 when installing an extension, the error occurs when compilation:

Total Errors Count: 1
Errors during compilation:
    Magebuzz\Socialshare\Block\Socialshare
        Incorrect dependency in class Magebuzz\Socialshare\Block\Socialshare in /home/webadmin/public_html/app/code/Magebuzz/Socialshare/Block/Socialshare.php
\Magento\Framework\UrlInterface already exists in context object

Can anyone help?


texts: Which is Magento 2 server good for hosting

texts:
Could you recommend me which is server provide is better for m2 hosting...
Basic Requirement:
SSD: 512 GB
RAM: 32 GB
8core CPU
Dedicated servers
Thanks  in advance


texts: Magento 2 - Skip installing a module during setup:upgrade

texts: Is there a way that not to install a module during setup:upgrade? We have several modules that are not in use but want to keep it in the source such that we can enable it again on-demand.


texts: Override price sorting to use max_price in list view?

texts:
In a category that's only listing grouped products with several associated products each, I'd like the price sorting to use the max_price. Seems like it's using the min_price by default.

Is there an admin option I'm missing, or would I need to go override a model for this?

Thanks!


texts:
In the checkout, I have a select from which the user should choose their address type (commercial or residential) and I want to save this as a comment in the request, however I do not know how I should do to achieve the same.

Select Code:

  Type of address:

        <select class="required-entry" id="commentsEnd" name="commentsEnd" title="<?php echo $this->__('Type of address') ?>" class="validate-select onestep required-entry">
         <option>Select</option>
         <option value="residential">Residential</option>
         <option value="Commercial">Commercial</option>
        </select>

Edit

Note: I can already save comments in the request, which would be the "Benchmarks" field, from the following codes:

Code in file billing.phtml:

<?php echo $this->__('Reference: ') ?>

    <input style="width: 100% !important;" class="input-text required-entry" id="comments" name="comments" title="<?php echo $this->__('
Reference points:') ?>" />

Code in the Observer.php file in the onestepcheckout module:

if (!empty($oscOrderData['comments'])) {

$order = $observer->getEvent()->getOrder();
/* @var $order Mage_Sales_Model_Order */

$order->addStatusHistoryComment($oscOrderData['comments']);
$order->save();
}

Note 2: If I use the same logic, putting the id of the select being comments, I have a problem because one overwrites the other. And if I duplicate this code in Observer.php, putting two of it, but changing the id putting for example address and in the label and the input put the id being address, the same problem occurs, one overwrites the other.

Would it not be possible, for example, to concatenate the two so that they may be saved together?


texts: Why can't I change "Catalog Price Scope" to "Website"

texts:
Using Magento 2.1.5, I am trying to change the Catalog Price Scope option to Website from Global in Stores > Configuration > Catalog > Catalog > Price, but I cannot as it is disabled.

I have got 2 websites, each with one store and one store view.

Can someone help explain why I cannot change this option under the Default Config section for the scope. If I change the scope to anything else, I don't even see the option (which makes sense).


texts:
In my current setup, I don't use all features from Magento 2 and I won't. I already tried to disable the modules that I don't need but disabling just disables the output of the specific module. It does not remove it physically.

To remove modules, I tried to remove them via composer, but each one that I tried ended up in a big mess where nothing was working.

How can I check the dependencies of the Magento modules to wch other? I tried the

Composer show --tree

Command, but that is not analyzable.

To have a concrete example: how can I find the dependencies of the ups module of Magento?


texts:
I have the following XML file sections.xml at the following path:

  Magento2Dir/app/code/vendor/module/etc/frontend/section.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="customproduct/manage/add">
        <section name="cart" />
    </action>
</config>

I have a bit of code on a page which sends the product ids and quantities to a controller which adds the product to the cart (the products do get added to the cart).

This does not update the mini-cart. If I add another product using the method for default products (Standard add to cart) then it works and the mini-cart is updated.

What is the minimum I require for the mini-cart to load changes?

Including via AJAX


texts: Removing sidebar for Catalog_Product_Edit based on role

texts:
We have a module that needs a customized product edit page based on the roles of "Administrator" and "Showcase". The showcase user doesn't need all of the stuff that the full admin has and my supervisor would like it so that they get just one page (w/o sidebar) and limited form options.

Is this possible? Are there tutorials? or even suggestions?

UPDATE
The image on the left is what I need the admin section to look like, the right, what I want the showcase user to look like.


texts: Magento 1.9 End of Life and Paypal, VISA etc?

texts:
i have 2 installation of magento 1.9.4
After the June 30, can we still work with magento 1.9.4? Can we accept payments from Paypal and other Payment getaways?

I know that security patches will not be available but because the cost of migration is big enough i think that it will be great to work with these installations for some months or 1,2 years more.

Does anyone knows about this?


texts:
I have at the moment in catalog.xml
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>

and in view.phtml

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

I have double checked that this product has cross sell products, also I have set indexes (reindex on save) and cache disabled, also tried to reindex and purge cache.

However cross sell products are not showing


texts: Customer address update code is always creating new address

texts:
I am facing a strange behavior in the following code (Magento EE 1.14.2.0). Though it's an update code as it's being loaded by ID, it's always creating a new entries.

$customerId = 123;
$addressId  = 123;

echo '
';
echo 'Loading address::' . $addressId . '
';
$address = Mage::getModel('customer/address');
$address->load($addressId);
$addressData = array (
    'country_id' => 'US',
    'street' =>
        array (
            0 => 'street 1',
            1 => 'street 2',
        ),
    'telephone' => '+1-000000',
    'postcode'  => 'xxx',
    'city'      => 'NY',
    'region'    => 'NY',
    'firstname' => 'John',
    'lastname'  => 'Doe',
);

$address->setData($addressData);
$address->setCustomerId($customerId);
$address->save();
echo '
';
Zend_Debug::dump(
    $address->getData()
);

I checked Customer Address Api & My Account Address section, they are also using the similar code.

Do you guys see any issue with the above code?


texts: Magento2.3: Product is showing as OUT OF STOCK even the product has set to stock

texts:
I have created a simple product and set it as IN STOCK and given 1000 in quantity field. However, when I check the product in front-end, I can see the product is showing out of stock.

Why it is showing like that?

Please share your knowledge to rectify this error.


texts: What is the additional_data column used for in sales_order_item table?

texts: I have noticed that there is a column additional_data in the table sales_order_item. What is the purpose of this column? Can I put some data into it? If I can do that, how can I assure my data will not be overridden by some other module? Has anyone have any knowledge about this column?


texts: How to add subject to custom email template in magento 2

texts:
I am trying to add subject to custom email template with bellow but it is not working.

<!--@ Your Order No {{trans "%order_number" order_number=$data.order_number}} - Order Shipped  @-->

its not working for me while i am getting order_number variables in email template.
anyone can help me regarding this


texts: Show only 1 month old out of stock products

texts:
I'm trying to override the prepareProductCollection to show a list of products which will have all in stock products and one month old out of stock products.

So far I was able to filter out the products as I want to but the pagination is not working correctly.

protected function _getProductCollection()
{
    if (is_null($this->_productCollection)) {
        ...
        // filter product colletion
        foreach ($this->_productCollection as $key => $product ) {

            $date_created       = $product->getCreatedAt();
            $datetime           = new DateTime($date_created);
            $month_created      = $datetime->format('Y-m-d');

            $current_date       = date("Y-m-d");
            $current_time       = new DateTime($current_date);
            $onemonthbuffer     = $current_time->modify('-3 month')->format('Y-m-d');

            if ( !$product->isSaleable() ){
                 if ( ($month_created < $onemonthbuffer) ) {
                    $this->_productCollection->removeItemByKey($key);
                 }
            }
        }
    }

    return $this->_productCollection;
}


texts: Magento 2.1 Checkout 500 (Internal Server Error)

texts:
Magento 2.1 create an order step. (POST /V1/carts/mine/payment-information)

Result:

Array ( [messages] => Array ( [error] => Array ( [0] => Array ( [code] => 500 [message] => Server internal error. See details in report api/630822351214 ) ) ) )

Is the coding wrong?


texts: Smartwave porto cart icon need to change

texts: I have tried to change the code in _mincart_lesss but cart is not changed in website.Any one can help me on this?


texts: How do I check if an order was reordered

texts:
I want to check if an order was reordered, in other words if the reorder button was pressed from adminpanel.

I have the collection of orders:

foreach ($collection as $order) {
     // if $order->checkIfItWasReordered(){
     // do smth
     //}
}

Is there any function or smth to check if an order was reordered ? Thx


texts: When I am deleting files from var folder It is giving error

texts:
I have installed two Magento's at my live server of version 2.1.7 & 2.1.8 When I am deleting some files from /Var folder it is giving me error in my system like bellow

In CMD

[Exception]
  Warning: ltrim() expects parameter 1 to be string, object given in /home/av
  iansrollplug/public_html/alpha/vendor/magento/framework/Code/Generator/Enti
  tyAbstract.php on line 152

On site

RuntimeException: Source class "" for "Magento\Framework\App\Response\Http\Interceptor" generation does not exist. in magento_root/vendor/magento/framework/Code/Generator.php:185

I have deleted the below folders from /var folder

var/Cache
var/generation
var/page_cache
var/tmp
var/view_processed

Why it is happening? When I had deleted it first time in normal way (let it be present in trash) it was working but when I deleted it completely that it should not store any data into trash then it started generating this error

Please If any one can help into this?Where I need to do changes? I didn't altered anything into the core files of Magento


texts: Magento: Add captcha to custom contact form

texts:
I created a new custom contact form in Magento website, I am trying to add captcha at the end of it.

I have added to app/code/core/Mage/Captcha/etc/config.xml

                <customcontacts>
                    Custom Contact Form
                </customcontacts>

And I added to app/design/frontend/base/default/layout/captcha.xml

    <customcontacts>
    <reference name="customcontacts">
        <block type="core/text_list" name="form.additional.info">
            <block type="captcha/captcha" name="captcha">
                <reference name="head">
                    <action method="addJs"><file>mage/captcha.js</file></action>
                </reference>
                <action method="setFormId"><formId>customcontacts</formId></action>
                <action method="setImgWidth"><width>230</width></action>
                <action method="setImgHeight"><width>50</width></action>
            </block>
        </block>
    </reference>
</customcontacts>

And I added to my form this code:


texts: how to add custom header link and showing items count in magento?

texts: How to add custom header link and showing items count like My wishlist, cart etc.


texts: getting a syntax error when trying to upload to my site

texts:
I cannot upload product images, I cannot upload images in a cms block through the wysiwyg.
I am getting this error:

I went ahead and replaced all of the .js files with the original download files, just in case I had somehow altered one, but this has not helped in the least. Can any body help me find a direction to diagnose where this issue is coming from?


texts:
Installed the latest Magento 2 beta3 release with sample data, and configured Varnish, and enabled Varnish debugging in vcl file. When requesting a page, and refreshing, I see the css, js files, etc... are all cached (showing HIT) but the response headers for the magento pages show:

Referer:http://xxx/magento2/men/tops-men/tees-men.html
    Via:1.1 varnish
    X-Magento-Cache-Control:no-store, no-cache, must-revalidate, max-age=0
    X-Magento-Cache-Debug:MISS
    X-Varnish:1005693536

I have Varnish enabled in the admin panel (Full Page Cache set to "Varnish Caching") and the generated vcl loaded into Varnish.

Is this the expected result for the Magento pages themselves? Should I see a "HIT" for the Magento page in Varnish? Just trying to better understand how it works and how best to configure it.


texts: Magento 2.0.7 Product import inserts duplicate entry of stock item

texts:
I am using the FireGento_FastSimpleImport2  module to import simple products into my store using the command line. This module passes the array to Magento's core import models. I am facing some issues when importing the products.

When I import the products, the import functionality makes duplicate entry instead of updating existing data for the same product in cataloginventory_stock_item if product already exists.
I have explicitly set the behavior of the import as add_update, but when I trace it in the core import model, it is always append.
EDIT
I have traced this issue, strangely, they are not allowing the add_update behavior for products, Magento/ImportExport/Model/Import/Entity/AbstractEntity::getBehavior() metod filters out that behavior.

Note: I am using Magento 2.0.7, and I think the append behavior is the cause of duplicate stock items and URL rewrite error.


texts: How to get Magento Product List using Soap V2 at CodeIgniter?

texts:
If I try with below code,

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Live_stock extends CI_Controller {

    public function index()
    {
        //$this->load->view("live_stock_view");

        $proxy = new SoapClient('www.abc.com/api/v2_soap/?wsdl'); // TODO : change url
        $sessionId = $proxy->login('abc', 'abc123'); // TODO : change login and pwd if necessary
        $result = $proxy->catalogProductList($sessionId);
        var_dump($result);

    }
}

My output :

How to solve my error?


texts: Magento2 - Reorder options inside layered filter

texts:
I'm quite new to Magento so maybe this is a stupid question.

I have some filters set up in the layer navigation, one of them is the size of the products we're selling.

I'd like to know if it's possible to reorder the options inside that size filter because now they are appearing in alphabetic order but I'd like to display them something like: XS-S-M-L-XL. Below image is a screenshot of how they are displaing right now.

I've read a lot of questions and posts but they are only to rearrange the entire filters on the layered navigation, not the options inside them.

Hope I've been clear enough for you to understand. If any further details are needed just let me know!

Thanks in advance.


texts: Slow cart, long query is updating sales_flat_quote

texts:
I'm running magento 1.7.0.2 CE and my cart is really slow. Every time I visit the cart I see this query which takes up to 30sec:

UPDATE sales_flat_quote SET store_id = '7', `created_a

Sorry, mtop doesn't show me more. I hope someone had this also and can help me.


texts: How to pass the value from Module A phtml file to Module B php file

texts:
I want to share one field from Module A to Module B,
I am trying, (Module B)
    $storeid = 'https://mybusiness.googleapis.com/v4/accounts/123456789/locations?filter=storeCode="<?php
            echo $this->getLayout()->createBlock("Zero\Storelocator\Block\Neareststore")->setTemplate("Zero_Storelocator::google_reviews.phtml")->toHtml();
            ?>"';

    $url = 'https://mybusiness.googleapis.com/v4/accounts/'.$accountId.'/locations/'.$storeid.'/reviews';

Logic: I want to get location id based on the store code, store code i am getting from Module A pass to Module B in URL 1 and get location ID using API and pass that location Id to second url
The first step, How to pass my Module A phtml file value to Module B php file,
Any best practice pls suggest?


texts: Custom step between product page and shopping cart

texts:
I need to develop a custom step between the Magento product detail page and the shopping cart. If the user clicks on 'Add to cart' the user should be redirected to a new custom form page to enter his/her birthday first. After submitting the birthday data the product should be added to the shopping cart as normal. The birthday data fields should be saved in the quote- and if the user goes to checkout also in the order-model.

I'm new to Magento development so it would be great if somebody could give me some rough hints or guideline where to start and how to plug in.

Thanks a lot in advance!


texts: How to delete all pages products in form admin

texts:
I have 20k products. And I want to remove all the products via bulk operation in magento admin. But it's only delete the current page products only. Not all of. Can you guys please help us to delete all of them?

Thanks you in advance!


texts: REST API: Setting Item Quantity / Need to Get Current Reserved Quantity of an item

texts:
Working on using the Magento 2.3 Rest API to set the Quantity of an item available based on a separate datastore. I realize that the formula for getting the Total Salable quantity is based on the reserved quantity and the total stock. Because of this we need to add the reserved quantity from Magento into our quantity number that we push via the api.

I've looked over the api documentation a bunch and I have not found a way to get the total reserved quantity of the item. With out adding the total reserved quantity to the quantity that we are seeing to the Rest API we will have a resulting salable quantity lower than what is available for sale.

Has anyone been able to find a way to get the current reserved quantity for the items via the REST API?


texts: How can i add coupon code box on onepage checkout

texts: I need customer can apply coupon code at the stage of checkout. How can i  add coupon code apply box on onepage checkout


texts: Add product in cart with name change programmatically in admin

texts:
I need to add a product in cart with a custom/dynamic name (that I will ask from user), I have tried this by changing product name to "Custom name" and then reverting to original after product is added in cart. But this isn't working, besides the custom product name gets saved in sales_flat_quote_item.

Is there something which I am missing, or if the method is not correct, please let me know the other one.


texts: Magento2 : Move review to seperate place

texts: When I am adding reviews in product page it's showing it in review tab, but I want it in seperate place i.e under the tabs section.How to do it


texts: How to add extra pages to Google Site map

texts:
We have a storelocator module on our Magento store, it works well but it is not being added to the Magento google sitemap.

Is there a way to add to our sitemap which Magento automatically generates?


texts: How can I properly add additional columns to the sales order grid?

texts: Is there a way (or several ways) to add additional columns to the sales order grid which one sees in the admin area?


texts: How to use Paypal "Buy button" concept in magento 2?

texts:
Actually i am looking for a solution on marketplace multi-vendor concept. As in Magento paypal express checkout is default which makes once buyer paid the payment will redirect to the admin paypal account directly.

But my question is how to make multiple account checkout. Actually in our marketplace sellers should add their verified paypal account in payment method place and get it verified like same in ebay and after that once email id got linked if any buyer like to buy a product from him he can buy but the payment should directly goes to the seller paypal account not the admin paypal. And this concept we have tried with parallel checkout and adaptive payment type in paypal but now a days that services not more exist in paypal. So is it possible to do through paypal buy button concept with grant application and is it possible to do a single checkout with multiple sellers products? if "Yes" could someone please explain and help me out.

I have attached some screenshot for better understanding. If still its not clear please tell me i will explain more in detail.

Thanks in advance.


texts:
we need to take charge -

$10 for any subtotal below $50,

$12 for any subtotal below $100,

$15 for any subtotal below $150,

and $150+ is free shipping all the time

And also FedEx

Free shipping and FedEx are working fine but table rate csv has condition above but our requirement is below when we are importing table rate then Table rate $150 is always showing.

Please check screenshot


texts: Buy X and Get a discount off Y (Different SKU)

texts:
I’m trying to implement a rule where a customer can order a Chocolate Éclair for $2 when they buy any other product. I’ve tried all sorts of combinations, with the shopping cart rules and I’ve worked out how to implement the right discount when the Chocolate Éclair SKU is chosen, alongside any other products.

Unfortunately it seems to be showing up when there’s one chocolate éclair in there as well.

Is there anyway you can help me out and show me how to implement this rule please, or even let me know whether it is possible, as this is going to be one of our offers moving forward so I need to ensure that it works this week.

For now i have simply offered the opportunity to get a Chocolate Eclair for $2 with any purchase through an attribute


texts:
I have just created a new module and in controller echo some text so it is showing above the header how i can wrap it under the header as the other module showd:

Following is my Controller code:

 class OptFirst_ReviewMyCompany_ReviewController extends   Mage_Adminhtml_Controller_Action
     {

      public function indexAction()
        {
    // "Fetch" display
        $this->loadLayout();

    // "Inject" into display
    // THe below example will not actualy show anything since the core/template is empty
    $this->_addContent($this->getLayout()->createBlock('core/template'));

    echo "Hello developer...";

    // "Output" display
    $this->renderLayout();
}
}

and Also I want to create a form here that will same data to database how i can do that too


texts: Do simple products need an individual url_key set?

texts:
As we had controversial opinions about this on our project, I'd like to ask the question here for another opinion (or two):

For Magento2, should we set url keys for simple products? Which of the three options is best?

a) use a unique url key for each simple product

b) use the same url key for all simples of one configurable

c) leave the url key empty for simple products

Our setup:

We have one page per configurable in our shop.
all simples of one configurable have the same name

My findings:

Configurables must have a unique url key
It is possible to add the same url key to multiple simple products
If I do not set a url key for a configurable, it is derived from the "name" attribute automatically
It is perfectly fine to set no url key for a simple. The simple product will then have no attribute record for the attribute type "url_key".
M2 does not seem to automatically increment the url key, if the (automatically derived) url key exists already


texts: Create customer with REST API - password does not work

texts:
i'm creating customers with the REST-API and trying to give each customer an initial password.
Problem is, that when the customers try to log on to the shop with their mail-address, loggin in is rejected because of a wrong password.

This is my code for creating customers in C#:

customerLocal.Password = "defaultpassword123!";
customerLocal.TaxVat = String.Empty;
customerLocal.CustomerCategory = "3";
request = new RestRequest("customers", Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddBody(customerLocal);
restClient = new RestApiClient();
restResult = restClient.Execute(request);

after executing, customer is created, but the password isn't accepted when logging in.

I've also tried to encrypt the password with md5:

customerLocal.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("defaultpassword123!", "MD5");

This isn't working too.


texts:
I've been working locally on my iMAC through the native LAMP stack and I'm developing a Magento installation. So far so good, until yesterday, after trying to run an n98-magerun task to clear the cache (unsuccessfully I might add, don't know why thats not working either), it seems that something within the installation went kaput and now when I try to get to the home page of the magento installation, it WILL NOT load. It hangs for about two minutes before finally giving me a "no Data Received" Chrome screen.

My console shows only one thing, which is

i18n-values: Missing value for "primaryParagraph"

Even more confusing is the fact that I can navigate to other known pages within the installation, and I do get to a 404 page, even though those pages should exist.

A quite thorough five hour long search regimen has produced no useable information on the error above, and there doesn't seem to be anything about things that can go wrong with magerun, so I'm completely stumped.

Thoughts, constructive comments, places I may have overlooked, and any other useful info would be extremely appreciated.

Disclaimer: I am not a magento expert, I only started working with it before christmas.


texts: Proceed to checkout redirects to empty cart page

texts:
When I double click on "Proceed to Checkout", it's redirecting me to an empty cart page but the mini-cart still seems to show a product.

If i add an another product, the mini-cart displays only the new products which I have added. I suspect that this error is because of cookie. Is this is a bug in Magento? Please comment with your suggestion.

Version: Magento 2.2.3


texts: Order Review Step before Payment Step in magento one page checkout

texts:
I am looking for customization Magento Onepage checkout.I want order review step before payment step in Magento Onepage checkout.

So on click on the payment step the order should be created (or placed).but review step should be before payment step.

'login', 'billing', 'shipping', 'shipping_method', 'review' , 'payment';

I had gone through many articles on google every where their is code to remove review step and place order from the payment step.

Please give me an idea  how can i achieve this.


texts: How to create a session and share with iframe in magento 2 API

texts:
The username and password will be send from third party service by cURL or something to Magento application. So now we need to create session in Magento application for shared customer details and also this session will be shared with iframe.

Because I am going to load this Magento application in an iframe.


texts: Magento 2.2.5: Warning: getimagesize failed to open stream: No such file or directory

texts:
I'm doing resize image, and there is an issue here:

  1 exception(s):
  Exception #0 (Exception): Warning: getimagesize(C:/xampp/htdocs/magento/pub/media/Aht_BannerSlider/images/slide_1.jpg): failed to open stream: No such file or directory in C:\xampp\htdocs\magento\vendor\magento\framework\Image\Adapter\AbstractAdapter.php on line 304

I've search a lot, and try delete var, delete gerenate, delete public/static ,clear cache, setup:upgrade, even static-content:deploy, but none solution work.
So here is the code:

<?php

namespace Aht\BannerSlider\Helper;

use Magento\Framework\App\Filesystem\DirectoryList;

class Image extends \Magento\Framework\App\Helper\AbstractHelper
{
    /**
     * Custom directory relative to the "media" folder
     */
    const DIRECTORY = 'Aht_BannerSlider/images';

    /**
     * @var \Magento\Framework\Filesystem\Directory\WriteInterface
     */
    protected $_mediaDirectory;

    /**
     * @var \Magento\Framework\Image\Factory
     */
    protected $_imageFactory;

    protected $_storeManager;

    /**
     * @param \Magento\Framework\App\Helper\Context $context
     * @param \Magento\Framework\Filesystem $filesystem
     * @param \Magento\Framework\Image\Factory $imageFactory
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     */
    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\Filesystem $filesystem,
        \Magento\Framework\Image\AdapterFactory $imageFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager
    ) {
        $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
        $this->_imageFactory = $imageFactory;
        $this->_storeManager = $storeManager;
        parent::__construct($context);
    }

    /**
     * First check this file on FS
     *
     * @param string $filename
     * @return bool
     */
    protected function _fileExists($filename)
    {
        if ($this->_mediaDirectory->isFile($filename)) {
            return true;
        }
        return false;
    }

    /**
     * Resize image
     * @return string
     */
    public function resize($image, $width = null, $height = null)
    {
        $mediaFolder = self::DIRECTORY;

        $path = $mediaFolder . '/cache';

        $absolutePath = $this->_mediaDirectory->getAbsolutePath($mediaFolder) .'/'. $image;
        $imageResized = $this->_mediaDirectory->getAbsolutePath($path).'/'. $image;

        if (!$this->_fileExists($path . $image)) {
            $imageFactory = $this->_imageFactory->create();
            $imageFactory->open($absolutePath);
            $imageFactory->constrainOnly(true);
            $imageFactory->keepTransparency(true);
            $imageFactory->keepFrame(true);
            // background Color nhằm không hiển thị khoảng đen sau khi resize.
            $imageFactory->backgroundColor(array(255,255,255));
            $imageFactory->keepAspectRatio(true);
            $imageFactory->resize($width, $height);
            $imageFactory->save($imageResized);
        }

        return $this->_storeManager
                ->getStore()
                ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . $path . $image;
    }
}


texts: How to Export CSV File to Custom Module Table in Magento 2?

texts:
How to add Magento 2 export functionality to your module in Magento 2?

Using this side

  System -> Data Transfer -> Export

Any solution??


texts: Prevent US buyers from checking out in Canadian Dollars (only US dollars)

texts:
My store has two currencies, US dollars and Canadian dollars. Base currency is Canadian dollars, US dollars is just a conversion. But I have an extension which allows customer to checkout in the currency they wish (CAD or USD) and the credit card will be charged in the respective currency.

Is there a way to prevent US buyers from checking out using Canadian dollars ?

Thanks all in advance!


texts:
In my system log I am getting below error. Please help me to resolve it.

  ERR (3): Warning: include(Mage/Searchautocomplete/Model/Processor.php): failed to open stream: No such file or directory  in


texts: Widget "Design Package/Theme" field - How to update?

texts:
There's a dropdown field - "Design Package/Theme" when creating a widget which allows you to select the theme the widget will be applied to. This field is not optional.

Once the widget is created, this field cannot be changed. I now want to apply the widget to a new theme but am unable to do it. Is there any way to do this via the database?

This seems very unintuitive to me, because:

What happens if you want a widget to apply to multiple themes
What happens when you want to change the theme the widget applies to


texts: Magento2: Mirasvit SearchAutocomplete not working with Elasticsearch search engine

texts:
I am facing an issue with Mirasvit SearchAutocomplete Module.

It's working properly with mysql search engine. And it stops working with the Elasticsearch6+ search engine.

Facing this error:  Sorry, something went wrong. You can find out more in the error log in ajax response.

I have debug the code, it seems collection not working properly after activating the Elasticsearch search engine.

Have you guys faced such kind of issue?


texts: How can I change the title of the Contact Page in Magento 2?

texts:
I am facing an issue regarding change Title on contact page in Magento 2.

I have extend the template

app/design/frontend/Mgs/child_theme_name/Magento_Contact/view/froentend/layout/contact_index_index.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <title>Contact Us</title>
</head>
<body>
    <referenceContainer name="content">
        <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml">
            <container name="form.additional.info" label="Form Additional Info"/>
        </block>
    </referenceContainer>
</body>

But Doesn,t seem any success.


texts:
I have to change magento connect manager url sitename.com/downloader to sitename.com/customurl
but don't have a idea how to change it can anyone help me


texts:
I have a Magento store with 4000 products and i'm trying to create an xml file in order to register with a comparison service but i have a small problem. They want me to include in xml an MPN number (Manufacturer part number). For all products in my store I have a product name which is consisted of two or three words, brand name and MPN and i would like to copy the last word to an attribute value with name mpn.
I have some knowledge of SQL but i'm fairly new to Magento.
Magento 1.9.3.1
Any help would be appreciated.


texts: Magento 2 Commerce. What is up with the VersionControl Folders?

texts:
I see a couple of VersionControl folders across Magento source code.

Magento\Framework\Model\ResourceModel\Db\VersionControl
Magento\Customer\Model\ResourceModel\Db\VersionControl
Magento\Eav\Model\Entity\VersionControl etc.

Does anyone have any idea what are the purpose of the clases residing under the VersionControl folder and when|how are they used?


texts: Frequent Css and js changes not reflecting Magento 2 in Windows environment

texts:
I am modifying a module which uses css and js.

  OS : WINDOWS
  Magento Mode : Developer

What I've tried :

php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
deleted cache folder under var/cache
deleted C:\xampp\htdocs\magento2\pub\static ( except .htaccess file)

By doing this all the css and js updates, but I have to do it each time even for minor css changes

In ubuntu, it works fine when I am in developer mode. I opened it private browser, even flushed the browser cache.

Update:  In developer mode on windows environment if we delete all the files form pub/static folder and  than refresh the page it will show the updated css and js .

I have no idea its the only way to work on windows environment  as in Linux in developer mode everything got updated as we refresh the page.

To remove version number from files path
Stores>Configuration>Advanced>Developer>[ Static Files Settings tab] Sign Static Files to NO


texts: Dynamically change the page title in Magento

texts:
I've opened my the 1column.phtml file and I'm trying to capture dynamically the Meta Title of the product using the following snippet:

$this->getLayout()->getBlock('head')->getTitle();

Then I'm trying to put it in the  tags of the same page:

<title><?php $this->getLayout()->getBlock('head')->getTitle(); ?><title>

but no lack...

Any advice?

Thank you


texts:
I am trying to create a quote programmaticaly via

$quote = $this->_quoteFactory->create();
$quote->addProduct($item);

But it does not allow me to add a product that is not in stock: Exception #0 (Magento\Framework\Exception\LocalizedException): This product is out of stock.

How can I bypass this check? I don't need to finish the order.

$stockItem->setIsInStock(true);

is of no use if I am not saving it. And I don't want to save it because it is not supposed to change.


texts:
I have a little problem, I don't know how to solve it. My problem is I want get category id by the page layout selection. For example from admin I have created new layout 'category-like'. just like other layouts, 1-colomn, 2-colomns-with-left-bar .. So now I want get which categories are used this layout. If two categories are used this layout mens, then I need that category id ...Please help me guys..

Update:

At least please tell me, how get page layout name from category id ...


texts: Composer Update Error: magento/product-community-edition 2.1.0 requires php ~5.6.0|7.0.2|~7.0.6

texts:
Trying to do an update to Magento 2.1.0 via composer and getting this weird error.

Php version is 7.04 running on Ubuntu x64

composer require magento/product-community-edition 2.1.0 --no-update

  ./composer.json has been updated

composer update

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

  Problem 1
      - Installation request for magento/product-community-edition 2.1.0 -> satisfiable by magento/product-community-edition[2.1.0].

  - magento/product-community-edition 2.1.0 requires php ~5.6.0|7.0.2|~7.0.6 -> your PHP version (7.0.4) does not satisfy that
  requirement.


texts: How to use ComponentRegistrar::LIBRARY in Magento 2

texts:
We have 4 types of components in Magento 2, as I have been using three of them, but my question is how to use const LIBRARY = 'library'; component.

As name implies, this is something to include third party libraries, but any one can give me an example on how to include a library and use the lib in global application level.

/**#@+
* Different types of components
*/
const MODULE = 'module';
const LIBRARY = 'library';
const THEME = 'theme';
const LANGUAGE = 'language';

I did not find any information about const LIBRARY = 'library'; in the official Magento 2 documentation Register your component.


texts: setting up local environment from private git

texts:
I started a new project and am pretty new to Magento 2.  The person gave me access to there personal git repo with there magento that they use fro production.  They also gave a dump of the database.

When I look at the .gitignore file its is the same as on the magento git repo.  So I dont have a config.php or evn.php or even an auth.json.

When I try to open the magento from the git I get "Autoload error
Vendor autoload is not found. Please run 'composer install' under application root directory."

So then I run composer install, is this really what i should be doing?  The person who gave me access to the git said i was doing it wrong but how get the files that it needs to run then?

I get some errors on plugins, looking for passwords they don't have.  I delete the plugins from the composer lock file.  That gets rid of those errors but then it asks me for the login for repo.magento.com.  I try using my creds for magento but those get rejected.

What are the proper creds for the repo.magento.com? It asks for username and password but is actually the keys it is looking for?

Am i doing this right or is there a better way?


texts: Magento 2 deployment script fro AWS codeDeploy

texts:
I want to create a code deploy deployment plan for Magento 2. Code is on bitbucket repository and I need to know the correct deployment script fro Magento 2 which will deploy the latest changes on the server.

$ git checkout master
$ git fetch --all
$ git reset --hard origin/master

$ php bin/magento maintenance:enable

$ composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader

$ rm -r var/cache/*
$ rm -r var/log/*
$ rm -r var/view_preprocessed/*
$ rm -r pub/static/_requirejs/*
$ rm -r pub/static/adminhtml/*
$ rm -r pub/static/frontend/*
$ rm -r generated/*

$ php bin/magento module:disable -c --all
$ php bin/magento module:enable --all --clear-static-content

$ php bin/magento deploy:mode:set production
$ php bin/magento setup:static-content:deploy -f
$ php -d memory_limit=-1 bin/magento setup:di:compile
$ php bin/magento app:config:import --no-interaction
$ php bin/magento setup:upgrade --keep-generated

$ php bin/magento maintenance:disable

I am using these commands. Is this correct?


texts: Price layered navigation in Magento2 when change the price on the fly

texts:
I am building an extension to change the product price on the fly using some observers, everything is okay and works fine except the price layer navigation on the left side.

In the category page view i am using this observer catalog_product_collection_load_after. But the Price Layer navigation is not working on the new prices. Anyone have a suggestion.

Note: the price is on customer level


texts: magento 2 how to get product (country_of_manufacture) by sku via API

texts:
Here is the script i get the product but the country_of_manufacture is not inside in the product object.

get Product attribute from the

function getProduct ($sku, $token, $ch) {
    $ch = curl_init("http://m23.rayman.com/index.php/rest/V1/products/".$sku);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));

    $result = curl_exec($ch);
    return $result;
}

anyone know how to get the country_of_manufacture via rest api by sku?


texts: Magento 2: Product Repositories, Filter Groups, and `AND`

texts:
I'm trying to use a product repository to fetch a list of products.  I want to fetch based on two filters, combined with an AND criteria, but things don't seem to be working.  Do I not understand how filter groups work?  Or is this a bug that should be reported?

Specifically, (silly example for simplicity's sake) I have a constructor where I inject a filter builder, filter group builder, and a search criteria builder

public function __construct(
    \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
    \Magento\Framework\Api\FilterBuilder $filterBuilder,
    \Magento\Framework\Api\Search\FilterGroupBuilder $filterGroupBuilder
)
{
    $this->searchCriteriaBuilder = $searchCriteriaBuilder;
    $this->filterBuilder         = $filterBuilder;
    $this->filterGroupBuilder    = $filterGroupBuilder;
}

Then, later on in a method, I use the filter builders to build two filters

    $filter1 = $this->filterBuilder->setField('sku')
            ->setValue('24-MB01')
            ->setConditionType('eq')
            ->create();

    $filter2 = $this->filterBuilder->setField('sku')
            ->setValue('WT08-XS-Black')
            ->setConditionType('eq')
            ->create();

Then I use the filter group builder to build a filter group that consists of these two filters

    $filter_group = $this->filterGroupBuilder
        ->addFilter($filter1)
        ->addFilter($filter2)
        ->create();

Then I used a search criteria builder, set the filter group on it

    $criteria = $this->searchCriteriaBuilder
        ->setFilterGroups([$filter_group])
        ->setPageSize(100)
        ->create();
    return $criteria

Finally, when I use this criteria with a product repository (used elsewhere, leaving out constructor and di to avoid confusion)

/* @var Magento\Catalog\Api\ProductRepositoryInterface */
$list = $productRepository->getList($searchCriteria);

The call is succesfull but I get back two products.  i.e. the SKU filter was applied as a OR, not an AND. I'd expect this query to return nothing.

If I dig into the Magento\Catalog\Api\ProductRepository class, and take a look at the collection's select statment

protected function addFilterGroupToCollection(
    \Magento\Framework\Api\Search\FilterGroup $filterGroup,
    Collection $collection
) {
    //...
    if ($fields) {
        $collection->addFieldToFilter($fields);
    }

    //printf lives in my heart forever
    echo($collection->getSelect()->__toString());
    exit;
}

I see the criteria added with an OR

SELECT `e`.*, IF(at_status.value_id > 0, at_status.value, at_status_default.value) AS `status`, IF(at_visibility.value_id > 0, at_visibility.value, at_visibility_default.value) AS `visibility`

FROM `catalog_product_entity` AS `e`

INNER JOIN `catalog_product_entity_int` AS `at_status_default` ON (`at_status_default`.`entity_id` = `e`.`entity_id`) AND (`at_status_default`.`attribute_id` = '94') AND `at_status_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '94') AND (`at_status`.`store_id` = 1)

INNER JOIN `catalog_product_entity_int` AS `at_visibility_default` ON (`at_visibility_default`.`entity_id` = `e`.`entity_id`) AND (`at_visibility_default`.`attribute_id` = '96') AND `at_visibility_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_int` AS `at_visibility` ON (`at_visibility`.`entity_id` = `e`.`entity_id`) AND (`at_visibility`.`attribute_id` = '96') AND (`at_visibility`.`store_id` = 1)

WHERE ((`e`.`sku` = '24-MB01') OR (`e`.`sku` = 'WT08-XS-Black'))

Is this a bug?  Is there a way (short of relying directly on the product collections and ditching the repositories) to make this work?


texts:
I have created a new table 'custom_table' i need to render the values in a custom template.
How to get the values of that table ?


texts: Magento2: Issue with photo in basket for configurable product

texts:
Always, in other magento stores I add only one photo for main configurable product without photo for sizes and work everything as should.

Now when I add in this way (without photo for sizes):

then missing photo in basket:

I need to add in this way to show photo in basket (photo for main and for all sizes).

any solution?


texts: Why my menu isn't displaying in Magento 2?

texts:
Top navigation menu not displaying in my magento. I refreshed cache and made reindexation. I followed many links and made all the possible options provided from the links. Still, it's not showing the menu.
I just have a main menu with a submenu, in the "All stores" already have associated the menu, but even so, the menu is not displayed.


texts:
Would appreciate some advice.

I created the configurable product in the image but it won't allow you to leave the price for the configurable part blank and to just choose the prices for each of the simple products. Is there a way round this please? When the page loads I would like a default item with it's price to be displayed. In the dropdown list I need to have the price for each next to the option and for that price to be displayed when chosen.

I don't understand the way magento works in this respect. It doesn't seem intuitive to me to have an abstract base price whether that be zero as in my example then for the options to be + or - that. Each of my products is not related in price at all but it seemed the obvious choice to make them configurable as they share the same specifiations except width.

Many thanks for any help.


texts: How can i get products from a remote database in real time by filters in Magento 2

texts:
This request is for an auto parts store. The products are filtered by car make, model, year, etc. When a client apply a filter I need to make an API call to manufacturer server, get products and display those products and the client must be able to purchase those products.

Is there any module for this?
I do not know where to begin with this.


texts:
How can I get increment_id on  Magento 2 checkout page?

 >$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   >$quoteId = $objectManager-> create('Magento\Checkout\Model\Session')->getQuoteId();///session user quote_Id

Im using objectManager to get quote_id, is there a solution using the same way?


texts:
I tried these steps, but nothing happened. I got 500 internal server error
https://www.cloudways.com/blog/create-and-configure-multistore-magento-2/

I have 3 domains.

The main is beste.nl. The others are fejie.nl and pacats.nl.

Codes:

beste.nl = beste
fejie.nl = fejie
pacats.nl = pacats

I just copied the index.php of beste.nl and pasted into fejie.nl, and using this following code:

  $params = $_SERVER;
  $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'fejie';
  $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
  $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
  $app = $bootstrap->createApplication('Magento\Framework\App\Http');
  $bootstrap->run($app)

I just copied the .htaccess of beste.nl and pasted into fejie.nl, and using this following code:

  RewriteCond %{HTTP_HOST} ^(.)fejie.nl
  RewriteRule . – [E=MAGE_RUN_CODE:fejie]
  RewriteCond %{HTTP_HOST} ^(.)fejie.nl
  RewriteRule . – [E=MAGE_RUN_TYPE:website


texts: override "List" block but not working (Magento 1.9)

texts:
I have overridden "List" block by following code

    <catalog>
        <rewrite>
            <product_list>NameSpace_ModuleName_Block_Product_List</product_list>
        </rewrite>
    </catalog>

Also I have added "List.php" under the same structure, but product list is not getting displayed.


texts: Single product discount cart price rule not working in magento 2.2.4?

texts:
I have created cart rule for single product, in my cart rule I have added one condition for single brands.
check below screen-shot fore more information.

When We set rule only single product then rule apply all cart products.
Can anyone advise what I did wrong?


texts:
I create a new Magento 2 theme extend Luma. I want to add a css file to rewrite the default Luma style.

I add in the default_head_blocks.xml file:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
  <head>
    <css src="css/custom.css" />
  </head>
</page>

But is not work.

For example I want to replace the search button icon with my image, but custom.css in under the style-l.css. What I can do? I can change the order of the styles?

or what is the best way to change the Luma styles?


texts: Magento 2 REST API checkout payment gateway redirect

texts:
I am creating a Magento 2 store that sells virtual products, this site have its checkout directly at the product page. The customers will never buy more than 1 product at a time.

This checkout uses ajax calls aimed at the REST API's for the steps in the purchase.

So far I can create new cart, add product, set billing address, set payment method, collect totals and place order. BUT! One of the payment methods we use is an external credit card gateway. I have created a custom payment method module for this and it is settable through the APIs. However, the response that i get from "placeOrder()" API call contains only the order entity_id.

My intuition tells me that depending on payment method such an API call would add something to the response to tell the frontend that a redirect should take place.

I have probably missed something, maybe an API call that should be made before placeorder to process payment and then in case of redirect do placeorder at the callback url?

Does anyone have an idea of how this is supposed to be done?


texts:
I am unable to save/edit products or magento configuration. This is after setting my website to the following redirect for SEO purposes.

SEO redirect purposes (all done in magento admin)

no index.php
301 redirect from http to https

The error message is below.

  Mixed Content: The page at 'https:// example.com
  /index.php/admin/system_config/edit/section/web/key/a28ca18264dbb0bcdf848da4c2620ed4/'
  was loaded over a secure connection, but contains a form which targets
  an insecure endpoint 'http:// example.com
  /index.php/admin/system_config/save/section/web/key/ff882db370816b350dbf1b10cf065dac/'.
  This endpoint should be made available over a secure connection.

This is my current admin configuration.

Add Store Code to Urls: No
Auto-redirect to Base URL: No
Use Web Server Rewrites: Yes
Unsecure Base URL & Base Link URL: http://example.com/
Secure Base URL & Base Link URL: https://example.com/
Use Secure URLs in Frontend: No
Use Secure URLs in Admin: No

Can anyone help? I tried clearing cache but it does not work.


texts: Getting disabled products in a collection for Magento 2.3.1

texts:
I have the following code to get all disabled products

    $products = $this->productCollectionFactory->create()
        ->addAttributeToSelect('sku')
        ->addAttributeToSelect('name')
        ->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED);

However, the result is always coming back empty even though in the admin I can see there are disabled products.

Therefore my question is how do I get all disabled products in a collection?


texts: Magento 2 - Store disable issue in Multi stores website

texts:
I am working on multi store website, as far I know person should be able to disable store view / website if that is not a default store view / website.

I want to disable some of the store views but can't able to disable the store. it give me the notification

  It cannot be disabled

P.S: I already set one of the store view as default.

Any help, experience and knowledge sharing would be appreciated.


texts: Retrieve via javascript/jquery/ajax/ReST the category tree

texts:
I was looking for a way to get the category tree via ReST API.

I looked here but it doesn't seem to show how to fetch the category tree (it has an entry point which lists a product's assigned categories list, and that's not what I'm looking for).

I'm using Magento 1.6.2 (cannot update - even if it's possible, the guy before me working at this project killed a lot of kittens and considering the time I have to do this, and my newbieness, I cannot resurrect them) and I need to access ReST API (I already know how to do this in SOAP API). How can I create such custom entry point for ReST API? (It seems to not exist). I don't expect a long explanation. Links with their contexts are also accepted.

My intention is to use such API via a regular AJAX call:

$.get('entry/point', {data:needed, for:this, entry:point, function(categTree){
    //process (and build/display) the tree
}, 'json' /*or xml. actually don't care*/});


texts:
How to override Magento\Sales\Controller\Adminhtml\Order\AddressSave contoller?

di.xml

<preference for="Magento\Sales\Controller\Adminhtml\Order\AddressSave" type="Xxx\Order\Controller\Adminhtml\Order\Address" />

Contoller

<?php

namespace Xxx\Order\Controller\Adminhtml\Order;

use Magento\Sales\Controller\Adminhtml\Order\AddressSave;

class Address extends AddressSave
{
    public function execute()
    {
        echo "hi";
        exit;}}

I am trying to do this but it's not working.

Any help will be appreciated.

Update

<?php

namespace Xxx\Yyy\Plugin;

use  Xxx\Zzz\Model\Data;
class AddressSave
{

    /**
     * @var \Magento\Framework\Controller\Result\RedirectFactory
     */
    protected $resultRedirectFactory;
    protected $_pincodeModel;

    /**
     * @var \Magento\Framework\Message\ManagerInterface
     */
    protected $messageManager;

    public function __construct(
    \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory, \Magento\Framework\Message\ManagerInterface $messageManager,Data $pincodeModel    )
    {
        $this->resultRedirectFactory = $resultRedirectFactory;
        $this->messageManager = $messageManager;
        $this->_pincodeModel = $pincodeModel;
    }

    public function aroundExecute(
    \Magento\Sales\Controller\Adminhtml\Order\AddressSave $subject, \Closure $proceed
    )
    {
        $resultRedirect = $this->resultRedirectFactory->create();

        $codAvailability = $this->_pincodeModel->isDeliveryAvailable($postCode) ? "yes" : "no";
        if ($codAvailability == 'yes') {// Write your own logic here
            $result = $proceed();
            return $result;
        } else {
            $this->messageManager->addError('We can\'t update the order address right now.');
            return $resultRedirect->setPath('sales/*/');
        }
    }

}

di.xml

 <type name="Magento\Sales\Controller\Adminhtml\Order\AddressSave">
        <plugin name="admin_order_address_save" type="Xxx\Yyy\Plugin\AddressSave" />
    </type>

}else {
        $action = $this->_request->getActionName();
        $this->messageManager->addError(__('Delivery is not available at ' . $postCode));
        $this->_actionFlag->set($action, \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
        $redirectionUrl = $this->_url->getUrl('adminhtml/sales_order/addressSave', array('address_id' => $addressId));
        $this->_responseFactory->create()->setRedirect($redirectionUrl)->sendResponse();
        return $this;
    }


texts: Difference between position and sort_order in customer install script

texts:
I'm trying to understand how the install works for EAV entities in Magento2.
I see that in the installEntities method from the Magento\Customer\Setup\CustomerSetup class, the attributes have 2 fields with the same value position and sort_order.
but in the catalog module in the Magento\Catalog\Setup\CategorySetup there is only the sort_order field.
Please explain what's the difference between them (if any) and for what is each one used.


texts: can't edit a bundle product after adding to cart

texts:
everything is working fine, the product is added to the cart with the correct default options with default quantities. But when I press edit from the shopping cart page I see all the options has the default quantity value. when I changed options qty and press add to cart button getting scripting error like following.

Uncaught TypeError: Cannot read property 'customQty' of undefined
Uncaught TypeError: Cannot read property 'reloadPrice' of undefined
Uncaught TypeError: Cannot read property 'changeOptionQty' of undefined.

Please help me to fix this issue.


texts:
I'm having some trouble with a payment module we are going to use.

The issue is that the module, before sending the payment request sum all products, shipping cost to match against Grand total. If the match fail, the transaction will not be processed.
This works perfect for my base currency,which is SEK, however when switching to USD. I can see Grand total to be in USD as well as shipping cost. However my products are yet still in SEK which gives me an error as the grand total amount don't match the "line items".

$totalAmount = round($order->getGrandTotal(),2);
currencyCode = $order->getOrderCurrencyCode();

How each line is calculatated for products:

$lineprice = $item->getPrice();
$linetax = $item->getTaxPercent();
$unitAmountExcludingTax =  $item->getPrice();
$linetaxamount = ($lineqty * $lineprice) * ($linetax/100);
$linetotalamount =  $lineqty * $unitAmountExcludingTax + $linetaxamount;

So should I just try to get something else then "getPrice" or should I do some sort of store to order rate conversion?


texts: Custom URL rewrites for categories and products

texts:
we have category and product URLs already indexed by google so we need to add/modify Magento URL Rewrites to match those URLs. We are migrating one of the ecommerce store from yahoo to magento, but we can't change the url structure as they are already indexed by google.

So basically, what I want is..

Magento URL: http://www.website.com/cat1/cat2.html
Need URL: http://www.website.com/cat2.html

Magento URL: http://www.website.com/cat1/product.html
Need URL: http://www.website.com/product.html

Magento URL: http://www.website.com/cat1/cat2/product.html
Need URL: http://www.website.com/product.html

At one extent I managed to solve this with product pages, by enabling Canonical URLs for categories and products from backend. But that doesn't help for all the cases, like for multiple categories in the URL.

Any help will be much appreciated!

UPDATE: I have disabled "Use Categories Path for Product URLs" and URLs with products are working as it should be. But the category link is still not solved. If there are multiple categories in the url, then issue still comes.

So, the original Magento URL www.website.com/cat1/cat2.html should be www.website.com/cat2.html only without cat1 in url.


texts: Magento2 | How to change the main search site?

texts:
Sorry for my English

I currently have a full-text index and when the search is in progress, it does not look for a substring.

How to make a search to work as %LIKE%?

I have this

hdd with serial number: wcawf3605242model: wd5000aaks-75v0a0date: 04 mar 2010dcm: harchtjabnproduct of: thailandpcb sticker: 2061-701640-k02 05pd5pcb revision: 2060-701640-002 rev a

and when I enter V0, I want it to find him here. wd5000aaks-75v0a0date


texts: MageTool - Does clear cache clear the sessions cache?

texts:
I am using the Mage Tool to clear my cache, and I am wondering, when I clear the cache using this tool, does it empty all the users shopping carts?

The tool can be found at :

https://github.com/alistairstead/MageTool


texts:
Right now my code is

<?php
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
$catIds = explode(',',$cats);
$i=0;
?>

<?php foreach($catIds as $catId): ?>

        <?php
            $category = Mage::getModel('catalog/category')->getCollection();
            $category->addAttributeToFilter("Top_Menu" , array('eq' => '146'));
            $category->addAttributeToFilter("entity_id" , array('eq' => $catId));
            $category->addAttributeToSelect('*');
            $category->load();
            foreach($category as $category1):
                echo 'getUrl().'">'.$category1->getName()."";
                    $subCats = Mage::getModel('catalog/category')->load($category1->getId())->getChildren();
                    $subCatIds = explode(',',$subCats);
                    if(count($subCatIds) > 1):?>

                        <?php foreach($subCatIds as $subCat) :?>

                            <?php
                                $category2 = Mage::getModel('catalog/category')->getCollection();
                                $category2->addAttributeToFilter("Top_Menu" , array('eq' => '146'));
                                $category2->addAttributeToFilter("entity_id" , array('eq' => $subCat));
                                $category2->addAttributeToSelect('*');
                                $category2->load();
                                foreach($category2 as $category3):
                                    echo 'getUrl().'">'.$category3->getName()."";
                                    $subCats2 = Mage::getModel('catalog/category')->load($category3->getId())->getChildren();
                                    $subCatIds2 = explode(',',$subCats2);
                                    if(count($subCatIds2) > 1):?>

                                                <?php foreach($subCatIds2 as $subCat3) :?>

                                                    <?php
                                                    $category4 = Mage::getModel('catalog/category')->getCollection();
                                                    $category4->addAttributeToFilter("Top_Menu" , array('eq' => '146'));
                                                    $category4->addAttributeToFilter("entity_id" , array('eq' => $subCat3));
                                                    $category4->addAttributeToSelect('*');
                                                    $category4->load();
                                                    foreach($category4 as $category5):
                                                    echo 'getUrl().'">'.$category5->getName()."";?>
                                                    <?php endforeach; ?>

                                                <?php endforeach; ?>

                                    <?php endif; ?>

                                <?php endforeach; ?>

                        <?php endforeach; ?>

                    <?php endif;
            endforeach; ?>

    <?php endforeach; ?>

how this has 700 hits to the database and is makaking my site very slow.
How do I reduce the number of loads?