texts: Unable to call function in ajax success in magento2

texts:
I have found below error:
> Uncaught TypeError: Cannot read property 'set' of undefined.

Code:

    <script>
require(['jquery','Magento_Customer/js/customer-data','domReady!'], function ($, customerData) {

    $(function () {

        var settings =
            {
                url: "<?php echo $block->getUrl('customdesignsubcategories/index/save'); ?>",
                method: "POST",
                allowedTypes: "pdf, ppt, pptx,doc, docx, jpg, jpeg, png, gif, xlsx, xlsm, xlsb, xls, xltx, xltm, xlt, csv, xlam, xla, ods, zip, txt",
                maxFileSize: 26214400,
                fileName: "myfile",
                uploadStr: jQuery(".box").html(),
                multiple: true,
                nestedForms:false,
                dragDropStr:"",
                onSuccess: function (files, data, xhr)
                {
                    var file_data = jQuery.parseJSON(data);
                    $('<input>').attr({
                        type: 'hidden',
                        name: file_data.original + "[]",
                        value: file_data.modified
                    }).appendTo('form');
                },
                onError: function (files, status, errMsg)
                {
                    $("#status").html(errMsg);
                }
            };
            $("#mulitplefileuploader").uploadFile(settings);
            var dataForm = $('#customdesignsubcategories_form');
            var ignore = null;

            dataForm.mage('validation',
            {
                ignore: ignore ? ':hidden:not(' + ignore + ')' : ':hidden'
            }).find('input:text').attr('autocomplete', 'off');

            $('#finalSubmit').click( function()
            {
                $('.ajax-file-upload > form > input').unwrap();

                if(dataForm.validation('isValid') === false)
                {
                    $("#mulitplefileuploader").uploadFile(settings);
                    return false;
                }
                if(dataForm.validation('isValid')==true)
                {
                    console.log(customerData);
                    $.ajax({
                        type:'POST',
                        url: '<?php echo $this->getUrl("customdesignsubcategories/index/sendEmail");?>',
                        data: dataForm.serialize(),
                        dataType:'json',
                        showLoader: true ,//use for display loader
                        success: function(data){

                            if(data.status == "CaptchaError")
                            {
                                $('#customdesignsubcategories_form .invalid-captcha').show();
                                $('#customdesignsubcategories_form').find('input[name*="captcha"]').focus();
                                return false;
                            }else if(data.status=="Success")
                            {
                                var msg = 'some message here';

                                customerData.set('messages', {
                                    messages: [{
                                        type: 'success',
                                        text: msg
                                    }]
                                });
                            }
                        }
                    });
                }
            });
       });
   });
</script>


texts:
I want to add my custom phtml to homepage.

I dont know how to add my phtml using my module

How can i add my phtml to homepage


texts: I have a website at http://www.avantalarm.com/ and I've created a development site at http://www.avantalarm.com/dev/ and everything seems to be working fine, however when I go to http://www.avantalarm.com/dev/admin to reach the development admin page, it redirects me to the main admin page for my main site.  I don't know a ton about .htaccess and I'm not sure if that's the problem, but I'd love to be able to reach my dev site's admin page.  Any help would be appreciated.  If I can offer up any code let me know.


texts: Magento2 -How to get data from system configuration

texts: Fields added through the system.xml and default values populated with config.xml, how do we fetch the data in Magento2


texts: Margento Product sync with external database

texts:
I need to sync magento products with external database and also vice versa. Is there any tool available for this?

If not how it can be done with API?


texts: Magento 2 admin menu action result Invalid security or form key. Please refresh the page. on click

texts:
I have succesfully added a new admin menu. But the problem is whenever i clicked the admin menu button, I got Invalid security or form key. Please refresh the page.

Here're some of my codes.

This is my menu.xml

     <add id="Testing_Basic::menu_item" title="Manage Items" module="Testing_Basic" sortOrder="10" parent="Testing_Basic::menu" action="Webpage/Create/Index" resource="Testing_Basic::menu_item"/>

And this is my directories looks like.

This is my

  Controller/Adminhtml/Webpage/Index.php

<?php
/**
* Webkul Grid Controller
*
* @category    Webkul
* @package     Webkul_Grid
* @author      Webkul Software Private Limited
*
*/
namespace Testing\Basic\Controller\Adminhtml\Webpage;

class Index extends \Magento\Backend\App\Action
{
/**
 * @var \Magento\Framework\View\Result\PageFactory
 */
protected $_resultPageFactory;

/**
 * @param \Magento\Backend\App\Action\Context        $context
 * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
 */
public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory
)
{
    parent::__construct($context);
    $this->_resultPageFactory = $resultPageFactory;
}

/**
 * Grid List page.
 *
 * @return \Magento\Backend\Model\View\Result\Page
 */
public function execute()
{
    /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
    $resultPage = $this->_resultPageFactory->create();
    $resultPage->setActiveMenu('Testing_Basic::grid_list');
    $resultPage->getConfig()->getTitle()->prepend(__('Grid List'));

    return $resultPage;
}

/**
 * Check Grid List Permission.
 *
 * @return bool
 */
    protected function _isAllowed()
    {
        return $this->_authorization->isAllowed('Testing_Basic::grid_list');
    }
  }

And this is my routes.xml

    <?xml version="1.0"?>
    <!--
    /**
    * Webkul_Grid route xml
    *
    * @category    Webkul
    * @package     Webkul_Grid
    * @author      Webkul Software Private Limited
    *
    */
    -->
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
     <router id="admin">
       <route id="create" frontName="create">
       <module name="Testing_Basic" />
       </route>
       </router>
    </config>


texts: can i use one product collection for multiple attribute filtering?

texts:
I have a product collection based on category.
Can I use addFieldToFilter (color) for both equal and not equal.
Color with given value as one set of collection and color which is not equal to given value as another set of collection.(both values are same)
Please guide me.
Thanks.


texts:
I want to add google map in Magento 2 checkout page.

Added API url and key to phtml using below code

<referenceContainer name="after.body.start">
            <block class="Test\Vendor\Block\Map"
                   name="google.map"
                   as="googleapi"
                   template="Test_CVendor::map.phtml" />
        </referenceContainer>

And added my script to map.phtml.

<script async defer
        src="https://maps.googleapis.com/maps/api/js?libraries=places<?php echo $this->getApiKey(); ?>">
</script>

I have added custom component in checkout_index_index.xml
from that component I have set template and define div over their like

Now I want to render google map to this div.

Can any one please guide me for which binding I need to use and how to render map over this div.


texts:
In my web site http://www.chocolate-shop.it

I have a problem with active menu top.

If I enter in web site, go out and re-enter some the menu items remain active.


texts: How to Dynamically Add Menus to the Administration

texts:
I want to add a sub menu structure in the backend multiple times for a list of (in this case) manufacturers.

When a new manufacturer is added to the system (could be done in XML, as this does not happen so often), a sub menu with the common structure should be added automatically.

Example Menu Structure

Acme

Attributes
Categories

FooBar

Attributes
Categories

Magento Inc. Hardware

Attributes
Categories

and so on


texts:
I created a module with following admin routes.xml

  /app/code/UV/Bestellung/etc/adminhtml/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="custom" frontName="custom">
            <module name="UV_Bestellung" />
        </route>
    </router>
</config>

This is the controller:

  app/code/UV/Bestellung/Adminhtml/Controller/Index

<?php
namespace UV\Bestellung\Controller\Adminhtml\Index;

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

class Index extends Action
{
    public function execute()
    {
        echo 'Test';
        /*
        $page = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        return $page;
        */
    }
}

When I call

  www.mysite.com/admin/custom

it redirects me to the Dashboard.
Can someone tell me what is wrong or what the correct URL is?

Thanks! :-)


texts: Get current date time used in magento for saving data

texts:
I want to get current date time which is magento used for save data into database. I searched and get this line of code,

Mage::getModel('core/date')->date('Y-m-d H:i:s');

but this is not working for me. For test i create a product and check its details then i get this date,

[created_at] => 2015-11-18 07:47:35

but after that i echo above line then date is different. I get this date after echo Mage get date line

2015-11-17 21:52:05. I want function which provides datetime which is save in database.


texts: How can i get exact google map latitude and longitude in php?

texts:
How can i get exact Latitude and longitude of user in php, without using IP,
Any hope with google api?


texts: How to use filters on custom product listing?

texts:
I need to use filters on different type of product listings not just on category page.

Let me give and example i have the product listing of mostly-viewed products . I have created a CMS page and assigned it a template file say mostly-viewd.phtml. Now i want to show filters on it.

So far i did this :

I made a custom module where,

Block/List.php

    <?php
    class Company_Filter_Block_List extends Mage_Catalog_Block_Product_List
    {
        protected function _getProductCollection()
        {
        $collection = parent::_getProductCollection();

                    /* Need to work here */

        return $collection;
        }
    }

Now i am able to use this block and getting the product list of category i am using root category here so i am getting all the products of store now i want to filter them and show only those products , which have atleast 30 views.

Any idea how should i do this.

Thanks in advance.


texts: M2 - Translate "We received too many requests for password resets. Please wait and try again later or contact"

texts:
Where can I find the location to know the exact translation string? I need to translate this sentence "We received too many requests for password resets. Please wait and try again later or contact" to Dutch language.

Regards,


texts: Need add to cart functionality on product list page. (attribute: size, quantity)

texts:
I need add to cart functionality on product listing page.

On the product list page I have size and quantity box and add to cart is directly placed on the shopping cart page.

Currently it redirects on the product view page.

Magento version is 1.9

Kindly help.


texts:
How to add admin Grid in magento 2.0.6

I want to display sold product list in that Admin Grid with order status filter


texts: How to get all categories in configuration (system.xml). magento 2

texts:
I'm getting all the categories in system.xml using

<?php
namespace Vender\Module\Model\Config\Source;

use Magento\Framework\Option\ArrayInterface;

class Category implements ArrayInterface{

    protected $_categoryFactory;
    protected $_categoryCollectionFactory;

    public function __construct(
        \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory,
        \Magento\Catalog\Model\CategoryFactory $categoryFactory
    ) {
        $this->_categoryCollectionFactory = $categoryCollectionFactory;
        $this->_categoryFactory = $categoryFactory;
    }

    /**
    * Get category collection
    *
    * @param bool $isActive
    * @param bool|int $level
    * @param bool|string $sortBy
    * @param bool|int $pageSize
    * @return \Magento\Catalog\Model\ResourceModel\Category\Collection or array
    */

    public function getCategoryCollection($isActive = true, $level = false, $sortBy = false, $pageSize = false)
    {
        $collection = $this->_categoryCollectionFactory->create();
        $collection->addAttributeToSelect('*');

        // select only active categories
        if ($isActive) {
            $collection->addIsActiveFilter();
        }

        // select categories of certain level
        if ($level) {
            $collection->addLevelFilter($level);
        }

        // sort categories by some value
        if ($sortBy) {
            $collection->addOrderField($sortBy);
        }

        // select certain number of categories
        if ($pageSize) {
            $collection->setPageSize($pageSize);
        }

        return $collection;
    }

    public function toOptionArray(){

        $arr = $this->_toArray();
        $ret = [];
        foreach ($arr as $key => $value){
            $ret[] = [
                'value' => $key,
                'label' => $value
            ];
        }
        return $ret;
    }

    private function _toArray(){

        $categories = $this->getCategoryCollection(true, false, false, false);
        $catagoryList = array();
        foreach ($categories as $category){
           $catagoryList[$category->getEntityId()] = __($this->_getParentName($category->getPath()) . $category->getName());
        }
        return $catagoryList;
    }

    private function _getParentName($path = ''){
        $parentName = '';
        $rootCats = array(1,2);
        $catTree = explode("/", $path);
        array_pop($catTree);
        if($catTree && (count($catTree) > count($rootCats))){
            foreach ($catTree as $catId){
                if(!in_array($catId, $rootCats)){
                    $category = $this->_categoryFactory->create()->load($catId);
                    $categoryName = $category->getName();
                    $parentName .= $categoryName . ' -> ';
                }
            }
        }
        return $parentName;
    }
}

but when I submit my extension to magento QA then they give me the error
now how can I solve this? they are saying that I'm duplicating the class the which core class I can use to get all categories like that


texts: Limit in the number of sharing wishlist in magento 2

texts:
I just found that the 'share wishlist' button on my wishlist page is gone after sending emails for the number of times set in the wishlist configuration in the backend.

In other words, if the default number is 10, I can share the wishlist only 10 times and I can't use the feature forever.

However, according to their document, the number means the maximum number of emails that can be sent in a single batch not the number of emails sent separately.

https://docs.magento.com/m2/b2b/user_guide/configuration/customers/wishlist.html

So you can't use the 'Share wishlist' feature anymore after you send the list to 10 people or send it to one by one up to 10. Although you add a new product after removing the old one, you still can't use the feature.

I understand I can increase the number up to 10000 but it's ridiculous that they limit the number of lifetime sharing lists.

My magento version is 2.2.6.

Can you please share your wisdom to resolve this issue if there is any?

Thank you for your help in advance.


texts: How to trim text before saving in system.xml

texts:
In my custom module in system.xml in Admin I have field:

 <field id="user_key" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
       <label>User ID Key</label>
       <comment>Set User Key</comment>
 </field>

I save that field to database.

I need to trim it before it is saved.

Is there any mechanism to trim it before it is saved?

Something like:

<field id="user_key" trim="1" (...)


texts: Magento Export order comment to a text file

texts:
What will be the best practice to export Magento order comment to text file? Eg. What event I shall grab to get the data.

I'd like to grab the comment as someone add a comment. (then save it to a text file.  Saving to text file is not a problem.  )

Please help me if you can.


texts: Call to a member function setActive() on boolean in vendor/magento/module-backend/Model/View/Result/Page.php:27

texts:
I am using a module which gives me this error when I try to open its settings in the admin.

This is part of the stack trace:

  app/code/Rokanthemes/SlideBanner/Controller/Adminhtml/Slider/Index.php(70):
  Magento\Backend\Model\View\Result\Page->setActiveMenu('Rokanthemes_Sli...')

Code of controller: https://pastebin.com/wVrQ6QcE

I can see that it tries to set the menu for Rokanthemes_Slidebanner which is of course the extension I am talking about. The question is, why it cant set the menu for that single extension while the rest works just fine. I have no idea where to look anymore.

Thanks for helping!


texts: How to add a custom block on sales order's create page inside admin panel?

texts:
I want to add a custom block on sales order's create page under admin section.

Here is my code:

<adminhtml_sales_order_create_index>

    <reference name="sidebar">
        <block type="adminhtml/template" name="verification" template="magentomod/ageverification/sales/order/create/comment.phtml"/>
    </reference>

</adminhtml_sales_order_create_index>
<adminhtml_sales_order_create_load_block_data>

    <reference name="sidebar">
        <block type="adminhtml/template" name="verification" template="magentomod/ageverification/sales/order/create/comment.phtml"/>
    </reference>

</adminhtml_sales_order_create_load_block_data>

It's working fine but if I change the reference from sidebar to content or data block, it stops working. I want to add this block within content block.

How can I do this?


texts: Magento2 - product is not showing after data migration

texts:
I have migrated Magento 1.9 data to Magento 2 using data migration tool. Data migrate successfully completed.

When I log in to admin dashboard that time all product showing correctly.

When I searched product that time product is not displaying in the list page. But I am directly put URL key in front of the domain name that time product is display.

I have tried following things,

 A product is set to enabled under a status
 A product is set to catalog (and search) under visibility
 A product has qty (in stock) and set to in stock
 A product is attached to a category
 Then run an "Empty cache" and a re-index.


texts: how to migrate data from Magento 1.9.2.4 to Magento 2.0.7

texts:
I am using Magento 2.0.7 and installed Data Migration Tool. I have found that there are no option to migrate data from magento 1.9.2.4 also I have tried to use ubertheme migration tool but getting below error:

  CDbCommand failed to execute the SQL statement: SQLSTATE[23000]:
  Integrity constraint violation: 1062 Duplicate entry '1' for key
  'PRIMARY'. The SQL statement executed was: INSERT INTO `store` (`website_id`, `group_id`, `sort_order`, `is_active`, `store_id`, `code`, `name`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6)

Can anyone help me to fix this issue or suggest any better solution to migrate the data? Any help will be appreciated.


texts: Magento 2 - Validate product for sales rule condition

texts:
I have the sales rules collection in a helper file got the rules collection from this bit of code. Now I want to validate if the product id needs to validate against sales rule.

Constructor contains this

\Magento\SalesRule\Model\RuleFactory $ruleFactory,
$this->ruleFactory = $ruleFactory;

and the public function contains this

$_rules = $this->ruleFactory->create()->getCollection();
foreach($_rules as $rule){
            $fromDate = $rule->getFromDate();
            $toDate = $rule->getToDate();
            if (isset($fromDate) && $_currentTime >= strtotime($fromDate)) {
                if (isset($toDate)) {
                    if (strtotime($toDate) >= $_currentTime) {
                        print_r($products_id);
                        print_r($rule->getData());
                    }
                }
            }
        }

Can any one help on this.


texts: PayPal Express Checkout with PayPal API certificate

texts:
I have to integrate PayPal Express Checkout. By API signature it is working but with API Certificate it is not working and always showing error "Unable to communicate with PayPal Gateway".

Please give some solution for this.


texts: How to redirect to controller using jquery ajax in magento 2.3.5

texts:
I want to pass dynamic text-box value to controller using ajax, so if anyone have idea about it then please share with me.
Thanks In Advance


texts: Magento 2 login to other website on same code

texts:
I have a store that has two websites running off the same code but different urls. User accounts are set to be shared between sites but should be redirected to the correct site (based on usergroup) on login.

So far I have a plugin setup on after login execute action

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <type name="Magento\Customer\Controller\Account\LoginPost">
    <plugin name="vendor_wholesale_loginpostplugin" type="Vendor\Wholesale\Plugin\LoginPostPlugin" sortOrder="1" />
  </type>
</config>

  LoginPostPlugin.php

<?php

namespace Vendor\Wholesale\Plugin;

/**
 *
 */
class LoginPostPlugin
{

  protected $_customerSession;
  protected $_scopeConfig;
  protected $_messageManager;
  protected $_storeManager;

  public function __construct(
    \Magento\Customer\Model\Session $customerSession,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Framework\Message\ManagerInterface $messageManager,
    \Magento\Store\Model\StoreManagerInterface $storeManager
  )
  {
    $this->_customerSession = $customerSession;
    $this->_scopeConfig = $scopeConfig;
    $this->_messageManager = $messageManager;
    $this->_storeManager = $storeManager;
  }

  /**
   * Change redirect after login
   *
   * @param \Magento\Customer\Controller\Account $subject
   * @param \Magento\Framework\Controller\Result\Redirect $result
   */
  public function afterExecute(
    \Magento\Customer\Controller\Account\LoginPost $subject,
    $result)
  {

    $cur_customer = $this->_customerSession->getCustomer();

    $current_customer_group = $cur_customer->getGroupId();

    $group_ids = $this->_scopeConfig->getValue('wholesale/permissions/allowed_groups', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

    $allowed_group_ids = explode(",", $group_ids);

    $store_id = $this->_storeManager->getStore()->getId();

    // If they are one of the allowed wholesale groups
    if(in_array($current_customer_group, $allowed_group_ids)){

      // If they are not on the wholesale store, redirect to the wholesale store
      if($store_id != 2){

        $wholesale_url = "***";

        $this->_customerSession->logout();
        $this->_messageManager->addError(__("You should login to the wholesale website, you have been redirected to it"));
        $result->setUrl($wholesale_url . '/customer/account/');
        // Login to wholesale store here

      }

    // If they are a regular customer
    } else {

      // If they are trying to login to the wholesale store
      if($store_id == 2){

        $main_store_url = "***";

        $this->_customerSession->logout();
        $this->_messageManager->addError(__("You do not have permission to log into the wholesale website, you will be redirected to the main website"));
        $result->setUrl($main_store_url . '/customer/account/');
        // Login to main store here

      }

    }

    return $result;
  }

}

This works.But, I want to be able login to the correct website after redirecting them.

I would have thought that the two would use different browser sessions entirely & it would not be possible.

However, I found when adding messages the messages carried across between sites.

Both sites are running on the same url with the wholesale website running in a folder.


texts: how to whether item refunded or not through invoice level in magento 2

texts: I want to know whether a specific item is refunded or not from invoice level.


texts:
Is this a valid rewrite? I can't seem to find the answer to: How to rewrite to models from the same Module?

Do I need to separate the classes or can I put both under rewrites? This is not working so far.

These are the two models I want to rewrite.

Module_Reminder_Model_Reminder
Module_Reminder_Model_Observer

    <config>
        <modules>
            <Module_Reminder>
                <version>1.0</version>
            </Module_Reminder>
        </modules>
        <global>
            <models>
                <adjreminder>
                    <rewrite>
                        <reminder>Module_Reminder_Model_Reminder</reminder>
                        <observer>Module_Reminder_Model_Observer</observer>
                    </rewrite>
                </adjreminder>
            </models>
        </global>
    </config>


texts: Redirect to /downloadable/customer/products after successful checkout automatically | Magento 2.4.1 CE

texts: Cause we only sell downloadable products in our Magento 2.4.1 CE with Autoinvoice we would like to redirect our costumers automatically to the /downloadable/customer/products/ instead of the /checkout/onepage/success/ page. Is there any solution? Thank you!


texts: How to move things around in UI Components in magento2?

texts:
I want to move fields on customer/index/edit. Creating another fieldset can be done with

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="my-new-fields">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Additional Information</item>
        </item>
    </argument>
    <field name="blablupp">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" translate="true" xsi:type="string">buueeyyy</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">customer</item>
            </item>
        </argument>
    </field>
</fieldset>

And even hiding a field from an existing fieldset is easy by adding to the customer fieldset:

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="customer">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Additional Information</item>
        </item>
    </argument>
    <field name="prefix">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="visible" xsi:type="boolean">false</item>
        </argument>
    </field>
</fieldset>

But what I really want is to move a field from customer to another to simplify life for unexperienced admin users. How is that accomplished?


texts: Layout Update XML in magento2 pages in backend

texts:
I want to add some other blogs in pages using 2 columns with right bar in pages.
For example, I have added code like remove wishlist and I have added my custom block in that Layout Handle in the backend. But it's not working. Please tell me how to fix this.

Layout handle in pages screnshot:
https://prnt.sc/i4reka

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="catalog.compare.sidebar" remove="true"/>
        <referenceBlock name="wishlist_sidebar" remove="true"/>
        <referenceContainer name="sidebar.additional">
            <block class="Custom\Blog\Block\Sidebar" name="blog.sidebar" template="Custom_Blog::sidebar.phtml" after="-"/>
        </referenceContainer>
    </body>
</page>


texts: Magento 2: How to add multilevel AND and OR conditions to searchCriteria?

texts:
What i want to achieve is this -

  attr1 = 'val1' AND attr2 = 'val2' AND ((attr_s1 = 'val_s1' AND attr_d1
  = 'val_d1' AND attr_t1 = 'val_t1') OR (attr_s2 = 'val_s2' AND attr_d2 = 'val_d2' AND attr_t2 = 'val_t2') OR (attr_s3 = 'val_s3' AND attr_d3 = 'val_d3' AND attr_t3 = 'val_t3'))

in short

  P and Q and ( (A and B and C) or (L and M and N) or (X and Y and Z) )

I have gone through similar kind of thread here -
SearchCriteria Logical OR and AND search

But what I want is much more complex.
Can it be done with searchCriteria or in any other way?


texts: How do I get an order collection in admin order view using the email address of the current order?

texts:
I am trying to build an order history table to display previous orders (order number/date/items ordered, etc) from a customer order in the admin order view (Magento\Sales\Block\Adminhtml\Order\View\Info). This table should list all previous orders that used the email from the current order regardless if they are a guest or have an account.
I did this in Magento 1.9 by calling the model directly in the template and running through the loop for orders and items for those orders:
<?php
$orderCollection = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_email',$_order->getCustomerEmail())->addFieldToSelect('*')->setOrder('entity_id', 'desc');
$recordNumber = 1;
if ($orderCollection->getSize() >= 2) {

$orderCollection->getSelect()->limit(20);
foreach($orderCollection as $order){
$history_id = Mage::getModel('sales/order')->loadByIncrementId($order->getIncrementId())->getId();
$orders = Mage::getModel("sales/order")->load($order->getId());
$orderHistoryDate = $this->formatDate($order->getCreatedAtStoreDate(), 'medium', true);
$items = $orders->getAllVisibleItems();

//list orders (order number, date, status)

foreach($items as $item):

//list items in orders (qty ordered, item name, sku)

endforeach;

}
}

How can I do this with dependency injection on Magento 2?


texts:
I am looking to interact with the Magento 2.0.4 API to pragmatically create customers.

http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html

The above URL states that you can get an access token with the following CURL command:

curl -X POST "http://v2.magentosite.com/index.php/rest/V1/integration/admin/token"      -H "Content-Type:application/json"   -d '{"username":"admin", "password":"password"}'

The returned result though is:

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


texts: Magento 2: How to Create admin user programmatically using frontend controller

texts:
I want to create an admin user programmatically , from the frontend controller my frontend code is:

<?php
namespace Learning\HelloPage\Controller\Account;
use Magento\Framework\App\Action\Context;
class Add extends \Magento\Backend\App\Action
{
    protected $_userFactory;

    public function __construct(
        \Magento\User\Model\UserFactory $userFactory
       )
    {
        $this->_userFactory = $userFactory;
    }

    public function execute(){

        $adminInfo = [
            'username'  => 'killer',
            'firstname' => 'admin',
            'lastname'    => 'admin',
            'email'     => 'me@helloworld.com',
            'password'  =>'hello@123',
            'interface_locale' => 'en_US',
            'is_active' => 1
        ];

        $userModel = $this->_userFactory->create();
        $userModel->setData($adminInfo);
        $userModel->setRoleId(7);
        try{
           $userModel->save();
           echo 'saved';
        } catch (\Exception $ex) {
            $ex->getMessage();
        }
    }
}

it is giving me this error.


texts: How to develop custom report module for orders filter by category in magento 2

texts:
I want to develop custom module in which i can filter sales order details filtered by category id.
I am serching for solution but i can't find any solution please help me.
Thank you in Advance.


texts:
I want to combine block with price and block with quantity. QTY block without button "add to cart".

I found in theme's catalog file :

Magento_Catalog/templates/product/view/addtocart.phtml.

I see qty block template. And I found file

/magento_root/app/code/Magento/Catalog/view/base/templates/product/price/amount/default.phtml with price block.

How can I combine these two template?

I try to copy block what I want, but I have exeption.


texts: Magento 1 - Jquery datepicker error with merged JS

texts:
In magento 1 when merged javascript files is set to "yes" I encountered this error :

When merged javascript files is set to "No" there was no problem with jquery datepicker.

Do you have any idea how to solve this issue ?

Thanks

EDIT

When I click on the error in the console, the end of this line "throw e;}" is underline in red :

return before+String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function each(iterator,context){var index=0;try{this._each(function(value){iterator.call(context,value,index++);});}catch(e){if(e!=$break)throw e;}


texts:
How to Translate about this code please?
->addSuccessMessage(__('Your #' . $incrementId . ' has been submited.'));

I tried Your #%1 xxxx but not working?
anyone can help,
thank you!


texts: How to i add a cache id into Full Page Cache

texts:
i have a categories menu, when i add a new category to it even after i reindex and refresh every cache it doesn't update even though the top navigation has and i can navigate to it via url, it only appears after i flush the cache storage

i get it from the cache using this line of code

Mage::app()->getCache()->load($this->getCacheId());

$this->getCacheId() just returns the string LEFTCATEGORIES

now even if i disable all the caches it still remains until i either flush the storage cache or delete the cache folder (and even the full page cache folder if it's enabled)

now it's not very often that new categories are added into magento but we don't really want to have to flush the storage cache every time we create a new category

so how do i add my LEFTCATEGORIES cache id to the full page cache so that when we refresh it it gets refreshed as well


texts: Steps Install Elasticsearch 6.6 for Magento 2

texts:
I have many problems when installing Elasticsearch on my server. I'm going to put the steps that I followed in case someone can tell me if I'm missing something or not, please, or if I need to install something.

My system Ubuntu 18.04, Nginx 1.14.0, MySQL 5.7.25, Magento 2.3, PHP 7.1.26, Magento 2.3

I followed this link:

Install and configure Elasticsearch (devdocs.magento.com)

I have installed the Java Software Development Kit (JDK) with this steps:

sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get -y update
sudo apt-get install -y oracle-java8-installer

I have installed Elasticsearch 6.6 follow this steps:

sudo wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.0.deb
sudo wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.0.deb.sha512
sudo shasum -a 512 -c elasticsearch-6.6.0.deb.sha512
sudo dpkg -i elasticsearch-6.6.0.deb
sudo rm elasticsearch-6.6.0.deb
sudo rm elasticsearch-6.6.0.deb.sha512
sudo vi /etc/elasticsearch/elasticsearch.yml
    network.host: localhost
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
curl -XGET "localhost:9200" ------> (everything works correctly)

Configure and run cron: With this step is enough? or should I create a specific cron job for reindexing?

php bin/magento cron:install

and then, to configure my nginx I followed this link:

Configure nginx and Elasticsearch (devdocs.magento.com)

Set up a proxy. Is this step necessary?

To create a new file /etc/nginx/conf.d/magento_es_auth.conf with the following contents

server {
    listen 8080;
    location / {
        proxy_pass http://localhost:9200;
    }
}

Next steps

service nginx restart
curl -i http://localhost:8080/_cluster/health ------> (everything works correctly)

I have configured Magento to use Elasticsearch. And it seems that everything works correctly.

Secure communication with nginx. Is this step necessary?

Can someone help me resolve my questions in bold? And to know if these are the passos necessary to install and configure Elasticsearch or if I need to do something else


texts: Magento 2.3 multistore with multiple domains

texts:
I have 2 stores with 2 different domains, domain2 is created as alias

Changed base links and base url's in both stores to match corresponding domains.
also added following code to index.php:

$params = $_SERVER;
$domain2store = array(
    'domain1'=>'default',
    'domain2'=>'store2'
);
if(isset($domain2store[$_SERVER['HTTP_HOST']]))
    $storecode = $domain2store[$_SERVER['HTTP_HOST']];
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = isset($storecode) ? $storecode : '';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);

everything works just fine on first store which is also default. but on second store product images are showing default no-image.
so if in backend product has 3 images - i get 3x no-image on frontend.

css, js and static(wysiwyg) images are loaded fine in second store ( domain )
and if i use products in static blocks i do see normal product images. but on product detail page all product images are shown as no-image


texts: How to get the product name by the sku in an inner join

texts:
I am trying to do a join from inventory_source_item (sku column) to get a list of product names.

i currently have

SELECT * FROM `inventory_source_item` order by source_item_id desc limit 61

What table can i join to where i can join the sku to get a list of 61 product names? Cant find it anywhere!


texts: Error log after installing Aschroder Custom Order Number

texts:
I installed Aschroder Custom Order Number extension, and it seems like everything works properly. However, I'm getting this error in my system.log file. Can someone please help me understand how to fix it?

The error repeats, so I'm gonna pass only few first lines here.

2015-02-06T08:14:09+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 104: parser error : Comment not terminated
&lt;!--          &lt;block type=&quot;paypal/logo&quot; name=&quot;paypal.p  in /home5/xxxxx/public_html/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2015-02-06T08:14:09+00:00 ERR (3): Warning: simplexml_load_string():             &lt;!--    &lt;action method=&quot;setLogoType&quot;&gt;&lt;value&gt;wePrefer_150x60&lt;/value&gt;&lt;  in /home5/xxxxx/public_html/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
2015-02-06T08:14:09+00:00 ERR (3): Warning: simplexml_load_string():               ^  in /home5/xxxxx/public_html/app/code/core/Mage/Core/Model/Layout/Update.php on line 450


texts: How to override or extend proceed-to-checkout.js

texts:
I need to override or extend Magento's proceed-to-checkout.js file in my module.
app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js

In my modules requirejs-config.js I have tried using a mixin and also replacing the mapping with both...

var config = {
    'config': {
        'mixins': {
            'Magento_Checkout/js/proceed-to-checkout': {
                'Mynamespace_Checkout/js/view/proceed-to-checkout-mixin': true
            }
        }
    }
};

AND

var config = {
    map: {
        '*': {
            proceedToCheckout: 'Mynamespace_Checkout/js/proceed-to-checkout'
        }
    }
};

Neither work and I'm unsure how I should write the mixin as Magento's original proceed-to-checkout.js file simply returns an anonymous function with a jQuery click event listener.

Any idea how I can get this to work in a module?


texts: I can not save any configurations from the admin panel

texts:
I can not save any configuration from the Admin panel, after saving the settings and clean the cache.
There are no written records and no error message is seen.

Video of error


texts: Trouble in getting in customer data using block class

texts:
I'm having trouble in getting the customer details using block class. I want to show the customer name after he/she logged in using block class. I can do it via object manager but not through block.

Below are my code:

Block file:

<?php

namespace vendor\module\Block;

use Magento\Customer\Model\Session;

class Testing extends \Magento\Framework\View\Element\Template {

    public function __construct(
        Session $customerSession,
        \Magento\Framework\View\Element\Template\Context $context
    )
    {
        parent::__construct($context);
        $this->_customerSession = $customerSession;

    }
    public function getCustomerName(){
        $this->_customerSession->getCustomer()->getName();
    }
}

In template file:

<?php echo $block->getCustomerName(); ?>

In XML:

<referenceContainer name="content">
     <block class="vendor\module\Block\Testing" name="customer.session.data" template="Magento_Theme::html/test.phtml" cacheable="false" />
 </referenceContainer>

When I try to load the customer name, its not working.

Any help will be appreciated!


texts: How to create a dynamic generated Admin fields in "add product section"?

texts:
I want to add dynamic field for each product type and display in Product detail page.
Can anyone tell me how can I achieve this. (See below image)


texts: Is it possible somehow to remove shipping fee from existing order? I tried to edit the order, but i have an error message after i clicked on the edit button: "Please specify the product's option(s)."


texts:
I have created the local setup from the live server. After that, I have copied the theme files like Porto and porto_rtl from the live server and pasted it on the local setup.

Then run all the command. but it throwing the js error

  Compilation from source
  /var/www/html/test//app/design/frontend/Smartwave/porto/web/js/jquery.parallax.min.js
  failed Magento\Framework\View\Asset\File\NotFoundException: Unable to
  resolve the source file for
  'frontend/Smartwave/porto_rtl/en_US/js/jquery.parallax.min.js' in
  /var/www/html/test/vendor/magento/framework/View/Asset/File.php:160

How to resolved that.

Thanks.


texts: Magento 2.3, Get the order status before and after change using the plugin?

texts: In Magento 2.3, How to get order statuses, before and after change using the plugin?


texts: Magento2: Need to show system filed value in label not in input box

texts:
I need to show field value in the label, not in the input box.

Please suggest for this


texts:
I made some modifications on my customer group_id and I have now multi-select, so I can select more than 1 groups per customer and I setup a new customer group with the name myshipping. How I can apply free shipping if the customer have myshipping group assigned?

Thank you

I found this maybe will help someone to give me an idea:

EDIT:

class Anshu_ShippingFilter_Model_Shipping extends Mage_Shipping_Model_Shipping {

    public function collectCarrierRates($carrierCode, $request) {
        if (!$this->_checkCarrierAvailability($carrierCode, $request)) {
            return $this;
        }
        return parent::collectCarrierRates($carrierCode, $request);
    }

    protected function _checkCarrierAvailability($carrierCode, $request = null) {
        $isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
        if ($isLoggedIn) {

            $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
            if (2 == $groupId && 'freeshipping' == $carrierCode) {
                return false;
            }
            return true;
        }
    }

}


texts: Magento 1.9.1 configurable product attribute sorting

texts:
As i already mentioned, there seems to be a problem with magento 1.9.1 and the sorting of attributes of configurable products.
The options of a configurable product now ALWAYS depend on the product ID of the simple product. The order of the attribute options are ignored.

I went back to magento 1.9.0.1. Maybe someone can determine how the sorting in 1.9.1 is done. It would be great for everyone who uses configurable products to fix that.

If somebody wants to see that, you can do it here in magento demo store.
I wasnt able to sort the sizes correctly.


texts: Magento 2 Vue Storefront error can't start docker in background

texts:
I am implementing the vue storefront using the following reference:

https://medium.com/the-vue-storefront-journal/vue-storefront-how-to-install-and-integrate-with-magento2-227767dd65b2
https://docs.vuestorefront.io/guide/installation/linux-mac.html#using-vue-storefront-demo-as-a-backend

I have got the following error:

Can you please provide me all the steps of the docker implementing for vue I am not aware of the docker.
Implementing vue is possible without docker?
Thank you so much in Advanced.


texts: Custom attribute address in checkout page

texts:
We're experiencing the same problem, even in Magento 2.2.7 version.

https://stackoverflow.com/questions/52619136/magento2-save-new-address-attribute-in-checkout

Newly added custom attributes are present on first "Shipping" step but when on "Review & Payments" step these fields are no longer present, hence not sent to form.
Or in our case, an error apper since they are required and values are not set.

Did someone find how to solve it?

In my case:

    $attributesInfo = [
        'gsp_address_type'  => [
            'label' => __('Address Type'),
            'type' => 'varchar',
            'input' => 'select',
            'source' => 'Mod\Module\Model\Data\AddressType',
            'position' => 1,
            'visible' => 1,
            'required' => 1,
        ],
    ];

    foreach ($attributesInfo as $attributeCode => $attributeParams) {
        $customerSetup->addAttribute('customer_address', $attributeCode, $attributeParams);
    }

    foreach ($attributesInfo as $attributeCode => $attributeParams) {
        $attribute = $customerSetup->getEavConfig()->getAttribute('customer_address', $attributeCode);
        $attribute->setData(
            'used_in_forms',
            ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address']
        );
        $attribute->save();
    }


texts: Adding a new block to a Product detail page above Add to Cart block

texts:
So I'm trying to add a block to the product page. The block will simply output an attribute if it exists for that particular product. In this case it is outputting the bottle size.

Now I've got the content block working. My problem is I'm not sure how to get it positioned and set up right. So first I'll explain how I have it working. I've added the following code to catalog_product_view.xml

<referenceBlock name="content">
  <block class="Magento\Catalog\Block\Product\View"
        name="product.bottlesize"
        template="Magento_Theme::html/products/bottlesize.phtml"
        before="-"/>
</referenceBlock>

So this works fine, but it outputs this block first before any other product information, so it appears over the image on the left. I'd really like this to be above the Qty and Add to Cart. So I tried to do the following but it fails:

<referenceBlock name="product.info.options.wrapper.bottom">
  <block class="Magento\Catalog\Block\Product\View"
         name="product.info.addtocart.bottlesize"
         template="Magento_Theme::html/products/bottlesize.phtml"
         before="-"/>
</referenceBlock>

But this causes it not to display at all. I've tried finding various examples and replicating the examples in various ways but it never shows up. The block works because my first example displays it, just in the wrong area.

I'd really like to know the fix but also a bit of understanding around this since I can't seem to grasp the protocol.


texts: Even I have specified var jQuery = jQuery.noConflict(); in my code but there i am getting the reference error on this line. What may be the possible reasons for this error?


texts: Removing cron.php, cron.sh, ... from robots.txt - reasons, and is there *any* influence on the shop somehow?

texts:
We are currently evaluating to optimize our robots.txt file. Our SEO Manager requested to remove specific stuff that Magento puts there by default.

Those values are:

-# Files
-Disallow: /cron.php
-Disallow: /cron.sh
-Disallow: /error_log
-Disallow: /install.php
-Disallow: /LICENSE.html
-Disallow: /LICENSE.txt
-Disallow: /LICENSE_AFL.txt
-Disallow: /STATUS.txt

Developers don't want to remove those positions as there might be sensitive content in those files, SEO Manager says that its just a recommendation for Bots and that they'll crawl the files most likely anyway. Additionally to that some SEO Agency told our SEO Manager that there is a SEO influence in general when removing those positions (???).

Lets come to the question:

Are there any influences to the shop if we remove those files, and if so, how might they change the total SEO of the shop.


texts:
I am sorry if my question is out of place. I am new to Magento and to this forum and I need some advice.

My application requires that after I make a few changes to my items in Magento (prices, inventory), I would create a feed only to those items that I have changed (since I started the editing).

another option is to create a feed of items that were changed after a specific date/time.

What is the best way to do something like that?
Is there an extension that has a solution for such an application?

p.s: I am a developer. If there is no readymade solution, I will do it myself.


texts: Magento 2.3 extend product list collection in child template - error on search

texts:
We use the following method to extend the product list collection inside a child template.
This works fine for the product catalog list page, but gives a error (skips the load from the element) on the search page. The setProduct element does not work on search.

How can we solve this to make this also work on the search page?

Code:

<?php
namespace Vendor\CatalogProduct\Block\Product;

class Data extends \Magento\Framework\View\Element\Template
{
    private $product;

    public function setProduct($product)
    {
        $this->product = $product;
    }

    public function getProduct()
    {
      return $this->product;
    }

}

Inside list.phtml;

<ul class="product-highlights-specs">
   <?php $block->getChildBlock("product-specs")->setProduct($_product);
   echo $block->getChildHtml('product-specs', false);?>
</ul>

Inside product-specs template;

<?php
$_product = $block->getProduct();
$attributeset = $_product->getAttributeSetId();

echo $_product->getName();?>
?>


texts: Inject Class of Factory (Model or Repository) For Saving Data

texts:
If I want to save data in controller's action, what should I inject?

Model Class or Repository Class
Model Factory or Repository Factory

.

use Krish\Database\Api\Data\TestInterface;
use Krish\Database\Model\TestModel;
use Krish\Database\Model\TestRepository;
public function __construct(
    Context $context,
    TestInterface $testInterface,
    TestModel $model,
    TestRepository $testRepository
)
{
    parent::__construct($context);
    $this->testInterface = $testInterface;
    $this->model = $model;
    $this->testRepository = $testRepository;
}
public function execute()
{
    $this->testInterface->setName('Through Repository');
    $this->testRepository->saveTest($this->testInterface);

    $this->model->setData('name','Through Model');
    $this->model->save();
    exit;
}

In above code, Data is saving from both Model and Repository.
This code also works fine with below constructor:

use Krish\Database\Model\TestModelFactory;
use Krish\Database\Model\TestRepositoryFactory
use Krish\Database\Api\Data\TestInterface;
public function __construct(
    Context $context,
    TestInterface $testInterface,
    TestModelFactory $model,
    TestRepositoryFactory $testRepository
)
{
    parent::__construct($context);
    $this->testInterface = $testInterface;
    $this->model = $model->create();
    $this->testRepository = $testRepository->create();
}


texts: Tax specific query very strange behaviour or is it with eBay GSP Sales

texts:
I am thinking M2 might be correct but not 100%.
I have all my Tax Zones and Rates added and my Tax Rules setup.
I have the correct settings and all my sales are in the UK and VAT is applied correctly.
But i have several sales through the GSP (eBay Global Shipping Programme) which ships all over the world.
But as a seller in the UK under eBay GSP T&C's to me it's a UK sale as i ship to a UK address.
But the Magento invoice on GSP sale does not show VAT i think it must look at the billing address.
So in Magento mine shows zero tax but if i open it i have a value of VAT ion that country.
See here
It makes no sense it shows zero tax in purchase page in invoice it shows zero but if i open dropdown it shows UK20% but the vaule is totally wrong?
Currently running Magento ver. 2.3.5-p1


texts: "As Low As" / Expired Special Price Still Showing (Magento 2.1.11)

texts:
I have a configurable product with two variations. Each simple product has a special price set as expiring yesterday, and this is properly reflected when the product is added to the cart.

However, "As Low As [special price]" still displays on the product. Is this the intended behavior, or is there a way to fix this? Thanks!

Edit: have of course tried flushing cache/reindexing/etc. Also, some easy bounty for someone to collect, I'd imagine.


texts: Customize Layered Navigation and Catalog List Behaviour

texts:
What I'm trying to achieve is a little bit funky.

We have an attribute on certain items which is called Primary Item and set to true. What we're trying to achieve is the following:

1) On category page, with no filtering in layered navigation show only Primary Items. On layered navigation block, show counts of ALL items.

2) On category page with filtering of some sort, show all items that matches the filter property, regardless if its a primary item. On layered navigation block, show counts of ALL items.

3) On search, show all items that matches the search query, regardless if they are primary or not. On layered navigation block, show counts of ALL items.

We tried adjusting Catalog\Block\Product\List.php and added the following:

 $this->_productCollection = $layer->getProductCollection();

        $_filters = Mage::getSingleton('catalog/layer')->getState()->getFilters();
        if (isset($_filters) && !empty($_filters)){
            //DO NOTHING

          }elseif(empty($_filters)){

            $this->_productCollection = $this->_productCollection->addAttributeToFilter('primary_item', array('eq' => 1));;

          }

This indeed works in category listing but it also changes the layered navigation count values as we're changing the collection too early.

We also tried manipulating the actual block:

$_filters = Mage::getSingleton('Mage_Catalog_Block_Layer_State')->getActiveFilters();
if (isset($_filters) && !empty($_filters)){
       //DO NOTHING
  }elseif(empty($_filters)){
      $_productCollection = Mage::getResourceModel('catalog/product_collection')
      ->addAttributeToSelect('*')
      ->addCategoryFilter(Mage::getModel('catalog/category')->load($cat_id))
      ->addAttributeToFilter('primary_item', array('eq' => 1))
      ->load();
  }
?>

Although it worked for 1+2, the search does not work at all and showing ALL primary items no matter what you search for. Moreover, the sorting in the category page stopped working (by price, by position, etc).


texts: discount coupon code is not working on checkout page

texts: My discount coupon code is not working on the checkout page, if I'm clicking on the apply button or canceling the button, both buttons are not working and the coupon code is working properly on the cart page


texts: Url in magento product page not showing up right

texts:
As mentioned in the title i am dealing with the following problem.
When i click at a category in my menu the url i see is something like that:

myshop.com/catalog/category/view/s/category-name/id/14

and what i want to show as url is the following

myshop.com/menu item/category/product //(when clicked in a product).

Any ideas?


texts: Magento 2.3.0 logo not uploaded due to deferred.pipe() console error

texts:
Please check attachment. I have a fresh Magento 2.3.0 installation. Unable to upload a logo.

The error says "A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later."

Consol error

  JQMIGRATE: deferred.pipe() is deprecated at
  /adminhtml/Magento/backend/en_US/jquery/jquery-migrate.jsjquery-migrate.js:45


texts: How to add a custom block to admin sales order shipment

texts:
i've been trying to include a block in the sales_order_shipment form.

I already got the block to appear at the bottom of the page, but everytime i press the ship button the information related to my block isn't sent (because it's not part of the original form).

This is what I've done so far:

In my module config.xml i added:

<global>
....
<blocks>
        <modulename>
            <class>Companyname_Modulename_Block</class>
        </modulename>
</blocks>
.....
</global>
<adminhtml>
    <layout>
        <updates>
            <Companyname_Modulename>
                <file>modulename.xml</file>
            </Companyname_Modulename>
        </updates>
    </layout>
</adminhtml>

Added modulename.xml to layout in (app/design/adminhtml/default/defaul/layout):

<layout>
<adminhtml_sales_order_shipment_new>
    <reference name="content">
            <block type="modulename/sales_order_shipment_create_atinfo" name="atinfo" template="modulename/sales/order/shipment/create/atinfo.phtml"></block>
    </reference>
</adminhtml_sales_order_shipment_new>

Added my template, named atinfo.phtml to (app/design/adminhtml/default/default/template/modulename/sales/order/shipment/create) with some simple html.

The problem seems to be that, by adding my block this way, it doesn't go into:

<form id="edit_form" method="post" action="<?php echo $this->getSaveUrl() ?>">

That is defined in form.phtml.

Is it possible, on my modulename.xml, to insert the block (name=atinfo) inside the block (name=form) that is defined on sales.xml (located at /app/design/adminhtml/default/default/layout)?

Right now, if we insert the block (name=form) inside modulename.xml, it gets duplicated on the order new shipment page.

Any help would be appreciated, as i said before, my block appears in the page, but when i press the Ship button, my block information isn't sent.


texts:
Is there way to encrypt Magento FTP/Cpanel Codes so that no one except myself can be able to access it?
If there is a way how, I would really appreciate the help.
Thank you!


texts: Can create grid like the way of magento 1x in Magento 2

texts: Sometime i want to create a grid in backend like the way in magento 1. Should i use that way or complete move to ui way? I heard somewhere that old way soon will deprecated! Is it right


texts: Magento2 : How can i use use_default[url_key] option to be chcked using CSV upload

texts:
Using product CSV upload I want to to be checked the use default option for url_key as i have multiple stores.

I have tried use_dafult_url_key option in CSV but its not working


texts: How to properly add ".phtml" files to cms home page?

texts:
I created a few ."phtml" files in my custom theme. Currently, I create a block & widget in the backend to call them on my cms home page.
Is that the correct way?
If I, for example, want to use my custom theme on another magento2 installation, these ".phtml" files aren't included on the cms home page anymore and blocks & widgets need to be created manually.

Should I handle that stuff different? Maybe include into XML? If yes, how?

Thanks a lot for clarification :))


texts: get order status from order id, email and customer's last name

texts:
I'm currently looking for a method from which I can get the order status based on the order id, customer email and customer last name.

I'd written this code so far

public function orderHistoryAction(){
    $req = $this->getRequest();
    $oid = $req->getParam('oid', '');
    $lnm = $req->getParam('lnm', '');
    $eml = $req->getParam('eml', '');

    $order = Mage::getModel('sales/order')->loadByIncrementId($oid);
    if ($order->getId()) {
        if ((strcasecmp($lnm, $order->getCustomerLastname()) == 0) && (strcasecmp($eml, $order->getCustomerEmail()) == 0)) {
            echo $order->getStatusLabel();
        } else {
            echo 'invalid';
        }
    } else {
        echo 'invalid';
    }
}

and is working well for both customer and guest. But this doesn't seems to me the right approach. I supposed to used something like written in this blog or this blog. If anybody could make me correct?


texts: Magento 2: PWA sample data installation error

texts:
I have installed PWA in magento root directory like magenotpwa231/pwa-studio/

PWA installed successfully but getting stuck Repository type is not registered: github while installing sample data.

I have copy deployVeniaSampleData.sh to magento root directory.

See below path:

magenotpwa231/pwa-studio/packages/venia-concept/deployVeniaSampleData.sh to magenotpwa231/deployVeniaSampleData.sh and then run the command bash deployVeniaSampleData.sh

See the below is the process of run command:

  cmd: bash deployVeniaSampleData.sh

Please specify absolute path to your Magento 2 instance
Magento root folder: /var/www/html/magenotpwa231
Sample data will be installed there.

Are you sure you want to continue? [y/n]y
adding composer repository git@github.com:PMET-public/module-catalog-sample-data-venia.git
adding composer repository git@github.com:PMET-public/module-configurable-sample-data-venia.git
adding composer repository git@github.com:PMET-public/module-customer-sample-data-venia.git
adding composer repository git@github.com:PMET-public/module-sales-sample-data-venia.git
adding composer repository git@github.com:PMET-public/module-tax-sample-data-venia.git
adding composer repository git@github.com:PMET-public/sample-data-media-venia.git
Repository type is not registered: github

Any help will be appreciated. Thanks!


texts: Magento2. Change template in protected $_template

texts:
The question is easy.

How to change template, whose path exists only in protected property $_template


texts: Magento2 : What is the difference between Order Status And Order State

texts: Does anyone know how we can differenciate Order Status And Order State ?


texts: Why attributes of bundle items of a bundle product are also saved to the bundle product itself? (database-wise)

texts:
Recently I was studying how the options of the layered navigation filter on the category page are determined and retrieved. I have dug a bit into the models and database for it, and there I found the following mechanism which I do not understand:

Situation:
Say, I have an attribute named color (attribute_id = 133), a simple product A (entity_id = 26), and a bundled product B (entity_id = 27), and A is added to B as its bundle item, in Magento ver. 1.9.0.1.

Step 1: color is not set for both A and B

Step 2: color is set as Black (value_id = 19) for B

Step 3: color is set as White (value_id = 18) for A

From step 3, we could see that apparently attributes of the bundle items (A in this case) are also saved as if they are the attributes of the bundle product (B in this case) itself. And I believe that this is why the attributes of the bundle items of bundle products also appear in the layered navigation filter.

I would like to ask why is it designed this way? Why would the system save attributes of the children products to the parent product as well? How does it help in any specific process in the system?

Thanks in advance.


texts:
I have 3 weeks trying to install by composer some modules but when i see the data base i cant found any data table of the module. I recibe different issues but always persist this kind of issue:

2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DatabaseName.aw_raf_summary' doesn't exist, query was: SELECT aw_raf_summary.id FROM aw_raf_summary WHERE (referral_link = :referral_link) AND (website_id = :website_id)
Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DatabaseName.aw_raf_summary' doesn't exist.

This is an example after of install Refer A Friend (Component name: aheadworks/module-raf Component version: 1.1.3)
I'm using Magento 2 CE 2.3.4

My steps on command line are:

composer require aheadworks/module-raf
php bin/magento setup:static-content:deploy -f
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento cache:clean


texts: Display coupon code on Product page. Magento1.9

texts:
I want display coupon code on product page. In shopping cart price rules ,i have applied coupon to a particular category. I want to display the coupon on every product page whose category id is specified in shopping cart price rules.

$current_sku=$_product->getSku(); // Sku you are looking for

$rules = Mage::getResourceModel('salesrule/rule_collection')->load();

foreach ($rules as $rule) {
if ($rule->getIsActive()) {
    $rule = Mage::getModel('salesrule/rule')->load($rule->getId());

    $conditions = $rule->getConditions()->asArray();

    foreach( $conditions['conditions'] as $_conditions ):
        foreach( $_conditions['conditions'] as $_condition ):
            $string = explode(',', $_condition['value']);
            for ($i=0; $i<count($string); $i++) {
                $sku = trim($string[$i]);
                if ($sku==$current_sku) {
                        echo $rule->getCouponCode(); // Return coupon code that matches the sku condition
                }
            }
        endforeach;
    endforeach;
}
}

ref-
Get Shopping cart rule coupon code


texts: tried every possible way setting up cron job

texts:
I just upgraded from 1.9.0.1 to 1.9.2.4 and order conformation mails are not sending automatically. However, If I force send them through admin panel then they do work properly. I have tried every possible way setting up my cron job but it doesn't work at all. after visiting the url www.mysite.com/cron.php i am getting 404 page not found.

Any solution?


texts: Magento product list grid mode how to remove toolbars?

texts:
I want to show 20 products on my homepage without any toolbar at the top or bottom.

Currently I have this block, which shows a toolbar:

{{block type="ultimo/product_list_featured" category_id="26" product_count="20" show_items="4"
is_responsive="1" is_random="0" hide_button="0" block_name="X"
template="catalog/product/list.phtml"}}

How do disable the toolbars at the top and bottom?


texts: Magento 2.1.3 to magento 2.1.6 upgrade possible Issue?

texts:
Magento ver 2.1.6  - Added on Apr 11, 2017.

Magento 2.1.6 contains over 15 significant performance enhancements when compared to 2.1.5
http://devdocs.magento.com/guides/v2.1/release-notes/ReleaseNotes2.1.6CE.html

I want to know possible issue of upgrade magento 2.1.3 to 2.1.6.

Have anyone face any issue after upgrading magento version to 2.1.6

Magento said there is some issue with image resizing.


texts:
I need to retrieve some information from my custom admin controller  using AJAX.
But when AJAX is used I get current page's entire HTML !

I simply want to get some JSON data from my custom controller. That I will implement later on.

I'm calling my custom controller from a block in this

URL .../admin/admin/order_shipment/new/order_id/...

Here is my ajax call

 var param = 'form_key='+window.FORM_KEY;
         $.ajax({
                 showLoader: true,
                 url: "admin/PostaPlus/PostaPlusShipping/HSCodes",
                 data: param,
                 type: "POST",
                // dataType: 'json'
                }).done(function (data) {
                    alert(data);
                    console.log(data);
                 });

Here is my custom controller codes,

<?php
 namespace PostaPlus\PostaPlusShipping\Controller\Adminhtml;
 use Magento\Backend\App\Action;

 class HSCodes extends \Magento\Backend\App\Action
{

   protected $resultJsonFactory;

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

  public function execute()
  {
    //return $this->resultJsonFactory->create()->setData(['a' => 'b']);
    return 'test string';
  }

  public function indexAction(){

    //echo 'test string';
  }
}

Here is my route file,

<?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
     <router id="admin_hs_codes">
      <route id="PostaPlus" frontName="PostaPlus">
        <module name="PostaPlus_PostaPlusShipping"/>
      </route>
    </router>
 </config>


texts:
How to check if a variable is a MYSQL query?
It needs to exclude sql injection.
I tried to write regular expressions, but it's veeeery hard. I think, that checking it would be easier.


texts: how to hide all inactive/disable steps in magento checkout page

texts: I want to show only one step at a time on magento checkout page and when a customer will click on continue button then next step should appear and remaining all steps should be hide. As you can see in the picture, here checkout method is active and remaining steps are just disable so here i want all disable step should be hide not just to keep as disable. there is two js file also been included accordion.js and opcheckout.js. I tried a lot to achieve the same thing but I couldn't not achieve So please some one help me, please !!


texts: Different sort direction for each sortable attribute

texts:
is it possible to have different Default Sort Direction for different sortable attributes?

is sort direction a value that can be changed using updateAttribute or is the sort direction global?

thank you


texts:
I am planning to use the following robots.txt:

## robots.txt for Store

## GENERAL SETTINGS

## Enable robots.txt rules for all crawlers
User-agent: *

## Crawl-delay parameter: number of seconds to wait between successive requests to the same server.
## Set a custom crawl rate if you're experiencing traffic problems with your server.
# Crawl-delay: 30

## Magento sitemap: uncomment and replace the URL to your Magento sitemap file
##Sitemap: http://mystore.com/sitemap.xml

## DEVELOPMENT RELATED SETTINGS

## Do not crawl development files and folders: CVS, svn directories and dump files
Disallow: /CVS
Disallow: /*.svn$
Disallow: /*.idea$
Disallow: /*.sql$
Disallow: /*.tgz$

## GENERAL MAGENTO SETTINGS

## Do not crawl Magento admin page
Disallow: */admin/

## Do not crawl common Magento technical folders
Disallow: /app/
Disallow: /downloader/
Disallow: /errors/
Disallow: /includes/
Disallow: /lib/
Disallow: /pkginfo/
Disallow: /shell/
Disallow: /var/

## Do not crawl common Magento files
Disallow: /api.php
Disallow: /cron.php
Disallow: /cron.sh
Disallow: /error_log
Disallow: /get.php
Disallow: /install.php
Disallow: /LICENSE.html
Disallow: /LICENSE.txt
Disallow: /LICENSE_AFL.txt
Disallow: /README.txt
Disallow: /RELEASE_NOTES.txt

## MAGENTO SEO IMPROVEMENTS

## Do not crawl sub category pages that are sorted or filtered.
##Disallow: */*?
Disallow: */*?dir*
Disallow: */*?dir=desc
Disallow: */*?dir=asc
Disallow: */*?limit=all
Disallow: */*?mode*
Disallow: */*?p=*&

# Paths (no clean URLs)
Disallow: /*.js$
Disallow: /*.css$
Disallow: /*.php$

## Do not crawl 2-nd home page copy (example.com/index.php/). Uncomment it only if you activated Magento SEO URLs.
Disallow: */index.php/

## Do not crawl links with session IDs
Disallow: */*?SID=

## Do not crawl checkout and user account pages
Disallow: */checkout/
Disallow: */onestepcheckout/
Disallow: */customer/
Disallow: */customer/account/
Disallow: */customer/account/login/

## Do not crawl search pages and not-SEO optimized catalog links
Disallow: */catalogsearch/
Disallow: */catalog/product_compare/
Disallow: */catalog/category/view/
Disallow: */catalog/product/view/

## Do not crawl some specific CMS pages & others
Disallow: */terms-of-sale/
Disallow: */terms-of-use/
Disallow: */privacy-policy/
Disallow: */sales/order/
Disallow: */storecredit/info/
Disallow: */invitation/

## SERVER SETTINGS

## Do not crawl common server technical folders and files
Disallow: /cgi-bin/
Disallow: /cleanup.php
Disallow: /apc.php
Disallow: /memcache.php
Disallow: /phpinfo.php

## IMAGE CRAWLERS SETTINGS

## Extra: Uncomment if you do not wish Google and Bing to index your images
# User-agent: Googlebot-Image
# Disallow: /
# User-agent: msnbot-media
# Disallow: /

But this is for multi store environment. I have following stores (as sub-directory):

http://mystore.com/
http://mystore.com/us/
http://mystore.com/uk/
http://mystore.com/de/

And robots.txt will be uploaded to the root folder.

The main thing I am concerned here is the use of * (wild card operator) for multi store environment. For example:

    Disallow: */*?dir*
    Disallow: */*?dir=desc
    Disallow: */*?dir=asc
    Disallow: */*?limit=all
    Disallow: */*?mode*
    Disallow: */*?p=*&

Are the robots.txt's contents fine for multi-store (esp. the one with * at first)?


texts: Magento refresh sidebar cart on checkout

texts:
I'm customizing magento 1.9.2.4 onepage checkout, but when i use right sidebar cart with totals, it doesn't update automatically when i change shipping methods and payment methods

I tried few jQuery solutions like

var accordion = new Accordion('checkoutSteps', '.step-title', true);
    <?php if($this->getActiveStep()): ?>
    accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
    <?php endif ?>
    var checkout = new Checkout(accordion,{
        progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
        review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
        saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
        failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
    );
      Accordion.prototype.openSection = Accordion.prototype.openSection.wrap(
            function(parentMethod, section) {
                // Call parent method
                parentMethod(section);
            jQuery.get('<?php echo Mage::getBaseUrl()?>/checkout/onepage/',function(data){

            var datax = jQuery.parseHTML(data);
             // .tblgt is cart total div class
            jQuery(datax).find('.tblgt').each(function(){
                  jQuery('.tblgt').html(jQuery(this).html());
            });
              });
         });

the above solution refresh cart in every step but it also refresh my address selections .

is there have any other solution for update the cart


texts: How to fix "element is not expected" in a CMS page with no XML changes?

texts:
I'm receiving this error message which is mentioned below, but as you can see in the image there are no XML updates, neither content, how can I fix it?

  Please correct the XML data and try again. Element 'reference': This element is not expected. Expected is one of ( referenceContainer, container, update, move, head, body ). Line: 1


texts: Magento 1.9 - How to Change Product Option in Configurable product

texts:
I am trying to read the products from excel and creating. Once I created a size/color variant (Size / Color configurable ) product programmatically how can I change this product after creating a Color and Size combo configurable product? Do you have any thoughts on this?

Please help me.


texts: unserialized in Magento\Framework\Message\Collection error

texts:
I have a integration using Magento 2 and Wordpress.
For a specific plugin, when it is enabled I get this error in admin and frontend

  Fatal error: Magento\Framework\Message\Manager::getMessages(): The
  script tried to execute a method or access a property of an incomplete
  object. Please ensure that the class definition
  "Magento\Framework\Message\Collection" of the object you are
  trying to operate on was loaded before unserialize() gets called or
  provide a __autoload() function to load the class definition in
  /var/www/html/magento2/vendor/magento/framework/Message/Manager.php on
  line 116

The message suggests that I should provide a autoload function to Manager.php

Can someone tell me how should I do that? How can I create a module that override that file if path is my wordpress install?

In order to do that I wrote a module. I don't know why it is not working. So my Magento 2 module looks like this

Here is my code

di.xml:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\Message\Collection">
        <plugin disabled="false" name="Gabriela_MessOverride_Plugin_Magento_Framework_Message_Collection" sortOrder="10" type="Gabriela\MessOverride\Plugin\Magento\Framework\Message\Collection"/>
    </type>
</config>

Collection.php:

<?php
/**
 * Override GetMessage()
 * Copyright (C) 2017
 *
 * This file is part of Gabriela/MessOverride.
 *
 * Gabriela/MessOverride is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

namespace Gabriela\MessOverride\Plugin\Magento\Framework\Message;

class AfterCollection extends Magento\Framework\Message\Collection

public function getMessages($clear=false)
{
    if (isset($_SERVER['REQUEST_URI']) && strstr($_SERVER['REQUEST_URI'], 'WORDPRESS_PATH')) {
        return $_objectManager->get("core/message_collection");
    }
    if (!$this->getData('messages')) {
        $this->setMessages($_objectManager->get('core/message_collection'));
    }

    if ($clear) {
        $messages = clone $this->getData('messages');
        $this->getData('messages')->clear();
        $manager->dispatch('core_session_abstract_clear_messages');
        return $messages;
    }
    return $this->getData('messages');
}

I'm not sure I'm following the right path. I'm wondering if the best aprroach is to create a plugin. And I don't know if my code is totally right. I'm also wondering why my Magento 2 question was labeled as off-topic in the Magento 2 forum.


texts: Call to a member function setTemplate() during rewrite Mage_Catalog_Block_Product_View_Options_Type_Select

texts:
i try to rewrite 'Mage_Catalog_Block_Product_View_Options_Type_Select' this catalog block but i got a error like

  Fatal error: Call to a member function setTemplate() on boolean in app/code/core/Mage/Catalog/Block/Product/View/Options.php on line 197

below is my config.xml file code with file path.

  app/code/local/Eventprice/Meta/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Eventprice_Meta>
            <version>0.0.1</version>
        </Eventprice_Meta>
    </modules>
    <global>
        <models>
            <eventprice_meta>
                <class>Eventprice_Meta_Model</class>
            </eventprice_meta>
        </models>
        <resources>
            <eventprice_sql>
                <setup>
                    <module>Eventprice_Meta</module>
                </setup>
            </eventprice_sql>
        </resources>
        <blocks>
            <eventprice_meta>
                <class>Eventprice_Meta_Block</class>
            </eventprice_meta>
            <adminhtml>
                <rewrite>
                    <catalog_product_edit_tab_options_type_select>Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Select</catalog_product_edit_tab_options_type_select>
                </rewrite>
                <rewrite>
                    <catalog_product_edit_tab_options_option>Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option</catalog_product_edit_tab_options_option>
                </rewrite>
            </adminhtml>
            <catalog>
                <rewrite>
                    <product_view_options_type_select>Eventprice_Meta_Catalog_Block_Product_View_Options_Type_Select</product_view_options_type_select>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

below is my Select.php file code with path.

  app/code/local/Eventprice/Meta/Block/Catalog/Product/View/Options/Type/Select.php

class Eventprice_Meta_Catalog_Block_Product_View_Options_Type_Select
extends Mage_Catalog_Block_Product_View_Options_Type_Select
{
    /**
     * Return html for control element
     *
     * @return string
     */
    public function getValuesHtml()
    {
       //function code as it is
    }

}


texts: PCI Compliance: Cookies HttpOnly flag is not set

texts:
In the default cookie settings, the Use HTTP Only option is already set to Yes. But the PCI Compliance checking has found several cookies that are not set. Here is the list:

section_data_ids
section_data_clean
private_content_version
recently_viewed_product
mage-cache-storage-section-invalidation
form_key

I already tried the suggestions here: Magento 2 : How to set secure cookie OR HTTP ONLY FLAG SET. But none of them worked. Can someone please help on this issue?


texts: Local site not loading after disabling two factor auth module and clearing cache in magento 2.4.1

texts: I have installed Magento 2.4.1 via composer install, then I tried to log in to the admin it asks for two-factor authentication, I have disabled the two-factor authentication using the command (bin/magento module:disable Magento_TwoFactorAuth) and flushed the cache using (bin/magento cache:flush), after doing these when I try to access my site it gives a blank page(attached screenshot).


texts: I want to access orders using customer token in rest API of Magento. Is it possible?


texts: Magento Rest API - white space sku issue

texts:
Issue
Unable to get update price via REST API due to white space in the sku
Steps to reproduce the issue

Create a product with SKU containing white space, eg. 'BAH SB'
Query Magento instance via REST API /rest/V1/products/BAH SB
Observe response

I tried URL Encoding:

/rest/V1/products/BAH%20SB
/rest/V1/products/BAH+SB

but didn't work.
Any Help?


texts: Validate class not found from basename 'Magento\Framework\Validator\EmailAddress' Error while doing Forgot your password

texts:
I am using Magento 2.3.3. when customer clicks on forget password and enters email address.
After clicking on Reset Password it gives this error Validate class not found from basename 'Magento\Framework\Validator\EmailAddress'

See https://prnt.sc/s7ronv

can somebody provide me solution for this.


texts: Magento 1 EE: Onestep checkout Grand Total Issue

texts:
I'm facing the weird issue,

On the Checkout page, on load Grand Total is displaying correctly.

but when I choose the shipping method it add the tax value to the Grand Total (even when the backend tax setting; Include Tax In Grand Total-No)

I also checked this with the base theme and still, the issue is same.

Please suggest.


texts: Getting product information from a external database

texts:
I have been given an unfinished product from a client, and it is a mess.

This is my first time ever using Magento, but I have used other CMS's. So please bare with me as I am a "newbie". I do have experience with PHP, MYSQL, and a few others.

Let me give a few specifics, so I can give you a better idea on what I am trying to accomplish.

I am using Magento 1.9

My client owns a bookstore, and they get almost 100 new books each week (all different IBSN's). As it sits right now they are going through a lengthy process to export and import CSV files to get this information on Magento.

So leading into my question, can we import/stream this info from an external database?  We have access to a database that has all of the products information (descriptions, author info, publication info, etc) and all we need to do is link the 2 together.

Is this possible? Or a similar way that could help the ease of this process?

Thank you in advanced for the help.


texts: Site Has Give Error NetworkError: 404 Not Found

texts: Site gives error like NetworkError: 404 Not Found


texts: Error flushing cache after install of SUPEE-10415

texts:
After installation of SUPEE-10415 patch on 1.7.0.2, an error is shown after flushing the Magento cache:

There has been an error processing your request

Cannot send headers; headers already sent in /home/youngag/public_html/magento/app/code/core/Mage/Core/Model/Config.php, line 1245

Trace:
#0 /home/youngag/public_html/magento/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/youngag/public_html/magento/app/code/core/Mage/Core/Model/App.php(1246): Zend_Controller_Response_Abstract->setHeader('Content-Type', 'text/html; char...')
#2 /home/youngag/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(80): Mage_Core_Model_App->getResponse()
#3 /home/youngag/public_html/magento/app/code/core/Mage/Core/Model/Url/Rewrite.php(204): Mage_Core_Controller_Varien_Front->getResponse()
#4 /home/youngag/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(166): Mage_Core_Model_Url_Rewrite->rewrite()
#5 /home/youngag/public_html/magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/youngag/public_html/magento/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /home/youngag/public_html/magento/index.php(93): Mage::run('', 'store')
#8 {main}

Has anyone else encountered this error?  Any insight as to how to solve this issue would be appreciated.


texts: Product Collection Only Getting the Main Website Products not All Store Products

texts:
I am using a basic product collection to get in-stock enabled product but it isn't returning all in-stock enabled products in my store. Please find the code below:

$Products =  Mage::getModel('catalog/product')->getCollection();
$Products->addAttributeToSelect('*');
$Products->addAttributeToFilter('status', 1);
Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($Products);
echo count($Products);

Its showing the count of 1964 records which is present in main website
but total it must show 2003 records which is present including all stores.

I tried with filter $Products->addWebsiteFilter(array(1,2,3,4)); but still it returns the main website product count.

I tried this https://magento.stackexchange.com/questions/67893/product-collection-wont-get-all-productstoo, but not worked.

Also suggest some best query to fetch the collection,so that it not load the server.

Thanks


texts: Difference between Shell and PHP Cron files in 1.9

texts:
The title pretty much sums it up. Is there a difference between the shell file and php file for the Magento cron?

If there is a difference is there a reason to run one instead of the other?


texts: How to set start time and end time for coupon in Shopping Cart Price Rule

texts: Currently, with Magento Shopping cart price rules, we can only set Start Date and End Date. How to set start time and end time along with date? Thank you in advance.


texts:
Actually, I entered the correct details of user name and password in admin panel in localhost. After entered the details, it shows invalid details.

How do I login to the admin panel in localhost.


texts: API url is being GET as document and not XHR

texts:
Currently have a controller with below as the index action.

public function indexAction()
{

     $collection = json_encode(Mage::getModel('frequent/question')->getCollection()->getData());

     $this->getResponse()->clearHeaders()->setHeader('content-type', 'application/json', true);

     $this->getResponse()->setBody($collection);

}

However when I try to get the json data on the request url its not being processed as an XHR request but as a document request. Please see attached image.

thanks


texts: Get configured product from configurable in cart

texts: I need to get the simple product of a configurable product in the cart.  Right now I am getting the configurable product.  Thank you.


texts: I do not want share Shopping Cart in two stores in magento2

texts: I have two different stores 1) General 2) Wholesale, now If customer add product to Cart from General then it should not be show in Wholesale Cart.


texts: Add option to dropdown, backend magento 1.9

texts:
I've been looking for a way to check/update/save a new option to my 'size' dropdown.

    public function lockAttribute($observer) {
    $installer = new Mage_Eav_Model_Entity_Setup('core_setup');
    $installer->startSetup();

    $event = $observer->getEvent();
    $product = $event->getProduct();

    /** @var \Mage_Eav_Model_Entity_Attribute $attribute */
    $size = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', self::SIZE);

    $width = $product->getData('width');
    $height = $product->getData('height');

    $newOptions = array($width . ' cm x ' . $height . ' cm');
    $exitOptions = array();
    $sizes = Mage::getModel('eav/entity_attribute_source_table')
        ->setAttribute($size)
        ->getAllOptions(false);

    foreach ($sizes as $option) {

       if (in_array($option['label'], $newOptions)) {
           array_push($exitOptions, $option['label']);
        }else{
            continue;
        }
    }

    $insertOptions = array_diff($newOptions, $exitOptions);

    if(!empty($insertOptions)) {
        $option['value'] = $size->getId();
        $option['label'] =  $insertOptions;
        //$installer->addAttributeOption($option['label']);
        $size->setOption($option['label']);
        $size->save();
    }

    $product->setData(self::SIZE, $size->getId());
    $installer->endSetup();
}


texts: Magento 1.9 : Create a CSV of product SKU, Quantity and Price

texts:
I'm trying to work out how to create a downloadable CSV file that contains fields for Product SKU, Quantity (should be set to 5 if more than 5 in stock) and Price in Magento 1.x. Price in this instance is in a custom attribute called ChannelPrice and not the Magento attribute Price. This CSV will be produced every 5 minutes or so using a Cron.
I'm not a PHP wizard unfortunately, so I am not sure where to start here - be it via some sort of API, or directly via the database. Any things I need to consider or help will be most gratefully received!
Many thanks in advance.
Andrew


texts: How to get list of orders filtering by payment method

texts:
I would like to get a list of orders which have been made by a specific payment method using the search criteria. Is there any way we can achieve this?

The only thing I've found is this thread: Magento 2: Get orders by payment method, which doesn't use searchCriteria. I would like to understand how to do this type of search/join between tables and models in magento 2.

Thanks


texts: Magento 2 session id cookie - where to find it?

texts:
I have custom php script located inside pub/. It doesn't use Magento objects to limit spent resources because it is called at each page load with ajax call.

Inside that script I need to check if data saved to cookie inside Magento observer is from the same Magento session or not.

In Magento 1 it was easy by using $_COOKIE['frontend']. Each time I saved data to cookie I also saved information about $_COOKIE['frontend']. When I read cookie value I also checked if $_COOKIE['frontend'] is still the same as it was when I saved the cookie information.

Now with Magento 2 there is no cookie with name frontend, I found useful cookies just cookie PHPSESSID, but this is probably not the same as Magento session id. At least with Magento 1 it was different, it could last different time as Magento session id. So how does Magento 2 check Magento session id, is in Magento 2 the same as PHPSESSID?


texts: Magento event to observe shipment creation, not invoice

texts:
I'm trying to send a text message right after shipment was created in admin panel. I'm observing sales_order_shipment_save_after which works fine. The problem is this event fires on invoice creation too.

I couldn't find the right event for observing only shipment creation. Any suggestion?

I'm on 1.9.2.1.

[EDIT]

I listed all events by adding Mage::log in dispatchEvent method in app/Mage.php. These are the ones which seem related (and I didn't try them already):

sales_order_shipment_save_commit_after
controller_action_postdispatch_adminhtml_sales_order_shipment_save
core_copy_fieldset_sales_convert_order_to_shipment

Which one should I use?


texts: Magento2: Filter product collection by product attribute

texts: How to filter product collection by product attribute in magento 2 like we did in magento 1.x using addAttributeToFilter method


texts: 404 page when trying to access a /media subdirectory file in iframe

texts:
I try to load a pdf file into an iframe using JavaScript in a magento page:
My pdf files are stored in /media/subdirectory.

I declared a .htaccess for my subdirectory in order to allow access, and When i go to the url www.mysite.com/media/subdirectory/myfile.pdf, the file is displayed in my browser.

But, when I define this url as my iframe src, my iframe loads the 404 page...
(I checked the src url by copy/paste the src url into the browser, and the url is good)

Any idea why?


texts: how to change category filter position in magento 2 layered navigation?

texts: I have to move category filter after my custom attribute filter but I am not able to how to move it please help me how to change position. I want to move category filter in the last position.


texts: All necessary commands for Using Magento 2 - For beginner

texts:
ALL Basic Commands
I am new in Magento 2 but require I necessary commands including bash commands and git command to working with Linux based system ,


texts: Magento 2.3.4 error while upgrading to Magento 2.4.0

texts:
I upgrade to version 2.3.4 to version 2.4.0 but I have an error. I have searched on google but it is not working.
Problem 1

- magento/magento2-functional-testing-framework 2.4.5 requires php 7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0 -> your PHP version (7.4.9) does not satisfy that requirement.
- magento/magento2-functional-testing-framework 2.4.5 requires php 7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0 -> your PHP version (7.4.9) does not satisfy that requirement.
- Installation request for magento/magento2-functional-testing-framework 2.4.5 -> satisfiable by magento/magento2-functional-testing-framework[2.4.5].


texts: How to install Venia and magento in local environment?

texts: I want to setup venia as storefront and backend as magento how I can do ?Any good guidelines ?


texts: How to achieve magento product media image uploaded in custom module

texts: Is it possible to get the same media image uploader which is in the product image tab in my custom module. Or any idea for uploading multiple images in adminhtml form of magento. I will like to achieve something like the below image. Can anyone please help me on doing this.


texts: Facing strange issue after compilation missing pub directory in all files paths CSS, JS etc

texts:
Magento2 I am facing a strange issue where my Frontend is broken. Missing pub directory in all CSS/JS/Images etc..
http://magento/static/version1621852367/frontend/theme/default/en_US/mage/calendar.css

This should be
http://magento/pub/static/version1621852367/frontend/theme/default/en_US/mage/calendar.css

How to solve this issue?


texts: I'd like to ask how to add one filter to customer admin grid to show only active customers. The column name is is_active. Thank you in advance


texts: Magento2 Uncaught Error: Class 'Magento\\Store\\Model\\StoreManager' not found

texts:
I moved my Magento2.2.5 based website to a new server (its a multisite) and now I am getting this error when trying to go to the website and note sure why

PHP Fatal error:  Uncaught Error: Class 'Magento\\Store\\Model\\StoreManager' not found in /index.php:46

My index file looks like this

switch ($_SERVER['HTTP_HOST']) {
case 'www.abc.de':
case 'abc.de':
    $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'de';
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
    $app = $bootstrap->createApplication('Magento\Framework\App\Http');
    $bootstrap->run($app);
    break;
default:
    Mage::run();
break;
}