texts: Elasticsearch: Does search in frontend work that way?

texts:
I thought my Elasticsearch is configured correctly. 'Test connection' in the admin panel is successful and the quick search there shows many entries as dropdown, as you can see in the screenshot below. I have already reindexed - if this is all what is required to build up data in Elasticsearch.

But I have two problems:

If I enter something into the search box, the response takes about a second. Shouldn't it be much faster? This concerns frontend and admin panel.

In the quick search of the frontend I see only the already entered terms in the dropdown list. See the image below. Shouldn't there be entries similar to the admin panel?

As you can see, I have searched for 'print' and already hit the Enter button. Then I typed 'print' into the search box again, to show what I get offered during typing. Actually, there are more products that match to 'print', but I can see only what I have entered already. This shouldn't be like that, right?
The browser's request is https://my-domain.com/search/ajax/suggest/?q=print&_=1597670046451 and the response is:
[{title":"print","num_results":"253"},{"title":"Printer 20","num_results":"241"}]

If I search for 'print' on the command line, I get the following:
$ curl -i http://es_machine:9200/_search?pretty=true&q=print
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 768,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "g6master_product_1_v3",
        "_type" : "document",
        "_id" : "1",
        "_score" : 1.0,
        "_source" : {
          "store_id" : "1",
          "sku" : "T_121985",
          "status" : "1",
          "status_value" : "Enabled",
          "visibility" : "4",
          "tax_class_id" : "2",
          "tax_class_id_value" : "Taxable Goods",
          "name" : "Printer 15 - Textplatte",
          "url_key" : "textplatte-colop-printer-15",
          "description" : ".....",
          "short_description" : "....",
          "category_ids" : [
            3,
            4,
            5,
            6
          ],
          "position_category_3" : "0",
          "name_category_3" : "Produkte",
          "position_category_4" : "10000",
          "name_category_4" : "Textplatten",
          "position_category_5" : "0",
          "name_category_5" : "Colop Printer Line",
          "position_category_6" : "0",
          "name_category_6" : "ALL",
          "price_0_1" : "10.680000",
          "price_1_1" : "10.680000",
          "price_2_1" : "10.680000",
          "price_3_1" : "10.680000"
        }
      },
      {
        "_index" : "g6master_product_1_v3",
        "_type" : "document",
        "_id" : "2",
        .
        .
        .

Currently, I don't know if this is how it should be and also where to find and fix the problem. What could be wrong? Any hints are much appreciated!


texts: So many admin-related checkboxes grayed/greyed out in ALL scopes

texts:
For unknown reasons I am currently unable to modify a large proportion of settings, such as those for enabling template hints, although this was possible at some time in the last month, as evidenced by the fact that the default hint keyword "magento" was changed to "hints" by me.
More examples include all of the inventory-related options. See screenshots
Store is in developer mode. In all scopes - default, Main Website, or Default store view - the checkboxes in the Debug section of the developer panel are grayed/greyed out:

I have tried cleaning the cache, removing /var/view_preprocessed, & removing the /generated/code folder.


texts: How to save the custom tab data in the database

texts:
I am working on magento 2.4 and I added a custom tab in the edit product form in the admin panel. I want to save the data of my custom tab form.
I am new to Magento and finding it hard to cop up with it. Can anyone suggest me how to achieve this task?

CompanyName\ModuleName\view\adminhtml\ui_component\product_view.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <htmlContent name="custom" sortOrder="10">
        <argument name="data" xsi:type="array">
            <item name="wrapper" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Set Design Area</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="opened" xsi:type="boolean">false</item>
            </item>
        </argument>
        <settings>
            <wrapper>
                <canShow>true</canShow>
                <componentType>fieldset</componentType>
            </wrapper>
        </settings>
        <block name="custom.block" class="CompanyName\ModuleName\Block\Adminhtml\Product\Custom" template="CompanyName_ModuleName::product/custom.phtml"/>
    </htmlContent>
</form>

view/adminhtml/templates/custom.phtml

Set Design Area for the product customisation

    <?php //echo "
"; print_r($block->getCurrentProduct());?>

    <form data-form-part="product_form" method="post" action="">
        <input type="hidden" name="canvasHeight" id="canvasHeight" value="1">
        <input type="hidden" name="canvasWidth" id="canvasWidth" value="2">
        <input type="hidden" name="canvasXCdnt" id="canvasXCdnt" value="3">
        <input type="hidden" name="canvasYCdnt" id="canvasYCdnt" value="4">
    </form>

CompanyName\ModuleName\Observer\Productsaveafter.php

<?php

namespace CompanyName\ModuleName\Observer;

use Magento\Framework\Event\ObserverInterface;

class Productsaveafter implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $_product = $observer->getProduct();  // you will get product object
        echo "
";print_r($_product);die;
        $_sku=$_product->getSku(); // for sku

    }
}

I see the html part but when I click on Save button on product page the form values does not get printed. Is there any other way where to do this easily?
Please help


texts:
I develop a module with custom connection to custom database, and i'm using it through Mage_Core_Model_Abstract, Collection etc.
But in exception.log i see

Exception message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbname.table_prefix_tablename' doesn't exist

But my custom db doesn't have a table prefix.
I've tryed to override table_prefix

<global>
<resources>
<db><table_prefix><![CDATA[]]></table_prefix></db>
<customdb_write>
...

but it doesn't work.
What can i do?


texts: Can i retrieve Product Custom Options with magento REST?

texts:
I am developing system to manage some services outside of magento system, however i need both systems (magento and the one i am creating) to comunicate.

So i went to magento rest api documentation and searched about how to fetch products, wich i think is pretty simple, but i am not sure if the custom options of the products will be returned in the request.

Any help/tip?


texts: My custom customer attribute field wont insert into the database?

texts:
Im new to Magento 2 and I've been trying to work this problem out where I need to create a unique field in the database called "GitHub_Url" and then validate that field to make sure that its no more than 200 characters long, and that it is, in fact, a URL, and appears in the user registration form.
Here is my code:

BRM2\Customers2\Setup\InstallData.php

<?php

namespace BRM2\Customers2\Setup;

use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Customer\Model\Customer;
use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{

    /**
     * @var CustomerSetupFactory
     */
    protected $customerSetupFactory;

    /**
     * @var AttributeSetFactory
     */
    private $attributeSetFactory;

    /**
     * @param CustomerSetupFactory $customerSetupFactory
     * @param AttributeSetFactory $attributeSetFactory
     */
    public function __construct(
        CustomerSetupFactory $customerSetupFactory,
        AttributeSetFactory $attributeSetFactory
    ) {
        $this->customerSetupFactory = $customerSetupFactory;
        $this->attributeSetFactory = $attributeSetFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');

        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

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

        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute(Customer::ENTITY, 'github_url', [
            'type' => 'varchar',
            'label' => 'github_url',
            'input' => 'text',
            'required' => true,
            'visible' => true,
            'user_defined' => true,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_searchable_in_grid' => true,
            'validate_rules' => '{"max_text_length":200,"min_text_length":10,"validate-url":true}',
            'sort_order' => 1000,
            'position' => 1000,
        ]);

        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'github_url')
            ->addData([
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer'],
            ]);

        $attribute->save();
    }

}

The requirements are:

Make the "Github_Url" field unique    done
Validate to make sure it is a URL done
200 Characters Max done
appears in the user registration form  done
appears when the user attempts to edit his information

But every time I try to save the customer I receive the following error on-screen
"The "github_url" attribute value is empty. Set the attribute and try again."
and when I checked the logs it says

Integrity constraint violation: 1062 Duplicate entry '' for key
'customer_entity.CUSTOMER_ENTITY_GITHUB_URL', query was: INSERT INTO
customer_entity (website_id, email, group_id, store_id,
created_at, updated_at, disable_auto_group_change, created_in,
prefix, firstname, middlename, lastname, suffix, dob,
default_billing, default_shipping, taxvat, confirmation,
gender) VALUES (?, ?, ?, ?, '2021-03-12 16:56:02', '2021-03-12
16:56:02', ?, ?, ?, ?, ?, ?, ?, NULL, ?, ?, ?, ?, ?)


texts:
so I have breadcrumbs in breadcrumbs.phtml and I don't know how to change their format for example I have this in $crumbs:

  [category1484] => Array
        (
            [label] => Laptop
            [link] => http://www.someweb.com/radioshack/catalog/category/view/s/laptop/id/1484/
            [title] =>
            [first] =>
            [last] =>
            [readonly] =>
        )

Instead I want to have the url keys for the breadcrumb so that I have like this:

http://www.someweb.com/radioshack/laptop

for example in products I could use to get urls like this:

 <a href="<?php  echo  Mage::helper('core/url')->getCurrentUrl()."/".$prod->geturl_key(); ?>">

But I do not have this option in bread crumbs should I customize breadcrumbs and start over or can I change the format?

We have url rewrites in just one store and we can show the products and categories by url_key but for breadcrumbs I have problem and if you ask why you have just for one store it is because we needed it to be faster so we kept it in just one store


texts:
I had a magento website abc.com and now migrated all files and database to xyz.com.
After changing database and url path, the xyz.com is displaying the same home page(front-page). But, when you click on any product or page in home page or go to Admin Login url:

  Not Found

  The requested URL /admin was not found on this server.

  Additionally, a 404 Not Found error was encountered while trying to
  use an ErrorDocument to handle the request.

Need your help.


texts: Magento2 : How to add Observer for catch when new order placed

texts:
I wanted to save the orders from magento2 to my local Database.

I am planning to Create a module and add Observer to catch once a order is placed.

I don't know much about the Events & observer, just gone through this link

Please help me is there any Event already given by Magento2 after new Order. if there is no default event for Order placement Where do I have to write a event for new order.

Thanks in Advance.

Edit:

  app\code\Autosynch\Sale\registration.php

<?php /**
* Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Autosynch_sale',
__DIR__
);

  app\cpde\Autosynch\Sale\Observer\OrderPlaceAfter.php

<?php

namespace Autosynch\Sale\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;
use \Psr\Log\LoggerInterface;

class OrderPlaceAfter implements ObserverInterface
{
    public function execute(Observer $observer, LoggerInterface $logger)
    {
        $order = $observer->getEvent()->getOrder();

        $logger->info($order->getData());
        $logger->debug($order->getData());

        var_dump($order->getData());
        exit;
    }
}

  app\code\Autosynch\Sale\etc\module.xml

<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Autosynch_Sale" setup_version="0.0.1">
    </module>
</config>

  app\code\Autosynch\Sale\etc\event.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_submit_all_after">
        <observer name="modulename_sales_order_place_after" instance="Autosynch\Sale\Observer\OrderPlaceAfter" />
    </event>
</config>

Please help me where I am missing.


texts: Disable products programmatically based on values

texts:
I have a problem. I need to disable products if they are in category ID 154 and have a quantity of less then 1.

I use the backorder function but these products should not be able to backorder. How can I solve this?

Another way can be to add a special attribute to the products and when they go quantity=0 they should get disabled. Or they get the value "Not in stock"

But how can I solve this in a good clean way?


texts: Magento 1 enable captcha on multiple website

texts:
I'm running and old website M1 EE 1.14. The captcha under System->Configuration->customers->customer configuration can be enabled easily. However, when I switch the configuration scope to other websites, the captcha config is missing.

Does anyone know on how to enable captcha for each website individually?


texts: Override captcha library class in magento 2

texts:
With reference to my own question, I have found that we can change density and number of lines and dots in native magento 2 captcha in /vendor/magento/zendframework1/library/Zend/Captcha/Image.php.

Now my question is that how can we override above file class using custom module, because we don't want to make changes directly in core magento files.

Any help would be appreciated.

Thanks


texts:
I recently started developing on magento2 and I'm finding a habitual problem always.

When I start creating new extension or something, it's normal I will need M2 objects on my controller's constructor, like:

\Magento\Framework\View\Result\PageFactory
\Magento\Framework\App\Action\Context
...

and a lot more, like "session", "product", "customer" etc, etc.

The problem is how I find all the namespace and how it works, variables and methods, etc? I searched on http://devdocs.magento.com/ and seems they don't provide information about M2 objects or I didn't find it. They just explain how to do this DI and use their objects...

I feel like I'm blind, my only tool is google and always I ended up coming to stack overflow or similar with a guy asking like: How to use session on magento2 (for example)... and then magically someone says to use this:

\Magento\Framework\Session\SessionManagerInterface

$this->sessionManager->setVar('whatever');

ahm... okay this is how I learned to use sessions on Magento... but I'm still so blind... what else can do this object? when I google SessionManager nothing real appears... I only see questions...

So... how you do M2 developers? I only see an alternative navigating through Magento2 core folder for discovering new useful objects or learning about known objects... but it can be a nightmare...

Really, there's not a document with ALL M2 objects, what is their purpose, methods, variables, etc...


texts: How to use config:sensitive:set command in Magento 2 CLI?

texts:
I notice there are two commands, config:set to Change system configuration and config:sensitive:set to Set sensitive configuration values.

I learned Sensitive configuration values hold restricted or confidential information (e.g. - keys, username, password, personally identifiable info) and store settings to app/etc/env.php.

I use config:set frequently but how can I use config:sensitive:set practically? What is the difference between them? Thank You.


texts:
I have a category full of shirts.

All shirts are different prices

What I am trying to do is if 3 shirts are selected the total cart price is $250

if 6 shirts are selected the cart price is $500

if 4 shirts are selected the first 3 are at $250 then the 4th shirt at full price

Can this be done?

Thanks in advance


texts: Magento 2 randomly applying wrong custom layout

texts:
I have got an issue applying custom layout to a CMS page.
I am on Magento 2.2.0 Enterprise edition on a multiserver stack.

Here is my configuration :

File Vendor/Theme/view/frontend/page_layout/full_width.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="main.content" htmlClass="full_width_content" />
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
    </referenceContainer>
</layout>

File Vendor/Theme/view/frontend/layouts.xml

<?xml version="1.0"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="full_width">
        Full width
    </layout>
</page_layouts>

File Vendor/Theme/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Theme" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Theme"/>
            <module name="Magento_Cms"/>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>

On the CMS page configuration I chose Design > Layout > Full width

The expected result will be the  element having the class .full_width_content but sometimes I have the default class .page-main defined in vendor/magento/module-theme/view/base/page_layout/empty.xml

Over 10 page loading I have:

1 time
9 times

Has anyone ever encountered this problem?
Do you have any ideas for testing and debugging?
Is that a configuration issue?

Thank you!


texts: Magento 2: How to add a link to Stores->Configuration

texts:
I have a section <MySection> defined in system.xml, and a menu item called Settings in menu.xml. <MySection> can be found in Mangento Admin: Stores->Configuration->MySection, The link for the Setting should be the url of <MySection>. I have tried to add action='admin/system_config/edit/section/', but it doesn't work as the key in url is different. I have also tried to redirect to that link in controller by doing:

$resultRedirect = $this->resultRedirectFactory->create();
$resultRedirect->setUrl('/admin/admin/system_config/edit/section/easytranslationplatform');

return $resultRedirect;

it failed as well. So, my question is that how to add a menu item that can link to Store->Configuration-><mySection> page.


texts: Magento 1 to Magento 2 conersion Mage::getModel('sales/order')

texts: What is the class that is instantiated with command Mage::getModel('sales/order') in Magento 1 and what is the replacement of this class in Magento 2, ie. how can I get it with command $objectManager -> get($stringForGettingIt) ?


texts: How to add type and search for Magento2 Products Attributes (dropdown)?

texts:
I  want to add "type and search" select box feature in Magento 2 product attribute dropdown.

It is very difficult to select brand when i have more than 1000 brands .

can anyone help me ?
Thanks


texts: I have a Magento store which hosting information are missing. I can login into the admin panel and want to access the module files from there. Can I do this?


texts: styles-m.css 404 (Not Found) after installing ElasticSuite Module by Smile. | Elasticsearch

texts:
After installation of this module: https://github.com/Smile-SA/elasticsuite/ the front-end is now messed up. Installed using composer. Magento ver. 2.2.4 with ElasticSuite 2.6.x latest release.

In the console I get:

  GET http://www.example.co.uk/static/version1540202793/frontend/Venustheme/body_fitness_child/en_GB/css/styles-m.css 404 (Not Found)

I cleared the cache and even deployed static content again, however, the error is still present.

Anyone have experience or is using this module? Any suggestions?


texts: How are you supposed to navigate the mobile menu with the keyboard?

texts:
I am working on fixing Magento accessibility issues to bring Magento 2 up to meet WCAG 2.0 AA.  The mobile menu seems impossible to me to navigate with the keyboard.  I can open up top level items using the arrow keys (tab does not work), but not further into the menu than that.  On the level I can access, it also seems to only apply the class of .ui-state-focus as opposed to an actual :focus so built-in visible focus standards appear bypassed.
I'm curious if just missing something here on how to properly navigate this with just the keyboard?  If not, is there a solution to resolve this without having to rebuild the whole menu?
FWIW I'm running Magento 2.3.6 using the Blank theme that comes with Magento.


texts: How to Increase column count on magento product category page

texts:
Is there any way to increase column count in magento product category page.
Default it listed 4 product in a row. I need 5 Products in a row


texts: how to set the css for special price products on cms page

texts:
I have a cms page on which i am showing products having special price only issue with products catalog listing this is link
http://www.motifz.com.pk/special-offer/?___store=default
when select view all the catalog products css out of control please guide me how i fix it thanks in advance
EDIT
following is my xml related with promotional

<catalogextensions_index_promotional>
        <reference name="content">
            <block type="catalogextensions/promotional_list" name="promotional_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
                </block>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
            </block>
        </reference>
    </catalogextensions_index_promotional>


texts: Magento 2: Product's main image not able to display

texts:
I have uploaded some products with images manually before 2 days. But product images are not displaying now at back end as well as front end.

Wired thing is that thumbnail image displays properly in back end grid and front end list page but some what how I don't know product main image not displaying.

I have tried reindex, disabled cache and also checked in db as well as folder, images are there.

Please let me know if you have any solution to resolved this issue.

Thanks in advance.


texts: Magento 2 : How to get product size Swatches in Configurable product page?

texts:
I have a custom module in my product page which allows customers to ask them notify them when an out of stock product size comes back in stock. I want to get out of stock product size swatches on a custom form inside a modal in product page but Im not able to get the swatches when I add block in layout.

 <block class="Magento\Framework\View\Element\Template" name="custom-modal" template="Vendor_module::custom-modal.phtml" >

                <block class="Magento\Swatches\Block\Product\Renderer\Configurable" name="product.info.options.swatches_inside_modal"   />

            </block>

How can I get out of stock product size swatches inside my custom-modal.phtml?


texts: How to add field dependency in admin customer form UI component

texts:
I'm trying to add field dependency with two custom fields added to admin customer form by extending customer_form.xml in local extension.

Here is one answer

Dependency in admin form field in magento 2, but for default admin from is not ui component.

Can it be done with just XML ?


texts: How to change last name as optional in Magento-2

texts:
I want to change lastname as optional in customer address in Magento-2.

Vendor\magento\module-customer\view\base\ui_component\customer_form.xml

override into

mycompany\custommodule\view\base\ui_component\customer_form.xml

But i can't to override it.
If anyone knows please help me


texts: Magento ver. 1.9.3.8 customer/user login didn't working in chrome? But working in firefox and Edge

texts:
My magento store customer login is just reloading the page in chrome. I have checked the code flow, Everything is good. Like the session is setting, Even its going to customer/account/index. But returning back.

Kindly Help.


texts:
I have used authorized.net payment method and its working fine.

In account dashboard I have a link Payment Methods which says "You have no stored payment methods".

I want to ask how it works means I didn't find any option to add payment methods or enable it from admin side.

Please guide me.

Thanks


texts:
I need to export the following from all my products.

Sku
Name
Description

I have tried to use the dataflow profiles, it just has not worked for me at all. We are running at 100k products and I think its too big for that option, I have found this script though which exports sku and category_id

<?php
error_reporting(E_ALL | E_STRICT);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
Mage::app();
$products = Mage::getModel("catalog/product")->getCollection();
$products->addAttributeToSelect('category_ids');
$products->addAttributeToFilter('status', 1);//optional for only enabled products
$products->addAttributeToFilter('visibility', 4);//optional for products only visible in catalog and search
$fp = fopen('exports.csv', 'w');
$csvHeader = array("sku", "category_ids");
fputcsv( $fp, $csvHeader,",");
foreach ($products as $product){
$sku = $product->getSku();
$categoryIds = implode('|', $product->getCategoryIds());//change the category separator if needed
fputcsv($fp, array($sku, $categoryIds), ",");
}
fclose($fp);
?>

Something like this would be ideal, but I have no idea how to modify it to export different things...

Can someone talk me through it?


texts: Magento 2 data migration tool says `Migration completed`, however the data is not migrated

texts:
I want to move to Magento 2. I use the Magento 2 Data Migration Tool to transfer the data from Magento 1 to Magento 2.

The first thing I migrated is settings:

  sudo php bin/magento migrate:settings -r
  /path_to_magento_installation/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.1.1/config.xml

(With the path to my Magento installation instead of path_to_magento_installation.)

  However, when I go to the Magento 2 backend, I see that my stores and
  pages (and I think every other setting) is not migrated. It is the
  same as before using migrate:settings.

What went wrong? / What do I have to do?

  Thanks in advance!


texts:
I'm looking to have a pricing table (on the frontpage) for one specific product, but 3 different (predefined) quantities.

Showing the product and having the correct add to cart links on the page was relatively easy:

$_productId = '498';
$_product   = Mage::getModel('catalog/product')->load($_productId);
$_url       = Mage::helper('checkout/cart')->getAddUrl($_product);

Getting the Qty 1 price including tax, currency and some formatting was easy as well:

$_price = Mage::helper('core')->currency(Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice()));

This results in €15,00

However, my goal is to have a pricing table like:

┌───────────┬───────────┬───────────┐
│  Single   │ ValuePack │ FamilyPack│
├───────────┼───────────┼───────────┤
│   €15     │    €10    │    €7.50  │
├───────────┼───────────┼───────────┤
│  Qty 1    │   Qty 5   │   Qty 10  │
└───────────┴───────────┴───────────┘

Getting the Qty * X price wasn't hard either:

$_qty = 5;
$_price = Mage::helper('core')->currency(Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice($_qty)));

As expected, this results in €10,00

However, even though I change $_qty, the output of the other 2 prices is always the same as the first.

Illustration:

$_price_1 = Mage::helper('core .... $_product->getFinalPrice(1))); results in €15
$_price_2 = Mage::helper('core .... $_product->getFinalPrice(5))); results in €15 as well
$_price_3 = Mage::helper('core .... $_product->getFinalPrice(10)); results in €15 as well

I'm assuming this has something to do with Magento caching the product price after the first lookup.

Anybody got a clue on how to create this table the correct way?


texts: Magento 2: How to override Ui & Component folder files

texts:
How to override these below files:

vendor/magento/module-configurable-product/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanel.php
vendor/magento/module-ui/Component/Form.php

ConfigurablePanel.php is defined in vendor/magento/module-ui/etc/adminhtml/di.xml


texts: Magento 1.8.1 Product Stock alert emails not sending

texts:
The Product Stock Alert emails are not sending.

Other emails such as new membership and password chages are sending

Cron appears to be working - the "catalog_product_alert" job is scheduled and appears to be running every minute. The product_alert_stock table shows who is signed up and shows that they have been notified, but they don't get an email.

Looking at email reports in cpanel suggests that no emails have been sent - they are not pending or blocked or successful.

Is there anything else I need to check? Thanks very much!


texts: How to get all order items using sales_order_grid_collection_load_before in magento

texts:
Below is my code but I can't fetch order items details,just I need order items from sales_order_grid_collection object,I also try getAllItems() but it does not work

This is my config.xml file

<sales_order_grid_collection_load_before>
                <observers>
                    <package_module_sales_order_grid_collection_load_before>
                        <class>marketplace/observer</class>
                        <method>customOrderGridCollection</method>
                    </package_module_sales_order_grid_collection_load_before>
                </observers>
            </sales_order_grid_collection_load_before>

this is observer.php

public function customOrderGridCollection(Varien_Event_Observer $observer)
 {
            $orderGridCollection = $observer->getOrderGridCollection();
            // $collection = $observer->getEvent()->getOrderGridCollection();
   foreach ($orderGridCollection as $order)
   {
    foreach ($order->getAllItems() as $item) //$order->getAllItems() not work
    {
        // $item->getData('product_id') not work

    }
   }

 }


texts: Magento v2.3.5 to v2.3.6 update, composer version issue

texts:
I believe this is due to the recent update to composer, but would appreciate any thoughts...
Trying to update Magento from 2.3.5 to 2.3.6, having just updated to the latest version of composer (2.0.4)
I get the following error:

Root composer.json requires magento/product-community-edition 2.3.6 -> satisfiable by magento/product-community-edition[2.3.6].

magento/product-community-edition 2.3.6 requires magento/composer ~1.5.0 -> satisfiable by magento/composer[1.5.0, 1.5.1] from composer repo (https://repo.packagist.org) but magento/composer[1.0.2, ..., 1.6.0] from composer repo (https://repo.magento.com) has higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.

It sounds like Magento 2.3.6 does not support the latest version of Composer, is this correct? If so, any ideas how to get around this?
Thanks


texts: How to get the (literally) entered Discount Code?

texts:
I'm using Magento 2 and I've created a Plugin based on Magento\Quote\Api\CouponManagementInterface

My plugin is working fine, I can get value from the log. But, my problem is the following: I want to get the actually entered discount code (in the Apply Discount Code field during checkout). But, in my plugin it keeps returning 25. (I've entered a fake code 12345).

public function beforeSet($cartId, $couponCode) {
  $log = fopen(dirname(__FILE__).DIRECTORY_SEPARATOR."CouponManagement.log", "a");
  fwrite($log, date("d-m-Y H:i's")." beforeSet: ".$couponCode."\r\n");
  fclose($log);
}

No matter what I do, it keeps returning/writing: timestamp beforeSet: 25

What I basically want is to use the entered code to call an external API to return an existing giftcard value which I can than use to insert (and use) as a new Discount Code into Magento.

Any help would be greatly appreciated!


texts: Removing javascript and css from specific cms page in magento1

texts:
I am trying to remove the css and JS for a specific CMS page but none of the JS or css are being removed.
Here is the code that i am using to remove the css and JS

<layout>
    <reference name="head">
        <action method="removeItem"><type>js</type><name>prototype/prototype.js</name></action>
        <action method="removeItem"><type>js</type><name>lib/ccard.js</name></action>
        <action method="removeItem"><type>js</type><name>prototype/validation.js</name></action>
        <action method="removeItem"><type>js</type><name>scriptaculous/builder.js</name></action>
        <action method="removeItem"><type>js</type><name>scriptaculous/effects.js</name></action>
        <action method="removeItem"><type>js</type><name>scriptaculous/dragdrop.js</name></action>
        <action method="removeItem"><type>js</type><name>scriptaculous/controls.js</name></action>
        <action method="removeItem"><type>js</type><name>scriptaculous/slider.js</name></action>
        <action method="removeItem"><type>js</type><name>varien/js.js</name></action>
        <action method="removeItem"><type>js</type><name>varien/form.js</name></action>
        <action method="removeItem"><type>js</type><name>varien/menu.js</name></action>
        <action method="removeItem"><type>js</type><name>mage/translate.js</name></action>
        <action method="removeItem"><type>js</type><name>mage/translate.js</name></action>
        <action method="removeItem"><type>js_css</type><name>ves/jquery/plugins/fancybox/jquery.fancybox.css</name></action>
        <action method="removeItem"><type>js_css</type><name>ves/jquery/plugins/fancybox/jquery.fancybox.css</name></action>
        <action method="removeItem"><type>skin_css</type><name>css/font-awesome.min.css</name><params/></action>
        <action method="removeItem"><type>skin_css</type><name>css/bootstrap/bootstrap-tiny.css</name><params/></action>
        <action method="removeItem"><type>skin_css</type><name>css/custom_theme.css</name><params/></action>
        <action method="removeItem"><type>skin_css</type><name>css/animate.css</name><params/></action>
    </reference>
</layout>

This code is written in layout update xml under Design tab
I am attaching image for reference.

tab

but none of the JS is CSS is being removed. I tried to debug in code but my remove item is not being called for the files i am calling. So there must be some other way to do this. Please help !
Thank you


texts: The sitename.com is't working www.dellbazar.com is currently unable to handle this request Http Error 500

texts:
I install Magento using softaculous. It installed successfully but after that am having this error. Here is the error log details :

[20-Dec-2016 14:03:15 UTC] PHP Fatal error:  Call to undefined function iconv_substr() in /home/dellbazar/public_html/app/code/core/Mage/Core/Helper/String.php on line 103
[20-Dec-2016 14:03:58 UTC] PHP Fatal error:  Call to undefined function iconv_strpos() in /home/dellbazar/public_html/lib/Zend/Locale/Format.php on line 486

These errors repeats many times.


texts: Magento | Get the last status for any order

texts:
We need to get the last status of the order on fly after the order is placed in the frontend.

Can you please help us in it?

Thanks


texts: Add product alerts for "out of stock" associated products

texts:
In Magento 1.9.2.4, I would like to display product alerts for associated products even though other associated products for the configurable product are in stock. For example, I have shoes in sizes 5-14. We are out of stock in just a few sizes, 7.5 and 9. I would like to have the product alert come notify them when those 2 sizes become available.

Unfortunately the product alerts do not show up if there is at least one associated product in stock for the configurable group.

Does anyone know how to set up the product alerts so customer can be notified when the size they want comes back in stock.

Thank you


texts:
If in some product price varies based on weight like kiranaman.com or truemart.in > grocery having an option for display weight, so like same way anyone please suggest me how this works for my store. I'm using Magento 1.9.2.2 version. Please find out the URLs and image

Display Weight        Actual Weight    Price     Spl. Price
  20 Lb  (9.08 Kg)        20 Lb         $15.99
  10 Lb (4.54 Kg)         10 Lb          $8.99      $8.49
   5 Lb (2.27 Kg)          5 Lb          $5.99
   2 Lb (908 g)            2 Lb          $2.99
   1 Lb (454 g)            1 Lb          $1.49


texts:
Grouped Products - is it possible to show out of stock status individually (by each product)?

Magento: 1.9


texts: My transactional email is sent many times

texts:
I have an issue with my shell script. I'm trying to send a transactionnal email to a list of specific customers (more or less 1000 customers) Sometimes, an email is sent 2 or 3 times to the same customer and I don't understand why.

I've got my customers collection and I made a loop on it.

$emailTemplate = Mage::getModel('core/email_template')->loadDefault('birthday_mail');

foreach( $customerList as $customer ){

    $emailTemplateVariables = array();
    /*
     ...
    */

    $emailTemplate->send($customer->getEmail(),'John Doe', $emailTemplateVariables);
}

This script is execute with Pentaho Data Integration.
I'm wondering if my code is correct and the problem is on Pentaho execution or if I made a mistake in my script.


texts:
i have tried every things to solve this issue.
So when i try to upload an product image with the size image over 100 kb there is this issue..
i already set into .htaccess SecFilterEngine Off,  post_max_size 16MB, upload_max_size 16MB there isn't protection password limitation i think and i have tried to set the secure url with http.

But it doesn't change.
Please help me, what can i do?


texts: approve and delete products on magento frontend

texts: I have a M2 extension that provides me to a frontend dashboard to allow suppliers to upload products. The extension also provides a product list table that show supplier products. Is there a way to approve or delete a product from frontend instead of login into backend as admin user? I mean put some buttons into the product list table and assign the respective functionality to the button. Is there a way to do that?


texts: Set front-end product in stock / out of stock of each product

texts:
I tried to modify the product's frontend stock status. First I got my stock for each product that is different for each customer in my outside database.

How can I make the customization in magento such that, if customer is logged in, the loaded product status will change based on the customer id and product sku, but it will not change the backend product status.

For example, customer with id = 1, and product sku = A0001, at my outside database, the specific product quantity is 1000, so the product with sku A0001 will display the status to in stock, but when customer with id = 2 and sku = A0001 is logged in, at my outside database, the quantity is 0, so the product with sku A0001 will display the status to out of stock for customer 2.


texts:
I am using Magento 1.9.3.7 at URL http://wowitprojects.com/inkmytale/
But i did not get any emails. I have already make changes suggested in https://stackoverflow.com/questions/27450413/magento-1-9-1-0-order-confirmation-emails-not-sending.


texts: Magento 2 - How to auto checked a multiselect ui-component?

texts:
I have a ui-component
        <field name="interest" formElement="multiselect">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">customer</item>
                </item>
                <item name="options" xsi:type="object">
                    \Model\InterestOptions
                </item>
            </argument>
            <settings>
                <imports>
                    <link name="customerId">${ $.provider }:data.customer.entity_id</link>
                </imports>
                <label translate="true">Interest</label>
            </settings>

        </field>

And the data source come from InterestOptions.php
class InterestOptions implements OptionSourceInterface
{
    public function toOptionArray()
    {

        return [
            'option1' => [
                'label' => 'Option 1',
                'value' => 'option1'
            ],
            'option2' => [
                'label' => 'Option 2',
                'value' => 'option2'
            ]
        ];
    }
}

How can I auto checked some value by my own logic in my source php?


texts:
If I would like to setup HTTPS on all pages (Frontend and Backend) which would be the best approach?

For now using Apache 2.4 on CentOS 7 I have setup the following in VirtualHost:

VirtualHost *:80
        ServerName www.magentotest.dev
        ServerAlias www.magentotest.dev
        DocumentRoot /var/www/magento/
        ErrorLog /var/log/magentotest/error.log
        CustomLog /var/log/magentotest/access.log combined

        Redirect / https://www.magentotest.dev/
/VirtualHost

VirtualHost *:443
        ServerName www.magentotest.dev
        SSLEngine on

        SSLCertificateFile /etc/ssl/certs/magentotest.crt
        SSLCertificateKeyFile /etc/ssl/certs/magentotest.key

        DocumentRoot /var/www/magento/
        ErrorLog /var/log/magentotest/ssl.log
        CustomLog /var/log/magentotest/ssl.log combined
/VirtualHost

After doing this I visited Magento frontend which was totally messy, after a quick inspection on the source code I have seen that the browser was correctly redirecting HTTP to HTTPS but all the URL of the website was pointing to HTTP.

So I login to the backend and set HTTPS for both SECURE and UNSECURE URL in store settings, flush the cache and tried again, everything now appear to be correct and working.

From this setup I have a few questions:

Is this the correct way to setup HTTPS for every page (Frontend and Backend)?
Setting the UnsecureBaseURL in the backend to HTTPS I expected a slow performance on Frontend, correct me if I'm wrong but with this setup Apache is pointing the user to HTTPS, while Magento take the request, process it with PHP which answer GO to HTTPS right? I mean there is a way to avoid using Magento Secure/UnsecureBASE and tell Magento to point just to HTTPS and forget everything else?

Thanks
Marcos


texts: How to change sales price from 4 to 2 decimal digits on main page?

texts:
I'm completely newbie to Magento so need full explanation/path to change a sales price from 4 to 2 decimal digits on my main page. On the product page it shows correctly, see California-dreaming.com first dress Katharine.

Seems to require some coding somewhere as couldn't just go to System/Manage Currency/Rates and change the 4 decimal digits it shows there. My prices are usually showing with only 2 digits but adding sales price makes the problem on the main page, and only on that page?!?

I have no idea where the coding takes place, so if someone knows the answer please include the steps to get to the system file where I need to  make a change.

I have Magento 1.9.1.0

Thanks

Senna


texts: Magento 2.3 - Add a new column after one column into the table using db schema

texts:
I need to add a new column after one of the particular columns in the existing table using DB schema & checked this dev doc link, they didn't mention about the before or after column.

Is there any way to do this?


texts: How to create bundle product programatically and add it to cart at runtime?

texts: I want to create a bundle product with radio and checkboxes at run time and add it to cart.Suggest me solution


texts: How to integrate Custom Courier in Magento

texts:
I want to integrate DTDC couriers on my project website. But the courier agency didn't provides the api for integration.So I want to know How to manually integrate the courier service, and how to manage it.

Thanks


texts: Data format for creating a product using soap api in magento 2

texts:
$productData = array(
        'sku'               => 'MSD',
        'name'              => 'MSD',
        'visibility'        => 4, /*'catalog',*/
        'type_id'           => 'simple',
        'price'             => 5,
        'status'            => 1,
        'attribute_set_id'  => 4,
        'weight'            => 1,
        'custom_attributes' => array(
            array( 'attribute_code' => 'category_ids', 'value' => ["3"] ),
            array( 'attribute_code' => 'description', 'value' => 'Simple Description' ),
            array( 'attribute_code' => 'short_description', 'value' => 'Simple  Short Description' ),
            ),
    );

and passing data like below

$result = $soapClient->catalogProductRepositoryV1save(array('product' => $productData));

I got this error
Fatal error: Uncaught SoapFault exception: [env:Sender] Invalid product data: %1 in D:\xampp\htdocs\magento214\vendor\zendframework\zend-soap\src\Client.php:1116 Stack trace: #0 D:\xampp\htdocs\magento214\vendor\zendframework\zend-soap\src\Client.php(1116): SoapClient->__soapCall('catalogProductR...', Array, NULL, NULL, Array) #1 D:\xampp\htdocs\magento214\soap5.php(34): Zend\Soap\Client->__call('catalogProductR...', Array) #2 {main} thrown in D:\xampp\htdocs\magento214\vendor\zendframework\zend-soap\src\Client.php on line 1116


texts: magento 2.1.7 can we give product price based on multiple stores

texts:
As i need to give product price for same product based on multiple stores.
Can we give product price for same product based on multiple stores  in magento 2.1.7


texts: Magento 2 : Change Display Form of Customizable Products

texts:
The price of product with different design is shown below. I have kept the product price as zero and mentioned the price of variants like this. But in the front end its showing Suede+ 655.

I want it to be "Suede= Rs 655" or only "suede". How to do it?


texts: Where are the admin panel pages in Magento?

texts: When you go to Catalog->Manage Products you can search a product by its SKU. I need to make a change in the page so I can put some restrictions in this search. How can I find which page is fired when you search by SKU ?


texts: Add module to Magento Marketplace - where can I find their official tester utility

texts:
I intend to add my first module to Magento marketplace.
While reading the documents they say that in the first step the module will go into a first automatic test phase using their utility and they encourage people to download this script and test before application. But the link provided is not working.
Anyone know how can I get it ?
Thanks !!!


texts:
I have just placed a test order and noticed that the Order # (44) is much lower than the last sale which occurred on my store Order # 85. How do I correct this?

Edit: Have added screenshot of eav_entity_store table.


texts:
I want to manage the products in magento on a website scope instead of the default scope. The problem is, that i am not allowed to access the website/store-scope because its greyed out / disabled.
However, i can alter them on a view scope level, but since i can have multiple views, this would be a heavy workload to alter the attributes for every view instead of website/store level.

Is there a solution, that a developer can somehow override this default behavior of the catalog/products adminhtml?

In the picture i want to set values for the according Testsite/Teststore scope which is currently denied for me.

I also want to achieve the same behavior for third party extensions which operate on the same way (not within System -> Configuration)


texts: Make one of article X free, if article Y is N times in the cart

texts:
I have an article "Wood" (Articlenumber 1115). If the user puts 42 wood in the cart, then he should get one Axe for free, but he must put the Axe to his cart himself, because he has too choose one.

The axes which he can choose have the following article numbers:

521537, 521538, 521517, 521518, 521527, 521528

I created this rule as Condition (sorry for the german UI, I translated some strings)

This is the action (again: I translated it from german to english):

Problem:

If the user puts 42 Wood in the cart and then one axe, then it works and the axe is for free!

But if the customer puts another axe which is in the article number list to the cart, then it is also free, but I want to gift the customer only one axe.

The documentation says The discount applies to each qualifying item in the cart. How can I change it so that it only applies to one of the items and then stops?

I hope the problem was clearly described.

What am I doing wrong?


texts:
Is there any possiblity to build custom order summary form in emails?

I'd like to build custom table which I can style as needed since editing files in Magento_Sales/templates/email/* doesn't have much effect.

Or how could I at least edit Totals? They seem to be generated right from the system.

Thanks for help.


texts: Changing in PHTML in Vendor Folder does not affect frontend

texts:
I changed the subscribe.phtml in

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

I just changed:

<?= $block->escapeHtml(__('Subscribe')) ?>
to
Test

I cleared everything with :

sudo rm -rf pub/static
sudo rm -rf var/cache
sudo rm -rf var/composer_home
sudo rm -rf var/generation
sudo rm -rf var/page_cache
sudo rm -rf var/view_preprocessed

and then started php bin/magento setup:static-content:deploy.

But nothing changed. Why ? Please help


texts: How to delete all products in a specific category on magento 2?

texts: How to delete all products from a specific category in Magento 2? or delete products by category id.


texts: Magento 2 Store switcher error in "section-config.js" Uncaught TypeError: Cannot read property '*' of undefined(…)

texts:
I'm implementing a custom store switcher in my custom theme.

Block template is as follow:

<?php if (count($block->getStores())>1): ?>
    <?php $id = $block->getIdModifier() ? '-' . $block->getIdModifier() : ''?>

    <?php echo $block->escapeHtml($block->getStoreName()) ?>

    /

    <?php foreach ($block->getStores() as $_lang): ?>
        <?php if ($_lang->getId() != $block->getCurrentStoreId()): ?>
            <span class="view-<?php echo $block->escapeHtml($_lang->getCode()); ?> switcher-option">
                <a href="#" data-post='<?php /* @escapeNotVerified */ echo $block->getTargetStorePostData($_lang); ?>'>
                    <?php echo $block->escapeHtml($_lang->getName()) ?>

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

<?php endif; ?>

The link to new store is correctly displayed so I guess the xml stuff is OK, but on click I receive the following error:

  section-config.js:33 Uncaught TypeError: Cannot read property '*' of
  undefined(…)

The generated html looks like the following:

    It


texts: Magento 2: changes to default.xml in custom theme aren't loaded

texts:
My custom theme is not loading any data from default.xml.

I confirmed this by checking the mage file in var/cache directory.

Can anyone please help me by explaining the cases in which default.xml doesn't reflect?


texts: When trying to upgrade I encounter the error "Cannot process definition to array for type time"

texts:
I'm getting the following error on Magento 2.3.2 when executing command:

php bin/magento setup:upgrade

  Cannot process definition to array for type time

I'm aware that this is usually caused by a script using time but I'm
not sure which extension is using this.

Is there a quick way to check through either the CLI or the database
to find out where it is being used and is there a safe way to change
it to another type?


texts: Changes configurable product main image to associated simple product image when option selected

texts:
Looking for a way that allow change the product image based on the attribute selected for the configurable product.

Configurable Product With Color Options : 1) Red 2) Green

If the Red is selected by user is should change the main image on the details page with the one from associated products.

Requirement: Is this available in default magento version Or should i use extension?


texts:
I followed the Magento dev docs per below:

  If you add a new .html template, and then edit it, the changes will
  not apply until you do the following: delete all files in the
  pub/static/frontend and var/view_preprocessing directories, then
  reload the pages. You can delete the files manually or run the grunt
  clean: command in CLI. For details about using Grunt in
  Magento see Installing and configuring Grunt.

However now in developer mode set via htaccess I get Internal Server Error 500 across site and admin urls. Is that a caching issue if its looking for the cleared files to render?


texts: Magento 2: How to disable Minify CSS JS setting?

texts:
I went to the admin panel.

Then I went to

Stores > Configuration > Advanced > Developer > CSS Settings

Stores > Configuration > Advanced > Developer > JavaScript Settings

and enabled minify CSS and Javascript.

Now, CSS and JS of my website are not working.
My admin panel and the website is broken.
How do I disable this setting?


texts:
I have successfully migrated all data with data-migration-tool from Magento 1.9.1.0 to Magento 2.2.4.

When trying to create customer from backend it gives below error

No such entity with email = xxx@abc.com, websiteId = 1

While when going to Back-end and trying to add new customer from admin->customers->add new customer

and trying to select website from option Associate to Website ,it is grayed out(refer image),not clickable.

I have multiple websites and stores.

Please Help to resolve this issue.

I have searched on forum and found some useful links but they are not helpfull for me.

I have run query and reindex all data but not any succes

SET FOREIGN_KEY_CHECKS=0;
UPDATE `store` SET store_id = 0 WHERE code='admin';
UPDATE `store_group` SET group_id = 0 WHERE name='Default';
UPDATE `store_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

While when trying to create customer programatically then it is creating successfully.


texts: Getting all customer addresses which have empty required fields

texts:
I'm looking for a proper way to get all customer addresses that have empty required fields (eg. postcode, street,...) so i can later delete those. (This is due to a previous version in which empty addresses were made as a placeholder by former developers. This functionality has now been removed, but those addresses still remain, causing frustration to the users who want to use one of those addresses in checkout, getting a notification that certain data is required.)

I'm fairly new to Magento, but I know there is a way you can do this in code and call the ->getSelect() to ouput a query which I can use to output the data to csv and to later remove all those addresses in a similar fashion.

So basically there are 2 things that need to happen:

Get all required address fields
Get all customer addresses which have empty data in any of these fields

(Later on I intend to use this same function to delete those addresses, but I'm sure I can figure it out once I have the needed addresses.)

I have little experience with Magento's query language, but this seems challenging even to more experienced Magento developers, so if you can get me on my way with this, I would be extremely grateful.


texts: How to display product associated categories & filter product by categories in admin panel

texts:
I am not so much familiar with magento development.i am facing some trouble
my problem is i have add product's associated categories within product name column in admin panel(catalog > manage products) & i have also filter product by categories and i don't have any idea.how to do this task.

Thanks in advance for help


texts: How to disable a magento extension from admin?

texts:
My site has an extension called "instantsearch+" for product searching operation. I want to disable it and use the default magento search. I have selected option "NO" for "Enable InstantSearch+" in the admin section, But still it is working as before.
Kindly suggest how to disable it and use the default magento search option ?
Thank you.


texts: How to create sales rule programmatically in Magento2

texts:
I am migrating code from Magento1 to Magento2 and need to create a group of sales rules programatically. I need to do this because it's based on the price of the item, plus $1 if they purchase two (buy one at full price, get a second for $1).

I was previously able to accomplish this using this code. I am wondering how one would go about it under Magento2?

        $discount = ($price - (($price + 1) / 2));
        $shoppingCartPriceRule = Mage::getModel('salesrule/rule');

        $shoppingCartPriceRule->setName('Add a second for $1 - ' . $sku)
        ->setDescription('Buy one item at regular price, and receive a second item for just $1.00 more!')
        ->setFromDate('2000-01-01')
        ->setToDate(NULL)
        ->setUsesPerCustomer('0')
        ->setCustomerGroupIds(array('0','1','2','3',))
        ->setIsActive('1')
        ->setStopRulesProcessing('0')
        ->setIsAdvanced('1')
        ->setProductIds(NULL)
        ->setSortOrder('1')
        ->setSimpleAction('by_fixed')
        ->setDiscountAmount($discount)
        ->setDiscountQty(NULL)
        ->setDiscountStep('0')
        ->setSimpleFreeShipping('0')
        ->setApplyToShipping('0')
        ->setTimesUsed('0')
        ->setIsRss('0')
        ->setWebsiteIds(array('1',))
        ->setCouponType('1')
        ->setCouponCode(NULL)
        ->setUsesPerCoupon(NULL);

        // Add Sku Condition
        $skuCond = Mage::getModel('salesrule/rule_condition_product')
               ->setType('salesrule/rule_condition_product')
               ->setAttribute('sku')
               ->setOperator('==')
               ->setValue($sku);
        $shoppingCartPriceRule->getActions()->addCondition($skuCond);

        // Add Qty Condition
        $qtyCond = Mage::getModel('salesrule/rule_condition_product')
               ->setType('salesrule/rule_condition_product')
               ->setAttribute('quote_item_qty')
               ->setOperator('()')
               ->setValue('2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96');
        $shoppingCartPriceRule->getActions()->addCondition($qtyCond);

Thank you!


texts: Magento 2 - knockoutjs template ignores script tag

texts:
I try to add a script tag with a console.log("hello world"); message in the knockoutjs template vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-rates.html
This is the template for the cart summary in the cart. ( the sidebar at the right side ) where the shipping methods are showing if you expand that section

I just added this code at the end of the file:
<script>
    console.log("Hello world!");
</script>

Then I flushed the cache and also flushed the browser cache and reloaded the site, but the console log is not showing if the shipping methods load.
The script tag is in the source code, but it is not executed.


texts: Moving blocks in backend product add form

texts:
for example I want to move the block "images and videos" before content block.

I couldn't find a way to do this:

Any hint in that direction will be greatly appreciated.


texts: Currency formatting is fine in catalog view but not produtc view on front-end

texts:
So basically I am trying to adjust currency formatting for an Algerian client, the french part of the site works fine, the Arabic side was a bit messy due to RTL language but I managed to make it work. To adjust the currency format, I edited the ar.xml and ar_SA.xml under vendor/Magento/Zend...../Locale/Data and this works fine in Catalog view but if I go into a product view (And slow down loading). The initial formatting appears and then it is caught by something else that turns it into the formatting that I do not want.
Basically the price shows up as 123 000, no decimals and space as a thousands separator in the catalog view.
If I click the product, it then appears as 123,000.00 , showing 2 decimals and putting , as the thousands seperator.
Thank you for your time


texts: Magento 2 How to prevent product save with custom condition using plugin 'aroundSave'?

texts:
I want to prevent to save the product with my custom condition, for that, I want to use the plugin with method 'aroundSave',

When the user clicks on 'Save & Duplicate' button I do not want to save the original product simply duplicate the product.
Is the plugin method is correct or I need to override the controller or use catalog_product_save_befor event?

Anyone have any example please share.

for example,

namespace Vendor\Module\Plugin;

class Save
{
   public function aroundExecute(\Magento\Catalog\Controller\Adminhtml\Product\Save $subject, $result)
    {
      if (some condition == true)
          then save product
      else
            not save the product
    }
}

How can I achieve this functionality?


texts:
the sidebar "recently ordered" show last order, but I don't get the order of product.

For example, here I have three products: C... M... S... (it's in french, so I show only the first letter).

The sidebar show in this order:
S
C
M

Why, and how I can change it ?I already search, but it's difficult to find this specific question.

I want to have the sidebar show recently order products order by name, so result would be:

C M S

I can try to explain it better if you don't understand.

Edit : I find the phtml file at :

  C:/wamp64/www/market-eurecia/vendor/magento/module-sales/view/frontend/templates/reorder/sidebar.phtml

But i don't know how it work, i find the databind with the foreach, but don't know how to change the order.


texts: How to set ifconfig for move tag use in xml magento 2

texts:
I have stuck the set configuration with ifconfig element for move tag. I was tried but no luck. you can see below code where i want to put ifconfig element:

<move element="catalog.leftnav" destination="catalog-leftnav-top" before = "-"/>

I just want to set condition when extension is disable from configuration than this move tag should not working.

if you have any alternate solution please provide to me. It will too much helpful for me and also others.

Thanks


texts: Magento 2 : How faceted data works for layered navigation?

texts:
I have created module for custom filter on category page every thing is working fine except price range in layered navigation.

Please anybody can explain me how getFacetedData('price') works in magento2

$productCollection->getFacetedData('price');

This function gives me price ranges based on default product collection not based on my filtered collection.

FYI:
I have filtered collection as below,

$productCollection = $layer->getProductCollection()
->clear()
->addAttributeToSelect(['name','price'])
->addAttributeToFilter('sku', array('in' => ['sku1','sku2']));


texts:
I have a link in the top header, once user clicks on it, it will open a modal. I want the modal to contain the contents of customer account page where he can edit his password, etc. How do I call it using a method like

echo $this->getLayout()->createBlock('core/template')->setTemplate('test/test.phtml')->toHtml();

?>

In short, customer account pages contain the list of items (My Wish list, Acount Information, Address Book, etc). I want to show in this modal only the content of Account Information which he will be able to update password, email, Avatar etc.


texts:
Good morning!

Is it possible to delete old url records in the database without harm the system?

My problem is a shop that first started with one storeview in english.

Years later they added a new language. So far no problem.

The problem now is the sitemap. The generator seems to find some old urls to the ids that were originally for the english storeview. And so we got a XML-Sitemap that has for some products the old url.

I tried so far to truncate the core_url_rewrite but that had no effect.
And I really don't want to debug the whole sitemap generator script to fix this problem because I guess that this is problem inside their database with their old urls.


texts: How to add my custom popup form after adding the products in Shopping cart magento 2

texts:
I really need someone help to fix the custom popup in add to cart. When a user will add the products into shopping bag then I want to show a popup like an image below.

I already design a custom popup. Now I want to add it to custom magento 2 theme. Please, I need your help to fix it.

and please show me the file path where I have to overwrite and how I have to put my custom code.

My custom code is:

                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>

 A new item has been added to your Shopping Cart. You now have 1 items in your Shopping Cart.

                        <input type="button" class="btn btn-default btn-md" name="" value="View Shopping Cart">
                        <input type="button" class="btn btn-default btn-md" name="" value="Continue Shopping">

        $("#modalClick").click(function(){

                    $("#loginModal").show();
            });

Stylesheet:

/* ----------------- Modal Start ----------------------- */
.modal-dialog {
    width: 800px;
}
.close-button {
   padding-right: 10px;
}
.modal-popup i {
   font-size: 20px;
}
.bt-login,.bt-login:hover, .bt-login:active, .bt-login:focus {
    background-color: #ff8627;
    color: #ffffff;
    padding-bottom: 10px;
    padding-top: 10px;
    transition: background-color 300ms linear 0s;
}

.login-tab {
    margin: 0 auto;
    max-width: 1500px;
}

.login-modal{
     margin-top: 186px;
}
.login-modal-header {
   background: #262029;
   color: #fff;
}

.login-modal-header .modal-title {
    color: #fff;
 }

.login-modal-header .close {
    color: #fff;
}

.modal-button {
    padding: 5px 0px;
    font-family: calibri;
}

.login-modal i {
    color: #2fa72e;
    font-size: 30px;
}

.login-modal form {
    max-width: 1500px;
}

.tab-pane form {
    margin: 0 auto;
}
.login-modal-footer{
    margin-top:15px;
    margin-bottom:15px;
}
.login_social_bookmarks{
    padding:20px 0px 0px 60px;
    font-family:calibri;
}
.login_social_bookmarks ul{
    margin:0px;padding:0px;
    list-style:none;
}
.login_social_bookmarks ul li{
    float:left;
}
.login_social_bookmarks ul li a{
    display:block;
    padding:10px;
    margin-left:-12px;
    margin-right:12px;
}
.login_social_bookmarks ul li a:hover{}
.fb_icon {
  margin-left: 15px;
  margin-top: -22px;
}
.g_icon{
  margin-left: 15px;
  margin-top: -20px;
}
#home{
  border: 1px solid lightgray;
  border-top: 0px;
}
#profile{
  border: 1px solid lightgray;
  border-top: 0px;
}
#forget_password{
  border: 1px solid lightgray;
  border-top: 0px;
}

/*----------------- MOdal Finish ---------------------- */

Please help me...

Thanks


texts: Magento 1: layout action tag best practice

texts:
While studying for the Frontend Certification, I noticed a new thing I never came accross.

Basically when I want to use the <action> tag, let's say to change the template of a block, I'm used to do the following:

<reference name="block.name">
    <action method="setTemplate">
        <template>my/template.phtml</template>
    </action>
</reference>

But today, I noticed you could also do it like this:

<action block="block.name" method="setTemplate">
    <template>my/template.phtml</template>
</action>

It works fine but I've never came accross such code in the core.

Is that valid code or is that "hacky" ?
Which syntax would be recommended as best practice ?


texts: Getting error "THERE HAS BEEN AN ERROR PROCESSING YOUR REQUEST" in Magento 1.8.1.0

texts:
In Magento ver. 1.8.1.0 I am getting error "THERE HAS BEEN AN ERROR
  PROCESSING YOUR REQUEST"

Please can any one help on this.

I tried to ask godaddy to update my.cnf file as guided in

Geting Fatal error: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

but they are not able to help.

I am getting this error on home page and category pages, Its strange some category page and cms pages are working fine.

Thanks


texts:
I have a cms block that is added to a page via layout xml.

<block type="cms/block" name="my_cms_block" as="my_cms_block">
    <action method="setBlockId">
        <block_id>my_cms_block</block_id>
    </action>
</block>

It is then used on a page with the following snippet.

<?php echo $this->getChildHtml('my_cms_block'); ?>

Now what I would like to do is be able to pass variables into this block from the page that can be used in the cms block itself via {{var something}}

For example we have a cms block that we want to use across a selection of product pages but in this block we want to be able to use a product attribute say name or anything really.


texts:
I am facing problem while translating text, I have two stores views, English and French.
On French store view the text is translated with special characters.
ex:

Qty = QtÃ©
Recently added item(s) = Derniers articles ajoutÃ©s.

It need to display "Qté" and "Derniers articles ajoutés" respectively.
I have added all the translation words in:

app\design\frontend\THEME\default\locale\fr_FR\translate.csv

But no success.
I don't want to translate this with inline translation functionality.

Why is this happening any idea?


texts: magento2 checkout shipping methods render

texts:
Please, help me.
Magento 2 checkout page rerender shipping methods when i change country in "Shipping address". I've added one more select field with shippment type ( courier, pickup or both of it) and now i need to load shipping methods, that have selected type.

I'l gived to shippment method new attribute via xml:

        <field id="shippingtypes" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Shipping types</label>
            <source_model>MyVendor\MyModule\Model\Config\Source\AllShippingTypes</source_model>
        </field>

So question is how to load only shipping methods, that have same shipping type attribute, that selected by user and rerender it, when it change like with countries?


texts:
I have created two tax rates in magento 1.9.2.

applied both in single rule.

only one tax rate showing in cart and checkout page.

is it possible to apply two tax rates on single product in magento 1.9.2?


texts: Production mode doesnt load any content for custom module

texts:
I have created a custom module in Magento 2. In developer mode it is working well, however same module does not show any content in the production mode of Magento its show only white screen. There is no error in logs, apache, system, debug logs are empty. Any suggestions?

I tried everything
Cache
Reindexing
Permission


texts: create new customer attribute in magento admin panel

texts:
I'm creating new customer attribute in magento admin panel but it's returning an error Text length does not satisfy specified text range.

the attribute code is mag_customer_testing_id, the attribute code length is accepting less than 21.

how can i solve this?

Thanks.


texts: Magento2.3.0 Categories - I wish the products which are in child category will be visible in each parent category by default

texts:
I am using in Magento2.3.0 when i create product in admin side i need to Categories - I wish the products which are in child category will be visible in each parent category by default.

adding the products automatically to the parent category and to the subcategories which are on higher level

so if anyone idea reply me how to achieve this requirement

below sample image added which i define i needed


texts: PHP 7: How to create a separate log file in PHP to log only the order data(Order info retrieved from an Magento Order object)?

texts:
I have an application developed to manage the orders, vendors and many more things.  The default error_log() functionality has already been in use across the application coded in PHP to log not only the errors but order object data to a file called error_log.txt.
I'm looking for a way to log order-specific data to a separate log file so that this data resides in this file as long as I want it to. Could you please guide me in the right direction to achieve this?


texts: How to call and place customer dropdown attribute in Customer Registration Page and One Step Checkout?

texts:
I have made a custom customer dropdown attribute like shown in the screenshot (through Silk Software). See Screenshot:

I was wondering how to make show the dropdown in the customer registration form template, so that new customers can choose any option and save it to their account information.

Is there also a way to show the dropdown in the checkout template for not registered users?

In the case of registered users, is there also a way to show the dropdown in the checkout template, so that the selected value shows or the options show for those who have not chosen? Would it be automatically saved in the database?


texts: How to get Customer EMail id when checkout is done in without login?

texts:
when user purchases product without logging in, how to get email or customer information in such case?

$ShippingData =Mage::getSingleton('checkout/session')->getQuote()
                    ->getShippingAddress()
                    ->getData();
var_dump($ShippingData);
$BillingData = Mage::getSingleton('checkout/session')->getQuote()
                    ->getBillingAddress()
                    ->getData();
var_dump($BillingData);

getting shipping and billing data dont have email id.
Please help.


texts: In Magento 2 How to remove the "Position" option from the Sort by Toolbar

texts: I've been trying to remove the Sort by "Position"  option. Can we do it without extending template?


texts:
When sending transaction test mails like "New Pickup Order" we get the following error in the mail: Error filtering template: The product that was requested doesn't exist. Verify the product and try again.

This happened after we deletes some products.

How can it be, that this affects sending test mails?

Any any idea how to fix this?

Thanks
Aldo


texts: Save addition information in payment method on Order Page

texts:
I have created custom payment module in Magento for emi options.

But the issue is that when person place order, then in the invoice I can only see the payment method they used for place order, But cannot see emi option they have selected.

For example: this time it is showing me

Payment method:
xyz payment

But I also want add addition selected option like that:

Payment method
xyz payment
3 month emi

So, Please guide how can I use this in my payment module


texts: Limit text field size in product custom attribute to 80 characters

texts:
I have just created a custom attribute (standard text field) on a simple product. I'd like to limit this field to 80 characters as it's to be used as an eBay title to integrate with eBay.

I only want to limit this field though, not all text fields.

Can someone advise how I can do this?

Thanks


texts:
I am installing my team's installation of Magento on my developer machine, and I am getting this error message when I try to go to the frontend root or the /admin of the website:

Fatal error: Uncaught Error: Call to a member function getModelInstance() on null in /Applications/XAMPP/xamppfiles/htdocs/wt/app/Mage.php:463

Stack trace:

#0 /Applications/XAMPP/xamppfiles/htdocs/wt/app/code/core/Mage/Core/Model/App.php(919): Mage::getModel('core/store')
#1 /Applications/XAMPP/xamppfiles/htdocs/wt/app/code/core/Mage/Core/Model/App.php(834): Mage_Core_Model_App->_getDefaultStore()
#2 /Applications/XAMPP/xamppfiles/htdocs/wt/app/Mage.php(920): Mage_Core_Model_App->getStore()
#3 /Applications/XAMPP/xamppfiles/htdocs/wt/app/Mage.php(702): Mage::printException(Object(Mage_Core_Exception))
#4 /Applications/XAMPP/xamppfiles/htdocs/wt/index.php(83): Mage::run('', 'store') #5 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/wt/app/Mage.php on line 463

How can I resolve this?


texts:
How do I set .htaccess so people can't see cron.sh and mage?

I kind of feel like nobody should be able to get to anything except index.php from the outside. Yet Magento's default .htaccess file has this stuff:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

So the question is how do you block people from being able to get to cron.sh and mage and stuff like that? It's really not cool that people can just go right to these.

I would think something like this would be appropriate:

<Files cron.sh>
    order allow,deny
    allow from 127.0.0.1
    deny from all
</Files>

So that way crontab can still access cron.sh but it can't be called from the outside. Am I on the right rack here? How are people dealing with this?


texts: Create/Update Attribute Option Custom api issue

texts:
I have created custom rest api to create/update attribute options by attribute_id.

Here is my webapi.xml file code.

 <route url="/V1/attribute/AttributeOption" method="POST">
    <service class="Vendor\Module\Api\AttributeInterface" method="AttributeOption"/>
</route>

Api/AttributeInterface.php

<?php
namespace Vendor\Module\Api;

interface AttributeInterface
{
 /**
 * POST for attribute api
 * @param mixed $param
 * @return array
 */

  public function AttributeOption($params);
}

Model/Attribute.php

  <?php
   namespace Vendor\Module\Model;
   use Vendor\Module\Api\AttributeInterface;
   use Magento\Eav\Setup\EavSetupFactory;
   use Magento\Store\Model\StoreManagerInterface;
   class Attribute implements AttributeInterface
  {
   protected $_eavSetupFactory;
   protected $_storeManager;
   protected $_attributeFactory;
   protected $eavAttributeFactory;
   protected $attributeOptionManagement;
   protected $productFactory;
   private $productAttributeRepository;
   protected $objectManager;
   public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectManager,
    \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attributeFactory,
    \Magento\Eav\Model\Entity\AttributeFactory $eavAttributeFactory,
    \Magento\Eav\Api\AttributeOptionManagementInterface $attributeOptionManagement,
    \Magento\Catalog\Model\ProductFactory $productFactory,
    \Magento\Catalog\Model\Product\Attribute\Repository $productAttributeRepository
) {
    $this->_objectManager = $objectManager;
    $this->_eavSetupFactory = $eavSetupFactory;
    $this->_storeManager = $storeManager;
    $this->_attributeFactory = $attributeFactory;
    $this->eavAttributeFactory = $eavAttributeFactory;
    $this->attributeOptionManagement = $attributeOptionManagement;
    $this->productFactory = $productFactory;
    $this->productAttributeRepository = $productAttributeRepository;
  }

  public function AttributeOption($params) {
      // looking for logic to create / update options from request
  }

}

Here is my json Request:

 {
"params":{
    "Type": "create",
    "attribute_id" : "159",
        "OptionValues": [
         {
            "OptionId": "01",
            "OptionName": "Test"
         },
         {
            "OptionId": "Null",
            "OptionName" : "Test2"
         }
     ]
   }
}

I need to create the option for particular attribute by reading the above json,

if OptionId = null i need to create the new option otherwise

I need to update the label for option_id.

Can anyone help me with this please.


texts: How to send JSON POST data for admin module?

texts:
I am trying to send a POST request to a controller with JSON payload. Relevant request details are as follows.

Request URL:http://mag.local/index.php/shahal/test/saveJson
Request Method:POST
Content-Type:application/json

Payload

{"name":"shahal","form_key":"3j7DhIGtPqIRkpyD"}

Rather than going to appropriate controller, it redirect the request to the dashboard. I assume its because Magento doesn't decode JSON string and read the form_key from the request body. Is there any other workaround for this issue? Or is there a straightforward method for JSON requests in magento?

IMPORTANT

I cannot change the structure of the incoming requests.


texts: what is the best way to create a new instance for class?

texts:
What is the difference or best way for creation instance of new class?

Object manager?

or

Define in to constructor?


texts: How to save additional column field in core table in magento 2

texts:
I have created custom module for product review. I have added additional coloumn in review_detail table in DB. I got all submitted values from form including my custom column value in Controller. But Now How Do I Save the additional column value in DB which means how do I pass the value to DB to that associated created column

 public function execute()
    {
        $message = null;
        $status = null;
        if (!$this->formKeyValidator->validate($this->getRequest())) {
            $message = __("Invalid form key");
            $status = 'failed';
        } else {
            //get the form data
            $data = $this->reviewSession->getFormData(true);
            if ($data) {
                $rating = [];
                if (isset($data['ratings']) && is_array($data['ratings'])) {
                    $rating = $data['ratings'];
                }
            } else {
                $data = $this->getRequest()->getPostValue();

                $detail = $this->getRequest()->getPostValue('detail');
                $data['detail'] = trim($detail);
                $rating = $this->getRequest()->getParam('ratings', []);
            }
            if (($product = $this->initProduct()) && !empty($data)) {
                /** @var \Magento\Review\Model\Review $review */

                $review = $this->reviewFactory->create()->setData($data);
                $review->unsetData('review_id');
                $validate = $review->validate();
                if ($validate === true) {
                    try {
                        $review->setEntityId($review->getEntityIdByCode(Review::ENTITY_PRODUCT_CODE))
                                ->setEntityPkValue($product->getId())
                                ->setStatusId(Review::STATUS_PENDING)
                                ->setCustomerId($this->customerSession->getCustomerId())
                                ->setStoreId($this->storeManager->getStore()->getId())
                                ->setStores([$this->storeManager->getStore()->getId()])
                                ->save();
                        foreach ($rating as $ratingId => $optionId) {
                            $this->ratingFactory->create()
                                    ->setRatingId($ratingId)
                                    ->setReviewId($review->getId())
                                    ->setCustomerId($this->customerSession->getCustomerId())
                                    ->addOptionVote($optionId, $product->getId());
                        }
                        $review->aggregate();
                        $status = 'success';
                    } catch (\Exception $e) {
                        $this->reviewSession->setFormData($data);
                        $message = __('We can\'t post your review right now.');
                        $status = 'failed';
                    }
                } else {
                    $this->reviewSession->setFormData($data);
                    if (is_array($validate)) {
                        foreach ($validate as $errorMessage) {
                            $message = $errorMessage;
                        }
                    } else {
                        $message = __('We can\'t post your review right now.');
                    }
                    $status = 'failed';
                }
            }
        }
        $result['messages'] = $message;
        $result['status'] = $status;
        $resultJson = $this->_resultJsonFactory->create();
        $resultJson->setData($result);
        return $resultJson;
    }


texts: How to exclude specific Products, Categories and CMS Pages from sitemap.xml generation in Magento 2?

texts: I need to create a custom module that allows excluding/skipping the Products, Categories and CMS Pages URLs from generating in sitemap.xml. I had tried this solution for Magento 1, How could I do it in Magento 2?


texts: Setting 'h1' title on the Contact form in Magento 2

texts:
I am trying to set a page title which is different to the <h1> heading for my contact page, but there is a bug which does not let you use XML on the contact form, so I have included it in the <head> tags.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <title>Contact Us - Test</title>
    <link rel="canonical" src="http://www.extenderstore.com.au/contact/" src_type="url"/>
</head>
<body>
    <referenceContainer name="content">
        <block class="Magento\Cms\Block\Block" name="contact-store-info" after="contactForm">
            <arguments>
                <argument name="block_id" xsi:type="string">contact_us</argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceBlock name="catalog.compare.sidebar" remove="true"/>
    <referenceBlock name="wishlist_sidebar" remove="true" />
</body>

How can I have a page title of "Contact Us - Test" and an <h1> heading of "Contact Us"?


texts: Merge results of magento and custom Database with while loop

texts:
We have 2 while loops , we are displaying 2 different results with both.

we need to combine or without combining we need to merge 2 results.

in below image ,

1st while loop result = >  1st, 2nd, 6th rows.

2nd while loop result = >  3rd, 4th, 5th rows.

we need 3rd , 4th & 5th rows results in 1st, 2nd 6th rows last column [ Paid status ].

1st while results coming from Database 1 [ magento - sales_flat_order] & 2nd while results are coming from Database 2 with table name order_details

$stmt = $user_home->runQuery("SELECT * FROM order_details");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->execute();

$i = 0;

foreach($order as $orderData)
{
$k = 0;
$orderitems = $orderData['dproduct_id'];
$orderitemsarray = explode(",", $orderitems);

/* 1st while */
while ($k < count($orderitemsarray))
{

if ($orderitemsarray[$k] != '0')
{

$stmtorders = $user_home->runQuery("SELECT * FROM order_details");
$stmtorders->execute(array(":dorder_id" => $orderData['entity_id']));
$roworders = $stmtorders->fetch(PDO::FETCH_ASSOC);
$dorderStatus = $roworders['dpaid_status'];

$productdetail = Mage::getModel('catalog/product')->load($orderitemsarray[$k]);
$designer_id = $productdetail->getDesignerID() ;

if($accountType == "admin")
{
$designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";

$responce[] = array(
$orderData->getIncrementId() ,
$orderitemsarray[$k],
$productdetail->getName() ,
$designerName,
$orderData['status'],
$data['dpaid_status'],
$data['commission'],
$sDate
);

}
}

$k++;
$i++;
}

/* 2nd while */

while($data = $stmt->fetch())
{

$responce[] = array(
$data['dorder_id'],
$data['dpaid_status'],
$data['commission']
);
$k++;
}
}

I tried below code , but it results as below image - means only 2 rows displayed instead of 23 rows....

while (($k < count($orderitemsarray)) &&  ($data = $stmt->fetch()))

Full page looks as below :


texts: Magento 2: Admin grid table - add new row on the fly?

texts: I created a custom UI grid table in admin. And I have a form on the same page to add new item to my custom database table(with ajax). After I added new item I need it to immediately appear in this grid table. So I decided instead of reloading whole table - is there a way to just push new row (with form data) to my grid with JS? Does Magento2 has any JS API function for that?


texts: Choosing the best URL key for categories

texts:
I have a multi-language store and try to choose the best URL key for categories. Also note that it can be set only for all store views, for a multi-language store it is a problematic point because the URL key for categories is a global value.

Also I try to add the main key word in the URL path because the store sells just one type of products - paintings. I can use this key word in the URL key in all store languages, but maybe it is not such a good deal - for example painting-painture. Or should I add the key word in the end of the URL key for each product? Another solution is to keep it language independent and don't use at all the main key word in the path but just the artist name instead. What do you think about?

Edit:
Take a look to this question for an alternative method.


texts: Magento 2 : Custom API code to upload multiple product images programmatically

texts:
I am making custom Magento API to create products. I can make products using custom API.
Now my requirements is to upload multiple images to that API.
Can anyone helps me for reference code to upload multiple product images programmatically ??
Following example works for me for creating simple procuts.
$simpleProduct->setTypeId('simple')
->setAttributeSetId($attributeSetId)
->setWebsiteIds([1])
->setName($params['product_name'].' '.$size_label)
->setSku('SKU_'.time().$size_label)
->setUrlKey(str_replace(" ","_",$params['product_name'])."_".time())
->setPrice($params['price'])
->setSize($size_value) // Set the 'color' attribute option value
->setVisibility(1)
->setStatus(1)
->setCategoryIds($CategoryIds)
->setStockData(['use_config_manage_stock' => 1, 'qty' => $size_qty, 'is_qty_decimal' => 0, 'is_in_stock' => $in_stock])
->setData('brand',$params['brand'])
->setData('color',$params['color'])
->setData('material',$params['material'])
->setData('type',$params['type'])
->setData('condition',$params['condition']);
$simpleProduct = $productRepository->save($simpleProduct);
$associatedProductIds[] = $simpleProduct->getId();
$simple_product_id = $simpleProduct->getId();

If anyone please guide me for this requirements.


texts: Configurable Products Not Showing in Search or Catalog

texts:
I am using Magento 1.9.0.1. I have set up a Configurable Product and created several associated products using the quick simple product creation.  The simple products are all "enabled" and "not visible individually"  .  I have inventory showing "in stock" with a quantity for all simple products.

Yet the configurable product is not visible in my catalog or in search.

Ideas what I am missing???
Checked the manual, etc.  and everything seems to be setup correctly.

edit

Within the configurable product, inside the associated products tab, Should the simple products be listed at the bottom?

For some reason, I am not showing any item skus and the search always comes up "blank" even though I search for a SKU that is available.

Steve


texts: How to ensure that our website is not vulnerable to the issue SUPEE-6482 after installing the patches?

texts:
I've installed the patch SUPEE-6482, but still appear a window like this:

Whether it means the patch is not installed correctly? How to ensure that our website/Magento is secure from the patch issue?
I mean sample case on release notes of SUPEE-6482 (two issues related to APIs and two cross-site scripting risks), whether sufficient in tests on web like https://shoplift.byte.nl/ or need special check?


texts: Magento2: How to disabled coupon code programmatically from the cart and checkout page?

texts:
I want to disabled coupon code programmatically from the cart and checkout page if the condition is true.

Please help me.


texts: magento 2: get configurable product custom attributes at checkout/confirmation page

texts:
I have configurable product with custom attributes (not front end visible)
I get the $item from when looping over $items.
I'm getting $items like so:

$itemsVisible = $cart->getQuote()->getAllVisibleItems();
$items = $cart->getQuote()->getAllItems();

$y = $item->getProduct()->getResource()->getAttribute('my_attribute_id')->getFrontend()->getValue($item->getProduct());

The trouble is I can't see the attribute's value, i see all the meta data about the attribute, but not the value relvant to the item. I need to access that attribute on the checkout and confirmation steps of the order placement.

When accessing the same element on the PDP page I get it with no problems:

$x = (int) $product->getResource()->getAttribute('my_attribute_id')->getFrontend()->getValue($product);

I stepped through both cases with xdebug, but just can't figure it out.


texts: Magento 2 - How to change phone form type

texts:
In Magento 2, I want to change input telephone type to number only in all forms.

I succeed this change in checkout page by following this post :

https://community.magento.com/t5/Magento-2-x-Programming/Change-telephone-input-field-to-number/td-p/93660

But I don't know how to make the same on customer account create and edit forms.

Do you have any ideas ?

Thanks


texts: Populate Data for custom Column Customer Group Under Report Sales Order

texts:
I'll have to add new Column (Customer Group Name) Under the Report -> Sales -> Orders
Current Progress
I have added New Column under the
app/code/Vendor/Module/Block/Adminhtml/Sales/Sales/Grid.php
    $this->addColumn(
        'group',
        [
            'header' => __('Groups'),
            'index' => 'group',
            'sortable' => false,
            'type' => 'string',
            'totals_label' => __('Group'),
            'header_css_class' => 'col-group',
            'column_css_class' => 'col-group'
        ]
    );

But how can I populate data for this new column ?


texts: Why magento2 use UI components in Recent release of magento2,1[product edit page]?

texts:
In recent version of magento (Magento2.1), they have totally changed structure of product edit page (Backend). I mean they had replaced with UI components.(While in previous version of magento2.X they are not using UI components.)

Is there any reason for that ? If yes, then why they didn't addded in previous version of magento2.x ?