texts: Magento 2 websites : BLOCK access from ALL & ALLOW access only from some countries?

texts:
There are many options and many articles, but

I want some advice for my particular setup from Pros who have more experience than I do.

On my VPS I have tree magento websites.

All websites have the same target countries.

The idea is to block ALL and allow access only from a few countries.

What would you recommend considering my current setup? see pix below

should I use plugins for each website?
do something in Varnish?
block using htaccess?
iptables?
webmin firewall setup?
something else?

also some automation is preferred, I do not want to manually update the country ips every week


texts: Magento2 - In eav_attribute_option_swatch table New option value not inserting

texts:
I have 400+ visualswatch options, whenever I add new one, It will insert in eav_attribute_option_value but the Admin value which is supposed to be inserted in eav_attribute_option_swatch is not being inserted, instead.
It will just update the last option before the new one.


texts: Disabling modules for frontend requests?

texts:
In order to increase performance for a site I'm looking to disable modules from being loaded only if it is a frontend request (i.e. not admin).

Has anyone had experience doing this, or have any suggestions on how to go about this?


texts: Magento 2 admin product custom option page add customer group dropdown

texts:
I want to add customer group dropdown on product custom option page.
the reason behind is to show the custom option based on the customer group in front-end.

how can i achieve the above functionality.
Here with i have attached the screen which is what i need

Kindly share your ideas and thoughts, thanks in advance for you support


texts: two div horizontally when one div is disable another should take the whole space 100% width in Magento 2

texts:
I have two div's horizontally in one div there is Instagram feed plugin and another is the newsletter, now when Instagram feed plugin is disabled then newsletter should come in the whole space in Magento 2.

as you can see in the image now when Instagram feed is disabled hello should take the whole space

code to set width

<link rel="stylesheet" type="text/css"
 href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/
 bootstrap.mi
 n.css">

hello

hello


texts:
I have setup the enviroment for Magento 2 development in clean Ubuntu 14.04 image. Installed Magento with no troubles, but I'm thinking if there is any way to configure Vagrant to improve page load speeds during development.

in my Vagrantfile, I've setup the synced_folders to my "global" coding directory. This way ALL magento files are synced via NFS.

config.vm.synced_folder "~/Code/", "/var/www",  type: "nfs"

Should I sync only app\code folder?


texts: How to create one step checkout page in magento 2?

texts:
I am creating checkout pages and after one step they are redirecting to another pages .

I want to handle all these steps on 1 pages like this

After completing and press continue, next step  should trigger on same page.

I just need  way to do that on same page. Any sort of help would be highly appreciated


texts:
In Magento 2.3.6 how can I hide Alt Text of the first image in fotorama image gallery?
I saw there is a setting for hiding caption trough /etc/view.xml but it applies on all images, I want to hide the first image only.


texts:
How to create a collection of all products that have attribute ABC?
Can someone please guide me as i am new to Magento?

Then I would like to link that collection to a custom static block using href link?
Please provide me step by step approach as i am a newbie.

Appreciate your help.


texts: M2 | sales email > customize price display > how to show only grand totals?

texts:
I'm trying to style Magento's transactional emails.
I already managed it to edit and style the item display and included the item picture, but i haven't found a solution to only display the grandTotal price including tax and style it.

Customizing items was quite easy by creating an own /email/items/order/default.phtml. but I couldn't find a file, which generates the price display.

My Magento skills are quite basic. I would be glad for any advice as detailed as possible.


texts:
Does  anyone know of a multiple table rate extension for Magento 2.0? Have used Webshopapps Premium Matrix Rates with Magento 1.9 and it was great but they are not making it available for 2.0.

I want to have 2 or 3 shipping choices and be able to specify an extra rate per unit of weight e.g. base price $2 plus $1 per extra 200g.


texts: How to add new address for a existing customer through REST API

texts:
I am facing one issue. Actually I have created first the customer profile using magento2 through REST API but now I am trying to add the address for this existing profile but unable to do it. My code is given below.

$ent_id=44;
$customerData = [
        'customer' => [
            'addresses' => [
                [
                    "customer_id"=>$ent_id,
                    "firstname"=> $first_name,
                    "lastname"=> $last_name,
                    "company"=> $company,
                    "street"=> [
                    $street
                    ],
                    "city"=> $city,
                    "postcode"=> $pin,
                    "country_id"=> $country_id,
                    "telephone"=> $mobile
                ]
            ]
        ]
    ];
    $requestUrl='http://magento-148486-425775.cloudwaysapps.com/index.php/rest/V1/customers/'.$ent_id;
    //echo $requestUrl;exit;
    $ch = curl_init();
    $ch = curl_init($requestUrl);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($customerData));
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));
    $result = curl_exec($ch);

    $result = json_decode($result, 1);
    print_r($result);exit;

Actually here the customer_id=44 which had created before for that customer I need to add address but it could not happen. Please help me to resolve this issue.


texts: How to make a product not visible in storefront

texts:
Current Magento Version: Magento EE 2.2.5

I have created a product in admin panel

I need that product not to display in storefront but I should be able to place an order for that product through API.

If I disable that product, it will not show up in storefront and also I will not be able to place order for that product through API too.

Is there any way to make a product only accessible only through API?

Thanks,
Sahana


texts: Not able to use virtualType as Action constructor argument

texts:
In short I seem unable to use a virtualType I created as an argument in my Action's contructor but everything works fine when using a concrete class instead.

Index.php (my action):

namespace Unit1\CustomConfig\Controller\Test;

use Magento\Framework\App\Action\Context;
use Magento\Framework\App\Action\Action;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action{
    private $customConfig;

    public function __construct(Context $context, \Unit1\CustomConfig\Model\Config $customConfig){
        $this->customConfig = $customConfig;
        return parent::__construct($context);
    }
}

My di.xml (Unit1/CustomConfig/etc/di.xml):

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager:etc/config.xsd">
    <virtualType name="Unit1\CustomConfig\Model\Config" type="Magento\Framework\Config\Data">
        <arguments>
            <argument name="reader" xsi:type="object">Unit1\CustomConfig\Model\Config\Reader</argument>
            <argument name="cacheId" xsi:type="string">welcome_messages</argument>
        </arguments>
    </virtualType>
    .......
</config>

I get the error:

  main.CRITICAL: Class Unit1\CustomConfig\Model\Config does not exist

  Class Unit1\CustomConfig\Controller\Test\Index\Interceptor generation
  error: The requested class did not generate properly, because the
  'generated' directory permission is read-only. If --- after running
  the 'bin/magento setup:di:compile' CLI command when the 'generated'
  directory permission is set to write --- the requested class did not
  generate properly, then you must add the generated class object to the
  signature of the related construct method, only. [ ] [ ]

The error has nothing to do with file permissions (I checked and confirmed - it generates all the other files and folders - just not this interceptor as it cannot find the Model\Config class).

The thing is I am really confused on why it cannot find the virtualType or am I understanding the virtual type wrong?

This is part of an excercise in Magento U and the exercise initially used a concrete class for Model\Config along with a type (instead of virtualType) in the di.xml. I saw that the concrete class didn't really do much so based on my understanding of virtualType I wanted to confirm that I could simply replace it. But it's not so. How come? This was the original excercise solution which works:

Config.php:

namespace Unit1\CustomConfig\Model;

use Magento\Framework\Config\ReaderInterface;
use Magento\Framework\Config\CacheInterface;

class Config extends \Magento\Framework\Config\Data {
    public function __construct(ReaderInterface $reader, CacheInterface $cache, $cacheId = ''){
        parent::__construct($reader, $cache, $cacheId);
    }
}

and the corresponding type in the di.xml:

<type name="Unit1\CustomConfig\Model\Config">
    <arguments>
        <argument name="reader" xsi:type="object">Unit1\CustomConfig\Model\Config\Reader</argument>
        <argument name="cacheId" xsi:type="string">welcome_messages</argument>
    </arguments>
</type>

That is all that has changed - Instead of a concrete class and a type in di.xml I just turned it into a virtual type. And once I change those back they work perfectly. But the virtualType does not work. Can someone explain to my why?

Thanks!


texts: How to create login management for custom entity in Magento 2

texts:
I would like to create  a sales rep custom entity.
and I do not want to use customers (create an attribute called customer type is sales rep or not ) achieve the functionality.
How to create custom session login?
Thanks in advance..!


texts: Automatically redirect when session times out?

texts:
Is there a way to redirect the user to some URL or route automatically once the session has timed out? I tried finding an event for that I can use, but it seems there is no such thing.

It would be ok if the redirect happens right after the next action the user takes. It would be perfect if it happens automatically without any user interaction.

Thanks!


texts: How to add a button in admin grid in magento 2

texts: I wish to add button field in layout grid(without using UI component), After adding button, also need to add click function to that field. Please provide me a solution to add button as a field in the grid.


texts: Magento "block within block" - trying to add newsletter and recently viewed block

texts:
our site uses 1 columns layout. But thought theme 2 columns are created.

question: I am trying to add the blocks product_viewed and newsletter in right column; but this is not working. Any idea why not?

Layout.xml contains some code to call a static cms/block 'shopper_custom_right'

<cms_page_view>
        <reference name="right">
                <block type="cms/block" name="shopper_custom_right">
                <action method="setBlockId"><block_id>shopper_custom_right</block_id></action>
                </block>
        </reference>
</cms_page_view>

shopper_custom_right contains

{{block type="cms/block" block_id="storereviews"}}
{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}
{{block type="cms/block" block_id="last_blogs_block"}}
{{block type="core/template" template="newsletter/subscribe.phtml"}}

As a result: storereviews and last_blogs_block are showing up, but product_viewed and newsletter are not showing ....

So I tried updating layout.xml and added :

<reference name="right">
    <remove name="right.poll" />
    <action method="unsetChild"><name>catalog.compare.sidebar</name></action>
    <!-- CUSTOM -->
    <!-- <action method="unsetChild"><name>right.reports.product.viewed</name></action> -->
    <action method="unsetChild"><name>right.reports.product.compared</name></action>

    <block type="newsletter/subscribe" name="right.newsletter" template="newsletter/subscribe.phtml" after="-" />
    <block type="reports/product_viewed" name="right.reports.product.viewed" template="reports/product_viewed.phtml" after="right.newsletter" />
</reference>

But still the two blocks are NOT showing up ..... now I don't know what could be causing this: any ideas?


texts: How "cms_block_store" and "cms_page_store" tables are working with Primary keys in Magento?

texts:
I have a general doubt in MySql foreign key constraints and Magento.
As per MySql, a table should have only one primary key for a table and a Primary key should contain unique values.
I checked in "cms_block_store" and "cms_page_store" Magento tables. In that, both table  block_id, page_id, and store_id columns are declared as foreign keys and at the same time mentioned as primary keys.
Here two primary keys declared in a table and
A foreign key cannot contain unique values but at the same time A primary key should contain unique values, but here the fields are working with the duplicate entries even the fields are mentioned as Primary keys.
Please check the attached screenshots:
"cms_block_store" table structure:

"cms_page_store" table structure:

Can someone help me to understand how working in Magento against MySql?


texts: Call to a member function setUrl() on a non-object after security patch SUPEE-8788. Please help me with this. Magestore Giftvoucher

texts:
class Magestore_Giftvoucher_Block_Product_Upload extends Mage_Adminhtml_Block_Media_Uploader
{

public function __construct()
{
    parent::__construct();
    $this->setId($this->getId() . '_Uploader');
    $this->setTemplate('');
    $this->getConfig()->setUrl($this->getUrl('giftvoucher/index/customUpload'));
    $this->getConfig()->setParams();
    $this->getConfig()->setFileField('image');
    $this->getConfig()->setFilters(array(
        'images' => array(
            'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png)'),
            'files' => array('*.gif', '*.jpg', '*.png')
        )
    ));
    $this->getConfig()->setWidth(32);
}

public function getDeleteButtonHtml()
{
    $this->setChild(
        'delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')
            ->addData(array(
                'id' => '{{id}}-delete',
                'class' => 'delete',
                'type' => 'button',
                'label' => Mage::helper('adminhtml')->__(''),
                'onclick' => $this->getJsObjectName() . '.removeFile(\'{{fileId}}\')',
                'style' => 'display:none'
            ))
    );
    return $this->getChildHtml('delete_button');
}

public function getDataMaxSize()
{
    $dataSize = Mage::helper('giftvoucher')->getInterfaceConfig('upload_max_size');
    if (is_nan($dataSize) || $dataSize <= 0) {
        $dataSize = 500;
    }
    return $dataSize . 'K';
}

}


texts: Add admin pagination with custom array of data?

texts:
I have an array with the structure like:

$list = array(
    '0' => array(
        'name' => 'First',
        'version' => '1',
    ),
    '1' => array(
        'name' => 'second',
        'version' => '2',
    ),
    '2' => array(
        'name' => 'third',
        'version' => '3',
    ),
    '3' => array(
        'name' => 'fourth',
        'version' => '4',
    ),
    ...So on...

I am showing this array data in custom html table using phtml file. Now, i want to add pagination and a search box with this table. What is the best way to do so in Magento 2.

Please Help..!!


texts: Is there a limit to the number of tier prices of a product?

texts:
I am using Magento 1.9.2.0.
I have many (35) customer groups because I want to set different discounts for each group. For each customer group there are a number of tier prices for a product. And here lies the problem:

You can't add more than 197 tier prices. They simply aren't saved. There is no error message or a warning. I created over 200 tier prices for different customer groups but after the product was altered and saved all tier prices above 197 were lost.
Also it isn't possible to edit the category or the meta tags with this many tier prices. The message with "product has been saved" appears but the entered values for the meta tags are lost. Only after I delete some tier prices to only have about 190, I can save changes in the meta tags and the category.

Has anybody expiriences the same issue?
What is the reason for this?
Does anybody know a workaround to add more tier prices?

I opened a ticket in the Magento bug tracking system but no reply as of now.


texts: Custom product collection on product page displays vertically (need it horizontally)

texts:
Please advise,
I have a custom block named "sizes" to display on product page collection of similar products with another sizes. It is located in app/design/frontend/default/my_theme/blocks/sizes.phtml

The code of sizes.phtml:

<?php
$product = Mage::registry('current_product');
$sizes = explode(',', $product->getData('sizes'));
if (strlen($product->getData('sizes')) > 0) {
    foreach ($sizes as $sku) {
        $sizes[] = trim($sku);
    }

    $linkedProducts = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect(array('name', 'product_url', 'small_image'))
        //->addFieldToFilter('is_active', 1)
        ->addAttributeToFilter('sku', array('in' => $sizes));
    ?>

Other Sizes

                <?php foreach ($linkedProducts as $linkedProduct): ?>

                            <div class="item-img" style="margin-right: 10px;" data-toggle="tooltip" data-original-title="<?php echo $this->htmlEscape($linkedProduct->getName()) ?>">
                                <a href="<?php echo $linkedProduct->getProductUrl(); ?>">
                                    <img
                                        src="<?php echo $this->helper('catalog/image')->init($linkedProduct, 'small_image')->resize(83, 83) ?>"
                                        alt="<?php echo $this->htmlEscape($linkedProduct->getName()) ?>"/>

                <?php endforeach; ?>

<?php } ?>

But instead of grid block in displaying like a list (see the screenshot)

What should I change to show it horizontally?
Many thanks for your help in advance!


texts: Magento 2 get current category Id using registry

texts: Any one know how I can get the category id using current category registry in Magento 2?


texts:
I have a custom phtml and block file. I have called the phtml page in my cms home page.I want to display the product image, name ,price.I have dispalyed the name and price.But Iam not able to display product image.The path of the image is getting as /T/G/TGM-35SD.jpg

This is my block function

public function getProductCollection()
        {
           $todayDate = date('Y-m-d');
           $limit = 5;
           $collection = $this->_productCollectionFactory->create();
           $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds());
           $collection->addAttributeToSelect('*');
           $collection->addAttributeToFilter(
                'news_from_date',
                [
                    'or' => [
                        0 => ['date' => true, 'to' => $todayDate],
                        1 => ['is' => new \Zend_Db_Expr('null')],
                    ]
                ])->addAttributeToFilter(
                [
                    ['attribute' => 'news_from_date', 'is' => new \Zend_Db_Expr('not null')],
                ]
            );
           $collection->getSelect()->orderRand()->limit($limit);

           return $collection;
        }

This is my phtml.

<?php

 $collection = $block->getProductCollection();?>

<?php $iterator = 1; ?>

<?php foreach($collection as $product){ ?>
<?php /* @escapeNotVerified */ echo($iterator++ == 1) ? '
' : '

' ?>

                    <?php
                    $productImage = $product->getImage();

                    ?>

                    <a href="<?php /* @escapeNotVerified */ //echo $product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
                        <?php //echo $productImage->toHtml(); ?>

                        <?php
                            $_productNameStripped = $product->getName();
                            echo $_productNameStripped;
                        ?>

                        <?php //echo $block->getReviewsSummaryHtml($_product, $templateType); ?>
                        <?php /* @escapeNotVerified */ echo $product->getPrice(); ?>
                        <?php //echo $block->getProductDetailsHtml($_product); ?>

                <?php echo($iterator == count($collection)+1) ? '
' : '' ?>
    <?php //echo $product->getName();echo '
';?>
    <?php //echo $product->getPrice();?>

    <?php } ?>

Please help.


texts: Hreflang php code for getstore instead of getwebsite

texts:
I am using the following code to generate the hreflang on my website:

<?php
$groupId = Mage::app()->getStore()->getGroupId();
$collection = Mage::getModel('core/store')->getCollection()->addFieldToFilter('group_id', $groupId);

foreach ($collection as $store) {
    echo '<link rel="alternate" href="' . preg_replace('/\?.*/', '', $store->getCurrentUrl()) . '" hreflang="' . $store->getCode() . '"/>' . "\n";
}
?>

This gives me the links exactly the way I want them but with the exception of 'default' store that appears as www.example.com/default/.

I would like to replace 'default' with 'en'. Is there a way to do it? I tried looking for the code but can't find it any where as most developers tend to use getWebsite instead of getstore. Would really appreciate if someone can help with the appropriate code in php that can be pasted in head.phtml.


texts: magento 2.3 use core tables to custom module grid

texts:
I have a custom module with a custom table and I've created a ui component grid to show its data in Magento backend. This works fine.

Now I need a second admin grid were to show a collection of order items. The problem is that I'm not able to populate the grid with the records from the sales_order_item table.

As a temporary workaround, I created a custom DataProvider to fetch the data from the order item collection interface but this way I had to rewrite all the filters and sorting methods. This way the second grid works as intended: it shows the filtered collection of order items correctly.

Still, I think it would be more efficient to just keep the original Magento functionality but I don't know how to bind the core sales order item table to my custom grid.

I simply tried to create a new Model/ResourceModel/Collection that links to the core table but that doesn't work, I get the error: "class xx/Grid/Collection does not exists". My code:

  Vendor/Module/Model/Name.php

namespace Vendor\Module\Model;

use Magento\Framework\Model\AbstractModel;
use Vendor\Module\Model\ResourceModel\Name as ResourceModel;

class Name extends AbstractModel
{

    protected function _construct()
    {
        parent::_construct();
        $this->_init(ResourceModel::class);
    }

}

  Vendor/Module/Model/ResourceModel/Name.php

<?php

namespace Vendor\Module\Model\ResourceModel;

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class Name extends AbstractDb
{
    const TABLENAME = "sales_order_item";
    const KEY_ID = 'item_id';

    protected function _construct()
    {
        $this->_init(self::TABLENAME, self::KEY_ID);
    }

}

  Vendor/Module/Model/ResourceModel/Name/Collection.php

<?php

namespace Vendor\Module\Model\ResourceModel\Name;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Vendor\Module\Model\Name as Model;
use Vendor\Module\Model\ResourceModel\Name as ResourceModel;

class Collection extends AbstractCollection
{
    protected function _construct()
    {
        $this->_init(Model::class, ResourceModel::class);
    }
}

  Vendor/Module/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Vendor\Module\Model\ResourceModel\Name\Grid\Collection">
        <arguments>
            <argument name="mainTable" xsi:type="string">sales_order_item</argument>
            <argument name="resourceModel" xsi:type="string">Vendor\Module\Model\ResourceModel\Name</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="vendor_module_name_listing_data_source" xsi:type="string">Vendor\Module\Model\ResourceModel\Name\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
</config>

As I said, this doesn't work, when I load the page I get the error "Class Vendor\Module\Model\ResourceModel\Name\Grid\Collection does not exist". So how can I link my custom grid to the core sales_order_item table?


texts:
simplexml_load_file($xmlFile)
this

  function working fine on local server but now loading xml on a live server


texts: Magento - Customer default address always taken instead of customer chosen address in checkout

texts:
I noticed that Magento saves the default address after placing an order from checkout page, even when customer choose other addresses rather than the default.

In other words, all orders have the default address as billing and shipping address (if customer have default address).

Is it a bug in Magento or I'm missing something here?


texts: Data migration tool installation getting killed in magento 2.3.3

texts:
I am trying to install a data migration tool in Magento 2.3.3. But it gets killed in between

./composer.json has been updated
 Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Killed

What can be the reason?
I tried through composer as well as GitHub


texts: Magento 2 - Extend table rates shipping methods

texts:
I've configured table rates with my custom rates from backend and it works fine. But I need to add two custom rules:

when a single product weight is higher than 25 kg the shipping cost increase by 8€.
If the product weight is higher than 50 kg the shipping costs have an increase of 8€ plus 0.26€ for each kg over the 50th kg (so for instance if the product weight is 51 kg the shipping costs have an increase of 8,26€, while if the product weight is 52 kg the shipping costs have an increase of 8,52€).

So I would like to extend the custom workflow of table rates calculation and add these rules. How I could do it?


texts: How can i add existing customer in BCC or CC while sending new customer account creation welcome email in magento2?

texts: How to add some existing customer's emails in BCC or CC in welcome emails  in magento2 ?


texts: RuntimeException When i Load Helper Class magento 2

texts:
Error When i load my Helper Class Magento2. it shows

1 exception(s): Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Wac\DropPin\Helper\Data

  app/code/Wac/DropPin/view/frontend/templates/cart/item/default.phtml

 echo $this->helper('Wac\DropPin\Helper\Data')->productWeight('Test');

  app/code/Wac/DropPin/Helper/Data.php

<?php
namespace Wac\DropPin\Helper;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
        protected $_productRepository;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Catalog\Model\ProductRepository $productRepository,
        array $data = []
    )
    {
        $this->_productRepository = $productRepository;
        parent::__construct($context, $data);
    }

    public function productWeight($id)
    {
        return $id;
    }

}


texts: magento2.2.3 site is blank after di compie

texts:
Can anyone help me how to resolve the below problem.

after di:compile command my site is blank in windows xampp server.

Thanks


texts:
In a ko template (abc.html) I have the following

.

I made sure that requirejs-config.js loaded the correct config

'a_script' : 'namespace/js/a_script'

and that "a_script.js" file exists. At runtime, abc.html gets loaded but the data-mage-init is not initialized or run.


texts:
On an installation of Magento 1.9.0.1, I've noticed that moving categories programmatically doesn't change the parent_id column in catalog_category_entity and can leave things broken.

Let's say that category 5555 has the path 1/5/123/987/5555 and you do this:

Mage::getModel('catalog/category')->load(5555)->move(123, 333)->save();

The path column is correctly updated, as is the catalog_category_product table. However, the parent_id column in catalog_category_entity remains set to 987 and is not changed to 123.

Simply changing the code to this fixes the problem:

Mage::getModel('catalog/category')->load(5555)->move(123, 333)->setParentId(123)->save();

Is this a bug in this version of Magento? It seems like the move() method should change the parent_id for me.


texts: Magento 2 : How to add address attribute in checkout new address form?

texts: I want to add some more field on checkout page new address form. For this I added some customer address attribute from script and assign that attribute in all form. But still its not coming in New address form on checkout.


texts: no warning message when using the same email to register account

texts:
I just found If I use the same email to create different account Magento would just reload the same page www.domainName.com/index.php/customer/account/create/. And there is no new account being created in the backend.

I found there should be something like a warning message saying "There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.'"

Allow duplicate E-mail for magento customer Registration

how do I fix this problem. thank you.


texts: How to get the price of all simple products assigned to configurable products in magento 2 listpage?

texts:
I referred the link :
stackexchange but I am not getting any results.
I have used following code in Magento_Catalog/templates/product/list.phtml

$configurableOptions = $_product->getConfigurableAttributesData();

    foreach ($configurableOptions['matrix'] as $option) {
       echo $option['price'];
    }

I got an error like :
Warning: Invalid argument supplied for foreach() in Magento_Catalog/templates/product/list.phtml


texts: Adding xml modification to Magento custom theme

texts:
I have custom theme for magento. I made some modification in local.xml file which works fine, but I would like to made modification who won't be overwrite after update.

I made a new xml file (mod.xml) and insert it to my theme layout folder - how to run it on site?

<?xml version="1.0"?>
<layout version="0.1.0">

<default>
    <!-- move the cookies info block from the bottom block to the top -->
    <reference name="before_body_end">
        <action method="unsetChild">
            <name>global_cookie_notice</name>
        </action>
    </reference>

    <reference name="after_body_start">
        <block type="page/html_cookieNotice" name="global_cookie_notice" as ="global_cookie_notice" template="page/html/cookienotice.phtml" before="-" />
    </reference>
</default>

</layout>

Thank for help.


texts:
I am trying to use Magento locally on Windows with PHP 7.

I have followed this guide.

  ***** Step By Step *****

  Download the latest Apache Version - Zip-File
  Copy Apache24 folder from Zip-File to your C: Drive
  Navigate into C:/Apache24/bin
  Open file --httpd-- with Rightclick -- Run as Administrator .
  Open Start-menu -- Type in : cmd -- Right Click -- Run as Administrator
  Type in CMD ---- cd /Apache24/bin --
  Type in -- httpd -k install -- leave CMD open
  Download !!THREAD SAFE!! Version of PHP
  Open PHP Zip-File
  Create folder --PHP-- in the C: Drive
  Copy Content of PHP Zip-File to C:/PHP/
  Go to C:/PHP
  Search for File with name: "php7apache2_2.dll" and copy the name !! File has other name if older PHP version was downloaded !!
  Go to C:/Apache24/conf
  Open File "httpd" with Editor
  Scroll to bottom and add the following Code: " LoadModule php7_module "C:/PHP/php7apache2_4"  AddHandler application/x-httpd-php
  .php  PHPIniDir C:/PHP " !! Change PHP Version 7 to the one that you
  have chosen !!
  Search for line " DirectoryIndex index.html " Change to: "DirectoryIndex index.php index.html"
  Save and close
  Go back to CMD and type in " httpd -k restart "
  Download MySQL
  Install MySQL with downloaded installer "Developer Default"
  During Installation choose ROOT Password and save it for later use
  Download phpMyAdmin
  Copy Folder in Zip File into C:/Apache24/htdocs
  Rename copied folder into "phpmyadmin"
  Navigate to C:/PHP
  Rename File "php.ini-production" to "php.ini"
  Open php.ini with Editor
  Search for Line "extension=php_mbstring.dll"
  Remove Semicolon ";" in front of "extension=php_mbstring.dll" and "extension=php_mysqli.dll"
  Save Exit
  Open CMD and Type in " httpd -k restart "
  FINISHED!

However Magento is not compatible with PHP 7.

So i guess I need to use a different PHP version, so I tried PHP 5.4 but got stuck. I think i need to change:

" LoadModule php7_module "C:/PHP/php7apache2_4"

But cannot find the equivelent to C:/PHP/php7apache2_4.


texts: Logging to custom file is not working from module helper

texts:
I wanted to wrap the logging functionality in my module helper.

I have defined Custom Logger as:

File: app/code/MagePsycho/CustomLogger/etc/di.xml

<?xml version="1.0"?>
<!--
/**
 * @category   MagePsycho
 * @package    MagePsycho_CustomLogger
 * @author     magepsycho@gmail.com
 * @website    http://www.magepsycho.com
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <virtualType name="MagePsychoCustomLogger" type="Magento\Framework\Logger\Monolog">
        <arguments>
            <argument name="handlers"  xsi:type="array">
                <item name="debug" xsi:type="object">MagePsycho\CustomLogger\Logger\Handler\Custom</item>
            </argument>
        </arguments>
    </virtualType>

    <!-- DI for Module Observer -->
    <type name="MagePsycho\CustomLogger\Observer\ControllerActionPredispatch">
        <arguments>
            <argument name="logger" xsi:type="object">MagePsychoCustomLogger</argument>
        </arguments>
    </type>

    <!-- DI for Module Helper -->
    <type name="MagePsycho\CustomLogger\Helper\Data">
        <arguments>
            <argument name="logger" xsi:type="object">MagePsychoCustomLogger</argument>
        </arguments>
    </type>

</config>

File: app/code/MagePsycho/CustomLogger/Helper/Data.php

<?php
namespace MagePsycho\CustomLogger\Helper;
/**
 * @category   MagePsycho
 * @package    MagePsycho_CustomLogger
 * @author     magepsycho@gmail.com
 * @website    http://www.magepsycho.com
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    protected $_logger;
    /**
     * @param \Magento\Framework\App\Helper\Context $context
     * @param \Psr\Log\LoggerInterface $logger
     * @param \Magento\Framework\Module\ModuleListInterface $moduleList
     */
    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Module\ModuleListInterface $moduleList
    ) {
        $this->_logger                  = $logger; //$context->getLogger();
        $this->_moduleList              = $moduleList;
        parent::__construct($context);
    }
    /**
     * Logging Utility
     *
     * @param $message
     * @param bool|false $useSeparator
     */
    public function log($message, $useSeparator = false)
    {
        //Even this is not working
        #$this->_logger->pushHandler( new \Monolog\Handler\StreamHandler( '/var/log/magepsycho_customlogger.log') );
        if ($useSeparator) {
            $this->_logger->addDebug(str_repeat('=', 100));
        }
        $this->_logger->addDebug($message);
    }
}

And trying to use as (from any observer, model, block classes)

/**
  * @var \MagePsycho\CustomLogger\Helper
  */
 protected $_helper;

 public function __construct(
     \MagePsycho\CustomLogger\Helper\Data $helper
 ) {
     $this->_helper          = $helper;
 }

And call it from any methods

$this->_helper->log('message to be logged...');

But this is always logging to var/log/debug.log file.
If I use directly use the logger as DI, it works. But I wanted the logging functionality via Helper class.
Any idea what am I doing wrong?

You can find the sample module that I am using for custom logger:
https://github.com/MagePsycho/magento2-custom-logger


texts: integrate WordPress functions into magento 2 store using WP-load function in magento root index.php

texts:
I have multi-site WordPRESS website. https://staging3.rocknetworks.com/. So, I need to include my WordPress header & footer in magento 2 (Fresh magento 2) https://staging3.rocknetworks.com/store2 website.
I have added the wp-load.php in magento 2 root index.php but it's not working for me. https://prnt.sc/uc0o22
Basically I need to  use wordpress functions in magento 2 template so that i can create use same layout like my WordPress.
On My live website in which I have setup magento 1 which is working fine. but it's not working for magento 2.


texts: Magento 2 Specify target store in .xml files (default.xml, di.xml)

texts:
The title kind of says it all, just to be a bit more specific:

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

    <!-- **** if store == my-special-case-store  -->
    <preference for="Magento\Catalog\Block\Product\View\Options" type="MyPackage\MyModule\Block\Options"/>
    <!-- endif -->

</config>

also if I wanted to do the same with "view/frontend/layout/default.xml"
how do I accomplish this?

I'm just looking for directions here.


texts: Magento2 How to Update product price by website or store id

texts:
I try to programmatically update product price for different website in magento2.

This blow code is working but It will update main website price only, I need to update different website price using different website id.

<?php
error_reporting(1);
ini_set('max_execution_time', 0);
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$state = $objectManager->get('\Magento\Framework\App\State');
$state->setAreaCode('frontend');
$product_id = 7878;
$price = "3.99";
$productFactory = $objectManager-
>get('\Magento\Catalog\Model\ProductFactory');
$product = $productFactory->create()->load($product_id);
$product->setPrice($price);
$product->save();
?>

How can I load website?


texts: How to enable or disable footer link in magento2.1 with helper function dynamically from xml based on my own config value?

texts:
I have my own contact us module in magento.I want to remove default contact us link from footer and add my own link.
I  have remove default contact page link and add my own link.
I want that when my module is disabled then default contactus link will not remove from footer.

<referenceBlock name="contact-us-link" remove="true"/>

<referenceBlock name="footer_links">
    <block class="Magento\Framework\View\Element\Html\Link\Current" name="contact-us-link2" ifconfig="contactus/active_display/enabled_contactus">
        <arguments>
            <argument name="label" xsi:type="string">Contact Us2</argument>
            <argument name="path" xsi:type="string">contactus/front/index</argument>
        </arguments>

    </block>
</referenceBlock>


texts: running setup:upgrade causes an error from a disabled module

texts:
When I run bin/magento setup:upgrade I get this error:

Source class "\WeltPixel\Backend\Model" for "WeltPixel\Backend\Model\Logger" generation does not exist.

[RuntimeException]
Source class "\WeltPixel\Backend\Model" for "WeltPixel\Backend\Model\Logger" generation does not exist.

We have recently uninstalled the Pearl theme from Weltpixel and all of their modules (including Backend).  Why would magento (2.2.4) still call the Weltpixel backend after it has been disabled using the bin/magento module:disable command?  Is there anything I can do to recover this?


texts: How Importing Images with Labels using addImageToMediaGallery in magento2?

texts:
Magento2.1.x

I had a problem adding a product Image Label programatically. Here's the code I used:

    $imageLabel1 = 'Test1';
    $imageLabel2 = 'Test2';
    $imageLabel3 = 'Test3';
    $product->setMediaGallery (array('images'=>array (), 'values'=>array ()))
            ->addImageToMediaGallery('/test1.jpg', array('image'), false, false);
            ->addImageToMediaGallery('/test2.jpg', array('thumbnail'), false, false);
            ->addImageToMediaGallery('/test3.jpg', array('small_image'), false, false);

Where i can set $imageLabel1 - 2 - 3?


texts: I am having a terrible time sending emails to our distributors on orders placed. Order confirmations go to customer. Shipping confirmations go to customer. No new order confirmations go to warehouse for distribution. Can anyone help with the issue?


texts: Display product on checkout/cart when empty

texts:
I would like to display products on site.com/checkout/cart when there are no items in the cart because a lot or visitors click the cart button without having a product in there.

The current code of the noItem.phtml looks like this:

<?php echo $this->__('Shopping Cart is Empty') ?>

    <?php echo $this->getMessagesBlock()->toHtml() ?>
    <?php echo $this->getChildHtml('checkout_cart_empty_widget'); ?>

<?php echo $this->__('You have no items in your shopping cart.') ?>

<?php echo $this->__('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    <?php echo $this->getChildHtml('shopping.cart.table.after'); ?>


texts: Why I'm getting a HTTP ERROR 500 in Godaddy Server?

texts:
Firstly This is not a duplicate!

Tried All possible things given on StackOverflow and magento.stackexchange for this but none of it solved my issue.

Getting HTTP 500 error when accessing register page and when accessing checkout page.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 3097 bytes) in /home/site/public_html/app/code/core/Mage/Core/Model/Email/Template/Abstract.php on line 98

Checked throttling checked php.ini , checked .htaccess for memory things and all.
Checked config file.


texts: 20% OFF all items in category B & Cart Subtotal must be greater than or equal to $200

texts:
I would like to create a promo code that discounts all skus in category b
However customers must have $200 or more in their cart in order for code to work.


texts: error Command "buildpack" not found : m2 PWA

texts:
I'm trying to setup PWA in ubuntu system as showing in this reference link: magento PWA
At this step yarn buildpack create-custom-origin packages/venia-concept i'm getting this error:
yarn run v1.22.4
error Command "buildpack" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Thanks.


texts: Magento 2 Update URL key with SQL update

texts:
Is there any way to update URL Keys with SQL? I have thousants of wrong URL keys.
If not any other solution?


texts: Magento 2 : BreadCrumbs and Page Title not Display on Custom Page

texts:
I used this blog for add custom collection on my custom page with layered navigation. But, there are not display breadcrumbs and page title using this below blog.

How to add it?

  https://webkul.com/blog/how-to-create-layered-navigation-on-custom-page-in-magento-2/

Please help me.

Thanks.


texts: How to change dynamic attributes when simple product is selected

texts:
Here is my problem.

I have a Magento website (CE 1.9.2.1) selling radiators. Each radiator is available in various sizes and the heat output etc is different for each size. When a size is selected via the configurable product I would like to show certain attributes for this size (simple product) in the description area.

I have a module setup (Best4Mage Configurable Products Simple Prices) that changes the description when a simple (size) is selected. I have edited my description.phtml code to the below (which includes a single attribute currently) but when the description changes (upon selection of a specific size) the attributes disappear:

$product_id = Mage::registry('current_product')->getId();
$_product=Mage::getModel('catalog/product')->load($product_id);
$attribute = $_product->getResource()->getAttribute('reina_type');
if ($attribute)
{
    echo $attribute_value = $attribute ->getFrontend()->getValue($_product);
}
?>

getProduct()->getDescription(); ?>

    __('Product Information') ?>

        helper('catalog/output')->productAttribute($this->getProduct(), $_description, 'description') ?>
        Material: getAttributeText('reina_type'); ?>


texts: Magento 2 : "Invalid address id" when adding product to cart

texts:
When I add a product to the cart, it shows the error "Invalid address id".
How can I solve this issue?


texts: Custom module change `foreach` to chose what to display

texts:
I have a custom module for batch order in my magento application. I have created another store view and the batch order form will need to have different products in each store.

Here is part of the code that's responsible for the tabs is my order form. The content of the tab can be set in the admin panel.

Updated:

// Gets the block data.
$groups = $this->getGroups();
$mySelectedGroups = array('2', '4'); // this is the group entity_id from database

                    <?php
                    // Loops through the groups to get their name as nav heading.
                    // The first iteration will activate the tab for the first group.
                    $navI = 1;
                    foreach ($groups as $group) :
                        if (in_array($group, $mySelectedGroups))
                        if ($group->hasProducts()) { ?>
                            <li <?php if ($navI == 1) { ?> class="active" <?php } ?>>
                                <a href="#<?php echo $group->getId(); ?>"
                                   data-toggle="tab">
                                    <?php echo $group->getName(); ?>
                                    &nbsp;<i style="display: none;" class="text-danger error_glyph_<?php echo $group->getId(); ?> fa fa-exclamation-circle" aria-hidden="true">

                            <?php $navI++;
                        } endforeach; ?>

It pulls all the groups of products created in the admin. Can you tell me a way of calling them here 1 by 1 instead of bulk action?

I will then be able to set them manually for each store view.

Update:

That's the getData() for $groups:

It doesn't look like a normal array...

That's what the original looks like.

Here is the back end setting for it.


texts: How verify customer presence in database during the import

texts:
I've to import custumers from a txt file but I don't know what I have to use like univocal attribute to verify the customer presence into database.
For example, for the products import I use the sku attribute.

$product_model = mage::getModel('catalog/product');
                $productId = $product_model->getIdBySku($sku);
                if (!$productId){
                    // insert
                }else{
                   // update
                }

Can you help me, please?


texts: debugging magento line by line for understanding magento

texts:
I am new to magento. How could i debug line by line like other programming languages dot net.
I have tried with setting developer mode to true. but its shows only error.
I want to see line by line execution for better understanding magento and to see involved tables.

SetEnv MAGE_IS_DEVELOPER_MODE “true”


texts:
I can't enable Profiler on nginx. I have already added this line: set $MAGE_PROFILER html to file devmagento2.conf, but nothing was happened. I also have tried to add this line: $_SERVER['MAGE_PROFILER'] = 'html' to file index.php, with the same result.

Can you help me with this issue?


texts: Fatal Error Mediafallback.php on line 61

texts:
I am trying to add a configurable product on magento 1.9.1.0 and experiencing a fatal error

  Fatal error: Unsupported operand types in /public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php on line 61

Any suggestions how I can solve the problem?


texts: Magento2 - Change standard address format on Magento Frontend

texts:
I want to change Magento's standard address format to the one we use in the Netherlands.

For those who don't know the address format, it is the method in which we write the address. For example, the Dutch format is this:

Name
(Businesspark name etc.)
Street + number
Postal code + town
Country

The address format for the USA is this (Magento2 default):

Name of address
Street number and name
Name of town, State abbreviation + ZIP code
(typical handwritten format)

You can read more at wikipedia.


texts: Is there any one who can help me out to use pre-loader image in my magento website. please click http://www.sweetfrost.in


texts: How to resolve paypal (Website Payments Standard (Includes Express Checkout)) error in magento 1.9.1.0?

texts:
I have removed the Order review steps in Checkout page. After that PayPal payment has stopped working. Before the changes, PayPal was working fine.
Referred Url:-
https://bsscommerce.com/confluence/skip-order-review.html
I have updated the file by given step in above mentioned URL. It's working fine for bitpay payment.
Two kind of payment method having in onepage checkout.
1.Paypal
2.Bitpay
I tried to pay using PayPal it's getting shows alert box "true".

Paypal response:
success:false
error:    true
error_messages:   PayPal gateway has rejected request. Invalid token
(#10410: Invalid token)."


texts: Using custom Environment Variables for sensitive database info

texts:
I know Magento stores the database connection details within the 'local.xml' file, however our firm is trying to avoid passwords and other sensitive data being stored within our git repo's for security purposes.

I know you can create Environment Variables easily via an .htaccess file, but I'm hoping to find a workable solution that will enable me to set this database information dynamically from a environment variable.

As the local.xml is an XML file and as this is a non dynamic/server-side filetype we cannot use it to read environment variables.

Would there be a way to somehow add in some hook/custom behaviour to Magento in which I could replace the local.xml with a PHP file that will allow me to pull in these environment variables?

So in a sense, the local.XML would become a local.PHP file with the ability to read my own custom environment variables such 'DB_HOST', 'DB_USERNAME', 'DB_PASSWORD' rather than having them already set in the xml file as 'localhost', 'root', 'password123' etc..

Any ideas on how best to achieve this, or are there any existing Magento add-ons/extensions/mods that will allow me to do this?


texts: How to display various special "sale items" pages?

texts:
We have various sale products for limited times.

How best to display these so that it's easy to end old sales and start new ones?

I was thinking of creating a CMS Page "Sale Products."

If the CMS page includes layered navigation, then I could link to various sales by filtering by Manufacturer.

Suppose I have Acme Widgets in categories "Deluxe" and "Standard".
If Acme Widgets has a sale on deluxe widgets and standard widgets, and I want to have separate banners for each on the homepage, would it be possible to include the category as a layered navigation option inside the CMS page, so that I could directly link to filtered results by category?

Or would I have to rely on normal attributes?

Also, should I create a module to do this, or just write code inside of a custom CMS block in app/design/frontend/default/my_theme/template/cms/ ?

I will probably need a way of retrieving custom product collections based on sale prices, and cms might not be the right place to write that code.

Thanks


texts: Adding an attribute to customer order page on the backend

texts:
I want to add a custom attribute which i have already created to the order page in the back end. I have used this in my config.xml file to add the attribute to the customer account page, but I want to access the same field from the Order page.

<?xml version="1.0"?>
<config>
    <modules>
        <Shailendra_CustomField>
            <version>0.1.0</version>
        </Shailendra_CustomField>
    </modules>
    <frontend>
        <routers>
            <customfield>
                <use>standard</use>
                <args>
                    <module>Shailendra_CustomField</module>
                    <frontName>customfield</frontName>
                </args>
            </customfield>
        </routers>
        <layout>
            <updates>
                <customfield>
                    <file>customfield.xml</file>
                </customfield>
            </updates>
        </layout>
    </frontend>
    <admin>
        <routers>
            <customfield>
                <use>admin</use>
                <args>
                    <module>Shailendra_CustomField</module>
                    <frontName>customfield</frontName>
                </args>
            </customfield>
        </routers>
    </admin>
    <global>
     <fieldsets>
        <customer_account>
            <occupation>
                <to_quote>occupation</to_quote>
            </occupation>
        </customer_account>
      </fieldsets>
    </global>
    <global>
        <fieldsets>
            <customer_account>
                 <occupation><create>1</create><update>1</update><name>1</name></occupation>
            </customer_account>
        </fieldsets>
    </global>
    <global>
        <resources>
            <customfield_setup>
                <setup>
                    <module>Shailendra_CustomField</module>
                    <class>Mage_Customer_Model_Entity_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </customfield_setup>
            <customfield_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </customfield_write>
            <customfield_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </customfield_read>
        </resources>
    </global>
</config>

Would i have to just add something to this config file. If so what would i have to add.


texts: Magento 2.1.4 - List of products which have special price with widget conditions

texts:
I try to do a list of the products which have a special price defined. So I created a widget like that :

But even the products which have their "Date To" that is passed are shown.

Is it possible to add a condition which always takes the current date to filter these products?


texts: What is the purpose of set_order in Magento2?

texts:
I'm trying to add a new attribute set and I have this data:

$data = [
   'attribute_set_name' => 'Sample attribute set',
   'entity_type_id' => $entityTypeId,
   'sort_order' => 200,
];

Could someone explain what the sort_order means here? I just started to learn Magento 2, so it's a little confusing.


texts:
I migrate magento2 windows system to linux system with database. Home page of magento2 is working fine but other page is give error
404 not found. If I add index.php in frontend url then it's opening but without it not possible.
   And also magento admin is also not opening even after adding index.php in url.


texts: "is one of" condition in catalog price rules not working

texts:
In magento 1.9.1.0 "is one of" and "is not one of" conditions dont work in catalog price rules with multiple skus listed.

Condition sku is "xxx" works fine.  However, sku is one of "xxx", "yyy". Makes rule not work.  It is a confirmed bug from my previous research on the issue.  I'm looking for a local overide fix.

Does anyone know how to fix this?


texts: Changed attribute set name, now new products wont show up anymore

texts:
I've changed the standard product attribute set name to something else than Default. Than I noticed new products wont show up anymore (yes they are visible, in stock, emptied the cache and new index etc.).

So I changed it back to Default, when I saw you weren't allowed to change the attribute name. But it still doesn't work. What can I do?


texts: How Can I Set CategoryIds for a product?

texts:
I have a product and I want to set some attributes to it before saving.
So I have:

$newProduct = Mage::getModel('catalog/product');
$newProduct->setName($model->getDescription())
                            ->setName("aaaaa")
                            ->setCategoryIds(array(2));

$newProduct->save();

It saves the Name attribute, but CategoryIds doesn't get saved. Any ideas why?
I also tried:

                           ->setData('category_ids',2)


texts: Di.xml error Cannot instantiate interface

texts:
I am trying to use the di.xml to pull a table from different module to populate a dropdown in the admin panel. When I write the XML code below it is throwing this error:

  PHP Fatal error:  Uncaught Error: Cannot instantiate interface Symfony\Component                                                                                \Console\Output\OutputInterface in /var/www/vhosts/dev.vendor.com/vendor/magento/                                                                                framework/ObjectManager/Factory/AbstractFactory.php:116

<?xml version="1.0"?>
<!--
/** Grid di xml
 * @category  Vendor
 * @package   Vendor_namespacesearch
 * @author    Vendor
 * @copyright Copyright (c) 2010-2017 Vendor Software Private Limited (https://webkul.com)
 * @license   https://store.webkul.com/license.html
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Vendor\namespacesearch\Api\Data\GridInterface" type="Vendor\namespacesearch\Model\Grid" />

    <virtualType name="Vendor\namespacesearch\Model\ResourceModel\Grid\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">productcms_applicationsearch</argument>
            <argument name="resourceModel" xsi:type="string">Vendor\namespacesearch\Model\ResourceModel\Grid</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="namespacesearch_record_grid_list_data_source" xsi:type="string">Vendor\namespacesearch\Model\ResourceModel\Grid\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
    <type name="Vendor\namespacesearch\Logger\Handler">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Vendor\namespacesearch\Logger\Logger">
        <arguments>
            <argument name="name" xsi:type="string">customLogHandler</argument>
            <argument name="handlers"  xsi:type="array">
                <item name="system" xsi:type="object">Vendor\namespacesearch\Logger\Handler</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="namespaces_record_grid_list_data_source" xsi:type="string">Vendor\namespaces\Model\ResourceModel\Grid\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
    <type name="Vendor\namespaces\Model\ResourceModel\Grid\Grid\Collection">
        <arguments>
            <argument name="mainTable" xsi:type="string">productcms_application</argument>
            <argument name="eventPrefix" xsi:type="string">Vendor_namespacesearch_grid_collection</argument>
            <argument name="eventObject" xsi:type="string">Vendor_grid_collection</argument>
            <argument name="resourceModel" xsi:type="string">Vendor\namespaces\Model\ResourceModel\Grid</argument>
        </arguments>
    </type>
</config>

Thanks for the help


texts: Magento : Is there any way to stop to entered Dummy card details in Credit Card (saved) payment method?

texts:
Is there any way to stop to entered dummy card details like 4111111111111111 in Credit Card (saved) magento?

i just want to validate card details using savecc payment method.
Any idea please share.


texts: Is there a way to check a Magento 2.1.x DB health?

texts:
I have a server that is running a soon to be production site, and a dev site. The Dev site is a complete copy from production (db & files). The only things changed for the Dev was The DB name itself, the UID/PSW used to connect to the database, and the URLs within the database for the dev site.

However, I was installing an extension on both sites, and I started to get unexpected errors on the production site, that I didn't get on the Dev site.

Specifically errors stemming from the URI class.

To clarify, I installed the plugin on the Dev site, had a minor issue, and the developer of that extension patched the problem (a slight incompatibility with our theme).  I then, proceeded to replicate the installation and all steps in the production environment, and suddenly I was getting a URI class error

  (Expecting a string or a URI object, received
  "Magento\Framework\ObjectManager\ObjectManager), and then a (Object
  DOMDocument should be created) error.

I just want to check my tables for health and consistency to make sure nothing is slowly going wrong with them, but I'm not sure if there is a recommended check path for Magento 2.1+ ?


texts: magento 1.9 back-end settings area with error

texts:
good morning friends, i need urgent help, i'm desperate.
I was trying to correct a problem in the product evaluation form and tried to disable some non-native extensions on the backend to check for any conflicts.
After that, the settings page was completely blank.
follow the inage below
I'm not even able to invert the process because the modules I disabled, it doesn't appear for me to be able to enable them again.

In addition, it also affected the front end, without CSS and JS from the frontend.
I already cleared the cache, I tried to see the log, I tried to enable the modules via the app \ etc \ modules \ path, but nothing,
Could you tell me how I could solve this?
the version is 1.9


texts: Setting a unique home page for each store in Magento2

texts: How would I set a a unique home page per store in Magento 2? Is there a way to do this programmatically and in the admin panel as well?


texts: How to remove meta title from head in Magento 2?

texts:
I need to remove meta title from header in all pages.

<meta name="keywords" content="Oneplus One"/>
<meta name="robots" content="NOINDEX,NOFOLLOW"/>
<!-- I need to remove meta title -->
<meta name="title" content="Oneplus One"/>
<meta name="viewport" content="width=device-width/>
<meta name="format-detection" content="telephone=no"/>
<title>Oneplus One</title>

I have created module RemoveMetaTitle.

di.xml :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Page\Config">
        <plugin name="unsetMetaTitle" type="Vendor\RemoveMetaTitle\Plugin\PageConfig\UnsetMetaTitle" sortOrder="9999"/>
    </type>
</config>

Plugin/PageConfig/UnsetMetaTitle.php :

namespace Vendor\RemoveMetaTitle\Plugin\PageConfig;

class UnsetMetaTitle
{
    public function afterGetMetaTitle($subject, $return)
    {
        return '';
    }
}

afterGetMetaTitle seems to be not even executed.


texts:
I want to split an order after checkout into 2 sub orders, such as if 2 products are brought they should reflect as 2 sub-order's of a single order.

Thanks in advance.


texts: Import products and keeping the current id

texts: Has anyone tried importing products from another store and keeping the same ID? I'm not sure how to do identity inserts with Magento. I'm sure there has to be a way.


texts: PayPal gateway has rejected request. %1 in Magento 2.3.1

texts:
I am using Magento version 2.3.1

I have already check on magento.stackexchange.com but not getting exact answer to solve the issue

Its setup PayPal Express Checkout method with Sandbox yes test mode

when i have placed order from front-end so its redirecting paypal
so pay not on that

and after that getting error on review page
error is like that

  PayPal gateway has rejected request. %1

not getting error on specific error number like #10002

If anyone here help here, thanks in advance


texts:
Does Magento have the option without an extension to enable customers to leave order notes?  I am aware of gift messages functionality.  But have never located simple note functionality.

This is so the customer can leave order notes like "please call before processing" or "please do not include prices on invoice in box".


texts:
so I am trying to integrate a custom module we purchased into a theme (free one) that we downloaded, but I really am hitting it hard here. Let me provide URL's before I continue explaining:

[Theme] emthemes.com/responsive-magento-themes/em-titany.html
[Module] webtexsoftware.com/baby-gift-registry-magento-extension
[Module demo] 1.demo.webtexsoftware.com/

I am sorry I cannot provide full links, I need reputation to add more than 1.

So the problem is, that it appears the following module is designed to work with magento's default theme only, or at least that's what I think. At the demo page, you can see what is the end result. Link with javascript popup is automatically added into navigation (Baby registry).

Now, when I apply my custom theme to be loaded by default, everything works fine, except that I don't get to have my module's custom link. If I switch back to default theme, it all seems to be running smoothly.

Now, I want to say that I have little to no experience when it comes to magento development.

I've started reading lots of articles, and I've grasped a little how magento works, how configuration is being handled on load and so. There are some parts of the module that are being loaded correctly, but most of the files are just ignored, you can say. My guess would be, that my theme is overriding or like it's having higher priority to the module.

I'll provide part of the folder structure, because I believe it could come in handy for someone.

My module:

├── app
    │   ├── code
    │   │   └── local
    │   │       └── MagExt
    ├── design
    │   │   ├── adminhtml
    │   │   │   └── default
    │   │   │       └── default
    │   └── frontend
    │   │       └── default
    │   │           └── default
└── skin
└── frontend
    └── default
        └── default

My theme structure:

├── app/
    ├── design
        ├── frontend
            ├── default
                ├── em0121

Now as I already said, configuration seems to be loaded correctly, but still having problems. For instance, there is main configuration file placed in /layout/ which it seems to be working, since I am seeing the javascript and css files appended to my template, but the following line for example does not do anything:

<reference name="top.links">
        <action method="setTemplate"><template>sometemplate.phtml</template></action>
    </reference>

And other stuff like that.

My magento version is 1.9.1.0
My module is written to support multiple versions, and the one I'm using is also for 1.9.x

Any kind of advice or tutorials to read would be highly valuable. Thank you.


texts:
I know this has been asked a million times, but I can't find the right answer.

I have a Magento 1.9 on a shared server. Images keeps failing to show. I can change the folder permissions through FileZilla and the images shows up, but in the next product it is wrong again.
I can see that Magento is creating new folders with the permiision 750 and images with 640.

Can I change it somewhere so the permissions is right?


texts: Magento 2 How to add contact number field in sign up form?

texts:
I want to add only a telephone number add in register/sign up form....

So please help me....


texts: Magento 2 install extension, extension directory contains all the files without paths.

texts:
I bought extension and have it downloaded. However, it's not something I was expecting.

The directory contains all the files of the module right in the first directory after unpacking. So it's like magenest-module-worldpay-and-subscriptions-2.0.0 > [Module files].

How do I install the extension? I can't drop the files to the root...

Using Magento ver. 2.1.8


texts: Magento2: Add new Field in Cart page and Save in order?

texts:
I want to Add new Field "Remark"  in Cart Items Page.
it is a purpose to  "Remark" for product.
When i save cart(Update cart) it will be saved in Quote items table. also "Procced To checkout" It will be saved in order detials.
Also view in admin side


texts: Sort collection on labels of multi-select attribute values

texts:
I found this sollution for filtering multiple multi-select attribute values.

$data = THE ARRAY OF THE CHECKBOX VALUES;

$filter = array();
foreach ($data as $value) {
    $filter[] = array(
        'attribute' => $attribute->getAttributeCode(),
        'finset'    => $value
    );
}

if (count($filter) > 0) {
    $collection->addAttributeToFilter($filter);
}

I need to filter the output alphabetically. For example my attribute looks like this:

Label     Value
apple     1051
banana    1052
pear      1053
melon     1054

and I want to sort it not on values but on labels.


texts: How to upgrade Magento 2.3.3 to Magento 2.4?


texts: Newsletter Signup Block Not Displaying Correctly

texts:
Can any one help correct what I think is a coding issue. I have taken the code for the Magento inbuilt newletter subscription block and used it to create a widget so I can place a further newsletter signup option at the top of my home page.

However, in the image below you can see that it is not displaying correctly and is showing some of the code on the front end.

This is the code I have used;

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>

    <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail">

            <?php echo $this->__('Sign up') ?>

                <input type="text" name="email" id="newsletter" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Sign up for our newsletter')) ?>" class="input-text required-entry validate-email" />

            <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Subscribe')) ?>" class="button btn-inline"><?php echo $this->__('Subscribe') ?></button>

    </form>

Can anyone advise how I rectify this please?

Thank you


texts:
I want to add a table here

Like the one in customer -> edit. I figured out how to create it (in system.xml):

<system>
<tab id="example_tab" sortOrder="10">
    MYModule
</tab>

    Example config section
    <tab>example_tab</tab>

    <resource>MYModule_SendCoupon::config</resource>

    <group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
        Partner Informations

        <field id="name" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
            Name
            <validate>required-entry validate-number</validate>
        </field>

    </group>

This is what I want


texts: getting error in while running Cutom admin controller URL in magento 2

texts:
Getting below error -

  Recoverable Error: Argument 1 passed to
  namespace\Modulename\Controller\Adminhtml\Blacklist\Index::__construct()
  must be an instance of Magento\Backend\App\Action\Context, instance of
  Magento\Framework\ObjectManager\ObjectManager given, called in
  /home/mage2demo/public_html/mage21new/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php
  on line 93 and defined in
  /home/mage2demo/public_html/mage21new/app/code/Namespace\Modulename/Controller/Adminhtml/Blacklist/index.php
  on line 13

here is the code -

namespace Mynamespace\Modulename\Controller\Adminhtml\ModuleDirectoryname;

use \Magento\Backend\App\Action;
use \Magento\Backend\App\Action\Context;

class Index extends Action
{
    protected $helper;
    protected $context;

    public function __construct(
        Context $context,
        \VT\Blacklist\Helper\Data $helper
    ) {
        $this->viewHelper = $viewHelper;
        parent::__construct($context);
    }

    public function execute()
    {
        echo "hello"; die;
    }
}


texts: Magento1 get all attributes like in admin backend

texts:
We are bulding a new M2 Shop and I need to get all Attributes from our M1.4.1.1 using SQL. The Attribute Options are no problem.

So far I found this code which works great but it only has a few values.

select * from eav_attribute where entity_type_id IN (select entity_type_id from eav_entity_type where entity_type_code = 'catalog_product')

It seams that the "Shop Options" (maybe wrong translation) are missing like (Use in Quick search, Use in Advanced Search, Comparable in Shop, use in Filternav, Use for promo...) M2 has simular options which are called "Storefront Properties".


texts:
I created a custom credit card payment method. I tried to implement an error message when there's an error during checkout due to invalid inputs in payment method's credit card form. Sample error:

My problem is when I tried to update the payment form with the correct value, checkout data being sent is still the old one and not the updated one. Any idea on how refresh the payment method data during place order?


texts: Recently I removed a module but after removing still the module is displayed in module list and exist in magento.core_resource table , any one can help me .How I remove the module completely


texts: Magento2 - Not able to refresh the cache from admin

texts:
I experiencing for quite some time.
While I can clear the cache from console, but from admin when I hit refresh, the cache is still showing as invalidated.
when I navigate to other page - it says for example two cache is refreshed. but when I check the cache page - it still shows invalidated.

I tried changing permission for var directory to 755 from 777 and back with no luck.
the directory ownership is fine and owned by the web-user.


texts: What is the difference between inventory_source_item and inventory_stock_x?

texts:
With Magento's new multi-source inventory system, various new tables have been introduced into the database.

inventory_source_item contains the machine name of the source, SKU, quantity, and the status.

inventory_stock_x is a table that exists for each source, containing the SKU, quantity, and if it's salable.

Why does the second table exist, when the first could store all of that information?


texts: Custom Helper issue with fopen and fwrite

texts:
I am currently working on a custom extension to provide server-side LESS compiling (beyond what the current offerings are) for Magento 1x installs. I have the extension 99% done with the exception of the minifier. Here is my code to minify:

            if ($minify == 1) {
            // minify the css file list
            $temp = "";
            $cssFileContent = array();
            foreach ($cssFileList as $cssFile) {
                $temp .= file_get_contents($cssFile);
                $temp = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $temp);
                $temp = str_replace(': ', ':', $temp);
                $temp = str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $temp);
                ob_start("ob_gzhandler");
                header("Content-type: text/css");
                $cssFileContent[] = array('filename' => $cssFile, 'content' => $temp);
                fclose($cssFile);
            }
            foreach ($cssFileContent as $fileContent) {
                fopen($fileContent['filename'], 'wb');
                fwrite($fileContent['filename'], $fileContent['content']);
                fclose($fileContent)['filename'];
            }
        }

This is being executed by an observer using a helper function. $CssFileList contains a list of CSS file names. As you can see, I am getting the contents and running some minification replaces and saving the filename and content data to an array. I then run a second foreach, open each file, attempt to write the content, and then close. (I had this entire action as one foreach initially, but while debugging the issue I am having I split them into two separate loops.)

The issue I am having is with fopen and fwrite. Per PHP documentation, fopen should open the file. If it isn't there, it creates it. Using the 'w' option truncates the data, and I use 'b' because I am on a Windows machine (using XAMPP).

If I run the code above as-is, it finds the files and truncates them (0 bytes). That's it. I thought maybe something was up with fwrite not working, so since fwrite cannot create a file itself, I tested it by manually deleting a file in $CssFileList and then commenting out fopen. fwrite() works flawlessly and minifies the code for the file as expected.

Why are fopen() and fwrite() not working together in this loop? I also tried to use the file_put_contents() method and instead of truncating and then adding the current loop iteration's content, it is actually adding the content from the last loop iteration along with the current content. (This makes the last file huge because it has all the content from the files before it.)

Help?


texts: Magento 2.1.10: Sort by Special Price doesn't working

texts:
I'm working on category page, and try to sort the products collection by Special Price.
I've override setCollection() of \Magento\Catalog\Block\Product\ProductList\Toolbar

And the result is the only sort for Normal price (not including Special Price):

So my solution is Left Join with catalog_product_entity_decimal table (this table is using for store Special Price, also store Normal Price as well, 149.0000 is normal price, and 120.0000 is special price).

And I print the query, and got this:

SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `catalog_product_entity_decimal`.`value` AS `special_price` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='127'
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 LEFT JOIN `catalog_product_entity_decimal` ON e.entity_id = catalog_product_entity_decimal.entity_id WHERE (attribute_id = 78 or attribute_id = 77) AND (catalog_product_entity_decimal.store_id = 0) GROUP BY `entity_id` ORDER BY `special_price` desc, `price` desc

But with this, the GROUP BY affected before ORDER BY, and ruin my result.
Its remove the 120.0000 and only show the 149.0000 in query result

If I remove the GROUP BY, it will show both, but the Magento code will error with "Already exists Entity Id".

If there is any way to make GROUP BY go after ORDER BY? Or better way to solve the problems? Thanks.


texts: SOAP/XML-RPC Admin Role in Magento Enterprise?

texts:
I can´t find the SOAP/XML-RPC Admin/User creation.
Is that already available in EE 1.7.1 or did this come later?

Can I use the SOAP API instead for these things or is this not possible?

I would need it for the Trustpilot Integration.


texts: Importing Products in csv file - empty columns

texts:
I am currently adding all my products into a csv file ready to import into my store. To get the template i exported my existing products and am using that csv as the template which contains every single column.

I have a lot of empty columns such as...

custom_design_from
manufacturer
minimal_price
msrp
special_price

etc..

Do i need to include these empty columns? If i remove them will that mess up my import?


texts: Magento url key has strange numbers added by the system Magento 1.7.0.2

texts:
I've been pulling my hairs to figure out what's going on with my Magento store (1.7.0.2 version). 80% url-keys are appended with strange numbers in two different forms. Some are like this http://www.example.com/product-name-2886-351.html, random numbers assigned after my dress style numbers, but these randomly-assigned numbers are not changing after added by the system.

Another version URL with strange numbers are like this: http://www.example.com/product-name-2926.html. Notice the style number "2926" is assigned by the system. "2886" was originally input on the URL key section when we added this product.

Some SEO people told me it's because we uploaded the CSV again and again without truncating the url_rewrite table, so it created the duplicate version of products. That's why Magento does this to differentiate products. We uploaded CSV many times at the initial stage but there are some products are not affected by this. I'm not technical at all. I'm very confused by all this, but I don't quite believe this is the reason happening here.

After reading some threads, I know there are some real experts out there. Could you please help? If we upgrade to Magento 1.8, would this problem go away?


texts: Currency symbol is missing when switching

texts:
I am using Magento version 2.2.0
URL: http://www.hit-counts.com/vinca/
The currency symbol ($),(SAR) is missing when switch the English store to Arabic store. I removed the code as well from this root path but nothing changed.

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

<numbers>
    <currencyFormats numberSystem="latn">
        <currencyFormatLength>
            <currencyFormat type="standard">
                <pattern>¤#0.00</pattern>
            </currencyFormat>
        </currencyFormatLength>
    </currencyFormats>
</numbers>


texts: When i hide one item (anyone) in checkout_index_index.xml payment method doesn't work , Magento 2

texts:
When  I hide one item (anyone) in checkout_index_index.xml payment method doesn't work, thanks for help.

For example.

<item name="postcode" xsi:type="array">
   <!-- post-code field has custom UI component -->
   <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
   <item name="visible" xsi:type="boolean">false</item>
   <item name="validation" xsi:type="array">
       <item name="required-entry" xsi:type="boolean">true</item>
   </item>
</item>

and result:


texts: Error Message: the State and Province are not entered

texts:
The error message I'm getting is:

  the State and Province are not entered.

This error occurs in Customer View at checkout when you're trying to purchase a product.

It happens both when you're entering billing address and different shipping address.

I am using Magento Version 1.9.0.1


texts: Request parameters to filter SQL query using session

texts:
I want to filter the Coupon Usage table based on the request parameter passed in querystring.

http://localhost/magento2.4/admin/dev_grid/index/index/key/34c2c2b9b61b0cd82f9ed3218fec5f633c713730495d99f2743c7f87522f7890/?param_1=2

This param is dynamic and based upon the param_1 value, I want to filter out the table records.
Right now, I am using a plugin afterGetSearchResult in order to join the table as well as use the where clause.
If I put a static value in where clause, it works but if I use $this->request->getParams()['param_1'], it fails.
Although I can see the output in the console that the params are fetching.
This problem is exactly similar to the link below and he solved it using the session variable but he has not mentioned how he did it.
Magento2 filter not working for request parameter for order grid


texts: Can you achieve zero downtime deployment with magento2?

texts:
If you have a new module and you need to run setup:upgrade then I don't see a way where you can have zero downtime. It's always going to be 10-20 seconds down because you need to upgrade the database. Or am I missing something?

Even if you're deploying to a different folder and then when all files are generated you symlink the live environment to this folder, you still have to take care of the database.


texts: How to add custom options for categories product sorting in magento admin

texts:
I need to add options to sort by bestseller products/top rated in productsDisplay Settings' tab for categories so that we can choose the default sorting option for each category from admin panel. I want to be able to configure this option for individual categories through the backend

I have followed many tutorials to override the getAttributeUsedForSortByArray() menthod in config.php but options are not displaying in drop-down in admin panel.

Is there any way to have the 'bestseller' and 'top rated' options added to the 'Default Product Listing Sort By" dropdown under display settings tab for categories.

Any help would be greatly appreciated!


texts: Magento 2.2.5. What would be the correct way to update a price based on tier pricing

texts: Is there a way to update the product price based on user selection when I have enabled tier pricing in a product? For example, in the below image, if the user enters 5 in the Qty box, the price gets updated with the correct price, ie. 180.00.


texts: How to get the session from Magento 2.1.9

texts:
I am not able to get the session from Magento 2.1.9.

How to get it for the integration of Magento with SAP?


texts: Magento + ElasticSearch not showing search results

texts:
Before I enabled ElasticSearch the search bar would give me a list of categories, products, and blog posts that matched. And when I hit enter the search results page would contain the matching products.

After I enabled ElasticSearch the search term suggestions show, but the results page contains no products. Oddly if I do an "advanced search" (/catalogsearch/advanced) I do get the results I would expect.

I'm using Magento 2.3.4 with ElasticSearch 6.8.7.

I've done the following on my test server to try to diagnose the problem:

Configured and setup ElasticSearch.
Configured Magento according to the Magento documentation, I get the "Successful! Test Again?" button
Run bin/magento indexer:reindex
Installed kibana to make sure I can see and search the data in ElasticSearch, I can.
Switched to the luma theme to eliminate the theme as the issue.
Checked log files for new error message (error, exception, system). No messages were generated doing searches besides access log messages.

If anyone has any suggestions or advice I'd greatly appreciate it.

Thanks,
Brian


texts: Magento 2 getting wrong order and order id when select ship to multiple address

texts:
I am using Magento 2.2.4, my problem is:
I am using 2 events one page checkout success and sales order place after.
In my controller I am getting order id from customer session using
$orderIncrementId = $this->checkoutSession->getLastRealOrderId();
Now when the flow goes with one page checkout everything works fine.
But when I select ship to multiple addresses, event I used to get order id is sales order place after.
The Id is random id from previous order.
Also no payment details present in order collection


texts: How to create page in customer account section Magento 2

texts:
I want to create new page and link to => HISTORY
how i can do this??
where I can add a new link?


texts: Customer session loggedIn() not working Magento 2

texts:
I have to check whether a customer is logged in or not.
It only works for My account page and for the rest of the pages, it gives a null result. It was working before.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
$customerSession->isLoggedIn();

This code only works for My Account page, and for all other pages, it gives the empty result.

I tried this in my header.phtml as I need loggedIn condition in my header.phtml but it doesn't work.

 $om = \Magento\Framework\App\ObjectManager::getInstance();
 $context = $om->get('Magento\Framework\App\Http\Context');
 $isLoggedIn = $context->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);

Still, this doesn't work in my header.phtml

What the issue, how to resolve it.


texts: "Unique constraint violation found" in frontend, but no trace in expection.log

texts:
I am pretty new to Magento and made a copy of my a production webshop for testing purposes on our server. The website looks to be working fine, but somehow I keep getting "Unique constraint violation found" errors in the frontend whenever I try to add a product to the cart.

The strange thing is there is no stack trace whatsoever in my exception.log

I am completely lost as to where I should even start debugging this. Does anyone have a hint for me? Can somebody help me get this error logged?


texts: Catalogsearch super sub categories products search not working

texts:
I tried a lot, but I can't find a solution. In catalogsearch only showing the selected category product, it's not showing the subcategory of the selected category. I tried a lot of suggestion on google. but it wouldn't help me to out.

https://stackoverflow.com/questions/9468059/magento-filter-product-collection-by-multiple-categories

Catalogsearch category filter not listing certain sub-sub categories


texts: How to get a list of all products without images in Magento 2?

texts: Is there a way of seeing a list of all the visible products on the fronted that do not have images linked to them.


texts: I have update the quantity and change Stock Availability to instock but quantity not updated. It displayed product saved, but quantity not updated.


texts: How would it be possible to change the color for a url that is a Custom Variable inserted in a transactional e-mail?

texts:
Here is the custom variable:
CUSTOMER SUPPORT
It gets a default color: #aaa; and I cannot manage to find where is that color set from in order to change it.
I managed to override the text color by adding code in the "Template Styles" section of the e-mail template, and it looks fine in the Preview, but when I test it with gmail.com and hotmail.com, it displays with the default color.
Unfortunately, it is not an option to add an inline style directly to the variable and neither is it an option to have an inline style directly in the email template.
I am not sure what to do, I've been working with Magento2.3 for a couple of months now and my CSS and HTML knowledge and google only got me so far.
Could anyone please suggest where might I find a way to edit the color either of the links in e-mail templates or of the links in custom variables?


texts: How to create observer to change order status after it was created?

texts:
I am creating a custom payment method.

Before calling the payment gateway, I am calling PlaceOrderAction javascript function in mypay-method.js. that way, order is created in Processing status.

placeOrder = placeOrderAction(this.getData(), false, this.messageContainer);

The fact is that I need the order to be created with Payment Pending status, so, I have to change order status accordingly after it was created.

How can I do it?


texts:
I'm building a store using Magento CMS. It was all working fine, however a bit slow and so I decided to take some steps to optimize the store.

The first one was the minify of the files. However, when I did this the store broke and I can not roll back because the dashboard also does not work. When I click the links on the sidebar they do not point anywhere.

Thank you very much in advance. Need help.


texts: How to display search results sorted by categories

texts:
I need to sort my search results by product categories.

If I have Product A and Product B in Category A
And I have Product C and Product D in Category B

If all products are available in search result, I want to show them like,

  Product A, Product B, Product C, Product D

I want to put same category products with each other on results page.

Currently It is showing as

  Product A, Product C, Product B, Product D

I have tried this but its not working.


texts: Variable which will tell how much amount remaining to achieve free shipping?

texts: How can I get this ,  Only x amount remaining to get free shipping ? Is there any functionality available ? As My site will give free shipping above 50$


texts: Magento 2 : How to Set Category to Show 5 Columns

texts: The default number is 4, so I want to change (using XML like Magento 1) to 5 or more products per row.


texts:
We need a simple way to add an attribute to a customer record that is not editable by the customer or admin, only programatically. Essentially, we have an ExpressionEngine site coupled with Magento.

We authenticate via webservice and would like to store some JSON that we get back from the authentication into the customer's record and update it each time they login.

We will also want the data modified if they change information in the checkout process, such as shipping address. We will then send the data back to our webservice as we currently do that with each order.

Is this difficult to do as we are now storing some JSON on each product using a custom attribute with MageWorx's Custom Options extension?

I used the Online Module Creator here http://www.silksoftware.com/magento-module-creator/ but am not sure how to modify or retrieve the value once the module is installed.

Where could I learn how to write an extension to do this?


texts: Magento GeoIp - Multiple Websites - Auto Redirection

texts:
Hi there just a quick question/advice about GeoIP redirection and Magento

I have a store that we currently run in the UK and ship only to UK addresses. We wish to start selling to the rest of Europe (Euros) so we need two website views as we want the to be processed in base currency but also because we want to set different pricing levels for Euros than GBP not just a conversion.

The client wants customers to be auto redirected to the region which they are from which is fairly straightforward. Using apache mod_geoip to accomplish.

However, I'm wondering what the advantages and disadvantages of auto redirecting customers in terms of seo?

Our current intended setup would be (all of these would be english, they don't want translations):

http://www.our-store.co.uk/ - English UK Store - GBP
http://www.our-store.co.uk/eu/ - English European Store - Euros

My argument is that if it's auto redirecting, then in seo terms that doesn't seem like a good idea to me as if the search engine trawling the site is viewing from a specific region then it would only be able to see one instance of the website?

However, the client doesn't want people from other regions to see prices from opposing regions because they would be alot higher for one region than another hence the want for autoredirection...

Does anyone have any advice on how I should go about this?

Thanks in advance


texts: Magento 2 reload stock status of configurable product

texts:
I've been trying to understand the "On stock" issue on the product page for a few days now.
Unfortunately, with the standard installation some things work differently than expected.

Why does the stock status not change when an attribute of a configurable product is changed?

Is this a bug of Magento or is the behaviour so intended?

How can I reload stock status each time I click on a different attribute of the configurable product, so that the current stock status of each individual product is displayed?