texts:
we use have some configurations to some user groups (different prices, only some categories etc) and it's all good if the customer logout and login as a different group account, but when it auto logs out after sometime the cookies stay so the customer see in our website the group restrict config as a logged out customer.
It's a bit difficult to explain but what I need is to delete the cookies that are created when the customer login when the account logs out by the end of session lifetime.
Is there anything we can do to make this work?
Best regards,
Rui Silva


texts: Magento 2 - Where to find LESS Mixin definition?

texts:
In the file vendor\magento\theme-frontend-luma\web\css\source_breadcrumbs.less there is this code getting called:

& when (@media-common = true) {
    .breadcrumbs {
        .lib-breadcrumbs();
    }
}

Lets say the mixin .lib-breadcrumbs() is defined multiple times in different files. How can I figure out where the mixin which is called is located? Is there a stacktrace or something which I can look into?


texts:
When I try open link with image then I get 404 not found.

Log:

2020-05-17 11:33:29.128103 [ERROR] [10840] [HTAccess] Failed to open [/home/web/domains/catalog.website.com/public_html/pub/media/wysiwyg/.htaccess]: Permission denied
2020-05-17 11:33:49.211472 [ERROR] [10840] [HTAccess] Failed to open [/home/web/domains/catalog.website.com/public_html/pub/media/logo/.htaccess]: Permission denied
2020-05-17 11:33:49.266410 [ERROR] [10840] [HTAccess] Failed to open [/home/web/domains/catalog.website.com/public_html/pub/media/wysiwyg/.htaccess]: Permission denied
2020-05-17 11:34:00.722778 [ERROR] [10840] [HTAccess] Failed to open [/home/web/domains/catalog.website.com/public_html/pub/media/wysiwyg/.htaccess]: Permission denied
2020-05-17 11:34:00.722948 [ERROR] [10840] [HTAccess] Failed to open [/home/web/domains/catalog.website.com/public_html/pub/media/logo/.htaccess]: Permission denied


texts: How to get product review summary data in magento2

texts:
I need to get Product review  summery in magento2 programtically
how to get it ?


texts: How to get config field value for all available store views as an array?

texts:
I have one configuration field with scope as store view in my module.

System config path: vendor/module/title

I have multiple websites with multiple store views and I want to get values of my field for each store view as an array.
I can use looping for website and store views to get value for my field for each store view with below code.

$this->scopeConfig->getValue('vendor/module/title', ScopeInterface::SCOPE_STORE, $scopeCode);

and then store it in an array with store_code or store_id as the key.

Is there any other way I can achieve this? May be without loop?


texts: Configurable items Default price issue on Magento2

texts:
For configurable products by default the lowest price of the associated products is displaying.
But i want to display highest price of the associated products.

How to fix this issue on Magento2 . Please help me.


texts: Magento 2 InvalidArgumentException Could not find a matching version of package

texts:
I am trying to install the module using the composer in Magento 2.
I have created a module and publish on the GIT repository and also added the GIT repository URL at packagist.

Module GIT URL: https://github.com/sumansingh51/suman-hello
Module composer.json:
https://github.com/sumansingh51/suman-hello/blob/master/composer.json
Module packagist URL:
https://packagist.org/packages/sumansingh51/suman-hello

Now I am trying to install this module in my Magento project and showing below error

[root@pt project]# composer require sumansingh51/suman-hello
[InvalidArgumentException]
Could not find a matching version of package sumansingh51/suman-hello.
Chec     k the package spelling, your version constraint and that the
package is ava     ilable in a stability which matches your
minimum-stability (stable).

Also tried to with "minimum-stability": "stable" OR "minimum-stability": "dev",
But it showing the same error in terminal.
What things I need to change so I can install the module via composer?
How package version effect the composer installation?


texts:
In my store each customer has own big JSON array (about 1,5K items).
The JSON array is updated regurarly (so it can't be cached)
At the moment, every time JSON data is needed, it's being pull from database. It need for all product pages.

Is there any way, to cache the JSON data (redis, local storage, etc) for each user in a way so that it can be easily updated when required?

Thanks!


texts: Magento 2 - RabbitMQ Message has been rejected: Warning: Error while sending QUERY packet

texts:
I'm using RabbitMQ as message broker as publisher/subscriber, but sometimes I receive the following error:

  Message has been rejected: Warning: Error while sending QUERY packet. PID=5987 in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 228

I think that this occure because the connection with MySQL stays open and when exceed wait_timeout = 500 from my.cnf the next message cause me this error. Now, how can I avoid this? Is there a way to close connection from my consumers?


texts: How to Define Custom/Use Custom Resource Methods in Installation Scripts

texts:
What's the proper way to define functions used in installation scripts? I have a long list of data to add in a module, and I'd like to avoid writing a long serial script or just including functions at the bottom or top of the installation script files.

Specifically, I'm wondering if there's a .php file that can be included for the data or sql scripts.

UPDATE: See my answer.


texts: How to update Customer Order in Magento 1.9.3.1

texts: Customer purchased Product X. We shipped Product Y. Now I want remove Product X and add Product Y in the Sales Order or Sales Invoice.


texts:
I've got a big issue,

I cant create orders via the admin area, i click create order and it goes straight to a HTTP ERROR 500 page

My accounts.php file is exactly how it should be.


texts:
Magento getting store bestsellers: configurable products, only from current store

We have tested some bestseller codes like from here and here and here. They all work fine if you only sell simple products. We sell many products and often in many stores.

So in essence what we would like is a bestseller list that shows

configurable bestsellers (or at least the real parent)
with sales order qty summed per store (so exclude sales made in other stores)
with sales order qty summed per category (optional)
with an optional command to lag limit the sales qty over time (like last month only)

Has this ever been done?


texts: Magento 2.3.4 - Order page return 500 error

texts:
If click place order button getting 5005 error,

Fatal error: Uncaught Error: Call to undefined method Zend\Log\Logger::error() in /usr/share/nginx/html/giri/vendor/magento/module-sales/Model/Order/Email/Sender.php:88
Log Error :
main.INFO: Broken reference
shipping.log :
<Response>
<ServiceHeader>
<MessageTime>2020-07-19T13:12:03.616+02:00</MessageTime>
</ServiceHeader>
<Status>
<ActionStatus>Error</ActionStatus>
<Condition>
<ConditionCode>111</ConditionCode>
<ConditionData>Error in parsing request XML:An invalid
XML character (Unicode: 0x1f) was found in the
element content of the document.</ConditionData>
</Condition>
</Status>
</Response></res:ErrorResponse>


texts:
I want to override following file in my custom module:

  module-sales/view/adminhtml/templates/order/create/shipping/method

What I did so far:

  magento/app/code/view/adminhtml/layout/sales_order_create_index.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">
    <body>
        <referenceBlock name="shipping_method">
            <referenceBlock name="form">
                <action method="setTemplate">
                    <argument name="shopmethtempindex" xsi:type="string">UV_Adressen::order/create/shipping/method/form.phtml</argument>
                </action>
            </referenceBlock>
        </referenceBlock>

    </body>
</page>

Placed the template here:

  /var/www//magento/app/code//view/adminhtml/templates/order/create/shipping/method/form.phtml

Why doesn't it work?


texts: Translate “custom option” in mini-cart for multistore

texts:
I have managed to successfully translate the custom options in the article (see previous question here. But the next step is to reproduce these options also in the "mini-cart".
The minicart now includes an article with two options. See picture below

I see the code looks like this:

I think the code comes from:
vendor/theme-xxxxxxxx/Magento_Checkout/web/template/minicart/item/default.html and it is called in line:

from:

But how can I translate the custom options text "html: option.value" from this piece of coding? That's the big question :)


texts: Unable to activate integration with Oauth 1.0

texts:
I have been trying to create my own external application using Oauth, but I get to filling out the details for the callback URL and Identity link URL (and the name), which creates fine, but when I go to activate the integration I get greated with a "Sorry, something went wrong. Please try again later.", and the only error I get is from the debug.log file within Magento.
[2020-10-08 16:02:22] main.DEBUG: URI '/admin_13rc6p/admin/integration/tokensExchange/id/8/reauthorize/0/key/0ed0706f89d9950b82de796f028519b5f67df267cb337095fa255da0d52db82b/?form_key=hljjqv6G0SmuLm9g&_=1602172897038'' cannot be accessed with GET method (Magento\Integration\Controller\Adminhtml\Integration\TokensExchange) [] []
[2020-10-08 16:02:22] main.DEBUG: Request validation failed for action "Magento\Integration\Controller\Adminhtml\Integration\TokensExchange\Interceptor" {"exception":"[object] (Magento\\Framework\\App\\Request\\InvalidRequestException(code: 0): Invalid request received at /var/www/magento-install.com/lib/internal/Magento/Framework/App/Request/HttpMethodValidator.php:69)"} []

(I replaced my domain with magento-install.com)
I have followed the guides on https://devdocs.magento.com/guides/v2.4/get-started/authentication/gs-authentication-oauth.html, but still no luck with getting it to activate.
Any suggestions?


texts: How to enable symlinks after SUPEE-9767 V2 install?

texts:
Its seems SUPEE-9767v2 has disabled and removed the option in "Advanced -> Developer -> Template settings", that would allow us to enable/disable symlinks.

What is the other way to enable symlinks after V2 patch install?


texts: How do I remove TOTAL EXCL TAX from cart review page?

texts:
In Magento by default the review page displays the Cart TOTAL EXCL TAX and Cart TOTAL INCL TAX.

Due to the way I've configured Magento (everything including tax), the EXCL TAX and INCL TAX values are identical (which could be confusing for customers).

Does anyone know of a way to remove the EXCL TAX line from the cart review page?
(I can't seem to find a configuration option for it anywhere).


texts: Programmatically add customer login through soap api

texts: I want to add customer login outside magento.and also set session. I am using magento with third party application connected with soap api. Using soap api is any solution to authenticate customer login as well as set session.


texts:
We built a website with Magento 2.2 community version. We have got a strange issue with the Order number in Magento.

For example, Magento was at number 100034467 and the next order number that came in was 100034470. The order numbers 100034468, 100034469 were missing. Please see the attached screenshot.

We have no idea what happened to the missing order numbers. Is this a normal one in Magento?

If this really an issue, please let me know your thoughts to resolve this.

Now is the peak season for us, we would like to resolve this issue as soon as possible.

Looking forward to your help and support.


texts: How to add a Contact Form to sent to email address

texts:
How to add a contact form to our contact page but finding it difficult to do so.

I can add the form via html and styling etc but getting it to send to an email address is where I'm having problems.


texts:
I want to display a li on product-page, if the product got upsell products.

What is the condition that I need to check for this?

Thanks!


texts:
I am trying to migrate a magento version 2.3.3 site / system from one server to another.

After doing everything I should do to complete the migration I am getting 302 as a server response once after another. A targeting loop.

I have already tried some solutions such as changing the values of the config table core_config_data.

            path           |              value
    web/seo/use_rewrites   |                1
    web/unsecure/base_url  |       http://exemple.com/
     web/secure/base_url   |      https://exemple.com/
web/secure/use_in_frontend |                1
web/secure/use_in_adminhtml|                1
  web/url/redirect_to_base |                0
   web/cookie/cookie_path  |               NULL
  web/cookie/cookie_domain |               NULL
 web/cookie/cookie_httponly|                0

I looked into .htaccess to see if there was something that was redirecting and found nothing either. I leave the link to it here: https://pastebin.com/30LDUsb5

After thinking it was all right, I ran php bin / magento c: c. And perhaps another important piece of information, magento is using Redis for front and backend sessions and caching. The server I set up has a Redis server available but it is empty, magento can populate it from scratch.

Thank you in advance for any light.


texts: Cannot call my custom Helper Class. Magento 2

texts:
I'm trying to call my custom Helper class in Controller but when I call the function of my helper in Controller it gives me Fatal error: Uncaught Error: Call to undefined method Magento\Backend\Helper\Data::getSKUU()getSKUU() is my custom helper function and the code is calling the core helper class while I'm injecting my custom Helper class in the controller
Vender\Module\Controller\Adminhtml\Index

<?php

namespace Vender\Module\Controller\Adminhtml\Index;

use Vender\Module\Helper\Email;
use Vender\Module\Helper\Data;
use Magento\Backend\App\Action;
use Magento\Framework\App\Action\Context;
/**
 *
 */
class AcceptOffer extends \Magento\Backend\App\Action
{
    protected $_model;
    protected $helper;

    function __construct(
         \Vender\Module\Model\ResourceModel\MakeAnOffer\CollectionFactory $model,
        \Magento\Framework\App\Request\Http $request,
        Context $context,
        Email $email,
        \Vender\Module\Helper\Data $helper,
        \Vender\Module\Model\MakeAnOffer $mode
    )
    {
        $this->_model = $model;
        $this->request = $request;
        $this->_email = $email;
        $this->_helper= $helper;
        $this->_mode = $mode;
        parent::__construct($context);
    }

    public function execute()
    {
        $id= $this->request->getParam('id');

        $this->_mode->load($id)->addData(array('check_status'=>2));
        $this->_mode->setId($id)->save();

        $dataa = $this->_model->create()->addFieldToFilter('makeanoffer_id',$id)->getData();
        // print_r($dataa);exit;
         /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();
            try {
                // $this->_helper->setCoupon();
                $this->_helper->getSKUU();
                $this->_email->sendAdminEmail($dataa);
                $this->messageManager->addSuccessMessage('The Offer has been Accepted!');
                return $resultRedirect->setPath('*/*/index');

            } catch (\Exception $e) {

                // display error message
                $this->messageManager->addError($e->getMessage());
                // go back to edit form
                return $resultRedirect->setPath('*/*/index');

            }
    }
}
//Not colling my custom Helper Class
  ?>


texts:
in my store I have some configurable product and other simple product.

No problem until this morning. I can't add any product in my cart anymore. I don't know why, I have only this exception :

> Fatal error: Uncaught Error: Call to a member function getValue() on
> null in
> project/vendor/magento/module-configurable-product/Model/Quote/Item/CartItemProcessor.php:86
> Stack trace: #0
> project/generated/code/Magento/ConfigurableProduct/Model/Quote/Item/CartItemProcessor/Proxy.php(103):
> Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor->processOptions(Object(Magento\Quote\Model\Quote\Item))
> 1 project/vendor/magento/module-quote/Model/Quote/Item/CartItemOptionsProcessor.php(84):
> Magento\ConfigurableProduct\Model\Quote\Item\CartItemProcessor\Proxy->processOptions(Object(Magento\Quote\Model\Quote\Item))
> 2 project/vendor/magento/module-quote/Model/Quote/Item/CartItemPersister.php(108):
> Magento\Quote\Model\Quote\Item\CartItemOptionsProcessor->addProductOptions('configurable',
> Object(Magento\Quote\Model\Quote\Ite in
> project/vendor/magento/module-configurable-product/Model/Quote/Item/CartItemProcessor.php
> on line 86

I didn't edit any of theses files.


texts: I want to create Dropdown Attribute for Products and want to fetch data from the database in created Dropdown Attribute.


texts: ifconfig in layout xml for enable disable when change file .phtml

texts:
Good evening, I have some problems with my module. I am using the ifconfig option in my .xml module in the theme folder layout, and my option in the admin (ENABLE / DISABLE) works, but to disable are not carrying the original file footer.phtml (folder rwd/default/template/page/html/). Resulting in a blank footer .... I need to load the default file footer instead of my custom footer.phtml when my module is disabled by the admin config, how to proceed?

The code I'm using is:

<layout version="0.1.0">
    <default>
        <reference name="root">
            <!-- set a new file customized for module footer.phtml -->
            <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
                <action method="setTemplate" ifconfig="customizefooter/options/custom_enable_cf">
                    <template>customizefooter/footer.phtml</template>
                </action>
            </block>
        </reference>
    </default>
</layout>

Also see: http://pastebin.com/DT2UMt2C


texts: Magento 2.3 customer register after redirect to previous page

texts:
In default magento functionality : customer register after redirect to
my account page but I want to redirect previous page
My code :
<?php

namespace Vendor\Registerredirect\Plugin;

use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Registry;
use Magento\Framework\UrlInterface;
use Magento\Framework\App\Response\RedirectInterface;
class Redirect
{
    protected $coreRegistry;

    protected $url;

    protected $resultFactory;

    public function __construct(Registry $registry, UrlInterface $url, ResultFactory $resultFactory, RedirectInterface $redirect)
    {
        $this->coreRegistry = $registry;
        $this->url = $url;
        $this->resultFactory = $resultFactory;
        $this->redirect = $redirect;
    }

    public function aroundGetRedirect ($subject, \Closure $proceed)
    {
        if ($this->coreRegistry->registry('is_new_account')) {
            /** @var \Magento\Framework\Controller\Result\Redirect $result */
            $result = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
            $result->setUrl($this->redirect->getRefererUrl());
            return $result;
        }

        return $proceed();
    }
}

any one know how to solve above code or other code if it is working ..
Any idea how can achieve that ?
Thanks in advance


texts: Magento 2.2 listing page products sort by price is incorrect

texts:
I'm using Magento CE 2.2.6
In front-end when we sort the category pages by price, the sorting happens wrongly.

Any suggestions are appreciated.


texts: Can the Cost attribute scope be changed to Store View?

texts:
The cost attribute (not the price) is locked to "Website". We have a situation where we sell the same product in different countries and as such the cost of the product is actually different. For example the landed cost to the USA may be $5, but the landed cost to the UK is $7.50.

We'd like to be able to run Magento's reports and see the total product sales/profit. And we'd like to be able to see the sales/profit for the USA store and for the the UK store separately. We would do this based on Websites instead (and do Show Report For: All Websites), but we have other websites on the same Magento installation so this wouldn't give us the data we need.

There is no built in way to change the Cost attribute to Store View, but if we were to manually do so would it cause any problems?

What is the best way to make the change? Modifying the DB, or creating a module that does it, or?

What are the potential problems with doing this?


texts: How can I add a custom block to the products page in Magento 2?

texts:
I'm looking to add custom product attributes to the product page. Basically adding a block under the title to list product attributes.

I looked at echoing out the attributes in

Magento_Catalog/templates/product/view/attributes.phtml

file but that seemed messy. So I was hoping there'd be a way to add a custom block to the xml and then rendering my own .phtml file? That way I'm keeping the core code seperate from my own (obviously I'm adding all this into my own theme files and not touching the vendor files.)

Would this be possible and/or the best way?


texts:
after upgrading our platform in Magento 2.4.2 we're facing an issue where the compiled js from root/vendor/magento/magento2-base/lib/web/legacy-build.min.js is appearing in the frontend of the website.
Anyone would have a solution to fix that ? Thanks for your time.


texts:
I am uploading 1000 products to Magento 1.9 using Magmi's Image Attributes Processor and receive the following error

  SKU 3800231 - Image attributes processor v1.0.33 - path/853698004078.jpg cannot be found in images path
  my file structure as follow

Shop/MagentoRoot/Magmi/
                /var/import/xxxxx.csv
                /media/import/xxxxxxx.jpg

I have tried the following as my path in my .csv

/xxxx.jpg
xxxx.jpg
/media/import/xxx.jpg
/shop/MagentoRoot/media/import/xxx.jpg
/home/ShareServerPath/public_html/shop/MagentoRoot/media/import/xxx.jpg

what is the right path? or how do i debug it to find the right path

thank you


texts:
I have a problem and as I am new to magento I decided to turn to you. I am editing the layout of some pages in magento 2, and there is a specific page created in the CMS by the content panel - Pages, which I need to change, and it is only on that page. I tried to find the XML and I think the correct XML must be cms_page_view but I can't edit this xml. Can you help me please?
I tried to edit the xml id from cms_page_view to cms_page_view_id_9.xml, and copied the xml from cms_page_view and added the code I needed to add and it looked like this:
<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="columns" label="Main Content Container" htmlTag="div" htmlClass="container px-0 container-alinhamento" htmlId="teste" />
        <referenceContainer name="content">
            <block class="Magento\Cms\Block\Page" name="cms_page" />
        </referenceContainer>
    </body>
</page>

But it does not work. Can someone help me please?


texts: Programmatically login customer is not working with Associate to Website as “Main website"

texts:
I am trying to login a customer using email id and password.
Please check my below code:

public function customerlogin($email,$password)
 {
    $session = Mage::getSingleton('customer/session');
    try
    {
        $session->login($email,$password);
        $session->setCustomerAsLoggedIn( $session->getCustomer() );
        return json_encode(array('status' => 'success'));
    }
    catch( Exception $e )
    {
        return json_encode(array('status' => 'error'));
    }
}

Suppose I have two customers. One of them is created as “Associate to Website” as “Admin”. And other one is created as “Associate to Website” as “Main website”

Now if I passed username and password of customer who associate with admin then I am getting success in response. But if I try to pass username and password of “Main website” customer then I always get an error in response.
Why this is happening?

I am passing correct username and password.


texts: hello i have Some course which is subscription product like a month year week and i i want to create subscription using paypal express checkout in magento2


texts: Magento 2: Inline styles for emails are applying partly

texts:
For example,
There is a "New order" template. The styles for this template are placed in
    app/design/frontend/Vendor/Theme/Magento_Sales/web/css/source/_email.less

Here's an example of styles:

.order-totals {
    background: #e0edf6;

    > tr {
        > th {
            font-weight: @font-weight__regular;
        }

        > th,
        > td {
            padding: @email-content__padding__base;
            text-align: right;
        }

        & + tr {
            th,
            td {
                padding-top: 0;
            }
        }
    }

    .price {
        white-space: nowrap;
    }
}

So, the selectors are all allowed by Magento 2. But actually the only applied styles are:

.order-totals{background: #e0edf6}

and

.price{white-space:nowrap}

When emails were being tested in the developer mode, all styles were applied, but now the mode is switched to production, css minify is on and styles applied partly. What can be wrong?


texts: How do I access a child entity field for reference in an MFTF Test

texts:
I need assistance trying to access a field of a required entity inside a parent entity created for a test

Example I am trying to create a configurable product

<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttributes">

The entity for that looks like this

<entity name="productAttributeWithTwoOptions" type="ProductAttribute">
  <data key="attribute_code" unique="suffix">attribute</data>
  <data key="frontend_input">select</data>
  ...
  <data key="used_for_sort_by">true</data>
  <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>

In the test how could I access the label field from the FrontendLabel required entity?

<entity name="ProductAttributeFrontendLabel" type="FrontendLabel">
  <data key="store_id">0</data>
  <data key="label" unique="suffix">attribute</data>
</entity>

I assumed it might be something like this {{createConfigProductAttributes.ProductAttributeFrontendLabel.label}}


texts: Magento 2 preference not working in di.xml

texts:
I have a custom module where I'd like to extend the Base Handler

<preference for="Magento\Framework\Logger\Handler\Base" type="Custom\Foo\Handler\DefaultHandler" />

Strangewise this does not work in this specifc case, while other preferences are working fine like

<preference for="Psr\Log\LoggerInterface" type="Custom\BarFoo\Handler\BaseLog" />

Thanks for clarification

Best


texts: How to hide button ''Send Mail' and 'Hold' in sale order page, magento 2

texts: Using magento 2.2, admin page. I need to hide button 'Send Mail' and 'Hold' in order page of status 'Pending'.


texts:
I'm trying to make my module's InstallData.php work but it's not even running.

Before every test i delete the module's entry from setup_module table.

I thought the namespace and path were the issue, i tried with TwoKnet\ICircle but it's not working either.

Here's the code:

namespace _2000net\iCircle\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use \Magento\Customer\Model\Customer;
use \Magento\Customer\Model\Indexer\Address;

class InstallData implements InstallDataInterface
{

private $eavSetupFactory;

private $eavConfig;

private $attributeResource;

public function __construct(
    \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory,
    \Magento\Eav\Model\Config $eavConfig,
    \Magento\Customer\Model\ResourceModel\Attribute $attributeResource
) {
    $this->eavSetupFactory = $eavSetupFactory;
    $this->eavConfig = $eavConfig;
    $this->attributeResource = $attributeResource;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {

    error_log('is running');

    try {

        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
            Customer::ENTITY,
            'icircle_id',
            [
                'type'         => 'int',
                'label'        => 'iCircle ID',
                'input'        => 'text',
                'required'     => false,
                'visible'      => true,
                'user_defined' => false,
                'position'     => 999,
                'system'       => 0
            ]
        );

        $customerAttribute = $this->eavConfig->getAttribute(Customer::ENTITY, 'icircle_id');
        $customerAttribute->setData('used_in_forms', [ 'adminhtml_customer' ]);
        $this->attributeResource->save($customerAttribute);

        $eavSetup->addAttribute(
            Address\AttributeProvider::ENTITY,
            'icircle_id',
            [
                'type'         => 'int',
                'label'        => 'iCircle ID',
                'input'        => 'text',
                'required'     => false,
                'visible'      => true,
                'user_defined' => false,
                'position'     => 999,
                'system'       => 0
            ]
        );

        $addressAttribute = $this->eavConfig->getAttribute(Address\AttributeProvider::ENTITY, 'icircle_id');
        $addressAttribute->setData('used_in_forms', [ 'adminhtml_customer_address' ]);
        $this->attributeResource->save($addressAttribute);

    } catch (\Exception $exception) {
        error_log($exception->getMessage());
    }

}

}


texts: Magento 2 Error after Migration from Magento1.9 to Magento2

texts:
I have successfully migrated all data with data-migration-tool from Magento 1.9.1.0 to Magento 2.2.4.

After investigation Admin->Customers->All Customer ,I am getting error

    1 exception(s):
    Exception #0 (BadMethodCallException): Missing required argument $options of Magento\Eav\Model\Entity\Attribute\Source\Config.

    Exception #0 (BadMethodCallException): Missing required argument $options of Magento\Eav\Model\Entity\Attribute\Source\Config.
    #0 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Eav\\Mod...', Array, Array

)

After a lot of Investigation I found some link that have same problems and apply these fixes in my setup but not got any success.

Please Help me.


texts: How to call a function which is in a overwritten controller block?

texts:
I have developed a module to overwrite a controller.
I have the next route:
Lecasa/Javinewlistproductcontroller/Block/Catalog/Product/List.phtml

This List.phtml file is:
class Lecasa_Javinewlistproductcontroller_Block_Catalog_Product_List extends Mage_Catalog_Block_Product_List

I have been trying to use a function that I created in this List.phtml but i did not find the way to call it. Then I copied this one in Lecasa/Javinewlistproductcontroller/Helper/Data.php, I configured all files but when I used Mage::helper(...)->function(), the magento system added the Mage_ prefix to the helper class. Then, as a last alternative, I would like to know how I can call the function which is created at Lecasa/Javinewlistproductcontroller/Block/Catalog/Product/List.phtml
directly from the rwd/.../List.phtml.

Thanks.


texts: How to implement a single product and bundles consisting of a single product multiple times

texts:
I'm not totally new to magento but now I got a customer with a request I don't know how to implement.
For understanding I'd like to make an example first:

There is a product P for 10$.
For a customer it is possible to buy let's say 50 P for 500$.
But there should be the possibility to buy bundles (3,5,10,25,50 qty).
As example the bundle B exists of 25 times the product P and is sold for 220$ (30$ reduction).
So the customer can choose between buying 50 times product P or rather cheaper bundles.

Is there any uncomplicated way to implement this, giving the customer the option to choose instead of automatically go for pricing rules?

I appreciate any thoughts on that.


texts: Simple Magento2 example of retrieving and displaying a custom table field?

texts:
I have a custom table in my Magento2 database and can not find a simple working example of how to connect, retrieve, and display the field data in a Magento2 page.

This one mostly works but is incomplete because it stops at fetching the field but doesn't show how to actually display the field on the webpage:
http://webkul.com/blog/magento2-write-custom-mysql-query-without-using-model/

Can someone please provide a complete example?


texts: Magento2:How to updated customer attribute programmatically?

texts: I am using magento2. I have created customer custom attribute in magento2.I want to change labels of created customer custom attribute. i have created two files installData.php and upgradeData.php in setup folder. but not changing the labels of custom attribute.also i am confusing between InstallData and UpgradeData files.


texts: Default billing address country title in checkout

texts:
In Magento Admin System->Configuration->General->Countries options default country is --Please Select-- but In frontend it's null. Check the attached image. In billing.phtml templates echo $this->getCountryHtmlSelect('billing'); is showing list of all countries fine from admin but when by default it's showing blank if '--Please Select--' is selected.

Why it is showing blank tab instead of '--Please Select--' ? How I can show all counties with '--Please Select--' selected by default?


texts: How do i use UI components in front-end in magento2

texts:
I want to show orders grid in my account section in Front-End. I have extended luma theme.

I know it is possible to show admin grid in Front-End but, I don't have a breakthrough. Please assist me on how do i show admin grid in front-end. I want to show it in My Account section of the customer account.


texts:
Magento before applies the patch (also upgrade) how to check core file in changes or not. Anyone have a name of the software or any type of script to find out core file changes list.

I have Magento website version 1.7.0.2 and I did many core files changed 2 years ago but today I need to check wich file I have changed. for manually one by one check take lots of time.


texts: When clicking on Magento Connect Manager from admin, facing this error: Mage registry key "_singleton/admin/session" already exists


texts: SUPEE-9767 issue : Design Exceptions with Enterprise Full Page cache

texts:
SUPEE-9697 has broken the Design Exceptions functionality of Magento Enterprise with Full Page cache. This feature is normally used for serving a mobile theme.

To recreate the issue (with full page cache enabled and a design exception defined):

Flush full page cache.
In Chrome, enable developer tools and toggle the device toolbar.
Switch to a device which will activate your theme (e.g. an iPhone).
Visit the site and confirm you see your mobile theme.
Toggle the developer tools device toolbar so you now see a desktop view.
Refresh the page.

Undesirable behaviour:

You will see that the template being served (by full page cache) is the mobile template, which is incorrect.


texts: How to Increase file size of Importing Products to Magento 2

texts:
I'm looking to import product into M2 but the allowed size is 2MB and my file has 2.33 MB how can I increase the size?

Thanks in advance.


texts: How to add column in customer grid with dropdown values?

texts:
I've added a custom attribute for customers to choose from during registration. For simplicity sake lets say this is their favorite color (color_customer). Values are pulled from a dropdown list. Everything works fine in both front- and backend. I added this custom attribute to the customer grid by overwriting the grid file. I then tried to get the values of the color attribute before the _prepareColumns function. I'm not so sure this is the right way to go and I'm hoping someone could shed some light on this matter.

    <?php
    class Company_Module_Block_Adminhtml_Customer_Grid extends      Mage_Adminhtml_Block_Customer_Grid{

    protected function _prepareCollection(){
    $collection = Mage::getResourceModel('customer/customer_collection')
        ->addNameToSelect()
        ->addAttributeToSelect('email')
        ->addAttributeToSelect('created_at')
        ->addAttributeToSelect('group_id')
        ->addAttributeToSelect('color_customer')
        ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
        ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
        ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
        ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
        ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');

    $this->setCollection($collection);

    if ($this->getCollection()) {

        $this->_preparePage();

        $columnId = $this->getParam($this->getVarNameSort(), $this->_defaultSort);
        $dir      = $this->getParam($this->getVarNameDir(), $this->_defaultDir);
        $filter   = $this->getParam($this->getVarNameFilter(), null);

        if (is_null($filter)) {
            $filter = $this->_defaultFilter;
        }

        if (is_string($filter)) {
            $data = $this->helper('adminhtml')->prepareFilterString($filter);
            $this->_setFilterValues($data);
        }
        else if ($filter && is_array($filter)) {
            $this->_setFilterValues($filter);
        }
        else if(0 !== sizeof($this->_defaultFilter)) {
            $this->_setFilterValues($this->_defaultFilter);
        }

        if (isset($this->_columns[$columnId]) && $this->_columns[$columnId]->getIndex()) {
            $dir = (strtolower($dir)=='desc') ? 'desc' : 'asc';
            $this->_columns[$columnId]->setDir($dir);
            $this->_setCollectionOrder($this->_columns[$columnId]);
        }

        if (!$this->_isExport) {
            $this->getCollection()->load();
            $this->_afterLoadCollection();
        }
    }

    return $this;
     }
     }

protected function _prepareColumns(){
   $color = Mage::getModel('eav/config')->getAttribute('customer', 'color_customer');
   $options = $color->getSource()->getAllOptions(false);
   $colors = array();
   foreach ($options as $option)
   {
       $colors[$option['value']] = $option['label'];
   }
    $this->addColumnAfter('color_customer', array(
        'header'    => Mage::helper('customer')->__('Fav Color'),
        'width'     => '80px',
        'index'     => 'color_customer',
        'type'      => 'options',
        'options'   => $colors
    ),'email');
    return parent::_prepareColumns();
  }


texts: mage-cache-storage clean after reload page magento 2.1 checkout

texts:
I input some information at the checkout. It write in mage-cache-storage. When I reload checkout page mage-cache-storage are clearing. Why is this happening? How I can fix it?
Thanks in advance.

I found core file for testing. Path is: vendor/magento/module-checkout/etc/frontend/sections.xml

<?xml version="1.0"?>

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

    </action>
    <action name="checkout/cart/delete">

    </action>
    <action name="checkout/index/index">

    </action>
    <action name="checkout/cart/updatePost">

    </action>
    <action name="checkout/cart/updateItemOptions">

    </action>
    <action name="checkout/cart/couponPost">

    </action>
    <action name="checkout/cart/estimatePost">

    </action>
    <action name="checkout/cart/estimateUpdatePost">

    </action>
    <action name="checkout/onepage/saveOrder">

    </action>
    <action name="checkout/sidebar/removeItem">

    </action>
    <action name="checkout/sidebar/updateItemQty">

    </action>
    <action name="rest/*/V1/carts/*/payment-information">

    </action>
    <action name="rest/*/V1/guest-carts/*/payment-information">

    </action>
    <action name="rest/*/V1/guest-carts/*/selected-payment-method">

    </action>
    <action name="rest/*/V1/carts/*/selected-payment-method">

    </action>
</config>

And added here

<action name="checkout/*">

</action>


texts: skip function execution using before plugin

texts:
I'm overriding the controller Magento\User\Controller\Adminhtml\User\Validate::execute() using before-plugin so I can perform some checks before magento validate using this function. If certain condition met, I want to return an error response from my before-plugin and skip the execution of main execute action. For this, I write the code below.

<!-- app/code/[vendor]/[module]/etc/di.xml -->
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\User\Controller\Adminhtml\User\Validate">
        <plugin name="admin_user_validate_controller_plugin" type="[vendor]\[module]\Plugin\AdminUserValidateControllerPlugin" sortOrder="20"/>
    </type>
</config>

and here is my plugin.

namespace [vendor]\[module]\Plugin;

class AdminUserValidateControllerPlugin
{
    public function beforeExecute(\Magento\User\Controller\Adminhtml\User\Validate $subject)
    {
        $response = new \Magento\Framework\DataObject();
        $response->setError(0);
        $errors = null;

        if([some_custom_validation_checks_return_false]) {
            $error = "some_error_message";
            $subject->messageManager->addError($error);

            $response->setError(1);
            $subject->_view->getLayout()->initMessages();
            $response->setHtmlMessage($subject->_view->getLayout()->getMessagesBlock()->getGroupedHtml());
            $subject->getResponse()->representJson($response->toJson());
        }
    }
}

Question#1: I was expecting it to return my error message in response of ajax call of validation controller, but it redirects to admin_dashboard page with my error message. How can I make it correct so my plugin will respond.

Question#2: After responding via ajax, how can we make it so magento stop further execution of main function. Also can we achieve it? That is, can we exit/die further execution in before-plugin in a proper way?

Thank you.


texts: Magento 2, Cannot `getCollection()` from model factory

texts:
Using magento 2.2, CRUD, API. I got an error while try to access method getCollection().

  {
      "messages": {
          "error": [
              {
                  "code": 500,
                  "message": "Fatal Error: 'Cannot declare class Iota\EShopping\Model\ResourceMode\Social\Collection, because the name is already in use' in '/home/esh_www/app/code/Iota/EShopping/Model/ResourceModel/Social/Collection.php' on line 20",
                  "trace": "Trace is not available."
              }
          ]
      }
  }

CALL

use Magento\Customer\Model\CustomerFactory;
use Iota\EShopping\Model\SocialFactory;
use Iota\EShopping\Setup\SchSocialLogin;
use Iota\EShopping\Api\Data\SocialLoginModel as Login;

/**
 *
 * @author channarith.bong
 *
 */
class CustomerManagement implements \Iota\EShopping\Api\CustomerManagementInterface
{

    /**
     *
     * @param SocialFactory $socialFactory
     * @param CustomerFactory $customerFactory
     */
    public function __construct(
        SocialFactory $socialFactory,
        CustomerFactory $customerFactory
    ){
        $this->customerFactory = $customerFactory;
        $this->socialFactory = $socialFactory;
    }

    /**
     *
     * @return string
     */
    public function validateCustomerLogin()
    {
        $socialCollection = $this->socialFactory->create()->getCollection();
    }
}

Model

<?php
namespace Iota\EShopping\Model;
use Magento\Framework\Data\Collection\AbstractDb;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Model\Context;
use Magento\Framework\Model\ResourceModel\AbstractResource;
use Magento\Framework\Registry;

/**
 *
 * @author channarith.bong
 *
 */
class Social extends AbstractModel
{
    /**
     *
     * @param Context $context
     * @param Registry $registry
     * @param AbstractResource $resource
     * @param AbstractDb $resourceCollection
     * @param array $data
     */
    public function __construct(
        Context $context,
        Registry $registry,
        AbstractResource $resource = null,
        AbstractDb $resourceCollection = null,
        array $data = []
    ){
        parent::__construct($context, $registry, $resource, $resourceCollection, $data);
    }

    /**
     * Define resource model
     */
    protected function _construct()
    {
        $this->_init('Iota\EShopping\Model\ResourceModel\Social');
    }
}

Collection

<?php
namespace Iota\EShopping\Model\ResourceMode\Social;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

/**
 *
 * @author channarith.bong
 *
 */
class Collection extends AbstractCollection
{
    /**
     * Define model & resource model
     */
    protected function _construct()
    {
        $this->_init('Iota\EShopping\Model\Social', 'Iota\EShopping\Model\ResourceModel\Social');
    }
}

Resource

<?php
namespace Iota\EShopping\Model\ResourceModel;

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
/**
 *
 * @author channarith.bong
 *
 */
class Social extends AbstractDb
{
    /**
     * Define main table
     */
    protected function _construct()
    {
        $this->_init('iot_td_social_login', 'id');
    }
}


texts: Which event triggers when the category page is loaded in magento2?

texts: I need to apply condition based on the category filters applied to the layered navigation. Let me know which event name will help us to fetch the values to the observer file


texts:
i have a problem with the update of my magento installation from 2.2.3 to 2.2.5, when I try to make the composer update appear this error:
Problem 1
    - Installation request for magento/product-community-edition 2.2.5 -> satisfiable by magento/product-community-edition[2.2.5].
    - magento/product-community-edition 2.2.5 requires amzn/amazon-pay-and-login-magento-2-module ^2.0.4 -> satisfiable by amzn/amazon-pay-and-login-magento-2-module[2.0.12, 2.0.4] but these conflict with your requirements or minimum-stability.

I have see that last version of amazon pay module is the 1.2.6.
How I can solve it?


texts: Magento2 - Why no cache memory on Content->Widgets grid view in admin panel?

texts:
In most Magento Admin grid view, they can remember admin user searching params even if they quit that page.
For example: Stores-> All stores page
But in Content->Widgets page, it is not available to cache the memory.
So how can I reactive this function?


texts:
how can I change the direction of my website to be (from right to left) for languages that start from the right in magento 2.2.6
any advice, please


texts: Show failure message in onpage failure page

texts:
I'm trying to show some custom failure messages on onepage failure page in magento 1. How can I do this? I did the same for magento 2 using:

$this->messageManager->addError(__($msg));

And redirecting to corresponding page.


texts: How to get stock quantity of each product in Magento 2

texts: How to get stock quantity of each product in list.phtml in Magento 2 ?


texts: Magento site note loading all sections/blocks after moving it to amazon AWS

texts: I have moved my local magento site to Amazon AWS. After moving, my site is not loading with all sections/blocks(Products listing and slider/banner) in site front end. I am using themevast theme. Can any one help me to solve this? What could be the reason for this?


texts: How to add column for total orders in customer grid in magento?

texts:
I have added total number of orders column to customer grid in the magento admin.
I need to put 2 text box in that column like from and to so we can search customers whose total orders are between that given range.

ex. suppose we put 3 and 5 into (form and to) textbox then we will display all customers whose total orders are between 3 to 5.

and also need to work filtering (searching and sorting)

add code in the following file app\code\core\Mage\Adminhtml\Block\Customer\Grid.php

add this code in _prepareCollection() fucntion only

$sql ='SELECT COUNT(*)'
        . ' FROM ' . Mage::getSingleton('core/resource')->getTableName('sales/order') . ' AS o'
        . ' WHERE o.customer_id = e.entity_id ';
        $expr = new Zend_Db_Expr('(' . $sql . ')');

        $collection->getSelect()->from(null, array('orders_count'=>$expr));

and also add this code in _prepareColumns() function with same file

$this->addColumn('orders_count', array(
            'header'    => Mage::helper('customer')->__('Total Orders'),
            'align'     => 'left',
            'width'     => '40px',
            'index'     => 'orders_count',
            'type'  => 'number',
            'sortable' => true,
        ));


texts: Magento 2 checkout form customer email value pre-fill does not work while other works

texts:
I am using Magento 2.3. I am trying to pre-fill fields in Magento checkout form.
 I have done following. I followed this article.

First I defined dependency injection at vendor/module/etc/frontend/di.xml.
I believe it is working.

After that, I created layoutprocessor at Vendor/Module/Plugin/Magento/Checkout/Block/Checkout/LayoutProcessor.php with following contents:

<?php

namespace Vendor\Module\Plugin\Magento\Checkout\Block\Checkout;

class LayoutProcessor
{
    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array $jsLayout
    ) {
        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['firstname']['value'] = 'First Name';
        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['customer-email']['value'] = 'default@example.com';
        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['street']['children'][0]['value'] = 'Street Line one';

        return $jsLayout;
    }
}

My problem is that, the firstname field gets filled with the value, while customer-email field does not get filled with the supplied value. Where am I doing wrong?


texts: Add css file conditionally if the page is shopping cart using xml

texts: I need to add css file to shopping cart page. But it should only added to the that page. Is it possible to do this?


texts: In magento 2 How to show all customer review in separate custom page?

texts:
In magento2,using custom modules i need to show customer review in separate page like

reviewer name,
rating given
Which Product customer gave rating? etc.

Let me know how to get all those details in custom page.


texts: Magento 2 : Not able to get the frequently bought product collection in frontend same as related products

texts:
Right now I'm building a custom module and I am not able to get the frequently bought product collection in frontend from backend.
if anyone has any idea about it then please advise!


texts: showing product on custom page gives error

texts:
i am showing product on custom page created via modules

app\design\frontend\base\default\layout\related.xml

 <?xml version="1.0"?>
    <layout version="0.1.0">
      <related_index_index>
        <reference name="root">
          <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
          <block type="catalog/product" name="related_index" template="related/index.phtml"/>
        </reference>
      </related_index_index>
    </layout>

app\design\frontend\base\default\template\related\index.phtml
i just copied list.phtml content here with few modification

no it gives error

Fatal error: Call to a member function getStoreLabel() on a non-object in app\design\frontend\themefolder\themefile\template\catalog\product\price.phtml on line 53

i got few answer but i do not want to modify core files please suggest way to fix it

Line no 53 of price.html

$_specialPriceStoreLabel = $this->getProductAttribute('special_price')->getStoreLabel();

Updated code for my \app\design\frontend\base\default\template\related\index.phtml

Here i am show all related products of product

$model = Mage::getModel('catalog/product');
$product_id = Mage::app()->getRequest()->getParam('product');
$product = $model->load($product_id);

// Get all related product ids of $product.
$allRelatedProductIds = $product->getRelatedProductIds();

    $_helper = $this->helper('catalog/output');
    $store = Mage::app()->getStore();
    $code  = $store->getCode();

?>
<?php if(!count($allRelatedProductIds)): ?>
<?php foreach ($allRelatedProductIds as $id):
        $_product = $model->load($id);
        ?>

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_product->getName();?>

 <?php echo $this->getPriceHtml($_product, true) ?>
 <?php endforeach ?>


texts: Magento 2: practical explanation of what is a proxy class?

texts:
So, I know theorically what is a proxy class in Magento 2. I've read the awesome Alan Storm article about it and I totally understand how those classes are generated.

However, and I don't know if it's because I'm a non native English speaker or if Alan's explanations are using non core classes which are very abstract, but I'm having a hard time understanding how it works and specially when to use it during development.

So let's take this example from the core in app/code/Magento/GoogleAdwords/etc/di.xml:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\GoogleAdwords\Observer\SetConversionValueObserver">
        <arguments>
            <argument name="collection" xsi:type="object">Magento\Sales\Model\ResourceModel\Order\Collection\Proxy</argument>
        </arguments>
    </type>
</config>

I would like to know:

why a proxy class is used in that particular case ?
when, in general, should one use a proxy class ?


texts: How to check module enable or not from system advance tab in xml

texts:
I am adding a tab in product page in admin. I want to check module is enable or not before adding tab from xml.

System -> Configuration -> Advanced

Only in case of module enable then we want to add some xml to include. but in case of writing ifconfig we are getting true if module enable.

is there any else condition for that ?


texts: Remove left bar navigation from custom module via layout XML

texts:
I have 2 modules Blog and Recipe.

Blog module has left navigations :

Recent posts
Most views
Categories

configured in as:

\app\design\frontend\base\default\layout\mageplaza_betterblog.xml

<reference name="right">
        <block type="mageplaza_betterblog/sidebar" name="post.list.right" as="post_list_right" before="-">
            <action method="setTemplate" ifconfig="mageplaza_betterblog/general/sidebar_right">
                <template>mageplaza_betterblog/sidebar.phtml</template>
            </action>
        </block>
    </reference>

    <reference name="left">
        <block type="mageplaza_betterblog/sidebar" name="post.list.left" as="post_list_left" before="-">
            <action method="setTemplate" ifconfig="mageplaza_betterblog/general/sidebar_left">
                <template>mageplaza_betterblog/sidebar.phtml</template>
            </action>
        </block>
    </reference>

In my Recipe module, I have left sidebar links as :

Recipe Categories
Latest Recipes

configured as :

\app\design\frontend\base\default\layout\magenshop\recipe.xml

 <reference name="left">

        <block type="core/template" name="recipe_sidebar_newest" after="-">
            <action ifconfig="magenshoprecipe/general/shownewest" method="setTemplate"><template>magenshop/recipe/recipe_sidebar_newest.phtml</template></action>
        </block>

        <block type="core/template" name="recipe_sidebar_popular" after="-">
            <action ifconfig="magenshoprecipe/general/showpopular" method="setTemplate"><template>magenshop/recipe/recipe_sidebar_popular.phtml</template></action>
        </block>
        <block type="core/template" name="recipemenuleftsidebar" before="-" template="magenshop/recipe/menusidebar.phtml" />
        <!-- <remove name="post_list_left" /> -->
        <action method="unsetChild"><name>post_list_left</name></action>
    </reference>

Now I need to remove all the 3 left sidebar links from 'Blog' module which is conflicting with my recipe module.

ie) In Recipe module, I'm getting the links of Blog module as well.

I had tried to remove the Blog links in recipe.xml as:

<action method="unsetChild"><name>post_list_left</name></action>

But still the links are not getting removed.


texts:
In the product category page I have a block 'select your currency',but it does not show any option in the list.
My currency.phtml file is

<?php if($this->getCurrencyCount()>=0): ?>

        <?php echo $this->__('Select Your Currency') ?>

        <select name="currency" title="<?php echo $this->__('Select Your Currency') ?>" onchange="setLocation(this.value)" >
        <?php foreach ($this->getCurrencies() as $_code => $_name): ?>

            <option value="<?php echo $this->getSwitchCurrencyUrl($_code) ?>"<?php if($_code==$this->getCurrentCurrencyCode()): ?> selected="selected"<?php endif; ?>>
                <?php echo $_name ?> - <?php echo $_code ?>
            </option>
        <?php endforeach; ?>
        </select>
        <?php echo $_code;?>

<?php endif; ?>

Is there any problem in this file ?
  In the system->configuration->currency setup
  Base currency: US dollar
  Default display currency:Canadian Dollar
  Allowed currencies:Canadian Dollar

In manage currency rate
1.03 can=1.00 US dollar

How to get more than one option in the list ?
also i want to know the purpose of all the layout handles in directory.xml file like
catalog_category_layered
catalogsearch_advanced_index
catalogsearch_result_index
catalogsearch_advanced_result etc.

Please help me.
Thanks in advance.


texts: why admin grid not showing in front end in magento 2

texts:
i'm working on overriding admin ui filter in custom module

https://belvg.com/blog/ui-grid-component-on-the-front-end-in-magento-2.html
with referring this blog

  but only loading css files not loading Magento_Ui/js/grid/provider

i added with all the steps
with (ui component)
but not showing anything in front end

ui component/mpquotesystem_seller_filters.xml

 <?xml version="1.0" ?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
        <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
        <item name="update_url" path="mpquotesystem/sellerquote/filters" xsi:type="url"/>
        </item>

    </argument>

</listing>

can you help me to find out the problem??


texts: Magento 2 - trigger order email and invoice on status change

texts:
In a custom Magento 2 module, I have some code that successfully creates an order from a quote and sets the status to "pending".

After payment, I would like to programmatically validate the order, generate the invoice and send the confirmation email to the client.

The code that sets the status to complete:

// Update the status
$order = $this->orderFactory->create()->loadByIncrementId($orderIncrementId);
$order->setStatus('complete');
$order->save();

Unfortunately, this doesn't generate an invoice and send the final email. How are we supposed to perform these action programmatically from an existing/pending order?


texts: Enable/Find VAT Registration Number Billing Address?

texts: I can see references all over Magento settings for the VAT reg number but I cannot find it using the store as a customer. Is there a setting to enable it on registration and to edit it later?


texts: Can I use Magento Community to learn how to create Magento Enterprise Themes?

texts:
Pretty simple question, I hope it's not too absurd for those with knowledge!

I am a frontend developer, I work for a company (that for reasons I won't bore you with, do not have direct access to the Magento frontend at this moment in time but that will change) that uses Magento (2) Enterprise. In my own time I'd like to develop the skills to be proficient in working on Magento in terms of frontend and themes.

If I was to install and work with the Community version would it be a total waste of time or would I be able to grasp some of the basics, quirks and concepts so when I am faced with Enterprise I'm not caught in the headlights.

If not, what is the best way to get hands on practice with Magento themes for Enterprise?


texts: How to call save method in collection instance

texts:
I was appeared Magento 2 Associate developer certification exam, in that I got the below tricky question, but I don't know the concept and answer of the question. can you have an idea regarding the answer and concept means kindly share your thoughts?

What will be the result of calling the save() method on a collection instance?

1.  It will save all items with one INSERT... ON DUPLICATE KEY UPDATE
    query.
2.  It will save the select query to the cache.
3.  It will save the select query execution result into the cache.
4.  It will loop over all items and call save() on each one.

What is the relationship between order entities and order address entities?

    1. One shipping address per unit of quantity is possible.
    2. One shipping address per line item is possible.
    3. Only one shipping address per order is possible
    4.  One shipping address per product type is possible.


texts: Can anyone suggest more technical resources for Magento 2?

texts:
I was able to find few articles on Magento 2  from

http://magenticians.com/
http://www.thienphucvx.com/

If anybody know some other resources can you please share it here? (links, Ebooks, blogs etc)


texts: Magento2: How to create a PDF in a custom module

texts:
I would like to generate a custom pdf upon sale and attach it to the sales email all within a custom module.

I think I need to extend Magento\Sales\Model\Order\Pdf\AbstractPdf to generate the pdf but I am not certain.

Has anyone done this before or has any idea if I'm on the right track?

// edit:

As per the comments, here is a basic layout as to how I included http://www.fpdf.org/ into my custom module:

First I downloaded the fpdf package. I extracted the files and placed them all into my Modules Helper folder, which now looks like this:

- Helper
 -- font (folder)
 -- makefont (folder)
 -- FPDF.php
 -- Data.php

Data.php is the only file I already had in this folder as it contains my helper Data class.

Next I edited the FPDF.php and added my modules namespace to it.

I edited my helper Data.php file and use my namespaces FPDF class:

use Company\ModuleName\Helper\FPDF as FPDF;

I defined any pdf infos I need in the data Class - you do not need this:

// PDF INFOS
protected $pdfFileDir = 'someDir/someSubDir/';
protected $logo1 = 'myLogo.jpg';
protected $logo2 = 'myExtraLogo.jpg';

/**
 * @var \Company\ModuleName\Helper\FPDF
 */
protected $_pdf;

and construct it

/**
 * @param \Company\ModuleName\Helper\FPDF $pdf
 * @param array $data
 */
public function __construct(
    (...)
    FPDF $pdf,
    (...)
    array $data = []
) {
    (...)
    $this->_pdf = $pdf;
    (...)
    parent::__construct($context);
}

I then created my method and generate the pdf:

public function generatePdf($productId, $someOtherVars)
{
    #start the pdf
    $pdf = new FPDF();

    $pdf->AddPage();
    $pdf->SetAutoPageBreak(0, 5);
    $pdf->SetFont('Arial', 'B', 16);

    // do your FPDF stuff here
    // eg: $pdf->Cell('', '', iconv('UTF-8', 'windows-1252', 'Page Header Title'), 0, 1);

    // $pdf->Ln(8);
    // $pdf->Cell('', '', $today, 0, 1, 'L');
    // and so forth .. see the FPDF documentation

    // render pdf
    $filename = 'somename' . $productId . '.pdf';
    $pdf->Output($this->getPdfBaseDir() . $filename, 'F');

    return $this->getPdfBaseDir() . $filename;
}

Then you call your method in your controller via your helper (which you need to include of course):

$this->dataHelper->generatePdf($yourVars);


texts: Magento2: How to get country list in custom HTML template

texts:
I need to display a country list with dropdown in the custom knockout HTML template.
Help would be appreciated.


texts: Adding content block to the Home Page, removing 'std'

texts:
I want to do a few things, and I am new and very very far from proficient with Magento; what I am asking for is the best, most concise way to do the following:

I would like to edit the content of my home page—and probably every other CMS page, as I get further in this project—in my text editor and not in the admin panel WYSIWYG. I guess I'd just have a template like home-content.phtml containing my markup for my carousel(s) and whatever else I end up putting on my home page. It seemed to me the most logical way to do this is attach my home-content.phtml to the getChildHtml('content') method in Admin panel -> CMS -> Pages -> Home Page -> 'Design' tab -> Layout Update xml with code like this:

<reference name="content">
            <block type="core/template" name="home-content"
                   as="home-content" template="home-content.phtml" />
</reference>

However, that was messed up by the next thing I wanted to do...
In my opinion, the default Magento HTML structure is horrifically bloated, with too many nested div's (wrapper -> page -> main-container col1-layout -> main -> col-main just to get to the content of a page). It makes styling with Sass a nightmare for me, with all those classes' styles split up into 5 different Sass partials. So, I am cleaning up the default structure to match my own design principals. Part of this means removing empty elements, such as the infamous

. The most efficacious way to get rid of this (as I don't plan on using the admin panel for content) is with <remove name="cms.wrapper"> in the CMS Home Layout Update XML. The problem is, this removes anything I add with the method above (reference name="content").

Basically: How can I add content to my Home Page with a .phtml and remove the

 without a conflict? I don't understand how the functionality of admin -> CMS -> layout update XML differs from the functionality of layout.xml, or why I should use one over the other (like, could I not use <cms index-index> to do the same thing?).

Thanks in advance, everyone.


texts: Magento 2 Uncaught TypeError: data.some is not a function

texts:
I have found below error in console on backend while editing customer from customer grid.
Path: Customers-> All Customers -> Edit.

  Uncaught TypeError: data.some is not a function
      at findFirst (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :5:41)
      at UiClass.clear (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :13:271)
      at UiClass.setInitialValue (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :13:406)
      at UiClass.eval [as setInitialValue] (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :5:186)
      at UiClass.initialize (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :3:1152)
      at UiClass.eval [as initialize] (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :5:186)
      at UiClass._super (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :5:147)
      at UiClass.initialize (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :8:172)
      at UiClass.eval [as initialize] (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :5:186)
      at new UiClass (eval at require.load (58d22521c2a079102fb0d912e124e25b.min.js:180), :5:16)

Thanks in advance for any help.


texts: MEQP Gives a Warning : Data load getFirstItem() method detected in loop

texts:
I want to get the First item from the collection so I have used following code. But it gives some warning on the usage of getFirstItem()

protected $_sampleFactory;

public function __construct(
   \Vendor\Module\Model\sampleFactory $sampleFactory,
) {
   $this->_sampleFactory = $sampleFactory;
}
public function execute()
{
   $collection = $this->_sampleFactory->create()->getCollection()->addFieldToFilter("product_id", $product_id);

   $customer_id = $collection->getFirstItem()->getCustomerId();
   return $customer_id;
}

This code is working properly but when I checked with magento-coding-standard tool its given me the warning on usage of getFirstItem() as follow.

  107 | WARNING | Data load getFirstItem() method detected in loop
  107 | WARNING | getFirstItem does not limit the result of collection load to one item.

Anyone has any idea how to solve it?


texts:
I have customized the magento's price rounding by changing in app/code/local/Mage/Core/Model/Store.php file's Round function and set the precision to 4 instead of 2 and also do changes in app/code/local/Mage/Paypal/Model/Api/Abstract.php for _exportLineItems function's $request[sprintf($privateFormat, $i)] = $value; line to $request[round($privateFormat,2)] = $value;

After this everything is working fine. But Now I have got an issue, When open paypal account and then via activity open the order for payment details it shows me different amount.

Below is image from my store:

And this one is from paypal:

One more thing my store has 7% tax and all products are incl. of tax.

Suggest where to changes to get the same amount details in paypal account.


texts: Magento 2, addAttributeToSelect not working with product collection?

texts:
I am applying these fillers:

$collection->addAttributeToSelect('name');
$collection->addAttributeToSelect('sku');

but every time getting full record as comes form:

$collection->addAttributeToSelect('*');

[{"entity_id":"101","attribute_set_id":"9","type_id":"simple","sku":"MH04-XS-White","has_options":"0","required_options":"0","created_at":"2018-10-08 07:35:50","updated_at":"2018-10-08 07:35:50"},{"entity_id":"102","attribute_set_id":"9","type_id":"simple","sku":"MH04-XS-Yellow","has_options":"0","required_options":"0","created_at":"2018-10-08 07:35:50","updated_at":"2018-10-08 07:35:50"},{"entity_id":"103","attribute_set_id":"9","type_id":"simple","sku":"MH04-S-Green","has_options":"0","required_options":"0","created_at":"2018-10-08 07:35:50","updated_at":"2018-10-08 07:35:50"},{"entity_id":"104","attribute_set_id":"9","type_id":"simple","sku":"MH04-S-White","has_options":"0","required_options":"0","created_at":"2018-10-08 07:35:50","updated_at":"2018-10-08 07:35:50"},{"entity_id":"105","attribute_set_id":"9","type_id":"simple","sku":"MH04-S-Yellow","has_options":"0","required_options":"0","created_at":"2018-10-08 07:35:50","updated_at":"2018-10-08 07:35:50"},{"entity_id":"106","attribute_set_id":"9","type_id":"simple","sku":"MH04-M-Green","has_options":"0","required_options":"0","created_at":"2018-10-08 07:35:50","updated_at":"2018-10-08 07:35:50"},{"entity_id":"107","attribute_set_id":"9","type_id":"simple","sku":"MH04-M-White","has_options":"0","required_options":"0","created_at":"2018-10-08 07:35:50","updated_at":"2018-10-08 07:35:50"}]

I am getting collection using class as:

\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory

and

public function getProductCollection()
{
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('name')->addAttributeToSelect('sku');
    $page = $this->getRequest()->getParam('page');
    $collection->setPageSize(50)->setCurPage($page);
    return json_encode($collection->getData());

}


texts: Magento 2. Command that is executed when admin:user:create is executed

texts:
Magento 2 has a console command admin:user:create

At a quick search we find a class that defines a command with such a name  Magento\Setup\Console\Command\AdminUserCreateCommand

Yet putting a breakpoint or even the old var_dump die seems to have no effect when this console command is run admin:user:create.

So what code is executed when we run admin:user:create from the console?

 /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        var_dump("here");
        exit;
        $errors = $this->validate($input);
        if ($errors) {
            $output->writeln('<error>' . implode('</error>' . PHP_EOL . '<error>', $errors) . '</error>');
            // we must have an exit code higher than zero to indicate something was wrong
            return \Magento\Framework\Console\Cli::RETURN_FAILURE;
        }
        $installer = $this->installerFactory->create(new ConsoleLogger($output));
        $installer->installAdminUser($input->getOptions());
        $output->writeln(
            '<info>Created Magento administrator user named ' . $input->getOption(AdminAccount::KEY_USER) . '</info>'
        );
    }

Does nothing. The command executes freely.


texts: Fedex/UPS/USPS API Integration Backup Plan

texts:
Like a majority of Magento ecommerce users, I call realtime API quotes from FedEx/UPS/USPS to get the shipping rates. The majority of the time, everything works okay. However, on occasions the API goes down (scheduled maintenance or randomly).

Scheduled maintenance, the administrator can go ahead and set a flat rate or table rate ahead of time. However when it randomly goes down, this can cause a massive headache. An example of this, is when Fedex went down for 57 minutes on Black Friday (Source). This affected approximately 200 customers/orders.

I am thinking of either finding a extension or writing my own that calls one API (lets say FedEx), if Fedex doesn't respond within 3 seconds, it will attempt to call the API of UPS. Of course there will be mapping involved (Fedex Ground = UPS Ground and so on) and I know the quotes price won't be exact (FedEx might be $6.75 and UPS might be $7.35), however I am attempting to give the customer a shipping quote without them noticing a problem or a problem that prevents them to checkout.

My question is, how do other Magento sites prepare for this? Do you have failsafes? Are the failsafes done manually or programmatically?


texts: Change product url when changing product name

texts:
Are there any extensions or settings that can change the product url when you change the product name.

Before example:

Product name: Product 1
Product url: product-1

After example:

Product name: Product 12
Product url: product-12

I want this to be like the example above.


texts: Magento 2: How to override core js module price-bundle.js

texts:
I am attempting to override the _onQtyFieldChanged event in the mage.priceBundle widget in the module-bundle/view/base/web/js/price-bundle.js file.

I am referencing the Magento dev docs (http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/custom_js.html) and this Magento StackExchange question (Magento2: How can I override core js module price-box.js), but I can't manage to get my custom _onQtyFieldChanged event method to execute. As of now I only have a console.log statement in that method.

A little background:
My custom price-bundle.js file is found in Endertech/BundleExtended/view/base/web/js directory.
My requirejs-config.js is in Endertech/BundleExtended/view/frontend.

requirejs-config.js:

var config = {
    map: {
        "*": {
            priceBundle: 'Endertech_BundleExtended/js/price-bundle',
            'Magento_Bundle/js/price-bundle': 'Endertech_BundleExtended/js/price-bundle'
        }
    }

};

Endertech/BundleExtended/view/base/web/js/price-bundle.js:

define([
    'jquery',
    'underscore',
    'mage/template',
    'priceUtils',
    'priceBox',
    'priceBundle',
], function ($, _, mageTemplate, utils) {
    'use strict';

    $.widget('Endertech.priceBundle', $.mage.priceBundle, {

        _onQtyFieldChanged: function onQtyFieldChanged(event) {
            console.log("Endertech Module");
            var field = $(event.target),
                optionInstance,
                optionConfig;

            if (field.data('optionId') && field.data('optionValueId')) {
                optionInstance = field.data('option');
                optionConfig = this.options.optionConfig
                    .options[field.data('optionId')]
                    .selections[field.data('optionValueId')];
                optionConfig.qty = field.val();

                optionInstance.trigger('change');
            }
        }
    });

    return $.Endertech.priceBundle;

});

EDIT:

So I realized that probably the issue I am coming across is the fact that the widget method I am trying to modify is a private method in module-bundle/view/base/web/js/price-bundle.js. Which is the reason why I can't override it or extend it. I am not sure if there is a way to get around this or a different approach I need to take to this issue that I don't know about.

Any help and suggestions are greatly appreciated.


texts: Change about routers between Magento 2.0.0-rc and Magento 2.0.0-rc2

texts:
I have a module with routers have frontName as "ticket". It working in Magento version 2.0.0-rc. But when i install this module in Magento version 2.0.0-rc2, i request to this routers and browser return "404 Page".

How to fix this routers ?

Thanks for advice.

This is very strange, because my module working normally with Magento 2.0.0-rc.

EDIT

My code in below.

app/code/Demo/Ticket/etc/frontend/routers.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="ticket" frontName="ticket">
            <module name="Demo_Ticket" />
        </route>
    </router>
</config>

app/code/Demo/Ticket/etc/module.xml

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

app/code/Demo/Ticket/Controller/Index/Index.php

<?php
   namespace Demo\Ticket\Controller\Index;

   class Index extends \Magento\Framework\App\Action\Action
   {
        public function __construct(
           \Magento\Framework\App\Action\Context $context,
        ){
           parent::__construct($context);
        }

       public function execute()
       {
           echo "Event Ticket";
       }
   }

app/code/Demo/Ticket/registration.php

<?php
   /**
    * Copyright © 2015 Magento. All rights reserved.
    * See COPYING.txt for license details.
    */

   \Magento\Framework\Component\ComponentRegistrar::register(
     \Magento\Framework\Component\ComponentRegistrar::MODULE,
      'Demo_Ticket',
       __DIR__
    );


texts: Magento 2.2.x - How to create customer radio and checkbox button attribute

texts: want to show radio button and checkbox in customer registration page and admin panel... I need exactly radio button and checkbox... But most of the friends mentioned in his/her blog on 'input'=>'boollean', it's not fulfilling my requirement.... Can anyone help me to create the custom customer attribute as radio and checkbox?


texts: Get Saved Credit/Debit Card Details in Magento2

texts: How can I get already saved credit/debit card details to use in my custom module from checkout page before place order.


texts: How to add some js files to catalog product grid

texts:
I want to add some js file to catalog product grid page in admin panel. For this I have tried below code in .xml file :

<adminhtml_catalog_product_index>
    <referense name="head">
        <action method="addJs"><script>admin/custom.js</script></action>
    </referense>
</adminhtml_catalog_product_index>

But above code not working, but when I add it in default section then it is added custom.js to all admin pages.

How to add js file to catalog product grid page in admin panel using xml?


texts: Update page layout sidebar-main and column.main widths

texts:
I'm on Magento 2.2.4 and I can't figure out how to edit the CSS for the catalog view page. I'm trying to edit

.page-layout-2columns-left .column.main

and

.page-layout-2columns-left .sidebar-additional

so that it's the same width as the layout when you login as a customer.

Sidebars being 22.3% and main content being 77.7%.

I tried adding this code to overwrite in my /Magento_Theme/web/css/source/_module.css but the column.main style is still reading 83.333333% somewhere.

.page-layout-2columns-left {
    .column.main {
        width: 77.7%;
    }

    .sidebar-additional,
    .sidebar-main {
        width: 22.3%;
    }
}

Any help is appreciated.


texts: how insert data into database custom table using custom module in model

texts:
I have created custom module and model but could not insert the data into database using the model please help how to do it

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <stallioni_vendorpage>
            <version>0.1.0
        </stallioni_vendorpage>
    </modules>
    <global>
        <models>
            <stallioni_vendorpage>
                <class>Stallioni_Vendorpage_Model</class>
                <resourceModel>vendorpage_resource</resourceModel>
            </stallioni_vendorpage>
            <vendorpage_resource>
                <class>Stallioni_Vendorpage_Model_Resource</class>
                <entities>
                    <vendorpage>

vendorpage

                    </vendorpage>
                </entities>
            </vendorpage_resource>
          </models>
        <resources>
            <vendorpage_setup>
                <setup>
                    <module>Stallioni_Vendorpage</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </vendorpage_setup>
            <vendorpage_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </vendorpage_read>
            <vendorpage_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </vendorpage_write>
        </resources>
        <blocks>
            <vendorpage>
                <class>Stallioni_Vendorpage_Block</class>
            </vendorpage>
        </blocks>
    </global>
    <frontend>
        <routers>
            <vendorpage>
                <use>standard</use>
                <args>
                    <module>stallioni_vendorpage</module>
                    <frontName>vendorpage</frontName>
                </args>
            </vendorpage>
        </routers>
        <layout>
                <updates>
                    <vendorpage>
                        <file>vendorpage.xml</file>
                    </vendorpage>
                </updates>
            </layout>
    </frontend>

</config>

model resource code

 class Stallioni_Vendorpage_Model_Resource_Vendorpage extends Mage_Core_Model_Resource_Db_Abstract
{
    protected function _construct()
    {
        $this->_init('vendorpage/vendorpage','vendorpage_id');
        //$this->_blockGroup = 'vendorpage';
    }

}


texts: How to find this Zendesk widget code in magento 1.9?

texts: I tried to search everywhere but still found nothing. I can't remember where i put it


texts: How to display Products Images on Category Products

texts: How can I show products images on category products page?


texts:
Recently I have migrated the magento-1 (ver: 1.9.1.1) data to magento-2 (Ver: ver: 2.1.2) fress version using data migration tool. And it working perfectly in our local computer (localhost).

I found an issue after upload it to server m2.hiddencamera.com.au that some product images not showing instead it showing blank image (http://m2.hiddencamera.com.au/hidden-cameras?cat=84). And this problem is for not generating the image cache in pub/media/catalog/product/cache/ folder.

But when I try to regenerate the image using php bin/magento catalog:image:resize it showing a warning;

Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file in /vendor/magento/framework/Image/Adapter/Gd2.php on line 65

However in the mean time before showing the Warning it generate some new images cache in the /pub/media/catalog/product/cache folder.

I have tried to show the new generated images after setup:upgrade, indexer:reindex, cache:clean, cache:flush
 But it not updating the missing image url for the new generated images cache.

Also I have contacted with the hosting support (siteground) but no luck.

Additional Information

Upgraded M2 Ver: 2.1.2
Migrated from: 1.9.1.1
PHP Version: 7.0.21
memory_limit: 768M
max_execution_time: 120

N.B: I have checked after migrated the Magento1 data to Magento ver: 2.1.7 that it causing the same issue when upload to server, but working properly in localhost.

I don't know exactly where the problem is. Please help me to resolve the issue for regenerating the product images.

Regards,


texts:
I'm extending catalog product edit page for this I have extended the Edit.php file from vendor/magento-catalog/block/adminhtml/product. My Changes is applying, but when i save the product it's not saving.

Same functionality working in first released Magento 2 ver 1.0.0 beta, but it's not working in recently released both MEE and MCE (ver 2.0.0 and 2.0.2).

For this I have written code as below.

Learning/Custom/etc/module.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Learning_Custom" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>

Learning/Custom/Block/Adminhtml/Product/ProductEdit.php

<?php
namespace Learning\Custom\Block\Adminhtml\Product;

use \Magento\Catalog\Block\Adminhtml\Product\Edit;

class ProductEdit extends Edit
{

    /**
     * @var string
     */
    protected $_template = 'catalog/product/edit.phtml';

}

Learning/Custom/etc/di.xml

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

<preference for="Magento\Catalog\Block\Adminhtml\Product\Edit" type="Learning\Custom\Block\Adminhtml\Product\ProductEdit"/>

</config>

Learning/Custom/view/adminhtml/templates/catalog/product/edit.phtml

<h1> Hi I'm extending product edit page</h1>
....
//below is the product edit.phtml file coding here i'm not posting.

I have cleared the cache and I have ran php bin/magento setup:static-content:deploy. But still no luck.

Could you please suggest me on this?


texts:
I have try to upgrade magento to latest version but when I try after run command:

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

I get error:

Failed to clone git@github.com:EaDesgin/magento2-pdf-generator2.git, git was not found, check that it is installed and in your PATH env.

  sh: git: command not found


texts:
Is there a safe way to upgrade from v1.9.x to v2?

Also I'd like to know if themes made for v1.9.x will work in v2?


texts: Magento 2: How to Read From Configuration Tree

texts:
What's "the right" way to read from a merged module XML configuration tree in Magento 2.

For example, in Magento 2, many modules have a pdf.xml configuration file

./Bundle/etc/pdf.xml
./Downloadable/etc/pdf.xml
./GroupedProduct/etc/pdf.xml
./Sales/etc/pdf.xml
./Tax/etc/pdf.xml
./Weee/etc/pdf.xml

It's my assumption, that similar to Magento 1, these files are all merged into a single tree for reading.  In Magento 1, you'd ready from the merged configuration tree with a config object

$config = Mage::getConfig();
$config->getNode('path/to/node');

It's not clear how a developer should fetch data from the merged pdf.xml files.  The dev docs has some good raw information about the new configuration system, but no straight forward examples of code that's equivalent to the above code in Magento 1.

I can think of half a dozen ways to do this using plain old PHP or the Magento 2 objects I know about -- I'm interested in the "according to hoyle" way the Magento 2 core team does this when they need to (or, if there isn't one standard way, and it depends on which XML section you're reading from)


texts:
I've made payment extension.
It works well.

Now I need to make showing payment url (below payment method name)

On 1.x I just edit info.phtml with using function $this->isEmailContext()

How can I make it now?
And how to get current order?


texts: Order confirmation email send to wierd email adresses

texts:
Magento is sending the order confirmation mail to my store email but also to a gmail a hotmail and other email address.

I also receive the confirmation mail 2 times.

How do I resolve this issue?


texts: Magento AddTab with Form & Grid within Same Tab in Admin Module

texts:
So I have a methodology that works fine but I have a distinct feeling there is a totally different way, more Magentoriffic way to do this.

I have an admin module with a tabbed form. In one of the tabs, I want a small form to reside just above a grid. I have done it by doing a simple append on the blocks with a period as shown below.

Works great, no errors, no exceptions, but I have not seen this methodology anywhere else in Magento.

So, I am on a quest to determine the Magento way of doing this. Here is my code:

$this->addTab('directory_content', array(
    'label'     => Mage::helper('businessdirectory')->__('Listings'),
    'title'     => Mage::helper('businessdirectory')->__('Listings'),
    'content'   => $this->getLayout()->createBlock('businessdirectory/adminhtml_directories_edit_tab_listing')->toHtml().
                   $this->getLayout()->createBlock('businessdirectory/adminhtml_directories_edit_tab_listing_grid')->toHtml()
));


texts:
I'm trying to build a CRUD module for Magento 2.
In this module, one of my entities has a "many to many" relation with the products.
For this, I need to add a section in my add/edit form where I can select the products.
I want to do this using form ui components, not with tabs.
I thought I could replicate the way the related products are done in the product add/edit form.
But there is a problem. I don't understand how is that added to the product form.
From what I saw, the product form uses ui components.
So how is the related products section added to the product edit screen?


texts: Why to create categories of simple products

texts:
I need to ask why do we create categories of simple products if we set that to not visible individually..?

Is there any specific purpose for it..?


texts: Observer calling class in construct 500 error

texts:
I have an observer, which is working fine (after some effort on what is a Frankenstein website). However when I attempt to use my class in my construct it causes a 500 error (mode is developer, but no useful logs are being created, and the error stated is to do with the guest checkout) - if I remove the class from the construct then the observer works.

<?php

namespace MyVendor\Order\Observer;

use \Magento\Framework\Event\Observer;
use \Magento\Framework\Event\ObserverInterface;
use \Psr\Log\LoggerInterface;

class OrderObserver implements ObserverInterface
{
    protected $logger;
    protected $exporter;

    public function __construct(
        LoggerInterface $logger,
        \MyVendor\Order\Model\Exporter $exporter
    ){
        $this->logger = $logger;
        $this->exporter = $exporter;
    }

    public function execute(Observer $observer)
    {
        //Observer execution code...
        $this->logger->debug('MyVendor-Observer');
        //$this->exporter->orderPlacedObserver($observer);
    }
}

There does not seem to be any error with setup:di:compile (not that this needs running in developer mode I know) - so how would I debug this issue and use my other class within the Observer?


texts: Customer's password changing unexpectedly

texts:
I am facing an issue, Some of registered customers are unable to login in website, They getting error message

  invalid login or password

and every time there is need to reset password from backend

Any one have suggestion why this happen.


texts: Magento 2. Catalog product edit save button not working

texts:
admin/catalog/product/save button is not working anymore.

I'm unable to edit/save product.

No output whatsoever in var/log/*
No output whatsoever in browser console
No activity in browser network tab
No custom module messing with the form.

Any tips on further debugging this?


texts: Magento 2 maintenance Mode Apache rewrite 503 error for image and css file

texts:
https://devdocs.magento.com/guides/v2.4/comp-mgr/trouble/cman/maint-mode.html#compman-trouble-maint-create

I have followed this guide to enable maintenance mode and create a maintenance page.
I have add new 4 file in root

/maintenance_files/styles.css
/maintenance_files/widgets.css
/maintenance_files/pelle_meca.png

and add this code in root .htaccess file.
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^192\.0\.2\.110
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html
Header Set Cache-Control "max-age=0, no-store"

I have enabled maintenance mode and create file maintenance.enable in doc root.
Now all Url is rewritten on the maintenance page but CSS and image are also rewritten and page structure is messed up.


texts: Magento checkout - getting custom attribute value

texts:
I am working in the OnepageController.php

What I needed was in the checkout process was to get values of some customer created attributes for the products in the current order. I have been able to get the system attribute 'sku' to show but I can't get custom attribute values to show.

My code so far is:

    $helper = Mage::helper('checkout/cart');
    $items = $helper->getCart()->getItems();

    foreach ($items as $item) {
        $itemSku = $item->getSku();

        echo $itemSku."<br/>";
  }

I have ran this in FireFox using Firebug and it does display the SKU value. What I need however is the value of a custom attribute created in the backend. I have tried to replace:

$itemSku = $item->getSku();

to:

$itemEan = $item->getAttributeText('ean');

Where 'ean' is the attribute identifier. This attribute is a text field. When the checkout is ran again there are no errors but noting displayed (apart from the break line html tag).

I also have another custom attribute which is a 'multi-select' attribute. Does how we get the attribute value for this change?

Any help displaying this is much appreciated.

UPDATE

I can't write an answer because of no reputation but I have found a solution which works for me if it helps anyone. The code below worked for me:

    $cartItems = Mage::getSingleton('checkout/session')->getQuote()-getAllItems();
    foreach ($cartItems as $item) {
        $ean = Mage::getModel('catalog/product')->load($item->getProduct()->getId())->getEan();
        echo $ean;
    }

where 'getEan()' is the name of my custom attribute starting with a capital letter.

Thanks to all for their input.


texts: export all product fields with custom options

texts:
I need to import products in Magento 1.9 through .csv

Simple products which I need to import all have custom options.

Can you tell me where should I find the structure of the csv with the correct fields to be filled?


texts: How to get current product in Magento 2.3.1 without deprecations

texts:
Not a duplicate question, as the referenced original question uses deprecated classes.

I want to get the current product in a Block / Model in Magento 2.3.1. I cannot directly use / inject / extend any deprecated classes like Registry / AbstractProduct. Must use DI and not ObjectManager

What is the best alternative for this?


texts: How to combine JS files in Magento 2.2.4

texts: I am using Magento 2.2.4 and want to combine external JavaScript files but, In the admin section I didn't find the options for it under the Developer section.


texts: How to extend model to get data from third party extension?

texts: I have a third party extension here and it has its own grid, and what I want to do is I'm going to create a custom module to make a grid in the backend using the data from that third party extension grid. Is this possible? And I'd like to know how or what should I do next? thank you.