texts: Magento 2: Way to Show Customer IP on "Customers Now Online"

texts:
I've seen in Magento 2 documentation, it should show IP of "Now Online" customers. However I cannot find any setting related to enable this from admin, and there is no filter option for IP.

Is there a way to show IP of customer who are currently online in website ?


texts: Add Facebook's Custom Audience Pixel Code into Magento

texts:
I need to add a Custom Audience Pixel Code for Facebook into my Magento site. The instructions say to paste this inbetween the   tags, which is simple with basic websites but a lot more complex with Magento.

Any idea where to add this?


texts:
Good day,

From magento ce 2.3.4 admin just in configuration module I can not save or saving button is not working:

a) Firefox most of the time not working

B) google chrome sometimes not working

c) Microsoft edge works ok

console says:

"TypeError: d[0] is undefined" related to https://cdn.mysite/pub/static/versionxxxxxx/adminhtml/Magento/backend/en_US/Dotdigitalgroup_Email/js/node_modules/fancybox/jquery.fancybox.pack.min.js

In order to resolve the issue I have tried:

fix permissions of folder and files, no luck
clear and flush cache, sometimes works
deploy the site, sometimes works

anyone has a solution or experiences the same issue?

at the same time, I am using, nginx, varnish apache and pagespeed.


texts:
This query is slow. Does anyone know why?

SELECT DISTINCT
    `color_idx`.`value`,
    COUNT(color_idx.entity_id) AS `count`
FROM
    `catalog_product_entity` AS `e`
LEFT JOIN
    `searchindex_result_mage_catalog_product` AS `tmp_table`
ON
    (tmp_table.product_id=e.entity_id)
LEFT JOIN
    `cataloginventory_stock_item` AS `_inventory_table`
ON
    _inventory_table.product_id = e.entity_id
INNER JOIN
    `catalog_product_index_price` AS `price_index`
ON
    price_index.entity_id = e.entity_id AND
    price_index.website_id = '1' AND
    price_index.customer_group_id = 0
INNER JOIN
    `catalog_category_product_index` AS `cat_index`
ON
    cat_index.product_id=e.entity_id AND
    cat_index.store_id='1' AND
    cat_index.visibility IN(3, 4) AND
    cat_index.category_id = '2'
LEFT JOIN
    `sales_flat_order_item` AS `t2`
ON
    (e.type_id NOT IN ('grouped', 'configurable', 'bundle')) AND
    e.entity_id = t2.product_id AND
    e.entity_type_id = 4
LEFT JOIN
    `sales_flat_order` AS `t3`
ON
    t3.entity_id = t2.order_id AND
    t3.state != 'canceled'
INNER JOIN
    `catalog_product_index_eav` AS `color_idx`
ON
    color_idx.entity_id = e.entity_id AND
    color_idx.attribute_id = '92' AND
    color_idx.store_id = '1'
WHERE
    (tmp_table.id IS NOT NULL)
GROUP BY
    `e`.`entity_id`,
    `color_idx`.`value`


texts: Architecture, Versioning and API support

texts:
What is the architecture of Magento and Magento Go? Is Magento Go simply a subset of Magento or is it an entirely separate product/code base?

What is the process for determining the version for Magento vs. Magento Go? Are their versions incremented and set in parallel, independently or in some other fashion?

I know that the minimum version to support the SOAP WSI API is 1.6. What is the minimum version of the Magento Go that supports the SOAP WSI API?


texts:
I am trying to install magento2 on xampp server and get these errors:
these PHP extensios are not available:

PHP Extension xsl.
PHP Extension intl.
PHP Extension soap.

Please tell me how to remove these errors.


texts: Magento2 : How to modify the store view url?

texts:
How to change the magento store view url?
For example change "?___store=en" to "?lang=en".


texts: What are the differences between magento cloud extension and open source extension?

texts:
I am searching about cloud extension and open-source extension in Magento. I didn't find any differences between them.
I checked the Magento Extension page, some Extensions have Commerce Cloud and Open Source Edition. For Example; Extension Link

If I want to develop an extension for Commerce Cloud, I don't know what I am doing. Please explain the differences and similarities Magento cloud extension and open-source extension.


texts: how to change custom option contents color in magento

texts: Hi im johnny im the new guy to magento , recently i face a small issues about custom options radio button and checkbox display contents color white, as the contents color is white , in the front end i can't see any texts in the radio button select area. does anyone have idea to fix it? i tried to use the google chrome to locate it to change the contents color. but when i refresh the web page, the color change back. i hope somebody can help .thanks


texts: Is Layered navigation available in SOAP / REST API

texts:
I'm building web services for an Android application, in that i need to provide an filter something similar to Layered navigation.

I've checked in Official Docs of REST and SOAP Web services, Layered navigation is not available in both.

Is it really not available or i didn't checked it properly ?


texts: how to get all attributes name and value from configurable product

texts:
i have configurable product made from different atrributes like : color , size, fabric

now i wrote code below to get all simple product from configurable products

$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($this->getProduct());
$simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();

foreach($simple_collection as $simple_product){
    echo "
". $simple_product->getName() ."	".$simple_product->getSku()."	".Mage::helper('core')->currency($simple_product->getPrice())."	".$simple_product->getQty()."
";
}

1:now i want to get all atributes from which configurable product is made and there respective value for simple products, ie value of color, size and fabric for all products

2:qty show blank why ??


texts: display the result in header for only particular phtml page

texts:
on a particular phtml page, we added following code :

 99999999

welcome &nbsp;
 Sign Out

and its displaying like this, code is reflecting below horizontal line, above horizontal line you can see logo in rectangle shape.

i want to reflect code above horizontal line, means in header.

and it should reflect only in particular phtml page. when i tried through css, it did't worked for me


texts: Magento 2.1.9 Shipment not save in admin side

texts:
I have place order and using authorize.net payment method.I have facing this issue in admin side when save shipment  getting this error

Cannot save shipment.exception 'PDOException' with message 'There is no active transaction' in /home/apps2/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:316
Stack trace:
#0 /home/apps2/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(316): PDO->commit()
#1 /home/apps2/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(510): Zend_Db_Adapter_Pdo_Abstract->_commit()
#2 /home/apps2/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(253): Zend_Db_Adapter_Abstract->commit()


texts:
Array ( [type] => 2 [message] => chdir() [function.chdir]: No such file or directory (errno 2) [file] => /home/studious/public_html/maal-php/lib/Varien/Io/File.php [line] => 567 )

The above error will display when i upload the image on attribute. Attribute image is added perfectly but the above code is also inserted.
when i select the particular image then its show like

"media/image/abc.pngArray ( [type] => 2 [message] => chdir() [function.chdir]: No such file or directory (errno 2) [file] => /home/studious/public_html/maal-php/lib/Varien/Io/File.php [line] => 567 )"

So in the front end attribute images are not showing


texts:
Each password follows different rules to be considered valid.

What rules are required for Magento 2 Admin Password?
Where can this rules be found (GUI or Code)
Does Magento2 offer out of the box functionality to apply custom rules to admin password (e.g a given regex or password length)


texts: Assign Products to Specific Store Programmatically : Magento2

texts: I am trying to assign different products of the main store to other stores programmatically. Is there any way to get it done?


texts:
I got the task to port some custom build stuff from magento 1 to magento 2.
One function was the extension of the order api, now the OrderRepository.

In theory I got it running, but my problem is, that the filterGroups of the searchCriteria is empty.
We used the filterGroups as a container for some custom parameter to execute a SQL filter on the order collection.

e.g. as a parameter we use invoiced_at and adding an SQL to the collection where we collect all orders which invoice is created_at = invoiced_at

Is there any way to get and edit the filterGroups of the searchCriteria?

di.xml

<?xml version="1.0"?>
<config
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

    <type name="Magento\Sales\Model\OrderRepository">
        <plugin name="company_orderrepository_override"
            type="Company\SystemOverride\Model\Plugin\OrderRepositoryOverride" sortOrder="1" />
    </type>

</config>

OrderRepositoryOverride.php

<?php
namespace Company\SystemOverride\Model\Plugin;

class OrderRepositoryOverride {

    protected $_request;
    protected $_logger;

    public function __construct(
        \Magento\Framework\App\Request\Http $request,
        \Psr\Log\LoggerInterface $logger
    ) {
        $this->_request = $request;
        $this->_logger = $logger;
    }

    public function aroundGetList(
            $subject,
            $proceed,
            \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria) {
                $this->_logger->debug("_request: " . json_encode($this->_request));
                $this->_logger->debug("subject: " . json_encode(get_class_methods($subject)));
                $this->_logger->debug("proceed: " . json_encode(get_class_methods($proceed)));
                $this->_logger->debug("get_class_methods->searchCriteria: " . json_encode(get_class_methods($searchCriteria)));
                $this->_logger->debug("searchCriteria: " . json_encode($searchCriteria));
                $this->_logger->debug("getFilterGroups: " . json_encode($searchCriteria->getFilterGroups()));
                $this->_logger->debug("getSortOrders: " . json_encode($searchCriteria->getSortOrders()));
                $this->_logger->debug("getPageSize: " . json_encode($searchCriteria->getPageSize()));
                $this->_logger->debug("getCurrentPage: " . json_encode($searchCriteria->getCurrentPage()));
                $searchResult = $proceed($searchCriteria);
                return $searchResult;
    }
}

debug.log

main.DEBUG: _request: {} [] []
main.DEBUG: subject: ["__construct","get","getList","save","delete","deleteById","___init","___callParent","__sleep","__wakeup"] [] []
main.DEBUG: proceed: ["bind","bindTo","call","fromCallable"] [] []
main.DEBUG: get_class_methods->searchCriteria: ["getFilterGroups","getSortOrders","getPageSize","getCurrentPage","setFilterGroups","setSortOrders","setPageSize","setCurrentPage","__construct","setData","__toArray"] [] []
main.DEBUG: searchCriteria: {} [] []
main.DEBUG: getFilterGroups: [{}] [] []
main.DEBUG: getSortOrders: null [] []
main.DEBUG: getPageSize: 25 [] []
main.DEBUG: getCurrentPage: 0 [] []

rest response

{
  "items": [],
  "search_criteria": {
    "filter_groups": [
      {
        "filters": [
          {
            "field": "created_at",
            "value": "2020-01-20",
            "condition_type": "eq"
          }
        ]
      }
    ],
    "page_size": 25,
    "current_page": 0
  },
  "total_count": 0
}


texts: Why is the default .gitignore in Magento 2 ignoring files from /pub/media?

texts:
I want to version control my Magento 2 site project, it has lots of catalog images. All .gitignore templates I found online are excluding from /pub/media , why is that?

There are different cases where another developer might need the images also
Also, if I want to deploy to live server, lets say AWS EC2 using git, (pulling from the remote repo) the images would be missing.

Can the experts please give me some insight on this issue?


texts: Magento 2: How to split catalog database (split database architecture)?

texts:
I am trying to use Magento 2.0 split database scalability feature. Below document explains how to split master databases but has no information on splitting slaves.

How can I set up separate database server for Catalog?

http://devdocs.magento.com/guides/v2.0/config-guide/multi-master/multi-master_masterdb.html


texts: Custom created Magento controller link to 404

texts:
after no sleep night full of googling and trying things, I need your help.
My created controller for Magento 1.9, is inaccessible at the address ("whoops, our bad..." page):
http://magento1.at/customblog/test/test

domain/frontname/controllername/actionname

I have already tried running this on windows and mac, repaired permissions of every file and folder, admin panel logout-login, clearing cache, reindexing data, checking my code, and still no luck. The module btw is working, I can Enable/Disable it in admin, and the install script worked with no problems.
So. please, tell me where my problem is at, thanks, everyone so much!
Here is my code:

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Atwix_CustomBlog>
            <version>1.0.0</version>
        </Atwix_CustomBlog>
    </modules>
    <global>
        <helpers>
            <Atwix_CustomBlog>
                <class>Atwix_Customblog_Helper</class>
            </Atwix_CustomBlog>
        </helpers>
        <models>
            <customblog>
                <class>Atwix_Customblog_Model</class>
                <resourceModel>customblog_resource</resourceModel>
            </customblog>
            <customblog_resource>
                <class>Atwix_Customblog_Model_Resource</class>
                <entities>
                    <block>

atwix_article

                    </block>
                </entities>
            </customblog_resource>
        </models>
        <resources>
            <atwix_customblog_setup>
                <setup>
                    <module>Atwix_Customblog</module>
                </setup>
            </atwix_customblog_setup>
        </resources>
    </global>
    <frontend>
        <routers>
            <customblog>
                <use>standard</use>
                <args>
                    <module>Atwix_Customblog</module>
                    <frontName>customblog</frontName>
                </args>
            </customblog>
        </routers>
    </frontend>
</config>

TestController.php

<?php
class Atwix_CustomBlog_TestController extends Mage_Core_Controller_Front_Action {

    public function TestAction()
    {
        echo('test');
    }
}


texts: Customer Specific Product module doesn't work in Magento 1

texts:
I have a problem with Customer Specific Product module in Magento 1.9. I installed the module but it works only when I am logged in with full privilege(full admin), if I make a new user role and I give this privilege for him doesn't work.
I have two pictures to show you the problem. In the first picture I am logged in with the new role that I created and when I try to change the section to Customer Group Specific Products nothing happened. And the second picture shows what should be displayed when I change the section. In the second picture I am logged in with full privilege.


texts:
I'm aware this might not fall strictly into the stack exchange rules, however there seems to be growing frustration within the magento 2 world of development, but somewhere needs to try help people as the magento team are always shutting down tickets regarding performance.

--

This question is not about performance on production servers, so please no recommendations for things like varnish, redis, minifying/concatenating files etc.

--

What have people found to be the most optimal setups for having a fast streamlined magento 2.2+ development environment, for both Windows and OSX.

Keeping in mind the following

Docker
Vagrant
Mamp/Wamp
Native binaries with apache/nginx
Grunt/Asset generation performance
Postgres, MySQL, Maria etc

--

Personally we've found they've all been slow in the ways we've attempted, including using Laravel Valet, Vagrant, OSX apache/php-fcgi - and they're all terrible.

--

What have others found to be good setups as certain users seem to think we all must just be doing it wrong, without shedding any light onto their solutions.


texts: Magento2 Sharing product link for WhatsApp Web with bitly link

texts:
Magento2 Share product link for WhatsApp Web with bitly link
how to currentUrl share with bitly link?
$objectManagerInstance=\Magento\Framework\App\ObjectManager::getInstance();

$url = $objectManagerInstance -> get('Magento\Framework\UrlInterface');

$currentUrl = $url -> getCurrentUrl();

<div class="whatsapp_share <?php echo $size_class; ?>">
  <a href="whatsapp://send?text=<?php echo $text?>%0A%0A<?php echo "",$currentUrl."";?>"><?php echo __('Share');?>


texts:
I am creating a Magento plugin/module which I would like to have insert html in various places on my site, such as for adding statistics in the footer - one version for the admin footer and another for the front end footer. The content itself is ready to go, just need to figure out how to get it onto the page.

However, I'm having a hard time locating a page that discusses how to use a plugin to inject dynamic content so I'm not quite sure where to begin. Still figuring out how Magento works, so any assistance/tutelage would be appreciated!

Do I need to create a separate template under the /app/design/ directory and somehow trigger this (perhaps with an observer)? Or can the template files exist as, say, a file within my module's "Block" directory?
I'd prefer to keep everything contained within /app/code/local/My_Co/My_Mod/ if it can be done.


texts: There has been an error processing your request error

texts:
I have installed the OwlCarouselSlider for Magento 2 downloaded from the MarketPlace. Upon login to the dashboard i get the following error:

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 2019932515

This is a copy of the report.

a:4:{i:0;s:71:"Setup version for module 'WeltPixel_OwlCarouselSlider' is not specified";i:1;s:1383:"#0 D:\xampp\htdocs\PCM\store\vendor\magento\framework\Module\DbVersionInfo.php(56): Magento\Framework\Module\DbVersionInfo->isModuleVersionEqual('WeltPixel_OwlCa...', '1.0.1')
#1 D:\xampp\htdocs\PCM\store\vendor\magento\framework\Module\DbVersionInfo.php(79): Magento\Framework\Module\DbVersionInfo->isSchemaUpToDate('WeltPixel_OwlCa...')
#2 D:\xampp\htdocs\PCM\store\vendor\magento\framework\Module\Plugin\DbStatusValidator.php(55): Magento\Framework\Module\DbVersionInfo->getDbVersionErrors()
#3 D:\xampp\htdocs\PCM\store\vendor\magento\framework\Interception\Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#4 D:\xampp\htdocs\PCM\store\var\generation\Magento\Framework\App\FrontController\Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#5 D:\xampp\htdocs\PCM\store\vendor\magento\framework\App\Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#6 D:\xampp\htdocs\PCM\store\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#7 D:\xampp\htdocs\PCM\store\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#8 {main}";s:3:"url";s:20:"/PCM/store/admin_pcm";s:11:"script_name";s:20:"/PCM/store/index.php";}

I have also run the following commands:

bin\magento indexer:reindex
bin\magento setup:static-content:deploy
bin\magento cache:flush
bin\magento module:enable WeltPixel_OwlCarouselSlider
bin\magento setup:upgrade
bin/magento setup:di:compile -vvv

None of these worked. Any ideas on how to fix the issue or remove the extension completely from the store?

Thanks


texts: Magento 2 - Calling Custom Media Attribute

texts:
I am trying to call a custom media attribute, and it is assigned to the product; thus I created size guide phtml and I hooked it to the product view, but I ended up with an undefined error "Undefined variable: _product"

<?php
    $imageHelper = $this->helper('Magento\Catalog\Helper\Image');
    $attributeImage = $_product->getCustomAttribute('sizechart_desktop');
    $attributeImageUrl = $imageHelper->init($_product, 'sizechart_desktop')->setImageFile($attributeImage->getValue())->getUrl();
?>

            &times;

            <img src="<?php echo $attributeImageUrl; ?>" />


texts: Magento 2: Change price + tier prices of configurable product and variants afterwards

texts:
We run Magento 2.1.7 and want to change prices and tier prices of configurable products' variants. Doing that seems to be really painstaking as
- price input field of configurable product is disabled after first save and
- it seems that you have to edit every product variant's price separately.

Even if changing tier prices on every simple product variant tier prices from master article are used. The cannot be edited after product was saved once.

Honestly, that should be a basic feature of a shop system these days. Has anyone the same problem and/or a solution how I can change price of configurable product afterwards?


texts: How to use getFieldset for customer in magento2?

texts:
I have used below code in magento1 to get customer attributes.

$customerAccount = Mage::getConfig()->getFieldset('customer_account');
    foreach ($customerAccount as $code => $node) {
        if ($node->is('name')) {
            $fields[$code] = $code;
        }
    }

How the same code can be used in m2?
  Please anyone suggest me on this.

here is my full action method of m1.

  public function createPostAction()
{

    if (!$this->_getSession()->isLoggedIn()) {
        $this->_redirect('customer/account/login');
        return;
    }

    $this->_getSession()->setEscapeMessages(true);
    if ($this->getRequest()->isPost()) {
        $errors = array();

        $user = Mage::getModel('customer/customer')->setId(null);
        $master = Mage::getSingleton('customer/customer')->load($this->_getSession()->getCustomer()->getMasterId());
        $data = $this->getRequest()->getPost();

        $defaultFields = array();
        foreach (Mage::getConfig()->getFieldset('customer_account') as $code=>$node) {
            $defaultFields[] = $code;
            if ($node->is('create') && isset($data[$code])) {
                if ($code == 'email') {
                    $data[$code] = trim($data[$code]);
                }
                $user->setData($code, $data[$code]);
            }
        }
        foreach ($this->_getSharedFields() as $_att) {
            $user->setData($_att, $master->getData($_att));
        }

        try {
            $validationUser = $user->validate();
            if (is_array($validationUser)) {
                $errors = array_merge($validationUser, $errors);
            }
            $validationResult = count($errors) == 0;

            if (true === $validationResult) {

                $user->save();
                foreach ($this->_getSharedFields() as $_att) {
                    $user->setData($_att, $master->getData($_att));
                }
                $user->save();

                $message = $this->__('User was successfully created');
                $this->_getSession()->addSuccess($message);

                $this->sendNewSubUserAccountEmail($user);

                $this->_redirect('*/*/list');
                return;
            } else {
                $this->_getSession()->setCustomerFormData($this->getRequest()->getPost());
                if (is_array($errors)) {
                    foreach ($errors as $errorMessage) {
                        $this->_getSession()->addError($errorMessage);
                    }
                }
                else {
                    $this->_getSession()->addError($this->__('Invalid user data'));
                }
            }
        }
        catch (Mage_Core_Exception $e) {
            $this->_getSession()->setCustomerFormData($this->getRequest()->getPost());
            if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
                $url = Mage::getUrl('customer/account/forgotpassword');
                $message = $this->__('There is already an account with this emails address. If you are sure that it is your email address, click here to get the password and access your account.', $url);
                $this->_getSession()->setEscapeMessages(false);
            }
            else {
                $message = $e->getMessage();
            }
            $this->_getSession()->addError($message);
        }
        catch (Exception $e) {
            $this->_getSession()->setCustomerFormData($this->getRequest()->getPost())
                ->addException($e, $this->__('Can\'t save user'));
        }
    }
    $this->_redirectError(Mage::getUrl('*/*/new', array('_secure' => true)));
}

I am looking for code in magento2 for below one

 $user = Mage::getModel('customer/customer')->setId(null);

How this can be used in magento2?


texts: Which Checkout event should I use to execute code after product is added to cart?

texts:
I'm working on Magento CE 1.9 and I would like to execute the following code after the customer adds a product to cart:

<?php
$id = '226'; // Replace id with your product id
$qty = '1'; // Replace qty with your qty
$_product = Mage::getModel('catalog/product')->load($id);
$cart = Mage::getModel('checkout/cart');
$cart->init();
$cart->addProduct($_product, array('qty' => $qty));
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
?>

The above code will programmatically add a product to cart. Ultimately, I'm going to test to see if the conditions of a shopping cart price rule are met and if so, run that could which adds a free "gift" or promotional product.

I've got my basic module configured. I'm just curious which event I should make use of that will allow me to add a product and update the cart? These appear to the applicable options:

checkout_cart_add_product_complete
checkout_cart_product_add_after
checkout_cart_update_items_before

So everytime a product from my catalog is added, an event is fired and my code is executed. Thanks in advance.


texts: Getting swatch value from checkout_cart_product_add_before observer

texts:
Is it possible to get the Swatch value id or name from the checkout_cart_product_add_before observer? I've passed the Product using
$product = $observer->getProduct();
$productId = $observer->getProduct()->getId();

but I can't find anywhere online on how to get the swatch value or child id of the saved product, currently, it only passes the configurableID and I need the Simple id. Looping through the associated products is no good as I need the one that was selected


texts: where is declared layout xml file in module?

texts:
i am learning to create a module from here.

  http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html

And on in this article everything is fine even workin also but i want to know where local.xml file is declared.

  app/design/frontend/base/default/layout/local.xml

When i call this action method how it know that it have to load template from layout/local.xml. why it did not try to load template from other xml file?

public function call_blockaction() {
//remove our previous echo
//echo 'Hello Index!';
$this->loadLayout();
$this->renderLayout();
}


texts: How can I lock an attribute on Mage_Customer_Model_Customer?

texts:
I found a question about locking product attributes so that they cannot be edited after the product is created. I'd like to do the same thing with a customer attribute in CE.

The solution with products is to use lockAttribute() inside the model's _load_after event, but lockAttribute() doesn't exist on the customer model.

Invalid method Mage_Customer_Model_Customer::lockAttribute(Array
(
    [0] => my_custom_attribute
)
)

Is there a simple way to lock a customer attribute by calling a different method somewhere, or do I need to do something like override the relevant adminhtml form model and template and lock the field by hand?


texts: Magento2.2.4 : What is The New Features in New Release Magento (2.2.4)?

texts:
What is the difference between Magento 2.2.3 and 2.2.4 version?
Is the Main thing of New Release Reduces Cart Abandonment in Magento 2.2.4?
What are the new features were introduced in these release?
What is the difference when we move from 2.2.3 to 2.2.4


texts: Shoplift vulnerability if admin panel is hidden?

texts:
Among the six installations I have access to there's one that was apparently compromised by Shoplift. This is the only one that has a standard /admin backend url.

After patching all of them and reading many resources I guess that a site isn't vulnerable to Shoplift if the attacker doesn't know the admin URL - which corresponds just fine to the observation.

Still not fully convinced - especially after reading the full story by CheckPoint -, though, so: is it?

The - at least at first sight - uncompromised sites are on shared hosting without shell access so any deeper investigation will be pretty expensive. Hence knowing that the attack has no impact without knowledge of the admin URL would be a huge life(/time) saver.

PS: $this->question is ! about (security by obscurity || the possibility of brute forcing the admin URL).


texts: Magento2: Showing custom table data as options for select dropdown in UI component grid form

texts:
I have a UI grid form in the admin, that allows the admin to edit the data in a grid. The grid is listing data from a custom table multivendor_pickupinstore with structure below:

id
seller_id
order_id
product_type
pickup_date
created_at
status

Now in the edit form I need to add the drop-down to choose the seller. The data is in another table multivendor_user with columns as below:

is_vendor
userstatus
user_id
priority
storeurl
storetitle
email
name

What I have done so far is create the form with all the input fields. please see the field component in the form.xml file,

    <!-- This field has data type 'select' and standard 'input' form element and looks like input -->
    <field name="seller_id">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">[Vendor]\[Module]\Model\Select\Source\Options</item>
            <item name="config" xsi:type="array">
                <item name="componentType" xsi:type="string">field</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="label" xsi:type="string">Seller</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="source" xsi:type="string">p_pickups</item>
            </item>
        </argument>
    </field>

I understand that the model [Vendor]\[Module]\Model\Select\Source\Options can be used to return the required option array. I have the model [Vendor2]\[Module2]\Model\Sellers that can be used to return the seller collection (table multivendor_user). But I am not able to get data from custom table.
Could someone please help me with this. Thank you in advance.


texts: Magento2 - Translate custom links (name) at main menu

texts:
How can I translate custom links (name) at my main menu?

e.g

Home (/)  ->  Strona glowna  (/)

About Us (/about-us)      -> O nas  (/o-nas)

Contact (/contact)    ->  Kontakt  (/kontakt)

I add custom posiotion to mainmenu in this code:

E:\xampp7\htdocs\mgnt2\app\design\frontend\TemplateMonster\framework\TemplateMonster_Megamenu\templates\html\topmenu.phtml

        <button class="rd-navbar-toggle" data-rd-navbar-toggle=".rd-navbar-nav-wrap"></button>

                <?php echo $_menu;?>

                    <a href="<?php echo $this->getBaseUrl()."o-nas"; ?>"  role="menuitem"> <?php echo __("Your Custom Menu")?>


texts:
I have a custom attribute for min_price I need to update this field using data from the cost field using a formula.  (cost+1.50)/.84

Any ideas on how I can do this?

I've tried to make since of the EAV database and do it in MySQL directly but it's confusing to say the least.

https://stackoverflow.com/questions/24580872/mysql-multiple-select-statements-with-an-update


texts: Hide old price when group price is setted - Magento 2

texts:
I am using magento version 2.3.1 with the "Porto" theme installed. I have set a group price for a product. In the frontend I see the original strikethrough price and the set price for user group. Is it possible to hide the original strikethrough price ONLY when the group price is set? While if I set the "normal" discount (special price) is the original price shown?

Recapping:
If I set a group price -> show only group price
If I set a discount (special price) -> show both (original and special price)

Thanks and sorry for my bad english


texts:
Is that possible to generate dynamic less CSS?

Is there any other way without replacing dynamic CSS in phtml file?


texts: How can i add a template in all the pages except in category page

texts:
I have a template called test.phtml in \magento\app\design\frontend\rwd\newtheme\template\test\test.phtml

In page.xml layout file I am not getting how to add my template to appear in all pages except product page.


texts: How to install Magento using command-line? I would like to know how to do this. I have tried to install Magento using command-line but I couldn't do it successfully. So I would like to know if it's possible to install Magento, using command-line, in my local PC?


texts: Magento2 : How to add Upload Field in Payment Method section for checkout page?

texts:
I want to create my custom payment method which I created now.

And I want to create upload file field and save in payment table in database, and also save file in folder and attach in email.
How can I achieve this?


texts:
How to delete AMP pages from Magento?
How to remove AMP pages from Magento?


texts: Magento catalogProductUpdate specify currency

texts:
Is there a way to specify the currency of the price with the catalogProductUpdate (SOAP V2) call?

I use Magento soap V2 API via PHP to update the price of a product. Our price management system is based on USD prices. Our Magento default currency is in CAD. Here's my call :

$this->soap_client->catalogProductUpdate($this->soap_session_id, 'magento-sku',
    array(
        'price' => '25.99'
    )
);

I would like the '25.99' to be in USD while still keeping CAD as our default currency.


texts: Additional options are getting removed from the quote item

texts:
We have developed a custom module to add the additional options to the cart item using the observer events "checkout_cart_product_add_after" and "sales_model_service_quote_submit_before". It seems everything is working fine.

But, when we apply coupon code or enable gift options from the back-end or perform any default magento action l(like delete item, update item, etc) then new quote item id is being generated and old one has been removed. New one is being displayed without additional options we have added earlier.

This issue has been resolved in Magento 2.2 but can someone help us for version 2.1.*.

Magento 2.1.7, PHP 7.0, Mysql 5.6
Preconditions

Install Magento 2.1.9
Create a product (simple/configurable)
Add the product into the cart with some specific additional options. We have followed the steps from this https://webkul.com/blog/additional-options-cart-item-magento2/
Steps to Reproduce

Apply coupon code from the cart page or enable gift options from global configuration on product level.
Added additional options will be removed.
Expected result

Data shouldn't be changed from the quote and added additional options should always be there.
Actual result

https://drive.google.com/file/d/1Ds-JxlWostO9bU9PmLo6dKxvYUxvFR_Y/view
https://drive.google.com/file/d/1px-YUpFrJtXpPcvjWPt8V5F06LDimoH6/view
Hopefully, you will get idea about the issue by above explanation. However, please let us know if you have any confusion.

Thank you in advance. Looking forward to hearing from you soon.


texts: How can I bulk change the sort of my images?

texts: When I bulk upload images, all the images arranged according to the second images. How can I bulk update the images displayed based on the first image?


texts: Problems creating category Magento 2.1.7

texts:
my code to create a category is the following:

private function createCategory($name='',$parentId=2,$active=true,$description='',$metaTitle='',$metaKeywords='',$metaDescription='')
{
    if(!isset($metaTitle))
    {
        $metaTitle = $name;
    }
    $categoryRepository = $this->categoryRepository;
    $category = $this->categoryFactory->create();
    $category->setName($name);
    $category->setParentId($parentId);
    $category->setIsActive($active);
    $category->setCustomAttributes([
        'description' => $description,
        'meta_title' => $metaTitle,
        'meta_keywords' => $metaKeywords,
        'meta_description' => $metaDescription,
    ]);
    $category->save();

    $categoryRepository->save($category);

    return $category->getId();

}

this error came up: [Magento\Framework\Exception\AlreadyExistsException]

URL Key for specified store already exists

Any solution for this?

Can't expect this to happen when importing data.

PD: Thanks for your time.


texts: How to override magento_sale module phtml file?

texts:
I am unable to override this file in adminhtml of magento_sale module here is the path
vendor\magento\module-sales\view\adminhtml\templates\order\create\totals\shipping.phtml

The issue is that file is not rendering from layout and also can't find its block so how can i override this file any solutions


texts: How to rename the tabs under Details on product details page in Magento 2

texts: I use a Porto theme for my Magento 2 store and wondering if there's an easy way to rename the Details tabs on product details page.


texts: Magento 1.9.3 Upgrade Missing core_email_queue_recipients table

texts:
After upgrading Magento 1.9.1 to 1.9.3.1 manually via FTP, the site works fine except when you get to the checkout success page. It is blank.

The exception log shows that the core_email_queue_recipients table is missing.

Checking the database with MySQL Workbench shows that it is indeed missing. I am assuming that the SQL upgrade script did not fire, but I have no idea how to fire this.

Some sources say to go to the core_resources table and modify the database version value there to make it fire, but they don't mention which 'code' field value is the database version. See https://community.magento.com/t5/Version-Upgrades/1-9-0-1-to-1-9-2-2-missing-core-email-queue-table/td-p/22350

Any ideas?


texts: Magento 2 afterRender ko binding loses customer scope

texts:
I have a custom block rendered in header which displays the customer's available credit limit.

 0 ? 'block' : 'none' }, afterRender: function(){jQuery('body').addClass(customer().customer_group_class);}">

After rendering this DOM I want to add a specific class to the body which is set in customer object as customer().customer_group_class. The problem here is the class does not get added. However, if I use the text binding, the class is displayed in that section.
Why is customer object undefined in afterRender binding?


texts: Get Selected drop down attribute in frontend?

texts:
I got all the drop down attribute value in this way

    <select class=" required-entry required-entry select" name="product[age]" id="age">
        <?php
             $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','age');
             $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
             $attributeOptions = $attribute->getSource()->getAllOptions();
             foreach($attributeOptions as $each){?>
               <option value="<?php echo $each[value]?>"><?php echo $each["label"]?></option><?php
             }

}?>
    </select>

In Here attribute Id = age. Now i already store some value in database that should be in selected

Please Help me for this
Thanks in advance

Also i used in this code

<select class=" required-entry required-entry select" name="product[age]" id="age">

<?php $productId = $this->getProduct()->getId();
$product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($productId);
$selectedvalue  = $product->getAttributeText('age');

$atributeCode = 'age';
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product',$atributeCode);
        $options = $attribute->getSource()->getAllOptions();

        foreach($options as $key => $value){

            if(in_array($selectedvalue,$value)){
                ?>
                <option>
                <?php echo $value['label'] ; ?>
                </option><?php
                continue;
            }
?>
                <option>
                <?php echo $value['label']; ?>
                </option><?php

        }?>
</option>
</select>

it also display all attribute value not highlighted selected value


texts:
I added a product programmatically in cart and redirected to checkout page. But Can't place Order.

class Wallet extends \Magento\Framework\App\Action\Action
{

protected $formKey;
protected $cart;
protected $product;
protected $_response;
protected $customerRepository;
protected $addressRepository;

public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\Data\Form\FormKey $formKey,
\Magento\Checkout\Model\Cart $cart,
\Magento\Catalog\Model\Product $product,
 \Magento\Framework\App\ResponseInterface $response,
 \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository ,
 \Magento\Customer\Api\AddressRepositoryInterface $addressRepository,

array $data = []) {
    $this->formKey = $formKey;
    $this->cart = $cart;
    $this->product = $product;
     $this->_response = $response;
     $this->customerRepository = $customerRepository;
     $this->addressRepository = $addressRepository;
    parent::__construct($context);
}

public function execute()
 {

  $productId =482;
  $params = array(
                'form_key' => $this->formKey->getFormKey(),
                'product' => $productId, //product Id
                'qty'   =>1 //quantity of product
            );
    //Load the product based on productID
    $_product = $this->product->load($productId);
    $this->cart->addProduct($_product, $params);
    $this->cart->save();
    //$this->_response->setRedirect('magento')->sendResponse();
    header("Location: https://test.rkhomeappliances.co.in/checkout/#payment"); exit;

    //https://test.payu.in/_payment_options
    //https://test.rkhomeappliances.co.in/checkout/#payment
 }

}


texts: Disk quota exceeded at my cpanel root of Magento website

texts:
The issue is that I am on unlimited shared hosting and there is a lot of unused disk space but I can not login to Magento backend or even add product to the cart or save any file at the root.
When I try to save any files (for example: cleanup.php) all I get is:
ERROR: Could not create file "cleanup.php" in /home/thewa2m2/public_html: Disk quota exceeded

I know Magento has a huge number of files but the directory /public_html/var/report cannot be opened, I am thinking too many duplicate of reports at the root directory of /var/report.
My question is: can I delete them? Will it affect my site?
how do I Stop my site from duplicating report or how do I stop unnecessary continuous report of my site?
my site still give me same report as paste below, please how do solved this issue?
a:5:{i:0;s:52:"Front controller reached 100 router match iterations";i:1;s:409:"#0 /home/thewa2m2/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(179): Mage::throwException('Front controlle...')
1 public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
2 public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
3 public_html/index.php(87): Mage::run('', 'store')
4 {main}";s:3:"url";s:102:"/skin/frontend/default/ma_libra_electronic/layerednavigationajax/images/ui-bg_flat_0_aaaaaa_40x100.png";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"english";}


texts:
I am using Postman to test send data to different websites e.g

I have 2 websites each has its own domain e.g onoe website one store and one store view per domain.

e.g

1- http://test.com have:

default website -> default store -> default store view

2- http://test.co.uk

website two -> store two -> store view two

this my setup to send data to website two

POST = http://test.com/soap/store_view_two_code?services=catalogProductRepositoryV1

XML request=

  <?xml version="1.0" encoding="UTF-8"?>
 <soap:Envelope xmlns:def="http://test.com/soap/store_view_two_code?
services=catalogProductRepositoryV1"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
   <def:catalogProductRepositoryV1SaveRequest>
    <product>
      <sku>000123-sku</sku>
      <price>99.00</price>
    </product>
   </def:catalogProductRepositoryV1SaveRequest>
  </soap:Body>
 </soap:Envelope>

XML response=

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
    <env:Body>
        <env:Fault>
            <env:Code>
                <env:Value>rpc:ProcedureNotPresent</env:Value>
            </env:Code>
            <env:Reason>
                <env:Text>Procedure not present</env:Text>
            </env:Reason>
        </env:Fault>
    </env:Body>
</env:Envelope>

Now that tell me that def:catalogProductRepositoryV1SaveRequest  isn't defined in the store_view_two_code

But if I change the the url for the request in xmlns like this:

...
<soap:Envelope xmlns:def="http://test.co.uk/soap/store_view_two_code?
services=catalogProductRepositoryV1"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
...

Note: I've just just replaced the test.com to test.co.uk and that gives success response.
Can someone tell me if this is normal behaviour why do I need to specify the the domain for the second url in the request to get success While the POST URL never  needs changing?

Here is some ref: https://github.com/magento/magento2/issues/14626

Thanks in advance.


texts: Magento 1.9.4 Session Error with PHP 7.2

texts:
I upgrade PHP from 7.0 to 7.2 for magento 1.9.4.2 using redis session storage.
But it's tack much time for session connection and got below session errors in log file.
 1. PHP Fatal error:  Uncaught Error: __clone method called on
    non-object in
    /app/code/core/Mage/Core/Model/Session/Abstract.php:214
 2. Warning: Unknown: Cannot call session save handler in a recursive
    manner  in Unknown on line 0
 3. Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: /var/lib/php/sessions)  in Unknown on line 0

I already use latest version of Cm_RedisSession & Cm_Cache_Backend_Redis.


texts: how can i override my core CSS file class according to my custom _module.less?

texts:
This is my table in configuration and down there is core css class for that with name ".accordion .config .value" i want to change the width of that class from 44% to 100%.

I have my custom _module.less file  and in that i have but not working

@centerpadding: 21px 308px;

.accordion .config .value
{
  width: 100% ;
}


texts:
Does anyone know any modules that can be used to import/export cms pages (and blocks) in CE?

The scenario I am looking at now is:

users (content editors) create pages/blocks with content on a staging website (cloned after live site, different db, different servers)
after the pages are being validated, the users create the pages again on the live site (copy-pasting)

Some things to take into consideration:

it shoudn't keep a reference to the store views by IDs, rather use the store view code
duplicate pages on import should be identified by url key and store views


texts: In magento 2.0 how can i add new top links and remove existing one using xml

texts:
app/design/frontend/Amydus/test/Magento_Theme/layout/default.xml

<?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">

        <referenceContainer name="header.container">
            <block class="Magento\Framework\View\Element\Html\Myblock" name="header.myblock">
                <arguments>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceBlock name="top.links">
            <block class="Magento\Framework\View\Element\Template" name="tlink.them" before="-" template="Magento_Theme::html/header.phtml"/>
        </referenceBlock>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_img_width" xsi:type="number">148</argument>
                <argument name="logo_img_height" xsi:type="number">43</argument>
            </arguments>
        </referenceBlock>
        <referenceContainer name="footer">
            <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="switch/stores.phtml"/>
        </referenceContainer>
        <referenceBlock name="report.bugs" remove="true"/>
        <move element="copyright" destination="before.body.end"/>

</page>

app/design/frontend/Amydus/test/Magento_Theme/templates/html/header.phtml

<?php
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $custSession = $objectManager->get('Magento\Customer\Model\Session');
?>
<?php switch ($block->getShowPart()):
    case 'welcome': ?>

CALL US AT - 9560740007

 |

  EASY RETURNS & EXCHANGE

 |

        <?php if(!$custSession->isLoggedIn()): ?>

HI GUEST

        <?php else: ?>

<?php echo 'Hi '.$custSession->getCustomer()->getName(); ?>

        <?php endif; ?>

 |

            <?php if($custSession->isLoggedIn()): ?>
                LOG OUT
            <?php else: ?>
                LOGIN
            <?php endif; ?>

    <?php break; ?>

    <?php case 'other': ?>
        <?php echo $block->getChildHtml(); ?>
    <?php break; ?>

<?php endswitch; ?>


texts: Trouble reindexing - forgein key constrain fails

texts:
I deleted all products by truncating tables.
Now, after uploading all products again I get this:

    Product Attributes index process unknown error:

    exception 'PDOException' with message 'SQLSTATE[23000]: Integrity
constraint violation: 1452 Cannot add or update a child row: a foreign key
 constraint fails (`XXXXXX`.`catalog_product_index_eav`, CONSTRAINT
`FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY
(`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE
CASCA)'

How can I repiar the database now so eindex is working again? How can I find the right entities to delete?


texts:
I need to rename the options in the Sort By dropdown on catalog listing page, i.e. 'Product Name' and 'Price'.
Please guide how can I achieve this, thanks.


texts: Magento 2 Discount/Coupon Code Can Only Be Applied in Cart Page

texts:
I am using Magento 2.2.5 and if I apply a discount code in the cart this works OK. However, if I try to apply discount code in payment/checkout page this does not work.

Can anyone please advise a fix?

The text 'apply' doesn't even populate on the button.


texts:
I have placed one order in my Magento 2 store and it's working perfectly but in sales order the tax price round off issue in some order. When I have place order with multiple items the round off-price issue for this sees below snap.
https://prnt.sc/u6qjfi
And if I place only this 2 item order the price should be perfect in order, for this see below snap.
https://prnt.sc/u6qgzs
Any one have solution for this.


texts: How can i hide product slider extension from Contact us, Terms and conditions, and 404 not found page?

texts:
I have installed a third party product slider extension in my Magento 1.9. I have enabled it only in the homepage. As in the backend (CMS->pages) the pages contact us, terms and conditions and 404 not found page comes as the sub of the homepage. Since the product slider is showing in all those pages. How can i remove slider from all other pages and retain it in the homepage only?
Thanks in advance


texts: Magento 2 Multiple Sales Order Grid(Duplicate) as per order Status

texts:
I am looking for solution for multiple sales order Grid as per order status.
One grid will have all pending order and another grid for Processing orders.

Please have a look attached screenshot.

how is this possible?Please give me an idea for that.


texts: Persistent permission issue on my folders

texts:
I am having some issues with my magento 2.3.1 stored on a ubuntu 16.04 server .
each time i run  php bin/magento setup:upgrade, the VAR and GENERATED folder always loses its permission until i run sudo chmod 777 -R var/ pub/ generated/ to give it full permissions but this keeps bugging out.

I am thinking of using

CRON to run a script that will run every minute that will give the folders full permission.
or
using HTACCESS to get this done. [using https://stackoverflow.com/questions/10086989/htaccess-file-to-allow-access-to-images-folder-to-view-pictures]

So far, Nothing is working fine


texts: Magento 2 Create Catalog Price Rule Programmatically

texts:
I have used the below code to create catalog price rule programmatically. It creates the rule,but the conditions are not saved.

$catalogPriceRule = $this->_objectManager->create('Magento\CatalogRule\Model\Rule');
$catalogPriceRule
    ->setName('name')
    ->setDescription('description')
    ->setIsActive(1)
    ->setCustomerGroupIds(array(1))
    ->setWebsiteIds(array(1))
    ->setFromDate('')
    ->setToDate('')
    ->setSimpleAction('by_fixed')
    ->setDiscountAmount(10)
    ->setStopRulesProcessing(0);

$conditions = array();
$conditions[1] = array(
    'type' => 'catalogrule/rule_condition_combine',
    'aggregator' => 'any',
    'value' => "1",
    'new_child' => ''
);

$i = 1;
$conditions['1--1'] = array(
    'type' => 'catalogrule/rule_condition_product_found',
    'value' => 1,
    'aggregator' => 'all',
    'new_child' => '',
);

$conditions['1--1--1'] = array(
    'type' => 'catalogrule/rule_condition_product',
    'attribute' => 'sku',
    'operator' => '==',
    'value' => '24-UB02',
);
$catalogPriceRule->setData('conditions',$conditions);
$catalogPriceRule->loadPost($catalogPriceRule->getData());
$catalogPriceRule->save();
$catalogPriceRule->applyAll();


texts: Magento 2: How to Show different quantity for specific product type in product grid?

texts:
I have a custom table for specific product type to store the product qty, the query to select the qty is like this for example:
SELECT a.qty FROM custom_product_table WHERE product_id = 1;

i noticed the qty column is rendered in this file
vendor/magento/module-catalog-inventory/Ui/DataProvider/Product/AddQuantityFieldToCollection.php
public function addField(Collection $collection, $field, $alias = null)
{
    $collection->joinField(
        'qty',
        'cataloginventory_stock_item',
        'qty',
        'product_id=entity_id',
        '{{table}}.stock_id=1',
        'left'
    );
}

How can i assign my custom  query as qty column only when the product type id is my custom product type id, for example type_id = 5 ?
IF(e.type_id = 4)
      (SELECT a.qty FROM custom_product_table WHERE product_id = e.entity_id) AS qty
ELSE
   $collection->joinField(
        'qty',
        'cataloginventory_stock_item',
        'qty',
        'product_id=entity_id',
        '{{table}}.stock_id=1',
        'left'
    ) AS qty


texts:
I am kind of new to magento but I don't why am I getting the error :

Fatal error: Call to a member function getStore() on string in /var/www/html/app/code/local/Webkul/Preorder/Helper/Data.php on line 641

after making the purchase.

Any suggestion why am I getting this error.

On line 641 in Data.php I have following code:

 $storeId = $order->getStore()->getId();


texts: Magento 2: Override grid.phtml file from custom module

texts:
I am new to magento development can you help me how to override grid.phtml which resides in

vendor\magento\module-catalog-widget\view\frontend\templates\product\widget\content\grid.phtml

I need to customize this template from my module. but i am not understand how to override this file, where to put and all.


texts:
When running vue storefrontend, there is a error in homepage:https://prnt.sc/sz102n
error display in console:500 internal server error

https://prnt.sc/sz0zcj


texts: Address book redirect to 'new' always when I click on address book

texts:
In account pages when I click on address book on left side panel it redirect to add new address form  with url customer/address/new/

while , In actual I should go to index where I can see address in address book.

Why its happening any idea ?


texts: Extension attribute on order make a column error

texts:
I'm trying to add an extension attribute to my order entity.

I've follewed this link  : https://www.rakeshjesadiya.com/extension-attribute-in-order-data-magento-2/

But I can see my extension attribute in my backend order entity.

Also, for the /sales/order/history, i've this  :

    public function getOrders()
{
    if (!($customerId = $this->_customerSession->getCustomerId())) {
        return false;
    }
    if (!$this->orders) {
        $this->orders = $this->getOrderCollectionFactory()->create($customerId)->addFieldToSelect(
            '*'
        )->addFieldToFilter(
            'status',
            ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
        )->addFieldToFilter('my_attribute', array("eq" => "Some value"))
            ->addFieldToFilter("category_ids", array("nin" => 9))
            ->setOrder(
            'created_at',
            'desc'
        );
    }
    return $this->orders;
}

But I have this error :

  Column not found: 1054 Unknown column 'my_attribute' in 'where clause', query was: SELECT COUNT(*) FROM sales_order AS main_table WHERE (main_table.customer_id = '70') AND (status IN('canceled', 'closed', 'complete', 'fraud', 'fraud', 'holded', 'payment_review', 'pending', 'processing')) AND (my_attribute = 'Some value') AND (category_ids NOT IN(9)) [] []

I need this because I need to hide orders where the orders contain certains category of product, if you know how to to this it woul be great !


texts:
I have a system.xml file in which I add some fields to admin configuration. This is one of my group/section/fields:

<config>
  <sections>
    <notifier translate="label" module="notifier">
      ...
      <groups>
        <general translate="label comment" module="notifier">
          ...
          <fields>
            <allow>
              Enabled
              ...
              <comment><![CDATA[
            Some HTML here:

              - sth,

              - sth,

              - sth,

              - sth.
          ]]></comment>
            </allow>
          </fields>
        <general>
      <groups>
    <notifier>
  <sections>
<config>

I can translate the label easily. I put this line into my csv file:

"Enabled":"Enabled"

But how can I translate the comment part?


texts: Magento showing server's IP under remote_ip

texts:
My magento install showing the server's IP in sales_flat_order/remote_ip. I want to show the client's IP.

I already tried this but not worked.

What to do?


texts:
I have image tag in phtml file ..

And also i got the value of images and media url from ajax call .

How to bind it like that in ko template

<img alt="<?php echo $sizeGuideImage->getAlt() ?>" class="img-responsive" data-src-base="<?php echo $this->getMediaUrl() ?>" data-src="<479:<?php echo 'sizeguide/small/' . $sizeGuideImage->getSmallImage() ?>, <767:<?php echo 'sizeguide/medium/' . $sizeGuideImage->getMediumImage() ?>, <1399:<?php echo 'sizeguide/large/' . $sizeGuideImage->getLargeImage() ?>, >1400:<?php echo 'sizeguide/extralarge/' . $sizeGuideImage->getExtraLargeImage() ?>" />


texts: Restrict buying of only the related product

texts:
I'm using Magento 2.3. I need to have the feature, where I've a two products A & B.

Now, a customer can buy product A and can buy product B only with product A. Product B cannot be sold separately.

Thus, if the customer adds product A and B, and deletes product A from the cart, then product B must also get deleted. However, if product B is only deleted, then product A must still remain in the cart.

Please suggest a solution.

Thanks.


texts: My store was working fine earlier today, but I don't know why and how my dashboard just stopped showing the details of last 5 orders now.Here it is http://s32.postimg.org/7i1hvcmgl/dash.jpg


texts: Customer login does not work after customer import via CSV (Hash not same)

texts:
I successfully exported my customers from Magento 1 into a CSV and then used the import tool in Magento 2 to import them. On the backend everything looks fine and all customers and addresses are listed.

However, if you try to login from the frontend, it says:

"Invalid login or password."

Looking at the customer csv file I noticed that the password hashes seem to be inconsistent. With some older ones looking like this:

4a42437364414ac618c65623a7337639:mZ

And newer ones down at the bottom of the csv file look like this:

13d82841997285ad391a7a951ec414fe:AzzxM5yPIZaEHfS9kEh2EjZlvcuDzTd5

I'm guessing Magento updated their hashing method at some point and this is the result.

Any ideas how to make the older ones compatible with Magento2?

Thanks.


texts: How to add a customer pre-approval module?

texts:
I'm using Magento 1.4.1.1. I'm thinking of adding a pre-approval module on my website. All new customers will need a back-office approval, before being able to log in.

I'm quite new in Magento but want to know whether there is an easy of doing it by myself  ?


texts:
In checkout page, when I select Portugal as country appears the image 1:

And after I change the country, for example I put Spain, and again I select Portugal and appears this:

I need that ALWAYS appear the second image. The dropdown.
I don't know what is happening. What is the problem?


texts: How does "front name" of a module affect its routing?

texts:
This is a question that comes to me as i faced below situation:

I had an extension with front-name: "csmymodule". I changed its front-name with: "mymodule".

But I notice that both these urls work:

http://examplesite.com/csmymodule/index/abc , http://examplesite.com/mymodule/index/abc

But the same works totally opposite with Mage_Contacts module: Even here I changed its front-name from "contacts" to "contact-us", and the following page redirects me to 404 page:

http://examplesite.com/contacts

And this page works fine:

http://examplesite.com/contact-us

Why is it so? Can i do anything such that old urls do not work or redirect to the new ones as they are called?
I am also curious to know how these both urls point to same page and why!


texts: Magento 2 Custom customer attributes with select list

texts:
Can someone point me in the right direction here? For a new magento 2 install I want to be able to add some custom attributes for the customer in the backend.

One of the attributes must be only visible in the backend
One of the attributes needs to be a selectlist be predefined variables.

Like:
Insurance company 1
Insurance company 2

Update:
In the end I fixed it with the help of:
Basic module: http://www.extensions.sashas.org/blog/magento-2-1-3-how-to-make-customer-attribute-update.html

Select list: Adding customer multiselect attribute


texts: Change value of all attributes using php file

texts:
We use more than 1000 attributes in our Magento store, that all have the value is_comparable "yes".

I want to change this value to "no" for all attributes in my Magento store.

How can I achieve that, by using a file?
Otherwise I need to edit 1000 attributes by hand.


texts: Magento 2 NO Access-Control-Allow-Origin redirect on other web site

texts:
In my Controller I use

$this->_response->setRedirect($url);

I got this error.

  Access to XMLHttpRequest at 'URL' (redirected from 'myWebStoreUrl')
  from origin 'myServerUrl' has been blocked by CORS policy: Response to
  preflight request doesn't pass access control check: No
  'Access-Control-Allow-Origin' header is present on the requested
  resource.

What should I do?


texts: Magento 2 Virtual Type real time usage example

texts:
I am working in Magento2, in that, I hear about some new concept virtual type, so I like to use the virtual type in my development(if it's needed).

But I have gone through so many blogs to understand, but no one has given the clear scope & real-time example.

Here I am looking for your great support to understand the virtual type with real-time usage.

share me your thoughts & idea about the virtual type


texts: Mandrill or Magento adding %20 to the end of my links

texts:
I'm currently using Mandrill to track my transaction emails.  Within those emails I have links.  Not sure why but when I click on the links via the preview or within my email client the links come up with errors.

Here is what comes up. "https://www.facebook.com/myshop%20" The %20 breaks the link.

Below is the original code.

Any help would be greatly appreciated.
Magento 1.9.2
Mandrill 2.0.7


texts:
I am experiencing random 404 on my product pages. I cant reproduce it, it happens and on reload it works. I found Product page 404 error only sometimes, but I dont understand what the solution should be.

Any ideas?

Magento 1.9.3.6


texts: Image's don't upload on product page and shows spinner icon

texts:
I'm attempting to add product images when adding a new product but I'm having a problem. The image uploads, but the spinner remains. As shown below:

I've done some digging. If I open the inspector window I see the following error:

Uncaught TypeError: Cannot read property 'value' of undefined
at product-gallery.js:138
at Function.grep (jquery.js:471)
at $.<computed>.<computed>.setBase (product-gallery.js:133)
at $.<computed>.<computed>.setBase (jquery-ui-1.9.2.js:432)
at $.<computed>.<computed>._addItem (product-gallery.js:217)
at $.<computed>.<computed>._addItem (jquery-ui-1.9.2.js:432)
at HTMLDivElement.handlerProxy (jquery-ui-1.9.2.js:739)
at HTMLDivElement.dispatch (jquery.js:5232)
at HTMLDivElement.elemData.handle (jquery.js:4884)
at Object.trigger (jquery.js:5136)

Which leads to the following code:

I put a breakpoint there and .value is null.

The image uploads, but only to the  products/tmp directory. I've checked all error files in var/log and nginx and php logs. There's no errors.

Anyone know why this might be happening? All permissions are correct (775 for media/* directory). Can't understand what would cause this. Also happens if I switch back to Luma from my current theme.

The theme I'm using has no adminhtml that's overriding anything.

Any advice?


texts: Magento 2 add custom(comment text) field in checkout shipping method

texts:
In Magento 2.3.0, checkout page i wants to add custom field (Comment text field) at shipping method tab.
Please suggest me how can i do this ?

Thank you


texts: How to add new div section in ko template(Checkoutpage payment section) in magento 2

texts:
I wish to add one div section on the checkout page(payment section) to add a custom message. How do I add it in below KO template
Magento/SalesRule/view/frontend/web/template/payment/discount.html.
Please provide me a solution.

I need to show message in after apply discount button
I have added a div in Magento/SalesRule/view/frontend/web/template/payment/discount.html. But It is falied to show the div section in checkout page(payment section)


texts: Load invoice by invoice id and invoice increment id

texts: I have an invoice id or an invoice increment id, is there a way to load an invoice using these?


texts: Overriding Quote Item Weight Programatically

texts:
My goal is to alter the weight of a product based on a chosen custom option. I have the custom option part working, but am unable to alter the weight of the item is such a way that affects the shipping estimates.

The below code partly works, in that it initially sets the correctly updated weight in the quote_item table. However, this gets overwritten, and is always overwritten before shipping is calculated. Is there a better way to do this? Or should I be plugging in later, perhaps? Any thoughts would be greatly appreciated!

<?php

namespace Ibex\Options\Model\Plugin;

use Magento\Quote\Model\Quote;

class Weight
{
    protected $configurationHelper;

    public function __construct(
        \Magento\Catalog\Helper\Product\Configuration $configurationHelper
    )
    {
        $this->configurationHelper = $configurationHelper;
    }

    public function beforeSetProduct(\Magento\Quote\Model\Quote\Item $subject, $product)
    {
        $logger = \Magento\Framework\App\ObjectManager::getInstance()->get('\Psr\Log\LoggerInterface');

        $customOptions = $product->getCustomOptions();

        if (isset($customOptions['option_ids'])){
            $optionIds = $customOptions['option_ids'];

            foreach (explode(',', $optionIds->getValue()) as $optionId) {
                $option = $product->getOptionById($optionId);
                if (isset($customOptions['option_'.$optionId])){
                    $itemOption = $subject->getOptionByCode('option_'.$optionId);

                    $group = $option->groupFactory($option->getType())
                    ->setOption($option)
                    ->setConfigurationItem($subject)
                    ->setConfigurationItemOption($itemOption);

                    if($group->getOption()->getValueById($itemOption->getValue())){
                        $optionValue = $group->getOption()->getValueById($itemOption->getValue());
                        $selectedWeight = $optionValue->getCustomWeight();
                    }
                }
            }
        }
        $weight = $product->getWeight();
        if(isset($selectedWeight)){
          $newWeight = $weight + $selectedWeight;
        }
        if(isset($newWeight)){
          $product->setWeight($newWeight);
        }
        return [$product];
    }
}


texts: Emails declined because of helo localhost

texts:
I'm stuck on configuring smtp settings in magento 2 2.3.5-p1.
I'm using mageplaza smtp plugin - everythings fine here. The emails are sent correctly but are declined by other hosters because of the helo / ehlo entry 'localhost'.
Where did this come from and how can i change that?


texts: Need Layered Navigation to lead to a specific part (ID) of page

texts:
I have implemented layered navigation to my homepage that have a top slider, now when I use filtration,it reloads page showing results but slider on top, so I have to scroll down a bit to get to my filtered content.

=> What I need is simply to add the section ID to URL like :

  www.example.com/?cat=140#maincontent

How to do it with Magento 2?

Can anybody help me please?


texts:
I would like to know theme execution flow of Magento 2.

I select a theme name 'A' and try to visit a page. Then I change the theme to 'B' and try to visit that same page. Which execution flow the themes will follow ? What will change in this theme changing situation ?


texts: how to call phtml file in left side bar in frontend?

texts:
I want to call phtml file in left side bar in frontend.

My xml code is

    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>
    <reference name="left">
        <block type="theaterbooking/theaterbooking" name="theaterbooking" template="theaterbooking/movieinfo.phtml" />
    </reference>
    <reference name="content">
        <block type="theaterbooking/theaterbooking" name="theaterbooking" template="theaterbooking/movietheater.phtml" />
    </reference>

I call movieinfo.phtml but it is not called.

how can i do?


texts: Shopping cart rule for a particular set of SKU's in a category

texts:
How can i set a shopping cart rules for particular set of SKU's in a category. I have tried below condition but the rules applies for all SKU's in a category.

  If ALL  of these conditions are TRUE :

  If an item is FOUND  in the cart with ALL  of these conditions true:

  SKU  is one of SKU1,SKU2,SKU3


texts: Magento2 - How to get estimate shipping rates for guest users using js?

texts:
I have followd this link to get estimate shipping rates, its working fine for logged in user. But I need to implement this with guest user as well.

I have changed service url for guest user as explained in the article and pass static quote id for testing purpose.

  serviceUrl =
  'rest/default/V1/guest-carts/:quoteId/estimate-shipping-methods'

Service with quote id :

  serviceUrl =
  'rest/default/V1/guest-carts/317/estimate-shipping-methods'

But its throwing error.

Can anyone help.. how we can achieve it for guest user?


texts: Magento : Fatal Error While Migrating From Magento 1.5.1 to 1.6.2

texts:
I have following error after my upgrade :

Fatal error: Call to undefined method Mage_Core_Model_Config::getResourceHelper() in /home/koala/dev/magento/koala/app/Mage.php on line 531

I ve set up some debug here :

/**
 * Retreive resource helper object
 *
 * @param string $moduleName
 * @return Mage_Core_Model_Resource_Helper_Abstract
 */
public static function getResourceHelper($moduleName)
{
    $registryKey = '_resource_helper/' . $moduleName;
    var_dump($registryKey);
    if (!self::registry($registryKey)) {
        $helperClass = self::getConfig()->getResourceHelper($moduleName);
        self::register($registryKey, $helperClass);
    }

    return self::registry($registryKey);
}

And the resource helper called is :

string(21) "_resource_helper/core"

Does anyone had and fixed this issue?

Thanks


texts: How to add filter to the collection of attributes in magento 2

texts:
magento 1 code to get all the attributes collection

public function getAttributes()
    {
        $collection = Mage::getResourceModel('catalog/product_attribute_collection')->addVisibleFilter()->addIsFilterableFilter();
        return $collection;
    }

I am changing magento1 code to magento 2 like below It get the collection but while applying filters like addVisibleFilter(),addIsFilterableFilter() then it is failed to load the collection. Please provide me a solution to get all the attributes with filters.

protected $_attributeFactory;

 public function __construct(
    ....
    \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attributeFactory,
    ....
) {
    ....
    $this->_attributeFactory = $attributeFactory;
    ....
}

public function <func_name>()
{
    $attributeInfo = $this->_attributeFactory->getCollection()->addVisibleFilter()->addIsFilterableFilter();

 }


texts: How to send transactional mail with attachment in magento 2.3

texts: How can I send email with attachment in magento 2.3.I already tried the way of custom  TransportBuilder class from many answer but not working at all.I'm new to magento pls help me.


texts: Change order status after invoice in Magento 2.3.3

texts:
How do I change the order status NOT STATE after I create an invoice in Magento 2?

I created a custom status called Invoiced, assigned it to state processing.

  Status code: processing[Invoiced]

When I submit an invoice I want the order to be assigned to this new status.

What additional steps do I need to do?


texts: My site is taking a Full minute to load due to slow queries?

texts:
My Magento Site , using a Theme, is taking a Full Minute to load up !!

The Host Provider has advise its due to SLO"W QUERIES.
I'm using a 4GB RAM Server, so dont think it's the problem.

Optimising the Tables has not resolved the problem.

Does anyone know if the the "Full Page Cache" Extensions will resolve the problem ?

Or is the Theme Template faulty ?

I really like the Theme since it's best suited to the business model & want to continue using it.

How can i resolve the issue of SLOW QUERIES ?

Pls help.


texts: Order state when creating shipping label

texts:
I have created a script that automatically create UPS shipping labels when a certain orders have the status "ready_for_ups".

However I'm unsure to which "state" I should assign this to. Is it "pending" or "processing".

Almost all of our payments are done with credit card and a few with bank wire transfer.


texts: How can I link images that are already on the server to a new product uploaded via api with only one call?

texts:
I uploaded about 12000 products to pub/media/<custom-dir-name>

I now want to link them to products as I upload them using the API.

The product creates just fine, but no images are linked.

{
  "product": {
    "sku": "sku",
    "name": "name",
    "price": 9.99,
    "attribute_set_id": 9,
    "status": 1,
    "visibility": 4,
    "type_id": "simple",
    "weight": "0.5",
    "extension_attributes": {
        "category_links": [
            {
                "position": 2,
                "category_id": "5"
            },
            {
                "position": 3,
                "category_id": "4"
            }
        ],
          "stock_item": {
            "qty": "10",
            "is_in_stock": true
        }

    },
    "custom_attributes": [
        {
            "attribute_code": "description",
            "value": "description"
        },
        {
            "attribute_code": "tax_class_id",
            "value": "2"
        },
        {
            "attribute_code": "image",
            "value": "/<dir-name>/A41024DGAM.jpg"
        },
         {
          "attribute_code": "small_image",
          "value": "/<dir-name>/A41024DGAM.jpg"
        },
        {
          "attribute_code": "thumbnail",
          "value": "/<dir-name>/A41024DGAM.jpg"
        }
    ]
  }
}


texts: I Need Help In Issue In My Theme Configuration: Magento 2

texts: I think there is must be in-store and storeview the name of my store and store view ?? it was working but now when I go to edit anything in this design configuration it does not apply on my website .. I have tried the indexing and cache flush ??


texts: Unable to generate sitemap.xml in Magento 2.3.3

texts:
Recently i moved from Cpanel to AWS afer that when i click on generate sitemap i am getting below error.
Path "/var/www/html/" cannot be used with directory "/var/www/html/"
For reference please find the attached image.


texts: It's always making logout everytime i make an action

texts:
Every time I login with my account on the website an tries to make an action it will logout.

Example:
I will go to the login page and insert the username and password, and it redirects me to my info-account page. But if I go to the products page, contacts page or shopping cart page and come back to the account page, it will always logout.

There is an exception: for instance if I go to the "about us" page or terms and conditions page and come back, I will still be able to see my info account.


texts:
I'm creating a new theme for a Magento 2.2.6 community edition and I need to wrap all the content inside a CSS class. To do so I had to change

<main id="maincontent" class="page-main">

to

<main id="maincontent" class="page-main myCustomWrapper">

To do that. I understand I need to change the line

<container name="main.content" htmlTag="main" htmlId="maincontent" htmlClass="page-main">

in the in the empty.xml file to

<container name="main.content" htmlTag="main" htmlId="maincontent" htmlClass="page-main myCustomWrapper">

I've tested that in the vendor/magento/module-theme/view/base/page_layout/empty.xml file and it worked. I then reverted and tried copying it to my theme. I followed the instructions here: Override base empty.xml file to rename the page-wrapper class and tried all possible combinations I could think about. Here the list of the files I tried:

Magento_Theme/view/layout/override/base/empty.xml
Magento_Theme/view/layout/base/empty.xml
Magento_Theme/view/frontend/layout/page_layout/empty.xml
Magento_Theme/view/frontend/page_layout/empty.xml
Magento_Theme/view/base/page_layout/empty.xml
Magento_Theme/page_layout/empty.xml

They all inside my frontend theme, but none of the tested files worked.

Is my frontend theme working?

Yes. That was the first thing I tried. I changed it int the backend/admin, I changed the Magento_Theme/templates/html/header/logo.phtml and changes were shown in my site, so the theme does work.

Did I clean cache?

Yes, before refreshing the page, I did clean the cache and remove all files in pub/static/* var/view_preprocessed/ var/di/* var/generation/* after every change in all the possible */empty.xml.

I asked in the freenode channel, I looked in the magento stackexchange site, but nothing.

Any hints will really be appreciated.


texts: How to make last two digit price is always 00? Magento 1

texts:
I set $1 = 1150 KRW as currency rate. Is there any way I can show the last two digits of KRW is always 00?

For example, if the product price is $15.5(15.5 x 1150=17,820 KRW), but I want to show 17,800 KRW (last two digits 00)


texts: display percentage of discount on product list and product view page in magento

texts:
We used "Promotions > Catalog price Rule " to give discounts for all products in our site.

for some category products we gave 20 % off and for some products we gave 10 % off.

i want to display percentage of discount on "product list " and "product view page" as like below

" [20 off]%"

please help me to find solution.


texts: Customer created / logged in timestamps in Admin

texts:
Over the weekend (2014-10-04 midnight through 2014-10-06 noon) I noticed that the customer created and last logged in dates were incorrect in the Admin.

Last Logged In: Oct 6, 8295 10:12:43 AM (Offline)

Last Logged In (America/New_York):  Oct 4, 2014 11:58:15 AM (Offline)

Account Created on: Oct 6, 8187 10:12:43 AM

Account Created on (America/New_York):  Oct 4, 2014 11:56:27 AM

This was happening only for updates (new customers, customer logins) that occurred within that timeframe; it stopped at noon on 2014-10-06. The database is correct.

After digging around, I found that the below methods in Mage_Adminhtml_Block_Customer_Edit_Tab_View are returning timestamps:

public function getCreateDate()
{
    return Mage::helper('core')->formatDate($this->getCustomer()->getCreatedAtTimestamp(),
        Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
}

public function getLastLoginDate()
{
    $date = $this->getCustomerLog()->getLoginAtTimestamp();
    if ($date) {
        return Mage::helper('core')->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);
    }
    return Mage::helper('customer')->__('Never');
}

Looking at Mage_Core_Helper_Data::formatDate($date), there is a line that, after checking that the input date is not an instance of Zend_Date, it converts it using strtotime:

$date = Mage::app()->getLocale()->date(strtotime($date), null, null);

So it seems that it is converting an existing timestamp twice.

Can anyone tell me why this would only get screwed up for the aforementioned timeframe? I'm not sure why the block methods are converting to timestamps ahead of time, but it has never been an issue until now (and seems to no longer be an issue).


texts: 404 - Redirect to Home Page - Banner Slider Not Working

texts:
   I want to redirect all 404 errors to Home page in my website. But currently what is happening is that, After following the basic procedure of selecting the Home Page in :

System -> Configuration -> General -> Web -> Default Pages -> CMS No-Route Page.

   It does redirect to my home page, but the Banner Slider does not work and just load all the slider images one below another. The home page works perfect when accessed directly by the base url.


texts:
My current Magento 2.2.0 site in displayed in English, I have changed the language to Danish in the admin panel but that has not changed anything. The option for Danish language comes standard with Magento.

I followed this guide: https://github.com/mageplaza/magento-2-danish-language-pack

But that has not changed anything either.

How do I change the frontend language on a Magento 2.2.0 site? This is really frustrating

Thanks!


texts: How to import category and sub category programmatically in Magento 2?

texts:
I am searching tutorials for importing categories and subcategories in Magento 2. Can anyone please explain in which path this code is to be written?

use \Magento\Framework\App\Bootstrap;

include('../app/bootstrap.php');

$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$url = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $url->get('\Magento\Store\Model\StoreManagerInterface');
$mediaurl= $storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
$state = $objectManager->get('\Magento\Framework\App\State');
$state->setAreaCode('frontend');

/// Get Website ID
$websiteId = $storeManager->getWebsite()->getWebsiteId();
echo 'websiteId: '.$websiteId." ";

/// Get Store ID
$store = $storeManager->getStore();
$storeId = $store->getStoreId();
echo 'storeId: '.$storeId." ";

/// Get Root Category ID
$rootNodeId = $store->getRootCategoryId();
echo 'rootNodeId: '.$rootNodeId." ";

/// Get Root Category
$rootCat = $objectManager->get('Magento\Catalog\Model\Category');
$cat_info = $rootCat->load($rootNodeId);

$categorys=array('Levis','Wranglers','Basics'); // Category Names
foreach($categorys as $cat)
{
    $name=ucfirst($cat);
    $url=strtolower($cat);
    $cleanurl = trim(preg_replace('/ +/', '', preg_replace('/[^A-Za-z0-9 ]/', '', urldecode(html_entity_decode(strip_tags($url))))));
    $categoryFactory=$objectManager->get('\Magento\Catalog\Model\CategoryFactory');
    /// Add a new sub category under root category
    $categoryTmp = $categoryFactory->create();
    $categoryTmp->setName($name);
    $categoryTmp->setIsActive(true);
    $categoryTmp->setUrlKey($cleanurl);
    $categoryTmp->setData('description', 'description');
    $categoryTmp->setParentId($rootCat->getId());
    $mediaAttribute = array ('image', 'small_image', 'thumbnail');
    $categoryTmp->setImage('/m2.png', $mediaAttribute, true, false);// Path pub/meida/catalog/category/m2.png
    $categoryTmp->setStoreId($storeId);
    $categoryTmp->setPath($rootCat->getPath());
    $categoryTmp->save();
}


texts: Add Custom Attribute To Recently Viewed Products Widget

texts:
I have override widget_recently_viewed.xml in my theme in Magento_Catalog
with

<?xml version="1.0" encoding="UTF-8"?>

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="widget_columns">
        <column name="brand" component="MyVendor_MyModule/js/product/brand" sortOrder="2" displayArea="details-area">
            <settings>
                Brand
                <bodyTmpl>MyVendor_MyModule/product/brand</bodyTmpl>
            </settings>
        </column>
    </columns>
</listing>
proj/app/MyVendor_MyModule/product/brand.html

proj/app/code/MyVendor/Product/view/base/web/js/product/brand.js

define([
    'Magento_Ui/js/grid/columns/column',
    'Magento_Catalog/js/product/list/column-status-validator'
], function (Column, columnStatusValidator) {
    'use strict';

    return Column.extend({
        /**
         * Depends on this option, product name can be shown or hide. Depends on  backend configuration
         *
         * @returns {Boolean}
         */
        isAllowed: function () {
            return columnStatusValidator.isValid(this.source(), 'brand', 'show_attributes');
        }
    });
});

proj/app/code/MyVendor/Product/view/base/web/template/product/brand.html

and it even renders the HTML but without brand(custom attribute) value

how can I make this thing works? (render the value of the custom attribute, should I dig around data provider?)

Appreciate for any help


texts: How to get yes/no attribute value in magento?

texts:
I added an attribute test through admin panel, which can be set to yes/no value. I want to display the value of test whether it is set to yes or no. How can I do that?

I tried something like that:

<?php
 $attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','test');
 echo $attribute_value = $attributeModel->getStoreLabel($storeId);
 $_product = Mage::getModel('catalog/product')->load($productId);
 echo $_product->getData('test');
?>


texts: adding new admin page to backend(magento 2)

texts:
I can get into the execute() function if I do not run the construct function. but I cannot find the bug in my __construct function.
The file is \app\code\Cleargo\Contactus\Controller\Adminhtml\Grid\Index.php

namespace Cleargo\Contactus\Controller\Adminhtml\Grid;

use Magento\Backend\App\Action;

class Index extends  Action

{
    const ADMIN_RESOURCE = 'Cleargo_Contactus::add_row';

protected $resultPageFactory;

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

public function execute()
{

    $resultPage = $this->resultPageFactory->create();
    $resultPage->getConfig()->getTitle()->prepend(__('Department'));

    return $resultPage;
}
}


texts: Can Magento be used for purchasing and selling products?

texts:
Our business is buying second hand mobile phones online, repair them and sell them online again.
It´s clear that Magento would do the selling job without any problem but I was wondering if I could also use it for buying phones (separate frontend) by means of an extension or something like that.


texts: Is it right having two google analytic code on a page in magento?

texts:
My magento site maintains the google analytic and remarketing section thorough an extension called "Aromicon (GUA)", which put a script and some parameters in every page.
 Now I have to add some code for dynamic google remarketing in some specific pages like Home, Category, Product, cart. So when I add another script having same function as in "GUA" but parameters are different, then will it work properly ? Or is it possible in other way ? Kindly guide..Thanks.


texts: How to get wishlist product category ID.?

texts:
I was assign one product in more then one category.

In one of , i was added product in Wishlist .

I want to know that this product is come for which category.


texts: How to send invoice mail automatically when invoice is created on Magento 2

texts:
What i tried to do, is to send invoice mail automatically to the customer when I successfully created an invoice.

By default the invoice mail in send just when i checked the Email Copy Invoice and then press Submit button(pictures)

I have a payment module(Buckaroo)  which create the invoice automatically for me, but the mail is not send.

So i want to create an observer to check everytime when an order is invoiced and send the mail automatically.

Does anyone know how can i do this? What event should I use for this?


texts:
I have a problem getting the collection, I have two shops and each one have their sku prepended the shop code like EN_1234 FR_3513. I tried to get the collection like always:

$productCollection = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('entity_id')
    ->addAttributeToFilter('sku', array('like' => $shop.'%'));

But from a time to now it only works for one shop, EN. I saw the query and it's getting their data from catalog_product_flat_1 where all the products are from EN, but the products of FR are in catalog_product_flat_4.

I tried to reindex by console and with the admin, but nothing.
What can I do?

UPDATE

$shop = 'EN' or $shop = 'FR'

I see part of the problem is because I'm calling a script I have in the root of magento, If I use this same function inside the model all works.


texts: Estimate Shipping is only showing one country (United States)

texts:
For some reason my estimate shipping is only listing the United States.

My Settings

Enabled shipping methods:

UPS
USPS

All countries are allowed for these two shipping methods.

System > Configuration > General > Country options

Default Country

None Selected

Allowed Countries

All Selected

I'm not sure what else to check


texts:
Is it possible to remove the port number from the url? I.e., I access the website by mywebsite.com but when I click something else in the page, it adds :8080 right between the domain name and the current page, so it will be smth like mywebsite.com:8080/flags. and I want to just hide this port number part from the URL.

After some research I could only find tutorials and help about removing or changing ports or redirections, etc.

Maybe it is possible somewhere from the admin panel?

UPDATE:

I found out that I have to set port_in_redirect to off, in some server block, which is...? (info here)


texts: Magento 2 | Add NOINDEX, NOFOLLOW to CMS page using Layout Update XML

texts:
How do I add the following robots META tag to a CMS page in Magento 2 using the Layout Update XML field?

<meta name="robots" content="noindex,nofollow"/>

I have tried the suggestions in the following questions, but none of them work

how to setup noindex,follow in a static page in magento2?
NO INDEX, NO FOLLOW on Specific Category Magento 2
How can I add meta noindex to all catalog search result pages in Magento2?

For example when I add the following code to the Layout Update XML field:

<head>
    <meta name="robots" content="NOINDEX,NOFOLLOW"/>
</head>

I get this error

  Please correct the XML data and try again. Element 'head': This element is
   not expected. Expected is one of ( referenceContainer, container, update,
   move ). Line: 1


texts: Magento 2 add custom checkbox after payment method

texts: In checkout page, after payment methods I want to add custom checkbox and save it's value in sales_order and quote table when click on placeorder button.


texts:
I am writing a Magento 2 REST API APP so far I can get a token, Update a SKU with PUT but I am not able to POST a new SKU or a new costumer. So far I understand that you update with PUT and create with POST. I followed several examples without luck.

I am testing with Postman.

Here is my HTTP:

POST

/rest/V1/customers
HTTP/1.1

Host: 192.168.2.153

Header
Content-Type: application/json
Authorization: Bearer mfgsw0jtevp95ok1la99rysv0aqf9maj
Cache-Control: no-cache

Body:
{
  "customer": {
"email": "user@test.com",
"firstname": "name",
"lastname": "lastname",
"storeid": 1,
"websiteid": 1
  }
}

Answere:

{
    "message": "Internal Error. Details are available in Magento log     file. Report ID: webapi-5ab75d4ddd21c"

}

exception.log

[2018-03-25 07:04:06] main.CRITICAL: Report ID: webapi-5ab749e684459; Message: Property "Storeid" does not have corresponding setter in class "Magento\Customer\Api\Data\CustomerInterface". {"exception":"[object] (Exception(code: 0): Report ID: webapi-5ab749e684459; Message: Property \"Storeid\" does not have corresponding setter in class \"Magento\\Customer\\Api\\Data\\CustomerInterface\". at /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Webapi/ErrorProcessor.php:205, LogicException(code: 0): Property \"Storeid\" does not have corresponding setter in class \"Magento\\Customer\\Api\\Data\\CustomerInterface\". at /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Reflection/NameFinder.php:100)"} []