texts: Review/Rating Spam Protection in Magento 2

texts:
I'm dealing right now with a common problem: Spam.

More exactly: Spam on my Magento 2.1.3 product reviews.

I'm trying to find solutions on how to avoid this problem. Right now any visitor can comment and review on my shop as a guest.

My approaches (that didn't help much so far):

/app/design/frontend/VendorName/ModuleName/Magento_Review/templates/form.phtml

Here i added some Javascript/jQuery + HTML:

An input field as a question like "7+8 = ?". If the user answers right "15" the review submit button will be enabled (which has been disabled before).
I've added ".. required />" to every input field.
I've created another input field. If you enter something there the whole review container will be removed by jQuery. So if any bot does automatically try to enter something it should get removed.

  => No success, still spam to see in Admin > Marketing > Reviews

Spam in Backend:

Looking at those spam-reviews there are two things that are strange:

The spam-reviews had been made on the same product all the time
The spam-reviews do not have any "star-rating" (1-5 stars) entered even if they are required in the form.phtml.

  Conclusion: These spammers must be bots that somehow ignore the
  required attributes and ignore the Javascript/jQuery code at frontend.

My Question: Do you have any creative ideas on how to deal with that? There aren't any extensions out there (niche alert !☺) to prevent this.. Maybe from server site? PHP? Please help!


texts: Toggle "required/not required" field in checkout

texts:
I have added a custom field in checkout called "Area". Area field is required by default, but I'd like to change that based on the selected country.

If customer selects a country other than FR, then Area field should become optional (not required).

Can you help me do that?

require([
    "jquery",
    "jquery/ui",
    "domReady!"
],
function($) {
    function load() {

        var country_select = $('div#shipping-new-address-form>div[name="shippingAddress.country_id"]>div.control>select.select');

        country_select.change(function () {
            var selected_country = $('div#shipping-new-address-form>div[name="shippingAddress.country_id"]>div.control>select.select :selected').val();

            if(selected_country == 'FR'){
                // make Area field required
            }else{
                // make Area field optional
            }

        });
    }
});


texts: Custom component with ability to add/remove items (see attachment)

texts: I was curious how I might be able to make a custom component like this in the Adminhtml area?


texts: How to create a custom theme for Admin Panel in magento 2?

texts:
I am trying to create a custom theme for admin panel in magento 2.3.0.
Below are the steps which i have followed:

1) Created a folder structure in

app/design/adminhtml/Vendor name/theme name

2) Added theme.xml and added below code:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Title</title>
    <parent>Magento/backend</parent>
</theme>

3) Added registration.php and added below code:

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/vendor name/theme name', __DIR__);

4) Added a module to change admin panel login logo:

  added Magento_Backend folder

  added layout folder

  added admin_login.xml and below code into it

   <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_image_src" xsi:type="string">images/Logo_Icon_Black.svg</argument>
            </arguments>
        </referenceBlock>
    </body>
 </page>

5) after creating above folders trying to run below commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

Still my changes are not getting relfected. Any help would be appreciated


texts: How we can enable maintenance mode of your Magento website?


texts: How to change text on cart / checkout buttons

texts:
I want to change the text on the buttons on my cart page

could some refer me to the correct file and the changes i need to make. I am happy with the style - its a simple change from 'card payment checkout' to 'secure checkout'

here's the info from inspect element of current buttons.

https://www.installaudio.co.uk/checkout/onepage/';">Card Payment Checkout

Card Payment Checkout

CSS path
body > div.wrapper > div > div.main-container.col1-layout > div > div > div > div.page-title.title-buttons > ul > li:nth-child(4) > button

help is much appreciated
Thanks


texts: I want to change the name of the Next button in checkout page. I am overriding the shipping.html file to change the name of next button but its not working even i have run deploy.


texts: Can I use same magento theme for different website?

texts: So i don't want to create multiple store but my 2 website will selling similar products. Can I use same magento theme for my two different websites?


texts: How to remove gap between banner slider and home page?

texts:
How to remove the gap between Banner slider and CMS home page (Magento 1.9) ?

I have installed Magestore Banner slider.

But by default, It is keeping space between Slider and my CMS home page.

Please suggest a solution to remove this space, And to join CMS home page and Banner slider.


texts: We now have 'code' on our frontend. See image. Please advise


texts: Magento2: How to add a payment method to admin create order?

texts:
I have an invoice payment method. The customer's call center should be able to create orders from backend and add this specific payment method to the order. The payment method is a gateway, which then creates the invoice to the finance company's system.

How do I implement this?


texts: Magento 2 - custom admin menu > access denied

texts:
i have this controller
News\LatestNews\Controller\Adminhtml\News.php
and if i comment this
protected function _isAllowed()
{

   // return $this->_authorization->isAllowed('News_LatestNews::manage_news');

}

the page shows access denied, but If turn it on,
it shows this error
1 exception(s):
Exception #0 (InvalidArgumentException): Boolean value is expected, supported values: array (
  0 => true,
  1 => 1,
  2 => 'true',
  3 => '1',
  4 => false,
  5 => 0,
  6 => 'false',
  7 => '0',
)

what is the problem?
how can i fix this?
newBieInMagentohere


texts: Add "from date" and "to date" in GROUP PRICE

texts:
we have a magento 1.7.0.2 and we use "group price" to set different price for registered user.
It works fine, but I would like to implement the "from date" and "to date" to automatically enable and disable promotions like special price.
I don't want to use catalogue rules because i've to menage all single product price.

Thanks


texts:
We are fetching information from database and displaying category ids, but we want to display category names instead of ids.

now in 2nd  dropdown box, instead of "category id" , we want to display  category names.

foreach ($categories as $category){
$cat_id = $category["category_id"];

full phtml

public function getOptions()
    {
       $resource = Mage::getSingleton('core/resource');

$readConnection = $resource->getConnection('core_read');

$writeConnection = $resource->getConnection('core_write');

$readConnection = $resource->getConnection('core_read');

$query = 'SELECT category_id, category_name FROM ' . $resource->getTableName('outthink_advance_brand_category');

$categories = $readConnection->fetchAll($query);

$brandsArr = array();

$brandSelect = '<select id="brand_select">';
$brandSelect .= '<option value="">My Brand</option>';
foreach ($categories as $category){
$cat_id = $category["category_id"];

$brandSelect .= "<option value='".$category["category_id"]."'>".$category["category_name"]."</option>";

$query = 'SELECT `outthink_advance_brand`.brand_id, `outthink_advance_brand`.originalcategory_id FROM `outthink_advance_brand` ';
$query .= ' inner join `outthink_advance_brand_category_item` on
(`outthink_advance_brand`.brand_id = `outthink_advance_brand_category_item`.brand_id )';
$query .= ' where `outthink_advance_brand_category_item`.category_id = '.$cat_id;

$brands = $readConnection->fetchAll($query);

$bArr = array();

foreach ($brands as $brand){
$bArr[$brand["brand_id"]] = $brand["originalcategory_id"];
}
$brandsArr[$cat_id] = $bArr;
}
$brandSelect .= '</select>';

return $brandSelect.'<select id="model_select"><option value="">My Model</option></select>';

    }
    public function getbrandsArr()
    {
        $resource = Mage::getSingleton('core/resource');

$readConnection = $resource->getConnection('core_read');

$writeConnection = $resource->getConnection('core_write');

$readConnection = $resource->getConnection('core_read');

$query = 'SELECT category_id, category_name FROM ' . $resource->getTableName('outthink_advance_brand_category');

$categories = $readConnection->fetchAll($query);

$brandsArr = array();

$brandSelect = '<select id="brand_select">';
$brandSelect .= '<option value="">My Brand</option>';
foreach ($categories as $category){
$cat_id = $category["category_id"];

$brandSelect .= "<option value='".$category["category_id"]."'>".$category["category_name"]."</option>";

$query = 'SELECT `outthink_advance_brand`.brand_id, `outthink_advance_brand`.originalcategory_id FROM `outthink_advance_brand` ';
$query .= ' inner join `outthink_advance_brand_category_item` on
(`outthink_advance_brand`.brand_id = `outthink_advance_brand_category_item`.brand_id )';
$query .= ' where `outthink_advance_brand_category_item`.category_id = '.$cat_id;

$brands = $readConnection->fetchAll($query);

$bArr = array();

foreach ($brands as $brand){
$bArr[$brand["brand_id"]] = $brand["originalcategory_id"];
}
$brandsArr[$cat_id] = $bArr;
}
     return $brandsArr;
    }
}


texts: Sort Magento 2 Category Products by Stock Quantity

texts:
I have a small "Problem" with Magento 2. In my Shop are "In Stock" and "Out of Stock" Items/Products. I am trying to find a Solution to Show first the Items/Products that are "In Stock" and at the last position on page the Items/Product "Out of Stock".

I find one Solution in the WEB but I am not understand how to Set it Up to function on my shop.

Here is the reference

Can somebody direct me in the right way, where I need to make this File, in which Folder?

Thank you in advanced


texts: Moving the displayed price to a different block

texts:
I'm trying to change the layout in a Magento template to have the price (and some other information) on a left column and the images/content of the product in the right.

my local.xml:

<catalog_product_view>
    <reference name="root">
        <action method="setTemplate">
            <template>page/2columns-left-special.phtml</template>
        </action>

    </reference>
    <reference name="leftprice">
        <block type="core/template" name="leftprice" template="catalog/product/leftprice.phtml" before="-"/>
    </reference>
</catalog_product_view>

This loads the correct template (2columns-left-special). In that template I've got this code:

<?php echo $this->getChildHtml('content') ?>
<?php echo $this->getChildHtml('leftprice') ?>

Content loads fine. Leftprice loads nothing.

There is a template file at

theme_name/template/catalog/product/leftprice.phtml

But this is ignored and doesn't show anything. What am I missing in the local.xml that tells Magento to load the proper template?


texts: Migration from 1.9.x to Magento 2.3.x issue

texts:
I try to migrate data from my old Magento store 1.9.3.10 to the new Magento 2.3.2 but when I run:

php bin/magento migrate:data --auto -r vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.10/config.xml

I have the following output:

[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: eav_attribute. Field: source_model. Error: Class ultramegamenu/category_attribute_source_dropdown_type is not mapped in record attribute_id=189
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: eav_attribute. Field: backend_model. Error: Class ultramegamenu/category_attribute_backend_grid_columns is not mapped in record attribute_id=191
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: eav_attribute. Field: source_model. Error: Class ultramegamenu/category_attribute_source_dropdown_columns is not mapped in record attribute_id=192
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: eav_attribute. Field: backend_model. Error: Class ultramegamenu/category_attribute_backend_dropdown_blocks is not mapped in record attribute_id=193
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: eav_attribute. Field: source_model. Error: Class ultramegamenu/category_attribute_source_categorylabel is not mapped in record attribute_id=194
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: eav_attribute. Field: source_model. Error: Class giftcard/adminhtml_system_config_source_giftcard_type is not mapped in record attribute_id=204
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: catalog_eav_attribute. Field: frontend_input_renderer. Error: Class ultramegamenu/category_attribute_helper_grid_columns is not mapped in record attribute_id=191
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: catalog_eav_attribute. Field: frontend_input_renderer. Error: Class ultramegamenu/category_attribute_helper_dropdown_blocks is not mapped in record attribute_id=193
[2019-07-01 08:39:17][WARNING]: Incompatibility in data. Source document: eav_entity_type. Field: entity_model. Error: Class xpayment-eav/xpayment is not mapped in record entity_type_id=9

What I can do?

Thank you


texts: Magento2 : Remove shipping charge and credit cart type and number from order invoice

texts:
I want to remove shipping charge and credit card type and credit card number from order invoice.

please check image:

I have overridden this core file

  vendor/magento/module-sales/Model/Order/Pdf/Invoice.php
  this file working fine.

But while overridding this file

  vendor/magento/module-sales/Model/Order/Pdf/AbstractPdf.php

I am not able to get any update of this file. I have commented some code from this file but not got any change.


texts:
How can I successfully update catalog Inventory Stock for a particular Item?

According to the API, this should be as simple as populating the properties and then making the call.

Dim objWS As MagentoService
Dim inventoryResult As Integer = objWS.catalogInventoryStockItemUpdate(
    sSessionId,
    sku,
    New catalogInventoryStockItemUpdateEntity With
        {.manage_stock = 1, .is_in_stock = 1, .qty = 1})

However investigating with fiddler reveals that the message sent over the wire doesn't contain all the information, but only the quantity like below.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <catalogInventoryStockItemUpdateRequestParam xmlns="urn:Magento">
            <sessionId xmlns="">62eee280a948d48b2f5c57efd4b5548f</sessionId>
            <productId xmlns="">4000</productId>
            <data xmlns="">
                <qty>1</qty>
            </data>
        </catalogInventoryStockItemUpdateRequestParam>
    </soap:Body>
</soap:Envelope>

Am I doing something wrong, Or is this a bug with Magento? There is a similar unanswered question on their official forums.


texts: Custom template file for specific category

texts:
I created custom attribute for category. How can I override default category template based on this custom attribute using observer?
What event should I look into?


texts:
I want to overwrite file design/frontend/base/default/catalog/product/view/addto.phtml in my custom module at path design/frontend/default/default/mymodule/catalog/product/view/addto.phtml

Here I am ading layout file

<catalog_product_view>
<reference name="product.info.addtocart">
    <action method="setTemplate">
        <template>wishlistnotification/catalog/product/view/addto.phtml</template>
    </action>
</reference>

Please help me on this.


texts: Correct way to use an array of SKUs to filter collection results in M2

texts:
Working with Magento EE v2.1.7.

I have an arbitrary array of SKUs that I wish to use to filter the products I'm returning on all category pages. I've created a custom module to generate this array dynamically based on business requirements. It can have one result or many results. Here is an example:

array("sku"=>"100010","sku"=>"100037","sku"=>"820654")

but I can also prep it for use with a collection:

array(
    array('attribute'=>'sku','eq'=>100010),
    array('attribute'=>'sku','eq'=>100037),
    array('attribute'=>'sku','eq'=>820654)
)

With this module I can pass the array anywhere its needed within Magento. While I can find many references to "adding attributes to filter" for Magento's collections, I'm not certain how to apply to ALL catalog results. From my understanding, it's possible to pass this information to the collection filter so that it tries each SKU with the OR operator in the query. The final result if I were using the sample array of 3 products above would be 3 product listings on the category page.

So do I need to interface with M2's object manager or is there a simpler yet acceptable way to present the filter data to the product collection? How would I begin to filter a catalog collection with these SKUs?


texts: The order of the digital contents stops at payment_review due to Redis issue

texts:
We have started selling the digital contents by the EC website that is created by Magento 2.4 on AWS (Multi-AZ) since a month ago.
However, it often stops the orders for the credit card in payment_review. The other payments such as Apple Pay are fine.
The symptom is as follows;

The problem occurs when Credit Card payment with 3D secure.
Rebooting Redis resolves the issue but it occurs after a day or a few days again. There is an extra free space in Redis.
"Did not write session for ID XXX: another process took the lock. /XXX/payment-information" sometimes occurs at the same time. (Where string XXX is a dummy string. Please ignore them.)  The parameters are max_concurrency=6,  break_after_frontend=5.

I would appreciate it if you inform me of any hints or suggestions.
2021/5/21
I would appreciate it if you could tell me any points to be careful of when we will change the value of break_after_frontend.
After the further investigation, we found that the process that process reads the session in Redis locks the session but another process has taken the session and locks the session after the break_after_frontend seconds passed. The original process failed to write the order_id into the session due to the lock by another process. Then the process has written "Did not write session for ID XXX: another process took the lock" in the log. After that the process has encountered 404 page not found error because it could not read the session data. Therefore we are thinking of changing the value of the break_after_frontend.


texts:
When I try generate products feed then I get error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.qty' in 'where clause', query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 1 LEFT JOIN `catalog_product_entity_int` AS `tbl_status_1` ON e.entity_id = tbl_status_1.entity_id AND tbl_status_1.attribute_id=94 LEFT JOIN `catalog_product_entity_int` AS `tbl_visibility_2` ON e.entity_id = tbl_visibility_2.entity_id AND tbl_visibility_2.attribute_id=96 LEFT JOIN `catalog_category_product` AS `tbl_category_ids_4` ON e.entity_id = tbl_category_ids_4.product_id WHERE (((tbl_status_1.value = '1') AND (tbl_visibility_2.value = '4') AND (e.qty >= '1

I try:

delete var/cache
indexer:reset
indexer:reindex

and also I try use flat product: no

reindex again

Still issue


texts: Shopping Cart Error Message - Show Remaining Quantity When Quantity Selected Exceeds Inventory

texts:
Whenever trying to add a quantity to the Magento cart that exceeds the quantity available, the guessing game begins with a message such as, "The requested quantity for 'SOME PRODUCT' is not available."

We want this message to actually show the available quantity.

Please provide the necessary changes in Magento to actually retrieve the available stock quantity and display this in the error message so the customer can change the quantity accordingly.


texts: Magento 2: js-translation.json 404 (Not Found) on production mode

texts:
After switching to the production mode, an error appeared in the console :

pub/static/adminhtml/Magento/backend/en_US/js-translation.json 404 (Not Found)
pub/static/adminhtml/Magento/backend/en_US/js-translation.json HTTP status: 404
    at XMLHttpRequest.xhr.onreadystatechange (text.min.js:8)

I was looking for a solution, I found such solutions:

bin/magento c:c
bin/magento c:f
rm -rf pub/static/*

and run

 php bin/magento setup:static-content:deploy en_US

or

 php -d memory_limit=4G bin/magento setup:static-content:deploy en_US

And I'm trying this :

  In vendor/magento/module-translation/Model/Json/PreProcessor.php

 $area = $this->areaList->getArea($areaCode);
 $area->load(\Magento\Framework\App\Area::PART_TRANSLATE);

needs to be:

$area = $this->areaList->getArea($areaCode);
$area->load(\Magento\Framework\App\Area::PART_DESIGN);
$area->load(\Magento\Framework\App\Area::PART_TRANSLATE);

But this did not help me, Magento still does not find the file :

pub/static/adminhtml/Magento/backend/en_US/js-translation.json


texts: Does arguments order in constructor matters?

texts:
I've noticed strange situation while creating class contructor (__construct).

Here is my code:

public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
        \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection,
        array $data = []
    )

And:

public function __construct(
        \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection,
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
        \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    )

In first case it returns Internal Server Error 500, but in second case all works fine.

Why does agruments order affects?

Thanks in advance!


texts: Can we manage products filtration by category wise in Magento 2 admin panel

texts: How can I manage the order of products by using category wise instead of SKU name etc..?


texts:
Can anybody point me to a nice Magento 2.3 tutorial on how to create an empty layout?
The idea is to place my report on a template that doesn't include the header and footer the rest of the site uses, not even the default CSS and JS files. The page I'm going to create would look like the Checkout page (no distractions.)
Thanks.


texts: Mirror Products Across Multiple Categories

texts:
I am currently using the same products on 2 separate categories in my Magento store. I have managed to get category B to take category A's products by using the snippet below in the custom layout update xml field:

<reference name="product_list">
     <action method="setCategoryId"><category_id>1</category_id></action>
</reference>

However the layered navigation fails to recognise the products being pulled in from category A and returns no filters what so ever. Is there anyway that you can get the layered navigation to use the set category ID on the product_list block rather than the current category ID if its been set in the custom layout xml?

It is also worth mentioning that I am using the Amasty Improved Layered Navigation extension for my layered navigation with the layered nav being pulled into the category.products block.

Thanks in advance for any help anyone can provide on this issue.


texts: Magento 2 Help - Sub-Categories not working on mouse over

texts:
Just getting the hang of magento 2, having a slight problem which I need your help on.

Using Magento 2.0.12
Using the basic luma theme

The sub-categories on the nav menu on front end were appearing on mouse-over, however after installing the free megastore banner slider and implementing 2 sliders (above menu and below menu with slides) - the dropdown menu sub categories on mouse over stopped working.

anyone got any clue?

The main category shows in the menu "products'
However, every sub-category doesn't show on mouse over.

I have made sure Include in Navigation Menu is set to YES on all of them

They are set under default category in the backend
- default category > products > boost pedals

Only 'products' show on the menu front end.

I have also tried running the following command and refreshing cache.

php bin/magento indexer:reindex


texts: How to change the product price with a plugin in Magento 2.1?

texts:
UPDATE

After a lot of debugging I found out that the plugin is loaded on the product detail page but not in the checkout.
It seems that the checkout gets the values from somewhere before so that is why the price is correct initially. But if Javascript is triggered it goes through the module loading process again and there the plugin is not loaded. Thus the original magento database price is loaded.

The problem seems to be in var/generation/Magento/Catalog/Model/Product/Interceptor.php
in function getPrice.
There they fetch $pluginInfo and this contains an array with my plugin. But only on the product detail page. In the checkout this array is always null and therefor it only calls parent::getPrice().

I wonder why my plugin is not loaded in the checkout?

Here is how I setup the plugin:

registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    '<vendor>_<plugin>',
    __DIR__
);

di.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\Product" shared="false">
        <plugin
                name="<vendor>_<plugin>_productplugin"
                type="\<vendor>\<plugin>\Plugin\Product\ProductPlugin"
                disabled="false"
                sortOrder="999" />
    </type>
</config>

app/code/<vendor>/<plugin>/Plugin/Product/ProductPlugin.php

<?php

namespace <vendor>\<plugin>\Plugin\Product;

class ProductPlugin
{
    public function afterGetPrice($product, $proceed) : float
    {
        return 111.55;
    }

}

OLD INFO

I already build a mage2-module with a plugin for Magento\Catalog\Model\Product and created an afterGetPrice() method. This works fine for:

product detail page
checkout/cart product listing on the left

But the problem is that the widget/sidebar summary component at the checkout on the right side of the e.g. Luma theme shows the right prices for a short moment, than an ajax request to the Magento REST-API changes all prices to the normal Magento product prices so the plugin does not work here.

Before everything is ok and can be checkt via console:

window.checkoutConfig;

quoteData and totalsData have got the proper prices. Later they will be updated by the response of totals-information.

I think these endpoints could be used for this action depending on the situation:

POST   /V1/carts/:cartId/totals-information
POST   /V1/guest-carts/:cartId/totals-information
POST   /V1/carts/mine/totals-information

<preference for="Magento\Checkout\Api\Data\TotalsInformationInterface" type="Magento\Checkout\Model\TotalsInformation" />
<preference for="Magento\Checkout\Api\GuestTotalsInformationManagementInterface" type="Magento\Checkout\Model\GuestTotalsInformationManagement" />
<preference for="Magento\Checkout\Api\TotalsInformationManagementInterface" type="Magento\Checkout\Model\TotalsInformationManagement" />

In my own theme no such reloading takes place but in step 2 of the onepage checkout the prices are also wrong.

  How can I achieve to overwrite the prices in the frontend with my own
  prices and in case of no data with the original price, like the
  afterGetPrice() function does?

Here you can see the process in screenshots:

first it loads the page with the correct price (sorry it's german language)

then it reloads the summary box

after the refresh the price is the magento price without the afterGetPrice() method being run


texts: Global Page Success / Warning / Error Messages not showing in Admin

texts:
None of the global page messages are appearing on any page in the admin panel. This includes and is not limited to my own custom messages, saving a product, canceling an order and clearing the cache.

I've tried with all caches enabled and disabled with no luck.

Some investigation has shown that I can get messages showing by adding $clear = false; in the getMessages() function in vendor/magento/framework/Message/Manager.php on line 120. This tells me that messages are being cleared on every redirect without allowing the latest added message to display.

I can't tell what happened to the system before I started seeing this bug.


texts: Redirect from simple product to parent product

texts:
I want to display all the associated simple products on the category-
  pages and link them to the their parent product.

How this can be achieved?

One simple product is associated with only one parent.


texts: How to remove unused js from home page in Magento 2

texts:
There are so many js files not used on home page in Magento 2. So, I want to remove it from home page. But, it's not remove still loading on home page.
Non used js example :

jquery/ui-modules/datepicker.js
jquery/ui-modules/timepicker.js
moment.js
jquery/ui-modules/sortable.js
jquery/spectrum/spectrum.js
mage/calendar.js
Magento_Ui::js/lib/knockout/bindings/resizable.js
Magento_Ui::js/lib/knockout/bindings/resizable.js

How can I remove this?
I need to remove this CSS and JS also from Google Page Speed.

Can anyone please help me?


texts: I have a license for the Magento Enterprise edition that expires December 1, 2014. I haven't determined whether I need the Enterprise edition, and think the Community Edition might serve my needs. What happens when the license expires? And is there a month-to-month option?


texts: magento2 only show checkout agreement in payment page

texts: I am doing checkout when order, but i have 2 checkout agreements in shipping address page and payment page. Now i want checkout-agreements only show in payment page. How can i do?. Please help me!


texts: set out of stock configurable products visibility to search

texts:
A configurable product is out of stock when all its simple products are out of stock.

I would like to set the visibility to search for all configurable products which are out of stock in bulk.

Can anyone help me how can I achieve this?


texts: Is it really true that magento does not swap out the images according to the attribute selected on the front end?

texts: i was really surprised to find this an issue. i am in an older vs 1.6. is there a way to get magento to show a red shirt when the color red is selected and blue when the blue attribute is selected? seems very basic for magento to pull the image from the associated product!


texts: Display Polls with a custom template shows only empty results

texts:
Meta

Magento 1.9.2.1
Custom Template
Poll works fine when in sidebar
Poll works fine when loaded by layout xml

History

Based on this information:

http://inchoo.net/magento/magento-frontend/reusing-magento-poll-on-any-page-or-any-block/

and

https://www.demacmedia.com/magento-commerce/how-to-display-the-magento-poll-voting-form-and-results-in-a-static-block/

I'd like to show the polls module anywhere I like, using the WYSIWYG Editor.

When I add the poll on a CMS page, by adding the xml to the design tab of the new page, it all works fine. This is not available in a static CMS Block. Since I need the poll to appear in a static block, I run into a little problem.

The problem

Loading the Poll with

{{block type="poll/poll" template="poll/active.phtml" poll_id="1"}}
{{block type="poll/poll" template="poll/result.phtml" poll_id="1"}}

does indeed show the poll and the results. Of course, the appear both at the same time and the results are empty.

Attempt for a solution

I tried to emulate the way the template is changed, when it's done with xml.
So I created poll/anywhere.phtml like this:

<?php
    $pollId = $this->getPollId();
    $poll = $this->getLayout()->createBlock('poll/activePoll');
    $poll->setPollId($pollId);
    $poll->setPollTemplate('poll/result.phtml', 'results');
    $poll->setPollTemplate('poll/active.phtml', 'poll');
    echo $poll->toHtml();
?>

Then I load This template in the WYSIWYG Editor via:

{{block type="page/html" template="poll/anywhere.phtml" poll_id="2"}}

This leads to the same behaviour, as when I load both parts separately, only that the poll itself does not show (correct in this case), but the results are still empty.

Again, when I load it with xml, it works as expected.

For reference (from the first link), this look like this:

<reference name="content">
    <block type="poll/activePoll" name="custom.poll">
        <action method="setPollId">
            <pollId>1</pollId>
        </action>
        <action method="setPollTemplate">
            <template>poll/active.phtml</template>
            <type>poll</type>
        </action>
        <action method="setPollTemplate">
            <template>poll/result.phtml</template>
            <type>results</type>
        </action>
    </block>
</reference>

From What I see, the same thing should be accomplished in anywhere.phtml

The question

Is obviously, what did I do wrong, what did I miss?

Any insight is greatly appreciated.


texts: Remove HH:mm:sec for From & To Date search

texts:
We are fetching orders from magento database & displaying in custom page :  www.1234.com/php/site6/orders.php
we are Displaying From & To Date for filtering orders based on those dates.

here 00:0:00 & 23:59:59 is displaying along with from & To date. [ hours : min : sec]

but i want to hide : 00:00:00 & 23:59:59 , so i removed those text from code, after that Filtering based on Dates not working. is there any issue with Date format ?

if (isset($_POST['post_at']) && $_POST['post_at'] != '')
    {
    $orderFromDate = $_POST['post_at'] . " 00:0:00";
    }
  else
    {
    $orderFromDate = '';
    }

if (isset($_POST['post_at_to_date']) && $_POST['post_at_to_date'] != '')
    {
    $orderToDate = $_POST['post_at_to_date'] . " 23:59:59";
    }
  else
    {
    $orderToDate = '';
    }

function getDesignerCollection()
    {
        if (isset($_POST['post_at']) && $_POST['post_at'] != '')
        {
        $orderFromDate = $_POST['post_at'] . "00:0:00 ";
        }
      else
        {
        $orderFromDate = '';
        }

        if (isset($_POST['post_at_to_date']) && $_POST['post_at_to_date'] != '')
        {
        $orderToDate = $_POST['post_at_to_date'] . "23:59:59 ";
        }
      else
        {
        $orderToDate = '';
        }

        if ($orderFromDate != '') $order->addFieldToFilter('created_at', array(
            'gteq' => $orderFromDate
        ));
        if ($orderToDate != '') $order->addFieldToFilter('created_at', array(
            'lteq' => $orderToDate
        ));

        foreach($order as $orderData)
        {
        $oDate = new DateTime($orderData['created_at']);
        $sDate = $oDate->format("Y-m-d");
        }

    }

script

jQuery.datepicker.setDefaults({
showOn: "button",
buttonText: "Date Picker",
buttonImageOnly: true,
dateFormat: 'yy-mm-dd'
});
$(function() {
$("#post_at").datepicker();
$("#post_at_to_date").datepicker();
});


texts:
I have a problem with exporting all products in magento 1.9.2.1.

I want to export sku, name, price and manufacturer. It's okay but i have several lines for an unique sku.

The first line shows the correct name, the correct price and the correct manufacturer and the second line shows only the sku.

I guess it's because of the images.

If i have 3 images for a product, i have the correct line + two blank lines
If i have 5 images for a product, i have the correct line + four blaank lines.

Do you have an idea why ? We need a good file in order to re-import it.

Thanks

EDIT

9084709010(sku)    GoodName  GoodPrice  Good manufacturer
9084709010
9084709010
9084709010
9084709010

And the number of blank lines with only sku is the same as the number of pictures


texts: How to define a custom layout of view.phml used by product review on selected categories

texts:
I was able to define a view.phtml custom layout on selected categories by adding this entry to the category's 'Custom Layout Update:' and set 'Apply to Products:' to YES. My purpose was to hide the price/add to cart and replace with some image/text on selected categories.

<reference name="product.info">
         <action method="setTemplate">
<template>catalog/product/custom_view.phtml</template></action>
</reference>

This works well except that when I clicked on review this product, it showed the default format with the price on it. I wanted to add an entry to set custom layout to REVIEW page as well.


texts: How to remove customer account navigation menu from wishlist item view page

texts:
I am trying to remove customer account navigation menu from wishlist item view page.

That means customer account navigation menu will display on the dashboard but when I click on toplink my wishlist then it will only show wishlist item without navigation menu.


texts: Programmatically create new orders from multiple existing orders

texts:
I would like to programmatically create new orders from existing orders by their id and send new order confirmations by mail. The new orders need to contain all the information the old ones had (Items, Customer, Shipping Information etc.):

<?php
include_once 'app/Mage.php';
Mage::app();

//some existing order ids
$orderIds= array('911', '1106', '926');

foreach($orderIds as $orderId){
    Mage::unregister('rule_data');
    Mage::getModel('adminhtml/session_quote')
        ->clear();

    /* @var Mage_Sales_Model_Order $order */
    $order = Mage::getModel('sales/order')->load($orderId)
        ->setReordered(true);

    /* @var Mage_Sales_Model_Quote $quote */
    $quote = Mage::getModel('sales/quote')
        ->setStoreId($order->getStoreId())
        ->assignCustomer(Mage::getModel('customer/customer')->load($order->getCustomerId()))
        ->setUseOldShippingMethod(true);

    /* @var Mage_Adminhtml_Model_Sales_Order_Create $model */
    $model = Mage::getModel('adminhtml/sales_order_create')
        ->initFromOrder($order)
        ->setQuote($quote);

    /* @var Mage_Sales_Model_Order $newOrder */
    $newOrder = $model->createOrder();
    $newOrder->setQuoteId($quote->getId())
        ->sendNewOrderEmail();

    $model->getSession()
        ->clear();
}

Unfortunately Magento keeps the Customer information while looping through the order IDs, so the emails are all sent to the customer of the first order (in this case the one with the id 911). Also, the order items seem to add up in the cart, so the last order which is placed contains all the order items of the previous orders... What am I doing wrong?


texts:
Catalog > Manage Categories

I select a category and go to "Category Products" tab. I reset filters and select one or more product to add to category. Then hit "Save Category" button and the category is indeed saved but the products have not been added to the category.

If I remove a product from a category then it is saved and removed correctly.

I have tested with new and different categories and the problem is the same. I have cleared caches, checked logs and there are no errors neither exceptions, no js errors as well.

Any possible idea would be appreciated.


texts: getLocaleCode() by customer instead of store

texts:
I am writing a module to send alert email to customer when a product is available. I have different email template with name like "alertmail EN", "alertmail FR"...

I can't do

$this->_store->getLocaleCode()

Because the mail is send by a cron. How can I get locale code by customer?


texts:
as i am new in the magento and i want help to add bxslider in the home page area.

I have added the widget-block from the admin to display the slider images.

Also I have added the js in default_head_block.xml file. but it does not working.


texts:
I am getting a Js error while trying to click a massaction from the drop of my custom grid. I am getting this on all action listed in the dropdown.
"massactions.js:79 Uncaught TypeError: this.selections is not a function"


texts: Building own Magento Api - getting users cart

texts:
How do I get products in user's cart?

I already have function that's returning my cart in JSON form what I want, but my problem is that without sessionID my api return empty cart.

How to deal with that issue?


texts: Magento 2 - Unable to Get Request Params in controller

texts:
I am trying to get input data in the controller but controller not getting url params.

<?php

namespace Crud\Crudatfrontend\Controller\Result;

use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Controller\Result\JsonFactory;

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

     /**
     * @var Magento\Framework\View\Result\PageFactory
     */
    protected $resultPageFactory;

    protected $resultJsonFactory;

    /**
     * @param Context     $context
     * @param PageFactory $resultPageFactory
     */
    public function __construct(
        Context $context,
        PageFactory $resultPageFactory,
        JsonFactory $resultJsonFactory
        )
    {

        $this->resultPageFactory = $resultPageFactory;
        $this->resultJsonFactory = $resultJsonFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
        var_dump($this->getRequest()->getParams());die("testing");
        //echo '
';
        //print_r($this->getRequest('height')->getParams());exit;
        $height = $this->getRequest()->getParam('height');
        //$height = 5;
        $weight = $this->getRequest()->getParam('weight');
        $result = $this->resultJsonFactory->create();
        $resultPage = $this->resultPageFactory->create();

        $block = $resultPage->getLayout()
                ->createBlock('Crud\Crudatfrontend\Block\Index')
                ->setTemplate('Crud_Crudatfrontend::result.phtml')
                ->setData('height',$height)
                ->setData('weight',$weight)
                ->toHtml();

        $result->setData($block);
        return $result;
    }
}

Here is my phtml file

            <form name="form_height" method="POST" id="form_height">
                    <input type="text" name="height" class="form-control input-md">
                    <input type="text" name="weight" class="form-control input-md">
                    <input type="submit" id="calculateTotalSubmit"  name="calculate-total-submit" value="Calculate Total">

            </form>

I am getting values in console.


texts:
I have two store view "en" for english and "ar" for arabic. When i click english store view icon, the url gets changed to

  "https://my-magento-store.com/?__store=en"

and after that when i click arabic store view icon, the url gets changed to

  "https://my-magento-store.com/?__store=en&__store=ar"

and returns error page. Please help me to fix this.


texts:
my xml code:

<customer_account>
    <reference name="customer_account_navigation">
        <action method="addLink" ifconfig="example/general/enabled" module="example" translate="label">
            <name>example</name>
            <path>example/list/</path>
            <label>My Example</label>
        </action>
    </reference>
</customer_account>

I m using translate="label" but its not working i dont know why but in admin side its working


texts: In Magento 2, at the Checkout, some fields are required. But for some reason the Postal code (postcode) field always has a red border and the 'required' notification below it. How do I remove this? Can't find it in any template.


texts: redirect to iframe on custom payment method on magento 2.1

texts:
I want to make a redirect after i configure IframeConfigProvider.
I have the cgi_url on config.xml and call it inside getConfig() at IframeConfigProvider and still i cant make the redirect.

After a press the "Place Order" button -i get a success page .

I know i have the block who call to iframe.phtml and i suppose its need to be use after IframeConfigProvider is set and call inside /etc/frontend/di.xml.

I really googling out and check braintree and razorpay extension but i cant really get a clearly answer.

Note: there is a topic who related to my question Magento 2 - Custom payment module but i'm not sure the solution because i cant make the connection to iframe.phtml and IframeConfigProvider().

I even try to config my sarig-method.js but still - none of the action really works.

https://gist.githubusercontent.com/refaelgold/f614153c468d1a6e9212f66942c22b31/raw/813c0f0be1ce1b0c98dfbf86744b730408d157e3/sarig-method.js

(sorry about the gist but i cant really paste my code here with the special tags)

Any help?


texts: Backend search term/keywords position order

texts:
If i want to search for this product:

iPhone 6 Mobile Phone special edition

I can now only find it by searching it like this: "iPhone 6 Mobile"

I want to be able to find it like this: "Mobile 6 iPhone", because some product names have their words ordered differently, so magento isn't showing even half of all the products because it just needs a too much specific search term.

Does anyone have any suggestions on how to achieve this?


texts: How to limit number of order per customer for certain product?

texts:
I have a requirement in my website where the customer can buy a certain product only once. If they try to buy that again it should throw an error saying cannot purchase this again.

Please help me on this.


texts:
We are creating a custom template and have a couple of issues with onepage cart checkout

When adding to cart, MiniCart does not update with cart item number
When go to checkout, http://[url]/checkout the checkout-loader doesnt disappear and keeps spinning so cannot go any further

Are there any configurations or coding that need to be applied? We have kept to most of the Magento template files and updated the css/less files

thanks


texts: Where is the JavaScript of the "Add New Option" Button?

texts:
I'm talking about the page at admin -> catalog -> manage products -> any product -> custom options tab. I customized this page and added a new button which I basically want to act similarly.
Presumably it is done via JavaScript, but it isn't clear to me where this functionality is defined.

A pointer in the right direction would be greatly appreciated.


texts: How to connect magento2 to rabittmq on aws

texts:
I have two Ec2 instances in AWS, on one instance I have installed Magento 2 and on another ec2 instance, I have installed RabbitMQ. How can I connect Magento 2 with RabbitMQ?
I have given public IP of Ec2 where RabbitMQ is installed, and port 5672.
But not able to connect. Please help.


texts: How to overwrite \Magento\Framework\Config\File\ConfigFilePool

texts:
Short version:
How to use custom db and module config files instead of env.php and config.php ? or How to completely overwrite \Magento\Framework\Config\File\ConfigFilePool ?

Long version:
I'm developing a multi client system similar to https://github.com/elisei/Magento-Multi_Client.
I want to develop it in such a way that with one codebase, multiple databases can be installed. So multiple projects can be developed.

On code level following folders/files will be different for each project.

var/*
pub/*
app/etc/env.php
app/etc/config.php

Instead of above I'll be using following folders/files:

var/client1/*
var/client2/*
pub/client1/*
pub/client2/*
app/etc/cliet1_env.php
app/etc/cliet2_env.php
app/etc/client1_config.php
app/etc/client2_config.php

Based on the url used diferent database will be used (which will be done through setting host flags for each url). If url is client1.com , db used will use cliet1_env.php.

DB config file (env.php) which is used by default is mentioned in Magento\Framework\Config\File\ConfigFilePool, so I've overwritten this file in a custom module using preference. For clients1 here is the program.

di.xml file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Framework\Config\File\ConfigFilePool" type="Aceturtle\MultiClient\Config\File\ConfigFilePool"/>
</config>

and overwritten file

<?php

namespace Aceturtle\MultiClient\Config\File;

class ConfigFilePool extends \Magento\Framework\Config\File\ConfigFilePool {
   const APP_CONFIG = 'app_config';
    const APP_ENV = 'app_env';

    /**
     * Default files for configuration
     *
     * @var array
     */
    private $applicationConfigFiles = [
        self::APP_CONFIG => 'client1_config.php',
        self::APP_ENV => 'client1_env.php',
    ];
    public function getPaths()
    {
        return $this->applicationConfigFiles;
    }
}

Call to \Magento\Framework\Config\File\ConfigFilePool::getPaths() is showing client1_env.php and  client1_config.php but still, If I print \Magento\Framework\Config\File\ConfigFilePool object it prints client1_env.php, client1_config.php, and env.php, config.php and if I run any command (module enable), it updates config.php, not client1_config.php. That means \Magento\Framework\Config\File\ConfigFilePool is not being completely overwritten.

How I can configure it such that my custom config files are used instead of default ones?


texts:
With latest release, CE 1.8.1 cookie_restriction_notice_block went to before_body_end in layout (/app/design/frontend/base/default/layout/page.xml). But users don’t realize about that notice nor that they are expected to allow cookies.

I used this code to easily unset global_cookie_notice block from before_body_end and set it in after_body_start in layout file local.xml in my theme:

    <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>`

However, I can’t figure out how to translate for different store views. Changing text as usual in CMS block in the admin (cookie_restriction_notice_block) for different store views didn't work for me.

How can I translate cookie_restriction_notice_block for different store views?


texts: Attribute with the same code already exists when add Custom Customer Attribute from Controller

texts:
i try following this tutorial to add new customer attribute, the tutorial run the function at InstallData.php. I'm trying to run the function from controller and i got the following error:

"Attribute with the same code already exists.";i:1;s:6637:"#0 /var/www/project/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(400)

here's my controller code:

    use Magento\Framework\App\Filesystem\DirectoryList;

    use Magento\Eav\Setup\EavSetup;
    use Magento\Eav\Setup\EavSetupFactory;
    use Magento\Eav\Model\Config;
    use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
    use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
    use Magento\Framework\Setup\ModuleDataSetupInterface;
    use Magento\Customer\Setup\CustomerSetupFactory;
    use Magento\Customer\Model\Customer;

    class Save extends \Magento\Backend\App\Action
    {
      protected $idListing;

      public function __construct(
            CustomerSetupFactory $customerSetupFactory,
            AttributeSetFactory $attributeSetFactory,
            ModuleDataSetupInterface $setup,
            ModuleContextInterface $contextt,
            \Magento\Backend\App\Action\Context $context
        ) {
            $this->customerSetupFactory = $customerSetupFactory;
            $this->attributeSetFactory = $attributeSetFactory;
            $this->setup =$setup;
            parent::__construct($context);
        }

      private function saveAttribute(){
        $context = $this->contextt;
        $setup = $this->setup;
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
        $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

        /** @var $attributeSet AttributeSet */
        $attributeSet = $this->attributeSetFactory->create();
        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute(Customer::ENTITY, 'test1234', [
            'type' => 'varchar',
            'label' => 'test',
            'input' => 'text',
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 1000,
            'position' => 1000,
            'system' => 0,
        ]);

        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'test1234')
        ->addData([
            'attribute_set_id' => $attributeSetId,
            'attribute_group_id' => $attributeGroupId,
            'used_in_forms' => ['adminhtml_customer'],
        ]);
        try {
          $attribute->save();
          echo "success";
        } catch (Exception $e) {
          print_r($e->getMessage());
        }
        exit;
      }

      public function execute()
      {

         $this->saveAttribute();
         exit;
      }
}


texts: Magento 2.3.3 View Order not working after PayU integration

texts:
Summary: Not able to open any orders post payu integration
Environment details:
Magento 2.3.3, Linux server (cloud)
Php 7.2
Steps to reproduce
1. Download the PayuIndia plugin for magenton 2.3.3 (this was given directly by the payu support team)
2. Install via composer/command line/web wizard etc. (end the result remained same.)
3. Admin Dashboard>Stores>Configuration>Sales>Payment Methods> enable payu gateway
4. Add products to cart, checkout using payu payment gateway
5. Go to Admin Dashboard>Sales>Order click on any order
Expected result:
The order details/view page should appear.
Actual result:
 Fatal error: Uncaught Error: Class 'PayUIndia\Payu\Block\Adminhtml\Order\View\Tab\Verify' not found in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116 Stack trace: #0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('PayUIndia\Payu...', Array) #1 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create('PayUIndia\Payu...', Array) #2 /var/www/html/vendor/magento/framework/View/Element/BlockFactory.php(46): Magento\Framework\ObjectManager\ObjectManager->create('PayUIndia\Payu...', Array) #3 /var/www/html/vendor/magento/framework/View/Layout/Generator/Block.php(268): Magento\Framework\View\Element\BlockFactory->createBlock('PayUIndia\Payu...', Array) #4 /var/www/html/vendor/magento/framework/View/Layout/Generator/Block.php(248): Magento\Framework\View\Layout\Generator\Block->getBlockInstance('PayUIndia\ in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116


texts: Magento 2.4 PayPal Express Checkout In-Context : error Unauthorized. Missing a required scope

texts:
Trying to test in-context payment on sandbox
Using bundled extension

On checkout when trying to pay seeing error
Request URL:https://www.sandbox.paypal.com/graphql?GetCheckoutDetails
Request method:POST

{"error":"Unauthorized.  Missing a required scope.  Retry your request with a valid access token or session token.","correlation_id":"39a10eb397597",...

Any ideas? One-click payment from product page and basket doesn't work either


texts: Add htmlContent via Magento\Ui\DataProvider\Modifier\ModifierInterface

texts: where i can find an example to add html content in my form using ModifierInterface. Or how to add part of ui_configuration in that modifier?


texts: HTTPS redirect to previous domain after changing domain

texts:
After transferring the file from another server and changing the domain. the https  still redirects to previous domain, i already updated the secure_url in system > configuration > web to the current url. I also try to clear cache and reindex but the problem is still there. everything in the website is okay except https.

Hoping for your help guys.
thank you.

UPDATE 11/08/2015

I change the value from core_config_data table, i don't know why but the default secure_url is still the previous domain even i already change it in the system > config..


texts:
Hello I have website test.english.com in ENG language
I want to add new website view within it for Spanish language
For that, I have created Folder magento_Root/pub/spanish and point it.
Now the website is running on test.english.com/spanish perfectly.

Now I want to change the domain for Spanish language is
test.spanish.com So where I have to point new subdomain(I'm asking
here folder path where to point new domain DNS).
What i have to add in variable $MAGE_ROOT

So Spanish website will run on test.spanish.com.

  Server - Nginx (With CentOs) - Varnish Enable


texts: Reindex with Firefox results in timeouts - at the same time Chrome opens admin without problems

texts:
I use Firefox as default browser. When I need to reindex data like Catalog URL Rewrites, it completely blocks magento browsing in Firefox. The indexing can take a long time and can result in a timeout, but that's OK for me. When I open another tab, I get the same timeouts, and I cannot do anything else.

I thought this was a magento thing, that while indexing the site became unresponsive. However, when I open the magento admin in Chrome, on the same computer, it works like normal. Minutes later Firefox works again. I can close tabs, reopen the admin dashboard in another tab, but no change.

How does this work and what can I do to get Magento work normally in Firefox again? I've thought of one way, to reindex in Chrome, but I would prefer to have it all working in Firefox.

Update: it seems to work the other way around as well. So reindexing in Chrome makes Chrome unresponsive and Firefox can be used. So that is a workaround, but I don't understand why you can't do this in one browser.


texts: How can I customize print out of Magento 2 sales order ?


texts: Prototype select element with id that contains specific character

texts:
I have a select box in admin customer address form like this:

<select id="_item13country_id" name="address[13][country_id]" class="required-entry countries required-entry select required-entry select">
 <option value=""> </option>
 <option value="TH" selected="selected">Thailand</option>
</select>

I need to select country field by using prototype to find which element that contains

  country_id

How can I do that ?. Many thanks for your help.


texts:
I have created custom module in admin its working fine but I want to store module data in multiple store like product data where we can save product data in different languages like English, German and French.

How is it possible?


texts: Basic procedure while adding an additional controller to a module in Magento 2.1

texts:
I am trying to create a new controller for a module. I have set the frontend layout XML file and corresponding template file. I have flushed the cache too. Still it's showing a 404 error. What am I doing wrong here? If I need to mention more information for answers, please do mention.

<?php

namespace Mine\Hello\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;

class Googi extends Action
{
    /**
     * @var PageFactory
     */
    protected $_resultPageFactory;

    /**
     * @param Context     $context
     * @param PageFactory $resultPageFactory
     */
    public function __construct(
        Context $context,
        PageFactory $resultPageFactory
    ) {
        $this->_resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    /**
     * Hello Landing page.
     *
     * @return \Magento\Framework\View\Result\Page
     */
    public function execute()
    {
        $resultPage = $this->_resultPageFactory->create();
        // Set title of page
        $resultPage->getConfig()->getTitle()->set(__('Something'));
        return $resultPage;
    }
}

routes.xml:

<?xml version="1.0"?>

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

The URL I am specifying is Magento/hello/index/googi.


texts: Magento 1.9 How to send a pdf invoice download link to order delivered email?

texts:
I'd like to know how I can send an email with a link to direct download the PDF invoice.

I'm using magento 1.9.2.4.

I would really appreciate any help.


texts:
Good evening, I add a function to insert a picture in the order confirmation email Magento 1.9

<img src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getThumbnail()); ?>"
 alt="<?php echo $_item->getName() ?>"/>

But I can't resize it

Example : getMediaUrl($_product->getThumbnail())->resize(150); ?>"
 alt="getName() ?>"/>

could you help me ?`


texts: How to hide free shipping for user group

texts:
I inherited a highly customized Magento-store. One of the modifications was to hide the free shipping method from one of the customer groups at checkout. I want to undo this modification, so all customer groups can see free shipping as per the default set up. The problem is, I can't seem to find where the modification has been made. I have checked in the template app/design/frontend... and in Shipping, app/code/core/Mage/Shipping  . I didn't find any modifications in any files there that would cause this behavior.

  Where would a modification to hide a shipping method from a user group
  on checkout have been made?


texts: How To Fix Theme Switching Error Message In 2.2.4

texts: On applying any new theme getting an error in the admin panel.something went wrong while saving this configuration. Area is already set


texts:
I installed a language pack using composer.

$ composer require mageplaza/magento-2-german-language-pack:dev-master
$ php bin/magento cache:flush

Now when I try to uninstall again, using this command:
php bin/magento i18n:uninstall mageplaza_de_de

I get the following message:

Package mageplaza_de_de is not a Magento language and will be skipped.
Nothing is removed.

This is what's in the registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'mageplaza_de_de',
    __DIR__
);

How can I uninstall this package?


texts:
For Migration I ran below 2 commands.

php bin/magento migrate:settings -r -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.8/config.xml

php bin/magento migrate:data -r -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.8/config.xml

Then I got below error

[2018-11-15 06:58:27][WARNING]: Source fields are not mapped. Document: customer_eav_attribute. Fields: is_used_for_customer_segment

Then I placed below code in map.xml first, then in map-eav.xml finally in map-customer.xml.

<ignore>   <field>customer_eav_attribute.is_used_for_customer_segment</field>
</ignore>

But I am still getting the previous error.


texts: Layout getBlock is always returning false

texts:
I have overridden a core file with my own file. This part is working correctly.

<adminhtml>
    <rewrite>
       <catalog_category_tabs>MyModule_Adminhtml_Block_Tabs</catalog_category_tabs>
    </rewrite>
</adminhtml>

However when trying to add a custom tab with a block for content, I'm running into issues.

class MyModule_Adminhtml_Block_Tabs extends Mage_Adminhtml_Block_Catalog_Category_Tabs
    protected function _prepareLayout()
    {
        // ...
        // dispatch event add custom tabs
         Mage::dispatchEvent('adminhtml_catalog_category_tabs', [
            'tabs' => $this,
        ]);

        // My tab
        $this->addTab('custom', [
            'label'   => Mage::helper('catalog')->__('Custom Tab'),
            'content' => $this->getLayout()->createBlock(
                'adminhtml/tab_custom',
                'category.custom.grid'
            )->toHtml(),
        ]);

        return parent::_prepareLayout();
    }

The createBlock method is returning false.

The referenced file is at MyModule/Adminhtml/Block/Tab/Custom.php. Is there something I'm missing?


texts: What does the Quote's Address' "freeMethodWeight" represent?

texts:
I see it's used in Mage_Sales_Model_Quote_Address_Total_Shipping::collect() and it's roughly equivalent to the address' total weight.
Also, various Carriers check against this value:

if ($request->getFreeMethodWeight()!=$request->getPackageWeight()) {
    $r->setFreeMethodWeight($request->getFreeMethodWeight());
}

Do you guys know what is its purpose?


texts:
How does Magento 2's initObservable function work?

The more detail the better as I feel not many people understand the KO implementation and with the checkout being built with it I think it's something we really should know more about. The dev docs are currently not helpful at all when it comes to KO and with it being customised the KO website doesn't help either.

Alan Storm has written some excellent articles on M2 and KO but even these don't explain how initObservable works.

All the code below is inside

 vendor/magento/module-ui/view/base/web/js/lib/core/element/element.js

I'm doing some digging into Magento 2's Knockout implementation and I can gather this code loops through each element passed to it and fires track.

    initObservable: function () {
        _.each(this.tracks, function (enabled, key) {
            if (enabled) {
                this.track(key);
            }
        }, this);

        return this;
    },

The track function then calls the observe function:

    track: function (properties) {
        this.observe(true, properties);

        return this;
    },

The observe function then works it's magic, this is where I get lost as nothing here seems reference knockout at all.

    observe: function (useAccessors, properties) {
        var model = this,
            trackMethod;

        if (typeof useAccessors !== 'boolean') {
            properties   = useAccessors;
            useAccessors = false;
        }

        trackMethod = useAccessors ? accessor : observable;

        if (_.isString(properties)) {
            properties = properties.split(' ');
        }

        if (Array.isArray(properties)) {
            properties.forEach(function (key) {
                trackMethod(model, key, model[key]);
            });
        } else if (typeof properties === 'object') {
            _.each(properties, function (value, key) {
                trackMethod(model, key, value);
            });
        }

        return this;
    },


texts: How to re-import products with existing images

texts:
I have accidentally deleted all product from Magento store (1100 items) but few minutes before that I did export all of them to the .csv file what let me to import them back but unfortunately there no single image back.

Is there a way to assign all these images back? I assume images are still in media/product? I have access to MySQL but how to prepare SQL query to reassign those images? I don't have fresh enough backup and this is a live store so I'm quite desperate.

Thank you.


texts: How to redirect to 403 custom error page in magento2 from controller

texts:
I am trying to redirect to custom 403 error page.

I have created plugin for controller as follow:

etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Controller\Category\View">
    <plugin name="Tatva_Catalog::changeCustomLimitData" type="Tatva\Catalog\Plugin\Controller\Catalog\View" />
</type>
</config>

Custom\Catalog\Plugin\Controller\Catalog\View.php

<?php

    namespace Custom\Catalog\Plugin\Controller\Category;

    use Magento\Framework\View\Result\PageFactory;

        class View
        {
            public function __construct(
                \Magento\Framework\App\Action\Context $context,
                \Magento\Catalog\Block\Product\ProductList\Toolbar $toolbar,
                PageFactory $resultPageFactory,
                \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory,
                \Magento\Framework\UrlInterface $url,
                \Magento\Framework\App\RequestInterface $requestInterface
            ) {
                $this->toolbar = $toolbar;
                $this->resultPageFactory = $resultPageFactory;
                $this->resultForwardFactory = $resultForwardFactory;
                $this->url = $url;
                $this->requestInterface = $requestInterface;
            }

        public function beforeExecute(\Magento\Catalog\Controller\Category\View $category)
        {

            $product_limit = $category->getRequest()->getParam('product_list_limit');
            $available_limits = $this->toolbar->getAvailableLimit();
            if(!in_array($product_limit, $available_limits) && !empty($product_limit))
            {
                return ?
            }
        }
    }

In above code what should I add instead of ? to return to custom 403 error page URL in Magento2.


texts:
I have a doubt referent a Multiple Stores in Magento.

There's a way to setup multiple stores in multiple servers?

For example:

www.store1.com in server1
www.store2.com in server2

But I wanna share the same admin with both...

So, what's the possibility to do this?

Thanks


texts:
Goal: Remove the "Delete My Data" Button
On a magento 2 store frontend, I'm seeing a button under Privacy tools in the Customer Account that says "Delete My Data". Is this functionality in the vanilla version of Magento 2? If it is standard functionality, I'm looking for the easiest way to remove it. I haven't found a config option yet.


texts: Duplicate customer orders functionality for new type of order

texts:
I'm looking to create a new menu item in addition to the standard Orders menu item on the customer account page.
However I need to have the new menu item, target orders of a new type.
So for example, lets say the new menu item was called X Type Orders when you click on that, it would load the history for orders with the order_type = "x-type" and when you click the view order button for a row, instead of going to sales\order\view\order_id\1 it would need to go to xtype\order\view\order_id\1
So again just to clarify, i want to be able to view the standard orders, but also I want to view the X Type Orders separately. I hope that makes sense.
Thanks guys :)


texts:
I am new to magento. I am using version 1.9.1. How can i call a phtml page as home page?

So far im making changes in cms->homepage->design im changing the html code there.
But now i want to include php in the homepage src code. How can i do that?


texts: Magento2: How to convert JSON to Array of nested objects

texts:
I am wanting to understand if there are some functions in Magento Framework which will assist me in mapping an array of nested objects from JSON (such as what would happen when the REST API is building objects from JSON - although in this case I'll be loading from code.)

My structure would be something like this (array of parent_objects)

{"parent_object":[
      {"id":0, "product"{"sku":"prod2", "name":"prod2"},
      {"id":0, "product"{"sku":"prod3", "name":"prod3"}, "customobject":{"field1":"field1-value"}}
 ]
}

And the class I would have the data mapped to is an array of:

\MyNs\Mymodule\Api\Data\ParentObjectDataInterface[] $parentObject

which contains these three properties (mix of primitive and object types)

 @var \Magento\Catalog\Api\Data\ProductInterface $product
 @var int $id
 @var \MyNs\Mymodule\Api\Data\CustomobjectInterface $customobject

Thanks.

EDIT: Currently trying to trace the process:

Appears that in \Magento\Framework\Webapi\Rest\Request\Deserializer\Json we have a method deserialize($encodedBody) that converts JSON to Array.

Then this is used in \Magento\Framework\Webapi\Rest\Request method getBodyParams()

Still tracing my way back now - I've also looked at the reflection classes, don't want to complicate too much and am looking for a solid answer where someone knows the best way.


texts: Magento2: How to override paypal-express.html & authorizenet-directpost.html?

texts:
I want to add unique IDs to the 'place order' buttons on checkout.
I found the right templates on the vendor folder & tried to copy them to my custom theme on app/design:

  vendor/magento/module-paypal/view/frontend/web/template/payment/paypal-express.html
  To:
  app/design/frontend/Vendor/Theme/Magento_Paypal/view/frontend/web/template/payment/authorizenet-directpost.html

&

  vendor/magento/module-authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html
  To:
  app/design/frontend/Vendor/Theme/Magento_Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html

But it doesn't seems to have any effect on the frontend.
*I already tried to replace 'view/frontend/web/template' with 'templates' on my overrides, still no effect.
*I tried all the obvious stuff like cache flush, static contents, etc...
UPDATE (SOLVED)
Eventually I created a custom module & overrided the templates using Vendor_Module/view/frontend/requirejs-config.js

var config = {
map: {
    '*': {
        'Magento_Authorizenet/template/payment/authorizenet-directpost.html': 'Vendor_Module/template/payment/authorizenet-directpost.html',
        'Magento_Paypal/template/payment/paypal-express.html': 'Vendor_Module/template/payment/paypal-express.html'
    }
}

};

I then placed the templates under:

  Vendor_Module/view/frontend/web/template/payment/authorizenet-directpost.html
  Vendor_Module/view/frontend/web/template/payment/paypal-express.html


texts: How to get news_from_date and news_to_date?

texts:
I have this code in my foreach:

<?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?>

How to get news_from_date and news_to_date with the same structure?


texts: Magento 2.3 - Theme Configuration mismatch after migration completed from magento 1.9 multi store website?

texts:
After migration, my multi-store website to Magento 2.3.4 Back-end working good all data migrated successfully my theme completely collapsed getting following error,

Following are my errors after migration,

Frond-end error:

1) https://snipboard.io/Dw47EM.jpg

2) https://snipboard.io/uIhnAJ.jpg

System.log:

https://justpaste.it/5ry3a

Debug.log:

https://justpaste.it/42t47

Try lots of combinations to solve the issue, still facing the issue.

Server details: Localhost - Centos 7, Nginx, Magento 2.3.4, paid theme (http://www.codazon.com/document/fastest/magento2/index.html)


texts: How to debug default magento 2 page messages not showing only on login and registration pages?

texts:
i have a magneto 2 server hosted on cloudways with the codazon infinit theme.
my problem is that the page messages on the login page and registration page don't work which is a big problem for users. I should note that the page messages on checkout and on product pages work perfectly.
what happens on the login and the registration page is when an not acceptable input is used (like an wrong password on login or an already used email on registration) the page just reload with no message shown.
the server uses varnish cache which has been set up right to my knowledge. Also sessions work.
i have tried to check the cookies, to my knowledge the mage-message cookie is the one that "activates" the page-message. This cookie stays clear after the reload ( or it clears immediately ).
i have spoken to the theme developers and they told me that everything is fine on their side and i should check cookies and sessions setup. Which i wrote before have checked.
I have spend many hours googling and to find out why this does not work.
what could be the problem here? these are default magento 2 page messages.
I am trying to make sense of magento 2 so please forgive me if used the wrong language.
thank you


texts: Can not open PDF document when an order is completed

texts:
I am receiving an error with the PDF document when an order is completed and I select “Print Invoice” from the drop down menu. When the PDF has been generated and l go to open it on my computer l get the following error:

“there was an error opening this document. the file is damaged and could not be repaired”

Has any had this issue and if so how can l fix it?


texts: How to round off all the prices in magento 2

texts:
Currently the price is Rs 1,599.00 After 45% discount the price will be Rs 879.45.

I want that the price will be round off i.e Rs 879 and then when we choose the quantity to be 18 then the subtotal price will be 15822

Check Below screens for reference.

https://prnt.sc/jsdn9b
https://prnt.sc/jsdnh1

I dont want that price will be displayed in the decimal form like subtotal,shipping,discount,tax etc etc.

I'm using Magento 2.2.2


texts: Magento 2.3: How to configure magento CLI commands to use custom names for dangerous redis commands

texts:
Environment

OS: Ubuntu 18.04 LTS
Server: Apache 2.4
Database: MySQL v14.14 distribution 5.7.25
PHP: 7.2
Redis: 5.0.4

Issue
Following the digitalocean tutorial referenced within the magento devdocs, I am directed to another digitalocean tutorial in order to properly complete the 'Securing Redis' section.
In order to complete 'Step 5 - Renaming Dangerous Commands', I must modify the magento installation to ensure that magento uses my alternative names, rather than the default command names.
Steps taken
There is no 'out-of-the-box' method for doing this and so I am unsure how to proceed.
Presumably, I could either create a module to extend Magento's caching features, or, I could use an external software or script to execute the Redis commands alongside the functional elements of the default Magento commands.
Ideally, I would like to store the command names as environment variables, then have a custom module within magento retrieve the command names and override those used by default.
I originally raised this as an issue on Magento's github, though the dev team does not consider this security flaw an issue and so they told me to raise it as a feature request on their 'community features' github project page.


texts: During development of a magento 2 site I keep getting permission issues. When I move from modes I get "Cannot change permissions for path." Is there something else that I should be doing?


texts: Magento site is not loading. It's error log is showing PHP Fatal error:  Class 'Zend_Db_Select' not found in select.php


texts: one splash page for two websites magento

texts:
My goal here is to create one splash page for only the two with the same domain. This page would link to each website (website2.com/store1, website2.com/store2).

Using Magento, I have 3 websites with 2 under the same domain name:

website1.com website2.com/store1 website2.com/store2

I have created 2 directories in root with new .htaccess and index.php respectively for each website and are both working properly, but when change the DirectorIndex index.php in root .htaccess but it changes the main page for all three sites. I have tried only updating the htaccess for website2.com, but it redirects back to website1.com.

I have tried adding another file, test.html, after index.php and updated my RewriteRule with this test.html but this doesn't seem to be working. I am not sure what I'm missing to get this working properly.

How can I set up htaccess and/or index.php so when I first go to website2.com that you see this splash page, but doesn't effect website1.com.

UPDATE
I am able to create a splash page and set it under the default index file, but it redirects for all 3 sites. I just want it to redirect when you first land on website2.com, not website1.com


texts: How do I assign an attribute to a group using the REST api?

texts:
I know how to create a configurable product based off an existing attribute from this tutorial on the dev docs, and I know how to create a new attribute from this answer on another question. When I create the new attribute, it shows as unassigned in my attribute set. From what I can tell, I need the new attribute assigned to a group before I can use it in the configurable/simple product payloads. What kind of request do I need to write to do this?

Basically, I want to do this using the REST api:


texts: magento 2 , write custom query in customer_address_entity, We can't save the address

texts:
I am trying to add a custom field(customer_type) value using observer to customer_address_entity table.The edit is done in BeforeAddressSaveObserver.php file.

The problem is the field is not getting saved and it just throws 'We can't save the address'. I have used this stack as an example

    <?php

namespace MY-SITE\MY-MODULE\Observer;

use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;

class BeforeAddressSaveObserver implements ObserverInterface
{

    /**
    * @var \Magento\Framework\App\RequestInterface
    */
    protected $_request;

     /**
    * @var \Magento\Framework\App\ResourceConnection
    */
    protected $_resource;

    /**
    * @param \Magento\Framework\App\RequestInterface $request
    */
    public function __construct(
        \Magento\Framework\App\RequestInterface $request,
        \Magento\Framework\App\ResourceConnection $resource
    ) {
        $this->_request = $request;
        $this->_resource = $resource;
    }

    private function getCustomerType() {
        return $this->_request->getParams()['customer_type'];
    }

    private function getEntityId($observer) {
        $customerAddress = $observer->getCustomerAddress();
        $entityId = $customerAddress->getCustomer()->getEntityId();
        return $entityId;
    }

/*    private function getConnection() {

        return $this_resource->getConnection();
    }*/

    public function execute(EventObserver $observer)
    {
        if(!count($this->_request->getParams())) return $this;

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $resource = $objectManager->get('\Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $tableName = $resource->getTableName('customer_address_entity');

        $sql = "UPDATE " . $tableName . " SET customer_type = '" . $this->getCustomerType() . "'  WHERE entity_id = " . $this->getEntityId($observer);
        $connection->query($sql);
    }
}


texts: AWS Elasticsearch with Magento 2 - Catalog Search indexer process unknown error

texts:
Magento is running on an AWS EC2 instance. AWS Elasticsearch version is 6.0, and Magento is 2.3.4.
Connectivity is successful when I check the connectivity to AWS Elasticsearch via Stores > Settings > Configuration > Catalog > Catalog > Catalog. I am using

Search Engine: Elasticsearch 6.0+
Elasticsearch Server Hostname: https://MyAWSElasticsearchServiceEndpoint.com
Elasticsearch Server Port: 443

When I do bin/magento indexer:reindex catalogsearch_fulltext I get following error
Catalog Search indexer process unknown error: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/magento2_product_1_v2/_mapping/document] contains unrecognized parameter: [include_type_name]"}],"type":"illegal_argument_exception","reason":"request [/magento2_product_1_v2/_mapping/document] contains unrecognized parameter: [include_type_name]"},"status":400}

Any help please?


texts: Filling fields forms in backend from two different tables

texts:
Currently, we have several forms that allow to edit/delete information, each one loading the data from one particular table. But what I want is to be able to load on the Form.php information from different tables.

On the code below there is a field name imagefilename. This field belongs to another table that is linked with a foreign key to the one I'm loading on the first if sentence on the line $data = Mage:: registry('banners_data')->getdata(); that was saved on the previous page at user click.

So I have the main ID and can search on the images table the needed data. But no matter how I try, it does not correctly load the information I need. I tried searching for samples but no luck or maybe I'm just not using the correct terms.

Here is a part of my _prepareForm function, without any code to load the image table as it was triggering some errors.

    protected function _prepareForm() {
        if (Mage::registry('banners_data')->getdata())  {
            $data = Mage::registry('banners_data')->getdata();
        }
        elseif (Mage::getSingleton('adminhtml/session')) {
            $data = Mage::getSingleton('adminhtml/session')->getdata();
            Mage::getSingleton('adminhtml/session')->getdata(null);
        }
        else {
            $data = array();
        }

        $form = new Varien_Data_Form(
            array('id' => 'edit_form',
                    'action' => $this->getUrl('*/*/save', $params),
                    'method' => 'post',
                    'enctype' => 'multipart/form-data',
    ));

        $fieldset = $form->addFieldset('banners_form',
            array('legend' =>Mage::helper('banners')->__('Campaign details page')));

        $fieldset->addField('banner_name', 'text',
            array(  'label'     => Mage::helper('banners')->__('Name'),
                    'class'     => 'required-entry',
                    'required'  => true,
                    'name'      => 'banner_name',
                    'note'      => Mage::helper('banners')->__('campaign name'),
                    'tabindex' => 1
    ));
.....
        $fieldset->addField('imagefilename', 'file',
            array(  'label'   => Mage::helper('banners')->__('Image to upload'),
                    'name'    => 'imagefilename',
                    'disabled'=> false,
                    'note'    => Mage::helper('banners')->__('Image you want to upload'),
                    'readonly'=> true,
                    'tabindex'=> 10
.....
}


texts: How to move Proceed to checkout button On shopping cart page Magento 2

texts:
You can try below code in checkout_cart_index.xml

<move element="checkout.cart.methods.bottom" destination="cart.summary" before="checkout.cart.summary.title"/>


texts: Magento when calling a static block's content via AJAX, images entered in CMS with {{ }} are not processed into their filename

texts:
I am trying to call a static block via AJAX. I can retrieve the text fine, however images are not processed from their {{ }} template format to the actual image path and come accross as they are written in the CMS.

{{media url="wysiwyg/groups-scenes-associations-c-296_367.jpeg"}}

This is not the case when I reference the block normally in a CMS page or phtml file, only when I get the block via this AJAX method.

So I am basically making a GET request to a script I have created, which launches an instance of Magento, calls the block HTML and echos it out to return to the original calling JavaScript - like so:

Script handing AJAX request:

require_once('../app/Mage.php');
umask(0);
Mage::app();

$block_identifier = 'delivery_country_' . $_GET['iso_country'];

$staticBlock = Mage::getModel('cms/block')->load($block_identifier);
echo $staticBlock->getContent();

Content of CMS static block

France

FR Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dignissim tempus vestibulum. Quisque tempor velit sed enim hendrerit vehicula. Donec egestas iaculis risus in bibendum. Ut est nisi, semper ac adipiscing ut, hendrerit faucibus metus. Nam mollis velit non purus congue sagittis. Phasellus sit amet felis in leo ultricies vehicula sit amet nec libero. Sed ultricies metus et quam scelerisque auctor. Vivamus et consequat orci.

Full response of script

France

FR Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dignissim tempus vestibulum. Quisque tempor velit sed enim hendrerit vehicula. Donec egestas iaculis risus in bibendum. Ut est nisi, semper ac adipiscing ut, hendrerit faucibus metus. Nam mollis velit non purus congue sagittis. Phasellus sit amet felis in leo ultricies vehicula sit amet nec libero. Sed ultricies metus et quam scelerisque auctor. Vivamus et consequat orci.

Why in my AJAX approach would the images be returned as the unprocessed {{ }} string above, rather than being processed into their proper path and filename? i.e. turning {{  }} into the image file name.


texts: Magento 1.9: Select Customer Group at Registration

texts:
This is driving me insane. I have followed every tutorial I have found and doesn't work.
I am just trying to include a radiogroup on the register screen so a customer can select 'Corporate' or 'Individual'.

I have created my module on

/app/code/local/company/CoreModifications/Controllers/AccountController.php

This overrides the default core function with:

     class Company_CoreModifications_Customer_AccountController extends  Mage_Customer_AccountController {

    /**
     * Get Customer Model. Overrides Magento function to setup group depending on customer selection.
     *
     * @return Mage_Customer_Model_Customer
     */
    protected function _getCustomer()
    {
        $customer = $this->_getFromRegistry('current_customer');
        if (!$customer) {
            $customer = $this->_getModel('customer/customer')->setId(null);
        }
        if ($this->getRequest()->getParam('is_subscribed', false)) {
            $customer->setIsSubscribed(1);
        }
        /**
         * Initialize customer group id
         */

        if($this->getRequest()->getPost('group_id')){
            $customer->setGroupId($this->getRequest()->getPost('group_id'));
        } else {
            $customer->getGroupId();
        }

        return $customer;
    }
}

I have set up my module config file with:

 <frontend>
  <routers>
  <customer>
    <args>
      <modules>
        <Company_CoreModifications before="Mage_Customer">Company_CoreModifications_Customer</Company_CoreModifications>
      </modules>
    </args>
  </customer>
 </routers>
</frontend>

I have modified the customer config.xml on
/app/code/core/Mage/Customer/etc/config.xml with:

 <global>
   <fieldsets>
     <customer_account>
        ...  //rest of config fieldsets
       <group_id>
         <create>1</create>
         <update>1</update>
       </group_id>
     <customer_account>
   <fieldsets>
 <global>

and of course I have modified my template to include the radiogroup:

            <input name="group_id" class="user_type" value="4" type="radio" tabindex="1">
            Corporate
            <input name="group_id" class="user_type" value="1" checked="checked" type="radio" tabindex="2">
            Individual

But the value is not saved on the database
The examples I have found are done on versions before Magento 1.9 which is the one I'm using.

I have tried to follow the saving process on Magento and it seems that it saves a customer entity with the correct data but this is not saved on the database yet, then it saves two address entities and then again another customer entity where the customer details are correct but the group_id is changed to the default value, in my case 1. After that it is when the entity is saved so the group_id is incorrect (in my tests I want to get 4).


texts: Magento checkout cart fieldset - how to remove annoying colon showing

texts:
In my checkout cart of magento using a custom template I get this annoying colon showing above the cart items:

It just showing a colon, its not affecting anything, but it looks like "this shop is not working", it gives some wrong signals to the user, I think...

The frontend source shows:

<fieldset>
   :

<table id="shopping-cart-table" class="data-table cart-table">

...and there we have it...!!! - the colon showing just after the fieldset.

cart.phtml i have testet and come up with the conclusion that it must be related to the getItemHtml($_item) ?>

First, what is it supposed to shown ?
Second, how do I remove it or at least hide it ?


texts: Import product images with slash in the SKU

texts:
I need help with this problem:

I upload the articles on magento through Magmi v0.7.22 and associate the images to the product through the plugin "Value replacer", because sku and images have the same name: {item.sku}.jpg.

Until here everything is fine.

It happens that I have some sku with the character / (slash) in the sku, for example: 23df.124/rpo and obviously I can not give the same name to the image.

Can you give me a suggestion on how to solve this problem?
Thank you and apologise for my poor English.


texts: Magento2 :: Accessing $_FILES using Magento Framework

texts:
I am current working on a file upload functionality in Magento. Everthing is working great.

I am using the \Magento\Framework\File\Uploader and files are getting properly uploaded.

The issue I would like to check if the file has been uploaded by the user before I initialize the Uploader class.

Currently I am doing is like:

if (!empty($_FILES[$field]['name'])) {
    try {
        $uploader = $this->_uploaderFactory->create(['fileId' => $field]);
        $uploader->setAllowedExtensions(['jpg','jpeg','gif','png']);
        $uploader->setAllowRenameFiles(true);
        $uploader->setFilesDispersion(false);
        $_FILES[$field]['name'] = str_replace(' ', '-', $_FILES[$field]['name']);
        $path = $this->_getUploadPath();
        $uploader->save($path, $_FILES[$field]['name']);
        $this->_myModel->setData(
            $field,
            "manufacturer/".$uploader->getUploadedFileName()
        );
    } catch (\Exception $e) {
        $this->messageManager->addSuccess($e->getMessage());
    }
} else {
    unset($_FILES[$field]);
    //Removing it from data set as no new
    //file was uploaded (fix for edit action)
    $this->_myModel->unsetData($field);
}

I would like to know if there is a better way to access $_FILES super global using the framework request object by using something like ?

$this->getRequest()->getFiles()

instead of accessing it directly which I think might be a bad practice to follow.

I tried to search this in the codebase but didn't get anything relevant.

  I am more interested in learning how we may access the $_FILES super global the magento way by using the magento Request object not how the proper way of uploading files


texts: How to Check my Current Product is Already added to Wishlist Magento 2

texts:
<?php
 echo "<pre>";
 print_r($this->helper('Magento\Wishlist\Helper\Data')->getWishlistItemCollection()->addFieldToFilter('product_id', $_product->getId())->count());
 die();
 ?>

I am using this Query to get wish list added product Count but it returns always '0', my current product is already added into wish list !! How to solve this issue?

  vendor/magento/module-wishlist/view/frontend/templates/catalog/product/view/addto/wishlist.phtml

Currently, I am testing with 'wishlist.phtml' vendor file


texts: Magento2: How to allow the site to crawl the pages

texts:
Here is my Robots.txt file

User-agent: *
Allow: /

Sitemap: abc.com/sitemap.xml

But the pages are still blocked. Please suggest is there any other options in Magento admin to enable this.

Thanks