texts: Magento 2 How to remove default website checkbox checked while add new product?

texts:
Magento 2.2.5. I have set up a multi website and it is working fine.

My problem is when admin create any new product Product in website field default website selection checkbox is checked by default. so reason for this product is automatically assign to default website.

But i want to remove the default website checkbox checked and give required validation to this fields so admin have a attention to select website scope while create new product.

For more information check below screen-shoot.

Default add new product form

What i want after modification

Edit :

Answer of @Idham Choudry is right for single website because there is only single checkbox for select product in website, but when i use this for multi-website there is more than two checkbox so all the checkbox are required. so ideally & in my case if we select any one checkbox then there is not necessary to select all checkbox. In short all checkbox is not required, if we select any one then validation will be remove.

Try with JavaScript way

Include custom JS using XML in below file

  app/code/Namespace/Modulename/view/adminhtml/layout/catalog_product_new.xml

<head>
    <link src="Namespace_modulename::js/website_validation.js"/>
</head>

My custom JS in below path

  app/code/Namespace/Modulename/view/adminhtml/web/js/website_validation.js

require(['jquery'],function($){
  $('#save-button').click(function(e) {
            e.preventDefault();
            var test = $(".admin__fieldset-product-websites :input").is(":checked");
            console.log(test);
});

Using this way my custom JS is load successfully but i can't give a validation to Product in website checkbox field.

Can anyone help me to solved out this problem.

Any help would be appreciated!


texts: create shopping cart price rules based on store view

texts:
Is there any way we can create shopping cart price rules based on store-views.

discount should apply only for particular store views ?


texts: how to create guest order in Magento-2 using test.php file

texts:
I try to create an order programmatically in magento2 using this code snippet found on webkul.com

Order I want to create for guest customer.while script executing customer creating ... I don't want that
Can any one help me to create orders for guest with out creating customers


texts: How can i get wishlist id of a product using the product

texts:
How can I get the wishlist id of the product, which is an item id of the product?
I have added a configurable product to the wishlist and I want its item id.


texts:
What is the connection between product attribute sets and categories?

Categories have no connection to product attribute sets, and any product can be assigned to any category
Each category is linked to a single product attribute set, and only products from that attribute set are allowed in the category
Each category is linked to a single product attribute set, and only products from that category’s set or any of its parent categories’
Categories can be connected to multiple product attribute sets, and only products from one of those sets are allowed in the category


texts: How to implement a redirect to a custom success page after submitting a form on a custom page (similar functionality like checkout)

texts:
I have a submission form and a controller, with the execute method. At the moment, after sending the form, my page reloads and on top of the page I get an alert that notifies the user about the success or failure of the operation, how can I instead redirect to a custom success page?

The execute method of my controller app/code/Vendor/Module/Controller/Order/Create.php:

    public function execute()
    {
        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();
        $data = $this->getRequest()->getPostValue();
        $sampleIds = explode(',', $data['sample_ids']);
        if (count($sampleIds) >  $this->helper->getMaxCount()) {
            $this->messageManager->addError(__('The count of "samples" exceeds the limit'));
            $data = null;
        }

        if ($data) {
            /** @var \Vendor\Module\Model\Order $model */
            $model = $this->_objectManager->create('Vendor\Module\Model\Order');
            $model->setData($data);
            $model->setStoreId($this->_storeManager->getStore()->getId());

            try {
                $this->objectRepository->save($model);
                $this->messageManager->addSuccess(__('Request was added to processing.'));
                $this->dataPersistor->clear('vendor_sample_order');

                // Send email
                $this->helper->sendEmail($model);

            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\Exception $e) {
                $this->messageManager->addException($e, __('Something went wrong while saving the data.'));
            }
        }
        return $resultRedirect->setRefererOrBaseUrl();
    }


texts:
I wish to reorder programmatically I'm about to start it but not sure from where do I start.

I'm adding products to cart programmatically rest will done by Magento from Cart to Checkout.

So while adding product to cart how can I mark that it's reorder from particular order ID like 2.

Any suggestion? I've checked reoder controller

vendor/magento/module-sales/Controller/AbstractController/Reorder.php

But not getting idea to mark order as reorder.


texts: Magento 1.9 how to show the color attribute in select box on product view

texts:
I am using Magento 1.9  and I wanted to show all the simple product color option on as a drop-down on configuration product how I can do that any idea
for example
Product A simple product with the color red
Product B simple product with the color Blue
Product C configurable product showing blue and red as color option as a select box on front end


texts: Magento Add new Fields In Customer Address?

texts:
I want to add new field Title. This field is a Dropdown and I give value like this.

$attributes = array(
'jobtitle'           => array(
    'label'    => 'Title',
    'backend_type'     => 'varchar',
    'frontend_input'    => 'select',
    'is_user_defined'   => 1,
    'is_system'         => 0,
    'is_visible'        => 1,
    'sort_order'        => 140,
    'is_required'       => 1,
    'multiline_count'   => 0,
    'option'            => array (
        'value' => array(
            'Mr' => array('Mr'),
            'Mrs' => array('Mrs'),
            'Ms' => array('Ms'),
            'Miss' => array('Miss'),
            'Dr' => array('Dr'),
            )
    ),
    'validate_rules'    => array(
        'max_text_length'   => 255,
        'min_text_length'   => 1
    ),
),
);

foreach ($attributes as $attributeCode => $data) {
    $attribute = $eavConfig->getAttribute('customer_address', $attributeCode);
    $attribute->setWebsite($store->getWebsite());
    $attribute->addData($data);
        $usedInForms = array(
            'adminhtml_customer_address',
            'customer_address_edit',
            'customer_register_address'
        );
        $attribute->setData('used_in_forms', $usedInForms);
    $attribute->save();
}

There is a options is my dropdown value. when I see in the admin side, field is added and the dropdown is displayed but this value is not set. I am getting the blank Dropdown. Please help.


texts: I am having an issue with my Magento site and any assistance would be greatly appreciated. I recently migrated my Magento  (1.4.1.1) site from Rackspace to a private server. The site was configured to load image cdn from Rackspace. Since migrating, the images do not load on any page, and all the menu's are missing, most of the website is displaying black. When the site is loading i can see that it is still trying to load the images from Rackspace and the images are still linked to it as well. How can i disable this and load the images from my server. All images are currently on my server as the whole directory was shifted over.


texts: Populate dropdown values programmatically and check for existing ones

texts:
I'm using a piece of code to add dropdown values to a specific attribute. The code I'm using is:

<?php

 require "app/Mage.php";
 umask(0);
 Mage::app();

 $installer = new Mage_Eav_Model_Entity_Setup('core_setup');
 $installer->startSetup();

 $values = array("test4","test5","test6");
 $attrCode = 'myattribute';

 $values = array_map('utf8_encode',$values);
 $iProductEntityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId();
 $aOption = array();
 $aOption['attribute_id'] = $installer->getAttributeId($iProductEntityTypeId, $attrCode);
 for($iCount=0;$iCount<sizeof($values);$iCount++){
  $aOption['value']['option'.$iCount][0] = $values[$iCount];
 }
 $installer->addAttributeOption($aOption);

 $installer->endSetup();

?>

This works perfectly for new values. However I'm going to use an exported CSV with all data to import into the attribute meaning that values that already have been added shouldn't be added anymore. When I run the above script twice, all 3 values are added twice while in fact nothing should be added when run for the second time.

How should I change this script to make this possible?


texts: Magento2 Error: Attribute with attributeCode "X" does not exist

texts:
I have created a new attribute for products and added that to the default attribute set. When I then click to navigate to Products > Catalog so that I can implement the attribute, I got the following error:

  Attribute with attributeCode "X" does not exist.

Any suggestions on how to resolve that?


texts: Cart price not updated on cart page - Magento 2.1.7

texts:
Cart is not getting updated when the product price in the cart is changed from the backend

can you please help!


texts: How to redirect page to cms page ie.(carrer.html) via controller file?

texts:
Mage::getSingleton('core/session')->addSuccess('Your inquiry was submitted and will be responded to as soon as
possible. Thank you for contacting us.');
$this->_redirect('*/*/');
return;


texts: Minify HTML and Magento 2 - Some Resources not minified

texts:
I'm updating from 2.2.3 to 2.2.5 and just testing a few bits however have found in page speed insights that Minify HTML seems to be a slight issue even though it's turned on within Stores -> Configuration -> Advanced -> Developer -> Template Settings -> Minify HTML.

The following resources show as not being minified:

Minifying .../template/authentication-popup.html could save 309B (29% reduction) after compression.
Minifying ..._Checkout/template/minicart/content.html could save 215B (20% reduction) after compression.
Minifying …ento_Ui/templates/modal/modal-slide.html could save 169B (27% reduction) after compression.
Minifying o_Captcha/template/checkout/captcha.html could save 167B (27% reduction) after compression.
Minifying …nto_Ui/templates/modal/modal-custom.html could save 145B (24% reduction) after compression.
Minifying …ento_Ui/templates/modal/modal-popup.html could save 144B (24% reduction) after compression.
Minifying …/en_GB/Magento_Ui/template/messages.html could save 137B (43% reduction) after compression.
Minifying buzzluma/en_GB/mage/gallery/gallery.html could save 135B (24% reduction) after compression.
Minifying …tPurchase/template/instant-purchase.html could save 111B (28% reduction) after compression.
Minifying …agento_Ui/templates/tooltip/tooltip.html could save 102B (37% reduction) after compression.

I know its only a tiny improvement but it's annoying me as to why these are not minified and am wondering if anyone know how to fix or has happened to anyone else?

This does not happen on the live store on 2.2.3 and that optimisation shows as already present.


texts: Unstable memory/mysql usage on 2.3.3, can't find the issue

texts:
This is regarding a Magento 2.3.3 running on Digital Ocean's server 4GB memory droplet, which should be plenty as it is the only thing hosted on there. However, I have observed since upgrade to 2.3.3 from 2.3.0, there is some instability in memory usage which then leads to the site crashing with Varnish cache or http500 error during checkout. The memory limit for Magento is set to 3GB all around.

Below are the memory usage in the last 7 days:

Normally the memory usage should be less than 1GB (not much traffic), however, I have noticed there is a pattern where the memory would slowly build up to about 2GB, then something crashed and it falls back to the normal range and then the cycle repeats.

I have run the htop command, which I find MySQL is using the majority of the memory and the connection time is more than an hour, not sure if this is normal. However, by restarting the MySQL service, the memory would fall back to the normal range, which is about

Not sure exactly how to troubleshot this, so any help is appreciated!


texts: How to secure Magento 2 dev site using .htaccess

texts:
Previously using Magento 1 I have been able to secure dev sites easily using a .htaccess / .htpasswd setup. It's just to keep the site from being viewed before it's ready. However the same setup in Magento 2 seems to have problems.

After entering the password prompt triggered by the .htaccess I can login to the Magento 2 admin but it then shows an error 'Something went wrong' and nothing will work after that. Everything works fine without the .htaccess code in place.

Any suggestions how to avoid this error using .htaccess. I only need to use it to password protect the front end so even a solution to exclude the admin url would work.

This is the code I'm using in the .htaccess file, put right at the end of the file.

AuthUserFile /home/site/public_html/.htpasswd
AuthName "Username and password required"
AuthType Basic
Require valid-user
<Limit GET POST>
  Require valid-user
</Limit>


texts: how to add custom action in manage products and perform that action? in magento

texts: How to add custom action in manage catagories and perform that action? in magento


texts: Magento 2 : How to create simple example of React JS Module?


texts: I am trying to create an offer for some tshirts. So basically I want to sell 5 tshirts for a certain price. The trouble i'm having is that when the items are added to the basket the amount is adding up to the price I want to sell the 5 tshirts for X5, so basically if i want to sell 5 tshirts for £15 its charging £75 as it's adding them all altogether. I've tried the Group and Bundle options, I've made sure the simple products (sizes and colours) are set to £0.00 but no luck, is it possible to do this without a plugin?


texts: Magento 2 - Get country name from country code

texts:
I want to get country name from country code, in Magento 1.9 I use the code like this to get country name:

$countryCollection = Mage::getModel('directory/country_api')->items();
foreach($countryCollection as $key=>$val) {
    $countryCodes[$val['country_id']] = $val['name'];
}

How I can made this code to work for Magento 2?

I get the values from the multiselect attribute with the name country_iso_list, the values of this attribute are AD, AE, AF, AG ...ZW, so they are countries code. I just want to replace the country code with the country name in the frontend. So all I just need is to replace the this part of code:

echo $countryCodes[$val];

in this code

         $data = explode(',',$block->getProduct()->getData('hed_country_iso_list'));
                    foreach($data as $value):
                        $attr = $block->getProduct()->getResource()->getAttribute('country_iso_list');
                        if ($attr->usesSource()):
                                $countries = $attr->getSource()->getOptionText($value);
                                $ccode = explode(', ', $countries);
                        endif;
                    endforeach;
                    if (!empty($countries)):
                             echo "
"./* @escapeNotVerified */ __('This product can be sent to the following countries:')."
";
                             $k=0;
                             echo "
";
                             foreach($ccode as $key=>$val) {
                                    echo $countryCodes[$val];
                                    echo (++$k < sizeof($ccode)) ? ', ' : '';
                             }
                             echo "
";
                    endif;

Thank you


texts: cpanel IP block not working Magento Multistore

texts:
We use cpanel IP blocker function to block some IP's. However we have a Magento 2.2.6 multistore setup with for every store a folder with it's own .htaccess.

Now cpanel only blocks in public_html.

When we try to copy the IP's then that site give a server misconfiguration.
Weird as the . htaccess is exactly the same.

Anybody any solution on an effective way to block visitor IP's on a Magento 2 multistore setup? Thank you.


texts: Export attribute set and the attributes that are assigned to it

texts:
our attribute sets have become messy, things are assigned to them that shouldnt be and some things that should be havent. Is it possible for me to export to CSV the attribute set name and a list of attributes assigned to it? export from magento2
Edit:
I just want to export the attribute set and the attributes assigned to it. for example a clothing store might show.
T-shirts

Colour
Size
Brand
style
pattern

ETC.


texts: Magento 1.9.3.8: Magento Compromise Injection

texts:
Your site is compromised with injected JavaScript. (71)
The malicious code signature(s) has been found on the page.

Please help.


texts:
get thumbnail image in product collection magento 2.3 but base image get
how to get thumbnail image

phtml file

          <?php
            $ProductImageUrl = $block->getUrl('pub/media/catalog').'product'.$product->getImage();
        ?>
        <img src="<?php echo $ProductImageUrl; ?>" width="210" height="210">

Block File

protected $_productCollectionFactory;

public function __construct(
   \Magento\Catalog\Block\Product\Context $context,
   \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
array $data = []
)
{
       $this->_productCollectionFactory = $productCollectionFactory;
       parent::__construct($context, $data);
}

public function getProductCollection()
{
    $porIds=array(1,2,3);
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*');
    $collection->addFieldToFilter('entity_id', array('in' => $porIds));

    return $collection;
}


texts:
I wonder what 'date' type needs in system.xml. I keep getting the error :

system.xml (only the field):

<field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
Start sync from :
</field>

error :

  Exception #0 (Exception): Output format is not specified. Please
  specify "format" key in constructor, or set it using setFormat().

If i add a format :

        <field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
            Start sync from :
            <format>yyyy-MM-dd</format>
        </field>

error :

  Element 'format': This element is not expected.

So what wants it? And how can i add time to it? (i need a epoch time eventually in the DB).

EDIT :

This error comes from :

\Magento\Framework\Data\Form\Element\Date : 150-158

$dateFormat = $this->getDateFormat() ?: $this->getFormat();
        $timeFormat = $this->getTimeFormat();
        if (empty($dateFormat)) {
            throw new \Exception(
                'Output format is not specified. ' .
                'Please specify "format" key in constructor, or set it using setFormat().'
            );
        }


texts:
When I go to my website I receive the following error (I downloaded this error file from the var folder):

  a:5:{i:0;s:88:\"Cannot send headers; headers already sent in
  /home/eyewear/public_html/index.php, line 1\";i:1;s:943:\"#0
  /home/eyewear/public_html/lib/Zend/Controller/Response/Abstract.php(115):
  Zend_Controller_Response_Abstract->canSendHeaders(true)

  #1 /home/eyewear/public_html/app/code/core/Mage/Core/Model/App.php(1246):
  Zend_Controller_Response_Abstract->setHeader(\’Content-Type\’,
  \’text/html; char...\’)

  #2 /home/eyewear/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(80):
  Mage_Core_Model_App->getResponse()

  #3 /home/eyewear/public_html/app/code/core/Mage/Core/Model/Url/Rewrite.php(204):
  Mage_Core_Controller_Varien_Front->getResponse()

  #4 /home/eyewear/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(166):
  Mage_Core_Model_Url_Rewrite->rewrite()

  #5 /home/eyewear/public_html/app/code/core/Mage/Core/Model/App.php(354):
  Mage_Core_Controller_Varien_Front->dispatch()

  #6 /home/eyewear/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)

  #7 /home/eyewear/public_html/index.php(105): Mage::run(\’\’, \’store\’)

  #8 {main}\”;s:3:\"url\”;s:1:\"/\”;s:11:\"script_name\”;s:10:\"/index.php\”;s:4:\"skin\”;s:7:\"default\";}

Before I got this error, I was optimizing the website by minifying CSS and one .js file. This error occurred soon after, so I reverted back to original unminified js and the error still remains.

Any help would be much appreciated.


texts: Redirecting to third party link after clicking on Place Order in magento2.3

texts: I am all new to magento2.I am stuck in from where to start for linking third party url after clicking on PlaceOrder button on checkout.I referred many links,but could not find anything helpful.It would be great if anyone can help me out.Below is the screenshot about my scenario.


texts:
I install for test this small extension with custom field:
https://github.com/jainmegha5395/Add-Custom-Field-in-Magento-2-Registration-Form

In this extension register form require SKYPE ID. I disable this module, but still when I try register new account I get issue: Skype field is required field. But this field is not visible in register form. Any solution?

https://prnt.sc/s1olfu


texts: Magento Product Custom option value setPrice not working programmatically

texts:
I just don't get it. I have installed Magento 1.9.2.2 CE in my site.

But when I run following code as custom script from root directory, it doesn't set product custom option value price to my desired value, $v->setPrice is not working at all, while the other value functions do work, why is that ??

<?php
$magePath = 'app/Mage.php';
require_once $magePath;
Varien_Profiler::enable();
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$product_ids  = array(897);
$productmodel = Mage::getModel('catalog/product');
foreach ($product_ids as $product_id) {
    /**i use this two arrays for collecte value because i uses inside setData of
    current option*/
    $cos     = array();
    $co      = array();
    $product = $productmodel->load($product_id);
    $options = $product->getProductOptionsCollection();
    if (isset($options)) {
        foreach ($options as $o) {
            $title = $o->getTitle();
            $optionType = $o->getType();
            //test type
            if ($optionType == "drop_down" && $title == "New Custom Title") {
                //getting collection of value related to current option
                $values = $o->getValuesCollection();
                $found  = false;
                foreach ($values as $k => $v) {
                    //test existing of value for update
                    if (1 == preg_match("/Ja$/i", $v->getTitle())) {
                        //update and save
                        $v->setTitle("Ja")->setSku("kk45")->setPriceType("fixed")->setSortOrder(2)->setPrice(floatval(120.0000));
                        $v->setOption($o)->save();
                        /**
                        this ligne is important i collecte all value required for normalize save function
                        related to current option
                        */
                        $cos[] = $v->toArray($co);
                    }
                }
            }
            $o->setData("values", $cos)->save();
            //var_dump($cos);
        }
    }
}


texts: Magento 2.2.7 - How to move product title above the product image?

texts: As it says in the title, it would like the product title to move above the  product image.


texts: Magento 2 catalog_product_get_final_price event not working for configurable product

texts:
I have to set the product price to a custom value depends up on the customer. So I have written an event catalog_product_get_final_price and in the observer I have set the custom price for the product. But this is working only for "Simple Product" (visibility both). When I view the configurable product nothing is happened. Even I have write a die() in the observer and it is working when I view the Simple product but not for the configurable product. That means when I view the configurable product, the event is not triggering.

How can I set the simple product's price to a custom value using event? I need this for the "listing" and "view page"


texts: Mageto 2: get custom attribute via rest api

texts: I have a module "extra fee", I did get order info via rest api, but I don't see "extra fee", how can I get it? anyone help me. Thank in advance.


texts: Object Manager argument replacement using nested array in custom module of Magento2

texts:
Alan has written a great tutorial object manager argument replacement through di.xml . Everything works fine for me except nested arrays:

<type name="Pulsestorm\TutorialObjectManagerArguments\Model\Example">
   <arguments>
       <argument name="thearray" xsi:type="array">
          <item name="baz" xsi:type="string">
          <item name="0" xsi:type="string">one</item>
          <item name="1" xsi:type="string">two</item>
          </item>
        </argument>
   </arguments>
</type>

After using above di.xml configuration and running php bin/magento ps:tutorial-object-manager-arguments it says

  There are no commands defined in the "ps" namespace

I'm missing something or the process of nesting arrays is changed now ?


texts:
I need to implement category navigation left sidebar and show only current category and children. I add left_nav.phtml.

<?php
$object = new Mage_Catalog_Block_Navigation();
$actualCategoryId = $object->getCurrentCategory()->getId();
$actualCategory = Mage::getModel('catalog/category')->load($actualCategoryId);
$subCategories = explode(',', $actualCategory->getChildren());

?>

<?php echo $actualCategory->getName(); ?>

    <?php
    foreach ( $subCategories as $subCategoryId ) :
        $category = Mage::getModel('catalog/category')->load($subCategoryId);
        if ( $category->getIsActive() ): ?>

<?php echo 'getURL().'">'.$category->getName().' '; ?>

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

But problem is when I clicked on subcategory, it's show only name, cause subcategory don't has children. But I need to show Parent and children, when I click on it.
Thanks.

ANSWER:

if ($actualCategory->getData('level') != 2) {
    $actualCategory = $actualCategory->getParentCategory();
}
$subCategories = explode(',', $actualCategory->getChildren());

I made it like this, but I open for another answers ;)


texts:
I was taking a look through the var/cache/ folder to see what was contained there and noticed that the following folders were listed, but most of them were empty:

    mage--0
    mage--1
    mage--2
    mage--3
    mage--4
    mage--5
    mage--6
    mage--7
    mage--8
    mage--9
    mage--a
    mage--b
    mage--c
    mage--d
    mage--e
    mage--f

The only files in this cache set was the following:

   var/cache/mage--4/mage---e54_CORE_CACHE_OPTIONS
   var/cache/mage--4/mage---internal-metadatas---e54_CORE_CACHE_OPTIONS
   var/cache/mage--5/mage---e54_CORE_CACHE_INVALIDATE
   var/cache/mage--5/mage---internal-metadatas---e54_CORE_CACHE_INVALIDATE

Magento Install Info:

   Magento Version: CE 1.9.1.0
   OS: Amazon Linux AMI
   PHP 5.3.29
   MySQL 5.5.40
   Running Magento in a Multi-Store setup
   Not Running Redis or Memcache
   Not Running APC, Xcache, eAccelerator

Is this normal? I would assume that the every folder should have something in it other than just 4 files for the whole Magento install.

Could this be some sort of permissions problem with the var/cache folder?

UPDATE

adding the following into app/etc/local.xml inside the  tags populated the var/cache folder with cache items

    <cache>
      <backend></backend>
    </cache>


texts: Getting error when trying to place order

texts:
I have migrate magento 1.9.3.1 to magento 2.2.3. Now I am getting error when trying to place with old customers but its working for new customers.

The error is "No such entity with orderId ="

Anyone familier with the issue?


texts: Magento 2 : Deprecated Functionality: Function ReflectionType::__toString() is deprecated

texts:
When I try to execute bin/Magento setup:install from command line I get an exception as "Deprecated Functionality: Function ReflectionType::__toString() is deprecated".
It gives the same error for my previous Magento instance when I do
bin/magento setup:upgrade.
It was running all good a few days earlier.
Any solution for this?
Note: I am using PHP 7.4 on my machine and installed Magento 2.3
Thank You


texts: Built wsdl does not match wsdl.xml configuration

texts:
I'm working on a site that was recently migrated to a new server. The previous dev mentioned that the Magento API worked for SOAP v2, but I can't verify that is the case so I'm not sure if this issue is specific to my environment. I'm on Magento 1.9.2.4. The error I'm getting when I attempt to parse the wsdl in the client is the following:

WSDLException (at /definitions/binding/operation[7]/operation):
faultCode=INVALID_WSDL: Encountered illegal extension element
'{http://schemas.xmlsoap.org/wsdl/}operation' in the context of a
'javax.wsdl.BindingOperation'. Extension elements must be in a namespace
other than WSDL's

The error is pointing to this location in the wsdl:

<definitions xmlns:typens="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="Magento" targetNamespace="urn:Magento">
 ...
<binding name="Binding" type="typens:PortType">
...
<operation name="storeList">
    <operation soapAction="urn:Action"/>
        <input>
             <body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </input>
        <output>
             <body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
    </operation>

The operation element that is a child of operation should have the soap namespace. All operation elements after this one in this wsdl are also missing the correct namespace. If I look at the wsdl.xml defining this operation, it looks correct as far as I can tell. The following is defined in /app/code/core/Mage/Core/etc/wsdl.xml.

<operation name="storeList">
        <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
        <input>
            <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
        </input>
        <output>
            <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
        </output>
    </operation>

I've reviewed the other wsdl.xml files that exist in my install to see if it's being overridden anywhere, but I don't believe it is. I've cleared the cache in both my client and magento install. I've also tried renaming some of the wsdl.xml files to see if I could tell if one of them was introducing the error, but no luck so far. Any ideas on what could be causing this?


texts: Error message in system.log regarding non well formed numeric value in Gd2.php

texts:
I can't figure out what this error message is in the system.log file. Have open the Gd2.php file looking at lines 492 and 513 and it has something to do with image watermark?

  2015-08-15T20:24:41+00:00 ERR (3): Notice: A non well formed numeric value encountered  in /home/.../magento/lib/Varien/Image/Adapter/Gd2.php on line 492
  2015-08-15T20:24:41+00:00 ERR (3): Notice: A non well formed numeric value encountered  in /home/.../magento/lib/Varien/Image/Adapter/Gd2.php on line 513

p.s. The files is getting very large with the same two lines above! It's about 119116 records.


texts:
I need to update my magento platform from 1.9.3.9 to 1.9.4.1. I know that is possible to do it with Magento connect but I see that it isn't safety.

Are there any other ways to update Magento securely?


texts: After changing to developer mode, website crashes

texts:
magento 2.1.7
php 70

After changing magento to dev mode, website is crashing and getting php error
and can't understand what is that error about.

How can I solve this problem ?


texts: How to get current Website ID in the Admin Panel?

texts:
I working with a custom extension related with multiple websites. I face with an issue, define a script code execute in the Admin Panel by getting Website Id. I expected result website_id like 0 (default ID in store_website table). But when I using this function below it always return 1.

/** @var \Magento\Store\Model\StoreManagerInterface */
$this->_storeManager->getStore()->getWebsiteId(); //return 1, expect 0
$this->_storeManager->getWebsite()->getId(); //return 1

  My Question: Any way to get current website_id in the Admin Panel or define a function run in adminhtml area?

  Note: This function needs to work on both the frontend and backend.

Any help would be appreciated.


texts: After grouping magento collection, the page became blank

texts:
after running the following code:

$newCollection = Mage::getResourceModel('catalog/product_type_configurable_product_collection')
            ->addAttributeToSelect('*')
            ->setFlag('product_children', true);

$newCollection->getSelect()->where('link_table.parent_id', array('in' => $productIds));
$newCollection->getSelect()->group('e.entity_id');

when using foreach or count, the page became blank. Anyone familiar with this case?


texts: How do I specify what image is displayed on social media, like Facebook, for my home page if someone posts my home page URL on there?


texts:
I'm using Magento 1.7.0.2

How can I delete store view by id programmatically?


texts:
I translated the magento. I want to create a language pack and upload to Magento. I do not know how to create packages. I tried to create a pack with "Create Extension Packag" in admin panel.  I completed the all fields.

New Extension->Contents Iset Path: /magento/magento/app/locale/my_file/ Type: Res.Dir.

In "conncect" folder I see only tgz file with xml inside without language pack.


texts: Magento2 : Add sales_order column coupon_code in sales order grid

texts:
In sales_order table we have a column coupon_code. I need to show it in sales order grid.

I have added the column coupon code by overriding sales_order_grid.xml file. The column is being shown. Now I need to show the values of sales_order.coupon_code.

sales_order_grid.xml:

    <?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="coupon_code">
            <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Coupon Code</item>
            </item>
        </argument>
        </column>
    </columns>
</listing>

Module/etc/di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid" type="Magento\Sales\Model\ResourceModel\Grid">
    <arguments>
        <argument name="columns" xsi:type="array">
            <item name="coupon_code" xsi:type="string">sales_order.coupon_code</item>
        </argument>
    </arguments>
</virtualType>
</config>


texts: Default search result listing to categories only, no product to display

texts:
Hi i want to create a custom module for search functionality, where it should search only from the list of categories provided by its custom location attribute,
for example
i have a list of categories as under
Root category: Restaurant

cat1 {location: Delhi}
cat2 {location: Delhi}
cat3 {location: Bangalore}

or so on..

I want to search as Delhi, it should show results as:
cat1, cat2 only,,

and while clicking on cat1 or cat2 it should show all its products.

How can i achieve this?
Many thanks in advance.


texts:
I have created a cart rule in my magento 2 site. It's working on my local environment. but it's not working in live( production) site.

All the target items not able to add to cart after rule activated.
otherwise fine.

I have checked all the configurations in my local site. but not found any issue with live.

Is this a known bug or what can be the issue that I am facing?.

Please help.


texts: catalog:images:resize command stops at 100/2115 images with Error sending QUERY packet

texts:
I just migrated an inventory from one Ecommerce Platform to Magento and while running the image:resize command to re-scale the images for them to display, the command consistently fails when it reaches 100 images, this is 100/2115.

Error Message:

Warning: Error while sending QUERY packet. PID=11883 in /home/[server]/public_html/magento/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 228

Does anyone know if there is a work around for this or solution?


texts: What is the difference between use Magento\... under namespace and __construct(Magento\...)?

texts:
As I'm writing a new module, this question just raise out my curiousity.

Let's take Magento\Customer\Model\Customer as an example, the below codes can perform the same function actually:

Using use Magento\Customer\Model\Customer under namespace

namespace Namespace\Module\Setup;

use Magento\Customer\Model\Customer;

class Abc implements Xyz
{
    protected $customer;

    public function __construct(
        Customer $customer
    ) {
        $this->customer = $customer;
    }
    ...
}

Directly declare inside __construct

namespace Namespace\Module\Setup;

class Abc implements Xyz
{
    protected $customer;

    public function __construct(
        Magento\Customer\Model\Customer $customer
    ) {
        $this->customer = $customer;
    }
    ...
}

My question is: What's the difference between them in terms of backend operations? And which one is more compliance to the best practice?


texts:
Is it possible in magento to send parameter to controller form?

    $x=987654;
    $url=Mage::helper("adminhtml")->getUrl("/label/setlabel");
    $block->addButton('label', array(
                     "label" => "Get Label",
                     "onclick" =>"popWin('$url', 'windowname', 'width=400,height=300,scrollbars=yes')
                                    )
    );"

controller file:

class MyCompany_MyModule_Adminhtml_LabelController
extends Mage_Adminhtml_Controller_Action
{
    public function setlabelAction()
        {
           echo $x;//is this possible?
        }
}

I have this $x parmeter, is it possible somehow to send it to controller and echo it there?


texts: Product alert e-mail with more than one product listed

texts:
Can you guys give me an example of how a product alert e-mail can dispatch more than one product alert in a single e-mail ?

It seems to this point that each product a single customer is subscribed generates one e-mail, one for each product, and so the product collection on stock.phtml foreach loop always has only one product.

Thank you.


texts: Why cli command "$ php shell/logs --clean" didn't remove all logs data?

texts:
2 times a year I clean my Magento logs (CE 1.7.0.2).
I run the process by cli:

$ php shell/log.php --clean

Usually it works fine.
But today after the process ends the php shell/logs.php --status gave me 5GB were still into logs db tables (7GB before the cleanup).

It means only 2GB were removed.

I tried to run the process several additional times but it remains to 5GB...

Is anyone encountered the same problem?

Thank you in advance for any feedback.


texts: Fetch data and arrange sequence in given format

texts:
This is my array:
<?php
$sku = ['HH017','HH018','HH005','HH010','20OZHHTUMBLER',
        '30OZTUMBLER2','HH006','HH-05'];

$sequence = ['HH005','HH010','HH006','20OZHHTUMBLER',...];

print_r(sort($sku, $sequence));

?>

I want to arrange that data of $sku in $sequence format.
I want to show the first 4 numbers from $sku, as mentioned in $sequence and then the remaining numbers will be shown after these 4 numbers.
How can I arrange the sequnce to show my data in this format.
Please advice.


texts:
I am using Magento 2.2.4, I am having too many Disabled/OutofStock products which are useless.

Now the problem I am simply replacing all Disabled/OutofStock products with New Products. I can successfully change everything in every disable product and make it New Product Besides Url Key. When I simply remove everything from Url Key field and Click save than new Url Key Generates successfully as per new product name but when I try to open that product in the browser, it shows 404 page and that product is still showing with old product's URL key. After that I have to go Marketing-->Url Rewrites and change the URL key manually and than the new product's URL key works fine But when ever I change anything in the new product for example Price, Categories etc than the old product's url key reverts back and the new product shows 404 page on new product's url key and only show the page on old product's url key.

I tried everything I able to found on the internet but failed, unfortunately.

Please guide if anyone has the solution for my above issue. I never faced this issue with Magento 1, This seems very weird.

Update: I just found that this issue is coming with the products only imported from Magento 1 and the products created with Magento 2 are working fine with Url Key.

FYI: we imported products from Magento 1 to Magento 2 with UB Data Migration Lite extension

does any one have any idea on this issue?


texts: Any type of email is not working accept forgot password in magento

texts:
In my magento store any type of email is not send/working only if I do change user password from admin then it's send mail to particular user that your password is changed otherwise not any mail being send.

for double check that if php mail function is working or not I have create one mail.php file in my root directory and below is my mail.php code but this is also not working.

<?php
$msg = "test site mail for testing purpose";
$msg = wordwrap($msg,70);
mail("test@gmail.com","My subject",$msg);//test@gmail.com change with my email id
echo 'sent...';
?>

when I run this file siteurl/mail.php it's show me message sent... so it means it's pass through mail function but not sending mail.

above code doesn't send mail what does it mean? does php mail function is not configure with my server? if php mail function is not working then I change user's password from admin how it's send mail to user that you password is changed.

I checked but not able to find so I think let me ask to pro.


texts: Magento Test Automation Framework and Community Edition

texts:
Over the last weekend I made the effort to experiment with Magento's Test Automation Framework (TAF), after a fashion, I got it up and running. However many/most of the bundled core tests do not pass for me, perhaps as many as 70% fail or are skipped.

I tested TAF's master branch from git against a clean install of 1.7.0.2 community, with selenium server 2.31.0, using the firefox profile and with PHP 5.4.

What sort of test pass rate should we expect with TAF and Community Edition, and if you get a higher pass rate what combination of PHP, Selenium and Browser type are you using?


texts: Frontend Grid Filters not Working in magento 2.4.2

texts:
I am getting this after a click on the Apply Filters Button in the frontend grid.
Uncaught TypeError: $(...).notification is not a function
at UiClass.apply (filters.js:203)
at HTMLButtonElement. (knockout.js:4245)
at HTMLButtonElement.dispatch (jquery.js:5232)
at HTMLButtonElement.elemData.handle (jquery.js:4884)
apply @ filters.js:203
(anonymous) @ knockout.js:4245
dispatch @ jquery.js:5232
elemData.handle @ jquery.js:4884
Filters are working fine till the Magento 2.4.1 version but I am testing my module on the 2.4.2 then getting this issue in the console.


texts: How to show the client pop-up when adding a product to the cart?

texts:
There is a delivery of goods in the store on the day of purchase.
but not all products can be delivered on the day of purchase, so there is a checkbox in the admin when adding goods, this product is available for this delivery or not.
How can I track the moment of pressing the button "add product to the basket" so that I could see a popup that this product is available for delivery today, and if it is not available, it shows that the product is not available is not available for delivery today.


texts: Layout type controller does not render scripts

texts:
I have a controller which I want to use to load scripts via ajax however whenever I add scripts to the block within the layout page type all script tags seem to be stripped out.

Is there a way I can load scripts into this controller like this?

  Controller

<?php
namespace Harrigo\GDPR\Controller\Index;

use Magento\Framework\Controller\ResultFactory;

class Tags extends \Magento\Framework\App\Action\Action
{
    protected $resultPageFactory;

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

    /**
     * Execute view action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
        return $resultLayout;
    }
}

  xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <container name="root" label="Root">
        <block class="Magento\Framework\View\Element\Template" name="tagblock" template="Harrigo_GDPR::scriptblock.phtml" />
    </container>
</layout>

  tagblock.phtml

<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('beforebodyend')->toHtml();?>
TEST
<script type="text/javascript">
alert("hello world");
</script>


texts: "Zend_Json Decoding failed: syntax error" when submitting order

texts:
I recently switched from Apache/PHP 5.5 to a new nginx/PHP 7.0.4 server and now I am getting once in a while a "Decoding failed: Syntax error" when customers try to checkout, apparently when they click the submit order button.

I am unable to reproduce the bug on my side, it happens in about 1 of 50 orders, sometimes also in the customer panel, so it seems to affect only logged users or SSL connections. As I am unable to reproduce the behaviour, I don't know what is happening on the frontend, but customers seem to be able to click the button again, because in most cases the order gets through after 2 error messages. The store is currently running Magento 1.9.2.1 and the server Centos7.

I know that the error is generated in Json.php in the function "decode".

Does anyone have an idea what could cause this and how to debug this? One way would be to log all JSONS with an error and then look at the syntax, but maybe someone already has a solution?

Here is an excerpt of the trace:

#0 /usr/share/nginx/html/app/code/core/Mage/Core/Helper/Data.php(659): Zend_Json::decode('', 1)
#1 /usr/share/nginx/html/app/code/core/Mage/Persistent/Model/Session.php(133): Mage_Core_Helper_Data->jsonDecode(NULL)
#2 /usr/share/nginx/html/app/code/core/Mage/Core/Model/Abstract.php(226): Mage_Persistent_Model_Session->_afterLoad()
#3 /usr/share/nginx/html/app/code/core/Mage/Persistent/Model/Session.php(154): Mage_Core_Model_Abstract->load('deleted', 'key')
#4 /usr/share/nginx/html/app/code/core/Mage/Persistent/Helper/Session.php(67): Mage_Persistent_Model_Session->loadByCookieKey()
#5 /usr/share/nginx/html/app/code/core/Mage/Persistent/Helper/Session.php(91): Mage_Persistent_Helper_Session->getSession()
#6 /usr/share/nginx/html/app/code/core/Mage/Persistent/Model/Observer.php(177): Mage_Persistent_Helper_Session->isPersistent()
#7 /usr/share/nginx/html/app/code/core/Mage/Core/Model/App.php(1357): Mage_Persistent_Model_Observer->emulateQuote(Object(Varien_Event_Observer))
#8 /usr/share/nginx/html/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Persistent_Model_Observer), 'emulateQuote', Object(Varien_Event_Observer))
#9 /usr/share/nginx/html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#10 /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Varien/Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
#11 /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Front/Action.php(69): Mage_Core_Controller_Varien_Action->preDispatch()


texts:
I use git and composer in my project.
My flow:
1 Each module has its own git repository.
2 I use composer and install and update modules to my project

update composer.json
composer update <module name>
composer install
./bin/magento setup:upgrade
./bin/magento cache:flush
git commit ...

In Primary repository i store composer.lock and composer.json

When i checkout to other branch and call composer install some modules are deleted. But EAV attributes remain in the database and my Magento 2 store crashes.

How I can correct uninstall modules and his EAV attributes in my flow?


texts: Error related to Framework in Magento 2 SSH CLI

texts:
I'm currently running a Magento 2 (2.2.7) site and I've been getting the following error in the CLI when I enter certain commands (usually to do with enabling/disabling modules).

  The directory
  "/var/www/vhosts/websitename.com/httpdocs/generated/code/Magento/Framework"
  cannot be deleted
  Warning!rmdir(/var/www/vhosts/websitename.com/httpdocs/generated/code/Magento/Framework):
  Directory not empty

I've also had some errors relating to Framework when certain modules are enabled.

I wondered what this error was and how to stop if from happening as I'm sure it's having some impact on my site.


texts: Different default value of an attribute in different attribute sets

texts:
I have attribute sets which I use when adding new products. All products have a weight attribute. I know you can set up a default value which will appear along all attribute sets with that attribute. My question is can I set up different default weight for each attribute set? and if so any tips on how I can achieve it would be highly helpful.

I use Magento Commerce 1.7.0.2


texts: How to pass customized value on cart page for Price?

texts:
I have redirected the form to cart page.

 $this->_redirect('checkout/cart/add', array('product' => 1, 'qty' => 1, 'price' => 500));

Now I want to save price value in table?

product and qty parameters are added in table successfully but not able to change price value.

Can anyone tell what parameter to pass for Price?

I have called below event

<events>
  <checkout_cart_product_add_after> <!-- identifier of the event we want to catch -->
    <observers>
      <checkout_cart_product_add_after_handler> <!-- identifier of the event handler -->
        <type>model</type> <!-- class method call type; valid are model, object and singleton -->
        <class>customiseproductprice/observer</class> <!-- observers class alias -->
        <method>applyCustomPrice</method>  <!-- observer's method to be called -->
        <args></args> <!-- additional arguments passed to observer -->
      </checkout_cart_product_add_after_handler>
    </observers>
  </checkout_cart_product_add_after>
</events>


texts: Display product text attribute on category

texts:
I'm trying to display a product text attribute on category list or view mode, but i can't find a guide to do this.

For example, a Product have this Text attribute: "7 work days to delivery" in the product page, i want to display "7 works days to delivery" on category page in both type of view.

How can i find .phtml file to add this code:

                                            <?php echo $this->__('Shipping Time Delivery') ?>

                                            <img src="<?php echo $this->getSkinUrl('images/tempi-spedizione.png') ?>" alt="tempi-spedizione" />

                                            <?php echo $_product->getData('tempi_spedizione') ?>

I find this code on product page.

There is an example page of the product:
http://www.millstore.it/formevet-antiparassitario-fiprotix-spot-on-cani-giganti-da-40-a-60-kg-4-fiale

And the category is this:
http://www.millstore.it/animali/cani/antiparassitari/pipette-spot-on

I want to display the text attribute under the price or the title of product in both view.


texts: Magento 2 : How to suffle the products by sort on list page?

texts:
I want to snuffle the products on list page but unable to do that. Here is the code.

  app/code/Am/Suffle/etc/frontend/di.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\Config">
        <plugin disabled="false" name="Am_Suffle_Plugin_Magento_Catalog_Model_Config" sortOrder="10" type="Am\Suffle\Plugin\Magento\Catalog\Model\Config"/>
    </type>
    <type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
        <plugin disabled="false" name="Am_Suffle_Magictoolbar_Plugin_Magento_Catalog_Block_Product_ProductList_Toolbar" sortOrder="10" type="Am\Suffle\Plugin\Magento\Catalog\Block\Product\ProductList\Toolbar"/>
    </type>
</config>

  app/code/Am/Suffle/Plugin/Magento/Catalog/Model/Config.php

<?php

namespace Am\Suffle\Plugin\Magento\Catalog\Model;

use Magento\Store\Model\StoreManagerInterface;

class Config
{

    /**
     * Adding custom options and changing labels
     *
     * @param \Magento\Catalog\Model\Config $catalogConfig
     * @param [] $options
     * @return []
     */

    public function afterGetAttributeUsedForSortByArray(
        \Magento\Catalog\Model\Config $subject,
        $options
    ) {

        //New sorting options
        $customOption['ai_magic'] = __(' Magic');

        //Merge default sorting options with custom options
        $options = array_merge($customOption, $options);

        return $options;
    }
}

  app/code/Am/Suffle/Plugin/Magento/Catalog/Block/Product/ProductList/Toolbar.php

<?php
namespace Am\Suffle\Plugin\Magento\Catalog\Block\Product\ProductList;

class Toolbar
{

    /**
     * Plugin
     *
     * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $subject
     * @param \Closure $proceed
     * @param \Magento\Framework\Data\Collection $collection
     * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
     */
    public function aroundSetCollection(
        \Magento\Catalog\Block\Product\ProductList\Toolbar $subject,
        \Closure $proceed,
        $collection
    ) {
        $currentOrder = $subject->getCurrentOrder();
        $result = $proceed($collection);
        $entity_ids =  array();
        foreach($collection as $product){
            $entity_ids[] = $product->getId();
        }

        shuffle($entity_ids);
        if ($currentOrder) {
            if ($currentOrder == 'ai_magic') {
                // $subject->getCollection()->clear();
                $collection->clear();
                // $collection->addAttributeToFilter('entity_id', $entity_ids)
;
                $subject->getCollection()->getSelect()->order(new \Zend_Db_Expr('FIELD(e.entity_id, ' . implode(',', $entity_ids).')'));
            }
        }

        return $subject;
    }

}

Thanks in advance.


texts: How can i translate custom elements in .phtml file according to store view

texts:
I have added a  tag in form.phtml file which shows on view Cart Page.

Custom Cart Information

which effects as

Hence my store is multi-lingual when i change store view to japanese
title SHOPPING CART is getting translated but CUSTOM CART INFORMATION  is printing is in english

I want this CUSTOM CART INFORMATION tag to be translated whenever i change my store view.
Is there any way to do this.


texts:
Long time reader, first time asking...

Not sure if this a magento issue or other.

I use Firebear import/export tool to update the stock qty, approximately 105,000 SKU's.

Worked fantastic for about a month of testing, would complete in about 30 minutes. I was ok with that. After testing and putting the site live things went south fairly quickly.
So before going live import would run in 28 minutes.
First day live 41 minutes 1st update, 2nd, 3rd and 4th update 52 minutes, 5th update 56 minutes, Day two live 6th update 3 hours 25 minutes.
After that things just got worse, eventually the update would just fail.

I've tried breaking the update into pieces just as a band aid but that soon stopped completing as well.

I've tried tweaking the mysql variables and no improvements noticed.

I've also noticed that deleting products with bulk actions if I do more than say 15 products at once it times out and takes awhile to recover.

The way the import tool is working is it seems to update 100 SKUs at a time, which it does quickly.

2020-01-08 10:50:56 : product with sku: COM7996-16 .... 0.00227s
2020-01-08 10:50:57 : Imported: 0 rows
2020-01-08 10:50:57 : Updated: 100 rows
2020-01-08 10:51:05 : The import was successful.
2020-01-08 10:51:06 : product with sku: COM7997-1 .... 0.00782s

So the first 100 gets updated it shows successful, you can see the time between the first 100 and the second 100 is like 9 seconds.  Fast forward to the end of this chunk of update, 25% of the whole thing, 26,400 sku's

2020-01-08 12:13:14 : product with sku: EDE72285 .... 0.00226s
2020-01-08 12:13:14 : Imported: 0 rows
2020-01-08 12:13:14 : Updated: 100 rows
2020-01-08 12:13:34 : The import was successful.
2020-01-08 12:13:35 : product with sku: EDE7256 .... 0.00802s

now 21 seconds has elapsed between each 100 update.

So this update took 83 minutes and it's only 1/4 of the whole thing.

I am at a loss of why the full update of 105,000 sku's used to take 28 minutes now it's taking 12 to 13 times as long.

The only thing that changed from testing to live is the domain name and SSL, files did not move, database is the same, user is the same.

Thank you for any advice.


texts:
i want to display at home page how many user have buyed in the last 24hours at our shop

this is my code but the result can never be.

$dateToday = date('Y-m-d');
$dateyesterday = date("Y-m-d H:m:s", strtotime('-24 hours'));
$collection = Mage::getResourceModel('sales/order_item_collection')->addAttributeToSelect('product_id');
$collection->addAttributeToFilter('created_at', array('gteq' =>$dateyesterday));
$collection->addAttributeToFilter('created_at', array('lteq' => $dateToday)); ?>
<?php if ($collection->count() > 0){?>

In den letzten 24 Stunden schenkten uns
        <?php echo $collection->count();?>
        Kunden ihr Vertrauen und haben bei uns eingekauft.

        Vielen Herzlichen Dank: Frau BlueB

<?php } ?>

thanks for any help

i found now a solution that works

$dateToday = date("Y/m/d");
                    $dateYesterday = date("Y/m/d", strtotime('-24 hours'));

                        $collection = Mage::getModel('sales/order')
                            ->getCollection()
                            ->addAttributeToSelect('*')
                            ->addAttributeToFilter('created_at', array('from'=>$dateYesterday, 'to'=>$dateToday));

a little thing dont work how i want. the script count only the orders from yesterday. but not the orders from today
do anyone hacve a solution for this


texts: I attached a new option to the delivery method, which the customer can choose. The question is, which is the best solution to store the value of that custom field in the form of the transport method.


texts: Magento CE won't let me use PayPal Standard without Express (which requires API credentials)

texts:
The only options showing up in my admin are these:

Payments Advanced (Includes Express Checkout)
Payments Pro (Includes Express Checkout)
Payments Standard (Includes Express Checkout)

I see screenshots from other admins where the (Includes Express Checkout) does not appear after Payments Standard.  I'm using v1.9.1.0 which is currently the latest version of Magento CE.

The issue is that if I select "Payments Standard (Includes Express Checkout)" I'm required to put in API credentials which I don't have (I don't want to upgrade my PayPal account, I just want the most basic payment option).

So, I'm trying to figure out how to get rid of the Express Checkout option, or at the very least find a way to use only Payments Standard.

Any help would be appreciated.  I can't find any other people in the forums having this issue so I'm wondering if it's new to v1.9.1.0 or something.

Please help.

Thank you.


texts: Magento local file location on virtual machine? (Noob alert)

texts:
So after installing XAMPP and running magento on it at the end all was very slow so I decided to install a virtual machine that provides bitnami. https://bitnami.com/stack/magento/virtual-machine

And everything is fast and smooth but now the problem is

In XAMPP the path is: C:\xampp\htdocs\Magento

but what is the path on that virtual machine?


texts:
How to use model popup using ajax?
Can any one help for this.
Here below my code.
How can i apply in this code model popup?
And also post data get in popup. How it possible?

app/code/Vendor/Complany/view/frontend/web/js/example.js

define([
    'jquery',
    'Magento_Ui/js/modal/modal'
], function ($,example,modal) {
        return {
            exampleData:function(ajaxurl){
                $("#example").click(function(e){
                    e.preventDefault();
                    $.ajax({
                        url:ajaxurl,
                        type:'POST',
                        showLoader: true,
                        dataType:'json',
                        success:function(){
                            alert('test');
                        }
                    });
                });
            }
        }
    }
);

app/cpde/Vendor/Company/view/frontend/templates/example/example.phtml

<div id="events_popup" style="display: none;" class="events_popup">

<script>
        require(
            ['jquery','Vendor_Company/js/example'],
            function($,example){
                var ajaxurl = '<?php echo //My URL using block function; ?>';
                example.exampleData(ajaxurl);
            }
        );
</script>


texts: Magento 2 Rest API - How to add custom comment option to Cart Item

texts:
I am using Magento 2 default quoteCartItem Rest APIs to add and update items in cart.
I want to add custom comment option in cart.
Any custom module to send comment using rest API.
I'm new in magento 2, not too familiar with technical keywords. Hope I explained this question properly.


texts: How to auto turn on 'Stock Availability' to 'In Stock' after Quantity is updated from 0 to any number greater?

texts:
I am working on a store with thousands of products. I have noticed that when product Quantity is zero (or manually turned to Zero) the Stock Availability goes 'Out of Stock' however when we update the product Quantity to number greater then zero like 10,15 or 200 the 'Stock Availability' stays 'Out of Stock' unless and until manually changed to 'In Stock' so that the product appears on frontend.
I want the 'Stock Availability' to Auto turned to 'In Stock' as we update the Quantity to number greater then Zero. The Quantity in my case gets its values from the store inventory software we don't change it manually.


texts: Category Menu Missing from homepage after upgrade

texts:
I have upgraded Magento from 1.9.2.0 to 1.9.4.2 through Magento connect manager.
The upgrade process went successfully and everything loaded fine except the Category Menu from the Homepage. The category menu from the home page is missing. I have a Mega Menu module and tried to disable it but no luck. How can I recover the menu?
Connect Manager also could login after upgrade. The login page just refreshes after login and return the below URL
https://magento-url/downloader/index.php?A=
Before I was able to login by changing from https to http but that also no longer works after upgrading.

Jais


texts: How to use modifier in product_action_attribute Form?

texts:
I have created an eav attribute and modified the field inside edit product form, that was easy. But in products mass action (Update attributes) page, the field I have created, by eav Attribute and modified, doesn't apply, It gets the default eav attribute field type etc. How could I apply the modifier for that form?

public function modifyMeta(array $meta)
    {

    $fieldCode = 'material';

    $elementPath = $this->arrayManager->findPath($fieldCode, $meta, null, 'children');
    $containerPath = $this->arrayManager->findPath(static::CONTAINER_PREFIX . $fieldCode, $meta, null, 'children');

    if (!$elementPath) {
        return $meta;
    }

    $meta = $this->arrayManager->merge(
        $containerPath,
        $meta,
        [
            'children' => [
                $fieldCode => [
                    'arguments' => [
                        'data' => [
                            'config' => [
                                'formElement' => 'select',
                                'componentType' => 'field',
                                'component' => 'VENDOR/js/components/select',
                                'filterOptions' => false,
                                'chipsEnabled' => true,
                                'disableLabel' => true,
                                'levelsVisibility' => '0',
                                'elementTmpl' => 'ui/grid/filters/elements/ui-select',
                                'filterOptions' => true,
                                'dataType'  => 'string',
                                'multiple'  => true,
                                'showTree'  => true,
                                'options' => $this->getOptions(),
                                'config' => [
                                    'dataScope' => $fieldCode,
                                ],
                            ],
                        ],
                    ],
                ]
            ]
        ]
    );

    return $meta;
}

That's how I did in edit Product form, but It doesn't apply to mass actions update attributes form.


texts:
I am trying to add a grid to the admin area, but I am receiving a blank content area (although the wrapper is displaying i.e. the _headerText and _addButtonLabel, the grid itself does not display). I have checked an re checked my code (error reporting is on but I get no errors).

I have tried

$mod = Mage::getModel('prefs/prefsformelements')->getData();
var_dump($mod);

and it tells me the data array is is empty (if there was a problem with the model, surely there would be an error returned?) is there something wrong with my code which for block? (I have provided the code for the grid as I would expect to get an empty grid if there is no data being received).

class Ps_Prefs_Adminhtml_AdminformsController
extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
    $this->loadLayout();
    $this->_addContent($this->getLayout()->createBlock('prefs/adminhtml_forms'));
    $this->renderLayout();
}
}

.

class Ps_Prefs_Block_Adminhtml_Forms
extends Mage_Adminhtml_block_Widget_Grid_Container
{
public function _construct()
{
    $this->_controller = 'adminhtml_forms';//path to block
    $this->_blockGroup = 'prefs';//module name
    $this->_headerText = $this->__( 'Form Fields' );
    $this->_addButtonLabel = $this->__( 'New Field' );
    parent::_construct();
}

protected function _prepareLayout()
{
    $this->setChild( 'grid',
            $this->getLayout()->createBlock( $this->_blockGroup . '/' . $this->_controller . '_grid',
            $this->_controller . '.grid' )->setSaveParametersInSession( TRUE ) );
    return parent::_prepareLayout();
}
}

.

class Ps_Prefs_Block_Adminhtml_Forms_Grid
extends Mage_Adminhtml_Block_Widget_Grid
{
public function _construct()
{
    parent::_construct();
    $this->setId('prefs_adminforms_index');
    $this->setDefaultSort('fieldname');
    $this->setDefaultDir('ASC');
    $this->setSaveParametersInSession(TRUE);
    $this->setUseAjax(TRUE);

}

protected function _prepareCollection()
{
    $collection = Mage::getModel('prefs/prefsformelements')->getCollection();
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

protected function _prepareColumns()
{
    $this->addColumn('fieldname', array(
       'header'  =>  $this->__('fieldname'),
       'index'   => 'fieldname'
    ));

    $this->addColumn('idform_elements', array(
        'header'    =>  $this->__('ID'),
        'align'     => 'left',
        'width'     => '50px',
        'index'     => 'idform_elements',//name of db column
    ));

    parent::_prepareColumns();
}

===

EDIT

===

this is the second page that I am trying to a grid to within this module. When I pull the data from the database for grid one I use

$this->_init('prefs/prefs');

but for this model ive been forced to use

$this->_init('ps_prefs/prefsformelements');

without the namespace I get a cant find entity config error, could this have an affect on my current problem?

===

EDIT

===

Still trying to track down the problem and I have found that if I add a simple echo command to Ps_Prefs_Block_Adminhtml_Forms_Grid::_prepareColumns() it is displayed. So would I be right in assuming I have done something wrong with the $this->addColumn commands? or is there something else going on here?


texts: Custom theme - Cannot find code to change text

texts:
I've downloaded a custom theme for my Magento 2 site and would like to know where some files are generally located such as the "Save 60% off sale" text or the "find your next Magento 2 theme". I've managed to change the color of buttons and other variables in the .less files, however, I cannot find everything here. I was wondering if there is any other likely location that they may be. I've also looked a lot on the Magento dashboard options but still no look.

I'm using the hiddentechies bizkick theme.

I appreciate that my question is very vague however any help would be much appreciated.


texts:
I want to get products by coupon code filtered whether by SKU or Mark so I can get theses details:

,order date price before discount , price after discount, name /surname of the client, telephone , country and product name

For order date ,price before discount and price after discount I got them named 'created_at','subtotal' and 'grand_total' from the table sales_flate_order . But I can not find the other items

I have done an essay , may you check it

SELECT
    /*   sales_flat_order.coupon_code AS coupon,*/
    catalog_product_entity_text.value As nomproduit,
    sales_flat_order.created_at   AS datedecommande,
    sales_flat_order.subtotal   AS prixavantremise,
    sales_flat_order.grand_total AS prixapresremise,
    sales_flat_order_address.firstname  AS prenom,
    sales_flat_order_address.lastname As nom,
     sales_flat_order_address.telephone AS telephone,
sales_flat_order_address.country_id AS pays
FROM catalog_product_entity_text
         LEFT JOIN sales_flat_order
                   ON (sales_flat_order.entity_id = catalog_product_entity_text.entity_id)
         LEFT JOIN sales_flat_order_address
                   ON (sales_flat_order.entity_id = sales_flat_order_address.entity_id)
        LEFT JOIN catalog_product_entity
                   ON (catalog_product_entity.entity_id=sales_flat_order_address.entity_id)
  where sales_flat_order.coupon_code = 'wxxxx'
GROUP BY catalog_product_entity.sku;

Thanks in advance


texts: How to get shipping quote on product view page - Magento2?

texts:
I would like to develop one add-on on my product detail page. I want to calculate estimated Shipping rates and Taxes.

Please review the following process which I am trying to achieve:

On product detail page there is an button called "Estimate Shipping Rates".
User clicks on the button and pop up will be opened with three fields Country, State and Zipcode.
User fills those details and submit the form an AJAX request will be sent.
Magento will calculate shipping rates send data in JSON format.

I am successful to achieve till third step. The problem is on 4th step. As per my findings I tried to replicate scenario as it is working on Cart page >> Estimate Shipping and Tax section:

Magento's process will be initiated from vendor/magento/module-quote/etc/webapi.xml file.

<route url="/V1/guest-carts/:cartId/estimate-shipping-methods" method="POST">
    <service class="Magento\Quote\Api\GuestShipmentEstimationInterface" method="estimateByExtendedAddress"/>
    <resources>
        <resource ref="anonymous" />
    </resources>
</route>

It will traverse to couple of interfaces and classes.
At the end it will retrieve from file - vendor/magento/module-quote/Model/GuestCart/GuestShippingMethodManagement.php, this file extends ShipmentEstimationInterface, ShipmentEstimationInterface call function estimateByExtendedAddress($cartId, AddressInterface $address). Which locate in this path vendor/magento/module-quote/Model/GuestCart/GuestShippingMethodManagement.php

I am sure how to call or integrate this process in my custom module.I found an example for magento 1 here. Please suggest way to achieve this task.


texts: Event not triggered when new product added in admin : Magento 2

texts:
Need to generate an observer in magento2 for event when admin add new product, edit product and delete product and write that product details to file...

Having below code in app/code/Weblizar/Helloworld/etc/adminhtml/events.xml

<?xml version='1.0'?>
<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework:Event/etc/events.xsd'>
    <event name='controller_action_catalog_product_save_entity_after'>
        <observer name='Weblizar_Helloworld_Product_Save_After' instance='Weblizar\Helloworld\Observer\productSaveAfter' />
    </event>
</config>

and code in app/code/Weblizar/Helloworld/Observer/productSaveAfter.php

<?php
namespace Weblizar\Helloworld\Observer;

use Magento\Framework\Event\ObserverInterface;

class productSaveAfter implements ObserverInterface
{
    /**
     * @var ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_objectManager = $objectManager;
    }

    /**
     * customer register event handler
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        //Do your stuff here!
        //die('Observer Is called!');

         /* @var $product \Magento\Catalog\Model\Product */
        $product = $observer->getEvent()->getProduct();

        $data = array(
            'product' => $product,
            'value' => 333
        );
        $myfile = fopen("/file_path/Observer.txt", "w");
        fwrite($myfile, print_r($data, true));
        fclose($myfile);
    }
}
?>

Please guide what is not proper. When I set above code event is not generated when new product added in admin.

Many Thanx...Need more help...If i add below code in ProductSaveAfter.php

 namespace Weblizar\Helloworld\Observer;

 use Magento\Framework\Event\ObserverInterface;
 use Magento\Catalog\Api\ProductRepositoryInterface;

  class productSaveAfter implements ObserverInterface
  {
    private $productRepository;

    public function __construct(
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
    ) {
        $this->productRepository = $productRepository;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        //Do your stuff here!
        //die('Observer Is called!');

         /* @var $product \Magento\Catalog\Model\Product */
        $product = $observer->getEvent()->getProduct();
        $newid => $product->getId();
       /* $data = array(
           'product' => $product->getId(),
           'productname' => $product->getName(),
           'value' => 333
        );*/

        $productId=1;
        $product_details = $this->productRepository->getById($productId);
        /*
            Here i want compelete product details that a admin adds by       catalog product=> new product
            and want to write in file
            How can i get product detail of single product (single record) from
            product_details(repository object).
            In above $productId = 1 is set... so it wil get entire row(product detail)
            for id 1.
        */
        /*The $product_details value need to write in text.txt....
        General product details can be fetch like this:
         //var_dump($product_details->getName());
        //var_dump($product_details->getPrice());
        Don't know how to get country, category, description,image,video...

        */
        $myfile = fopen("test.txt", "a+");
        fwrite($myfile, print_r($data, true));
        fclose($myfile);
}

}


texts: Simple way to to Increase the Number of Cross-sell Items in cart from 4 to 12?

texts:
I can't believe that Magento just decides for everyone that they should ONLY have 4 cross-sell items and that's it! I have 12 and I want all 12 of them to appear hopefully without the need to re-write half of the Magento code!

I found this:

How to Increase the Number of Crosssell Items in Cart?

but the article seems to be written for an older version of Magento. I have Magento 1.9.1

Is there really no simple way to do this?


texts: Magento2 - Remove tabs from admin edit forms

texts: For example remove "Related Products, Up-Sells, and Cross-Sells", "Configurations" or "Schedule Design Update" etc in product edit page:


texts: Can Magento 1 coupon codes imported into Magento 2?

texts: I want to import all Magento 1 cart rules in the new Magento 2 platform. can it possible with a migration tool or need to purchase an extension. if purchase please share the name of the extension.


texts: Magento2 sporadic HTTP requests to app/etc/config.php

texts:
While getting my fingers dirty with Magento2 and tracing the webservers error log (using Apache2 on a virtualhost setup on my development box) I see sporadic reports on illegal access to one of the config files: app/etc/config.php:

  [Mon Dec 21 09:14:31.603958 2015] [access_compat:error] [pid 15805] [client 192.168.11.11:11111] AH01797: client denied by server configuration: /home/user/workspace/customer/customer-magento2-shop/shop/www/app/etc/config.php

The according request from access log is:

  192.168.10.25 - - [21/Dec/2015:09:14:31 +0100] "POST /app/etc/config.php HTTP/1.1" 403 496 "-" "-"

I don't have a problem with the error message itself, access to that file should be blocked.

However I ask myself what is triggering these requests and why?

I assume that the HTTP request is done by the shop itself, maybe some kind of check. One indication of that could be the fact that no referrer (sic!) and no user-agent is provided with the request - so not from the standard browser.


texts:
I'm trying to disable the Magento 2 product reviews feature.
I tried Disabling the Module at the Magento 2 admin Stores\Advanced\Advanced\Magento_Review but the reviews tab on each product is still there.
Is there any way to disable it?
I know for sure that we could disable it in Magento 1.


texts: Force customers to update account information

texts:
I am importing a couple of thousand customers into a Magento instance and would like to force my customers to check and update their account information upon logging in for the first time.
Is this possible in native Magento or is there an extension to do this job?


texts: Is there any way to have magento send me an email when I get a message in my admin inbox?  I don't log in often and would like to stay on top of of security patches, etc.


texts:
I am having a big problem on our websites. When I add something to the shopping cart it works good. But if I navigate to say the homepage the product disappears. But when I add another product everything reappears.

UPDATE: When I look at a computer of a collegeau I sometimes see the product I put in my shopping cart on the other computer.


texts: Checkbox is not getting checked using knockout js?

texts:
In payment method, I am adding one more option i.e Store Credit.
Store Credit uses checkbox field.

Test/Payment/view/frontend/web/template/payment/storecredits.html

    <input type="checkbox"
           name="payment[method]"
           class="radio"
           data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>

app/code/Test/Payment/view/frontend/web/js/view/payment/method-renderer/storecredits-method.js

define(
[
    'Magento_Checkout/js/view/payment/default'
],
function (Component) {
    'use strict';
    return Component.extend({
        defaults: {
            template: 'Test_Payment/payment/storecredits'
        },
        getMailingAddress: function () {
            return window.checkoutConfig.payment.checkmo.mailingAddress;
        },
        selectPaymentMethod: function () {
            alert(jQuery("#storecredits").is("checked")); exit;

        },
    });
}
);


texts:
Saving tablerate.csv file for tablerate shipping method returns "An error occurred while saving this configuration: Unable to list current working directory." error.

screenshot -

any help would be greatly appreciated.
Thanks.


texts: Magento2: Remove Category path from product URL is not working

texts:
I have a Magento2 store. I don't want to add the category path into products URLs for that I set “Use Categories Path for Product URLs” as "NO" in magento2 Admin, but It still add the category path to the product URL.

What I already tried.

set “Use Categories Path for Product URLs” as "NO"
Did Reindex
Next I truncate tables url_rewrite and catalog_url_rewrite_product_category
Did reindex
Regenerate products URL

But No results.


texts: Redirect user to either admin or frontend based on login status

texts:
I want to build a custom controller, which works as follows:

if user already have admin session, redirect user to admin page A
if user does not have admin session, redirect user to storefront page B

Is there a way to achieve this?

First I tried building custom logic in adminhtml/controller but it didn't work because for case (2), magento shows admin login UI even before any of my controller logic runs.
Then I tried building custom logic in frontend controller but that won't work for case (1) because it's not possible from frontend to tell admin session ( How to get admin session(user) details on front side in Magento 2? )

Any advise would be appreciated.


texts: How to get value of own attribute in Observer?

texts:
I create an observer to intercept when a product is added to cart. The event that i used is "salesrule_validator_process".

The problem is that i create an eav attribute, but i can't get the value of that attribute related with the observable product. Here is my code:

public function execute( Observer $observer ) {
  $item_attribute = $observer->getItem()->getProduct()->getResource()->getAttribute('discount_elegible')
       ->getData();
}

Which retrieve something like these:

[attribute_id] => 139
    [entity_type_id] => 4
    [attribute_code] => club_discount_elegible
    [attribute_model] => Magento\Catalog\Model\ResourceModel\Eav\Attribute
    [backend_model] => Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend
    [backend_type] => int

And continue...


texts: Create symlink of magento 1 "media" folder

texts: I need to create a symlink of my magento1 "media" folder on another disk of my server because I need to make space on current disk. In which way can I do this?


texts: Event after create a admin user, magento 2

texts:
When i create a admin user in System/AllUser success, i need to get email from this account. Pls help me. I found this event but i dont know how to use.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_postdispatch_adminhtml_permissions_user_save">
        <observer name="my_admin_user_save_after_observer" instance="Magenest\KyAnh\Observer\AddAdminEvents" />
    </event>
</config>

and file AddAdminEvents.php

public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customer = $observer->getEvent()->getUser(); //get value
        print_r($customer->getEmail());

    }

how to get email of account created in here.


texts: Uninstall Magento 2.3 module (including database data) Getting Exceptions Error

texts:
I am trying to uninstall some modules in my Magento 2.3.1, I followed the following steps:

Remove the module Vendor_% from app\etc\config.php
Drop module tables or columns from database, please check app\code\Vendor\Module\Setup folder for more information
Remove the folder app\code\vendor/%
Remove module configuration settings from core_config_data table by running the following query
    DELETE FROM core_config_data WHERE path LIKE 'vendor%';
Remove module from setup_module table by running the following query
    DELETE FROM setup_module WHERE module LIKE 'vendor_%';
SSH Server
    php bin/magento cache:clean
    php bin/magento cache:flush
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy -f
    php bin/magento indexer:reindex
    php bin/magento cache:clean
    php bin/magento cache:flush

The problem is that after doing all this I receive the following error message:

Any idea how I can fix this problem?

UPDATE 1

Now I have the following error, but nothing appears in table eav_attribute, any idea of how to fix it?


texts: Magento 2 : Search query in magento search terms

texts:
What is Search Query On Magento search terms?

How it affect the website ?

I have over 3 million query on my website a lot of them have nothing to do with what I sell ?

Do i need to delete it from my search query ?


texts: Magento 2: How to override product grid link behavior?

texts:
I've added extra columns for my module in the product grid. Within the columns, I'm inserting some of my own icons that contain anchor tag links. When I click on the icons, I'm taken to the product edit page instead of the link I've specified in the icon, which is the default behavior when you click on a row in the product grid.

How do we override the product grid's default links so I can use my own specified links?

I've tried the JavaScript preventDefault() method to no avail, but I'm sure I'm using it correctly.


texts:
I am new to magento I type the following code below and the url was localhost/requestflowtest but i got 404 error even i tried with localhost/magento1.9.0.1/requestflowtest plz could anyone guide me

Practice_ControllerTest.xml

<?xml version="1.0"?> <config> <modules> <Practice_ControllerTest> <active>true</active> <codePool>local</codePool> </Practice_ControllerTest> </modules> </config>

In  app/code/local/Practice/ControllerTest/controllers/IndexController.php

<?php class Practice_ControllerTest_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { echo '
Hello World
'; } }

In /var/www/html/app/code/local/Practice/ControllerTest/etc/config.xml

 <?xml version="1.0"?>
 <config>
     <modules>
         <Practice_ControllerTest>
            <version>0.0.1</version>
         </Practice_ControllerTest>
     </modules>
     <frontend>
         <routers>
             <test_controller>
                 <use>standard</use>
                 <args>
                     <module>Practice_ControllerTest</module>
                     <frontName>requestflowtest</frontName>
                 </args>
             </test_controller>
         </routers>
     </frontend>
 </config>


texts: Creating dropdown menu of brands(manufacturer)

texts: How to create a navigation menu with brand(manufacturer) attribute? Is that possible?


texts:
I have a customer that have a lot of addresses (because I saved his address after each order)

So now I can't save changes I've made from backend because there's to many addresses and it's crashing my website.

How can I remove addresses from phpmyadmin? Knowing that some orders are related to addresses


texts: Lesti FPC, Redis and Magento multistore. How to Clear cache for only one store?

texts:
I have successfully set up Lesti FPC with latest Redis, including session and backend cache, on a Magento 1.9.2 with a few stores. Everything is working really great.

My question is, if possible, how I can clear the cache for a certain store? I have access to redis-cli via ssh, if needed.

The problem is, if I flush the cache in Magento, the cache is cleared for all stores.


texts: Apply Saved Filters to Custom Collection

texts:
I have created a custom grid and collection. Now, I am saving the filters to session for future use using:

$this->setSaveParametersInSession(true);

and retrieving this in another controller. How am I going to apply these parameters upon loading the collection?

I can retrieve the parameters/filters using:

$filters = Mage::getSingleton('adminhtml/session')->getData('custom_block_gridfilter');
$filters = Mage::helper('adminhtml')->prepareFilterString($filters);

Now, how am I going to apply it to?

Mage::getModel('custom/model')->getCollection();

Or perhaps how am I going to retrieve the grid collection with the filters applied to it?


texts: images not imported through csv in magento 1.9

texts:
I tried to import products through import/export, everything gets imported but not image.

What I did was:

Flushed cache and re-index
Media folder provided permissions to 777
Place all images in var/media/import
CSV column contains image,small_image,thumbnail,_media_image,media_gallery  & gallery
with values like /A30412.JPG
Only the placeholder image is shown in the frontend.

Any solutions, based on above scenario. Please suggest.


texts:
I need guidance on the following if this is the scenario.

If Green Beans is configurable product with following Custom Options:

100g is of $10.75,
200g is of $21.50,
250g is of $32.25 and
500g is of $53.75.

And Qty may be 1,2,3,4,5,6,7,8,9,10 up to 20.

So, Now if buyer buy 3 Qty of 500g then the calculation will be $53.75 x 3 = $161.25 and this amount should display on product detail page (when buyer select his/her requirement) and in cart page.

Now need guidance on How I can do this means, where I have setup the weight, qty,  price, formula and calculated figure for display.


texts: In magento1, In some of my orders, the state seems to be corrupted (or I am thinking this way). There are some pending orders which are not getting cancelled or confirmed. They are in pending state only. Attaching a sample screenshot. Can someone give some pointers how to fix this?


texts: How to remove parts of the returned URL using getProductUrl within a rewrite?

texts:
I was wondering if somebody might have a solution for me. Currently I have a working IndexController which brings back the correct sku from a search.

However the problem is that once the rewrite is made it adds the complete URL which does not link to a product page.

    // Check we have a product.
    if ($product->getId()) {
        // Get the URL and redirect to it.
        $url = $product->getProductUrl();
        if ($url) {
            $this->_redirectUrl('/support/'.$url);
            return true;
        }

    }
    // If we didn't find a matching product, load the default.
    $this->loadNoRoute();
    return false;

It then proceeds to load a URL like this:
https://mywebiteurl/support/https://mywebsiteurl/macbook-pro.html

Where I require the URL to load like this:
https://mywebiteurl/support/macbook-pro.html

Wondering if anybody could point me in the right direction as I'm going round in circles. Any help would be appreciated.

Thanks.


texts:
I have a custom form that has a input type file everything works fine except for the data persistor. Its working for text input types where you can just insert the request params in the data persistor. But to be honest I don't know how to even get started on saving the file in the data persistor.

I'm saving the file with the fileUpload class but creating one makes an object that I cannot save in the data persistor.

Does someone have a solution for this? Thanks a lot!


texts:
I have update my Magento version, Now the version is M2.3 and I installed the Authorize.net patch as well.

Now I am facing an issue is that -
1. Order is created in admin but on checkout, customer found the error message.
https://prnt.sc/n96fg2

I have got this email as well: https://prnt.sc/n96i3k
Admin settings: https://prnt.sc/n96jcp
Payment log:

  [2019-04-08 16:19:33] main.DEBUG: array (   'request' =>    array (
      'x_version' => '3.1',
      'x_delim_data' => 'FALSE',
      'x_relay_response' => 'TRUE',
      'x_test_request' => 'FALSE',
      'x_login' => '****',
      'x_method' => 'CC',
      'x_relay_url' => 'http://test.com/authorizenet/directpost_payment/response',
      'x_type' => 'AUTH_CAPTURE',
      'x_fp_sequence' => '243',
      'x_invoice_num' => '000000118',
      'x_amount' => 10.04,
      'x_currency_code' => 'USD',
      'x_tax' => '0.00',
      'x_freight' => '10.00',
      'x_first_name' => 'Test',
      'x_last_name' => 'Last',
      'x_company' => '',
      'x_address' => '3680  Maple Lane',
      'x_city' => 'Huntsville',
      'x_state' => 'South Carolina',
      'x_zip' => '35801',
      'x_country' => 'US',
      'x_phone' => '2565123672',
      'x_fax' => '',
      'x_cust_id' => '',
      'x_customer_ip' => '127.37.239.109',
      'x_customer_tax_id' => '',
      'x_email' => 'sun1@mailinator.com',
      'x_email_customer' => '0',
      'x_merchant_email' => 'test@malinator.com',
      'x_ship_to_first_name' => 'Test',
      'x_ship_to_last_name' => 'Marchant',
      'x_ship_to_company' => '',
      'x_ship_to_address' => '3680  Maple Lane',
      'x_ship_to_city' => 'Huntsville',
      'x_ship_to_state' => 'South Carolina',
      'x_ship_to_zip' => '35801',
      'x_ship_to_country' => 'US',
      'x_po_num' => '',
      'x_fp_timestamp' => 1554740373,
      'x_fp_hash' => '381E8B94801B2015C5F1CF6E7F54F12D92DF0CCE7CA68836503C325E73035F904D89EE19C4BD89372AD9D7FBFBB9C38223065DC6DC45BAD1E2FCDE6652F6523F',
  ), ) [] []

what's the issue.


texts: I have a grid in the Dashboard page to show all unread contacts, it look like 'Last 5 Orders' grid. So now I want to when I click on the row of grid then the popup window will open and show the contact detail. Please give me sugessions? Thanks a lot!!!


texts:
I would like the user to be able to sign up for an account/login from a link on the home page. But they also need to be able to create an account/login during the shopping cart checkout process.

I assume that I won't need to go to the Magento Marketplace to find what I need. It is intuitive that the account system is included in the Magento base install. Am I correct?

How do I integrate the account system on both of those two pages?


texts: The store that was requested wasn't found. Verify the store and try again in orders grid Magento 2

texts:
When I navigating to Admin dashboard -> Sales -> Orders. I am having this issue "The store that was requested wasn't found. Verify the store and try again." I cannot able to see my orders list, I can able to see an order from customers view but not in orders.

There is no logs also related to this problem.

Help me to solve this.


texts:
Invalid method

Exinent_CustomerActivation_Model_Customer::sendNewAccountNotificationEmail

I have use  customer activation extension and  wholesale account form register submitted to  occur this error.


texts: Change customer salutation on success page

texts:
How can I get customer information on success page (template I think is "success.phtml"). I want to set it to something link "Dear Mr. Hans Mustermann ..."

in success.phtml I found this code

$block->getOrderId()

I have tried $block->getCustomerName() or $block->getCustomerGender() but it does not work.


texts: Enable/Disable associated product programmatically

texts:
Is it possible to disable and enable associated products programmatically? Currently i do this for the simple product, but it doesn't seem to be affecting the associated product.

Right now i'm doing something like this:

UPDATE catalog_product_entity_int cpei, catalog_product_entity cpe
            SET cpei.value = '2'
            WHERE cpe.entity_id = cpei.entity_id
            AND cpe.sku = '" . $sku . "'
            AND cpei.attribute_id = 96