texts: Magento 2: How to upgrade Magneto version 2.2.1 to 2.3.2?

texts:
i want to update my Magento to v2.3.2, when i run composer update, i get this error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for magento/product-community-edition 2.3.2 -> satisfiable by magento/product-community-edition[2.3.2].
    - Installation request for phpro/grumphp ^0.12.1 -> satisfiable by phpro/grumphp[v0.12.1].
    - magento/product-community-edition 2.3.2 requires symfony/console ~4.1.0 -> satisfiable by symfony/console[v4.1.0, v4.1.0-BETA1, v4.1.0-BETA2, v4.1.0-BETA3, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9].
    - Can only install one of: symfony/console[v4.1.0, v2.8.38].
    - Can only install one of: symfony/console[v4.1.0-BETA1, v2.8.38].
    - Can only install one of: symfony/console[v4.1.0-BETA2, v2.8.38].
    - Can only install one of: symfony/console[v4.1.0-BETA3, v2.8.38].
    - Can only install one of: symfony/console[v4.1.1, v2.8.38].
    - Can only install one of: symfony/console[v4.1.10, v2.8.38].
    - Can only install one of: symfony/console[v4.1.11, v2.8.38].
    - Can only install one of: symfony/console[v4.1.12, v2.8.38].
    - Can only install one of: symfony/console[v4.1.2, v2.8.38].
    - Can only install one of: symfony/console[v4.1.3, v2.8.38].
    - Can only install one of: symfony/console[v4.1.4, v2.8.38].
    - Can only install one of: symfony/console[v4.1.5, v2.8.38].
    - Can only install one of: symfony/console[v4.1.6, v2.8.38].
    - Can only install one of: symfony/console[v4.1.7, v2.8.38].
    - Can only install one of: symfony/console[v4.1.8, v2.8.38].
    - Can only install one of: symfony/console[v4.1.9, v2.8.38].
    - Conclusion: install symfony/console v2.8.38

Here is my composer.json:

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.3.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "composer/composer": "@alpha",
        "ebizmarts/mailchimp-lib": "^3.0",
        "magento/product-community-edition": "2.3.2",
        "phpro/grumphp": "^0.12.1"
    },
    "require-dev": {
        "friendsofphp/php-cs-fixer": "~2.10.1",
        "lusitanian/oauth": "~0.8.10",
        "pdepend/pdepend": "2.5.2",
        "phpmd/phpmd": "@stable",
        "phpunit/phpunit": "~6.2.0",
        "sebastian/phpcpd": "~3.0.0",
        "squizlabs/php_codesniffer": "3.2.2"
    },
    "config": {
        "use-include-path": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": "app/code/"
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "alpha",
    "prefer-stable": true,
    "repositories": [
        {
            "type": "composer",
            "url": "https://repo.magento.com/"
        }
    ],
    "extra": {
        "magento-force": "override"
    }
}


texts: customer undefined trying to check if logged in

texts:
I'm trying to display a registration pop-up only if a user has never seen it before and it occurred to me it would be wise to also check to make sure they were not already logged in.

But when I follow the suggestions I have seen to use Magento_Customer/js/model/customer, customer ends up being undefined so I can't check customer.isLogged();

Am I missing something?

define([
    "jquery",
    "Magento_Customer/js/model/customer",
    "mage/cookies"
], function ($, customer) {
    "use strict";
    return function myscript() {
        // it was failing setting the variable so I added this
        console.log('in myscript', customer);
        // the console shows that customer is undefined
        var isLoggedIn = customer.isLoggedIn();
        var regMsgSeen = $.mage.cookies.get('regMsgSeen');
        if(!regMsgSeen && !isLoggedIn) {
            $(document).ready(
                function () {
                    $.mage.cookies.set('regMsgSeen',1,{});
                    setTimeout(
                        function () {
                            $('div#zoo-register-form').modal('openModal');
                        }, 1000);
                });
        }
    }
});


texts: Range in custom attribute in magento, layered navigation

texts:
I want to show custom attribute in range in layered navigation like the price is shown in range

  £20.00 - £30.00
  £30.00 - £40.00
  £40.00 - £50.00

i want custom attribute Length in Range

 1.00 - 2.00 Meter
 2.00 - 3.00 Meter
 3.00 - 4.00 Meter
 4.00 - 5.00 Meter

I saw a few related questions (https://magento.stackexchange.com/a/34036/24017) which says use Price Catalog Input Type, i have tried it but it gives currency symbol in it and i want length unit (meter, cm, etc.).


texts:
I am trying to include a child block (store_message) within store.phtml. Here is my code:

    <reference name="content">
        <block type="marketplace/store" name="store_list" template="marketplace/storesearch/store.phtml">
            <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                <block type="page/html_pager" name="product_list_toolbar_pager"/>
                <!-- <action method="setData"><key>_current_grid_mode</key><value>list</value></action> -->
            </block>
            <block type="page/html" name="store_message" template="page/html/store_message.phtml" />
            <block type="marketplace/store" name="insert_review" template="marketplace/storesearch/insertreview.phtml" />

        </block>
    </reference>

I have read many articles on blocks for magento but still the concept of type=A/B is not very clear to me. If I am going to keep the child block in the same directory as the parent then what is the type=A/B should I give? What is A? What is B?

Some explanations said that A is the class and B is the method. How can a simple child block have a class and method ... its just a template. Can someone please explain?


texts: Magento2 Missing order status after order is placed

texts:
My orders are missing order status in admin

Shipping is Store Pickup, Payment is VISA by secure pay
How am I suppose to debug this?


texts: How to set the "Visible on Product View Page on Front-end" to "Yes" by default in Magento Admin >Catalog > Attributes > Manage Attributes?

texts: My client has a requirement that while adding a new attribute, the field "Visible on Product View Page on Front-end" should be set to Yes by default. I tried looking for the form but am not being able to figure out from where this value is being rendered. Where can I find the file from where this form is being rendered? Thanks in advance.


texts: How to get the ordered items images in the order detail API in magento 2?

texts:
I need to get the product image in the order details API of the customer. Please help me to guide how can I achieve this.

Thanks in ad


texts: Magento 1.9.2 - new order emails not queuing

texts:
Im facing an issue with new order e-mails.

As far as I know, magento uses cronjob to send emails previously stored in core_email_queue table.
I configured cron and it works fine - it seems that cron is not a problem.

When i click Send Email,  notify customer by email or anything in admin panel it works just fine. Message appears in the table and after a minute or so it is send.

The problem is when a customer places an order, email does not appear in core_email_queue table.

Order email sending is enabled in sales email tab.

What I've already tried:

Adding:

$isShellDisabled = true;

line to cron.php file.

Did not work.

Changing

$mailer->setQueue($emailQueue)->send();

to:

$mailer->send();

in Mage/Sales/Model/Order.php

Did not work.

Do you guys have any idea, what can be wrong or how could I check where the problem is?


texts: Magento 2.3 Elastic Search 5.0+ Error on some pages

texts:
I am running Magento 2.3 and set up elastic search 5.0+ which works fine on most pages but in some, including layered navigation search results I get the following error:

1 exception(s):
Exception #0 (Exception): Notice: Undefined index: color_bucket in
/home/tthh/public_html/vendor/magento/module-
elasticsearch/SearchAdapter/Aggregation/Builder/Term.php on line 23

I've looked in Term.php and this is line 23:

foreach ($queryResult['aggregations'][$bucket->getName()]['buckets'] as
$resultBucket) {

Lastly, with elastic search enabled, I randomly now cannot press on any of the layered navigation (shop by) choices, an ajax gif shows up but the results do not change.

Changing back to MySQL search works fine.

Any insight into sorting this would be appreciated.


texts: Magento2. Use non AMD javascript scripts

texts:
I am trying to load an external javascript in my Magento 2.1.x installation in this way:

    <script type="text/javascript">

        var _iub = _iub || [];
        _iub.csConfiguration = {
            siteId: xxx,
            consentOnScrollDelay : 1500,
            callback: {
                onConsentGiven: function(){
                    dataLayer.push({'event': 'iubenda_consent_given'});
                }
            },
            cookiePolicyId: xxx,
            lang: "it",
            banner: {
                fontSize: "13", applyStyles: false,
                html:"Privacy policy HTML"
            }
        };
    </script>
    <script type="text/javascript" src="//cdn.iubenda.com/cookie_solution/safemode/iubenda_cs.js" charset="UTF-8" async></script>

Including the script //cdn.iubenda.com/cookie_solution/safemode/iubenda_cs.js breaks all the other javascript requirejs functionalities.

I tried to include the script in the requirejs way, editing my theme requirejs-config.js file:

var config = {
    "map" : {
        "*" : {
            ...
            'iubenda' : '//cdn.iubenda.com/cookie_solution/safemode/iubenda_cs.js'
        }
    }
};

and changing its inclusion in this way

<script type="text/javascript">
        var _iub = _iub || [];
        _iub.csConfiguration = {
            siteId: xxx,
            consentOnScrollDelay : 1500,
            callback: {
                onConsentGiven: function(){
                    dataLayer.push({'event': 'iubenda_consent_given'});
                }
            },
            cookiePolicyId: xxx,
            lang: "it",
            banner: {
                fontSize: "13", applyStyles: false,
                html:"Privacy policy HTML"
            }
        };
    </script>

    <script>
        require(['iubenda'], function(){});
    </script>

But this does not solve the errors.

The common error thrown is

Uncaught Error: Mismatched anonymous define() module: function (){return l}

How can I add external non AMD scripts to my Magento 2.1.x without breaking the requirejs functionalities?


texts: How to get Parent SKU of a Child Product in Checkout Page?

texts: Can anyone please let me know how to get parent sku of a child product in a checkout page. I'm using $session = Mage::getSingleton('checkout/session'); object in my checkout page.


texts: Adding more options to 'sort by ' in product listings

texts:
I want to add more options in the 'sort by' box. How can I add these and what are other options to add there?

In this image there are 2 options, Name and Price. How can I add more options?


texts: Can I create a URL to send in email which will open a specific cart by id?

texts:
I'm implementing an abandoned cart email solution. Is it possible in Magento to access a given cart simply by clicking a URL with the cart id somewhere? E.g. something like:

https://www.mystore.com/cart?id=123456789

The specific use case when this is needed is when someone clicks the link from a different device than where he was doing the shopping.

I'm particularly interested to find out if this is possible for carts created by unlogged visitors - for logged in people the persistent cart option can be enabled, and then I only need to send the link to login.


texts:
This may sound like a dumb question but I really don't understand it. For example, Magento 2 has been saying to make sure "Magento cron job is running".

  Create the cron job
  To create a cron job as the Magento file system owner, enter the following command as a user with root privileges:
  crontab -u <Magento file system owner user name> -e
  Then write in the file:
  "path-to-binary" -c "ini-file-path" "your Magento install dir"/bin/magento cron:run [>> "log-file"&]
  "path-to-binary" -c "ini-file-path" "your Magento install dir"/update/cron.php [>> <log-file>&]
  <path-to-binary> -c "ini-file-path" "your Magento install dir"/bin/magento setup:cron:run [>> "log-file"&]*

As I said before, this was an example because my problem is that I do not know where to write those commands. It always says to write this command or write the other, but I can't find where I am supposed to put them.

UPDATE:
I have access to cPanel to manage my server and use FTP to upload the files.


texts:
I have a walk with large product collection.
But I want to stop walk working. I don't have any idea for it.
Here is my code:

$this->_resourceIterator->walk(
        $productCollection->getSelect(),
        [[$this, 'callbackMappingProduct']],
        [
            'product' => $this->_productFactory->create()
        ]
);

public function callbackMappingProduct($args){
    /**
     * @var $product \Magento\Catalog\Model\Product
     */
    if(true == $this->hasStop) {
          //Here I wanna stop my walk collection.
    }
}

Thank Any tips.


texts:
We are going to use controller_action_layout_generate_blocks_before  frontend event in M2.
please note same event which is working on M1 but it is not working please review my below code and share your ideas

app/code/Demo/Stackexchange/etc/frontend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_layout_generate_blocks_before">
        <observer name="Demo_check_for_vision_user_session" instance="Demo\Stackexchange\Observer\CheckForStackexchangeUserSession" />
    </event>
</config>

app/code/Demo/Stackexchange/Observer/CheckForStackexchangeUserSession.php

<?php
namespace Demo\Stackexchange\Observer;
use Psr\Log\LoggerInterface;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Session\SessionManagerInterface;
/**
 * Class CheckForStackexchangeUserSession
 * @package Demo\Stackexchange\Observer
 */
class CheckForStackexchangeUserSession implements ObserverInterface
{
    /**
     * @var SessionManagerInterface
     */
    private $coreSession;

    /**
     * @var LoggerInterface
     */
    private $logger;

    /**
     * constructor
     */
    public function __construct(
        LoggerInterface $logger,
        SessionManagerInterface $coreSession
    ) {
        $this->logger = $logger;
        $this->coreSession = $coreSession;
    }

    /**
     * Vision redirects a customer
     *
     * @param Observer $observer
     */
    public function execute(Observer $observer)
    {

       $writer = new \Zend\Log\Writer\Stream(BP.'/var/log/magento2.log');
       $logger = new \Zend\Log\Logger();
       $logger->addWriter($writer);
       $logger->info("Usage for");

    }

}


texts: Magento2- Email template not being translated

texts:
I have created a custom email template, all works well everything is shown, except when I use the trans dictionary to translate a string from English to German, the translation does not seem to work.

I have provided a de_DE.csv file but still the text it not being translated. Cleared cache, reindexed.


texts: Magento 2 | Observe ajax calls in one page checkout

texts:
I'm looking for a way to observe ajax calls on opc page for e.g. when user changes shipping address.

I'm rendering additional fields for carriers, but when user changes address default shipping methods table comes back.

Any solution?


texts:
I have a configurable product which is enabled, and visible in catalog, search. It has a child product which is also enabled, and in stock. But the product is not visible on the frontend.

I have found that this is because it is not in the flat table. Not does it appear in any of the index tables. What could cause a product it be ignored by magento like this?


texts: Magento 2.3.* EE - Cart Price Rule coupon expiration date

texts:
I am using Magento 2 EE. I found that there is a new feature of "Schedule Changes" for coupon from_date and to_date.

I added both dates in admin for a coupon. But even after the end_date is gone, the coupon can be still applied in the front.

Does anyone have an idea how to set an expiration date to the coupon in EE?


texts: How to set notify me when back in stock for Magento 2 through REST API?

texts:
In Magento2 customers can subscribe to the out-of-stock products and get notifications when back in stock.
I would like to know how can a customer subscribe to out-of-stock products through REST API.


texts: Are http_cache_hosts Applicable When Using Magento Cloud With Fastly?

texts:
Magento with Varnish
When using Magento with plain old Varnish, you can configure http_cache_hosts in app/etc/env.php to instruct Magento to automatically purge Varnish caches when Magento Caches are flushed from either Admin or Cli.
Magento DevDocs - Configure Magento To Purge Varnish
Magento Cloud with Fastly
When using Magento Cloud with Fastly, there are Fastly Purge Options in Admin Configuration for Category/Product/CMS Page that when set to "Yes" instruct Fastly to automatically purge those caches when a cache invalidating event occurs. This appears to be a feature parity of the http_cache_hosts, but it's not explicitly clear.
Magento DevDocs (Cloud) - Configure Purge Options
I'm trying to understand if http_cache_hosts is even necessary when using Fastly and what is the correct way of configuring Magento Cloud with Fastly to automatically purge Fastly caches when Magento cache is flushed from Admin or CLI


texts: Magento2 - How to block keywords in username in registration?

texts:
I think my Magento 2 site has been targeted by a bot that promotes some kind of gambling website.
Luckily, my site is not yet live (I've placed "under construction" images on the header)
The bot that targets my site constantly registers fake users with seemingly stolen emails and each of their fake usernames contain the URL of a gambling website that the bot is promoting.
While I can still delete these fake users now, it will become a burden later on, and an embarassing display for legitimate users when my site finally goes live. So far, I just type "https" in the Users search list and delete everyone that has "https" in their username.
I'm wondering if there is a way for the Magento 2 user registration form to exclude / block certain keywords or patterns in usernames from registering in the site, because all the accounts that the bot created had the URL in them (https://www.example-gambling.com).
Can this be done? Is it possible for Magento 2 to prevent user registration of usernames that contains forbidden keywords?
Please let me know.
Thank you.


texts: Magento : Get Invoice PDF Link on Frontend Customer Dashboard

texts:
I want to get download invoice PDF link in customer dashboard account, when they are inside their order.

Therefore I need to edit default code in file: /app/design/frontend/theme/theme/template/sales/order/info/buttons.phtml

The default code is to download order PDF, but I want to change that to Invoice PDF.

Default code:

<a href="<?php echo $this->getPrintUrl($_order) ?>" class="link-print" onclick="this.target='_blank';">

How can I achieve that?


texts: add attribute column button is missing-Custom Grid

texts:
I created my custom grid in an extension but I don't know if it is something with permission or not that a button is not showing up in grid customization:

it should have add attribute column like this:

controller:

class Lenmar_Lightbulbs_Adminhtml_LightbulbsController extends Mage_Adminhtml_Controller_action
{
protected function _isAllowed()
    {
        return Mage::getSingleton('admin/session')->isAllowed('lightbulbs/lightbulbs');
    }

public function indexAction() {

    $this->loadLayout();
    $this->getLayout()->createBlock('lightbulbs/adminhtml_lightbulbs');
    $this->renderLayout();

}

public function gridAction()
    {

        $this->getResponse()->setBody(
        $this->getLayout()->createBlock('lightbulbs/adminhtml_lightbulbs_grid')->toHtml()
        );
    }

}

my cache is disabed and I reindexed it didn't help even I copy pasted my other extension which has this button and again rename everything it didn't work

I have the buttons comming from T:\app\code\community\BL\CustomGrid\Block\Widget\Grid\Columns\Config.php

here is the function:

public function getAddColumnButtonHtml()
{
    return parent::getButtonHtml($this->__('Add Attribute Column'), $this->getJsObjectName().'.addColumn();', 'scalable add');
}

also I can rename other ones and they will be changed in button text

also I found the condition! that when to show it:

   <?php if ($this->canDisplayColumnsConfig()): ?>
                                <?php if ($_gridModel->canHaveAttributeColumns()): ?>
                                    <span class="field-row">
                                        <?php echo $this->getAddColumnButtonHtml() ?>
                                    </span>
                                <?php endif ?>

I commented out this if condition and add attribute column showed up but I cannot do it it would affect other areas where add column shouldn't be there it seems I have some permission problem which I dont know how to figure out for this extension


texts: Magento 2 CSS/JS error in frontend and backend

texts:
It first started after i set https://(My_Domain_Name).com into Configuration > Web > Base URLs & Base URLs (Secure) > Base URL for Static View Files & Secure Base URL for Static View Files (I'm not even sure if this is the cause). I tried several solutions including: (Solutions from similar problems in stackexchange)

1) Go to pub/static folder and remove everything, except .htaccess file. Open up app/etc/di.xml find the path Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink and replace to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy. (It is already set to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy by default)

2) Using Putty to run below commands

    bin/magento setup:static-content:upgrade
    bin/magento setup:static-content:deploy
    bin/magento indexer:reindex

3) Using Putty to run below commands

    php -dmemory_limit=1G bin/magento setup:upgrade
    php -dmemory_limit=1G bin/magento setup:di:compile
    php -dmemory_limit=1G bin/magento setup:static-content:deploy -f
    php bin/magento cache:clean

4) The permission for /pub/ and /var/ folders is set to 0755 as per default.

I'm using Goddy Hosting > C-Panel > Magento 2.3.1 on Windows 10. First picture is from frontend and second picture is from backend.


texts:
I've written a function that after logging in, an group image will show to customer according to their groups. However, I found that after logging in, no images show to the customers if full page cache is turned on. The images can only show to the customers when the full page cache is disabled.

How can I deal with this issue?


texts: Magento2.1.0 Checkout page Not redirecting to success or error page when order is made by Authorize.net

texts: I have upgraded to Magento2.1.0 and when i make payment through Authorize.net the checkout page hangs with the Spinning Loader, it is not redirecting to Success or Error page. Did anyone Came across this issue.


texts:
I'm trying to set up Fedex on the site and it is not showing up during checkout. I have the Fedex option enabled in backend with applicable keys and passwords and such, obviously. I tried flipping on and off the residential delivery. Show method if N/A is true. It is set to debug and has an error message that should show... I made sure logging was enabled under developer tag... and I even did the following per advice found here:

  In file app/code/core/Mage/Usa/Model/Shipping/Fedex.php approx line
  409:  // find: $responseBody = curl_exec($ch);

  // add: Mage::log($responseBody);

I flushed cache and reindexed. Tried to go through checkout, and the only options showing are UPS. There is no error message, and nothing is logging in system.log or exception.log. Any ideas?


texts: How to use If condition in ui_component file sales_order_grid.xml

texts:
In Magento version (less than 2.0.5) sales_order_grid.xml is like

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <container name="listing_top">...</container>

but in Higher version (above 2.0.6) its like

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <listingToolbar name="listing_top">...</listingToolbar>

Now I am facing cross version issue in my custom module. I cannot even use ifconfig here bcoz of a ui_component XML file.

Any suggestions? It's urgent!


texts:
I would like to set all the products to show prices with tax included for
logged in users as well as guest users, but besides I tried all possible
combinations with tax settings, I didn't managed to set this up,
as I've encounter all sorts of weird behaviors. In addition,
it seems there is separate issue with "Catalog New Product List" widget
in that regard. Please read the explanation bellow.
Global settings:

Magento version 2.4.1
Shipping origin is set to Serbia.
Product price is set to 100 din.
Tax rate is set to 20%.

At "Tax settings" in admin panel, only change is:

Stores > Configuration > Sales > Tax > Default Tax Destination Calculation > Default Country > Serbia

What is happening:
"Catalog New Product List" widget shows the product price of 100 din.
for guest user which is fine, but when I logged in with the registered user,
at first, the price is still hanging at 100 din, but after I refresh the page
the price changes to 83.33 din. which is amount with deducted tax percentage,
which is wrong.
When I click the same product and go to product page, the price
displayed is 100 din. which is the correct one.
When I click "View and Edit Cart" and go to ../checkout/cart page,
the cart summary for logged in user is calculated as 100 din. + 20 din. (tax amount)
equal 120 din. in total and that's OK, but with the guest user, cart summary is
calculated as 100 din. + 0 for tax amount which is wrong. So, I ended up
with one product price for guest user, another totally wrong calculated price
at "Catalog New Product List" widget for logged in user, then one total amount
of 100 din. for guest user and different total amount of 120 din. for logged in user.
Basically, I can't set up the correct prices with tax amount for guest user, as
Magento keep deducting tax amount for guest user instead of adding it to price
value. I've managed to set up what I want, but just for logged in user.
For guest user I always end up with prices without tax amount (83.33 din)
instead of 120 din. which will be the right one. On top of that there is that widget
price odd behavior.
I can't figure it out what is wrong here and how to handle it, but it seems to me
that something is really not right...
Any help will be highly appreciated.
Question Update
Tax Zone and Rates

Stores > Configuration > Sales > Tax (settings #1)

Results for logged in user:

Results for guest user:

Stores > Configuration > Sales > Tax (settings #2)

Results for logged in user:

Results for guest user:


texts:
I have installed Elasticsearch and it's showing below message when I run this command
 curl -X GET 'http://localhost:9200'

{
  "name" : "a_KnAuZ",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "S-RwARt0SZGKMjYHqIuu5g",
  "version" : {
    "number" : "6.1.1",
    "build_hash" : "bd92e7f",
    "build_date" : "2017-12-17T20:23:25.338Z",
    "build_snapshot" : false,
    "lucene_version" : "7.1.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

Also, it's showing https://prnt.sc/rz8hio connection success message but when I am running index management command then it's showing below error message for catalogsearch_fulltext

{"error":{"root_cause":[{"type":"invalid_alias_name_exception","reason":"Invalid alias name [magento2_product_1], an index exists with thesame name as the alias","index_uuid":"MPr9O_RGTDKbDx4j4c8whg","index":"magento2_product_1"}],"type":"invalid_alias_name_exception","reason":"Invalid alias name [magento2_product_1], an index exists with the same name as the alias","index_uuid":"MPr9O_RGTDKbDx4j4c8whg","index":"magento2_product_1"},"status":400}

I am using Magento version 2.3.0 Version, how can we solve this issue?


texts:
I just installed Magento 2.2 on linux centos 6 with php 7.1.17 on Apache 2.4 but when I digit the url: http://localhost/Magento/admin I receive 404.

Can somebody help me ?


texts: getFinalPrice Configurable Product incorrect in the backend Magento 2

texts:
First, I will update in full detail about my environment.

Magento 2.3.2.
Created 1 Configurable Product.
Create Catalog Rule Price for that Configurable product. (eg: Discound 10%). -> Save, Apply.
bin/magento c: f && bin/magento indexer:reindex.
Configurable Product on Backend

Catalog Price Rule on Backend

Configurable Product on Frontend

Now, we have a Configurable Product.
When I try to use getFinalPrice funcion for simple products (I have put debug in file: Magento\Catalog\Controller\Adminhtml\Product\Edit.php line 52)

$_children = $product->getTypeInstance()->getUsedProducts($product);
$_children[0]->getFinalPrice ();

Return: $ 99 -> Incorrect

In Frontend: I put the debug in Magento\Catalog\view\frontend\templates\product\view\addtocart.phtml line 9

$_children =
$_product->getTypeInstance()->getUsedProducts($_product);
$_children[0]->getFinalPrice();

Return: $89 -> Correct.

Database:
catalog_product_index_price table

I mistaken?  Can anyone explain it to me? Thanks!


texts: PHP Fatal error: Allowed memory size of on indexer.php action

texts:
Before reply please read scenario on Magento 1.8.X

command

php  indexer.php --reindex all
Product Attributes index was rebuilt successfully
Product Prices index was rebuilt successfully
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 128 bytes) in  /home/zeleyane/public_html/naturjoya.com/lib/Varien/Object.php on line 117

Information PHP

php -i | grep memory
memory_limit => 512M => 512M
Collecting memory statistics => No
suhosin.memory_limit => 0 => 0

Try put on index.php

ini_set('memory_limit', '512M');

I think there're any file of Magento with limit 512M.

Try looking for 256 or 268435456 on files, I don't see a correct file.


texts:
In my case css and js files are not loading. It shows only html content both front end and backend part.

I applied many times clear the cache and reindexing.

Also run these commands:

1.sudo php -f bin/magento setup:static-content:deploy

2.php bin/magento setup:di:compile

3.php bin/magento indexer:reindex

4.sudo chmod -R 777 var/*

Delete Some folder under Pub/Static Directory:

MAGENTO_ROOT/pub/static/_requirejs

MAGENTO_ROOT/pub/static/adminhtml

MAGENTO_ROOT/pub/static/frontend


texts: Can you load a widget instance from a template?

texts:
I'd like to create 'widgets' in certain areas on my site, that can have certain parameters configurable by a non-technical Magento store admin. Widgets, by all descriptions sound like a nice way of doing this. All the adminhtml elements are in place to allow them to fill in the parameters without too much hassle.

What I can't work out though, is how to load and render a specific widget instance at a particular point in a template (as created via CMS > Widget > Add New Widget Instance and stored in widget_instance). I used the layout update feature to insert it into a block, which works reasonably well, but it's not quite flexible enough for what I wish to achieve.

Is it possible in a template file to load and render a widget instance?


texts: How to change delivery address on checkout - Magento 1

texts:
I'm customizing a magento store and I have the following problem.

Imagine that a customer of the store has 4 different delivery addresses, addresses already registered in the system.

Due to the customization I am making, I offer the customer who is buying in the store the option to choose which address he wants to deliver through a <select>, on a page outside the magento.

I have the deed code in the database, that is, the entity_id number for the address I want to change in the request that is in progress, according to the client's selection.

And that's exactly where my problem lies:

I need to tell the magento the address code I want to use at the checkout to finalize the order.

Magento by default, throws the client's default address in the ShippingAddress

Example of what I need: $checkout->setShippingAddress(entity_id), however, I can not make it work.

using the command below, I can get all the data from the checkout open:

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getData();

I need to change the delivery address to a new address, which is already registered in the system.

Can someone help me?

I do not know what to do anymore.

Thanks in advance for your help.


texts: Magento 2.3.0 Account Sidebar without success

texts:
I have tried to add a Custom link to my Magento Account page side-bar. but cannot add even I cannot remove as well.
I added

  Magento_Customer/layout/customer_account.xml

and copied the customer_account.xml from module_customer and paste

but nothing is happening.


texts:
How can i change the footer text color in .less file?
Which variable is this?


texts: Magento 2 Import Images form external URL Taking Infinite wait

texts:
My csv format is like this:
sku,base_image,small_image,thumbnail_image,additional_images
    7611009955,https://files.plytix.com/api/v1.1/file/public_files/pim/assets/35/ca/ca/5c/5ccaca3596022f046a0982b6/images/94/dd/21/5f/5f21dd9449fa400f57fa9e79/SUNNY_7611009955_Barnfilt_Babyblanket.jpg,https://files.plytix.com/api/v1.1/file/public_files/pim/assets/35/ca/ca/5c/5ccaca3596022f046a0982b6/images/94/dd/21/5f/5f21dd9449fa400f57fa9e79/SUNNY_7611009955_Barnfilt_Babyblanket.jpg,https://files.plytix.com/api/v1.1/file/public_files/pim/assets/35/ca/ca/5c/5ccaca3596022f046a0982b6/images/94/dd/21/5f/5f21dd9449fa400f57fa9e79/SUNNY_7611009955_Barnfilt_Babyblanket.jpg,

I am using Magento default Import,
If I Import A Bulk of Images for example 200 images Then Magento Import goes to Infinite wait and some times show Time out or access permission issues
Then for the rows unsuccessful I need to re-import them and It's then sometime successfully imported
Error:
 Imported resource (image) could not be downloaded from external resource due to timeout or access permissions

But I want to know What are possible solutions to import Product Images automatically from External source URL ???


texts: How to update custom field (Delivery_date) on sales_order table on plugins?

texts:
I have already created custom field delivery_date on sales_order by UpgradeDataInterface. And I have implemented the plugins aroundSave() on module-sale by modify checkout process. I would like update the delivery date in particular order.Is that implement by using AbstractCollection ?

Any hints?


texts: Add customer email to order via observer make export csv error

texts:
Here is my observer to add the code to show email in order grid

public function coreBlockAbstractToHtmlBefore(Varien_Event_Observer $observer)
{
    /** @var $block Mage_Core_Block_Abstract */
    $block = $observer->getEvent()->getBlock();
    if ($block->getId() == 'sales_order_grid') {

        $block->addColumnAfter(
            'email',
            array(
                'header'   => Mage::helper('sales')->__('Email'),
                'align'    => 'left',
                'index'    => 'email',
                'filter_index'    => 'email',
            ),
            'shipping_name'
        );

        // Set the new columns order.. otherwise our column would be the last one
        $block->sortColumnsByOrder();
    }
}

public function salesOrderGridCollectionLoadBefore(Varien_Event_Observer $observer)
{
    $collection = $observer->getOrderGridCollection();
    $select = $collection->getSelect();

    $select->joinLeft(array('oa' => 'customer_entity'),'oa.entity_id = main_table.customer_id', array('email'));

}

but it makes the CSV export function error, here is the error

You cannot define a correlation name 'oa' more than once

#0 D:\xampp\htdocs\test\lib\Varien\Db\Select.php(281): Zend_Db_Select->_join('left join', Array, 'oa.entity_id = ...', Array, NULL)
#1 D:\xampp\htdocs\test\lib\Zend\Db\Select.php(357): Varien_Db_Select->_join('left join', Array, 'oa.entity_id = ...', Array, NULL)
#2 D:\xampp\htdocs\test\app\code\local\Test\Admin\Model\Observer.php(67): Zend_Db_Select->joinLeft(Array, 'oa.entity_id = ...', Array)
#3 D:\xampp\htdocs\test\app\code\core\Mage\Core\Model\App.php(1338): Test_Admin_Model_Observer->salesOrderGridCollectionLoadBefore(Object(Varien_Event_Observer))
#4 D:\xampp\htdocs\test\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Test_Admin_Model_Observer), 'salesOrderGridC...', Object(Varien_Event_Observer))
#5 D:\xampp\htdocs\test\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('sales_order_gri...', Array)
#6 D:\xampp\htdocs\test\app\code\core\Mage\Core\Model\Resource\Db\Collection\Abstract.php(590): Mage::dispatchEvent('sales_order_gri...', Array)
#7 D:\xampp\htdocs\test\lib\Varien\Data\Collection\Db.php(565): Mage_Core_Model_Resource_Db_Collection_Abstract->_beforeLoad()
#8 D:\xampp\htdocs\test\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php(951): Varien_Data_Collection_Db->load()
#9 D:\xampp\htdocs\test\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php(1008): Mage_Adminhtml_Block_Widget_Grid->_exportIterateCollection('_exportCsvItem', Array)
#10 D:\xampp\htdocs\test\app\code\core\Mage\Adminhtml\controllers\Sales\OrderController.php(703): Mage_Adminhtml_Block_Widget_Grid->getCsvFile()
#11 D:\xampp\htdocs\test\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Adminhtml_Sales_OrderController->exportCsvAction()
#12 D:\xampp\htdocs\test\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('exportCsv')
#13 D:\xampp\htdocs\test\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 D:\xampp\htdocs\test\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 D:\xampp\htdocs\test\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#16 D:\xampp\htdocs\test\index.php(94): Mage::run('test_b2c_asia', 'website')
#17 {main}


texts:
My Magento 2 webshop don't send any email. My cronjob is running and
The settings are the same as in this ticket: order confirmation email not send in magento 2

Does anyone have any idea what might be wrong?

I'm using Magento 2.1.5


texts: Extension is showing effect/error after completly removing it magento

texts:
I have installed Simtech Searchanise for searching function in staging and live site. After few week we came to know in both site , extension using same API key. So when i do any changes in live it reflect on staging and vice versa. So i completely(file/db_table) removed extension from staging site. After removing it showing error Fatal error: Class 'Mage_Searchanise_Helper_ApiSe' not found in app/Mage.php on line 547.

To fix this i have removed var/cache , var/session and log tables from DB.
But it still showing error.

Anyone know why this issue is showing and how to fix it.


texts: Inventory and Ordered items in magento 1.9.3.1 went blank

texts:
I am using Magento 1.9.3.1, today i was trouble shooting the issue of a blank screen issue on Blog Extension ( Smartwave Blog provided with theme - aw blog). I have used the Advanced Tab in Magento Admin -> Configuration to disable some plugins i installed in the system to check if some plugins conflicts with Blog extension resulting in to white screen in blog manager options etc.

After that i have enabled those extensions i previously disabled, after this when i goto the Sales -> Orders and choose the latest order and my ordered items is showing blank.Also my Products page Inventory is also showing blank


texts: Magento 2.3.2 Google reCAPTCHA v3 very slow

texts:
I am using mageplaza google recaptcha in login, create user,forgot pass an so, But while doing any operation the recaptcha load very slow, and user submits data before captcha reload. Hence user often get recaptcha invalid issue.

How may i load recptcha with page load.

I used

$(".action.captcha-reload").trigger("click");
jQuery( "captcha-button-selector" ).trigger( "click" );

I used this two solutions.But no help.


texts: Braintree form error: ncaught TypeError: FormNapper requires an HTMLFormElement element or the id string of one - Magento 2.1

texts:
We have Magento 2.1 installed and we are completing the integration with Braintree, everything seems to be working fine, however, on latest version of Chrome shows this error:

braintree-2.17.6.min.js:4 Uncaught TypeError: FormNapper requires an HTMLFormElement element or the id string of one.

I have contacted Braintree but they said their hosted forms doesn't have this issue and that is something in Magento.

Anyone had this issue?


texts:
I am running magento 2.1. and recently I realized that if I delete a product from the admin, I can't access old orders anymore...

Does anybody have an idea what should I do?


texts:
I found a code to render a block at overview.phtml like code below.

overview.phtml:

<?php echo $block->getRowItemHtml($_item); ?>

And here's the Overview.php for it.

Overview.php:

/**
     * Return row-level item html
     *
     * @param \Magento\Framework\DataObject $item
     * @return string
     */
    public function getRowItemHtml(\Magento\Framework\DataObject $item)
    {
        $type = $this->_getItemType($item);
        $renderer = $this->_getRowItemRenderer($type)->setItem($item);
        $this->_prepareItem($renderer);
        return $renderer->toHtml();
    }

    /**
     * Retrieve renderer block for row-level item output
     *
     * @param string $type
     * @return \Magento\Framework\View\Element\AbstractBlock
     */
    protected function _getRowItemRenderer($type)
    {
        $renderer = $this->getItemRenderer($type);
        if ($renderer !== $this->getItemRenderer(self::DEFAULT_TYPE)) {
            $renderer->setTemplate($this->getRowRendererTemplate());
        }
        return $renderer;
    }

And the code from Overview.php is pass to item.phtml for overview page. So my question is, i got data like 'id' that i want to pass to item.phtml from overview.phtml, how can i pass it from the Overview.php?


texts: get Emails from specfied customer group in magento 2

texts:
I need to sent a newsletter for specific customer group, so I need to collect emails from a specific customer group.

I searched about tables:

customer group:

+-------------------+---------------------+--------------+
| customer_group_id | customer_group_code | tax_class_id |
+-------------------+---------------------+--------------+

Newsletter_subscriber:

+---------------+----------+------------------+-------------+----------------- ---+-------------------+----------------------------------+
| subscriber_id | store_id | change_status_at | customer_id | subscriber_email   | subscriber_status | subscriber_confirm_code          |
+---------------+----------+------------------+-------------+--------------------+-------------------+----------------------------------+

Customer_entity:

 | entity_id | website_id | email| group_id | increment_id| store_id | created_at| updated_at | is_active | disable_auto_group_change | created_in  | prefix | firstname | middlename | lastname | suffix | dob | password_hash  | rp_token | rp_token_created_at | default_billing | default_shipping | taxvat | confirmation | gender |

The Customer Entity table has all the information Customer Group id and Cutomer EMail

so how can I get emails from specified customer group using customer_entity table? Or any other easy way to collect emails form a specific customer group?


texts: why i am getting error while placing the order in magento

texts:
I am Getting the Error While Placing The Order.

what i have to do for this?how can i place order sucessfully?


texts: How to get client(user) browser timezone in magento 2?

texts: How to find client(user) browser timezone in magento 2?


texts: I am looking for best practice/ good ways to help to identify slow points on Magento loads on a local machine. I think what I am mainly looking for is identifying items that are causing slow time to first byte.


texts:
I used Magento 2.2.4 Version.

Magento2 How to Get Newsletter Subscribed Collection into phtml file


texts: 2.2 Faster way to regenerate css in developer mode

texts:
In developer mode, static files are mostly symlinked so making changes is immediately visible in frontend. However, when making changes to CSS this is not the case.

The minimal files I have to delete are var/view_preprocessed/.../css and pub/static/frontend/.../css.

However, it is still a bit slow and inconvenient. Is there a way to activate some sort of file watcher that will automatically regenerate the things it needs to?
(Something like compass in 1.9.X RWD theme.)


texts:
I am using default Magento checkout and would like to change the checkout final step from TAX to VAT.

Subtotal                                : €9.38
Shipping & Handling (Flat Rate - Fixed) : €6.50
Tax                                     : €2.16
Grand Total                             : €18.04


texts: Magento 2 - Page Builder Media Gallery not loading - "You entered an invalid Secret Key. Please refresh the page."

texts:
If I add a media node to the page builder and try to select an image from the gallery, then nothing happens. Normally the gallery should load.

I get this in the network console
https://company.de/backendlogin/cms/wysiwyg_images/index/key/095a7a5f8e56bbf90e8337f93695509fa2e57b0863e15518e17b60f110f3779b/target_element_id/BCP3YMC/store/1/type/image/?isAjax=true&current_tree_path=d3lzaXd5Zw--

{"error":true,"message":"You entered an invalid Secret Key. Please refresh the page."}

I flushed the cache and deleted all browser cookies, but it does not help.
The project is in production mode.


texts: How to pass an Extra Flag/Parameter to checkout_cart_product_add_after Observer

texts:
We are working on a custom module which can add product to the cart. So currently there are two methods to update cart, ie from Magento's normal add to cart and from our custom Module. While adding product from the custom module we want to set a custom price for the product. I was able to do this using the following code (checkout_cart_product_add_after).

public function modifyPrice(Varien_Event_Observer $observer) {
    $item = $observer->getQuoteItem();
    // Ensure we have the parent item, if it has one
    $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
    // Load the custom price
    $price = 2;
    // Set the custom price
    $item->setCustomPrice($price);
    $item->setOriginalCustomPrice($price);
    // Enable super mode on the product.
    $item->getProduct()->setIsSuperMode(true);
}

As per my understanding the above code will be executed when ever a product added to the cart. ie from custom module or from Magento's add  to cart. But we need to execute the code only when it is added from custom module. To do this We need to pass a flag/parameter to Observer function. How can we do this? Or are there any alternative methods to achieve what we are trying to do?.


texts: How to get customer gender value with text in magento2?

texts:
I want get customer gender value like Male or Female in magento2?

and also want to get gender attribute value like 1,2,3

text: Male, Female and Not Specified


texts:
Got a strange issue in Magento 2 on a Configurable Product:

All size 4,5 and 6’s should be £289.00 and have no VAT attached
All size 7’s should be 249.167 and have VAT attached

So I’ve se the config as the 4/5/6 price with not VAT and gone into the size 7’s simples and changed the price and clicked None VAT.

However on the front end the price is going funny, it is showing it as a special price ‘was £289.00 now £249.17’ when it should just be showing £289.00 then on the dropdown when you pick a 7 size it should change to £299.00.

I have checked in the back-end and there is no product using special price. Could this be a Magento 2 bug?


texts: 1.9.3.8 Multistore loading wrong website code

texts:
I have a 1.9.3.8 multistore set up at a temporary domain, with several websites set up within the multistore.  These websites broken up by brick and mortar location, for what it's worth.

The homepage of the default website is a typical homepage with a banner and whatnot.  But the homepage for any location is the root category with layered navigation (using amasty's plugin for this.  We are also using cart2quote, but I doubt that's causing the issue.  In any case, I have disabled these plugins temporarily, and the problem I'm having remains.)

The problem is that when I load one of the locations, the homepage is the original default home page!  I did some digging into that:  The $mageRunCode and $mageRunType are both being set properly in the index.php file.  However, when I check Mage::app()->getWebsite()->getName(), the value is the default website!  This means that all my config values are pointing to the wrong scope!  Why would this happen?!  I'm flabbergasted.  Anyone ever experienced this?  Am I missing something?


texts: Magento 2 braintree payment options invisible on shopping cart

texts: Braintree payment options[paypal and apple pay] doesn't show in minicart. My site is upgraded from Magento 2.1.7 to 2.2.4. The problem is in the database. But cant identifies the fix. Can anyone give a solution?


texts: how to create a grid without using ui component in magento 2

texts:
I need to create grid(inside the tab) without using ui component. Please provide me a solution.
this is a controller I have created to load grid but it is failed to load

public function execute()
    {

        $resultRaw = $this->resultRawFactory->create();
        return $resultRaw->setContents(
                        $this->layoutFactory->create()->createBlock(
                                'X\Y\Block\Adminhtml\FormContainer\Edit\Tab\GridContainer\Grid', 'grid.view.grid'
                        )->toHtml()
        );
    }


texts:
I am new in magento2. I am trying to set pagination and limit it accordingly in my custom FAQ module.

I am trying to use default pagination of magento2. I am getting the pagination in frontend but there is no limit to the data.

protected function _prepareLayout()
{
    $collection1 = $this->_modelFactory->getCollection();

    parent::_prepareLayout();
    if ($collection1) {
        $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager','my.custom.pager');
        $pager->setLimit(1)->setCollection($collection1);
        $pager->setAvailableLimit([1=>1,2=>2,50=>50,100=>100]);
        $this->setChild('pager', $pager);// set pager block in layout

    }
    return $this;
}

public function getPagerHtml()
{
    return $this->getChildHtml('pager');
}

It should show me only 1 FAQ but it shows 3.


texts:
What should be proper type for multiselect attribute? Of course it is connected with adding them programatically.

There is no exceptions while adding text type programatically, but you can't use it later in layered navigation.

Is it correct to use varchar type?


texts: How to fix the "payment transaction failure" issue in onepage?

texts:
After I installed the following patches: SUPEE-6285-1.9.1v2, SUPEE-6482-1.9.1.1, SUPEE-6788-1.9.1.1, SUPEE-7405-1.9.1.1, my website's onepage checkout payment is not working.

Entered debit Card/Credit Card details in onepage checkout and then clicked "Place Order" but no error and the page stays as it is... received an email titled "payment transaction failure".

I got the following errors in system.log file.

2016-03-07T19:31:25+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:25+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:25+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:25+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:29+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:29+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:29+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:29+00:00 DEBUG (7): GBP - GBP
2016-03-07T19:31:32+00:00 ERR (3): Notice: Undefined variable: status  in app/code/local/Paymentsense/Pay/Model/Pay.php on line 720
2016-03-07T19:31:32+00:00 ERR (3): Notice: Undefined index: error  in app/code/local/Paymentsense/Pay/Model/Pay.php on line 720
2016-03-07T19:31:32+00:00 ERR (3): Notice: Undefined variable: CrossReference  in app/code/local/Paymentsense/Pay/Model/Pay.php on line 720
2016-03-07T19:31:32+00:00 ERR (3): Notice: Undefined variable: message  in app/code/local/Paymentsense/Pay/Model/Pay.php on line 720

Plz find the other error logs here: pay.log, exception.log.

This is the line 720 in app/code/local/Paymentsense/Pay/Model/Pay.php

return array('status'=>$status,'transaction_id' => time() , 'fraud' => rand(0,1),'message'=>$json['error'],'data'=>$json,'CrossReference'=>$CrossReference,'paymenstatus'=>$message);

Here is the file Pay.php

any suggestions would be appreciated.

Thanks in advance...


texts: Newsletter subscribe not working on homepage [custom theme]

texts:
I copy this template from

  vendor/magento/module-newsletter/view/frontend/templates/subscribe.phtml

There's no js console error and any other error on server log. Subscribe is not working (email id not saved on admin panel). how to tackle it.it doesn't show any message alert.

my newsletter template  in

  mynamespace/mytheme/Magento_Newsletter/templates/
  newsletter-footer.phtml

Sign Up For Newsletter

Be the First to Know. Sign up to newsletter today

                <form class="form subscribe"
                      novalidate
                      action="<?php echo $block->getFormActionUrl() ?>"
                      method="post"
                      data-mage-init='{"validation": {"errorClass": "mage-error"}}'
                      id="newsletter-validate-detail">

                            <input name="email" placeholder="<?php echo __('Enter you email address here...'); ?>" type="email" id="newsletter"
                                   data-validate="{required:true, 'validate-email':true}"/>
                            <button class="action subscribe primary" type="submit">

                            </button>

                </form>

cms_index_index.xml

<referenceContainer name="main">
        <referenceContainer name="container.global" htmlClass="someotherclass"  >
            <block class="Magento\Framework\View\Element\Template" name="newsletter" template="Magento_Newsletter::newsletter-footer.phtml"/>

        </referenceContainer>
    </referenceContainer>

showing on homepage and validate email also


texts: Is it possible to have a global rating in Magento 2?

texts:
Is it possible to have a global rating in Magento 2 instead of have stars for Price, Value, Quality individually?

Maybe creating a new "Global" rating called just "Rating"?

That will be the correct way to accomplish this?

Thanks,


texts: Magento 2 get custom attribute values from products collection

texts:
I am trying to get the custom attribute vales from products collection as like below code but i didn't get attribute values.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
             $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection')
                                                ->addAttributeToSelect('cb_city');
             $collection = $productCollection->create()
                                             ->addAttributeToSelect('cb_city')
                                             ->load();
             print_r($collection);


texts: Magento 2.3 Multi website Store /rest/australia/V1/carts/mine/payment-information 404 error

texts:
I am using the Multi website store, main website USA, second website Australia. Here my issue in Second Website store (Australia) If i try to pay i am getting 404 error, how to solve this error?

How to solve the rest API error?


texts: Where exactly the store id is set when you create a new customer from adminpanel in M1?

texts:
I have a situation when I create a new customer from adminpanel. The store ID is saved as 0 in db. I have a website with 2 stores. If i create a customer from the frontend its working, I got valid store id values in the customer_entity table.

I did a var_dump($customer->getData()); exit(); in the core  in CustomerController class in saveAction method before $customer->save(); and there is no any store_id array key in the results. Thats why I got 0 values in the db.  What should I do to get a real store id value in the db when I create a new customer from adminpanel ?


texts: Magento2, after deploy in another language the generated js-translation.json is empty

texts: All translations are fine but JS templates are not translated. I realized that /pub/static/frontend/Vendor/theme/nl_NL/js-translation.json is empty!


texts: Magento 2 root composer.json file content?

texts:
What should the content be in the Magento 2 root folder composer.json file AFTER Magento is installed? When I add a new module, should I add this to the existing list (require, etc)?

Should all the installed modules be listed here always?


texts: Can I get whole categories (Item Types) as search results from my website's search bar?

texts: Many visitors of my website search for categories instead of certain items on the search bar. However the store is not configured to show this type of results. What would be the way to define a number of keywords that when searched, will lead to a result page with all the products of a certain category? Thanks in advance!


texts: Displaying Root Category in Magento Main Nav

texts:
I was wondering if it was possible to have a custom block or a menu item that when hovered over displays a list of all the categories in the shop? I tried to do this with the Root Category but I can’t get the root category to show up in the main nav.

thanks


texts:
I currently have a website where users can design their products, then check out.  Checking out redirects to the main Magento website, where the product is added to their cart (the custom product exists in our Catalog with custom options).  However, I'm not able to update the cart after redirecting from the external site.  It redirects to the cart, but the item is not listed in the cart.

As I understand it, I need to pass information to Magento from the external site, where Magento can then take this information and add the product to the cart.  I'm not sure how or where to send this information, though.

I have tried adding through URL by redirecting an HTTP form, as in:

$cart_url = "site.com/checkout/cart/add/product=" . $product_id . "&qty=1";
<form method="post" name="cart_form" action="<?php echo $cart_url; ?>">
    <input> product id</input>
    <input> custom option 1</input>
   ....
</form>

However this doesn't seem to update the cart.  Looking around on the net has shown that this no longer works in Magento 1.8+, and I'll need to create either an Observer or other Controller.

How do I create an observer in Magento that I can pass the form data from an external site to in order to add to the cart?  I'm fairly new to Magento, so I'm not entirely sure how to link the bits together.


texts: Auto-increment when generate SKU with Observer

texts:
I have created an observer for auto-generating SKU when admin add product.

This is my Custom_Module/Model/Observer.php

class Bookandgo_AutoSku_Model_Observer
{
    public function autoGenerateSku($observer)
    {
        $product = $observer->getEvent()->getProduct();
        $sku = "TA1000";
        $product->setSku($sku);
    }
}

It successfully generate SKU, now how i make this SKU auto increment? Also i want to make SKU based on selected attribute set. For example if i select Default attribute, it will be DF1000, but if i select Tour and Adventure attribute, it will be TA1000.


texts: Magento sort collection with multiple attributes

texts:
I want to sort Magento product collection  with multiple attributes at catalog product list page. I am using this code

$this->_collection->setOrder('price', 'desc');
$this->_collection->setOrder('price_plus_shipping', 'desc');

I also tried this code as well

$this->_collection->setOrder(array('price', 'price_plus_shipping'),Varien_Data_Collection::SORT_ORDER_DESC);

When i sort these both combine its not giving me accurate results but if i use both separately like when i am using only

  price_plus_shipping

its working fine also as

  price

its also working file
they are showing me accurate results. But i want to use them combine.
in Price i have product prices in price_plus_shipping i have alphabets like

  a,b,c etc


texts: Best way to deal with a message queue in Magento 1.x Custom Module

texts:
I have a situation where I need to process a request that will create a queue of messages to be sent, and I need this messages to be processed and send continuously.

The current solution I have in my mind is to create a Magento cronjob that will check every n minutes if my script.php is running.

If it's running, all good. If not, it will start running it, and this is script will have a infinite loop that process all messages on the queue.

I don't know why, but something in this solution sound sketchy to me, so I'd like to know if there's a better solution for that. I don't want to use RabbitMQ or other linux-like software.

EDIT: for a better context, I'm trying to guarantee messages are processed and sent in a personal chatbot project that integrate Magento to Facebook Messenger and Telegram (https://github.com/blopa/Magento-Chatbot/)


texts: Updating prices for products using a .csv programmatically

texts:
My question more broad at the beginning but I will go more into detail later.
I have around 3000 products where I have the Skus and prices in a .csv file. Now the prices changed recently and I would like to upload/update these prices of the products.
Is there a quick way to do this via a script using the SOAP API?

Or is there an easier way around this?

UPDATE
I have used this function http://www.blog.magepsycho.com/updating-product-prices-in-magento-in-easier-faster-way/ but now the value and price mismatch. Are there any better options going through a csv and then match the prices for each sku to a price.


texts: How to change the ISO currency code in the Magento core?

texts:
This is not a duplicate question, I have a very rare problem.

More than a year ago, the ISO currency code "Belarusian Ruble" changed. Previously it was "BYR", and now "BYN". Since then, there have been many updates to Magento, but the list of currencies and their codes has not changed.

Using the settings in the admin panel (System > Manage Currency > Symbols ), I can change the display of the currency ISO code at frontend, but inside in system it still wrong.

So I can not use payment solutions in my country, auto-renewal of exchange rates and many other things.

Please explain how to fix the wrong currency code in the Magento core?

Magento version CE 1.9.3.6


texts: Magento 2: Create HTTP Paths to Frontend Assets via PHP Code

texts:
In Magento 2, is it possible to generate an HTTP path to a module's front-end asset files (CSS, Javascript) using PHP?

i.e. I know it's possible to add code like the following to a layout handle XML file

<css src="foo/baz/bar.css"/>
<link src="Magento_Sales::js/bootstrap/order-create-index.js"/>

What I'm curious about is do these layout directives have direct PHP equivalents? If so, what are they.  If not, is there a reasonable technique for stabling reproducing their behavior via PHP?


texts: Magento 2. What is the purpose of the catalog_eav_attribute table?

texts:
What is the purpose of the catalog_eav_attribute table?

Is it in any way related to categories and category attributes? If so, how?


texts:
Is it possible to not enter any value in a Yes/No attribute? My default is set to No, so every time I make a product, it is No and in the attribute edit menu, I can't change No to empty, only to Yes.

I need to do this because I'm synchronizing data automatically. I have two different sources for similar products and one sends me whether it has a certain feature, but the other just doesn't know whether the device has it or not. And I want to avoid setting the attribute to No even though the device has the feature, only my data source didn't tell me.

Any help appreciated


texts:
Does anyone know what this Magento function does : function  __('text') ?

I guess it echoes text, but it is not a php native function. Using Sublime text, is there a way to find in which class it defined ? I use Magento CE 1.8.


texts: I have an observer running on sales_order_invoice_save_after. I am able to retrieve the invoice from this observer however I am having some issues retrieving the order from the invoice. How can I retrieve an order from an invoice?


texts:
I am trying in product/detail page to have all images in the gallery there with no slide to hide some of them, but it seems no possible in no option for view.xml.

I can create from scratch gallery.phtml of course but I would like to use what already exist in terms of zoom and responsiveness, keeping the gallery with dots on for the mobile


texts: Have anyone found Product Tags feature Extension for Magento2?

texts:
I want Product tag feature extension in magento2 like magento1.

Have anyone implemented before?

I know it's not exist in core magento2.


texts: Magento 2: Multiple checkboxes in system.xml

texts:
I want to create a system config where you could tick the necessary weekdays, but this way:

<field id="days" translate="label" type="checkbox" sortOrder="11" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Days in the week</label>
                </field>

I only get one checkbox. Is there a way to have multiple checkboxes one below the other?


texts: Cannot save product with required custom attribute (unique value)

texts:
Magento 2.x throws an error message on saving a product that has a unique, required attribute value when that value has been used before by a product that has been deleted.
In other words: the attribute's unique value of a product, remains stored in the database after that product has been deleted.

EXAMPLE
Say we create a product in M2 admin.

We have a REQUIRED Custom Attribute "SKU Number" with UNIQUE value "1".
Save the product and than delete the product and flush cache.
Create new product in M2 admin.
Apply required Custom Attribute "SKU Number". Also with value "1" (from deleted product).

It appears that we are now unable to save this newly created product because it uses the unique value of a deleted product. Error message: "Required attribute value must be unique".

IMHO the attribute value in this case is unique because the product that has been using this unique value has been deleted.

Does anybody have an idea about how can I delete the unique value of a custom attribute when it is no longer in use by a product?


texts: Add popup on clicking custom button in product edit page in admin in magento 2.3

texts:
I have added a custom button in product edit page using product_form.xml like below :

app/code/Company/Module/view/adminhtml/ui_component/product_form.xml

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

<form 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="buttons" xsi:type="array">
            <item name="set-to-sold" xsi:type="string">Company\Module\Block\Adminhtml\Product\Edit\Button\SoldButton</item>
        </item>
    </argument>
</form>

app/code/Company/Module/Block/Adminhtml/Product/Edit/Button/SoldButton.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Brainvire\ProductType\Block\Adminhtml\Product\Edit\Button;

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

class SoldButton extends Generic
{

    /**
     * @return array
     */
    public function getButtonData()
    {
    return [
        'label' => __('Diamond is SOLD'),
        'disabled' => true,
        'on_click' => sprintf("location.href = '%s';", $this->getUrl('producttype/product/sold')),
        'class' => 'save primary',
        'sort_order' => 5,
    ];

    }
}

the button is added like below :

This is working perfectly. A button is added, and a confirm box is also displayed on button click. But now i want to add a popup and call custom phtml in that popup on button click.

Any ideas how to proceed. Thanks in advance.


texts: One product, multiple options, one global stock entry

texts:
My product is tickets which have different age ranges:

Infant 0-2

Child 2-5

Child 5-9

Child 9+

I will have 100 tickets in total but I don’t know in advance how many of each age range I would need so want to be able to set one global quantity of 100.

Is this possible?

Edit:

I have 100 tickets total. The reason I need to have the various age ranges is because children in each range are given a present so I need to know how many of each range are sold. I cannot pre-configure each ticket type with a quantity as its impossible to know how many of each would be required


texts: Dont allow advanced search to click "search" without enter any search term

texts:
by default magento advanced search allows to click the search button without even enter some search words. In my magento this leads to a few seconds of waiting until you finally get a "no products found" page.

I want to do some validation or similar so that it will not be possible to click the search button without entering at least one field.

Can somebody help please?

edit: just a "required" field or the other magento field validations will not help as I still want to allow users to fill out any field (f.e. 1 out of 3) but if I apply the magento validations like "validate-one-required-by-name" all fields are set as "required" because I can only use it in (form.phtml)

                    <input type="text" name="<?php echo $_code ?>" id="<?php echo $_code ?>" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute)) ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>"  class="input-text2 <?php echo $this->getAttributeValidationClass($_attribute) ?> validate-one-required-by-name" maxlength="<?php echo $maxQueryLength;?>" />

and all of the text fields used in advanced search are affected by this line.

maybe the "search" button can be changed so that it will only be clickable if at least one field is filled? (like it is at the standard mini-searchbar in magento). this is the code of the button:

    <button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><?php echo $this->__('Search') ?></button>

//


texts: Can magento do custom quotes with link to cart?

texts:
I have a problem with our store and selling that i keep coming across.
What do others do??

We sell online a lot but often get telephone inquiries from customers who build a package from many of our products combined.

we want to be able to email our customers a link that takes them straight to our shopping cart loaded with the products we have talked about / agreed upon. and then possibly apply custom pricing if we have offered a deal over the phone.

We have looked around and cant find an extension that would do this.

What do other online retailers do?
or is there a way to do this?

Thanks
Dano
UK


texts:
We are having some problems with FPC and AW_BLOG ... the first blog page is being cached and after then clicking other links (in the blog) they always result in the samen page

Open this link
http://shirtsofcotton.com/blog/sinterklaas-cadeau-overhemd/

and then click a link in the blog section on rights hand; they dont seem to go to another page .... but again show the first open page

We have these set as cacheable actiosn: blog_index_list, blog_post_view

Is there something else we need to do?


texts: Magento 2.3.5 Tracking Email Missing Tracking Number And Order Items

texts:
When sending the tracking email in Magento 2 we are running into some major issues.

Using the default Luma shipment email {{trans "%name," name=$billing.name}} This part always comes out as a single comma as if its failed to retrieve the name.

and {{layout handle="sales_email_order_shipment_track" shipment=$shipment order=$order}} this section is always missing from the email.

I added a little bit of logging into the track.phtml which is responsible for it and from what I can see <?php $_shipment = $block->getShipment() ?> that bit of code always simply returns null, along with ```getOrder() ?>''' .

Since they come back as null the if check never works and they the tracking is never added, what I am wondering is why these would ever be null?

Every other email seems to work fine but for some reason shipping always just finds these 2 fields as null.


texts:
Not sure if this qualify as a question at all. But as i am unaware of this hence asking.
If you go to http://www.silksoftware.com/magento-module-creator/magento2x.php and create a magento2 module with a Single Table Model you will get a zip folder. And after extracting it you will find all the relevant files.
Now if you go inside model folder you will find this.

Where New is the model name.
Here is how its created
If i open status.php i can see few lines of code.
<?php

namespace SilkSoftware1\ModuleName1\Model;

class Status
{
    /**#@+
     * Status values
     */
    const STATUS_ENABLED = 1;

    const STATUS_DISABLED = 2;

    /**
     * Retrieve option array
     *
     * @return string[]
     */
    public static function getOptionArray()
    {
        return [self::STATUS_ENABLED => __('Enabled'), self::STATUS_DISABLED => __('Disabled')];
    }

    /**
     * Retrieve option array with empty value
     *
     * @return string[]
     */
    public function getAllOptions()
    {
        $result = [];

        foreach (self::getOptionArray() as $index => $value) {
            $result[] = ['value' => $index, 'label' => $value];
        }

        return $result;
    }

    /**
     * Retrieve option text by option value
     *
     * @param string $optionId
     * @return string
     */
    public function getOptionText($optionId)
    {
        $options = self::getOptionArray();

        return isset($options[$optionId]) ? $options[$optionId] : null;
    }
}

Have anyone used slik for creating modules and any idea why this status.php exists.
Thanks


texts: Load configurable product with preselected options of any one of simple product

texts:
How to load configurable product with preselected options of any one of simple product?

For example

I have a configurable product http://host/product/1.

It have 2 associated simple products http://host/product/2 and http://host/product/3.

Whenever configurable product page load, I need to display the preselected options of http://host/product/2.

Can anyone share hints to achieve this?


texts: Convert Magento1 Text Attribute to magento2 PriceType Attribute

texts:
Looking for solution for converting some attributes to another type.

Problem:

We sell boxes with dimensions Length, width, height on Magento 1 webshop.
On the frontend in Layered Navigation we used size Sliders for this attributes.

For this atrributes we used the type with Catalog Input Type for Store Owner -->
"Text"

All fields where fidlled with millimeters (Only the numeric values, not mm).

Now we want to change this 3 attributes from 'text' to 'Price', since all Layered navigation extensions require the input type "Price" field to get this attributes working with sliders.

Who can help?
Any idea how much work this takes?
Or maybe yo have a better solution?

I found an old script which should do the trick but this one needs a rewrite.


texts: Magento 2 how we can apply those condition in the frontend?

texts:
I was add a condition action in custom module admin form in magento 2

I used this blog to create a condition action: https://www.mageworx.com/blog/2016/09/magento-2-module-with-conditions-model-fieldset/

Database:

how we can apply those saved condition in the frontend?


texts:
Issue

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'TT::calculator.phtml' in module: 'Magento_Catalog' block's name: 'calculator.tab'

Layout Location:

app/code/TT/Calculator/view/frontend/layout/catalog_product_view.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="product.info.details">
        <block class="Magento\Catalog\Block\Product\View" name="calculator.tab" template="TT::calculator.phtml" group="detailed_info">
            <arguments>
                <argument translate="true" name="title" xsi:type="string">Calculator</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>
</page>

Template Location:

app/code/TT/Calculator/view/frontend/templates/calculator.phtml

Questions

I've seen some solutions where the *.phtml file is saved in app/design but I'm trying to get this to work in app/code. What have I missed?
Also, does this "extend" catalog_product_view.xml or replace it?


texts: Magento 2. Observer event on every page loaded after?

texts:
I'm calling my custom .phtml template from observer. The template is being called successfully and the HTML is displayed correct.

However this .phtml is executed before site's css and javascripts is loaded.

In the screenshot (source code from browser) it shows my custom template is loaded before everything and displayed on the top of the page. This makes jquery inside the template not working.

Which event should I use so that my custom .phtml is loaded after all site css and javascripts?

I have tried the following events with no luck,

controller_action_postdispatch_cms_index_index
store_load_after
controller_action_postdispatch


texts: Event for creating a new product attribute

texts:
Is there a Magento event for when a new product attribute is created?

I have tried these with no luck:

catalog_product_save_attribute_before
save_attribute_before


texts: Reorder Not working from admin Magento 2

texts:
I am going to generate reorder from admin. When i click on submit Order button the page will be stuck at "loading..." and never finish.
Can you guys let me know what is the issue actually?

Payment Method: Authorize.net credit card.
Shipping Method: USA (FEDEX GROUND).

Please see this screenshot.

Please help!!!


texts: Magento2 getting error while programmatically passing Customizable options

texts:
Magento2.3.3 I am using below code to programmatically passing Customizable options, by getting the following error

The product's required option(s) weren't entered. Make sure the
options are entered and try again.

$customOptions = ["option_id" => 2, // assign option Id
                  "option_value" => 'test' // here set selected option item Id
                 ];

             $params = array(
               'form_key' => $this->formKey->getFormKey(),
               'product_id' => $productId, //product Id
               'qty'   => 1 //quantity of product
             );

            $this->cart->addProduct($_product, $params);

            $productItem = $this->getProductQuote($_product);
            $productItem->setAdditionalData($this->serializer->serialize($customOptions));
            $productItem->setCustomPrice($productPrice);
            $productItem->setOriginalCustomPrice($productPrice);
            $productItem->getProduct()->setIsSuperMode(true);
            $this->cart->save();

Basically, I need to pass customizable options to the cart separately. For e.g. If users add 2 customizable options together & then adds the product to cart then in the cart they should be added as different products & not together(as default Magento does)


texts: How to fix warnings / errors raised by the Magento Marketplace technical review report?

texts:
With the new Magento Marketplace, a submitted extension goes through several validation states in order to be approved and available via the Marketplace.

One of them is the technical review, from which you can get a technical report like the following:

As you can see, 200+ warnings kinda scared the hell out of me, is there any resource to help fixing every warning apart from the list available in the docs: http://docs.magento.com/marketplace/user_guide/extensions/review-code-validation.html?


texts: I want to update the subtotal by clicking plus minus(real time) Magento 2

texts:
I want to update my subtotal by clicking +/- without any loading. I am using javascript to change the values but it's loading to change values. Is there anyone to help me out for this issues. please show me the file path where I have to overwrite. Please help by realtime ajax minicart source code for Magento 2.
please check my attachment image below.

Thanks


texts: Error More than one node matching the query when running custom MFTF Test

texts:
When running my custom mftf test, I get the error

More than one node matching the query: /entities/entity/requiredEntity[@type='custom_attribute_array'].Exception occurred parsing action at StepKey "disableWYSYWYG"

This happens when I add several  entries in my custom data file.
Interestingly it does not happen when using a predefined data entity with several required entities.
Has anyone an idea?


texts: Magento newsletter goal set-up Google Analytics

texts:
How can I set up the goal in Google Analytics for a successful newsletter subscription?
The problem here is that this successful newsletter subscription doesn't render a individual URL (so, nothing like: www.xx.com/thankyou or something, in which case I could have used 'thankyou'). It just returns the homepage (www.xx.com) with a message on it that subscription has been successful.

I googled quite a bit and more people seem to have encoutered this issue, but I haven't managed to work it out..


texts: set shipping method based on kilometre in magento 1.9

texts:
i am new in learning magento,

my task is i need to implement this,

-Free delivery-within 50km
-table rate shipping-outside of 50km

how to implement this?magento inbuilt functionality provide table rate as per county,region..etc parameter,

but how to implement table rate method with distance?

please help,thanks in advance


texts: Magento 2 : Swatches not display when use plugin around

texts:
I used around plugin to call custom phtml in category list page. It's working proper. But, In configurable product it's hide to display swatches.

I upload here my files code. Which function should I need to use in plugin to working perfectly ?

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\Catalog\Block\Product\ListProduct">
        <plugin name="custom-module-category" type="Vendor\Module\Plugin\File" sortOrder="16"/>
    </type>
    <virtualType name="Magento\CatalogSearch\Block\SearchResult\ListProduct">
        <plugin name="custom-module-search" type="Vendor\Module\Plugin\File" sortOrder="17"  />
    </virtualType>
</config>

File.php :

public function aroundGetProductDetailsHtml(
    \Magento\Catalog\Block\Product\ListProduct $subject,
    \Closure $proceed,
    \Magento\Catalog\Model\Product $product
    ) {
    $data = $this->_productDocFactory->create()->load($product->getId(), 'product_id');
    if(count($data->getData())){
    return $this->layout->createBlock('Vendor\Module\Block\File')->setProduct($data_id)->setTemplate('Vendor_Module::file.phtml')->toHtml();
    } else {
    return '';
    }
    }


texts:
I am using Below code for add custom filed in checkout page it's working fine i want to call in backend how to achieve this. Follow this Link

config.xml

<setup>
    <module>Excellence_Address</module>
    <class>Mage_Customer_Model_Resource_Setup</class>
</setup>

sql

$entityTypeId = $setup->getEntityTypeId('customer_address');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

//this is for creating a new attribute for customer address entity
$setup->addAttribute("customer_address", "delivery_instruction", array(
    "type" => "varchar",
    "backend" => "",
    "label" => "Delivery Instruction",
    "input" => "text",
    "source" => "",
    "visible" => true,
    "required" => false,
    "default" => "",
    "frontend" => "",
    "unique" => false,
    "note" => "Custom Attribute Will Be Used Show Delivery Instruction Field In Checkout Page"
));

$attribute = Mage::getSingleton("eav/config")->getAttribute("customer_address", "delivery_instruction");

$setup->addAttributeToGroup(
        $entityTypeId, $attributeSetId, $attributeGroupId, 'delivery_instruction', '999'  //sort_order
);

$used_in_forms = array();

//$used_in_forms[]="adminhtml_customer";
//$used_in_forms[]="checkout_register";
//$used_in_forms[]="customer_account_create";
$used_in_forms[] = "customer_address_edit"; //this form code is used in checkout billing/shipping address
//$used_in_forms[]="adminhtml_checkout";
$attribute->setData("used_in_forms", $used_in_forms)
        ->setData("is_used_for_customer_segment", true)
        ->setData("is_system", 0)
        ->setData("is_user_defined", 1)
        ->setData("is_visible", 1)
        ->setData("sort_order", 100)
;
$attribute->save();

billing.phtml

        <?php echo $this->__('Delivery Instructions') ?>

        <input type="text" name="billing[delivery_instruction]" id="billing:delivery_instruction" value="<?php echo $this->escapeHtml($this->getAddress()->getDeliveryInstruction()) ?>" title="<?php echo $this->__('Delivery Instructions') ?>" class="input-text required-entry" />

sales_flat_quote_address

/**
 * Adding Extra Column to sales_flat_quote_address
 * to store the delivery instruction field
 */
$sales_quote_address = $installer->getTable('sales/quote_address');
$installer->getConnection()
        ->addColumn($sales_quote_address, 'delivery_instruction', array(
            'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
            'comment' => 'New Delivery Instruction Field Added'
        ));

/**
 * Adding Extra Column to sales_flat_order_address
 * to store the delivery instruction field
 */
$sales_order_address = $installer->getTable('sales/order_address');
$installer->getConnection()
        ->addColumn($sales_order_address, 'delivery_instruction', array(
            'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
            'comment' => 'New Delivery Instruction Field Added'
        ));


texts: How to populate one column in a table from another table column [Magento OOP way]

texts:
I am new to magento. I have to perform a db task in magento upgrade script which should be done using magento OOP db way. But i cannot figure it out how to do it. I can do it in plain sql query but need someone's help to point out how to do it in magento's way.

Here is my sql qeury which i am running in magento and works fine but i need to do it magento's way. Any help is appreciated. I am not just looking fro a code. I need some explaination as well please.

$installer->startSetup();
$sql = "UPDATE Ecom_order eo, sales_flat_order sfo
        SET eo.order_status = sfo.status
        WHERE eo.order_id = sfo.entity_id";

$conn = $installer->getConnection();
$conn->query($sql);
$installer->endSetup();


texts: How can I run unit tests / code sniffs for individual modules using a CI provider?

texts:
At the company I work with, our modules are individual repositories. We add those as composer packages to our Magento 2 installation by adding GitHub as a repository in our composer.json:

"require": {
    "vendor/custom-module": "dev-master"
},
"repositories": [
    {
      "type": "git",
      "url": "git@github.com:CompanyName/custom-module.git"
    }
],
"autoload": {
    "files": [
        "registration.php"
    ],
    "psr-4": {
        "Happy\\PrivateProducts\\": ""
    }
},

This works fine, no questions there.

The next thing we want to do is set these modules up as individual testable modules using a Continuous Integration provider (CircleCI in our case). So I've added dependencies like phpunit and phpcs to the composer.json of our module:

"require-dev": {
    "phpunit/phpunit": "5.3.5",
    "squizlabs/php_codesniffer": "1.5.3"
}

We setup our master-branch to be protected and do our work in the development-branch. When we want to merge the changes we send a pull request to our master-branch. This is the moment where CircleCI kicks in.

Everything gets installed properly on our CI servers' container that is spawned. However, when I try to run phpunit or phpcs from the command line (using vender/bin/phpunit or vendor/bin/phpcs for example), I get a PHP error that all kind of Magento dependencies are missing:

PHP Fatal error:  Uncaught Error: Class 'Magento\Framework\Component\ComponentRegistrar' not found in /home/ubuntu/custom-module/registration.php:6
Stack trace:
#0 /home/ubuntu/custom-module/vendor/composer/autoload_real.php(66): require()
#1 /home/ubuntu/custom-module/vendor/composer/autoload_real.php(56): composerRequiref6475a93b986d5b841accb13703f079a('bdaf00c9b7defe0...', '/home/ubuntu/ma...')
#2 /home/ubuntu/custom-module/vendor/autoload.php(7): ComposerAutoloaderInitf6475a93b986d5b841accb13703f079a::getLoader()
#3 /home/ubuntu/custom-module/vendor/phpunit/phpunit/phpunit(45): require('/home/ubuntu/ma...')
#4 {main}

thrown in /home/ubuntu/mage2-private-products/registration.php on line 6

My question

I have a fairly good idea of why I'm getting this error. After all, I have the registration.php in my composer.json autoload-property. However, I am wondering what's best practice here?

Should I omit the registration.php from my composer.json-file?
Should I include the complete Magento framework as dev-dependency? (I don't think so because my unit tests should mock everything).
Should I wrap my register function with a if class_exists()?
Some other solution / suggestion?

What are other peoples experiences / best practices when it comes to individual module testing / CI processes with Magento 2?

Edit: I found out that if I omit my registration.php autoload in my composer.json, that Magento 2 will not see my module (which makes sense). For now I've included the Magento Framework (magento/framework) as a development dependency and added an auth.json for the credentials. I guess that's the best way to do this, but I'm still interested in other peoples' experiences.


texts: Magento 2.2.3 rewrite adminhtml template from module not working

texts:
I have upgraded magento version to 2.2.3. I am trying to rewrite adminhtml template

Magento_Sales::order/view/info.phtml

Using below code of sales_order_view.xml of my custom module

Also I have tried with below code:

But both are not working. It was working before upgrade to 2.2.3


texts: How to get admin details like first name, last name,email  using Rest API in Magento 2. Any options to add custom attribute like GST No, company name, contact number, Bank details


texts: I want to override Mage_Sales_Model_Quote_Item  I have already made the extended file in my extension but I am not able to call it  please help me .


texts: Magento 2 Message Manager not working in custom module Front end Controller

texts:
My controller without try catch:

class View extends Action
 {

  protected $resultPageFactory;
  protected $productRepository;
  protected $_messageManager;

  public function __construct(
    Context $context,
    PageFactory $resultPageFactory,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
    \Magento\Framework\Message\ManagerInterface $messageManager
  )
  {
    parent::__construct($context);
    $this->resultPageFactory = $resultPageFactory;
    $this->productRepository = $productRepository;
    $this->_messageManager = $messageManager;
  }

  public function execute()
  {

    $resultPageFactory = $this->resultPageFactory->create();
    $productId = 10;
    $_product = $this->productRepository->getById($productId);
    $_product->getName();
    $resultPageFactory->getConfig()->getTitle()->set(__('Custom
    Controller'));
    return $resultPageFactory;
  }

}

And the exception in the front end display is:

1 exception(s):
 Exception #0 (Magento\Framework\Exception\NoSuchEntityException):
 Requested product doesn't exist
 Exception #0 (Magento\Framework\Exception\NoSuchEntityException):
 Requested product doesn't exist.....\

Now with try catch :

......
public function execute()
{

    $resultPageFactory = $this->resultPageFactory->create();

    $productId = 10;
    try {
        $_product = $this->productRepository->getById($productId);
        print_r($_product->getName());
    }catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
        $this->_messageManager->addError($e->getMessage());
        print_r("Exception Occurred");
    }

    $resultPageFactory->getConfig()->getTitle()->set(__('Custom
    Controller'));
    return $resultPageFactory;
  }
  ......

The Front end display nicely but missing the exception message:

EXPECTED RESULT: Message with error on the page bellow e.g


texts: What is getFormattedOptionValue Vs. getFormatedOptionValue?

texts:
Is this just a legacy typo? Or is there something that I'm missing. I just noticed this in the file:

code/local/Mage/Checkout/Block/Cart/Item/Renderer.php

public function getFormatedOptionValue($optionValue)
{
    /* @var $helper Mage_Catalog_Helper_Product_Configuration */
    $helper = Mage::helper('catalog/product_configuration');
    $params = array(
        'max_length' => 55,
        'cut_replacer' => ' ...'
    );
    return $helper->getFormattedOptionValue($optionValue, $params);
}

(Edited two typos in the file path)


texts:
I recently migrated my Magento store to a new server. I moved the whole store, import the database, the SSL certificates and modify domain dns so it points to new Server's IP.
The problem is that when I access to domain.org it shows errors in report, and those error files are being generated in the old server.
My base URL are using domain, not IP, so I don't what is causing this problem.
Do I need to change somewhere else the IP in Magento?

How is it even possible that when I type domain.org it access to the old server if the domain is pointing and replicating to the new server IP?

Greetings!


texts: CSS are compiled but not called in frontend

texts:
I added css on my website. One is bootstrap and one is a custom css.
I addedd it on my Magento_Theme folder (inside layout/default_head_block.xml)

<css src="css/bootstrap/css/bootstrap.css" order="100" />
<css src="css/reflexmania2-custom.css" order="100" />

suddenly there was a problem on these css. They are not loaded in the frontend css inside the HEAD tag.

i tried cleaning cache, generated folders, view_preprocessed and then running

setup:upgrade
setup:di:compile
setup:static-content:deploy

but nothing. they are not loaded.

they are compiled because i can see inside my pub/static folder.

i'm getting crazy. How can i solve this problem?

Thanks for help

EDIT: 1 --> added xml default_head_blocks.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">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

 <css src="css/bootstrap/css/bootstrap.css" order="100" />
 <css src="https://use.fontawesome.com/releases/v5.4.1/css/all.css"  src_type="url" order="100" />
 <css src="css/reflexmania2-custom.css" order="100" />

</head>
</page>

Some notes: inside my Pub/static folder i have got all my css and layout.they are not working nor called from my theme. If i restore a previous version of my theme is the same. I think that there is some problem on pub static or some permission but i cannot understand where.

!(https://i.imgur.com/ZJalGjN.png)


texts: Displaying all the Product of a Category in Magento 2

texts: how to display all the products of a category in a phtml file using an external file in Magento 2