texts: Error running setup:upgrade : Base table or view not found: 1146 Table 'db.inventory_low_stock_notification_configuration' doesn't exist

texts:
I'm using Magento 2.3.4 and i disabled all Magento 2 inventory extensions, when running php bin/magento setup:upgrade, i encountered this error:

Schema creation/updates:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbname.inventory_low_stock_notification_configuration' doesn't exist, query was: SHOW CREATE TABLE inventory_low_stock_notification_configuration

i already ran the following command, but still got the same error:

rm -rf var/cache/
rm -rf var/page_cache/
rm -rf generated/code/
rm -rf generated/metadata/
php bin/magento setup:di:compile


texts: Merge 2 tabs into 1 on Customer Information page

texts:
How can I merge 2 tabs into 1 tab on this admin page:

Customers -> Manage Customers -> Click on a customer

The tabs I'm wanting to merge are "Customer View" and "Account Information".

It seems that the "Customer View" tab loads it's block and template through the customer.xml layout file.

And the "Account Information" tab seems to loads it's block in Tabs.php by calling createBlock(..)->initForm()->toHtml().

I'm unsure how I can use both tab's html content on 1 tab.


texts: Magento 2 check product attribute already exsists

texts:
I want to check if product attribute with same code already exists in setup file of my custom module?

How I could check it?


texts: How to change the title on Purchase Order in Checkout?

texts:
I want to be able to replace "Purchase Order Number" to just "Order Number", I couldn't find the right phtml file that handles this.

Does anyone know what is the right phtml or html file, so I can change the wordings? Thank you.


texts: Magento2 How to create accordion checkout flow

texts:
I want to create checkout flow like Magento 1 in Magento 2.
Can any one guide me for that how can I achieve this in Magento 2.


texts: CE 1.9 - If Category Layered Navigation has 0 Filters changed to One Page Column template

texts:
Currently using the 2-column-left template for category pages. The layered navigation shows up on the left (with attribute filters) but when there is nothing to show (no attributes for that specific category) the entire left column ends up being a vast empty space.

For these specific categories that have no filter attributes to show i would like to avoid this whitespace by switching to the one column template but only for those categories that have no attributes.

How can i achieve this please? If not through templates perhaps there is a way to add a CSS selector where i can modify the width to 100% based on the presence of the selector?


texts: Does magento update paypal with tracking information?

texts:
I'm trying to determine if magento will update paypal with tracking when a shipment is created.  My work flow right now is as follows.

Orders created on Magento site via paypal advanced.

Order is captured by THUB and a shipping label is created. A shipment is created on magento which sends the appropriate emails out.

It's at this point that I have to manually copy the tracking number over to paypal.  Shouldn't magento send paypal the tracking information when a shipment is created?

Any help or suggestions is always appreciated.


texts: SyntaxError: Unexpected end of JSON input

texts:
In Ajax call it always gives

XMLHttpRequest cannot load https://misfitlondon.co.uk/rubymage/default/login/. Request header field X-Prototype-Version is not allowed by Access-Control-Allow-Headers in preflight response.

Before 1 hour it does work fine https://misfitlondon.co.uk. Have any one idea why this happening.

I did'nt change any code in any file except styles.css.

Thanks


texts:
http://www.pretaplay.co.uk/special-offers.html?p=5

Hi all,

the above link is the beginning of the pages with the issue. Page 5 on this link is duplicated an extra 5 times. Eg page, 6,7,8,9 and 10 feature the same content. On the Sale section.

How would I go about sorting this issue?

Thankyou


texts:
I wanted to call Web service using POST method and attache the Data values.

Here is my URL : http://api.geonames.org/citiesJSON which takes below data in POST.

north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de&username=demo

How can I Form POST URL and Call POST Web service. Thanks in Advance.


texts: Shifted My magento 2 store from local server to AWS

texts:
I am new to aws and uploaded my current magento2 store also have done the installation process regarding apche 2 php, mysql and phpmyadmin installation also installed composer in root directory now when I enter the magento root directory it is displaying me it as

So What should I do to connect it with database


texts: Discount on categories but how to exclude already discounted products

texts:
I need to discount some categories in a magento shop which is not a problem. But I would like to exclude already discounted items in shop that has been setup manually on the products.

So I need a rule which includes the categories and exclude the items which already are on sale.

I hope someone can help me out.

Many thanks


texts: How to use Lottie animation library in Magento 2?

texts:
we are using Magento V 2.3.5-p1.
According to the client's requirements, they want to display animation in some of the pages. for that, they gave us .json file for animation. we have used Lottie js to display animation on the website. For that I have uploaded lottie-player.js file in app/design/frontend/{Vendor}/{theme}/web/js directory and included this JS in default_head_blocks.xml file.
After including this JS file I am getting js error in browser's console and this error seems to be in all pages. Because this js error other default scripts are not working sometimes. please refer below screenshot for the error

This error is related to the "define()" function. So, my conclusion is that the "define()" function is already defined in Magento's default jquery. So when the lottie-player.js loads on the website it is conflicting with Magento's default jquery because this file also have it's own "define()" function.
Have anyone used the Lottie animation library in Magento 2? Can anyone give me any suggestions on how can I use Lottie animation js in Magento 2?


texts: configurable swatch products not working properly

texts:
I have one question regarding configurable swatches.

I have purchased theme forest bizzare theme for magento and i transfer all configurable swatch folder in my bizzare theme.

and in product view page and listing page in color and size get configurable swatch but when i click on color in view or listing page products get blank.

can i know what is the issue and i am done wrong in this.

can you guide me in this what should i do to get product swatch correct on click.


texts:
Installing user configuration...
[ERROR] CredisException: Connection to Redis localhost:6379 failed after 2 failures.Last Error : (10061) No connection could be made because the target machine actively refused it.


texts:
So I just added a Buy Now button in my store using this previously answered question: Magento 1.9 How to add buy now button in product page?

Everything works fine, however I'm getting a pop up after pressing the Buy Now button.

It reads:

www.mystore.net says: https://www.mystore.net/checkout/cart/add/uenc/aHR0cHM6Ly93d3cucGI4ZWxtYXJrZXQubmV0L3dhbmQuaHRtbA,,/product/8/form_key/qPvLAuhxmDQklkqt/

Image: http://i.imgur.com/qWTgiGU.png

Is there anyway to just bypass it throwing this message?

Javascript added to app/design/frontend/ultimo/pixel/template/catalog/product/view.pthml:

var productBuyNowForm = new VarienForm('product_addtocart_form');
productBuyNowForm.submit = function (button, url) {
  if (this.validator.validate()) {
    var form = this.form;
    var oldUrl = form.action;
    alert(form.action);
    if (url) {
        form.action = url;
    }

    /* add return Url */
    var inputreturn= document.createElement("input");
    inputreturn.type = "hidden";
    inputreturn.name = "return_url";
    inputreturn.value = "<?php echo Mage::getUrl('checkout/onepage')?>";
        document.getElementById('product_addtocart_form').appendChild(inputreturn);
    /* add return Url */
    // Append a line break
    var e = null;
    try {
        this.form.submit();
    } catch (e) {
    }
    this.form.action = oldUrl;
    if (e) {
        throw e;
    }

    if (button && button != 'undefined') {
        button.disabled = true;
    }
  }
}.bind(productBuyNowForm);

Button added to app/design/frontend/ultimo/pixel/template/catalog/product/view/addtocart.phtml:

<button type="button"
    title="<?php echo $buttonTitle ?>"
    class="button btn-cart"
    onclick="productBuyNowForm.submit(this)">
 Buynow
</button>


texts: Magento 2 - How to remove Font Family and some other section of wysiwyg editor from a 3rd party module?

texts:
I have a 3rd party extension and for a field they've used "wysiwyg editor" but we want to remove some section of the editor e.g-fonts etc

please see the image:-

How can we achieve?is this possible?

Note:- Remember,we've to remove only some sections and fields not whole wysiwyg editor only for a 3rd party extension.

Update for @Hasham :- path for tiny_mce:-

Waiting for the reply!!!


texts: Auto Fill Magento Attribute based on another Magento Attribute Entity

texts:
I have multiple custom attributes in Magento.
Several share very similar names and serve the same purpose, yet the entities are different.

IE: Attribute One: Strap Color (eBay); Attribute Two: Strap Color (Amazon)
For the Attribute One (eBay) the entity would be: Beige whereas for the Attribute Two (Amazon) the entity would be: Cream

What I am looking to achieve is, when I enter entity Beige into Attribute One - this should automatically fill Attribute Two`s entity as Cream

Same goes to many other attributes.


texts:
I added a second domain to my web server. I had my hosting company assist with postfix configuration. Since then I am able to send email from the  command line using php:

php -r 'mail("destination@mycompany.tld", "Test Subject", "Test Message", "-f sales@secondarywebsite.tld");'

When I use the above to send email to either Outlook and Gmail, everything is perfect, so long as I include the "-f sales@secondarywebsite.tld". Email from Magento, on the other hand, shows me the email is "sent by/via" sales=secondarywebsite.tld@mainwebsite.tld.

Since as far as I know Magento is using the php mail command, why am I not getting the correct from address? What can I do to fix this? This seems like it would be a very common problem to have, I would think there is some sort of setting in Magento I'm missing.


texts: Speed up layered navigation filter in Magento

texts:
Any way to speed up the layered navigation?  I'm using a Manapro Filtered Navigation extension for some extra features, but it still takes about 5-6 seconds when I change each filter.

I only have 5 visible filters, so hopefully it's not that.  There are about 65k variations of products, so I don't know if it's just that, and maybe I need to look into speeding the mySQL queries somehow?

Any ideas?


texts: No such entity with id = 0 for CategoryRepository

texts:
I am new to magento2. Have worked enough on magento 1 but this is my first project with magento 2.2 and i ran into issue.

I have magento 2.2 setup and installed template monster theme. Everything was working fine. Then i started adding content of my own and created few categories. Later i realize i didn't want 1 root category which i created. so i deleted it and then i started getting this error on front side. Back-end is working perfect.

Here is a full list of errors i am getting.

http://prntscr.com/ie23qk

I already tried disabling theme and extensions. None of them work. Basically magento is looking for category id 0 which is not there as it always start with 1 in db. I am not sure how to solve or dont know where to see.

Any guidance will be helpful.


texts: In Magento2, Have it has the database diagram yet ? I just found diagram for magento 1.x, Magento Database Diagram


texts: Is it possible to run a query to find a list of products with no images assigned to them? Ideally I'd like SKUs printed out on the screen.


texts: Include a generated coupon code in Order E-mail Template if the subtotal is above a specified amount

texts:
Can this be done in Magento automatically? For example I have a promo in my site that is something like this.

If the customer's total order is $100 or above, an uniquely generated coupon code will be included in the new order template that will be sent to the customer's e-mail.

I tried looking of how to set it up inside Magento admin, but it seems to be not a built-in feature. Any suggestions or quick+dirty ways to implement this are welcome.


texts: How to update product store_view attributes (name, description) programmatically?

texts:
There is possible to have different product name and description because these attributes have store_view scope.
Please take a look at screenshot

To update product programmatically code should be something like:
$sku = 'sku1';
$storeId = 0;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $obj->create('\Magento\Catalog\Api\ProductRepositoryInterface')->get($sku,true, $storeId, true);

$_product->setShortDescription('short description');
$_product->setCustomAttribute("abc", 'abc');
$_product->save($_product);

But in that case product short_description attribute will be updated in all scopes.
How to update product in selected store_view scope?


texts: magento - add brand pages to sitemap.xml

texts:
i have a page with all the brands in my store. generated from the attribute "manufacturer".

all brand have their own brand page. like mydomain.com/canon.html

Is it posible to add all these brandpages to the sitemap.xml?

And how do i do that?

I have magento 1.8.1 CE


texts: Is it possible for order collection filter by attribute?

texts: I need to filter the order collections based product attributes. Is it possible. Product attributes stored in sales_flat_order_item ( product_options). But in this field stored in serialization form. How to search the orders based on the product attributes?


texts: Add a new row at start of grid collection of custom module grid tab

texts:
I have a collection ,which has total 30rows,Now,i want add new row at start of grid collection.

Current code of prepareCollection() in grid.php

protected function _prepareCollection()
    {
        $card = Mage::registry('amit_data');

        Mage::registry('amit_data')->setData('temp_amount', $card->getCardAmount());
        $collection = Mage::getModel('amit/order')->getCollection()
            ->addFieldToFilter('id_amit', $card->getId());
        $collection->getSelect()->joinLeft('sales_flat_order', 'sales_flat_order.entity_id=main_table.id_order', 'sales_flat_order.increment_id as increment_id');
        //$this->_prepareInitialRow();

        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

Current state

I want this type work


texts: Add Captcha to magento 2 contact form on cms page

texts:
I have to add captcha on the contact form. It's working on the default contact URL but not working with the contact form on CMS page.

<p>{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}</p>

<referenceContainer name="form.additional.info">
<block class="Magento\Captcha\Block\Captcha" name="captcha" after="-" cacheable="false">
    <action method="setFormId">
        <argument name="formId" xsi:type="string">contact_us</argument>
    </action>
    <action method="setImgWidth">
        <argument name="width" xsi:type="string">230</argument>
    </action>
    <action method="setImgHeight">
        <argument name="width" xsi:type="string">50</argument>
    </action>
</block>
</referenceContainer>
<referenceContainer name="after.body.start">
<referenceBlock name="head.components">
    <block class="Magento\Framework\View\Element\Js\Components" name="captcha_page_head_components" template="Magento_Captcha::js/components.phtml"/>
</referenceBlock>
</referenceContainer>

Please give me some suggestion or help.


texts: Magento 2 how to Add Facebook Pixel code?

texts:
How to add facebook pixel code in Magento 2.Is there any free module is available or do we need to create custom module for that?

If anyone implemented this please share ideas.


texts:
I’m trying to enable a module in my Magento 2.2.2. But as in the readiness check, PHP Settings Check is giving me the following error.

so, I checked my PHP Memory Limit and here the screenshot

I also tried installing through SSH but what it only does it give me random glitches.


texts: How to generate just a single row for each product in a Dataflow Profiles export?

texts:
We are exporting a list of products from Magento 1.9 using a Dataflow Profiles export.
The resulting export file includes multiple rows for each product if the product has more than one image (eg if the product has 3 images there will be 3 rows for the product in the resulting CSV file).
We would like to have just a single row per product regardless of the number of images for each product.
I assume this can be done by adding some XML to the "Actions XML" field.
How can we force the export to only generate a single line for each product (always just the first line if there is more than one line per product)?


texts: Magento 1.9 Importing products from csv error

texts:
Import products using csv to my store. It will display this errors. Thanks

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
update a child row: a foreign key constraint fails
(`mglab`.`catalog_product_entity`, CONSTRAINT
`FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY
(`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`)
ON DELE), query was: INSERT INTO catalog_product_entity       (entity_id,entity_type_id,attribute_set_id,type_id,sku,has_options,required_options,created_at,updated_at) VALUES ('','4','','simple','UF-222','0','0','2016-10-28 03:54:53','2016-10-28 03:54:53') ON DUPLICATE KEY UPDATE entity_type_id=VALUES(entity_type_id),attribute_set_id=VALUES(attribute_set_id), type_id=VALUES(type_id), sku=VALUES(sku),has_options=VALUES(has_options),required_options=VALUES(required_options), created_at=VALUES(created_at), updated_at=VALUES(updated_at);


texts: how to add a prefix to Magento product URL’s in magento 1.9.2.1?

texts:
Adding a Prefix to Product URL’s in Magento

I have follow below  instructions but its not showing prefix product url.Can anyone help me For this?

Copy:

/app/code/core/mage/catalog/model/url.php

To:

/app/code/local/mage/catalog/model/url.php

Replace :

if ($category->getLevel() > 1) {
           // To ensure, that category has path either from attribute or generated now
           $this->_addCategoryUrlPath($category);
           $categoryUrl = Mage::helper('catalog/category')->getCategoryUrlPath($category->getUrlPath(),
               false, $storeId);
           $requestPath = $categoryUrl . '/' . $urlKey;
       } else {
           $requestPath = $urlKey;
       }

To:

if ($category->getLevel() > 1) {
            // To ensure, that category has path either from attribute or generated now
            $this->_addCategoryUrlPath($category);
            $categoryUrl = Mage::helper('catalog/category')->getCategoryUrlPath($category->getUrlPath(),
                false, $storeId);
            $requestPath = 'product-p/' .$categoryUrl . '/' . $urlKey;
        } else {
            $requestPath = 'product-p/' .$urlKey;
        }
}


texts: Hide the main menu for CMS Pages in Magento2?

texts: Hide the main menu for home page and main menu display for another pages in magento2.?


texts: rewrite _prepareCollection and add custom attribute to filter for product grid

texts:
i want to rewrite the product grid like this

 protected function _prepareCollection() {

    parent::_prepareCollection();

    $this->getCollection()->addAttributeToFilter('supplier', array('eq' => 11));

    return $this;

 }

config.xml

   <blocks>
       <adminhtml>
           <rewrite>
               <catalog_product_grid>Namespace_Modulenam_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid>
           </rewrite>
       </adminhtml>
   </blocks>

the supplier is a custom attribute, i want the products show only according to the supplier attribute, the above code still show all the products, anyone know what's wrong with about code?


texts: How to create custom report for category data in Magento 2?

texts:
I am trying to create a report for categories.

Vendor/Module/registration.php

<?php

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

Vendor/Module/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
 <module name="Vendor_Module" setup_version="1.0.0"></module>
</config>

Vendor/Module/etc/adminhtml/menu.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
    <add id="Vendor_Module::seoreport" title="Seo Reports" translate="title" module="Vendor_Module" sortOrder="60" parent="Magento_Reports::report" resource="Vendor_Module::report"/>

    <add id="Vendor_Module::index" title="Category Meta Data" module="Vendor_Module" sortOrder="10" action="module/index" resource="Vendor_Module::index" parent="Vendor_Module::seoreport"/>
</menu>

Once the menu is clicked, I need to load the report screen with, all the category info like,

  Category Id

  Category name

  Meta Title

  Meta description

  Category description and etc

Help me with what are the steps I have to follow to get the grid like order and Best seller report with the export feature of Csv and Excel.

Any suggestions are appreciated!! It will be helpful if anyone update me with working code. Thanks..


texts: Override sendEmail() in shipment.php and emailAction() in ShipmentController.php

texts: anyone can help me , I am new to magento 1.9 and I need to override emailAction() in  ShipmentController.php and sendEmail() in shipment.php.For that what I have to do.In that screenshot , I need to override the button action of Send Tracking Information


texts: layout_generate_blocks_after observer is not redirecting to checkout/cart page in Magento 2

texts:
I'm using the observer layout_generate_blocks_after to perform redirection to an empty cart on a condition but it is not redirecting. Any help would be appreciated.
Here is the piece of code which i try to do:
$cart->truncate();
$cart->save();

$redirectUrl = $this->urlBuilder->getUrl('checkout/cart');

$this->_responseFactory->create()->setRedirect($redirectUrl)->sendResponse();
die();


texts: Change default sort order in Manage Products admin

texts:
In the admin Manage Products area, I want to set the default sort to newest first (via created_at) so the latest products added to my site are displayed first.

Everything I have tried to fix this doesn't seem to work and the majority of fixes appear to apply to the front end only, whereas I need it strictly for the back end.

Any suggestions?


texts: Magento 2: upgrade module with EAV attributes

texts:
I am working on a custom module with EAV attributes / models.
I have added some attribute in my setup script and the module is installed and working.
Now as the requirement changed, I need to add a new attribute in my script.
How can i write and upgrade script for the same.


texts: Is it safe to permission set 777 for var?

texts:
I saw 'Never use 777 for security reason' and I also found Magento 2 recommended permission setup on Magento 2 folder/file permissions
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;

Is it safe to use 777 for those and why?


texts: M1. How can I move Storenames to another Website

texts: M1. How can I move a storename to another website?


texts:
I'm working on a module that will show a wizard on the frontend which ends up showing an advice on what products to buy after a couple questions.

To show an advice there will be a backend where i need to link products just like the cross-sells, upsells and related product tab on the edit product page. Does anyone know a tutorial i could follow to accomplish this?


texts: Magento 1.9 change error placement of validation

texts:
I have the below code on my product view page:

<input type="text" class="price required-entry input-text" name="price">
INR

Since it has require-entry class the default magento validation works fine but the position of the error div shifts the position of my label. Currently on validation failure the structure is:

<input type="text" class="price required-entry input-text validation-failed" name="price">

This field is required.

INR

However, I want it as:

<input type="text" class="price required-entry input-text validation-failed" name="price">
INR

This field is required.

I want the error div to be after the span.

Thank you.


texts: How can Set filter collection in custom model by product id magento 2

texts:
I want to filter collection in my custom model by product id to load the filter data value in admin grid.

My Model:-
Vender\Modulename\Model\Outofstock

namespace Vender\Modulename\Model;

class Outofstock extends \Magento\Framework\Model\AbstractModel
{
    protected function _construct()
    {
        $this->_init('Vender\Modulename\Model\ResourceModel\Outofstock');
    }
}

Resource Model:-

namespace Vender\Modulename\Model\ResourceModel;

class Outofstock extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
    protected function _construct()
    {
        $this->_init('custom_table', 'id');
    }
}

Collection:-

namespace Vender\Modulename\Model\ResourceModel\Outofstock;

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
    protected $_idFieldName = 'id';

    protected function _construct()
    {
        $this->_init(
            'Vender\Modulename\Model\Outofstock',
            'Vender\Modulename\Model\ResourceModel\Outofstock'
        );
    }
}

I have already created a field with product_id and value 14

Please suggest me.If any other way is available to filter the collection before load in admin grid.

Can any one help me on this problem ? Any references or suggestions are highly appreciated.


texts: Magento 2 - Not allow to add same product into cart

texts: We are developing a custom module for not allowing user to add the same product (same SKU) into the cart. In the official documentation, I cannot find any information about it. Which class I should override to achieve this?


texts: Please choose to register or to checkout as a guest pop show on Guest checkout in magento v1.9.3.7

texts:
After selecting a product and going to checkout page during the guest section, after clicking on continue, it shows pop up message which is:

Please choose to register or to checkout as a guest.

In backend section, guest checkout is enabled.

What is missing in this?


texts:
i want to override price filter slider , like add 100 to end price slider , can it be done in some way which event / observer have i to override .

Please guide me way to do this


texts: Magento 2.3.4 PWA "Sorry! There are no products in this category"

texts: I've added a product in What's New Category I can see the product in there when I navigate to non-pwa magento frontend version. But still say: "Sorry! There are no products in this category" and show no products in PWA frontend version, Run all possible bin/magento commands yet no sign of the product anyone has any idea why and what i need to do?


texts: How to show subcategories in magento like refer website?

texts:
Here , Parent category is Chairs.
& subcategories are modern, classic, patio, event....etc.
Like this website: http://www.example.com

there are categories With images at the top under refine text

How to show these subcategory in category page with images in magento.


texts: What is the scope of "$this" and what are the drawbacks of using it?

texts:
Having basic knowledge of JAVA, I understand that usually "this" keyword is used for local references made within a class.

But as far as PHP OOP is concerned, and more specifically as far as Magento is concerned, what is the scope of "$this" which is used to make references (for example, calling methods, etc.) everywhere within block files, template files.. and so on??

What are the drawbacks if we make this kind of direct references through "$this"??

Thanks in advance :)


texts: Redirecting old sub-domain store url to new store search

texts:
I have a 2nd store which I'm closing and consolidating to my existing store. Instead of simply redirecting old links to a base directory I'd like to leave the customer looking at a search page result that best fits what they were trying to see on the store I'm closing.

For example, my current "old" store hosted on a separate subdomain looks like this:

http://subdomain.example.com/store/url-key

However I'm trying to use htaccess to redirect to my main domain (www) and convert the "url-key" to use "+" instead of "-" so that we can use it as the "q" like the following:

http://www.example.com/store/catalogsearch/result/?q=url+key

For now I'm redirecting all of my traffic to the base domain which I think is bad for SEO and user experience.

RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$
RewriteRule (.*) http://www.example.com/store/ [R=301,L]

I've tried all different combinations of htaccess redirects however I'm struggling to make it work correctly.


texts: Add Print Invoice Button after Payment (On Thank You page)

texts:
Is there a possibility to add a Print Invoice Button on thank-you/success page?  (See example)

I know User can get Invoice if they fill in this form:

https://www.domain.com/sales/guest/form/

Please advise,
Sandra


texts: Magento 2: The configuration parameter "componentType" is a required for "product-details" component

texts:
I am getting the following error when I try to edit a product in Magento Admin. What should I do solve this issue?

  Exception #0 (Magento\Framework\Exception\LocalizedException): The
  configuration parameter "componentType" is a required for
  "product-details" component.


texts: Magento 2 product collection category filter category position sort

texts:
Hi i am trying to get product collection with category filter and category position sorting but it not working
i tried below way
 $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addCategoriesFilter(array('eq' => $category->getId()));//
        $collection->addAttributeToSort('position');
//->setOrder('cat_index_position','ASC')

please any one tell me how to sort category positon


texts: preoverride extension files by customized theme

texts:
we installed fresh magento site , everything was working fine

the "add to cart" button was calling from addtocart.phtml file under

app/design/frontend/default/em0113/template/catalog/product/view/addtocart.phtml

but later we added an extension, than addtocart button calling from

/app/design/frontend/default/default/template/extension_name/catalog/product/view/addtocart.phtml

extension addtocart.phtml is overwriting the current addtocart.phtml file

please help what i have to do to override the extension file by normal addtocart.phtml file


texts:
I know its a simple question, but I am getting an issue while disabling my Magento_Banner.

I followed this doc

  https://devdocs.magento.com/guides/v2.3/config-guide/config/disable-module-output.html

But i am getting this error Table magento_banner do not have a column with name banner_id on running bin/magento setup:upgrade command.

on running bin/magento module:disable Magento_Banner


texts: Is there a cron job that I can turn on or some setting that I must set, so when I make changes in Magento2 admin panel while in developer mode, that I do not have to go to cache page and flush cache manually every single time ?


texts: Magento 2.2.1: Attribute values sort by name

texts:
I write here for an help.

Magento 2.2.1: For a few days I'm using Magento 2, after I used it for a couple of years Magento 1. I am aware of the presence of an important discomfort: attribute values are not sorted alphabetically, but only by order of insertion.
It's a serious problem, especially if the variables are so many. How can I fix it?

I tried to follow the other solutions in this forum, but I could not solve it.

Thank you in advance


texts: Magento 2.1.5: Products Missing in Categories after Reindex

texts:
I am running Magento 2.1.5 and facing a really strange issue. I have over 6,500 products uploaded to the store but some items are not showing up after performing a complete reindex. Of course, some items are out of stock but many of the products that are not showing up in their respective categories are the similar as others that are showing up just fine. These products are simple (not configurable) and belong to do the same attribute group.

Upon searching for the items in search the missing products show up. Upon saving the item the item appears again only to go missing again upon reindex.

After performing reindex one by one, I noticed the issue is affecting the following tables:

catalog_category_product
catalog_product_category

I even went ahead and added a row which made the product appear again on the front-end but after reindexing the row was deleted.

Does anyone have any clue as to what this issue could be? It's very, very strange but I'm hoping there is a simple solution.

Update 02/27/2017: I am still not able figure out a solution for this bug. If any Magento Expert can gain some insight into this and fix it he or she will be rewarded.


texts: Version Control for Magento mainly for the looks

texts:
We have a Magento webshop version 1.9.2, and I am trying to achieve the following scenario, please advice on the best way to achieve this:

Having a local test environment, connected to a version control such as Github such that we can go backward and forward with the changes made, two things are being tried:
- changing and editing the layout of the webshop, that is the looks and all the things done by the cms admin which later is stored into the database.
- Installing and playing around with different extensions(We do not develope any modules or extensions ourself, we just use what is out there).

What is the best solution for such a quest?


texts:
Anyone who experience that your frontend website is just loading just like this?

But the backend works properly. this is a Magento 2.2 platform. I am stuck on this please anyone can help me? thank you


texts: Can't access session into admin phtml file on Magento 2

texts:
I tried to set a session from a model file and access this on a phtml file like this and it's not working:

namespace/vendor/Model/ProcessModel.php:

    protected $backendSession;

    public function __construct(
        .....
        \Magento\Backend\Model\Session $backendSession,
        ....
    ) {

        $this->backendSession = $backendSession;
       ...
    }
    public function execute(Observer $observer)
    {

        $postdata = $this->_request->getPost();

        $t1 = $this->backendSession->setMyNam('test');
        $t2 = $this->backendSession->setMyNum('test2');
        $t3 = $this->backendSession->getMyNam();

        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info(print_r($t3, true));
    }

}

When I logged this, I received my value in my test.log which means that the session is set.

Now I want to get this session in a phtml file located at \namespace\vendror\view\adminhtml\templates\items\column\name.phtml.

To do that in my helper file located at \namespace\vendror\Helper\Product\View\Personalized.php I have this:

protected $backendSession;

public function __construct(
    ....
    \Magento\Backend\Model\Session $backendSession,
    ....
) {
    ....
    $this->backendSession = $backendSession;
    ...
}

public function getSession(){

    return $this->backendSession;
}

public function getSession1(){

    return $this->backendSession->getMyNam();
}

and in my phtml file name.phtml I try to get this value like this:

$var=$this->helper('namespace\vendor\Helper\Product\View\Personalized');

$nam = $var->getSession()->getMyNam();
$num = $var->getSession1();

and I receive nothing.

If I set my function getSession() to return a value like: return "text"; I receive this value in my phtml, but this is not working only with the session value.

What am I doing wrong? Why can't I see in my phtml the value set in the session?


texts:
I have created two stores with different themes. I want the first one to be loaded on http://example.local and the second one on http://example.local/shop.

Code for my second store view and I check Add Store Code to Urls in |Stores| -> |Configuration| -> |Web|.

When I go to http://example.local/shop, only html is loaded and in console I get this error:

The resource from “http://example.local/version1500395539/frontend/.../css-fix.css” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).[Learn More]  shop
The resource from “http://example.local/shop/shop/pub/.../css/config_3.css” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).[Learn More]  shop
The resource from “http://example.local/version1500395539/frontend/.../css/swatches.css” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).[Learn More]  shop
The resource from “http://example.local/version1500395539/frontend/.../css/styles-m.css” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).[Learn More]  shop

I try to deploy, permissions are fine, so, does any one have any idea what could it be?

Thank you.


texts:
I am able to apply discounts in a few areas pretty easily, but one area I cannot and want to be able to is apply a 20% discount if you purchase 4 or more identical items.  Below is the current Shopping Cart rule I have.  This rule won't apply any discounts though and I don't understand why.  I've tried other things, but they either do nothing, or apply the discount on everything in the cart, not just the products in the specified Category.

Can someone point me in the right direction please?  Am I misunderstanding what Row Quantity is?  Is there another way I can do this?  Thanks.


texts: magento 2.3.3 review not showing on product page

texts:
I migrate Magento 1.9.4 to Magento 2.3.2 everything is working fine but review not showing on the product page, even its total number of reviews on the product and the stars as well, also show in the widget but not appearing under reviews tab, review form also working fine.

Any solution thanks in Advnace ?


texts: Magento 2: Conver SQL Query to Magento Format

texts:
In addition of Magento 2 How to set group by in Collection query?

I have below query now.

SELECT t1.* FROM messages t1 WHERE t1.id = (select max(id) from messages t2 where t2.posts_id = t1.posts_id and t2.from_user_id = t1.from_user_id)

How can i convert it to Magento format as given answer

$collection = $this->collectionFactory->create()
           ->addFieldToFilter('id', $id)
           ->addFieldToFilter('status', 'Enable');

$collection->getSelect()->group('posts_id')->order('id DESC');


texts: CSS and JS files not loading in Production mode

texts:
I am changing my site to Production mode but CSS,JS is not loading after changing to production mode.

Group product has very odd issue. Display in Developer mode but not in Production mode.


texts:
I add a new step in checkout.
Now I am working on functionality like if customer logged in: default shipping step disabled it's working fine.

But it displays both my custom step HTML and also shipping step HTML in the first step.

This is my Knockout js where I add if condition for check customer login status.

Shipping.js

define(
    [
        'jquery',
        'ko',
        'Magento_Customer/js/model/customer',
        'Magento_Checkout/js/view/shipping'
    ],
    function(
        $,
        ko,
        customer,
        Component
    ) {
        'use strict';
        return Component.extend({
            defaults: {
                template: 'Prince_CheckoutStep/shipping',
            },
            visible: function(){
                if(!customer.isLoggedIn())
                {
                    ko.observable(false);
                }
                else
                {
                    ko.observable(true);
                }
            },

            initialize: function () {
                var self = this;
                this._super();
            }
        });
    }
);

This is my HTML where I add fadevisible property to li tag

        <button type="button"
                data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
                class="action action-show-popup">
            </button>

Also please explain what is difference between visible, fadevisible and enable in knockout js.


texts: Magento Hosting - Have I reached the max speed on shared?

texts:
I'm not sure if this question is allowed according to the question guide.
However I have got a Magento store with bout 620 products (planning to reach 1.5k-2k) on a shared hosting on h*stga*** since the cost of dedicated server is not affordable, I have tried to reduce the load time: 2.4 seconds and 0.889 for fisrt byte.
I have:

Disabled etag
Enabled gzip
Added future header
Reduced the number of cookies for static content served from CDN
CDN for css, media and js
Fooman Speedster Advanced
Full Page Cache plugin
Reduced CSS code size
Compiliant Mode On

I wonder if it the maximum speed I can reach with a shared hosting plan or not? I'm not talking about a 10-20 milliseconds, but 80 millisecond 1 second and about 300ms for first byte.
My store is based in italy and sells only here and the server is placed in USA (I think Austin). I have tought about moving the server to another host and looking online I have read good review about Sit*gr**nd, beacuse if I don't get it wrong it offers a cache system(varnish, memcached,..) also on shared hosting, plus ithas got server also in europe, so considering the moving cost and potencial problems (new dns,etc...), will I get a noticiable benefit?


texts: Default Condition In Promotions->Shopping Cart Price Rules

texts:
Our store is planning to support shipping in multiple countries.

Previously the promotional rules did not have any shipping country attribute as part of the conditions as it was not required. Now we need to differentiate between rules which are applicable in all countries vs rules which are applicable only in specific countries.

The magento way for this is that we select shipping country for rules where we need to restrict the applicability to certain countries and skip the condition if it needs to be applicable to all the countries.

Now we want to include a default condition for shipping country with default value as India while creating new rules so as to make it clear for the user creating rules.

How is it possible and where the changes have to be made for including shipping country as default attribute?


texts:
The special price was showing fine and suddenly not showing.  I checked the Admin and the special price is still there, just not showing in the front end.  After I saved the product in all the store views again, then it displays on the front end again.

Anyone has this similar issue?  Don't know why or when it will disappear.


texts:
My control admin of magento not load (it looks white). I tried several things how example: delete cache and with other explorers, etc... and really i need help because with this i tried 15 times.

I have XAMP 7.2 and Magento 2.3, windows 8.1


texts:
For the checkout, I would like to use a different UI template to that which is used on the cart. Currently, they both use the same UI template: <item name="template" xsi:type="string">ui/form/field</item>

checkout_cart_index.xml

...
<block class="Magento\Checkout\Block\Cart\Shipping" name="checkout.cart.shipping" as="shipping" template="cart/shipping.phtml" after="checkout.cart.summary.title">
    <arguments>
        <argument name="jsLayout" xsi:type="array">
            <item name="types" xsi:type="array">
                <item name="form.input" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
                    <item name="config" xsi:type="array">
                        <item name="provider" xsi:type="string">checkoutProvider</item>
                        <item name="deps" xsi:type="array">
                            <item name="0" xsi:type="string">checkoutProvider</item>
                        </item>
                        <item name="template" xsi:type="string">ui/form/field</item>
                        <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
                    </item>
                </item>
            </item>
            <item name="components" xsi:type="array">
                <item name="summary-block-config" xsi:type="array">
                    <item name="component" xsi:type="string">uiComponent</item>
                    <item name="children" xsi:type="array">
                        <item name="shipping-rates-validation" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <!--Step configuration components-->
                            </item>
                        </item>
                    </item>
                </item>
                ...

checkout_index_index.xml

...
<block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="onepage.phtml" cacheable="false">
    <arguments>
        <argument name="jsLayout" xsi:type="array">
            <item name="types" xsi:type="array">
                <item name="form.input" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
                    <item name="config" xsi:type="array">
                        <item name="provider" xsi:type="string">checkoutProvider</item>
                        <item name="deps" xsi:type="array">
                            <item name="0" xsi:type="string">checkoutProvider</item>
                        </item>
                        <item name="template" xsi:type="string">ui/form/field</item>
                        <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
                    </item>
                </item>
            </item>
            ...

As you can see, both are using the template <item name="template" xsi:type="string">ui/form/field</item>. I would like to change this template on the checkout to be something like: <item name="template" xsi:type="string">ui/form/field-checkout-only</item>, as I would like to add some more attributes to the fields when on checkout.

I've tried to do this by creating app/design/frontend/mitch/my_theme/Magento_Ui/web/templates/form/field-checkout-only.html – this didn't work.

I then tried to change the <item name="template" xsi:type="string">ui/form/field</item> to <item name="template" xsi:type="string">Magento_Ui::ui/form/field</item>, but this still doesn't work.

Any ideas?


texts: Make region /state optional in customer address in adminhtml?

texts:
I managed to make the region / state dropdown optional in the frontend without any problems. In the backend however, I did not make it work. So how could I make the state / region dropdown optional in the customer address area?

Thanks!

Magento 1.9


texts: On the cart page and after Guest checkout if click on create account nothing is happening and just showing below:


texts: How to differentiate image and hexcode in Visual swatch attribute in Magento 2?

texts:
I am working with Magento 2 to get attributes values. Now here I added on an attribute which name Swatch Image. in there I selected 2 options, one I selected hex code (#cdcdcd) and other options I selected Image.  Now I know how to get both values using option_id.
which are mentioned below.
for hex code

$opt_id = 26;
                        $swatchHelper=$objectManager->get("Magento\Swatches\Helper\Data");
                        $attributeOptionIds = array($opt_id);
                        $swatches = $swatchHelper->getSwatchesByOptionsId($attributeOptionIds);
                        echo "
";
                            print_r($swatches);
                        echo "
";
                        if(sizeof($swatches) > 0 ){
                            echo "
";
                            print_r($swatches[$opt_id]['value']);
                            echo "
";
                        }

and for Image

$opt_id1 = 27;
    $swatchHelper_image=$objectManager->get("Magento\Swatches\Helper\Media");
    $swatchCollection = $objectManager->create('Magento\Swatches\Model\ResourceModel\Swatch\Collection');

    $swatch1 = $swatchCollection->addFieldtoFilter('option_id',$opt_id1);
    $item=$swatch1->getFirstItem();
    $ThumbImage1 =  $swatchHelper_image->getSwatchAttributeImage('swatch_thumb', $item->getValue());
    echo "
";
    print_r($ThumbImage);

here I added code for both which I know already option 26 is hex and 27 is image. but I want to differentialte it.
I mean how can I recognize which is hex and which is image.

Please help me.


texts: magento 1.9.2.2 Display multiple categories on one cms page

texts:
Im trying to display multiple categories on one cms page

<reference name="content">
<block type="catalog/product_list" name="home.catalog.product.list" category_id="7" template="catalog/product/list.phtml" />
</reference>

from here

it works fine.. but when I tried to display multiple categories, e.g(category='7', category='8'......) in one cms page, its display only one category repeatedly.

how can I make it using this way?

please help.


texts: Magento MassAction grid (custom) Select All not working/not selecting. Why?

texts:
Magento MassAction grid (custom) Select All not working. Why?

In grid we click grid_massactionJsObject.selectAll()(select all link)

Question: how can we make select all work again?

Grid.php is set-up like this

protected function _prepareMassaction()
{
    $this->setMassactionIdField('item_id');
    $this->getMassactionBlock()->setFormFieldName('item_ids');
    $this->getMassactionBlock()->setUseSelectAll(true);

Select all does nothing


texts:
I'm using magmi to import more than 30.000 products with images.

The problem is with images that they are imported but all of them are excluded.

Is there any sql query that I can use and get all images included?

I used this query but only one row effected

update `catalog_product_entity_media_gallery_value` set disabled=1 where `value_id` in (select `value_id` from `catalog_product_entity_media_gallery` where value in (select value from `catalog_product_entity_varchar` where `attribute_id`=(select `attribute_id` from `eav_attribute` where attribute_code='image' and `entity_type_id`=4)));


texts: How to add simple text message in checkout page new address form? magento 2

texts:
Hi I have been trying to add simple text message in the highlighted section of attached screenshot . I am currently adding the custom text message in
I overrided below file from \vendor\magento\module-checkout\view\frontend\layout\checkout_index_index.xml
\app\design\frontend\Company\porto_base_child\Magento_Checkout\layout\checkout_index_index.xml
<item name="popUpForm" xsi:type="array">
    <item name="element" xsi:type="string">#opc-new-shipping-address</item>
    <item name="options" xsi:type="array">
        <item name="type" xsi:type="string">popup</item>
        <item name="responsive" xsi:type="boolean">true</item>
        <item name="innerScroll" xsi:type="boolean">true</item>
        <item name="title" xsi:type="string" translate="true">Shipping Address</item>
        <item name="trigger" xsi:type="string">opc-new-shipping-address</item>
        <item name="notice" xsi:type="string" translate="true">Some note here</item>
        <item name="additionalInfo" xsi:type="string">
            <![CDATA[My Html Information]]>
        </item>
        <item name="text" xsi:type="string" translate="true">Some note here</item>
        <item name="buttons" xsi:type="array">
            <item name="save" xsi:type="array">
                <item name="text" xsi:type="string" translate="true">Save Address</item>
                <item name="class" xsi:type="string">action primary action-save-address</item>
            </item>
            <item name="cancel" xsi:type="array">
                <item name="text" xsi:type="string" translate="true">Cancel</item>
                <item name="class" xsi:type="string">action secondary action-hide-popup</item>
            </item>
        </item>
    </item>
</item>

I am not getting any error's or warning but the below code in above file did not work. Can anyone please guide me through this it would definitely help me continue my learning of magento 2 concepts and get clear understanding how it works? thanks
<item name="notice" xsi:type="string" translate="true">Some note here</item>
            <item name="additionalInfo" xsi:type="string">
                <![CDATA[My Html Information]]>
            </item>
            <item name="text" xsi:type="string" translate="true">Some note here</item>


texts: How to add custom script form admin in head or footer which call on every page?

texts: Basically i want to add script of google analytic script to my  store .


texts: Magento 2 : How to fix "Class Magento\ConfigurableProduct\Model\Product\Type\Configurable\Interceptor does not exist"

texts: Please help, I can't create Products or Categories. How to fix it?


texts: Place Order and Create account is not working after installing SMTP Extension. Magento 2.2.10

texts: I installed the Magetop_Smtp extension but when I installed this extension then When I clicked on Place Order Button in checkout then nothing happens also when I create a new account of user then it gives me an error Fatal error: Class 'Zend_Application_Resource_Mail' not found in C:\xamppp\htdocs\magentoo\app\code\Magetop\Smtp\Mail\Rse\Mail.php on line 31 What is the issue n how can I sort this.


texts:
I am trying to import products from import/export profile in magento 1.9. I am trying to import a csv file but the csv file is not being imported and the following error is being displayed.

Does anyone knows why is it persisting.

The data is accurate and I have checked any error related to the products entry in the csv file. Can anyone explain how and why this error is being generated.


texts: Need help passing form values from checkout to a redirect page that goes to an external payment gateway

texts:
I need help in developing an external payment method module.

I have so far already managed to get the method to appear correctly on the admin, and on the checkout page. The next step is to send some of the values gathered in the form through a POST method that I have already set up on a redirect page, after "Place Order"

And this is where I have a problem.

I don't know how to call the values gathered on the form so I can send them on my redirect page to their destination.

That's my current problem. The problem I will have next is setting up a response page that gathers the information received by the external service and acts accordingly.

If I can't bother you to check out all of my code which I link bellow, I'll try to summarize here. I have made a mix of a couple of payment method tutorials, and the default Cc payment method, so there may be a few extra lines I am not requiring. I'm using the exact same form that Cc uses, since I need the exact same values, with the exact same validation (minus a few card types). (I probably should have extended the Cc method, right? I just realized while writing this...)

Form is the same as Cc, so a card number field looks like this:

<label for="<?php echo $_code ?>_cc_number" class="required">*<?php echo $this->__('Credit Card Number') ?>

            <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />

The model gathers the data in a method called assign data like this:

public function assignData($data)
{
    if (!($data instanceof Varien_Object)) {
        $data = new Varien_Object($data);
    }
    $info = $this->getInfoInstance();
    $info->setCcType($data->getCcType())
        ->setCcOwner($data->getCcOwner())
        ->setCcLast4(substr($data->getCcNumber(), -4))
        ->setCcNumber($data->getCcNumber())
        ->setCcCid($data->getCcCid())
        ->setCcExpMonth($data->getCcExpMonth())
        ->setCcExpYear($data->getCcExpYear())
        ->setCcSsIssue($data->getCcSsIssue())
        ->setCcSsStartMonth($data->getCcSsStartMonth())
        ->setCcSsStartYear($data->getCcSsStartYear())
        ;

    return $this;
}

And my redirect method, (which is already being properly called, but with default values) is a bunch of these:

<input type="hidden" value="5111111111111118" name="Card">

I need to be able to take the data from the form and place it in the values on my redirect. I have some ideas gathered from here and there, which involve using checkout session variables, but I'm open to anything.

https://dl.dropbox.com/u/17685301/app.rar

I'm copying my code in this dropbox link if you can be bothered. I am aware I'm mixing from a lot of places here but I think it's mostly ok since Magento tends to die if just one piece is missing from the puzzle.

Yes, I'm a noob, but I'm really trying hard to get the hang of Magento. Thanks in advance.


texts: Magento 2 : Filter dropdown value by other dropdown value : (Chained Select Boxes) in Checkout page

texts:
I try to do dropdown option filter and autofill postcode.

for select step are Country > City > State/Province > District > autofill postcode

What I have done

convert city textbox to dropdown and populate city name(from DB).
add dropdown for district and populate district name(from DB).
create table for district (district_id , region_id , postcode)

My Code

plugin file

class LayoutProcessorPlugin{

/**
 * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
 * @param array $jsLayout
 * @return array
 *
 */

public function afterProcess(
    \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
    array  $jsLayout
) {
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children']['shipping-address-fieldset']['children']['city'] = [
        'component' => 'Magento_Ui/js/form/element/select',
        'config' => [
            'customScope' => 'shippingAddress',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/select',
            'name' => __('City'),

        ],
        'dataScope' => 'shippingAddress.city',
        'label' => __('City'),
        'provider' => 'checkoutProvider',
        'visible' => true,
        'validation' => [],
        'sortOrder' => 120,
        'name' => __('City'),
        'validation' => [
            'required-entry' => true,
        ],
        'options' => $this->districttoOptionArray(),

    ];
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children']['shipping-address-fieldset']['children']['subcity'] = [
        'component' => 'Magento_Ui/js/form/element/select',
        'config' => [
            'customScope' => 'shippingAddress',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/select',
            'name' => __('subcity')
        ],
        'dataScope' => 'shippingAddress.subcity',
        'label' => __('แขวง'),
        'provider' => 'checkoutProvider',
        'visible' => true,
        'validation' => [],
        'sortOrder' => 121,
        'name' => __('subcity'),
        'validation' => [
            'required-entry' => true,
        ],
        'options' => $this->subdistricttoOptionArray(),

    ];
    return $jsLayout;
}

Output

My problem

I don't know how magento2 do filter (like in Checkout/LayputProcessor filter state by country dropdown)

  'filterBy' => [
                                          'target' => '${ $.provider }:${ $.parentScope }.country_id',
                                          'field' => 'country_id',
                                      ]

how to auto fill postcode textbox

reference : create field in checkout page (Magento2 "delivery date" module creation from scratch)


texts: magento set dropdown attribute value by selected value instead of id

texts:
i wrote custom code to assign attribute to product , issue is with dropdown attribute say color with values : red , green , yellow

not i want to set value of color to be red so i used code below

$product->setColor('red')

but it does not works as i neet to put id instead of vlaue , but i do not want to put id , can anyone help in this case


texts: Magento 2: add a custom phtml side bar to the homepage

texts: i want to add a custom side bar phtml file in the home page that would show specific categories. i couldn't find a specific layout or template file for the homepage. any ideas?


texts: May I know the mechanism behind multi-vendor module?

texts:
I want to understand mechanism behind multi-vendor module. How we can identity each product from each different product?

How does each product sell by different seller identified and distinguish from other seller? Based on sku or product id?


texts: Why aren't countries alphabetized on Configuration page?

texts:
I'm running Magento 2.3 on Windows 10 with xampp.  I installed Magento by cloning the Github repo.

On the Configuration page, the countries are not showing in alphabetical order.  Do you have any idea why this happened, and how do I fix it?


texts:
Im trying to add a custom .phtml file via XML to the product_view. This is what I have done:

In the catalog_product_view.xml:

<block class="Magento\Framework\View\Element\Template" name="ku.atrributes" template="Magento_Catalog::product/view/ku-attributes.phtml" before="product.info.main"/>
    <move element="ku.atrributes" destination="page.main.title" />

In the ku-attributes.phtml:

<?php
    $_product = $block->getProduct();
    echo $_product->getData('ku_untetitel');
?>

Result:
I only get the Product Title on a white, unformatted Page.

Whats wrong with this? What am I doing wrongly here?


texts: Magento2 : How to change controller execute method variable value by plugin

texts:
I want to change core controller execute method variable value by plugin.

How I can do change variable value? Any one have idea?

Thanks


texts:
When trying to create and save a new Attribute set. I am presented with a message saying "ATTENTION Sorry, we're unable to complete this request." when trying to save.

Preconditions:
Magento CE 2.1.3 OR  fresh installation of 2.1.5
- (i tried on both versions)

Steps to reproduce:
Go to Stores -> Attributes -> Attribute Sets
Click "Add Attribute Set"
Enter Attribute Set name and select base set ("Default" selected) and click "Save"
Assign attributes (NOTE: this error happens even if no new attributes are assigned)
Click "Save".

I am presented with a notice "ATTENTION Sorry, we're unable to complete this request" (No errors are shown). I am then allowed to a) Close the modal using the "X", or b) Click "OK", which closes the modal.


texts:
Currently my list of options to Order the results on the Category page are: position, name, price, color & newest.

I can't find the option (and Google doens't help me either) to place price as the first option in this list. So it's about the  showing the sort options.

I can change the toolbar.phtml file and adjust the sorting in there on the frontend myself, but I assume there must be a more elegant way of adjusting this in the code. Anyone has a suggestion to help me on the right track?


texts: Make extension install after core modules

texts: I have an extension i created that modifies core attributes. I want to make sure it is installed after all magento core modules. Is there a way i can use the depends node in my app/etc/modules/*.xml file to set the extension to be installed last? or do i have to include every core module inside it?


texts: Is i have to create attributes for creating magento grouped products with more columns

texts:
For creating, grouped product like this link demo : http://www.linbide.com/product.php?p=1,

is i have to create attribute names, attribute codes and what else? please guide me. I am struggling for this....

thanks in advance....


texts:
I need to set a discount price to products only when payment method is cash.

I created a price attribute called discount_price and put it in the product  attribute set. If customer is paying in cash I want the new discounted price to be set in cart.

I also created another yes/no attribute called has_discount.
When has_discount is set to yes cart rule activate and for example I can get 10% of discount in products paid in cash. But what I want is set the price of the attribute discount_price.

Can anyone help me with this?


texts:
I want to delete an entry in my custom module table, in a similar way to this select:

    $select = $this->getConnection()->select()->from(
        ['*' => $this->getMainTable()]
    )->where(
        'quote_ref = ?',
        $quote_ref
    );

    $data = $this->getConnection()->fetchOne($select);

I am using the following code:

    public function deleteByRef($quote_ref = null)
    {
        $delete = $this->getConnection()->delete();
}

And getting the following error:

1 exception(s):

  Exception #0 (Exception): Warning: Missing argument 1 for Zend_Db_Adapter_Abstract::delete(), called in C:\laragon\www\websitestore\app\code\Website\Quote\Model\ResourceModel\Data.php on line 43 and defined in C:\laragon\www\websitestore\vendor\magento\zendframework1\library\Zend\Db\Adapter\Abstract.php on line 650

How can I pass parameters to the delete method?


texts:
I hope someone could help me with the following fatal error in the Index Management:

Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Category_Flat::isBuilt() in /www/htdocs/postmao/app/code/core/Mage/Catalog/Helper/Category/Flat.php on line 80

I did a fresh install of ver 1.8.0.0. I do have a theme installed but that doesn't affect the core right?

How could I solve this?

BR Fritz


texts:
I want to display color,fabric,size,discount,Brand search/Filter options in products page.

So customer can search a tshirt  like color-Blue,Fabric-Cotton,Size-XL,Discount 50-60%,Brand-Pepe.

How to do from Admin panel.


texts: Layered Navigation price filter attribute multiselect check box

texts:
I am working on Layered navigation of Magento. I want to implement the following:

Price filter with multiple check boxes.
Kit type with Radio buttons.
Ratings with multiple check boxes.

The same is shown in the below image also.

I have already tried to customize the extension from magento-connect. But no luck. How can implement those multiselect filters.

Can anyone please help me on this. Thanks in advance.


texts:
I have a relatively straightforward module in Magento 2 for adding some extra functionality to the addto area on the product view page.
I wanted to append my own custom block after the product.info.addto block via a layout file, like so:

app/code/VENDOR/MODULE/view/frontend/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.options.wrapper.bottom">
            <block
                class="VENDOR\MODULE\Block\Product"
                name="product.info.anyname"
                template="VENDOR_MODULE::test.phtml"
                after="product.info.addtocart" />
        </referenceBlock>
    </body>
</page>

with my template test.phtml file being a simple echo for now:

app/code/VENDOR/MODULE/view/frontend/templates/test.phtml

<?php echo 'LA TREY: '; ?>

after enabling module, and running the di:upgrade, compile and cache clear php bin/magento commands, I go to my catalog product view page and no change. My "La Trey" isn't there.
So I thought I could win by copying the layout/catalog_product/view.xml file to the theme's Magento_Catalog folder - but again, after running the commands - nothing.
How do I get my block to show after the addto container on the catalog product view page?


texts: Magento 2 event observer custom config save given error

texts:
I have a custom section tab in configuration my section url is:
http://dev.test/admin/admin/system_config/edit/section/vendor_module/key/?????????

exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file .../app/code/Vendor/Module/etc/adminhtml/events.xml:
Element 'event', attribute 'name': [facet 'pattern'] The value 'admin_system_config_changed_section_vendor_module' is not accepted by the pattern '[a-zA-Z_]+'.
Line: 3

Element 'event', attribute 'name': 'admin_system_config_changed_section_vendor_module' is not a valid value of the atomic type 'eventName'.
Line: 3

Element 'event', attribute 'name': Warning: No precomputed value
available, the value was either invalid or something strange happend.
Line: 3
...

events.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="admin_system_config_changed_section_vendor_module">
    <observer name="custom_admin_system_config_change_vendor_module" instance="Vendor\Module\Observer\ConfigObserver"/>
</event>
</config>

It works with general and other sections. Any ideas?


texts:
I am trying to order products by SKU but I got it wrong
The order is on the Order page (Checkout)
This is a snippet of my code

$this->_items->getSelect()->order('main_table.sku ASC');
$this->_items->getSelect()->group('main_table.item_id');

I am trying to order products having SKU :
4422; 00003001 and 00004335
but I am gotten them in this order :

4422

00003001

00004335

How can I solve this problem, don't hesitate if you need more details?

Thanks in advance!


texts:
I am using an extension for PDF, but the extension is giving the wrong value for tax when I partially create Invoice or Creditmemo, As I checked the Extension is using "Mage_Sales_Model_Order_Pdf_Total_Default" Model object, Here is the code segment:

//function1:
/*
 * Get Totals information.
*/
$totals = $this->_getTotalsList($creditmemo); //This function has issue
$totalArr = array();
foreach ($totals as $total) {
    $total->setOrder($order)
    ->setSource($creditmemo);
    if ($total->canDisplay()) {
        $area = $total->getSourceField()=='grand_total'?'footer':'body';
        foreach ($total->getTotalsForDisplay() as $totalData) {
            $totalArr[$area][] = new Varien_Object(array('label'=>$totalData['label'], 'value'=>$totalData['amount']));
        }
    }
}
======================================================

//function2:
protected function _getTotalsList($source)
{
        $totals = Mage::getConfig()->getNode('global/pdf/totals')->asArray();
        usort($totals, array($this, '_sortTotalsList'));
        $totalModels = array();
        foreach ($totals as $index => $totalInfo) {
            if (!empty($totalInfo['model'])) {
                $totalModel = Mage::getModel($totalInfo['model']);
        //After this instance It will take order's tax amount instead of invoice/credit memo
                if ($totalModel instanceof Mage_Sales_Model_Order_Pdf_Total_Default) {
                    $totalInfo['model'] = $totalModel;
                } else {
                    Mage::throwException(
                        Mage::helper('sales')->__('PDF total model should extend Mage_Sales_Model_Order_Pdf_Total_Default')
                    );
                }
            } else {
                $totalModel = Mage::getModel($this->_defaultTotalModel);
            }
            $totalModel->setData($totalInfo);
            $totalModels[] = $totalModel;
        }
        return $totalModels;
    }

Suggest how can I fix it.


texts: Magento 2 Admin Grid Columns Not Displaying

texts: I installed magento2 latest version in ubantu and apache server admin grid view columns not displaying vertically


texts: Adding Category attribute but they are missing

texts:
I have created 2 category attributes. They are appearing in my eav_attribute table. But I can't see them in the category admin form. I'm under magento 2.4.
Attribute creation
$eavSetup->addAttribute(
    Category::ENTITY,
    'svg',
    [
        'type'         => 'varchar',
        'label'        => 'Category svg',
        'input'        => 'textarea',
        'sort_order'   => 100,
        'visible'      => true,
        'required'     => false,
        'user_defined' => true,
        'default'      => null,
        'global' => ScopedAttributeInterface::SCOPE_STORE,
        'group' => 'Content'

    ]
);
$eavSetup->addAttribute(
    Category::ENTITY,
    'color',
    [
        'type'         => 'varchar',
        'label'        => 'Background color',
        'input'        => 'text',
        'sort_order'   => 101,
        'visible'      => true,
        'required'     => false,
        'user_defined' => true,
        'default'      => null,
        'global' => ScopedAttributeInterface::SCOPE_STORE,
        'group' => 'Content'
    ]
);

I thought doing that was enough, but digging a little bit I saw we also had to write a custom view/adminhtml/ui_component/category_form.xml
category form xml
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content">
        <field name="svg">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">100</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">textarea</item>
                    <item name="label" xsi:type="string" translate="true">SVG</item>
                    <item name="required" xsi:type="boolean">false</item>
                </item>
            </argument>
        </field>
        <field name="color">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">101</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">color</item>
                    <item name="required" xsi:type="boolean">false</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

Thanks for your assistance.


texts:
it try to create order from shopping cart in magento via API , first i set customer, customer address, shipping and payment methods and it`s return me true then i use this code to create order

$orderId = $proxy->shoppingCartOrder($sessionId, $cartId);

and it`s return to me this error :

  SOAP-ENV:Server
  Call to a member function getTelephone() on a non-objectError in shoppingOrder

but when i check orders in magento admin panel , order is created and added to table in panel ! i set phone number for customer informaton , shipping info and , billing info .
can any body help me to find problem ?
thanks


texts:
I'm trying to rewrite some blocks from adminhtml (Magento 1.9.1.1). Here's my code in my extension's config.xml:

...
<global>
  <blocks>
    <adminhtml>
      <rewrite>
        <report_grid>Mypackage_Myextension_Block_Adminhtml_Report_Grid</report_grid>
        <widget_grid_column_filter_date>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Filter_Date</widget_grid_column_filter_date>
        <widget_grid_column_renderer_date>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Renderer_Date</widget_grid_column_renderer_date>
        <widget_grid_column_filter_datetime>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Filter_Datetime</widget_grid_column_filter_datetime>
        <widget_grid_column_renderer_datetime>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Renderer_Datetime</widget_grid_column_renderer_datetime>
        <report_sales_grid_column_renderer_date>Mypackage_Myextension_Block_Adminhtml_Report_Sales_Grid_Column_Renderer_Date</report_sales_grid_column_renderer_date>
      </rewrite>
    </adminhtml>
  </blocks>
</global>
...

Oddly enough, all blocks were overwritten except report_grid which is Mage_Adminhtml_Block_Report_Grid.I couldn't find the issue. I have a file called Grid.php in app/code/local/Mypackage/Myextension/Block/Adminhtml/Report. What should I do? Is there any other way to rewrite this block?

UPDATE:

Here's output of Mage::getConfig()->getNode('global/blocks/adminhtml')->asNiceXml();:

<adminhtml>
    <class>Mage_Adminhtml_Block</class>
    <rewrite>
        <report_grid>Mypackage_Myextension_Block_Adminhtml_Report_Grid</report_grid>
        <widget_grid_column_filter_date>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Filter_Date</widget_grid_column_filter_date>
        <widget_grid_column_renderer_date>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Renderer_Date</widget_grid_column_renderer_date>
        <widget_grid_column_filter_datetime>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Filter_Datetime</widget_grid_column_filter_datetime>
        <widget_grid_column_renderer_datetime>Mypackage_Myextension_Block_Adminhtml_Widget_Grid_Column_Renderer_Datetime</widget_grid_column_renderer_datetime>
        <report_sales_grid_column_renderer_date>Mypackage_Myextension_Block_Adminhtml_Report_Sales_Grid_Column_Renderer_Date</report_sales_grid_column_renderer_date>
    </rewrite>
</adminhtml>

And this is my Mypackage_Myextension_Block_Adminhtml_Report_Grid class:

class Mypackage_Myextension_Block_Adminhtml_Report_Grid extends Mage_Adminhtml_Block_Report_Grid
{
    public function __construct() {
        parent::__construct();
        die("Houston the eagle has landed. \o/");
        $this->setTemplate('myextension/report/grid.phtml');
    }
}

But it never called. If I die in Mage_Adminhtml_Block_Report_Grid it will die.


texts: Is there a way to change the date of an order?

texts: We had some minor technical issues a few days ago, and the final fix for us is to re-do several sales that were done via our storefront. However, since they were done in the past, does anybody know of a way to process an order with the old date applied to it?


texts: Magento 1.9 The requested Payment Method is not available

texts:
We want to disable a specific payment method, because we changed to another payment service provider.

But when we disable the module, we can not open the old orders anymore.
We get the error: The requested Payment Method is not available.

Is there a way to easily solve this, to open these old orders?


texts: Parent category and subcategory of active parent category

texts:
Can someone help to understand how to achieve Magento Category Navigation in header section.
Parent Category like men, women, children
and when I go with any parent category like MEN, I want to show subcategories of MEN and make it fixed for rest of its sub-subcategory child i.e. when i go with any subcategory i want to show that subcategory-set of active parent category.
like in this website top category navigation : http://www.zalora.sg/


texts: Remove hover from categories Magento 1.9 RWD

texts: How can I remove hover from categories menu in Magento 1.9 RWD? I want only clickable categories.I found solutions for previous versions modifying the menu.js but it's not working with the 1.9 RWD.


texts: Magento 2.3: products are out of stock only on the product details page

texts:
I have a multistore site with simple products that appear to have positive quantities from the backend and are set as "available" in stock.
I've checked and I'm sure all other store views have quantities greater than zero and are found to be available in all other store views as well.
I also checked the minimum stock settings under which products become unavailable.
I checked that the products have a salable quantity and that they are associated with defaul source (warehouse).
I have launched a full reindex and cleared of magento caches.
I don't use the flat tables for categories nor products.
Magento is configured to show products not available in stock.
The problem remains: simple products are saleable from the category page but when you enter the product details page they become unavailable as the stocks were exhausted.
The only way I have found to make the products available again and display them as available in the product details page is to manually save from backend.
Can anyone explain why these products are available in stock only on the category list page while they are not in stock in product detail page?
What other checks should I carry out?
Someone else had a similar problem?
Is there a way to see the query that magento launches when the product page is loaded?
Could this be a magento bug?


texts: Add transactional email template programmatically

texts:
I'm looking to add an email template to make it available in the transactional emails templates list in back office.

I'm a newbie to magento 2 and a huge newbie to magento 1. My project is under V1.14.1.0

Actually I already made this task for a magento 2 project when i started learning the tech. But I don't know the M1 structure good enough to make it for a magento 1 project.

So here I am looking for some help as I can't really find any documentations (at least not that I'm able to understand properly).

So here are my questions

1 - Where is the location of the custom / new mail templates in magento 1 ? Magento 2 is in MODULE/view/frontend/email/my_mail_template.html

2 - Is the template syntax the same ?

This is what my email template file looks like in Magento 2.

<!--@subject Test subjects@-->
<!--@vars {
"var data.name":"Test Name"
} @-->

{{template config_path="design/email/header_template"}}

{{trans "Name: %name" name=$name}}

{{template config_path="design/email/footer_template"}}

3 - Where do I setup the configuration to let magento 1 see there is a new template ? Magento 2 was in MODULE/etc/email_templates.xml

And the content looked like this

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="my_mail_template" label="My mail" file="notification_question_template.html" type="html" module="Week2_TP" area="frontend"/>
</config>

4 - Once I've created my template, my main goal is to send it under some specific events. Like, if it remains only one month of subscription to an user, the mail will be sent to warn an user at this moment.
How do we handle this under Magento 1 ? We need to setup some kind of cron task on the server ? I guess yes, but then how to setup this cron ? I guess magento provides services to do that ?

Thanks for your assistance. Sorry there is a lot of questions in one, but I rather explain the whole scope.


texts: Product page getting a static page title

texts: On every page there is static product title "My Dashboard".Although i had enter product name in magento admin but not showing on proudct page.Any guide


texts: changing a url does not let you use it again in the categories, any idea where the old urls used in categories are stored in magento 2.0 database? i'd like to be able to re-use them. thanks!


texts: Customers being redirected to checkout after login

texts:
Title says it all. After a customer logs in, it redirects them to checkout. What could be causing that?
I have a plugin that does login for pricing, but this happens even when I disable it. The option to redirect to cart after adding an item to cart is set to no.


texts:
I have separate headers for different pages of our store.  A different format is displayed based upon the page being visited.  For example, the homepage is different than category pages.  Occasionally the headers themselves cache over one another and this state is persistent until the cache is flushed.

What causes this and how can I fix it?

Enterprise Edition 1.9.


texts:
I'm going crazy here trying to add a custom validation rule to Magento 2. It's impossible to find any useful information about it.

The things I have are as follow:

1) requirejs-config.js file with the following content:

var config = {
map: {
    '*': {
        experius_postcodenl_validation_rule:'Experius_Postcode/js/validation/postcodenl-validation-rule',
        experius_postcode:'Experius_Postcode/js/widget/postcode'
    }
}};

2) Seperate javascript file:

define([
"jquery",
"experius_postcode", // Custom knockout view model
'jquery/validate',
"validation",
"mage/translate"
], function($,experiusPostcode) {
"use strict";

    $.validator.addMethod(
        'validate-postcode-housenumber-combination',
        function (value) {
            // My validation
        },
        $.mage.__('No address could be found.')
    );
});

This should be enough to add a custom validation rule to the global jquery validator object not?

I Double checked all the file paths. The requirejs-condig.js gets loaded (checked in my browsers network tab). No 404 errors on sources whatsoever.

Am I missing something?

ps: don't mind the validation rule itself. Its still a dummy rule


texts: How to read the File from the FTP server

texts: As I have to read the File From the FTP server of the last modified file from the particular path


texts:
I am trying to apply catalog rule for 27% from 2 customer group but it's not applied after indexing and cleaning cache.

So i debug the issue and found that catalogrule_product_price and catalogrule_product are empty. I am using Magento ver. 1.9.2.2

Following query has been generate while apply ruel

INSERT INTO `catalogrule_product_price` SELECT NULL AS `rule_product_price_id`, `dates`.`rule_date`, `t`.`customer_group_id`, `t`.`product_id`, MIN(rule_price) AS `rule_price`, 1 AS `website_id`, `t`.`latest_start_date`, `t`.`earliest_end_date` FROM (SELECT `cppt`.`customer_group_id`, `cppt`.`product_id`, CASE WHEN IFNULL((@group_id), 'N/A') != cppt.grouped_id THEN @price := CASE `cppt`.`action_operator` WHEN 'to_percent' THEN cppt.price * cppt.action_amount/100 WHEN 'by_percent' THEN cppt.price * (1 - cppt.action_amount/100) WHEN 'to_fixed' THEN IF((cppt.action_amount < cppt.price), cppt.action_amount, cppt.price) WHEN 'by_fixed' THEN IF((0 > cppt.price - cppt.action_amount), 0, cppt.price - cppt.action_amount) END WHEN IFNULL((@group_id), 'N/A') = cppt.grouped_id AND IFNULL((@action_stop), 0) = 0 THEN @price := CASE `cppt`.`action_operator` WHEN 'to_percent' THEN @price * cppt.action_amount/100 WHEN 'by_percent' THEN @price * (1 - cppt.action_amount/100) WHEN 'to_fixed' THEN IF((cppt.action_amount < @price), cppt.action_amount, @price) WHEN 'by_fixed' THEN IF((0 > @price - cppt.action_amount), 0, @price - cppt.action_amount) END ELSE @price := @price END AS `rule_price`, `cppt`.`from_date` AS `latest_start_date`, `cppt`.`to_date` AS `earliest_end_date`, CASE WHEN IFNULL((@group_id), 'N/A') != cppt.grouped_id THEN @action_stop := cppt.action_stop WHEN IFNULL((@group_id), 'N/A') = cppt.grouped_id THEN @action_stop := IFNULL((@action_stop), 0) + cppt.action_stop END, @group_id := cppt.grouped_id, `cppt`.`from_time`, `cppt`.`to_time` FROM `catalogrule_product_price_tmp` AS `cppt` ORDER BY `cppt`.`grouped_id` ASC, `cppt`.`sort_order` ASC, `cppt`.`rule_product_id` ASC) AS `t` INNER JOIN (SELECT DATE_ADD(FROM_UNIXTIME(1494181800), INTERVAL -1 DAY) AS rule_date UNION SELECT FROM_UNIXTIME(1494181800) AS rule_date UNION SELECT DATE_ADD(FROM_UNIXTIME(1494181800), INTERVAL 1 DAY) AS rule_date) AS `dates` ON 1=1 WHERE (UNIX_TIMESTAMP(dates.rule_date) >= from_time) AND (IF((to_time = 0), 1, UNIX_TIMESTAMP(dates.rule_date) <= to_time)) GROUP BY `customer_group_id`, `product_id`, `dates`.`rule_date`


texts: Ajax call always returns in error from controller Magento 2

texts:
From my controller, I return a JSON data to my Ajax call but it always goes in the error section, even when it's not an error.

 jQuery.ajax({
        type: 'POST',
        url: '/yxcustomer/index/emailpreferences',
        data: {"category1": category1,"category2":category2 , "category3":category3,"category4":category4,"category5":category5,"category6":category6,"category7":category7,
               "latest1":latest1,"latest2":latest2,"latest3":latest3,"latest4":latest4,
               "frequency":frequency,
               "email":email,"firstName":firstName , "lastName":lastName},
        dataType: "json",
        success: function (data) {
            console.log("data response success prefe " + JSON.stringify(data));

        },
        error: function (error) {
            console.log("data response error prefe " + JSON.stringify(error));
        }
    });

Controller code

 protected $resultJsonFactory;

  public function __construct(
    \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
    \Magento\Framework\App\Action\Context $context
) {
    $this->resultJsonFactory = $resultJsonFactory;
    parent::__construct($context);
}

 public function execute()
  {
    try{
       return  $this->resultJsonFactory->create()->setData(['success' => true,'contact'=>json_encode($contact) ,'message' => $this->messageManager->addSuccessMessage("Successfully updated email preferences")]);
    } catch (Exception $e) {
        return  $this->resultJsonFactory->create()->setData(['success' => false,'message' => $this->messageManager->addErrorMessage('Email preferences cannot be updated')]);
    }
}

Still that success code

$this->resultJsonFactory->create()->setData(['success' => true,'contact'=>json_encode($contact) ,'message' => $this->messageManager->addSuccessMessage("Successfully updated email preferences")])

Always goes in ajax error part

error: function (error) {}

the response is

  data response error prefe {"readyState":4,"responseText":"reading contacts with equalto filter\n{\"success\":true,\"contact\":\"{"id":"c74668c8-e886-4592-8950-273a7a6ab72d","email":"an@gmail.com","status":"onboarding","msgPref":"html","source":"api","customSource":"source","created":"2019-03-20T13:10:40-04:00","modified":"2019-03-21T03:44:36-04:00","deleted":false,"fields":[{"fieldId":"0bc403e9000000000000000000000005c10d","content":""},{"fieldId":"0bc403e9000000000000000000000005c10f","content":"Fluid"},{"fieldId":"0bc403e9000000000000000000000005c10e","content":"Men"},{"fieldId":"91c22871-0947-4f63-b067-4290ce18c0a0","content":"Anupam"},{"fieldId":"0bc403e9000000000000000000000005c111","content":""},{"fieldId":"0bc403e9000000000000000000000005c110","content":""},{"fieldId":"0bc403e9000000000000000000000005c113","content":"All"},{"fieldId":"0bc403e9000000000000000000000005c112","content":""},{"fieldId":"0bc403e9000000000000000000000005c115","content":""},{"fieldId":"0bc403e9000000000000000000000005c114","content":"New Arrivals"},{"fieldId":"0bc403e9000000000000000000000005c117","content":"Never Mind"},{"fieldId":"0bc403e9000000000000000000000005c116","content":""},{"fieldId":"0bc403e9000000000000000000000005c0e8","content":""},{"fieldId":"2b0a63f9-cb2d-4fc7-bcc5-06b30b59f8db","content":"singh"}],"numSends":0,"numBounces":0,"numOpens":0,"numClicks":0,"numConversions":0,"conversionAmount":0}\",\"message\":{}}","status":200,"statusText":"OK"}

What am I doing wrong, is there some Magento 2 issue?


texts: Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'reference': This element is not expected

texts:
I am getting below error when I go custom simple products details page.
It is working when go to simple product detail page. I am using magento porto theme and recently migrated from magento 1.9 to magento 2.3.3

main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_40b0d6346f25da66374a88a3ad4a3a7b9_page_layout_merged and handles default, catalog_product_view, catalog_product_view_id_1053, catalog_product_view_sku_JLVMC11611-GS, catalog_product_view_type_simple: Please correct the XML data and try again. Element 'reference': This element is not expected.

        -->


texts: Css and Js not loading from the static and media Magento 2

texts: I put my code on server and when I deployed it i get the error Internal server 500 so I deleted the .htaccess from the root of directory but css and js not loading and run deploy the update the di:compile and put 777 /var /generated pub/media and pub/static when i see the folder under pub/static /frontend .fr_FR/theme/it is empty same for media no wysiwyg and there are some folder related to theme missing on server. In local everything is working fine.


texts: Magento 2 : Payment methods uncheck while clicking custom icon in checkout page

texts:
I have created one custom icon in checkout page below payment methods.
My Requirement:
If I click the icon, the payment methods should be unchecked. After that, the customer needs to click the payment method to place an order.
Please provide me with a solution.
My custom js for custom icon
newValue is a boolean value (icon click true or false)
initObservable: function () {
            var self = this;

            this._super()
                    .observe({
                        CheckVal: false // While clicking the icon it comes here whether it is true or false
                    });

            this.CheckVal.subscribe(function (newValue) {
                if (newValue) {
                    self.customicon(newValue);
                } else {
                    self.customicon(newValue);
                }
            });

            return this;
        },
        customicon: function (newValue) {
            var self = this;
            var isLoading = ko.observable(false);
            var isApplied = ko.observable(false);

            self.ajaxCall(isLoading, newValue, isApplied);

        },
        ajaxCall: function (isLoading, newValue, isApplied) {
            if (newValue) {
                var iconvalue = 1;
            } else {
                var iconvalue = 0;
            }
            var serviceUrl = urlBuilder.build('x/y/z');
            fullScreenLoader.startLoader();
            jQuery.ajax({
                url: serviceUrl,
                type: "POST",
                data: {iconvalue: iconvalue},
                success: function (response) {
                    if (response) {
                        var deferred = $.Deferred();
                        fullScreenLoader.stopLoader();
                        //For, When click customicon, reset payment methods
                        quote.setPaymentMethod();
                        //For refresh payment section
                        getPaymentInformation(deferred);
                        jQuery.when(deferred).done(function () {
                            isApplied(false);
                            totals.isLoading(false);
                        });

                        totals.isLoading(true);
                    }
                }, error: function (error) {
                    isLoading(false);
                }
            });


texts: Magento 2 InsertForm component in to the UI form component

texts:
I would like to add form same as like admin customer edit Add new address form. So i have added InsertForm component inside the customer edit form using this reference link
A form is displaying fine but save, cancel and back button are not displaying in form
can anybody have idea why button is not displaying in form.


texts: Sort products by drop-down attribute on category page

texts:
I created an attribute which Input Type is drop-down and has custom source model, similar with brand. Now if I sort the product list by this attribute products are sorted by option id rather than option label. How do I should configure the attribute (or it's source model) to sort products by label.
Thanks


texts: Magento 2.3.4: How to change date from USA format to AU format through out the front side and admin side?

texts: How to change date from USA format to AU format through out the front side and admin side? I have magento 2.3.4 installed.


texts:
I'm Following below method to display menu and it is working in my local but when i put it live the template path is not getting it's is showing like  frontend/default/theme_name/template/ the page path is not getting.

You should override the _getHtml() method in Mage_Page_Block_Html_Topmenu class.

Here are the steps:

1.create your app/code/local/Mage/Page/Block/Html/Topmenu/Custom.php

2.put inside class Mage_Page_Block_Html_Topmenu_Custom extends Mage_Page_Block_Html_Topmenu

3.copy the _getHtml() method from app/code/code/Mage/Page/Block/Html/Topmenu.php and customize it as needed

4.edit your app/design/frontend/your_theme/default/layout/page.xml and replace <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/> with <block type="page/html_topmenu_custom" name="catalog.topnav" template="page/html/topmenu.phtml"/>


texts: Copy/import or migrate joomla articles to Magento

texts:
i am looking to migrate article of joomla to magento. We can display articles of joomla in cms or static blocks. Is there any way or method to achieve this?

Magento: 1.9.2.1
Joomla:  2.5.27

Is it possible if we can import articles from joomla in csv or any other format which we later can import in magento?

Update:

This question is not duplicate of Data migrations from virtuemart to magento becaue its specific to migration/copy of articles.

There are lot of extensions and services available to migrate products,customers and orders from joomla to magento but noboday talks about articles of joomla import. Nobody is ready to import articles so this question is different and specific.