texts: What is the best approach to mass updating prices? We need to batch update pricing for almost 200 products in our catalog and would prefer to learn a more efficient method than individually editing products just in case we ever need to do this again. My assumption is to use Magento's export feature to get all the products into a single flat file, update columns or do percentage adjustments and reimport the CSV back into Magento. Should I consider any other method than this?


texts:
Hi i am using magento vesion 1. 9
and i am trying to call magento soap apiv2 using php.

i use the following code.

$proxy = new SoapClient('http://domain/index.php/api/v2_soap/?wsdl=1');
$sessionId = $proxy->login((object)array('username' => 'user', 'apiKey' => 'password'));
$product = $proxy->catalogProductInfo((object)array('sessionId' => $sessionId->result, 'productId' => '27'));

i get the session id (i testes it by printing the id)
but when i make a soap call

$product = $proxy->catalogProductInfo((object)array('sessionId' => $sessionId->result, 'productId' => '27'));

the browser showing "Server error"

api user having full permission in the back end.
but still it is not working. please some one help me to find the solution.


texts: Full Page Cache -> HTTP 500 on CMS Home -> Error in Module

texts:
We are using Magefans Blog Module.

When we are activating the Full Page Cache, it triggers a HTTP 500 on the CMS home page, where we are using a implementation of it.

Modules Block Code that triggers the error:

/**
 * Get Block Identities
 * @return Array
 */
public function getIdentities()
{
    return [\Magento\Cms\Model\Page::CACHE_TAG . '_relatedproducts_'.$this->getPost()->getId()  ];
}

Error:

Fatal error: Uncaught Error: Call to a member function getId() on null in /home/customer00014/public_html/206/app/code/Magefan/Blog/Block/Post/View/RelatedProducts.php:135

Stack trace: #0 /home/customer00014/public_html/206/var/generation/Magefan/Blog/Block/Post/View/RelatedProducts/Interceptor.php(63): Magefan\Blog\Block\Post\View\RelatedProducts->getIdentities()
#1 /home/customer00014/public_html/206/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php(71): Magefan\Blog\Block\Post\View\RelatedProducts\Interceptor->getIdentities()
#2 /home/customer00014/public_html/206/vendor/magento/framework/Interception/Interceptor.php(150): Magento\PageCache\Model\Layout\LayoutPlugin->afterGetOutput(Object(Magento\Framework\View\Layout\Interceptor), ' <script>\n ...'')
#3 /home/customer00014/public_html/206/var/generation/Magento/Framework/View/Layout/Interceptor.php(494): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array) #4 /home/customer00014/public_html/206/vendor/magento/framework/View/Result/Page.php(241): Mage in /home/customer00014/public_html/206/app/code/Magefan/Blog/Block/Post/View/RelatedProducts.php on line 135

In the specific .php-file theres a ->getPost()->getID() call which triggers the error.

The question now is:

why does the module calls a member function on null, and what does that mean?
how can I fix this error? What would be the correct way to "get identitiers"?
for what do I need Identities? Is it cache relevant?


texts:
I keep getting HEADERS ALREADY SENT
in my logfile (system.log).

[6] /home/company/public_html/index.php:82
\

2018-09-17T10:49:23+00:00 DEBUG (7): HEADERS ALREADY SENT: \
[0] /home/company/public_html/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /home/company/public_html/lib/Zend/Controller/Response/Abstract.php:766
[2] /home/company/public_html/app/code/core/Mage/Core/Controller/Response/Http.php:83
[3] /home/company/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php:184
[4] /home/company/public_html/app/code/core/Mage/Core/Model/App.php:354
[5] /home/company/public_html/app/Mage.php:684
[6] /home/company/public_html/index.php:82
\

On line 82 of index.php there is the command Mage::run($mageRunCode, $mageRunType);

app/code/core/Mage/Core/Controller/Response/Http.php

public function sendHeaders()
{
    if (!$this->canSendHeaders()) {
        Mage::log('HEADERS ALREADY SENT: '.mageDebugBacktrace(true, true, true));
        return $this;
    }

I looked up canSendHeaders():

dev\lib\Zend\Controller\Response\Abstract.php

public function canSendHeaders($throw = false)
{
    $ok = headers_sent($file, $line);
    if ($ok && $throw && $this->headersSentThrowsException) {
        #require_once 'Zend/Controller/Response/Exception.php';
        throw new Zend_Controller_Response_Exception('Cannot send headers; headers already sent in ' . $file . ', line ' . $line);
    }

But I don't understand it. The variables $file and $line are not defined anywhere, how should this even work?

index.php

<?php

if (file_exists("url_rewrites.php")) {
    include("url_rewrites.php");
}

if (version_compare(phpversion(), '5.2.0', '<')===true) {
    echo  '

Whoops, it looks like you have an invalid PHP version.

Magento supports PHP 5.2.0 or newer.
Find out how to install
 Magento using PHP-CGI as a work-around.

';
    exit;
}

if (file_exists("defines.php")) {
    include_once ("defines.php");
}

/**
 * Compilation includes configuration file
 */
define('MAGENTO_ROOT', getcwd());

$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";
    }
    exit;
}

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';
    exit;
}

require_once $mageFilename;

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
}

umask(0);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

Mage::run($mageRunCode, $mageRunType);


texts: Issue while Configuring color swatches in Magento 1.9.3.10

texts:
I am using Magento 1.9.2.10 to configure color swatches i have followed the below link to do this:

  https://www.templatemonster.com/help/magento-how-to-add-and-manage-configurable-swatches.html#gref

but i'm  getting following error in my frontend and no products are loading:

  Fatal error: Uncaught Error: Call to undefined method
  Queldorei_ShopperSettings_Helper_Mediafallback::attachProductChildrenAttributeMapping()
  in
  C:\wamp64\www\shopping_hub\app\code\core\Mage\ConfigurableSwatches\Model\Observer.php
  on line 59

when i disable my configurable options from configuration section in admin panel then products are displayed but i also want color swatches to simultaneously.
I found this link

  https://stackoverflow.com/questions/44321588/magento1-9-3-3-configurable-product-swatch-bug but it did'nt work. Please help to sort out my issue.


texts: What is use of sales_flat_quote table? Can it be truncated?

texts: I want to know functionality of sales_flat_quote table. If I would truncate this table then will any issue occur or not?


texts: customer_account_create override not loading template

texts:
I created a module Pera_CustomerRegistration, i want to override /app/code/Pera/CustomerRegistration/view/frontend/template/form/register.phtml

However, when i try to all i got is is an empty page with only the "Create New Customer Account" title, which makes me assume that the layout is overridden, but that the template is not loading.
Here is what i have so far.

customer_account_create.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="head.components">
            <block class="Magento\Framework\View\Element\Js\Components" name="customer_account_create_head_components" template="Magento_Customer::js/components.phtml"/>
        </referenceBlock>
        <referenceContainer name="content">
            <block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="Pera_CustomerRegistration::form/register.phtml">
                <container name="form.additional.info" as="form_additional_info"/>
                <container name="customer.form.register.fields.before" as="form_fields_before" label="Form Fields Before" htmlTag="div" htmlClass="customer-form-before"/>
            </block>
            <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
                <arguments>
                    <argument name="triggers" xsi:type="array">
                        <item name="registerSubmitButton" xsi:type="string">.action.submit</item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="form.additional.info">
            <block class="Magento\Framework\View\Element\Template" name="form_additional_info_customer" template="Magento_Customer::additionalinfocustomer.phtml"/>
        </referenceContainer>
    </body>
</page>

And here is how the files are in the structure:

Also, here is my module.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Pera_CustomerRegistration" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Customer"/>
        </sequence>
    </module>
</config>

If you need any more info, please ask.


texts: Magento Search and only include products in categories

texts: Is it possible to set the native Magento search to only search products which are connected to a category?


texts:
I am trying to enable emails sending in magento 1.9, so I enabled the contact us flag from the admin panel and I set all the addresses.

My Environment is:
Server: EC2 , Domain: Godaddy, Magento 1.9

I also added the MX records to godaddy.

But now magento not sending any email when I test contact us page.

Note: Also I setup the SMTP setting from admin->configuration->advance->mail

Any extra steps?

Thank you.


texts: How to make a word break for span element?

texts:
I would like to add a word break at the checkout page via custom CSS but I'm not getting an expected result.

1. I have a heading like below:

2. I would like to change it as below:

3. But getting the below result:

HTML:

Kontaktperson/Leveransmottagare

CSS:

.xxxxx {
        word-wrap: break-word;
        display:block;
        width:156px;
    }

Could anyone please help me to get the desired result?


texts: I want get product by sku, name, price.I do not know how to get it. Please help me. i get it by sku is success but name or price isn't success.


texts:
On checkout page i want to hide summary component by default. and when a user clicks on a button i to show that Summary section. The Summary section is build through XML and KO. My Question is, Can i use Jquery in KO?

define(
[
    'ko',
    'uiComponent',
    'underscore',
    'Magento_Checkout/js/model/step-navigator',
    'Magento_Customer/js/model/customer',
    'jquery'
],
function (
    ko,
    Component,
    _,
    stepNavigator,
    customer,
    $
) {
    'use strict';
    /**
     * check-login - is the name of the component's .html template
     */
    return Component.extend({
        defaults: {
            template: 'Magento_Checkout/check-login'
        },

        //add here your logic to display step,
        isVisible: ko.observable(true),
        isLogedIn: customer.isLoggedIn(),
        //step code will be used as step content id in the component template
        stepCode: 'isLogedCheck',
        //step title value
        stepTitle: 'Login',

        /**
         *
         * @returns {*}
         */
        initialize: function () {
            this._super();
            // register your step
            stepNavigator.registerStep(
                this.stepCode,
                //step alias
                null,
                this.stepTitle,
                //observable property with logic when display step or hide step
                this.isVisible,

                _.bind(this.navigate, this),

                /**
                 * sort order value
                 * 'sort order value' < 10: step displays before shipping step;
                 * 10 < 'sort order value' < 20 : step displays between shipping and payment step
                 * 'sort order value' > 20 : step displays after payment step
                 */
                9
            );

            return this;
        },

        /**
         * The navigate() method is responsible for navigation between checkout step
         * during checkout. You can add custom logic, for example some conditions
         * for switching to your custom step
         */
        navigate: function () {

        },

        /**
         * @returns void
         */
        navigateToNextStep: function () {
            stepNavigator.next();
        }

    });

        $(".checkout-btn").click(function(){
        console.log("Hello World");
            $(".order-summary-sec").css("display","block");
        });

}
);

HTML:

Checkout

            Email Address
            <input type="text" name="email" class="field input-acc-field email-field">

This email is already registered with us, please sign in below

            Password
            <input type="password" name="password" class="field input-acc-field password-field">

OR sign in with Facebook

                SIGN IN WITH FACEBOOK

at the last i have pasted my jQuery Code. But it is not working.Any idea how i could be?


texts: "In State.php line 153 Area code is not set" error while upgrading to Magento 2.4.2

texts:
I tried to upgrade Magento core from 2.4.1 to 2.4.2 by changing composer.json and did composer install. After that, ran the upgrade command. The upgrade breaks and shows "In vendor/magento/framework/App/State.php line 153 Area code is not set". I went through various options, but couldn't find a proper way to fix it.
Any idea would be appreciated.


texts:
We host a shop with around 100 orders per day. In the day time there are around 10 orders per hour.
Some times, for an hour there is no order at all.

The shop owner, who monitors the current conversions, then makes a test order (which works fine). And right after that the orders start to flow in again.

This seems to be not linked to a specific time of the day. And the unique visitors do not drop - only the conversion rate.

What can be the reason for this?


texts: Header links: how to align it to opposite corners?

texts:
i have extended my default Luma header with new item:

<referenceBlock name="header.links">
      <block class="Magento\Framework\View\Element\Html\Link\Current" name="callmeback" before="account">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Call me back</argument>
                   <argument name="path" xsi:type="string">checkout/cart</argument>

                </arguments>
      </block>

could any one advice how to align this new item into left side, as on screenshot below:

also, maybe anyone will give me tip how to add some icons to menu items? will really appreciate that. Thanks in advance!


texts: Magento 2 : How to set the Title of Page in Admin Grid using UI_COMPONENT

texts:
I have created a custom module using UI_COMPONENT. Everything worked properly, but unable to set the Page Title.

Index layout file:

<?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>Test</title>
    </head>
    <body>
        <referenceContainer name="content">
            <uiComponent name="testing_item_grid"/>
        </referenceContainer>
    </body>
</page>

Adding Solution: In Adminhtml Controller prepend your title text.

Here is the code:

namespace Testing\test\Controller\Adminhtml\Index;
use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action;
class Index extends Action{
    public function execute() {

        $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        $resultPage->getConfig()->getTitle()->prepend(__(" Custom Grid"));
        return $resultPage;
    }

}


texts: Product Catalog edit in magento 2.1.1 will result to 500 Internal Server Error

texts:
I'm having a problem in my magento 2.1.1 site. Whenever I edit a product under catalog in admin. It will result to 500 Internal Server Error.
Also this is the error message in the logs.
Sat Nov 12 16:38:45.454203 2016] [core:error] [pid 25279] [client 123.252.223.212:21815] End of script output before headers: index.php, referer: http://site.sample/admin123/catalog/product/index/key/b61e460d10cf72cbccbd1719d2a08de7cd5668551fc480ff4944fcc87bfcae3f/

Here is the error also in console


texts: Magento 1.9 : image quality looks dull after resize

texts:
I have an issue when I resize magento image then its looks dull compare with orignal image.

for More you check attached image.

I have also try these extension but not get good results

https://github.com/magento-hackathon/Perfect_Watermarks

I have tried these solution but not get success.

Disable magento's compression of product images

https://stackoverflow.com/questions/8384678/magento-resize-image-quality-dirty-white-background


texts: Minicart 2.1 Minicart doesn't show products added to the cart

texts:
I'm working on a Magento 2.1 shop with a custom theme. When I use the blank theme, everything works just fine. The moment I enable my own theme, but without overwriting the minicart templates I have the following problem.

The item count in the minicart gets updated but overview of products in your cart is not there. Also the "Go to checkout"-"button and the "Close"-button of the minicart are not working anymore. This is what my console logs.

Unable to process binding "foreach: function (){return { data:getCartParam('items'),as:'item'} }"
Unable to process binding "foreach: function (){return { data:getCartParam('items'),as:'item'} }"
Unable to process binding "foreach: function (){return $parent.getRegion($parent.getItemRenderer(item.product_type)) }"
Cannot read property 'configurable' of undefined

It might be relevant to note that I moved the minicart in my default.xml file to another location, not sure if relevant.


texts: Why is log in form on home page not actually logging in?

texts:
I'm using the existing form from the default login page and calling the action like this:

<?php $custmlogin= new Mage_Customer_Block_Form_Login();?> <form action="<?php echo $custmlogin->getPostActionUrl() ?>"...

The action gets echoed just fine resulting in the same path I initially had hard coded, but it doesn't actually log me in. I just goes to the standard login page with a form for me to log in. Is there something else I need to do to actually submit the data and get logged in successfully?


texts:
I have Magento 2.1.4 and recently attempted to upgrade an extension but afterwards whenever I deploy the static content, it loses the CSS/JS on the front and backends.

php bin/magento setup:static-content:deploy

I have noticed that the path to my CSS is for example (I have turned the versioning folder thing off)...

/pub/static/frontend/mytheme/themename/en_GB/css/styles-l.css

However when I look for the folder above, en_BG does not exist. It is 'en_US' instead.

The same sort of behaviour is the same for the backend. The path to the CSS says...

/pub/static/adminhtml/Magento/backend/en_US/css/styles.css

But when I look for that file, 'en_US' does not exist. 'en_GB' exists instead.

If I just rename the folders and make sure they exist it works fine, but my question is why would this be happenning?

The site is setup to be en_GB (United Kingdom)

Thanks


texts: how to add default filter in magento admin ui component in magento 2

texts:
Hi I want to filter the admin grid data in default Magento 2

  how to add default filter in Magento admin UI component in Magento 2


texts: Create_at Admin time is not correctly showing in magento1.9

texts:
my function is
it is showing like Feb 22,2017 12:00:00 AM
i need to display current time.

 public function ws_getPunchHistory($custid,$intime,$outtime,$inlocation,$outlocation,$punchstatus,$create_at)
     {

   if(Mage::getSingleton('customer/session')->isLoggedIn()){
    }
    else{
        $res["error"] = "Invalid request";
        return $res;
    }
    $res = array();
    $data = array();
    $custid = Mage::getSingleton('customer/session')->getId();
    if ($custid != '')
    {
        $date= date_default_timezone_set('Asia/Kolkata');
        //$current = date('Y-m-d H:i:s');
         $current = date('Y-m-d H:i:s');
        $collection = Mage::getModel("manager/asmtracker")->getCollection()
                                                           ->addFieldToFilter('manager_id','64648')
                                                           ->addFieldToFilter('create_at', array('eq' =>$current))
                                                           ->addFieldToFilter('punch_in_time', array('null' => true))
                                                           ->getFirstItem();

    //print_r($collection);

        try{
            $data = array(
                'manager_id' => strval($custid),
                'punch_in_time' => strval($intime),
                'punch_out_time' => strval($outtime),
                'in_coordinates' => strval($inlocation),
                'out_coordinates' => strval($outlocation),
                'status' => $punchstatus,
                'create_at' => $create_at
                );
            // print_r($data);
            $this->_controller = 'adminhtml_asmtracker';
           $smodel = Mage::getModel("manager/asmtracker")->setData($data)->save();

            $res['code'] = 200;
            $res['asmtracker'] = 'ok';
        }catch(exception $exception){
            $res['code'] = 400;
            $res['asmtrakcer'] = $exception->getMessage();
        }

    }else{
        $res['code'] = 500;
        //$res['asmtrakcer'] = $exception->getMessage();
    }
    return $res;
 }


texts: Magento 2 Create Controller With No Theme?

texts:
Is it possible to create a controller with Magento 2 that doesn't have the admin menus/navbars?
Essentially I want the page to return just the HTML I write and not put anything else?
I considered just throwing the HTML into JSON and decoding it later but that seems kind of like a workaround.


texts: how to solve this prompt: "current customer does not have an active cart"?

texts: when the customer proceed to checkout, the prompt:"current customer does not have an active cart" denying them from placing the order


texts: How to change indexer mode from "update on save "to "update by schedule" from database or script Magento 2?

texts:
In Magento 2 admin panel I want to change indexer mode from update on save to update by schedule but I can not change it from the admin because it continues to loading nothing changes on any product related indexer.

I want to change this mode because in admin panel

  catalog -> product

section not loading. admin product page continues loading. and if after some time site giving 504 error at front-end and back-end.

So if anyone has any solution then let me know.

Thanks


texts: Can I create a module including only a helper class?

texts:
Is it possible to create a module/extension with only a Helper class declared?
I am trying to create a module because I need to use a function on more than one phtml files.

So far I got this code:

/app/etc/modules/Mycompanyname_CategoryStep.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompanyname_CategoryStep>
            <active>true</active>
            <codePool>local</codePool>
        </Mycompanyname_CategoryStep>
    </modules>
</config>

/app/code/local/Mycompanyname/CategoryStep/Helper/Data.php

<?php
class Mycompanyname_CategoryStep_Helper_Data extends Mage_Core_Helper_Abstract
{
    public function add($num1, $num2)
    {
        return $num1 + $num2;
    }
}

/app/code/local/Mycompanyname/CategoryStep/etc/config.xml

<?xml version="1.0" encoding ="UTF-8"?>
<config>
    <modules>
        <Mycompanyname_CategoryStep>
        <version>0.1.0</version>
        </Mycompanyname_CategoryStep>
    </modules>
    <global>
        <helpers>
            <categorystep>
                <class>Mycompanyname_CategoryStep_Helper</class>
            </categorystep>
        </helpers>
    </global>
</config>

That's the error I get:

  Fatal error: Class 'Mage_Categorystep_Helper_Data' not found in
  /home/account/public_html/app/Mage.php on line 550

Am I missing something? I followed this guide to create the module and this guide and several others to create the Helper class. Any help would be appreciated.


texts:
I want to remove the Keep Magento Healthy from my Footer. I followed the instructions in this question but am confused as to how to lay it out in my custom theme. How to remove "Help us keep magento healthy" in Magento 2.1

I have copied what is inside the the module-theme frontend folder from vendor/magento/module-theme/view/frontend/ into my app/design/frontend/Vendor/Theme

So currently inside of my Theme folder it looks a bit like this:
Magento_Theme
--layout
--templates
--html
----footer.phtlm
----bugreport.phtml
--web
--layouts.xml
etc
i18n
media
web
--css
----source

To the layout.xml files I added in the suggested to code remove the bug block

from the footer.phtml file I removed:
bug tracking link

I cleared the cache and nothing changed.

Can someone tell me where I'm going wrong?
Also, on the file structure in the vendor folder you have the module_files
and then you have the front end files with the css files inside. Am I correct in putting the layout.xml files into the app/design/frontend/Vendor/Theme or do the module-files all go into the app/code folder?

My apologies for these really basic questions. I cannot wait I know enough that this will look like a silly question to me! Thank you for all your help.

A novice


texts:
I've been trying to get a special price collection of products for Magento 2 but I keep on failing.

I've got the following example that works(almost):

    protected function _getSaleCategoryCollection()
    {
        if ($this->_productCollection === null) {
            /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
            $collection = $this->_productCollectionFactory->create();
            $this->_catalogLayer->prepareProductCollection($collection);

            $todayStart = $this->_localeDate->date()->setTime(0, 0, 0)->format('Y-m-d H:i:s');
            $todayEnd = $this->_localeDate->date()->setTime(23, 59, 59)->format('Y-m-d H:i:s');

            $collection
                ->addStoreFilter()
                ->addAttributeToFilter(
                    'special_from_date',
                    [
                        'or' => [
                            ['date' => true, 'to' => $todayEnd],
                            ['is' => new \Zend_Db_Expr('null')]
                        ]
                    ],
                    'left'
                )->addAttributeToFilter(
                    'special_to_date',
                    [
                        'or' => [
                            ['date' => true, 'from' => $todayStart],
                            ['is' => new \Zend_Db_Expr('null')]
                        ]
                    ],
                    'left'
                )->addAttributeToFilter(
                    [
                        ['attribute' => 'special_price', 'is' => new \Zend_Db_Expr('not null')]
                    ]
                );

            $this->_productCollection = $collection;
        }

        return $this->_productCollection;
    }
}

Alright, so the above example shows me all the products that has the special price 'value' not empty and also if the product is between the 2 dates.

The problem comes when I have a product where the special price is not empty, but equal to the normal price(therefore the product does not have a special price).

So in conclusion I need to add an 'and' condition to the above collection so the final price < smaller price

I've added following after researching different forums:

...
 )->addAttributeToFilter(
                    [
                        ['attribute' => 'special_price', 'is' => new \Zend_Db_Expr('not null')]
                    ]
                );

            $collection->getSelect()->where(
                    'price_index.final_price < price_index.price'
            );

            $this->_productCollection = $collection;
....

After adding that getSelect->where() , I'm only getting 4 simple products so I'm thinking this is not the right approach for me.
Also, I'm using elasticsearch(I don't know if relevant).

I'd appreciate if anyone has an idea.
Thank you!


texts: Suffix removal with setup script doesn't work

texts:
Method inside InstallData.php/UpgradeData.php to remove suffix from product and catalog pages:

public function removeSuffix()
{
    $this->_config->saveConfig('catalog/seo/product_url_suffix', null, 'default', 0);
    $this->_config->saveConfig('catalog/seo/category_url_suffix', null, 'default', 0);
}

As you can see in screenshots below, in backend the changes have been made and the core_config_data table has the fields that it would have if it was done manually in backend, but in url_rewrite table paths don't get updated.

Product and category links still show up as e.g. http://test.dev/gear/bags.html with the suffix.

I have done sudo bin/magento indexer:reindex and also tried flushing cache.

The suffix fields in backend are changed after running script:

The core_config_data table has the fields that would normally be there if it was done manually:

The url_rewrite table paths are not being changed:


texts: Magento 2 how to save custom field added in the form of customer group?

texts:
I've added some custom fields to the form of customer group by using upgradeSchema.php.

After that I found that the original fields like customer group code and tax id are saved by using setter methods in the API provided. It is completely different from Magento 1.X that just use setXXX() to save.


texts: Urls issue on Multi Website on Magento 2.2.8

texts:
We have a issue when creating multistore website on magento 2

Issue

We have 3 multi stores one for English language, Spanish and Italy. And among this English is our main site with domain example.com

I had created a new website using magento store and changed the URL of newly created store to abc.com. all created successful using siteground.com/tutorials/magento/multistore/
( add-on Method)

But when I  goto example.com some of the products urls are changed to abc.com domain.

Do you know why,
We are using Magento 2.2.8


texts: Show Configurable Product Options in UpSell Block and Add To Cart

texts:
Magento 2.2.3

I currently have the Upsell block displaying configurable products on the product view page.

I would like to display a drop down of the configurable options and then be able to add the product to cart. I have the drop down working, however I can't seem to get the add to cart to recognize the configurable option that was selected. I get the following error when clicking add to cart, 'You need to choose options for your item.'

My Code,

  app/design/frontend/custom_vendor/custom_theme/Magento_Catalog/templates/product/list/items.phtml

<?php
 if ($_item->getTypeId() == 'configurable') {
 $data = $_item->getTypeInstance()->getConfigurableOptions($_item);

 $optionhtml = '<select name="super_attribute['.$_item->getId().']" id="attribute'.$_item->getId().'">';

 foreach($data as $attr){
  foreach($attr as $p){
      $optionhtml .= '<option value="'.$p['value_index'].'">'.$p['option_title'].'</option>';
      }
    }

    $optionhtml .= '</select>';

    echo $optionhtml;
   }
?>

How do I customize the current add to cart or add a new add to cart button that will recognize what option was selected for the product?


texts: Remove State filed from estimate shipping block on cart index page.

texts:
I Want to remove state filed from Estimate Shipping and Tax block On Cart Index page.

I have Followed This Link But Not Worked.

Thanks


texts: Display available products in the category not the products created by categeory

texts:
I am having the category of
Category1 (25)
Category2 (3)
Category3 (16)

in that
Category1 have totally 25 products but the product available is 8,
Category2 have totally 3  products but the product available is 1,
Category1 have totally 16 products but the product available is 7,

so now I need to display the count of available products , for that how I achieve this.
I need the output of
Category1 (8)
Category2 (1)
Category3 (7)


texts:
I don't know if I'm allowed to ask it here. But I will give it a try.

I've just setup Magmi (MAGento Mass Importer).

I first logged in with the default credentials : magmi:magmi

now i set up an admin account on my magento shop and connected via that one.

Now it gives me the following error:

Notice: Undefined offset: 1 in /magmi_auth.php on line 44

Notice: Undefined offset: 1 in /magmi_auth.php on line 45

I already googled this issue and I got the following answer:

*Specifically this happens if the session is still logged in with the default magmi:magmi and you successfully connect to Magento.

A quick work around is to clear the browsing history, then log in with the Magento credentials.*

I already tried that but this aint working.

someone help me please.


texts:
I upgrade yesterday to Magento 2.3.3 from 2.3.2, which seemed to go relatively smoothly.

I tried to do a setup:di:compile today and got this error

In PhpScanner.php line 177:

  Class \My\NamespaceA\My\NamespaceB\InterfaceB does not exist

I've tried googling, but this error doesn't seem to be reported.  This class seems generic enough that I can't track it down.  Has anyone seen this before, or have any suggestions?


texts: Why cart page shows the message "Sorry, no quotes are available for this order at this time"?

texts:
In the Estimate Shipping and Tax section, there is a message

  Sorry, no quotes are available for this order at this time

How to restore form like normally and get rid of this message?


texts: Save payment interface extension attribute in Magento 2

texts:
My extension_attribute.xml file below:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">

    <extension_attributes for="Magento\Quote\Api\Data\PaymentInterface">
        <attribute code="comment" type="string"/>
    </extension_attributes>
</config>

I have created field (text box) in payment page Magento 2 checkout.
i want to save this value to customer_note column in sales_order_grid

I followed this answer
https://magento.stackexchange.com/a/187848/73525
but not working for (Payment comment field save )
this plugin not working

etc/di.xml
 <type name="Magento\Checkout\Model\PaymentInformationManagement">
        <plugin name="order_comments_save-in-order" type="Sugarcode\Deliverydate\Plugin\Checkout\PaymentInformationManagementPlugin" sortOrder="10"/>
    </type>

How can I save this attribute to orders and order grid?


texts:
currently i am working with a magento shopping site.I am newbie to magento. When i tried to login via one page both login and create button are disabled. Default login and create account working fine.

It shows the error uncaught TypeError: $j(...).foundation is not a function

please help me to solve the problem.Thanks in advance.

please check this link http://qwertykart.com/checkout/onepage/


texts: How to hide a custom attribute to category on particular category level?

texts:
I have created a custom attribute for the categories using installer script.

But I want to show that attribute only on level two categories.For all other levels it should not be visible.( This attribute is not mandatory field )

$installer->addAttribute('catalog_category', 'short_name', array(
    'group'                    => 'General Information',
    'input'                    => 'text',
    'type'                     => 'varchar',
    'label'                    => 'Short Category Name',
    'visible'                  => true,
    'required'                 => false,
    'visible_on_front'         => true,
    'is_html_allowed_on_front' => true,
    'global'                   => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

Is it possible to hide it from specific levels ?
I mean by hide that it should not be visible.


texts: Magento 2 get static image url in custom field type renderer

texts:
If I need to insert image inside admin form inside function _prepareForm I simply call this:

$this->getViewFileUrl("Company_Module::images/icon.png")

But this doesn't work if I call it within custom field renderer

<?php
namespace Company\Module\Block\Adminhtml\Renderer;
class Customtype extends \Magento\Framework\Data\Form\Element\AbstractElement{
  var_dump($this->getViewFileUrl("Company_Module::images/icon.png")); //returns null
}

What would be a proper way to get image url in this case?


texts: Emails not being sent when new orders are placed

texts:
This is what I've done so far

 - I've already configured the store's sales email to the correct email addresses
 - Test smtp (send test email)

My mailgun configuration works properly. Email were being fired when a user subscribe, etc.

It seems that this problem occurs when a new order is placed.

Because when I view sales>orders and then view a certain order and click "send email" the email is being sent.

Can anyone help me debug this problem.

Thanks


texts: Magento 2 : Disable Default Modules for Performance

texts:
We are trying to improve performance of our Magento 2 stores. But which default modules are there to be disabled without getting errors?

Currently I have this list:

Magento_AdminNotification
Magento_Backup
Magento_Vault
Magento_CheckoutAgreements
Magento_Dhl
Magento_Downloadable
Magento_Fedex
Magento_GoogleAdwords
Magento_GroupedImportExport
Magento_GroupedProduct
Magento_DownloadableImportExport
Magento_InstantPurchase
Magento_Marketplace
Magento_Multishipping
Magento_NewRelicReporting
Magento_Paypal
Magento_ReleaseNotification
Magento_ProductAlert
Dotdigitalgroup_Email
Magento_Rss
Magento_Signifyd
Magento_Authorizenet
Magento_Ups
Magento_SampleData
Magento_Usps
Magento_Braintree
Magento_Weee
Shopial_Facebook
Temando_Shipping
Magento_SendFriend
Magento_Review
Magento_ReviewAnalytics
Magento_WishlistAnalytics
Magento_GoogleOptimizer


texts: Magento 1.9 Method not found in Mage_Core_Model_Abstract

texts:
I have a custom method in my Shipping Model class

public function getCustomMethod()
{
    return 'test';
}

But whenever I want to call the custom method using Mage::getModel in my Helper class

Mage::getModel('custom_shipping/myclass')->getCustomMethod();

I'm getting the error:

  Method not found in Mage_Core_Model_Abstract

I understand that the Shipping Model extends Mage_Shipping_Model_Carrier_Abstract and not the Mage_Core_Model_Abstract

I know I have an option to create another Model class that extends Mage_Core_Model_Abstract to remove the error but I want to call it as it is.

So, how can I call my custom method getCustomMethod() which is inside the Shipping Model class?

Link to related questions and or articles is highly appreciated.

UPDATE: Added config.xml tag for model

<global>
    <models>
        <trunkrs_customcourier>
            <class>Trunkrs_CustomCourier_Model</class>
        </trunkrs_customcourier>
    </models>
</global>


texts: Is there any way to see order source in Orders table in magento admin?

texts:
I've google it, but I found only one thread in Magento Forum http://www.magentocommerce.com/boards/viewthread/40399/ but their forum engine always returns "Your message field is empty" error.

That's why I'll ask here.

We've used Bigcommerce, and they have nice feature in admin backend. In order table you can see the order sourse. It displays like icons (Frontend, backend, frontend tablet, frontend smartphone etc)

I need to implement it in our Magento instance. We have multistore running that shares same catalog (http://doorsandbeyond.com). I need to display the order source in admin backend.

I need to see which orders were submitted via backend, and which were placed from frontend.

I have some idea like to check website's code and display some string, but I don't know how to implement it. Then I think I can develop it to show the device type for the frontend orders, and admin's (Sales person's) name for backend orders, etc.

Any push in the direction will be appreciated

Thanks
Sharif


texts: What does the $this->hasData() evaluate and do?

texts:
I've seen at several sites having the method $this->hasData('test'); in their Block classes (not template files).

As an example, here's an extract of a method in a Block class from a tutorial site:

public function getTestModel()
{
    if (!$this->hasData('test')) {
        if ($this->getTestId()) {
            /** @var \Aion\Test\Model\Test $test */
            $test = $this->testFactory->create();
            $test->load($this->getTestId());
        } else {
            $test = $this->test;
        }
        $this->setData('test', $test);
    }
    return $this->getData('test');
}

I've searched around for this method, but I can't exactly figure out what this function does. Why would I want to store $test through $this->setData('test', $test);? I could just store it in a class variable like $this->tmpTest = $test and return the class variable, couldn't I?

Looking up the Magento source, this is the comment docs of this method in DataObject.php:

/**
 * If $key is empty, checks whether there's any data in the object
 * Otherwise checks if the specified attribute is set.
 *
 * @param string $key
 * @return bool
 */

But what's $key and what attribute is this referring to?

What am I actually checking with the hasData() method? The example I saw took in the word test as its parameter but I have no idea what the word "test" relates to.

What is that parameter the $this->hasData() method actually takes in?

Why would I even want to use this method?


texts: Will M2 Professional Developer exam have questions from Version 2.3 ?


texts: Can I remove store_id from cached image path?

texts:
I have a multi-store shop where product images are the same in all store views. As a consequence I have lots of thumbnails - duplicates of each other, e.g.:

media/catalog/product/cache/5/small_image/300x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg
media/catalog/product/cache/5/small_image/600x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg
media/catalog/product/cache/2/small_image/300x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg
media/catalog/product/cache/2/small_image/600x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg
media/catalog/product/cache/11/small_image/300x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg
media/catalog/product/cache/11/small_image/600x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg
media/catalog/product/cache/4/small_image/300x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg
media/catalog/product/cache/4/small_image/600x/9df78eab33525d08d6e5fb8d27136e95/b/a/bag.jpg

If I extend Mage_Catalog_Model_Product_Image and simply comment out the store_id from setBaseFile($file) function, e.g.:

    // build new filename (most important params)
    $path = array(
        Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath(),
        'cache',
        //Mage::app()->getStore()->getId(),
        $path[] = $this->getDestinationSubdir()
    );

Will there be any unintended consequences from doing this, and, will it work?


texts: how to add collation( utf8_general_ci) using install schema in magento2?

texts:
I want to create table using install schema in magento2 with column collation( utf8_general_ci) .

how to do this?


texts:
I've created tax rules for wholesaler and retail users.
Being a registered customer this tax rules are working fine.
But being NOT LOGGED IN user no rules are taken.
I would like to distinguish also for "NOT LOGGED IN" user if it's a retailer or wholesaler.
Is there a possibility to do this adaptation?


texts:
we are seeing

Undefined index: unsigned

coming from file

app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php on line 310

I see the function public function convertOldColumnDefinition($column) is being called where later in the function it tries to access $column['unsigned'] which apparently does not exist. But in which table? or query?

        $result = array(
        'type'     => $type,
        'length'   => $length,
        'unsigned' => $column['unsigned'],
        'nullable' => $column['is_null'],
        'default'  => $column['default'],
        'identity' => stripos($column['extra'], 'auto_increment') !== false
    );

Has anyone encountered this before?


texts: Magento 2 : How to change the attributes that manage the stock?

texts:
I'd like to change the attributes inventory_manage_stock and manage_stock for a product by ID.

I'm using a custom module, how can I do that?

Thanks


texts: How to create a custom button in checkout. Magento 2

texts:
Already I create button:
Vendor_Module/view/frontend/layout/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">

        <referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="billing-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="payment" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="afterMethods" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="custom-form" xsi:type="array">

                                                                <item name="component" xsi:type="string">Module_Vendor/js/view/fee-checkout-form</item>
                                                                <item name="config" xsi:type="array">

                                                                    <item name="template" xsi:type="string">Module_Vendor/fee-checkout-form</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>

fee-checkout-form

<button class="action apply primary" type="submit" value="Value">
                                    Span
                                </button>

how I should create button,so that after clicking, the controller or model is called?
ty for answer


texts: move minicart to after catalog.topnav magento 2

texts:
pls help me move minicart to after catalog.nav,im rewrite topmenu.phtml and call

$this->getLayout()->createBlock('Magento\Checkout\Block\Cart\Sidebar')->setTemplate('Magento_Checkout::cart/minicart.phtml')->toHtml()

minicart show correct but when click popup minicart show content blank


texts: Magento 2 custom routing frontend not working (100 router match iterations)

texts:
I have used this url to change it but i am keeping getting the same erros
https://magento.stackexchange.com/a/209478/96152
i have a custom routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="testurl" frontName="testurl">
            <module name="Test_CustomRouter" />
        </route>
    </router>
</config>

I have added frontend/di.xml
<?xml version="1.0" encoding="UTF-8"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\RouterList">
        <arguments>
            <argument name="routerList" xsi:type="array">
                <item name="customrouter" xsi:type="array">
                    <item name="class" xsi:type="string">Test\CustomRouter\Controller\Router</item>
                    <item name="disable" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">61</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>

This is my controller for the router
class Router implements \Magento\Framework\App\RouterInterface {

    /**
     * @var \Magento\Framework\App\ActionFactory
     */
    protected $actionFactory;

    /**
     * Response
     *
     * @var \Magento\Framework\App\ResponseInterface
     */
    protected $_response;

    /**
     * @param \Magento\Framework\App\ActionFactory $actionFactory
     * @param \Magento\Framework\App\ResponseInterface $response
     */
    public function __construct(
    \Magento\Framework\App\ActionFactory $actionFactory, \Magento\Framework\App\ResponseInterface $response
    ) {
        $this->actionFactory = $actionFactory;
        $this->_response = $response;
    }

    /**
     * Validate and Match
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @return bool
     */
    public function match(\Magento\Framework\App\RequestInterface $request) {
        $identifier = trim($request->getPathInfo(), '/');
        if (strpos($identifier, 'newcustomurl') !== false) {
            $request->setModuleName('customurl')->setControllerName('test')->setActionName('test');

        } else {
            return;
        }

        return $this->actionFactory->create(
                        'Magento\Framework\App\Action\Forward', ['request' => $request]
        );
    }

}

When i go to my frontent i get

Front controller reached 100 router match iterations

Please can i get some advice or where i am getting this wrong.


texts: Unable to make product In Stock In Magento2 Admin

texts:
We are using Magento2.3.5-p1 version , We imported all our catalog of 5000+ products and those all are showing finely in front end. When ever we go to Magento Admin Catalog and select any one of the product to edit and make change of your attributes and click on save then product is going to out of stock immediately.
Step 1 : Verified Stock Status of that product in admin panel , It is showing as Out of stock in Advanced Inventory section.
Step 2 : When i tried to select "in stock" value the dropdown is unselectable . It is still showing as Out of Stock, It is not for one product for every product it is same.
Step 3 : I thought that there is issue with my CSV file , So i tried to create a simple product on my own by clicking on Add new simple product from admin. In this case as well In Stock Dropdown value still inaccessible.
Step 4 : When i give Qty greater than 0 it should automatically change status as in stock in magento2 but not happened.
Any solution for this? Please find the attached screenshot of the issue


texts:
I create custom header in cart page like this

<checkout_cart_index>
    <reference name="root">
        <block type="page/html_header" name="header" as="header">
            <action method="setTemplate"><template>page/html/cartheader.phtml</template></action>
        </block>
    </reference>

    <reference name="footer">
        <block type="cms/block" name="Shopping Cart" before="footer_links">
            <action method="setBlockId"><block_id>shoppingcart</block_id></action>
        </block>
    </reference>

</checkout_cart_index>

then i see my log files it shows below error what is problem on it's

  2016-05-06T05:35:51+00:00 ERR (3):
      exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Page_Block_Header' in /var/www/html/domain/app/Mage.php:595
      Stack trace:
      #0 /var/www/html/domain/app/code/core/Mage/Core/Model/Layout.php(495):
  Mage::throwException('Invalid block t...')
      #1 /var/www/html/domain/app/code/core/Mage/Core/Model/Layout.php(437):
  Mage_Core_Model_Layout->_getBlockInstance('page/header', Array)
      #2 /var/www/html/domain/app/code/core/Mage/Core/Model/Layout.php(472):
  Mage_Core_Model_Layout->createBlock('page/header', 'header')
      #3 /var/www/html/domain/app/code/core/Mage/Core/Model/Layout.php(239):
  Mage_Core_Model_Layout->addBlock('page/header', 'header')
      #4 /var/www/html/domain/app/code/core/Mage/Core/Model/Layout.php(205):
  Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element),
  Object(Mage_Core_Model_Layout_Element))
      #5 /var/www/html/domain/app/code/core/Mage/Core/Model/Layout.php(210):
  Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
      #6 /var/www/html/domain/app/code/core/Mage/Core/Controller/Varien/Action.php(344):
  Mage_Core_Model_Layout->generateBlocks()
      #7 /var/www/html/domain/app/code/core/Mage/Core/Controller/Varien/Action.php(269):
  Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
      #8 /var/www/html/domain/app/code/core/Mage/Checkout/controllers/OnepageController.php(212):
  Mage_Core_Controller_Varien_Action->loadLayout()
      #9 /var/www/html/domain/app/code/core/Mage/Core/Controller/Varien/Action.php(418):
  Mage_Checkout_OnepageController->indexAction()
      #10 /var/www/html/domain/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254):
  Mage_Core_Controller_Varien_Action->dispatch('index')
      #11 /var/www/html/domain/app/code/core/Mage/Core/Controller/Varien/Front.php(172):
  Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
      #12 /var/www/html/domain/app/code/core/Mage/Core/Model/App.php(365):
  Mage_Core_Controller_Varien_Front->dispatch()
      #13 /var/www/html/domain/app/Mage.php(684): Mage_Core_Model_App->run(Array)
      #14 /var/www/html/domain/index.php(83): Mage::run('', 'store')
      #15 {main}


texts: Magento 2 Product Detail Page Image Not Loading

texts:
After upgrading Magento 2,
The products detail page product images are not loading, but the product archive page thumbnails are loading or showing.

I have tried ..

Flushing all caches
granting permissions
esizing images

But nothing seems to work or solve the issue. Screenshot here


texts: Magento 2.3 - How add new column/field to sales_shipment table

texts:
I need to add a new column/field (total_volume) to sales_shipment table. I know that I can use two approaches to do this, but what is the best?

The first approach is to use the "Extension Attributes". In this way Magento generate for me the methods getVolume and setVolume.

The second approach is to use the "Declarative Schema". The problem is that with this approach Magento doesn't generate for me the methods getVolume and setVolume. I should use the magic methods (that I don't like too much). To do what I want, I think that with this approach I should extend the ShipmentInterface and create a subclass for Shipment Model. Is it right?

So between these two approaches, what should I use?
When should I use the first and when the second approach?


texts: Magento 2.3 - Customer Login custom product view

texts:
We have a customer who asked that when a customer log's into their account, they can only see the products they have been allocated. Our customer is selling a type of products to different stores. And some of these have a limited product range. Instead of going through all the products on the site, they want only to see the allocated products.
Any help and ideas are appreciated.


texts: Magento 2 Reports Refresh Statistics Cron

texts: Is it possible to refresh report statistics via cron job. Does Magento2 support refresh via cron feature out of the box?


texts: Updated meta title and description for site pages but changes are not reflected on page browser source.

texts: How long does it typically take for magento changes to be reflected on site? I've tried viewing my page on incognito mode and page source does not show the new title and meta description. Please help.


texts: Magento Custom Module + SEO (adding meta tag)

texts:
Here, I put a custom magento "Storelocator" module, however I noticed that the tags "meta" was already preset in the source code of the page.

I just wanted that on this page there are other independent meta tag.
head.phtml and the default file.

I surfed the web to find a solution is I stumbled upon this page :
https://stackoverflow.com/questions/24373670/how-to-rewrite-head-phtml-in-magento

For cons, I want to put meta tags directly into the page storelocator.phtml.

So how to disable the Head.phtml in Storelocator page?

Thank you for your help.


texts: magento2.3 setup:upgrade after magento upgrade Type Error occurred when creating object

texts:
I Upgraded magento 2.1.8 to 2.3.5 and when I run setup:upgrade get the following error...

How can I get more details about this? It seems that Magento_Amqp is not compatible? It becomes after upgrade magento core.


texts:
I have download PRODSECBUG-2233 from magento official site

  patch -p1 < PRODSECBUG-2233-2.2.x-2019-07-26-08-35-48.patch

When i try to use this command, it's not working and show me this errors.

can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: app/code/Magento/Sales/Helper/Admin.php
|IDEA additional info:
|Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|<+>UTF-8
|===================================================================
|--- app/code/Magento/Sales/Helper/Admin.php    (revision d46f8efde7d6e7c40859e833f462c30edc101476)
|+++ app/code/Magento/Sales/Helper/Admin.php    (revision 102b397919b1c82aa13118abb5345ad81c626370)

How can i solve this ? Thanks

Magento 2.2.2 CE CentOS Server


texts: Magento 2 - Override Configurable Product Attribute Label

texts:
In Magento 1.9 you used to be able to override the label for an attribute used in a configurable product (see below):

For example in the image above the default attribute label is Hanging Display Size, but when the 'use default' checkbox is unchecked, you can change it to e.g Width of Hanging Display.

In Magento 2.2 this option doesn't seem to exist. Am I missing it, or is it possible to restore this function?


texts: Layered navigation: intval on price filter

texts:
I can see $prices = array_map('floatval', $prices); in Mage_Catalog_Model_Layer_Filter_Price.

I was wondering if I could intval without creating my own block, etc..?


texts: Add custom fileds to magento payment methods

texts:
I have create a custom payment methods on checkout step. When i save these fields it shows an error message for valid expiry date and cvv number?
Can anyone help me to remove this validation?


texts: Look at my code... How do expand to multiple categories?

texts:
The following code works for one category - ID 9. How do I expand to two categories?

How shall I adjust to make it exclude category ID 9 AS WELL AS category ID 32?

<?php $showStartingAt = !$_product->isConfigurable() && $_product->getAttributeSetId() == 9 && $_product->getCategoryId() != 9; ?>


texts: How to update order data after payment from paypal?

texts:
I am using Magento 1.7 version and having issue while updating data of order after make payment from PayPal.
I have an event sales_order_invoice_pay which works on invoice generate. When I make a payment from PayPal, it generates an invoice of order placed then this event calls.
<sales_order_invoice_pay>
      <observers>
          <test>
              <type>singleton</type>
              <class>test/observer</class>
              <method>getInvoice</method>
           </test>
       </observers>
</sales_order_invoice_pay>

Then, I have a field in sales_flat_order table which I want to update using
$orders = Mage::getModel('sales/order')->load($orderId);
$orders->setFieldId($fieldId);

I have value of both $orderId and $fieldId.
But it is not updating. It shows blank. I think this is due to PayPal IPN which overwrites the value of my field.

Is there any event for updating this value?
Any event which trigger after PayPal IPN received?
Any event which trigger after order detail email sent to customer?
Any idea which solves above issue?


texts: testing extensions on Magento enterprise

texts: I've written a module for Magento CE, but I have a customer that needs to install it on EE. Is there a way of testing if it works on EE without having to pay the 15,000 fee?


texts: Invalid Scope Type 'default' magento 2.3

texts:
I used the command bin/magento setup:upgrade and it returned

  Invalid Scope type 'default'

How can I fix this?


texts: Is it safe to remove zxcvbn.min.js from Magento 2?

texts: I see the file is located in Magento_customer and looks like it is being used for password validation or something. This file is close to 1 MB. Removing this could reduce the page size and can help speedup website. My combined JS is not around 1.5 MB. Would it be safe to just delete zxcvbn.min.js or is there a safer way to remove it?


texts: Magento 2 Make GET Request url to rewrite acceptable

texts:
For example I have this url which makes get Request and renders block with specific collection by Id.

  mainpage.com/products?some_category=99

Since Magento 2 Url Rewrites only accept /params/paramsvalue how could I rewrite my type of url to make it rewrite friendly like this

  mainpage.com/products/some_category/99


texts: How i Can Move Side Bar to Right on My Account Page

texts:
I want to Move Side-bar on My Account Page to Right On The Basis Of Admin Configuration Value

After Some Research i found that it can be done by setting Page layout="2coloums-right" i saw Lots of Post doing this in

  app/design/...

EDIT

here is My

  Vendor\Module\view\frontend\layout\customer_account.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-right" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom">
</page>

how i can do this in my Custom Module


texts: Magento 2 ui multi-select preselected values

texts:
I am new at Magento 2,

UI multi-select component render store views group by websites and stores,

but when I am editing I need saved values of store views of certain record to be preselected in that multi-select.

class StoreViews extends \Magento\Cms\Ui\Component\Listing\Column\Cms\Options
{
    /**
     * @var SegmentFactory $segment
     */
    protected $segmentFactory;

    /**
     * @var Segment $segmentModel
     */
    protected $segmentModel;

    /**
     * @var  Http $reguest
     */
    protected $request;

    public function __construct(SystemStore $systemStore, Escaper $escaper, SegmentFactory $segmentFactory, Http $request, Segment $segmentModel)
    {
        parent::__construct($systemStore, $escaper);
        $this->segmentFactory = $segmentFactory;
        $this->segmentModel = $segmentModel;
        $this->request = $request;
    }

    public function toOptionArray()
    {
        $id = $this->request->getParams()['segment_id'];

        $model = $this->segmentModel;
        $segmentFactory = $this->segmentFactory->create();
        $segmentFactory->load($model, $id, 'segment_id');

        $currentValues = json_decode($model->getData()['store_views']);

        return $options;
    }

}

FORM

 <field name="store_views">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">CodePool\CustomModule\Ui\Component\Form\StoreViews</item>
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">int</item>
                    <item name="label" xsi:type="string" translate="true">Store View</item>
                    <item name="formElement" xsi:type="string">multiselect</item>
                    <item name="source" xsi:type="string">page</item>
                    <item name="dataScope" xsi:type="string">store_views</item>
                    <item name="default" xsi:type="string">0</item>
                </item>
            </argument>
        </field>


texts: Error on Update inventory REST API? when SKU has a "#" in it

texts:
I'm trying to update the inventory of our products from our ERP using the rest api.  I have run into an issue when the SKU has a pound "#" in it.

A URL like:

https://magento.xyx.com/rest/V1/products/3736924F5/stockItems/1

works fine but a URL of:

https://magento.xyx.com/rest/V1/products/3736924F5#M/stockItems/1

Returns the error:

(
    [message] => "%fieldName" is required. Enter and try again.
    [parameters] => stdClass Object
        (
            [fieldName] => product
        )

)

I tried to URL encode the SKU but that didn't work.  Any ideas?


texts: Less file changes not taken in production

texts:
In prod mode with Magento 2.0.5

Making changes to app\design\frontend\mythemes\2016\web\css\source\_extend.less

Then ,

rm -rf var/cache/* var/view_preprocessed/* pub/static/*
php bin/magento setup:static-content:deploy

CSS generated in pub/static/ does not reflect the change.

Is it the right way?


texts:
Anyone suggest in which way Website/Store/StoreView can be used for this.

Need to have 10 domain like store1.domain.com, store2.domain.com... .
A product in Store1 can be visible in all other stores or in only one
store.
A product in Store1 can be in different price in each store.
A product availability will be different in each store Each
Store(store1, store2..) must support multiple language.
While searching in store1.domain.com it must never display the product which is hidden in that domain.

So for this is it possible to have Store1 in Magento as Store or Website ? To accomplish this how to use the Website/Store/StoreView classification.


texts: Magento 2 rewrite product collection for toolbar and filter in product listing

texts:
Which model use in toolbar and filter on product listing page? I need to rewrite collection, but can't find it.
I use event

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_block_product_list_collection">
        <observer name="my_filter instance="Dv\MyFilter\Observer\Myfilter"/>
    </event>
</config>

Code in observer

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

    $event    = $observer->getEvent();
    $event->getCollection()->addAttributeToFilter('my_attr', ['eq' => '1']);;

}

and it works only for product collections in listing. How I can update collection for toolbar and filter navigation?


texts: How to change the table structure Cart page in Custom Magento Theme

texts: I have a custom magento theme installed on magento 1.9.0.1 version called meigee Black and white theme. The cart page table structure is all wrong and I have turned on path hints and tried to change the corresponding phtml file, cart.phtml and default.phtml yet Im not able to re arrange it despite changing the table structure.


texts: Registering a shared service with a custom factory

texts:
I'm wondering how (if I can) register a shared service with a custom factory.

Consider the following code:

class MyApiFactory {
    private $config;

    public function ___construct(Config $config) {
        $this->config = $config;
    }

    //this method could either be __invoke
    //or the class could implement some factory interface
    public function create() {
        return new MyApi($this->config->get('some-value'), $this->config->get('some-other-value'));
    }

}

class MyApi {
}

class MyService1 {
    public function __construct(MyApi $api) {}
}

class MyService2 {
    public function __construct(MyApi $api) {}
}

With other PHP DI frameworks - I would register MyApiFactory as a factory for MyApi. If I requested for service MyService1 the DI container would see that It needs MyApi and therefore execute MyApiFactory to get MyApi - MyApi would then be stored as a service (if the container supports sharing).

Then I ask for MyService2 which also needs MyApi - as MyApi has already been created before - it just pulls it from the DI container and injects it in MyService2.

Therefore MyApi in MyService1 & MyService2 are the same.

I can't seem to find a way to do this in Magento 2. Basically I want to avoid creating MyApi twice.

The only way I can think to do this is to keep a record of the created MyApi inside MyApiFactory so the second time MyApiFactory::create is called it returns the existing instance. Then I would have to inject MyApiFactory into MyService1 & MyService2 and call create within there constructors or wherever.

This (to me) seems wholly unnecessary and quite unintuitive - is this a problem anyone else has come across? Is there some support for shared services with custom factories in Magento 2 ?

This was more of a question to the Magento 2 developers rather than the community, I did originally create this as an issue but that got shut down, refs: https://github.com/magento/magento2/issues/8182#issuecomment-273763661


texts: How to checkout specific product from cms page magento 2?

texts:
I have a virtual product and want to add to the cart when clicking on a button which is on cms page.

Customer must be redirected to checkout page after clicking on the button.


texts: Error occur: crypto_aead_chacha20poly1305_keybytes long when saving password in some payment module

texts:
Do anyone know what is the problem?

is this a php versio problem? i'm using webtatic 7.1.22 version

update: also installed sodium still not work


texts:
Can anybody suggest RTL theme for Magento 2 ?
It is to see content from right to left.


texts:
Please, Can anyone help me on the HeadLess Magento

How to learn Headless Magento From Begin?
How to Implement it on Magento?
What is main Benefit of headless Magento, why we need it, why we implement on this?


texts: magento 2 Rest APi How to use default methods

texts:
Magento 2 Rest API  have many default methods.  I want to use those method and display data.

For that i have create one new user and assigned full admin access.

Trying to get the product information by SKU using default method:
GET  /V1/products/:sku  which is given here

Now i am running following url:

http://127.0.0.1/M224/index.php/rest/V1/products/240-LV09

When i run this url in browser it

<response>
    <message>Consumer is not authorized to access %resources</message>
         <parameters>
              <resources>Magento_Catalog::products</resources>
          </parameters>
</response>

if i use curl code like this:

   $apiURL="http://127.0.0.1/M224/rest/V1/integration/admin/token";

   //parameters passing with URL

     $data = array("username" => "wuser", "password" => "admin@123");

     $data_string = json_encode($data);

        $ch = curl_init($apiURL);

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Content-Length: ".strlen($data_string)));

         $token = curl_exec($ch);

      //decoding generated token and saving it in a variable

      $token=  json_decode($token);

   //decoding generated token and saving it in a variable

    $headers = array("Authorization: Bearer ".$token);

//API URL to get all Magento 2 modules

     $requestUrl='http://127.0.0.1/M224/index.php/rest/V1/products/240-LV09';

     $ch = curl_init($requestUrl);
   curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

 $result = curl_exec($ch);

             //decoding result

             $result=  json_decode($result);

    //printing result
            echo "<pre>";
   print_r($result);

Which works!

How can i access the default methods and show output?  Do i need to curl for this?

For standard practice and MobileAPP output is it good to use CURL to get there?

Is it necessary to write entire token code to get response?

using token it takes time to reponse.  Is there any better way?

Any help would be apprecaited.


texts: What is the status of rounding issues in 1.7?

texts:
We are using Magento CE 1.7 and have various rounding issues. In various calculations there is a 0,01 EUR difference.

The basic issue might be that the article-prices are incl. tax.

Co-programmers overwrote the Mage_Core_Model_Store::roundPrice() method to calculate with 4 digits precision. But this seems to cause issues with PayPal payments.

Is there a solution for those problems?

EDIT:

We actually tried an official core patch which basically adds 4-digit rounding to \Mage_Tax_Model_Sales_Total_Quote_Shipping::_round, \Mage_Tax_Model_Sales_Total_Quote_Subtotal::_deltaRound and \Mage_Tax_Model_Sales_Total_Quote_Tax::_deltaRound which fixes a coupon rounding issue but not the PayPal problem.


texts: Datetime render issue on Magento admin grid

texts:
In our Magento EE dashboard sometimes DateTime column of grids (orders, customer orders) showing incorrect values, this only sometimes, not all times. Maybe it depends on the session, maybe it has the caching problem on Magento.

I could not catch the issue, not any messages related to this issue on error logs. Has somebody faced such type of issue?


texts: source/lib not available in magento 2 frontend design

texts:
trying to modify magento theme blank / luma i realized that code with name -> app/design/frontend/magento/theme/web/css/source/lib is not available in the application, but referred many times in other files mainly .less code.

an example is less code contained in: app\design\frontend\Magento\blank\web\css\styles-l.less

in line 30 displays:

@import 'source/lib/_responsive.less';

but no folder /lib or file _responsive.less is available.

any guidance appreciated.


texts: display error message if cash on delivery is not available

texts:
we are using the following cashondelivery.php : http://pastebin.com/iD28fF2F

app/code/core/Mage/Payment/Model/Method/Cashondelivery.php

here we restricted only some zip codes for allowing cash on delivery payment method, means what zip codes we entered in following file,

if we enter those zip codes than only cash on delivery payment method will display,

if we enter other zip codes cash on delivery payment method will not display . but we have to

display the error message "cash on delivery is not available"

how we can achieve this....


texts:
I'm trying to figure out how can I change the created_at date of a product.

can somebody point me in the right direction on how to do it?

I can't even find where it's stored in the database.


texts:
Our storefront, at store.fraudfighter.com, suddenly started serving up the below error message. It's pretty much out of the blue.  I can't even access via my admin panel, because when I try to navigate to the admin log-in, I get the same exact error page...???

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fraud_storenew.core_store' doesn't exist

Trace:
#0 /home/fraud/public_html/store/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/fraud/public_html/store/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/fraud/public_html/store/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/fraud/public_html/store/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 /home/fraud/public_html/store/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 /home/fraud/public_html/store/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 /home/fraud/public_html/store/lib/Varien/Data/Collection/Db.php(730): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 /home/fraud/public_html/store/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 /home/fraud/public_html/store/lib/Varien/Data/Collection/Db.php(566): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /home/fraud/public_html/store/app/code/core/Mage/Core/Model/Resource/Store/Collection.php(174): Varien_Data_Collection_Db->load(false, false)
#10 /home/fraud/public_html/store/lib/Varien/Data/Collection.php(752): Mage_Core_Model_Resource_Store_Collection->load()
#11 /home/fraud/public_html/store/app/code/core/Mage/Core/Model/App.php(624): Varien_Data_Collection->count()
#12 /home/fraud/public_html/store/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#13 /home/fraud/public_html/store/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#14 /home/fraud/public_html/store/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /home/fraud/public_html/store/index.php(87): Mage::run('', 'store')
#16 {main}


texts: Set origin address for shipping rate estimation

texts:
I have the following script that echoes a dollar value for UPS ground shipping for the given product given the address of the school it will be shipped to in the database. I want to be able to also change the origin region, state, and postal code for the rate estimation. There are multiple rate destinations so I can't just do it in the back end, I need to be able to do it programmatically. How do I do that?

<?php
$dbname='secret';
require_once('connect.php');
require_once('app/Mage.php');
umask(0);
Mage::app();

$product_id = $_POST['productID'];
$customer_id = Mage::getSingleton('customer/session')->getCustomerId();
$productQty = 1000;

$customer = Mage::getModel('customer/customer')->load($customer_id);
$customerSchool = $customer->getSchool();

/* Get info about school */
$sql = 'SELECT  mail_zip FROM schools WHERE school_name =  "' . $customerSchool . '"';

foreach ($con->query($sql) as $row) {
    $mail_zip= $row['mail_zip'];
}

$quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore('default')->getId());

    $_product = Mage::getModel('catalog/product')->load($product_id);

    $_product->getStockItem()->setUseConfigManageStock(false);
    $_product->getStockItem()->setManageStock(false);
    $quote->addProduct($_product, $productQty);
    $quote->getShippingAddress()->setCountryId('US')->setPostcode($mail_zip);
    $quote->getShippingAddress()->collectTotals();
    $quote->getShippingAddress()->setCollectShippingRates(true);
    $quote->getShippingAddress()->collectShippingRates();

    $_rates = $quote->getShippingAddress()->getShippingRatesCollection();

    foreach ($_rates as $_rate){
        if($_rate->getCode()=="ups_GND")
            echo($_rate ->getPrice());
    }
?>


texts: How to load a specific JS at the end of all other included JS files?

texts:
I have a specific fancybox.js file which I want to load at the end of all the JS files included in my local.xml

If load order can be changed then how can a JS file be loaded (included) at the end ?

Thanks.


texts: Remove block from layout depends on condition

texts: I want to remove  block product.info.addtocart from layout depends on some conditions


texts: how to fix php curl extension error while installing magento 2

texts:
How to fix php curl extension error while installing magento 2?

I attached the Screenshot


texts: How to make payment method visible in admin order creation

texts:
We need to often create orders in the backend via the admin panel. Currently three payment methods are available, credit/debit card, bank transfer and purchase order. I however need more than that, others are activated in the config>system but are still not visible in admin order creation.

Could any one please advise?

I would be grateful, thanks


texts: Add to cart error : ReferenceError: productAddToCartForm is not defined

texts:
I am stuck here when i click on add to cart button the firefox console is giving the following error. ReferenceError: productAddToCartForm is not defined i have tried adding the $.noConflict() and jQuery.noConflict() but they are not helping.

This was working some time ago but now this throwing error although i havn't touch it for a while.

Any idea about it.


texts:
Want to know how we can Set Shopping Cart Price Rule in Magento 1.9.2 for specific Category?

i have 1 product which is under multiple categories but i only want to put Condition on One Particular Category which means if i choose the item from that particular Category then the Rule will apply and if i choose the same product while i am in an other category then the rule will not apply.

How can we achieve this ?


texts: How to migrate custom fields to Magento2

texts:
I'm trying to set up my migration mapping to transfer over some custom fields that were created by installed modules, but I'm unsure how to define that in map.xml

For example, I have the field sales_flat_order.onestepcheckout_customercomment which I'd like to move to sales_order.onestepcheckout_customercomment. So I include the following in my map.xml:

    <move>
        <field>sales_flat_order.onestepcheckout_customercomment</field>
        <to>sales_order.onestepcheckout_customercomment</to>
    </move>

But the migration tool doesn't know the destination field sales_order.onestepcheckout_customercomment and so fails to map it.

My guess is there is some <transform> block I should be using, but I can't find any documentation detailing the different transform handlers.


texts: How to get product option value from quote_item_options table in magento 2?

texts:
I want to get product option from quote_item_options.

I want product option from item which is added to cart.

I just call event checkout_cart_product_add_after and in that observer i want product option

so which model is use to get that data in magento 2?


texts: How to call category collection on home page in magento 2?

texts: I want to show all the category on the left sidebar on home page. Please let me know how to get all the categories by collection, or there is another way to call all the category. please let me know


texts: Magento 2 - Create simple hello world script with uiComponent

texts:
I try to create my own Component and reuse it.
So I created these files:

THEME = app\design\frontend\company\fresh

Component File:
THEME\web\js\elements\custom\input_number.js
define([
  "jquery",
  "uiComponent"
],
function($, Component) {
  "use strict";

    return Component.extend({

        initialize: function () {
            return this._super();
        },

        test: function()
        {
            console.log("Hello world!");
        }
    });
});

requirejs-config.js:
THEME\requirejs-config.js
var config = {
    paths: {
        inputNumber: 'js/elements/custom/input_number'
    },
};

Using the new component:
THEME\Magento_Checkout\web\js\view\minicart.js
I copied the file from vendor into my theme so that I can make changes. Now I try to use my component and call my test method:
define([
    'uiComponent',
    'Magento_Customer/js/customer-data',
    'jquery',
    'ko',
    'underscore',
    'sidebar',
    'mage/translate',
    'mage/dropdown',
    'inputNumber'
], function (Component, customerData, $, ko, _, inputNumber) {
    'use strict';

    inputNumber.test();    // [ERROR] Failed to load the "Magento_Checkout/js/view/minicart" component.`

    ...

I also tried to fix the parameter order like Jorge Henrique explained:
define([
    'uiComponent',
    'Magento_Customer/js/customer-data',
    'jquery',
    'ko',
    'underscore',
    'inputNumber',
    'sidebar',
    'mage/translate',
    'mage/dropdown'
], function (Component, customerData, $, ko, _, inputNumber) {
    'use strict';

    inputNumber.test();    // [ERROR] Failed to load the "Magento_Checkout/js/view/minicart" component.`

    ...

But I still get this error in the console [ERROR] Failed to load the "Magento_Checkout/js/view/minicart" component.

I also tried to call the method inside of the method initSidebar but then I get Uncaught TypeError: inputNumber.test is not a function
THEME\Magento_Checkout\web\js\view\minicart.js:
define([
    'uiComponent',
    'Magento_Customer/js/customer-data',
    'jquery',
    'ko',
    'underscore',
    'inputNumber',
    'sidebar',
    'mage/translate',
    'mage/dropdown'
], function (Component, customerData, $, ko, _, inputNumber) {
    'use strict';

    var sidebarInitialized = false,
        addToCartCalls = 0,
        miniCart;

    miniCart = $("#minicart");

    function initSidebar()
    {
        inputNumber.test();  // Uncaught TypeError: inputNumber.test is not a function

        ...


texts: Magento 2 How to remove the delete option on magento/admin/catalog/product/index

texts:
which files should I edit to remove the delete option at action drop-down menu?
I've tried to remove

 $this->getMassactionBlock()->addItem(
            'delete',
            [
                'label' => __('Delete'),
                'url' => $this->getUrl('catalog/*/massDelete'),
                'confirm' => __('Are you sure?')
            ]
        );

\Magento\Catalog\Block\Adminhtml\Product\Grid.php, but the delete button still appears.

Thanks.


texts: Is it possible to use Database Views instead of Tables in Magento Resource Models?

texts:
I'm experimenting with developing an extension for Magento. I have the following scenario:

Database tables: mydb_table1, mydb_table2, mydb_table3, mydb_table4, mydb_table5

Database view: mydb_view1 that collects the latest values from those tables, mydb_view2 that collects any other value that isn't the latest

For flexibility reasons, I want to use database views as entities in my Resource Model in Magento. Since views and tables appear in different sections of the database schema, do I have to use the XML handle

 for the views or can I use a XML handle like <view></view>? I have 2 different versions of my etc/config.xml file but none of them work:

First version:

<entities>
   <view1>

mydb_view1

   </view1>
   <view2>

mydb_view2

   </view2>
</entities>

Second version:

<entities>
   <view1>
        <view>mydb_view1</view>
   </view1>
   <view2>
        <view>mydb_view2</view>
   </view2>
</entities>

Any help or guidance would be appreaciated, because every tutorial that I find talks about tables but not about views.


texts: 0 item price in cart when add to cart after place order

texts:
I'm building Mobile Magento 2 application with REST API. I'm using the following endpoint to add an item to cart

/V1/carts/mine/items

Then I'm placing an order with

/V1/carts/mine/order

After place order when I add a product to cart first time it has 0 price for an item in the cart.

I've tried to debug on the Magento side and I see that collectTotals for quote produce 0 price, but I'm not sure why. Any ideas here?


texts: how to add custom price for checkout in magento 1.9 soap api

texts: I am trying to add products with custom price using soap API. i am using following npm package https://github.com/MadisonReed/magentoapi.


texts: Magento 2 - How to manually upgrade extensions packaged in ZIP files

texts:
I have an extension I bought that is distributed via a zip file. I installed it just fine, but shortly after they released an updated version.

I can't find any guide online for manually upgrading extensions. I would use the same process used for install, but from what i've ready I get the impression that things like DB tables might not get cleaned / updated properly if I use the exact same steps I used for install.

FYI - I looked and the extension does not include an UninstallSchema.php file, but does include an InstallSchema.php and UpdateSchema.php that I want to make sure gets ran.


texts:
I am using multiple currency like (USD, AED, INR, PKR and CAD etc). But I have single store website in Magento 2.4.0. But My issue is i want to add all prices to these currency through products, fox example i have created simple product but there are only 1 option for Base price, i can only add 1 price for 1 currency that should be convert into all other currencies. I don't want to do that. I want to add individual prices for all currencies in from product section. How to I can do this ?
There is any solution is available for this issue. Please help.
Thanks & Regards


texts:
I would like to export placed orders (regardless of status) including products to a .CSV file. I want one row describing the order and one row for each product in the order.

I want the output to be something like this,

As you can see, it's kind of like a pick slip. The main point is that I want two sets of "headers" for each order and its' products.

Is this possible to output to a CSV file? I don't want a PDF. I'm fairly new to magento, so please bare with me. Anyone have a decent guide or similar?

No paid modules(!). Don't mind customising free modules though.


texts: Are Brim & MGT Cache Extensions the Same?

texts:
http://www.mgt-commerce.com/speed-up-magento-by-full-page-cache.html
http://ecommerce.brimllc.com/full-page-cache-magento.html

See Brim left 'Benifits' against mgt right 'Benefits'.

$200 difference... hopefully somebody isnt getting ripped off...


texts: Get products by filters in magento android

texts: HI is there any way to get the products with filters like filter by price, filter by brand names etc in  android? . I wanted to use "catalogProductList" magento api. Is that right one ? or I need to use any other api? If "catalogProductList" this one is the right api then how to send "filters" to this api? please let me know any reference is available for android.


texts: How to make downloader URL HTTPS -- can't pass PCI scan

texts:
We are doing our scheduled PCI scan and for some odd reason, this year they aren't letting the magentostore.com/downloader url slide. It's being marked as an automatic failure due to the plain text form.

They are saying this URL should be HTTPS.

I looked at some of the biggest sites using MagentoCE and Eneterprise, and they too use an HTTP url for the Magento Connect /downloader/ url.

Any help on this matter is greatly appreciated.

Regards,
Samuel


texts: how to add an additional field in the client panel / during registration

texts:
I have displayed additional fields when registering a new customer.

company name
address
mobile phone

I miss the "company's registration number" field

How can I create this field and display it in the registration form and client panel?


texts:
I tried to install a spanish language pack through magento connect. It seems it was already installed since in the magento connect screen I got a message saying something like : "error : this file is already installed". Since then the server is down.

How can I fix this ? I haven't written down the path to the exact file that seems to cause this issue, and I can't find it.

Thank you !


texts: How can i change the action of the Save Button in AdminHtml?

texts:
In the Save.php file in magento Catalog the Button is defined like this:

'label' => __('Save'),
        'class' => 'save primary',
        'data_attribute' => [
            'mage-init' => [
                'buttonAdapter' => [
                    'actions' => [
                        [
                            'targetName' => 'product_form.product_form',
                            'actionName' => 'save',
                            'params' => [
                                false
                            ]
                        ]
                    ]
                ]
            ]
        ],

At first i thought that action Name was the name of the action of the controller but if i change it with my 'mymodule/mycontroller/save' it doesn't do anything.
Searching in the Magento2 official documentation i found that there is a ButtonActionInterface defined somewhere.
My question is:

  What actually is the action used in the button and where is the file
  where it is defined.

Thanks in advance for the help.


texts: I moved magento folders from ftp.When I open store on my wamp localhost, it gives the error mentioned below

texts:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'finfid.log_visitor_info' doesn't exist, query was: DESCRIBE log_visitor_info

Trace:

#0 C:\wamp\www\local\magento\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\wamp\www\local\magento\app\code\core\Zend\Db\Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 C:\wamp\www\local\magento\lib\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 C:\wamp\www\local\magento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('DESCRIBE `log_v...', Array)
#4 C:\wamp\www\local\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE `log_v...', Array)
#5 C:\wamp\www\local\magento\lib\Zend\Db\Adapter\Pdo\Mysql.php(171): Varien_Db_Adapter_Pdo_Mysql->query('DESCRIBE `log_v...')
#6 C:\wamp\www\local\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(1596): Zend_Db_Adapter_Pdo_Mysql->describeTable('log_visitor_inf...', NULL)
#7 C:\wamp\www\local\magento\app\code\core\Mage\Core\Model\Resource\Abstract.php(212): Varien_Db_Adapter_Pdo_Mysql->describeTable('log_visitor_inf...')
#8 C:\wamp\www\local\magento\app\code\core\Mage\Log\Model\Resource\Visitor.php(172): Mage_Core_Model_Resource_Abstract->_prepareDataForTable(Object(Varien_Object), 'log_visitor_inf...')
#9 C:\wamp\www\local\magento\app\code\core\Mage\Log\Model\Resource\Visitor.php(108): Mage_Log_Model_Resource_Visitor->_saveVisitorInfo(Object(Mage_Log_Model_Visitor))
#10 C:\wamp\www\local\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(463): Mage_Log_Model_Resource_Visitor->_afterSave(Object(Mage_Log_Model_Visitor))
#11 C:\wamp\www\local\magento\app\code\core\Mage\Core\Model\Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor))
#12 C:\wamp\www\local\magento\app\code\core\Mage\Log\Model\Visitor.php(168): Mage_Core_Model_Abstract->save()
#13 C:\wamp\www\local\magento\app\code\core\Mage\Core\Model\App.php(1338): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#14 C:\wamp\www\local\magento\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Log_Model_Visitor), 'initByRequest', Object(Varien_Event_Observer))
#15 C:\wamp\www\local\magento\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#16 C:\wamp\www\local\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
#17 C:\wamp\www\local\magento\app\code\core\Mage\Core\Controller\Front\Action.php(64): Mage_Core_Controller_Varien_Action->preDispatch()
#18 C:\wamp\www\local\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(407): Mage_Core_Controller_Front_Action->preDispatch()
#19 C:\wamp\www\local\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#20 C:\wamp\www\local\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 C:\wamp\www\local\magento\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#22 C:\wamp\www\local\magento\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#23 C:\wamp\www\local\magento\index.php(89): Mage::run('', 'store')
#24 {main}


texts: Tierpricing between customer groups problem

texts:
I am using 2 shops within one Magento.
One for end-users and the other for my retailers.
On the retailer website, I need to separate the user group into wholesale and retail, I added a customer group wholesale with the retail tax scheme.

Old case:
One product A price 29.95 for normal price.
Tier-price for retail group 3 pcs 15.00.
On the List (frontpage) or product view no problem.
On the cart (put 3 pcs in the cart) price is 15.00 p.p.

New case:
I change prices retail group in the wholesale group (remain the prices itself).
I changed the customer to the wholesale group.
After clearing cache (and reindex the whole bunch), On the List (frontpage) and product view, no problem price is 15.00 for 3
On the cart (put 3 pcs in the cart) I see 29.95 p.p.
Tax behavior is correct (system adds the taxes needed)

Any hints about where to look for this strange situation?
I am using Magento 1.7.0.2

edit:
When I am changing the product tier prices user group to the retailer but remain the customer within the wholesale group the prices are wrong on the product view page but correct in the cart??


texts: Magento 2 cash on delivery for particular state

texts:
I need to enable cash on delivery option only for a particular state in a country.

I have tried to do it in "Payment methods" from magento dashboard and found only country-wise cash on delivery option.

Kindly some one guide me to achieve this without much of coding as I am not so good in magento 2.


texts: Unable to Create Roles by Roles Resources "Custom" option type in Magento 2

texts:
We are Unable to access Roles Resources "Custom" option type in Magento 2 to add the custom roles.

When we select Custom option type, nothing is getting displayed. And also no issue is getting logged under Magento logs

Navigated to the following configuration in admin

System -> User Roles -> Add New Role -> Role Resource -> Resource Access select custom

Screenshot:

Environment details:

Magento ver. 2.1.3

PHP 7.0.14
OS: Red hat

Any help in this regard is appreciated.