texts: How to export customer list with separate fields for first and last names?

texts:
Magento 1.9.x
Sendgrid

We have been paying for one of the paid versions of Sendgrid for some time and never sent a newsletter out yet. We are getting ready to send a newsletter from within Sendgrid now. We have exported the customer list from Magento by following these steps:

--> Customers --> Manage Customers --> Export to: CSV --> Export

The problem is that when we open the CSV file - it has the first and last name both in 1 column while Sendgrid requires separate columns for first and last name.

How can we export a full customer list out of Magento 1.9.x where first name and last name would be in separate fields of the exported CSV?


texts:
I have installed the OpenStream geoIp extension that pulls data from MaxMind database and I have been using this code for years to hide prices in countries that are not allowed:

            $geoIP = Mage::getSingleton('geoip/country');
                    if ($geoIP->isCountryAllowed()) {
                     ...
                     }

Now this is no longer working. Allowed countries are only UK, US and Canada. I want to hide prices for all other countries, but if I echo the country code, it shows US. I am using a VPN to test. Also if I try to update the GeoIP db I get banned for hours. Has anything changed? ANy pointer is very welcome.


texts: Magento 2.2, How to refresh payment method when Grandtotal is Rs.0?

texts:
I need refresh PaymentMethod when GrandTotal is Rs.0?

I have added my js below.

    define(
                [
                    'jquery',
                    'mage/url',
                    'Magento_Checkout/js/action/get-totals',
                    'Magento_Checkout/js/model/full-screen-loader',
                    'Magento_Checkout/js/action/get-payment-information',
                ],
                function (
                        $,
                        urlBuilder,
                        getTotalsAction,
                        fullScreenLoader,
                        getPaymentInformationAction
                        ) {
                    'use strict';

                    return function (isLoading, newValue) {
                        if (newValue) {
                            var use_wallet = 1;
                        } else {
                            var use_wallet = 0;
                        }

                        var serviceUrl = urlBuilder.build('wallet/checkout/totals');
                        jQuery.ajax({
                            url: serviceUrl,
                            type: "POST",
                            data: {use_wallet: use_wallet},
                            success: function (response) {

                                if (response) {
                                    var deferred = $.Deferred();
                                    isLoading(false);
                                    getTotalsAction([], deferred);

getPaymentInformationAction().done(function () {
    fullScreenLoader.stopLoader();
    return true
});
                                }
                            },
                            error: function (error) {
                                isLoading(false);
                            }
                        });
                    }
                }
        );


texts: How can I get pdepend to give me accurate results for my extension

texts:
pdepend is a useful tool for doing static analysis on a php codebase, but it doesn't know how to interpret Mage::(getBlock|getModel|helper|…) factory methods to their actual classnames. Factories may exist precisely to help relax tight coupling, but for pdepend purposes I want it to report on the resolved classnames. For example, if I have

$foo = Mage::getModel('eb2caddress/validator')->isValid($address);

I would like pdepend to see something like:

$v = new EbayEnterprise_Eb2cAddress_Model_Validator();
$foo = $v->isValid($address);

I started hacking together a shell script that would automatically do the above conversion, but as I am working on it I'm beginning to realize that I'm going to have a hard time with constructor arguments and singletons. Furthermore, the shell may not be the right approach. Are there any better tools to solve this problem? Even if the end result doesn't use pdepend, any Magento-aware tool (or a tool that can be configured to understand an arbitrary factory) that can tell me various modules' afferent and efferent coupling and relative responsibility as well as a straightforward depgraph would be really helpful.

Is anyone aware of such a tool, or how to get pdepend to understand Magento factories?


texts:
My client has a website at "wedowirelessbetter.com" and wants no pricing on any product which I have accomplished already, however when a Pre-Order is sent to a store after a customer checks out, I still see the pricing on the email template.  Is there an easy way to remove this?

I looked at the templates and I see order=$order but removing all of that removes the product from the email and shows nothing.

Any help would be appreciated.
Thanks,
Andy


texts:
I'm using this great tool called warden for local development and I'm currently in need of setting up Magento on a different domain tld - other than ".test" (it needs to be example.local, the reason being that it needs to be connected to a remote database.)
How can I set this up using warden?


texts: Magento 2.2 install error: No images in Magento Admin after installation

texts:
I installed Magento v2.2.4 with sample data on my local using xampp.
I downloaded the source from magento.com/tech-resources/download as the user guide instructed.

After finishing the installation, I found this error, and couldn't solve it:

Icons and favicons don't appear and styles are broken, also requirejs doesn't work.

Please, help me.
I am new to Magento 2 and couldn't know how to fix it.


texts: How do I translate the "Password Strength" , and other texts on Create new Account

texts:
I would like to translate the

"Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters."

"Password Strength: %1"

And other related content on customer/account/create/

How can I do this?

My version is Magento 2.2.3

Thank you,
Regards,


texts: Enable HTTP Strict Transport Security (HSTS) in Magento 2.1 - Should we do it?

texts:
Magento 2.1.9 has a built-in option to enable HSTS.

I read in OWASP official wiki that enabling HSTS for a domain is not something to be done without thorough thinking over, because preloading headers with HSTS can have permanent consequences on how the domain is served to users.

So, I wonder, if HSTS is recommended or will it only complicate things with potential disruptive effects on a website? What is your advice?


texts: Need help formulating getCategoryIds() statement

texts:
I am having trouble working with getCategoryIds() and would greatly appreciate help formulating this statement

$one = 71;
$two = 8;
$three = 4;

$categoryIds = $_product->getCategoryIds();

if(($one || $two || $three) is in $categoryIds)
{
do stuff;
}

I'm unsure of how to pull out all the categoryIds that a product might have (i.e. 5,7,2) and match against the hardcoded ones


texts:
I want to add some new functionality to the order create view in adminhtml

Following magento 2 docs guide I just have to reference the block I want to extend, as far as I understood.
My block is recognized just fine but in at the wrong position.

I'd like to have it at the position where the comments are placed

Here is my layout
    app/code/Namespace/FancyModule/view/adminhtml/layout/sales_order_create_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="content">
            <block class="Namespace\FancyModule\Block\Rewrite\Order\View" name="custom.order.discount" template="test.phtml" after="comment"/>
        </referenceBlock>
    </body>
</page>

and here is the magento layout including the block I'd like my bloc to appear after/before

 <referenceBlock name="content">
            <block class="Magento\Sales\Block\Adminhtml\Order\Create" name="order_content">
                <block class="Magento\Sales\Block\Adminhtml\Order\Create\Form" template="order/create/form.phtml" name="order_create_form" as="form">

                    <block class="Magento\Sales\Block\Adminhtml\Order\Create\Data" template="order/create/data.phtml" name="data">
                      <!-- THIS ONE -->
                        <block class="Magento\Sales\Block\Adminhtml\Order\Create\Comment" template="order/create/comment.phtml" name="comment"/>

                    </block>
                </block>
            </block>
        </referenceBlock>

Thanks for help


texts: Getting current product custom attribute on aroundExecute of Cart Add function - Magento 2

texts:
I need to access a custom attribute of the current product in Vendor\ModuleName\Plugin\Checkout\Controller\Cart. I have tried getting this from the request param, checkoutSession,registry (eventhough its deprecated) but failed.

Is this possible? Following is my code,

    <?php

    namespace Vendor\ModuleName\Plugin\Checkout\Controller\Cart;

    use Magento\Framework\App\ObjectManager;
    use Magento\Framework\App\RequestInterface;
    use Magento\Framework\Controller\Result\RedirectFactory;
    use Magento\Framework\ObjectManagerInterface;
    use Magento\Framework\UrlInterface;

    class Add
    {
        /**
         * @var ObjectManagerInterface
         */
        protected $objectManager;

        /**
         * @var RedirectFactory
         */
    protected $resultRedirectFactory;

    /**
     * @var UrlInterface
     */
    protected $url;
    protected $request;
    protected $registry;
    protected $_checkoutSession;

    /**
     * Data constructor.
     *
     * @param ObjectManagerInterface          $objectManager
     * @param RedirectFactory                 $resultRedirectFactory
     * @param UrlInterface                    $url
     * @param RequestInterface                $request
     * @param \Magento\Checkout\Model\Session $_checkoutSession
     */
    public function __construct(
        ObjectManagerInterface $objectManager,
        RedirectFactory $resultRedirectFactory,
        UrlInterface $url,
        RequestInterface $request,
        \Magento\Checkout\Model\Session $_checkoutSession
    ) {
        $this->objectManager = $objectManager;
        $this->resultRedirectFactory = $resultRedirectFactory;
        $this->url = $url;
        $this->request = $request;
        $this->_checkoutSession = $_checkoutSession;
    }

    /**
     * Around cart execute
     *
     * @param \Magento\Checkout\Controller\Cart\Add $subject
     * @param \Closure                              $proceed
     * @throws \Magento\Framework\Exception\LocalizedException
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function aroundExecute(
        \Magento\Checkout\Controller\Cart\Add $subject,
        \Closure $proceed
    ) {
        $cartData = $this->_checkoutSession->getQuote()->getAllVisibleItems();
        $cartDataCount = count($cartData);
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product
        $logger = \Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class);
        $logger->info('-------------------------------Test------------------------');
        $logger->info($cartDataCount);
        $logger->info($product->getId());
        $logger->info($product->getName());
        $logger->info(var_dump($this->request->getParams()));

        $contactUrl = $this->url->getUrl(
            'contact'
        );
        $result = [];
        $result['backUrl'] = $contactUrl;

        $subject->getResponse()->representJson(
            $this->objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result)
        );
        return;
    }
}

FYI, I am aware that use of ObjectManager is discouraged. This was done for for testing purpose only.


texts: after registration submitted Internal Server Error

texts:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Please refer below screenshot:


texts: Magento Admin URL returns 404, after changing  xml parameter

texts:
I've installed a module which didn't work as expected.

As a fix I tried changing the admin use parameter in the config.xml as i noticed it was the old router coding style.

After changing <use>admin</use> to <use>customadminurl</use> the admin panel is now inacessible. It just returns 404 error page.

    <admin>
        <routers>
            <adminhtml>
                <use>admin</use>
                <args>
                    <modules>
                        <ordercomment before="Mage_Adminhtml">Tech18_OrderComment_Adminhtml</ordercomment>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

I've tried to change the routing to the new style without the use parameter, but this didn't fix it.

    <admin>
        <routers>
            <adminhtml>
                <args>
                   ...

I've tried:

purging cache via n98-magerun
revert changes
checking conflicts via n98-magerun
reindexing
disabling the module
Changing admin url to non-custom (default "admin") both in database and local.xml
Checking rewrites table
checking all log files
checking core_config_data for issues
enabling security, backwards extension compatibility in

( https://marketplace.magento.com/18thtechnology-order-notification-of-creator.html#bv_questions)


texts: How to sort child products of configurable products

texts:
In Magento 2, I want to get the data of configurable child product in ascending order like 1kg, 2kg, 3kg and 4kg but I am getting it like 2kg, 3kg, 4kg and 1kg.
Any help please, thanks in advance.


texts: Magento 2: Can not see Stock/Qty box in product level in admin panel

texts:
is any idea about why i can not see the qty box in product admin page, There is no option to add any qty box.
Thanks in advance.


texts:
I am new to Magento.
I have installed Magento 2.1.10 successfully and now I am trying to install extension to it. I got a free extension from the market place and while installing it, I am finding the following error in the readiness check.

Wrong version of PHP
PHP Settings Check *

  Your current PHP memory limit is 128M. Magento 2 requires it to be set
  to 756M or more.

I have already set my memory_limit to 2G in the ini file.

Here is the screenshot of the readiness page

Here PHP version is 5.6.25, but my selected version is 7.0.6.
Please help me get ride of these errors. Any help/suggestion us appreciated. Thank you


texts: Undefined property: Mage_Shell_Compiler::$_factory in indexer.php

texts:
Since SUPEE on Magento 1.9.0.1 we see the following error:

Notice: Undefined property: Mage_Shell_Compiler::$_factory in /shell/indexer.php on line 45

Question: Did someone come across this error too?
`

It is used in this function
protected function _getIndexer()
    {
        return $this->_factory->getSingleton($this->_factory->getIndexClassAlias());
    }


texts: Magento change index mode using command line

texts:
I need to change index mode for a particular single index using command line.

I have followed this link it allows me to re-index data but when I try to change mode of index, either I get list of available options or get all of the indexes mode changed.

If I run below command,

php -f shell/indexer.php --mode-realtime catalog_url

it changes mode for all indexes instead of changing mode only for catalog_url

If I run below command,

php -f shell/indexer.php catalog_url --mode-realtime

I get list of options and mode for index is not changed.
Can anyone suggest what to do to change mode for a single index using command line.


texts:
With my local.xml, I am already able to add CSS and JS files. Now I want to add an .phtml file to the rwd/default/layout/page.xml file, but it won't work.

In the page.xml file, there is a block with the name 'header'. I have made a reference to it in my own local.xml file like this:

    <reference name="header">
         <block type="page/html_textblock" name="textblock" template="page/html/textblock.phtml"/>
    </reference>

The block inside the reference points to the textblock.phtml file, which only contains the sentence:

hey there

How do I make this sentence show on the page.xml, without altering the file?


texts: unmerge css and js files on magento admin back-end

texts:
I've made some changes on my local. then when i git push my changes to dev environment I don't see them. When I was inspecting my code I noticed that the css on my local are different because the css files on dev are merged.

I would like to know how can i un-merge the js and css files on the dev environment so that they look the same as the ones on my local


texts:
How can i modify transactional mails in Magento?

I want to change the email content.

The emails are not listed in system->transactional emails list.
I have checked app/code/locale too. But I didn't find the email templates to edit.


texts:
I've discovered that in the class \Magento\Backend\App\AbstractAction (the ancestor of every admin controller action) there is a member called _publicActions that is used in the validation of the secret key like this:

 if (is_array($this->_publicActions) && in_array($this->getRequest()->getActionName(), $this->_publicActions)) {
     return true;
 }

This means, that if a certain action name is listed in _publicActions you can access the action without the secret key in the url.
This is a blessing for development and debugging, because you can just do it like ROOT/admin/module/controller/action manually, without the need to know the secret admin key, but what I don't understand is why can I access the product edit page without the secret key.
Just call any product edit page like this ROOT/admin/catalog/product/edit/id/{product_id_here}.

The publicActions member is overwritten for orders (that allow index and view), in products (for edit) and in redirect controller for redirects.

Now my question:
Why are only some edit actions allowed without the secret key, and when/what should I allow in my custom CRUD modules without the secret key?


texts: Filter Product collection by multiple price ranges

texts:
I want to filter product collection by some attributes including diy_kit_price attribute (new attribute already added) as shown below.

Price Ranges:

0 - 5000
10000 - 15000

I tried several ways but no luck.

Working Code: when i am filtering by one price range:

$products = Mage::getModel('catalog/product')->getCollection()
         ->addAttributeToSelect('*')
         ->addAttributeToFilter('type_id', 'configurable')
         ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
         ->addAttributeToFilter('category_id', array(
             array('finset' => '37')
           ))
         ->addAttributeToSort('name', 'asc')
         ->addAttributeToFilter('diy_kit_price', array('gt' => 0))
         ->addAttributeToFilter('diy_kit_price', array('lt' => 5000));

Not Working Code: when i am filtering by one price range:

$products = Mage::getModel('catalog/product')->getCollection()
         ->addAttributeToSelect('*')
         ->addAttributeToFilter('type_id', 'configurable')
         ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
         ->addAttributeToFilter('category_id', array(
             array('finset' => '37')
           ))
         ->addAttributeToSort('name', 'asc')
         ->addAttributeToFilter('diy_kit_price', array('gt' => 0))
         ->addAttributeToFilter('diy_kit_price', array('lt' => 5000))
         ->addAttributeToFilter('diy_kit_price', array('gt' => 10000))
         ->addAttributeToFilter('diy_kit_price', array('lt' => 15000));

Is there any other way to filter. Can we filter using plain SQL with multiple price ranges.

Thanks in advance.


texts: Overwrite third party template file in my custom module

texts:
I have done some research to this subject but couldn't seem to find a detailed answer.

What I need

To overwrite a template file from a third party module
in my case: Amasty One Step Checkout

Template file to overwrite:

  /app/code/Amasty/Checkout/view/frontend/web/template/onepage/shipping/methods.html

I have found that this file is loaded using knockoutjs via this function:

<!-- ko with: requestComponent('checkout.steps.shipping-step.shippingAddress') -->
<!-- ko template: 'Amasty_Checkout/onepage/shipping/methods' --><!-- /ko -->
<!--/ko-->

in file:

  app\code\Amasty\Checkout\view\frontend\web\template\onepage\3columns.html

What I've done

Added module dependency

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Plugin_Name" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Checkout" />
            <module name="Amasty_Checkout" />
        </sequence>
    </module>
</config>

Tried overwriting the template file like this in my module's checkout_index_index.xml

<referenceBlock name="checkout.steps.shipping-step.shippingAddress">
    <action method="setTemplate">
         <argument name="template" xsi:type="string">Plugin_Name::shipping_view.html</argument>
    </action>
</referenceBlock>

But without success..

Can someone explain what steps to take to overwrite a third party's template file and if there is a difference if it is loaded in another template file via knockoutjs

Thanks in advance


texts: How can I change the quality of my thumbnails?

texts: My product image looks very good but somehow magento is making my thumbnails looking pretty bad. How can I fix this problem?(Setting?/Code?) Thank you!


texts: show frontend page only user is logged in in magento2

texts:
I want to show the customers details and bought products in frontend page

how can i show the my custom module's page only if the user is logged in.


texts: Static Content Issue After few SOAP API calls

texts:
I have recently made a magento project live, with some customization. The client asked that they need to integrate Microsoft Navision with magento, for that they are using SOAP APIs (V1 and V2 both). There is a strange error that we are facing on Production. The SOAP API calls works fine but after few calls the URL for static content get changed e.g.

http://www.domain.com/skin/frontend/default/mytheme/images/abc.gif it get converted to /frontend/default/mytheme/images/abc.gif. (yes skin is not there in the URL)

Same is happening with JS CSS and media images also. But As soon as we clear the cache it works well. Then again after few API calls it stops working.

This is a very odd Behavior, any help or direction is much much appreciated !


texts: Update custom column data in quote table Magento 2

texts:
I inserted a custom column in quote table like this:

if (version_compare($context->getVersion(), '1.0.1', '<')) {
          $setup->getConnection()->addColumn(
              $setup->getTable('quote'),
              'custom_column',
              [
                  'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                  'nullable' => true,
                  'comment' => 'Custom Column',
             ]
          );
        }

The custom column was successfully created, and added to every single row in quote table with null value, but the problem is, i don't know how to update the custom column data in the quote table by using only quote id


texts:
I need to setup TAX based on customer shipping state.

Example: If in the USA customer's shipping state is New York then TAX will be 14% otherwise for all state TAX will be 5.5%

I created 2 Tax Rate based on USA state but it's not working.
Anything I forgot to do?


texts: Unable to apply SUPEE-7405 v1.1 to Community Edition 1.9.0.1

texts:
I get the following error when trying to apply the patch.

sh PATCH_SUPEE-7405_CE_1.9.0.1_v1.1-2016-02-23-07-40-19.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
patching file app/code/core/Mage/Core/Model/Config.php
patching file app/code/core/Mage/Sales/Model/Quote/Item.php
Hunk #1 succeeded at 506 (offset 1 line).
patching file lib/Varien/File/Uploader.php
Hunk #1 FAILED at 216.
Hunk #2 FAILED at 538.
2 out of 2 hunks FAILED -- saving rejects to file lib/Varien/File/Uploader.php.rej

I have tried uploading a fresh copy of lib/Varien/File/Uploader.php from the 1.9.0.1 Magento files but it just shows the exact same error.


texts: Integrate Magento 1.9 CE into already built site (not Wordpress) with cart info persistent across site/store

texts:
I have been tasked with putting a store into a ready built site. the site has it's own custom CMS that is used to generate all the site's content (blogs, events etc..).

I intend to set the store base url to be mysite.com/store/ and the rest of the site would live at mysite.com/blogs/ , mysite.com/shows/ etc... as it currently does.

My problem lies in that the site has fixed header bar design which will now contain LOGIN / SIGN UP links as well as a shopping cart icon with the stored number of items in the cart above it (like Amazon). Also, it is not possible for me to utilise the Magento CMS for the rest of the site.

Is there a way to access the cart contents from the same domain (database?) but outside of the Magento install? And even logged in user details?

===========================================

EDIT :
I have looked into using the SOAP API to query the customer and the cart contents but it appears I would need the cart_id (quote_id ??).

Is it possible I could store the Cart ID in a $_SESSION variable after a user has added something and access that in the rest of my site, if so, where would I need to do this?

Questions like this seem to hint at hacking the core code, which I would have thought is out of the question.


texts:
In Magento 1.9.3.1 i have the following problem:

As you can see, tax are not included in grandtotal, but i have absolutely no idea why, because my tax settings should be alright:

any idea why this is not working? Thanks a lot!


texts: How to get data from config.xml of a module

texts:
In the module A I need to get some data from file config.xml of modules B and C.
Are there any methods or classes dedicated for this?

Especialy I need to get XML structure and values of node <default> so that I can restore default values of system configuration of modules B and C. Below is example from config.xml of Wishlist module:

<config>
    <default>
        <wishlist>
            <general>
                <active>1</active>
            </general>
            <email>
                <email_identity>general</email_identity>
                <email_template>wishlist_email_email_template</email_template>
            </email>
        </wishlist>
    </default>
</config>

As far as I know Magento loads config.xml files of all modules, so I was wondering maybe this data is already cached and can be retrieved from cache somehow? If not, how to retrieve it programaticaly?


texts:
I have setup magento 2.2.6 website on local system. PHP Version 7.2.12 installed on the local system.

When I have run url on local system then getting error:

  [2018-12-12 06:51:27] main.CRITICAL: Warning: Use of undefined
  constant MCRYPT_RIJNDAEL_256 - assumed 'MCRYPT_RIJNDAEL_256' (this
  will throw an Error in a future version of PHP) in
  D:\xampp\htdocs\testing226\vendor\magento\framework\Encryption\Encryptor.php
  on line 394

How to fix the issue? can anyone suggest the solution?


texts:
I am not able to enable the Caches anymore, I am not in Production Mode and I read that the Cache options are not available in Production Mode, but:

 bin/magento deploy:mode:show

Shows I am not in production.

So what is this?


texts: override payment/methods.phtml in custom extension

texts:
I am creating custom extension in my magento site. In this extension i need to add my own code while selecting Bank Transfer Payment method.

So basically I need to override payment/methods.phtml.

Magento File Full Path : app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml

I have created same file in my custom directory.

My custom module full path:

app/design/frontend/base/default/template/market/methods.phtml

market is my module directory name

My xml path resides at :

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

Code wriitten in xml to override:

<checkout_onepage_index>
         <reference name="checkout.onepage.paymentmethods">
            <action method="setTemplate">
                <template>market/methods.phtml</template>
           </action>
        </reference>
</checkout_onepage_index>

I think reference name is wrong. Please someone help which reference name should I use to override payment/methods.phtml. :)


texts: Magento 2.3.0 How to get request parameters in event observer?

texts:
I would like to get a request parameter in the observer file.

Below is the observer code.

  etc/frontend/di.xml

<event name="review_save_before">
    <observer name="set_customer_data" instance="Namespace\Modulename\Observer\ReviewSaveBeforeObserver"/>
</event>

  Observer/ReviewSaveBeforeObserver

<?php
namespace Namespace\Modulename\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Review\Model\Review;
use Psr\Log\LoggerInterface;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Framework\App\Request\Http;

class ReviewSaveBeforeObserver implements ObserverInterface
{

    /**
     * @var Http
     */
    private $request;

    /**
     * @var OrderInterface
     */
    private $orderInterface;

    /** @var \Magento\Framework\Logger\Monolog */
    protected $logger;

    public function __construct(
        LoggerInterface $loggerInterface,
        OrderInterface $orderInterface,
        Http $request
    ) {
        $this->logger = $loggerInterface;
        $this->orderInterface = $orderInterface;
        $this->request = $request;
    }

    /**
     * This is the method that fires when the event runs.
     *
     * @param Observer $observer
     */
    public function execute(Observer $observer)
    {
        $this->logger->addDebug('Executed Review Save After Observer');

        /** @var Review $review */
        $review = $observer->getDataByKey('object');
        echo '<pre>';print_r($this->request->getParams());die;
        //$review->setStatusId(Review::STATUS_APPROVED);
        $review->setCustomerId(1);
    }
}

But it is throwing below error.

  Fatal error: Uncaught Exception: User Error: Some transactions have not been committed or rolled back in /var/www/html/CE/2.3.0/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3955 in /var/www/html/CE/2.3.0/vendor/magento/framework/App/ErrorHandler.php:61 Stack trace: #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(256, 'Some transactio...', '/var/www/html/C...', 3955, Array) #1 /var/www/html/CE/2.3.0/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(3955): trigger_error('Some transactio...', 256) #2 [internal function]: Magento\Framework\DB\Adapter\Pdo\Mysql->__destruct() #3 {main} thrown in /var/www/html/CE/2.3.0/vendor/magento/framework/App/ErrorHandler.php on line 61

Any help would be appreciated!


texts:
My Custom Observer is not sending the email.

public function sendAdminMail(Varien_Event_Observer $observer)
{
    $customer = $observer->getEvent()->getCustomer();

    $customerName = $customer->getFirstname() . ' ' . $customer->getLastname();

    $emailTemplate = Mage::getModel('core/email_template');
    $template = "customer_registration_email_template";
    $sender = array('name' => 'Customer Registration',
                    'email' => 'registrationform@mydomain.com');
    $recipientEmail = Mage::getStoreConfig('contacts/email/recipient_email');
    $recipientName = "Sales";
    $variables = array('customer'=>$customerName);

    $emailTemplate->sendTransactional(
        $template,
        $sender,
        $recipientEmail,
        $recipientName,
        $variables
    );
}

Here is my config.xml (global node)

<template>
        <email>
            <customer_registration_email_template translate="label" module="adminnotification">
                Customer Registration Admin Notification
                <file>schott/customer_registration.html</file>
                <type>html</type>
            </customer_registration_email_template>
        </email>
    </template>

To be complete, here is the system.xml too

<config>
Customer Registration Admin Notification
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</config>

An email should be sent to the admin when a new customer registers.

What am I doing wrong here? The template is showing in the list of Transactional mails in the backend and it sends when I use it testwise for new orders for example.

Strange is also, that the content of the template does not load in the backend (transactional mails) when I add a new template and want to load its default content (it just loads and stays blank).

Any help appreciated. Thanks in advance!


texts: addAttributeToSort by ASC ignore null values

texts:
I am  try to sort my product collection.

At first it should be sorted by alphabet (A,B,C..) and then by other character like NULL ...

This is my code which I have tried...

return $this->_productCollection
        //->addAttributeToFilter('hero', array('FIND_IN_SET'=>array('A','',NULL)))
        //->getSelect()->order("FIND_IN_SET(hero,'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z') DESC")
        //->addOrder("FIND_IN_SET(hero,'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z') DESC, hero, NULL")
        //->addAttributeToSort("FIELD(hero,'A,, ')", 'ASC')
        ->addAttributeToSort('hero', 'DESC')
        //->addAttributeToFilter('hero', 'notnull')
        ;


texts: Magento 2 - Collection getSize() returns zero

texts:
I have read about the difference between collection count() and collection getSize(), but I don't understand what's the reason that gives different numbers in each method.

In a custom collection I created, I get the following:

echo $collection->getSize(); //returns 0
echo count($collection); //returns 33

1) Can somebody help, so I can find what causes zero results in my collection?

2) Does stock management affect with getSize()?


texts: General question regarding modules / extensions

texts:
I'm working for a computer components store.

My end goal is to make a 'Build your own computer' page where customers can pick components from each category (CPU, Memory, etc) and add them all to the cart.

I began by making a custom template file and just making it on a CMS page, but I've hit the point where items need to be added to carts etc, and I was planning on making another php page to add the item to the cart, and access it by AJAX, and I'm starting to get a bit flustered with what I'm making (I'll admit I'm out of my league, but I'm a programming student and am trying to learn.)

How should I be tackling this? Is it wrong to be making such a thing in template files alone? I have an extremely rough understanding of how modules work, but as far as I could tell, you can't have a CMS page with modules on them.


texts: Show sibling child categories in left.phtml navigation in Magento 1.9

texts:
In the standard left navigation catalog/navigation/left.phtml of Magento 1.9 when entering a child category, with no children of its own, the navigation area is left blank. For these childless categories only, I would like to show sibling categories in the left navigation.

For example:

Parent Category

Child A
Child B
Child C

In the above scenario, if I navigated to 'Child A' then 'Child A, Child B and Child C' would be shown in the left navigation bar (with Child A ideally being shown in bold).

My current navigation/left.phtml code is:

<?php if (!Mage::registry('current_category')) return ?>
<?php $_categories = $this->getCurrentChildCategories() ?>
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?>
<?php if($_count): ?>

        <?php echo $this->__('Browse By') ?>

                <?php foreach ($_categories as $_category): ?>
                    <?php if($_category->getIsActive()): ?>

                        <a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->escapeHtml($_category->getName()) ?>

                    <?php endif; ?>
                <?php endforeach ?>

<?php endif; ?>

Can an edit be suggested to the above, please, to get this working as desired?


texts: Is possible to create a new cart for a customer after he has done an order?

texts:
On my frontend, using the Magento 2.2 REST API, I have the following situation: a customer has the possibility to order products and specify the delivery date for each product.

For example: I can order Item A and want it to be shipped tomorrow and then order Item B and want it to be shipped next week.

To achive this, I store products on te frontend during the shopping and, when it's time for the checkout, I do the following:

Add Item A to cart
Do checkout (specifing delivery date in shipping information)
Add Item B to cart
Do checkout (specifing delivery date in shipping information)

The issue I'm running into: at the end of point 2 (when the first checkout is done) if I try to retreive customer's cart I get a 404 - No entity with customerId = [customer id]. It seems like the customer is deleted or something like that. Or maybe the cart is no more valid? Trying to create a new one I get a Deconding error. as response.

What I'm asking: is it possible to do what I described? If true, how can I do that?

Thank you!


texts: Magento 2: Parse error: syntax error, unexpected '' ''

texts:
This is my first time trying out Magento 2 and I tried creating a basic custom module, but when I tried to execute the php bin/magento setup:upgrade it, I got an error:

  Parse error: syntax error, unexpected ''Jurgis_Twilio'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in C:\wamp64\www\magento2\app\code\Jurgis\Twilio\registration.php on line 4

C:\wamp64\www\magento2\app\code\Jurgis\Twilio\registration.php:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Jurgis_Twilio',
    __DIR__
);

my php version (php -v):

PHP 7.0.10 (cli) (built: Aug 18 2016 09:48:53) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies


texts: Magento 2 - How to install extension from marketplace.magento.com via composer?

texts:
I bought a this extension from marketplace.magento.com. I tried to install it via composer like this:
composer require bsscommerce/customer-approval

But I get

[InvalidArgumentException] Could not find a matching version of
package bsscommerce/customer-approval. Check the package spelling,
your version constraint and that the package is available in a
stability which matches your minimum-stability (stable).

I also followed this documentation, but it does not help.


texts: Authorize.net Transaction Fails From Admin Order first time then works second time

texts:
I currently have Magento 2.3 installed and I ran across this issue (https://github.com/magento/magento2/issues/24844) that is similar to mine but I can't seem to take conceptually what was done and get it to work for my case. I currently have
<script>
//<![CDATA[
require(
    ['Magento_AuthorizenetAcceptjs/js/payment-form',
        'jquery',
        'domReady!'
    ],
    function(Authorizenet, $) {
        $(document).on('test', 'body', function() {
            var config = <?= /* @noEscape */ $block->getPaymentConfig() ?>,
                form = "#payment_form_<?= $block->escapeJs($block->escapeHtml($block->getMethodCode())) ?>";
            new Authorizenet(config, form);
        });
    });
//]]>

<script>
require(
    ['jquery'],
    function($) {
        $(document).trigger('body').trigger('test');
    });
//jQuery('body').trigger('test');

but no matter what I do this ends up making it worse causing the transaction to fail over and over again instead of just on the first try. What am I doing wrong?


texts:
I have setup a custom module in my magento store (CE-1.9.0.0) with the following in my config file:

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Custom>
            <version>0.1.0</version>
        </Company_Custom>
    </modules>
    <frontend>
        <routers>
            <custom>
                <use>standard</use>
                <args>
                    <module>Company_Custom</module>
                    <frontName>our-work/digital-work</frontName>
                </args>
            </custom>
        </routers>
        etc...

I know that when I have setup custom modules before the frontname works when it is a single string (i.e if I wanted to use just digital-work this works, just not when I have a nested string in place as in our-work/digital-work - this results in a page not found.

I am new to routers and magento so I presume I have misinterpreted what is possible in the <frontName> Is it possible to have a nested frontname?


texts: Setting different prices for different store or website?

texts:
We are currently running a one domain, one website, one store, several store views  (languages) magento install.

We are looking into setting up another domain to handle a more localized market with different prices.

So I went into the backend and first set up a new store as well as two new store views for it. I choose the same root cat. for this one.

I find that it is not possible to select the store in the scope drop down in order to edit products. So I can not change product prices based on the store only based on store views.

I want all store views under the new store to have the same price without assigning it twice for each product.

Second I went to add a new website in the backend, created a new store for it as well as a new store view. I was hoping to be able to edit prices under the website scope, but this does also not work as one is again able only to select a store view.

I might have overlooked something here. How am I to set different prices for seperate stores OR websites?

Update: So I have added a new root category to the new website store and added a product to it to test it out. I have assigned this product to both the main website store as well as the new website store.
When I go to edit view of this product and try to choose the website in the scoope selector I am not able to select website. It will only let me select a
store view instead.

We are using Magento 1.9.0.1

The bottom line is I am able to set prices for each store view under each website. But it is not possible to set a price for a website including all store views under it. This would mean that for each product on the new website we would have to set the price twice once for each store view as the new website will have two languages.

Can someone confirm if this is the way it is supposed to work or have I gone
wrong here?


texts: How to get product stock status on the listing page in Magento 2?

texts:
I am using Magento 2.3.1

I want to display stock status on the listing page. So, how can I get "Stock Status" attribute value on the listing page?

I have tried below code:

<?php
 $_productCollection = $block->getLoadedProductCollection();
 foreach ($_productCollection as $_product){

    $stock_status = $_product->getResource()->getAttribute('quantity_and_stock_status')->getFrontend()->getValue($_product);

 }
?>

And tried below as well:

<?php
     $_productCollection = $block->getLoadedProductCollection();
     foreach ($_productCollection as $_product){

        $default_stock_status = $_product->getData('quantity_and_stock_status');

     }
?>

But for each scenario, I got "Out of stock" even though the product is in stock
here quantity_and_stock_status is the default "Stock Status" attribute.


texts: Varien's product.js method override is not working

texts:
I want to override initPrices method.

For this in js folder i have created directory scommerce and in that directory created file product.js

In product.js file code to override is as following:

Product.OptionsPrice.prototype.initPrices = Product.OptionsPrice.prototype.initPrices.wrap(function(){ this.containers[5] = 'product-price-' + this.productId + '_clone'; });

In local.xml file i have add

<catalog_category_view>
        <reference name="head">
            <action method="addJs">
               <script>varien/product.js</script>
            </action>
            <action method="addJs">
                <script>scommerce/product.js</script>
            </action>
        </reference>
</catalog_category_view>

But it is not working.

I am following https://stackoverflow.com/questions/22962443/how-should-magento-varien-js-files-be-changed link.


texts: Can't find function iconv_strpos after server migration

texts:
I just changed my magento 1.9 installation to a dedicated server. I uploaded the file system and the database to the new server.

When I try to access my website, the following line appears in my error_log:

    PHP Fatal error:  Call to undefined function iconv_strpos() in /lib/Zend/Locale/Format.php on line 827

And the only thing my page shows is the home button of my website.

Did I have something more to do about my migration?

Thanks in advance.


texts: possible to write product custom attributes into session?

texts: I have a product custom attribute, want to write in session when then product detail page was load. So I can get use the session value on the other block on the same page. Anyone can give me an advise?


texts:
Is there a way to password protect a single product in Magento 1? We have a product that should only be able to be purchased by customers who know the password.

It could be accessible to others, as long as they can't purchase without the password, so any coupon code or special attribute field might work, just can't think of how one might go about that.


texts: Re-directing to registration when adding products to cart

texts: I want that when someone adds a product to the shopping cart, it is redirected to the registration page. In this way I can restrict the purchase only to registered users, how can I do this? Thank you


texts:
In Magento_Community_1-7_User_Guide.pdf shipping starts on page 145 (page 155 in PDF). But they do not explain the DHL module.

Where do I find documentation about how and what to configure this?

Also I wounder if this custom shipping calculation is really needed for a simple store or if fix prices do work fine in real life.

I found a DHL Intership extension that claimes to be the official tool. Is this an addition to the mangeto core function? Does do the same and is not needed anymore?


texts: Add Elastic Search on magento 2.2 without composer

texts: i have Mangento 2.2 site on which i want to add elastic search. According to the documentation we can add the same using composer, but my problem is i cannot use composer. Is there any other way to achieve the same?


texts: Difference between total_due & base_total_due

texts:
When I get order data I can see there is total_due and base_total_due. My question is what is the difference between these?

Basically I get to see if the order has been paid fully and unsure which I should check


texts: Magento 2.x some css and js not working in custom theme

texts:
I have installed Magento CE 2.1.2 in my local system Windows 7(64 bit) Uwamp.

Now I have created my custom theme and set it up in the backend. Below are the theme specific files and I have kept some folders like web/css/source, web/fonts, web/images etc. empty, as I want those files to be called directly from parent theme.

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\registration.php:

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Vivek/Custom',
    __DIR__
);

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\theme.xml:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Custom</title> <!-- your theme's name -->
    <parent>Magento/luma</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
    <media>
        <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
    </media>
</theme>

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\Magento_Theme\layout\default_head_blocks.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/source/style.css" />
</head>

and

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\media\preview.jpg

which is copied from Luma Theme.

After setting this same theme from backend, everything else works fine with new theme on frontend, but some css & js files are not being called from the parent theme, which results in icons and logo not displaying at all in frontend Homepage, Product Listing page etc. Also the "Hot Sellers" products block from Homepage disappeared.

Any hints on what could be the issue and how to resolve this ?


texts:
I'm trying to add a custom category attribute to the category collection:

$product = Mage::getModel('catalog/product');
$product->setId($productId);
$categories = $product->getResource()
    ->getCategoryCollection($product)
    ->addAttributeToSelect('some_custom_attribute');

However, some_custom_attribute doesn't get included to the collection data:

[4] => array(11) {
["entity_id"] => string(4) "1164"
["entity_type_id"] => string(1) "3"
["attribute_set_id"] => string(1) "3"
["parent_id"] => string(4) "1151"
["created_at"] => string(19) "2015-04-14 06:19:05"
["updated_at"] => string(19) "2015-04-14 06:19:05"
["path"] => string(13) "1/2/1151/1164"
["position"] => string(1) "3"
["level"] => string(1) "3"
["children_count"] => string(1) "0"
["product_id"] => string(6) "106224"

How can I add the some_custom_attribute to the result?


texts:
I know we can get formated customer addresses by calling,

$data = $customer->getPrimaryBillingAddress()->getFormated();

Is there a similar way to get shipping address and billing address of a order as a string?

This gives me a error

$order->getBillingAddress()->getData()->getFormated()


texts:
I have a block which I can call by using the following in a CMS page's content:

{{block type="karl_catalog/supplier_product" supplier_id="1242" template="karl_catalog/supplier_product.phtml"}}

This gets a collection of products and spits them out of the page and is all working fine.

However, I am trying to use an observer to see when this is called as I need to add rel="next" and rel="prev" links to the header. I've tried using the controller_action_layout_generate_blocks_after observer, but I've been unable to find a way to determine if the block type matches the above block type (above).

$l = $observer->getEvent()->getLayout();
foreach ($l->getAllBlocks() as $block) {
    echo $block->getType();
}

The above code echo's the block types, but karl_catalog/supplier_product is not shown.

Any ideas how I can achieve this?


texts: I am using PayPal Express Checkout, i set "Skip Order Review Step" to "No" but its still redirecting user to PayPal Page after selecting PayPal as a payment Method and Skipping order Review step. it should redirect after complete 5th (Order Review) step.


texts: Parse Log - extract info from huge exception.log file

texts:
How can I have a list of exceptions from a exception.log file ?

Sometime this files are very big and the only way to analyze them is using Vim or similar cli tools.
I would like php approach (so platform independent)


texts:
I am trying to edit a simple static block in Magento 1.9.0.1.
The static block is the main page of the Ma-Cance theme.
When I try to add a

 to the static block, and add some content, then save it... it throws away the code I just added.

I have no clue why this is happening...

The webstore is on a local Xampp server.
I have cleared all Magento's general caches and all other cache options are turned off...

Does anyone know what is happening?

SIDE NOTE: I know how to code in the Wysiwyg editor by using the Show/Hide button

EDIT 1:
Turning off the Wysiwyg editor seems to give me back my code, but why doesn't it save the code when it is turned on by default?


texts: Assign custom CSS class to an HTML element in custom template

texts:
So I am overriding the cart template for bundle products. In short - there's this code in my styles.css:

.data-table tbody th,
.data-table tbody td {
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid #DDDDDD;
}

I changed the #DDDDDD to red just to be sure it's the correct one - it is. So I created another class underneath:

.bundle_option_cell {   vertical-align: middle;
      border: 0;
      border-bottom: 1px solid lime;
}

and assigned this to a <td> tag but the change is not applied. The original settings (from the first class) apply. How can I force my changes?


texts: Magento2: How to get guest email address in checkout?(PHP way)

texts:
I develop a gateway module for magento 2 and when a customer who complete the registration process - i can get his email by :

$quote->getCustomerEmail()

but when i try to get a Guest email - i get a NULL value. There is a "Magento 2 way" to get it?

Javascript solution allready found:
Magento2: How to get guest email address in checkout?


texts:
In CMS->page->Design->DesignXML

I add this:

<reference name="top.menu">
<action method="addLink" translate="label title" module="customer">
<label>Home</label>
<url></url>
<title>Home</title><prepare>true</prepare>
<urlParams/>
<position>5</position>
</action>
</reference>

This gives an error (because of the name="top.menu") but what would be the correct XML for the top menu (not the top.links)


texts: I want to hook controller_action_postdispatch whenever reload the page i get all the detail of that page

texts:
I'm new in Magento2 and I want to know the detail of controller_action_postdispatch events like controller Name, action name,module name and all the details related to that event. I have created an events.xml file where I called the event name then try to get the details from the observer. My question is how to get the details on that event?
I have found $this->_request->getControllerModule(); but I couldn't use \Magento\Framework\App\Request\Http $request in observer.

Is there any

Here is my events.xml code

<?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_postdispatch">
        <observer name="category" instance="Comlitix\ComlitixInfo\Observer\Category"/>
    </event>
</config>

Here is observer file

<?php

namespace Comlitix\ComlitixInfo\Observer;

use Magento\Framework\Event\Manager;

class Category implements \Magento\Framework\Event\ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        echo'Hello world';
        die;

    }
}


texts: We are thinking about using Magento for our small business.  For transactions, can we charge the end customer just like a regular physical merchant or do we have to go through any 3rd party sites using Magento to charge?


texts: Fatal error when accessing magento admin

texts:
I have Magento 1.9, If i try to access magento admin area by just putting the

URL: www.domain.com/admin

then i dont see login area but i just see this error:

Fatal error: Call to a member function getUser() on a non-object in /home/themename/public_html/app/code/core/Mage/Admin/Model/Observer.php on line 52

Do you know the fix of this?


texts: magento subdomain website $this->getRequest()->isPost() return blank in every form submission

texts:
I have magento website in domain and also in sub domain.

The domain website form work correctly i.e. $this->getRequest()->isPost() return true after form submission.

But the subdomain website form after submission $this->getRequest()->isPost() return false.

I also add the code : getFormKey(); ?>" />

after form tag then also it is not working.$this->getRequest()->isPost() return false.

Same code works in my local xampp server.

Please help me to solve this issue.


texts: Magento 2 - Layered navigation not shown if there is only category in categories filters

texts:
In Search page, when I query some string it does not show the layered navigation filters when resultant products set belong to one category. So I want to show that particular category in  categories filter because may be all products belong to one
category but they may belong to different sub categories and there is default pattern when you click on root category in categories filter it shows all subcategories in which resultant product set belongs.

The idea is to show either subcategories in category filter when there is one root category in which product belongs with already selected root category or just show that particular root category, when user click that particular root category it will show all related subcategory belongs to resultant products set.


texts: Can coupon code entered stay in step without refreshing page/going to cart?

texts:
Currently I have a working Coupon code section on the last step of my onepage checkout, but whenever entering a code, it reverts back to the cart page and applies the code.. but if its something like free shipping.. it will show the free shipping on the cart page, but then you are going through the checkout again and having to select a shipping option, thus removing the free shipping effect again.

I imagine the code that is bringing it back to the cart page is

<form id="discount-coupon-form" action="<?php echo $this->getUrl('checkout/cart/couponPost') ?>" method="post">

Namely, the 'checkout/cart/couponPost' action.

Is there anyway possible for the user to get to the review step, enter the code, and just possibly refresh that specific step? Thanks!


texts: How to save a custom field value in DB for add new customers in backend magento2.2.5?

texts:
I have created a module for adding a new field Store Number in Add new customers in magento backend.
But not able to save the field value in database.

Refer my screenshot.

Any help would be appreciated.


texts: Magento 2 developer mode failing to generate content

texts:
It seems my developer mode in magento 2 stopped working. The only thing that seems to be deployed properly by it is the _requiresjs directory. Nothing is however done for frontend, any ideas what might cause this?

It renders the page just fine except for lack of css, js and other things that should recide in pub/static/frontend. Running deploy static command do however work.

I am suspecting language settings but not sure if that is a red herring or not. Appreciate any input.


texts: How/where to add string in product details page media full screen in Magento 2?

texts:
How can we add text in product details page Full screen section as mentioned in the below image.

Help would be appreciated.


texts: Magento 2 - Fotorama Gallery Nav shaft is missing on product page

texts:
If you add multiple images to a product then they are showing below the base image in small boxes, see screenshot below (bottom corner - left):

This box is missing. First I thought it is because some change in my theme, so I temporarily changed to luma theme, but the images are still missing, so my custom theme is not the cause.
Is there a setting somewhere which is not set correctly?
I already tried:
grunt clean
php bin/magento catalog:image:resize
php bin/magento indexer:reindex
php bin/magento cache:flush

I am using Magento 2.4.2 Enterprise running in Developer Mode, hosted on a Linux Server (Rackspeed).


texts:
In Magento 2.3.3, there is a parameter added to some of the action items. For example, if we take the following from module-cms/Ui/Component/Listing/Column/PageActions.php
if (isset($item['page_id'])) {
                $item[$name]['edit'] = [
                    'href' => $this->urlBuilder->getUrl($this->editUrl, ['page_id' => $item['page_id']]),
                    'label' => __('Edit'),
                    '__disableTmpl' => true,
                ];

So, my question is that can anyone explain how is this __disableTmpl being implemented? I know there is a link regarding XSS mitigation in Magento at this, however, it does not really explain what's going behind.
Thanks


texts:
I am trying to access a class's method using Mage::getSingleton()

I have done the following:

<?php $allReviews = Mage::getSingleton('efkreports/product_allReviews')->getAllProductReviews(); ?>
<?php zend_debug::dump($allReviews); ?>

But this is giving me error:

  Fatal error: Call to a member function getAllProductReviews() on a non-object in C:\xampp\htdocs\efk\app\design\frontend\default\efk1\template\catalog\product\list\related.phtml on line 37

I even tried using:

<?php $allReviews = $this->Mage::getSingleton('efkreports/product_allReviews')->getAllProductReviews(); ?>

which is giving me same error..

Please help me in how to call a method through a class name..

EDIT:

Config.xml

<config>
    <modules>
        <Efk_Reports>
            <version>1.0.0.0</version>
        </Efk_Reports>
    </modules>
    <global>
        <blocks>
            <efkreports>
                <class>Efk_Reports_Block</class>
            </efkreports>
        </blocks>
    </global>
</config>

Class

//This class is for getting Best selling products list
class Efk_Reports_Block_Product_AllReviews extends Mage_Reports_Block_Product_Abstract
{
   public function getAllProductReviews(){
        //some calculations here

        return $_productCollection;
   }
}


texts: Magento 2. Displaying text on specific days and hours

texts:
I got the following piece of code to display specific content on specific days and on specific hours.

I created an static block and pasted the code there, and then called it on a .xml file in Magento, but the code is not showing. I expect that the code works as expected (so specific text showing on specific days and hours).

Does anyone know what I am still missing?

Thanks for your answers.

Specific text for Monday

Specific text for Tuesday

Specific text on Wednesday


texts: How do I change the default destination page when a customer logs in?

texts:
I'd like to create a link which allows a customer to log in before returning to the page they started on, not to the My Account page.

The link needs to work from any location in the site.

Mage_Customer_AccountController has a _loginPostRedirect() which does the redirecting based on a series of session variables (defaulting to the My Account page). Is there a clean, safe way for me to use one of these session variables (from every page) to make my link work as I'd like? Or is my only option to implement a rewrite for this method and change the call to $session->setBeforeAuthUrl(Mage::helper('customer')->getAccountUrl())?


texts: Magento 1.9 sendTransactional doesn't show value from {{var payment_html}}

texts:
I'm using sendTransactional() to send emails programmatically. All working fine beside the variable {{var payment_html}} is empty.

How to pass this value?

below is the code I'm using now.

private function dosend($order, $templateId)
{
    // Set sender information
    $senderName = Mage::getStoreConfig('trans_email/ident_general/name');
    $senderEmail = Mage::getStoreConfig('trans_email/ident_general/email');
    $sender = array(
        'name' => $senderName,
        'email' => $senderEmail
    );

    // Set recepient information
    $recepientEmail = $order->getCustomerEmail();
    $recepientName = $order->getCustomerFirstname();

    // Get Store ID
    $storeId = Mage::app()->getStore()->getId();

    $vars = array(
        'order' => $order,
    );

    $translate  = Mage::getSingleton('core/translate');
    // Send Transactional Email

    Mage::getModel('core/email_template')
        ->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
        ->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $storeId)
    ;

    $translate->setTranslateInline(true);
}


texts: Add require-js to child theme at theme level

texts:
I want to add bootstrap javascript to my child theme.

I have created app/design/frontend/<Vendor>/<theme>/requirejs-config.js

In that file I have placed:

var require = {
    shim : {
        "bootstrap" : { "deps" :['jquery'] }
    },
    paths: {
        "bootstrap" :  "//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min"
    }
};

This doesn't seem to do anything.  How do I add scripts properly in a child theme?


texts: Issue while generating db_schema file for existing module Magento 2.3.1

texts:
I have installed fresh Magento 2.2.6 and i have installed two custom modules.
Then i have upgraded the Magento Version to 2.3.1 now i am trying to generate db_schema file for those module using below command.
php bin/magento setup:install --convert-old-scripts=1

Error:

[Symfony\Component\Console\Exception\RuntimeException]
The "--convert-old-scripts" option does not exist.


texts:
I have this XML to set my image sizes for both related products and my catalog widget on my home page. The Related Products portion works but the home page one doesn't.

<media>
    <images module="Magento_Catalog">
        <image id="related_products_list" type="small_image">
            <width>222</width>
            <height>222</height>
        </image>
        <image id="category_page_grid" type="small_image">
            <width>222</width>
            <height>222</height>
        </image>
    </images>
</media>


texts:
I have PayPal express setup on my Magento 1.8 instance however I would like to pass additional information through to Paypal eg an account number.

Please could someone advise if this is possible


texts:
I want the VAT number filed on to present when i click the user to zero vat customer group.If click any other group i dont want to show the vat field.
Anyone has any idea how to fix this.

  /private/var/www/html/magento2/vendor/magento/module-customer/view/base/ui_component/customer_form.xml

this is the core file for this


texts: Inserting options to a Multi-Select product attribute in Magento 2 Programatically

texts:
I have figured out how to create an InstallData.php script for adding a custom multiselect product attribute as part of a custom module in Magento 2, but I'm not finding any examples of how I could also create some initial option values for the new attribute.

Does anyone have any examples of how to add options to my attribute in the InstallData.php script?


texts: Progammatically Save Order To Another Mage Install (local)

texts:
We have two Magento installs 1.8, one for our live site and another for "other" development. Both are on the same server, different folders dbs etc, basically identical, they have the same products, setup etc.

What we are looking for is a solution to replicating orders from one Mage website to the other.

We want our live Magento site to also save customer orders to the "other" Magento as well as its own. Sort of programmatically creating the same order in the other Magento.

That way we see the same orders in both sites. The live site and the "other".

What is your thoughts?


texts: Magento 1.9 - Create order using REST API

texts:
I want to create order in magento 1.9 using rest api, but i am unable to find any method to create order using rest api.
I can't find any help from the below link : http://devdocs.magento.com/guides/m1x/api/rest/introduction.html

Have any idea?


texts: Magento Difference between checkout cart and checkout session

texts:
Can anyone state what is the difference between

Mage::getSingleton('checkout/session');

and

Mage::getSingleton('checkout/cart');


texts: Magento 2: How to display configurable product options in list page

texts: How to Displaying configurable product options in the category list page?


texts: How to edit shipping address after click order in Magento 1

texts:
I want edit shipping address after create order on frontend in magento 1.

I used observer, it's ok, but i cann't set new shipping address

Ex: i want change firstname to "ABC"

$orderId = $observer->getEvent()->getOrder()->getData('entity_id');
$order = Mage::getModel('sales/order')->load($orderId);
$order->getShippingAddress()->addFirstname("Abd");
$order->save();

And i also try this code but it not working

$order = Mage::getModel('sales/order')->load($orderId);
$quote = Mage::getModel('sales/quote')->load($order->getQuoteId());
$billingAddress = $quote->getBillingAddress();
$billingAddress
            ->setFirstName($defaultBilling->getFirstName())
            ->setCountryId($defaultBilling->getCountryId())
            ->setPostcode($defaultBilling->getPostCode());
$quote->save();

It's not work, please help me


texts: magento 2 how can I overwrite ar_SA.xml language symbol file?

texts:
I want to overwrite this file in my module.

vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml

How can I archive this ?


texts:
I am resetting password in my magento site, After that i got a success message but i am not getting any mail for that account. How do i fix?

I already change customer.xml but it doesn't work

After rest my password my login page url like thisurl example


texts: Some products cant be added to cart since Magento2.3.3

texts:
We have upgraded Magento2.3.3, some products are throwing the error :

  Product that you are trying to add is not available.

I have looked online and saw something about a view called Inventory_stock_1, It exists already and I cannot figure out why my product wont add.

Here is an image of a list of products that wont add to cart (except the first one, that works)

Has anyone had this since the new update?


texts: How to get coupon times used with coupon code using REST Api?

texts:
I have no experience with Magento. I was asigned the task to validate a coupon code via magento rest api. I've tried to use /V1/coupons/search GET method. My request url is:

 https://example.com/index.php/rest/V1/coupons/search/?searchCriteria[filterGroups][0][filters][0][field]=code&searchCriteria[filterGroups][0][filters][0][value]=12345ABC&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

However, my java based server receives a 500 status response.

I've also tried to make a curl request like this:

  curl -X GET --header "Authorization: Bearer some-token-string"

https://example.com/index.php/rest/V1/coupons/search?searchCriteria[filterGroups][0][filters][0][field]=code&searchCriteria[filterGroups][0][filters][0][value]=1234ABC&searchCriteria[filter_groups][0][filters][0][condition_type]=eq"

However my console responds:

curl: (3) [globbing] error: bad range specification after pos 92

Any help would be much appreciated.
Thanks in advance!


texts: Why does the default Magento theme have /html subdirectory?

texts:
If you look at https://github.com/magento/magento2/tree/2.3-develop/app/code/Magento/Theme/view/frontend/templates , there's phtml templates in this folder, but also in a subfolder called /html

Looking at the code style, there doesn't appear to be any noticeable differences between the phtml files in templates and the ones in templates/html.

What's the point of this folder? When developing a theme, should we be using our own html subfolder and if so, what is supposed to go in it (other than overriding / extending the default Magento 2 phtml files for replacement)?


texts: Magento 2: Coupon code makes an order free

texts:
I have a Magento 2.3.1 that makes this problem:

I have a coupon code that makes 90 EUR discount defined as:

Add a product to cart of 70 EUR (below 90 EUR)
Goto to cart, apply the coupon code
Total is 0 in cart
Add another product of price 120 EUR
Cart total is 190 EUR (above 90 EUR)
I still get the total of 0 EUR in cart

Why is this?


texts:
When I attempt to change the checkout totals sort order in Magento 2 backend, I can press save, however the sort order doesn't seem changed from the magento 2 backend.

When I look in the database, the following appears:

    MariaDB [mag]> SELECT * FROM core_config_data WHERE path LIKE "%totals_sort%";
+-----------+---------+----------+-------------------------------+-------+
| config_id | scope   | scope_id | path                          | value |
+-----------+---------+----------+-------------------------------+-------+
|      1095 | default |        0 | sales/totals_sort/subtotal    | 1     |
|      1096 | default |        0 | sales/totals_sort/discount    | 2     |
|      1097 | default |        0 | sales/totals_sort/shipping    | 3     |
|      1098 | default |        0 | sales/totals_sort/tax         | 5     |
|      1099 | default |        0 | sales/totals_sort/weee        | 4     |
|      1100 | default |        0 | sales/totals_sort/grand_total | 6     |
+-----------+---------+----------+-------------------------------+-------+
6 rows in set (0.01 sec)

This does not correspond with the details shown in Magento 2 backend.

Subtotal
1

Discount
3

Shipping
2

Tax
5

Fixed Product Tax
4

Grand Total
6

The email hasn't changed either.
Does anyone have any idea?


texts: Display Stock and Out of Stock Products Category

texts:
I'm having problem on displaying products that are in stock and out of stock in category page.

Here's the screenshot of my category.

Those 6 products doesn't have any quantity, in short they're out of stock. But what I want to happen is, even though they're out of stock, I want it to display on the list.

I already did this one

  Login to Magento backend
  Take menu System-Configuration.
  Take inventory tab from the left panel
  Set Display out of stock products to ‘Yes’ in Stock options tab in the right panel

But still, it doesn't work. Here's my code for it.

<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>

And if I count the products

$_collectionSize = $_productCollection->count();
echo $_collectionSize;

The output is 0, any solution how to display the products even if they're out of stock?
So if I echo it, it should say 6.


texts: Magento (or Nginx) isn't including index.php for additional stores

texts:
Nginx & Magento CE 1.9.0.1

I created an additional store in a sub-directory (e.g. shoes.com/sneakers/). Every link in the main site - shoes.com - works. If I try to visit a CMS page of the shoes.com/sneakers/ site (e.g. privacy), I get a 404 from the main site - shoes.com. If I precede the URL of the CMS with index.php so that the entire URL looks something like shoes.com/sneakers/index.php/privacy it works however the Nginx configuration I'm using now is using and hiding the index.php in the URL for anything at shoes.com.

Is it possible that sub-directories are excluded from this directive or that through misconfiguration, it only applies to the main site?

Additional Information: I followed Magento's documentation to create a secondary store - copying index.php and .htacccess over, changing the $mageRunCode in index.php and creating symbolic links for the necessary folders. This is working locally on my MAMP environment but not on staging. I checked permissions and still no luck. It's loading Magento, the correct package but not the correct theme which I have double-checked in the admin panel.


texts: Magento 2: "Store credit" Rest API not working

texts:
I am use Store Credit Rest API. But it is gives error Request does not match any route

  Method: POST

  Request URL:
  http://localhost/magento/rest/V1/carts/mine/balance/apply

I am passing params cartId and creditAmount

Below is the response of the API.

Response:

{
    "message": "Request does not match any route.",
    "trace": null
}

Any have idea how to make work Store Credit Rest API.

Any help would be appropriated. Thanks.


texts:
My magento cron job is failing with the following error:

zend_mm_heap corrupted

I've spent some time googling the problem but am still at a complete loss.


texts: Extending Plugin Model - Magento + Wordpress

texts:
I haven't created a Magento module before and after a lot of research I attempted to create a module to insert wordpress avatars into blog posts inside Magento (I am using Fishpig).

Below I will list my folder structure and what I have in my files but I can't seem to get my custom module to work!

JUST TO NOTE: I am trying to extend "Fishpig_Wordpress_Model_User"

app/code/local/Splitpixel/Avatar/Fishpig/Wordpress/Model/User.php
app/code/local/Splitpixel/Avatar/etc/config.xml

app/etc/modules/Splitpixel_Avatar.xml

My Splitpixel_Avatar.xml:

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

            <!-- Whether our module is active: true or false -->
            <active>true</active>

            <!-- Which code pool to use: core, community or local -->
            <codePool>local</codePool>

        </Splitpixel_Avatar>
    </modules>
</config>

My config.xml:

> <?xml version="1.0" encoding="UTF-8"?> <config>
>     <modules>
>         <Splitpixel_Avatar>
>             <version>0.0.1</version>
>         </Splitpixel_Avatar>
>     </modules>
>     <global>
>         <models>
>             <fishpig>
>                     <wordpress>
>                             <rewrite>
>                                 <user>Splitpixel_Avatar_Fishpig_Wordpress_Model_User</user>
>                             </rewrite>
>                     </wordpress>
>             </fishpig>
>         </models>
>     </global> </config>

My app/code/local/Splitpixel/Avatar/Fishpig/Wordpress/Model/User.php:

> <?php
>
> class Splitpixel_Avatar_Fishpig_Wordpress_Model_User extends
> Fishpig_Wordpress_Model_User {
>     public function getUserAvatar(){
>         $imageSource = “”;
>         $avatarPostId = $this->getMetaValue(‘wp_user_avatar’);
>         $collection = Mage::getResourceModel(‘wordpress/post_collection’)->addPostTypeFilter(‘attachment’)->addFieldToFilter(‘ID’, $avatarPostId);
>         foreach($collection as $post){
>             if ($post->getId() == $avatarPostId){
>                 $imageSource =  $post->getData(‘guid’);
>                 return $imageSource;
>             }
>         }
>         return $imageSource;
>     } }
>
> ?>

And then finally I am trying to use the new function in "template/wordpress/post/meta.phtml" by using the following code:

>  ### WORKING CODE TO GET AUTHOR NAME ###
> $post->getAuthor()->getDisplayName()
>
>  ### MY CODE THAT DOESN'T WORK ###
> $post->getAuthor()->getUserAvatar()

The code pulls back nothing! Now it may be my code, but the most likely factor is that I have dome something wrong in my config.xml or folder sructure as this is all new to me!

Any help is REALLY appreciated, thanks!

EDIT: Posted same time as patch drop so got missed by most!


texts: Magento : Layered Navigation on CMS Page is Only Filtering by 'Default Category'

texts:
I have a CMS page which displays products filtered by attribute (using 'Product List Plus' Magento extension widget).

I am trying to get layered navigation to display on this CMS page to be able to filter these products.

I have used below code which causes the layered navigation to appear:

<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" template="catalog/layer/view.phtml" >
<block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
</block>
</reference>

However this is only filtering products in uncategorised 'Default Category'.

I would like to filter results by a specific category.

Any ideas how to do this?


texts:
On the magento back end under catalog>manage categories it will not show me the items in the categories. However when I go to catalog>manage products it does show me the products.

I have flushed and refreshed the cache as well as re indexing everything.


texts: Get current configurable Product id in Magento 2

texts:
If I have a configurable product and I select color red, then how can I get the id of that virtual product that has been selected?

I would need to do this each time when a new color is selected on the product page to get the id of the new selected virtual product.

Thanks!


texts: Javascript - Can't get 'getElementsByClassName' working

texts:
Im struggling to figure out why my code is not working.
Here is part of the JS:

function init() {
    var showMenu = document.getElementsByClassName('showMenu'),
        perspectiveWrapper = document.getElementById( 'perspective' ),
        container = perspectiveWrapper.querySelector( '.container' ),
        contentWrapper = container.querySelector( '.wrapper' );

    showMenu.addEventListener( clickevent, function( ev ) {
        ev.stopPropagation();
        ev.preventDefault();
        docscroll = scrollY();
        // change top of contentWrapper
        contentWrapper.style.top = docscroll * -1 + 'px';
        // mac chrome issue:
        document.body.scrollTop = document.documentElement.scrollTop = 0;
        // add modalview class
        classie.add( perspectiveWrapper, 'modalview' );
        // animate..
        setTimeout( function() { classie.add( perspectiveWrapper, 'animate' ); }, 25 );
    });

Here is part of the HTML:

Company

Company

For some reason when I load the page, I get this error:

TypeError: undefined is not a function (evaluating 'showMenu.addEventListener')

I don't understand this because if I change this line:

var showMenu = document.getElementsByClassName('showMenu'),

to:

var showMenu = document.getElementById( 'showMenu' ),

It does work!

Why won't the class selector work but the id one will?

Thanks.


texts:
I've installed a module and I need to get some value from frontend and pass it to a controller in my module.

is it a good practice to update in other module js files that are not created by me? and is it ok to call a controller in other module


texts: Magento 2 : Disable form submit button untill required fields are not filled

texts:
I want to disable submit button untill required form fields are filled. Once the fields are filled, enable the button.
Can someone please guide me?


texts: Magento 2 + Varnish + Apache + Nginx SSL - Nginx.conf error

texts:
Have just had a developer implement Varnish cache with SSL termination.

http:s// --> nginx(443) --> varnish(port 8081) --> apache(8080)

All pages on our site are working fine except the home page which is returning Server 500 error.

I believe its an Nginx.conf error. Can anyone spot what might be going wrong?

I am just guessing its something to do with the below line

return 301 https://www.ourdomain.co.uk$request_uri;

Full config below. Any help appreciated

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80;
        server_name  www.ourdomain.co.uk;
    #    include /etc/nginx/default.d/*.conf;
    #location / {
    #    proxy_pass http://ourIPaddress:8081;
    #    proxy_set_header Host $http_host;
    #    proxy_set_header X-Forwarded-Host $http_host;
    #    proxy_set_header X-Real-IP $remote_addr;
    #    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #    #proxy_set_header X-Forwarded-Proto https;
    #    #proxy_set_header X-Forwarded-Port 443;
    #}
    return 301 https://www.ourdomain.co.uk$request_uri;
    }

    server {
        listen       443 ssl http2;
        server_name  www.ourdomain.co.uk;
        ssl_certificate "/etc/letsencrypt/live/www.ourdomain.co.uk/fullchain.pem";
        ssl_certificate_key "/etc/letsencrypt/live/www.ourdomain.co.uk/privkey.pem";
    ssl_trusted_certificate "/etc/letsencrypt/live/www.ourdomain.co.uk/chain.pem";
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_ciphers HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers on;
        include /etc/nginx/default.d/*.conf;
    location / {
        proxy_pass http://ourIPaddress:8081;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        #proxy_set_header X-Forwarded-Proto https;
        #proxy_set_header X-Forwarded-Port 443;
    }
    }

}


texts:
I've noticed a couple of bugs with my Magento 2 installation.

When loading the home page or admin of my website, it seems to keep refreshing itself for a while and takes up to a minute to load. It doesn't appear to be a performance issue with my computer because Magento 1.9 runs smoothly.
When I clear the cache, all images, Javascript and CSS stop working. Running php bin/magento setup:static-content:deploy does restore the locations of these missing files but it sets incorrect file/directory permissions.

Am I doing something wrong here? I get similar problems when trying to run Magento 2 using XAMPP on my local machine.


texts: only show price inclusive VAT on product page

texts:
My regular prices are exclusive VAT.

Only on the product page I want to show exclusive VAT and inclusive VAT.

I tried to change it via:

  Stores->Configuration->Sales->Tax->Show product prices in catalog->inclusive
  and exclusive VAT

Then there are 2 problems:

It shows the inclusive and exclusive VAT price on the whole website but I only want to show it on the product page.
I want it to show the price exclusive VAT and on the bottom of this price the inclusive VAT price. Not otherwise.


texts: Add Cross Sell Block to Checkout Step Magento 2

texts:
I have added a checkout step to my store where i want cross sell products. I have this block that is on the cart page for cross sell products which i would like to add in however my step is just a html file.

                <block class="Magento\Checkout\Block\Cart\Crosssell" name="checkout.cart.crosssell" template="Magento_Catalog::product/list/items.phtml" after="-">
                    <arguments>
                        <argument name="type" xsi:type="string">crosssell</argument>
                    </arguments>
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="crosssell.product.addto" as="addto">
                        <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                               name="crosssell.product.addto.compare" as="compare"
                               template="Magento_Catalog::product/list/addto/compare.phtml"/>
                    </block>
                </block>

So as suggested i am going to create a controller for cross sell and then call this controller using ajax and place into my html with javascript.

<?php
namespace Harri\HelloWorld\Controller\Index;

use Magento\Framework\Controller\ResultFactory;

class Display extends \Magento\Framework\App\Action\Action
{
protected $resultPageFactory;

/**
 * Constructor
 *
 * @param \Magento\Framework\App\Action\Context  $context
 * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
 */
public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory

)
{
    $this->resultPageFactory = $resultPageFactory;
    $this->_resultFactory = $context->getResultFactory();
    parent::__construct($context);
}

/**
 * Execute view action
 *
 * @return \Magento\Framework\Controller\ResultInterface
 */
public function execute()
{
    $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
    return $resultLayout;
}
}

However i am currently having issues with the controller and rendering the block from xml. This needs to use below code to render the block however am not quite sure how to use it in the controller to generate my cross-sell block.

$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
return $resultLayout;

I can echo hello world out into my controller however cannot get my controller to render the block from the xml. Also having a lot of difficulty getting the controller to just be a blank layout with just my cross-sell block.

XML: (using a differnt block at present for testing as have not setup crosssell on this site i ma testing on)

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<container name="root" label="Root">
        <block class="Magento\Cms\Block\Block" name="homeslider">
                <arguments>
                    <argument name="block_id" xsi:type="string">homeslider</argument>
                </arguments>
            </block>
</container>

I have created a github with progress so far with following issues:

Block called from the controller redirects to controller page. Want to either have this redirect to cart when adding a product from controller or use ajax add to cart from checkout.
Checkout step shows both my step and the next step on same page and both highlighted when loading /checkout. I think this may be due to my module requiring dependency on magento_checkout however cant see in docs how to do this.
My other issue once this is all working is hiding the step if there are no cross sells or showing another block in place in this step. Will try and check weather this is empty before the checkout loads and disable the step in the js however worried about page speed with loading controller twice.


texts:
I am running magento 2.1.5 and every thing was working fine. Suddenly my CSS and Js files are not loading I am getting error

 http://mymagentourl.com/pub/static/version1491202457/frontend/Magento/luma/en_US/css/styles-m.css” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).

what is the meaning of was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).

I am running magento in nginx Web Server and my mode is production. I tried

remove Var/* folder
re deploy static content
remove cache
flush
cache

I am not able to understand why my css and js is not loading?


texts: Can we create copy of catalog->mange product grid in custom module with some additional column

texts:
Can we create  copy of existing catalog -> manage product grid in custom module and extends its functionality add some new column, remove some existing column.
Both manage product grid and copy of manage product grid will use same table in back end. This is for magento 1.9

If it is possible please give me some guideline.


texts: Issue in sharing customer accounts globally

texts:
We have a magento installation and three websites with one store and store view each.

mywebsite.com/
mywebsite.com/store2/
mywebsite.com/store3/

Each website have different currencies.
Share Customer Accounts is set to Global under System->CUSTOMERS->Customer Configuration->Account Sharing Options.

Now if a customer login at mywebsite.com/ and then go to other two websites he/she is logged in that website also, which is working as intended.

But if they login into mywebsite.com/store2/ or mywebsite.com/store3/, and then switch websites, they have to login again, why is this so?

Is this a bug? Or am I doing anything wrong?


texts: Add Category filter in best seller product Collection

texts:
I get best seller product for all category using below code

public function __construct(\Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $collectionFactory

) {
    $this->_collectionFactory = $collectionFactory;

 }

public function getBestSellerData()
{
    $collection = $this->_collectionFactory->create()->setModel(
        'Magento\Catalog\Model\Product'
    );

    return $collection;
}

How can i add category filter for collection.
in magento 1 we can do like that

$catNum = 7; //The number of the category you want to load
$category = Mage::getModel('catalog/category')->load($catNum);
$products = Mage::getResourceModel('reports/product_collection')
->addOrderedQty()
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addCategoryFilter($category);


texts: how to add custom ajax javascript to admin> product > add/edit >custom tabs like :price / general

texts:
i want to add custom javascript to admin> product > add/edit >custom tabs like :price / general

what i want that there will be one drop down attribute on change of which i want to use ajax to autofill value in below textbox

for that i will be using ajax call on change of main dropdown

how can i do this.

i thought adding custom js code for that page only .

how can i do this i want magento like ajax loader when drop down change ?...

any help please could not find any proper guide or link for such case


texts: Magento 2 Reindex error: snapshot in progress

texts:
I'm using Magento 2.3 with cloud ElasticSearch and sometimes reindex cron gives the following error

[2019-09-18 19:24:13] main.ERROR: Cron Job indexer_reindex_all_invalid has an error: {"error":{"root_cause":[{"type":"snapshot_in_progress_exception","reason":"Cannot delete indices that are being snapshotted: [[product_1_v1284]]. Try again after snapshot finishes or cancel the currently running snapshot."}],"type":"snapshot_in_progress_exception","reason":"Cannot delete indices that are being snapshotted: [[product_1_v1284]]. Try again after snapshot finishes or cancel the currently running snapshot."},"status":400}. Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":171966464,"emalloc_start":157486136} [] []

[2019-09-18 19:24:13] main.CRITICAL: {"error":{"root_cause":[{"type":"snapshot_in_progress_exception","reason":"Cannot delete indices that are being snapshotted: [[product_1_v1284]]. Try again after snapshot finishes or cancel the currently running snapshot."}],"type":"snapshot_in_progress_exception","reason":"Cannot delete indices that are being snapshotted: [[product_1_v1284]]. Try again after snapshot finishes or cancel the currently running snapshot."},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"snapshot_in_progress_exception\",\"reason\":\"Cannot delete indices that are being snapshotted: [[product_1_v1284]]. Try again after snapshot finishes or cancel the currently running snapshot.\"}],\"type\":\"snapshot_in_progress_exception\",\"reason\":\"Cannot delete indices that are being snapshotted: [[product_1_v1284]]. Try again after snapshot finishes or cancel the currently running snapshot.\"},\"status\":400} at /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:620)"} []

The error occurs when magento try to reindex during the snapshot of elasticsearch platform (once a day).

After this error some indexes are in suspended status and product categories on frontend became empty.

To unlock them I usually do a manual reset and reindex.

Is there a way to check with an ssh script if one or more indexes are suspended? If it is possible, I can create a script that automatically reset and reindex them when necessary.

Other ideas?


texts: Add new nation into nation's list in Magento 2.3.5

texts:
I want to add a new country Northern Ireland with the country code XI in Magento 2.3.5 Admin. any idea for this?
I already tried with this -

Add new country in default country dropdown in Magento 2.3.5

I found the same answer everywhere but it does not work for me so please help me with this.

if I want to update the data in "ICUDATA-region" so can it be
possible?


texts: how can I convert an attribute value of type date to php datetime object in Magento 1.9

texts:
I have created in the backend a product attribute called estimated_date and I would like to manipulate it in an observer for catalog_product_save_after.

So from my catalog/product model I would like to

read this saved date,
convert it to a DateTime object,
manipulate it (in my case add a few days based on conditions)
and then save it back to another Date attribute.

The value that I get in my observer's product is of the form 13/11/2019 in this case when using $product->getData('estimated_date') but I would like to use a safe way to detect the date format used to save the attribute.


texts: Difference between cron:run and setup:cron:run

texts:
It is documented to set up two cron jobs for Magento 2

*/1 * * * * /usr/bin/php /var/www/html/example/web/bin/magento cron:run
*/1 * * * * /usr/bin/php /var/www/html/example/web/bin/magento setup:cron:run

What is the difference between those both? Which one is responsible for the indexers?