texts: Extension loading frontend layout on admin

texts:
I believe this is the case, at least. The problem is with an extension called VehicleFits, (it's also on GitHub).

EDIT: Here's a bit more configuration info. Magento EE 1.13, VAF 1.34.

Originally, the issue was that a _setActiveMenu() call was causing an error with the text:

Fatal error: Call to a member function setActive() on a non-object in /path/to/my/magento/site/app/code/core/Mage/Adminhtml/Controller/Action.php on line 104

Looking at the blocks available at the time of the _setActiveMenu() call, I see that it's all frontend stuff (cart_sidebar, top.search, etc), and the menu block is not available.

Any clues as to where I should look to see why the frontend layout is being loaded, and how I can ensure that the adminhtml layout is loaded instead?

Thanks!

Some more information...

Here's the definition of the menu from the plugin:

 <adminhtml>
    <menu>
        <vaf translate="title" module="adminhtml">
            <title>Vehicles</title>
            <sort_order>25</sort_order>
            <children>
                <vehicleslist translate="title">
                    <title>Vehicle List</title>
                    <sort_order>10</sort_order>
                    <children>
                        <local translate="title">
                            <title>Manage</title>
                            <action>adminhtml/definitions</action>
                        </local>
                    </children>
                </vehicleslist>
                <schema translate="title">
                    <title>Schema</title>
                    <sort_order>200</sort_order>
                    <children>
                        <local translate="title">
                            <title>Manage</title>
                            <action>adminhtml/schema</action>
                        </local>
                    </children>
                </schema>
            </children>
        </vaf>
    </menu>

    <acl>
        <resources>
            <admin>
                <children>
                    <vaf translate="title">
                        <title>Vehicle Fits</title>
                        <sort_order>0</sort_order>
                        <children>
                            <vehicleslist translate="title">
                                <title>Vehicle List</title>
                                <sort_order>10</sort_order>
                                <children>
                                    <local translate="title">
                                        <title>Manage</title>
                                        <action>adminhtml/definitions</action>
                                    </local>
                                </children>
                            </vehicleslist>
                            <schema translate="title">
                                <title>Schema</title>
                                <sort_order>200</sort_order>
                                <children>
                                    <local translate="title">
                                        <title>Manage</title>
                                        <action>adminhtml/schema</action>
                                    </local>
                                </children>
                            </schema>
                        </children>
                   </vaf>
               </children>
           </admin>
       </resources>
    </acl>
</adminhtml>


texts: In Sales Order Grid I want to hide the view Link

texts: when order status is complete . View link should be there if status is pending How to it condition on grid.


texts: Customer login is not working before 24 hours of registration in magento 1.9

texts: I have a Magento 1.9 site and the customer login is not working before 24 hours of registration. Before 24 hours of registration, when I try to login with correct credentials it redirects me to the homepage and if I enter incorrect credentials then it shows incorrect credentials error.


texts: Get total Qty of Items Ordered in Create Order in Magento Admin

texts:
I want to Sum up all the QTY of each all items.

I added another column, actually I just removed the Colspan.

I want all QTY to be summed up.

Then thses are the files that I adjusted

For view

app/design/adminhtml/default/default/template/sales/order/create/items/grid.phtml

And for the Controller

app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/grid.php

This is my code

public function gettotalquantity()
{
    $totalqty = 1;
    $items = $this->getParentBlock()->getItems();
    foreach ($items as $item) {
        $totalqty = $totalqty + $item->getQty();
    }
}

Kindly advice as it returns an error NUll.

Am I going the right way, newbie here in Magento.

Thanks.


texts: how to store a cms page id into the table of my custom module?

texts:
I have a module that allow a user to add/edit an item via the admin panel.
The admin add/edit page contains :

name (text field)
image (file upload)
a store to select (standard select for a store view)
link to a cms page (via a custom select)

I want to show to only the cms pages that belongs to the store the user select. So, my first idea was to reload the page once a store is selected, but I am also unable to do find out a way to do that...

How can I accomplish that?


texts: Magento2 get attribute of product in price template default.phtml

texts:
In Magento 1, I was able to get attibute value with following code:

Mage::getResourceModel('catalog/product')->getAttributeRawValue($_id, 'att_price', $_storeId)

How can I get the value in Magento 2, in tempalte

vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml

I copied it to my theme:

/app/design/frontend/xxx/ddd/Magento_Catalog/templates/product/price/amount/default.phtml

Thanks for the help!
Martin


texts: way to refresh step on getting back to it in checkout

texts: I'm looking for a way to force a refresh of shipping_method step each time I will get back to him. Is it possible to do it without brutal overwriting too many files?


texts: How to change the attribute set of the product via programatically in magento 2

texts:
I have created custom attributes for the attribute sets namely set1 and set2.

I have created the products via script with attribute set name as set1.
The products are saved successfully.

But Now I wish to change the attributeset name from set1 to set2.

Please provide me a solution how do i update the attribute set for the existing products while saving the product via programatically.


texts:
I have created custom module in Magento 2.
In stores->configuration i have created two tabs.
now my requirement is to open second tab when save the first tab configuration. am doing save operation using observer.
kindly let me know that how to redirect from one tab to another tab.


texts: Magento2: Console error - rest/default/V1/carts/mine/estimate-shipping-methods 500 Internal Server Error

texts:
rest/default/V1/carts/mine/estimate-shipping-methods 500 Internal Server Error is Showing on Cart Page.

Shipping method is not showing.


texts:
I implemented this in fresh Magento 2.2.3 instalation:
https://magenticians.com/add-custom-tab-magento-2/

After I make a change in code, like temporarily commented out:

<!-- <block class="Magenticians\Mymodule\Block\Mymodule" name="mymodule" template="Magenticians_Mymodule::mymodule.phtml" /> -->

and ran these in terminal:
php bin/magento setup:upgrade
php bin/magento cache:clean

...new tab is still there (changes didn't applied)...

I also tried activating developer mode:
php bin/magento deploy:mode:set developer

Changes don't apply...

Please help.


texts: How to prevent browser caching for merged files?

texts:
I'm using magento 2.1.2 in production mode with merge/minify/bundle enabled. It works good and the created files like /static/_cache/merged/6c3c8136610cacb3de381ea2afc99190.min.js has header expires setted to 1y. I think this setting is correct.

The problem is when new js changes are loaded. After flush all magento cache the new merged file contains new js changes correclty, but it has the same name as the old file, so the browser, due to the header expires, doesn't reload it and shows the old version.

To see the new changes i have to force the cache to clear with ctrl+F5.

I think a possible solution could be to give different name to merged file when they have different content or adopt a versioning system.

Do you know how to achieve this?


texts: Color Swatches not working on listing page after migration from 1.9.4.4 to 2.3.3

texts:
I have migrated the site from Magento 1.9.4.4 to Magento 2.3.3.
After migration the color swatches on the listing pages are not working for configurable product. Whereas, they are working fine on Product detail page.
https://nimbusweb.me/nimbus-screenshots/2f7f73c091dadb2de8d28f80ecf4ced5
https://nimbusweb.me/nimbus-screenshots/052f5103394864a09b11c4a91676b998
Has anyone come acrossed this problem?


texts: Install Magento 2.2.3 with composer throws

texts:
I am trying install a clean version of Magento 2.2.3 using composer:

 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition

This error is thrown:

 Problem 1
- Installation request for magento/product-community-edition 2.2.3 -> satisfiable by magento/product-community-edition[2.2.3].
- magento/product-community-edition 2.2.3 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.

 To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/7.1/php.ini
 You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

What do I need to do to set up my development environment?

Thank you


texts: Magento admin login Error : invalid form key. please refresh the page

texts:
I am new to magento. I have recently setup my site on magento. Today I was trying to increase the logout time frame for admin session as it used to logout in few seconds. As I tried to save the time to 600 seconds. I received an error on the page. and since then I am not able to log into my magento admin login though the site is working fine.

when ever I try to login into my admin. I receive an error stating

"Invalid form Key. Please refresh the page."

I have tried finding the solution and tried a solution  form a below page to add "return true" in "Session.php" page.

https://github.com/nexcess/magento-turpentine/issues/1077

Though, not of much use as after using this solution only the error message got disappeared but I am still not able to login.

We are using Magento 1.9.2 version


texts: Retrive customer custom attribute value via observer

texts:
I am trying to get custom attribute value of customer in observer, but no results. Can anyone help me:

<frontend>
    <events>
        <customer_customer_authenticated>
            <observers>
                <ssd_customeractivation>
                    <type>singleton</type>
                    <class>SSD_CustomerActivation_Model_Observer</class>
                    <method>customerCustomerAuthenticated</method>
                </ssd_customeractivation>
            </observers>
        </customer_customer_authenticated>
    </events>
</frontend>

Observer.php

 class  SSD_CustomerActivation_Model_Observer
    {
        public function customerCustomerAuthenticated($observer)
        {
            /**
             * @var $customer Mage_Customer_Model_Customer
             */
            $customer = $observer->getEvent()->getModel();
            Mage::log($customer->getData('customer_active'));

        }
    }

Installer:

$installer = $this;
$installer->startSetup();
$setup         = new Mage_Eav_Model_Entity_Setup('core_setup');
$attributeCode = 'customer_active';
$setup->addAttribute('customer', $attributeCode, array(
    'label'        => 'Is Active',
    'type'         => 'int',
    'input'        => 'boolean',
    'visible'      => true,
    'required'     => false,
    'position'     => 530,
));
$eavConfig   = Mage::getSingleton('eav/config');
$attribute   = $eavConfig->getAttribute('customer', 'is_active');
$usedInForms = array(
    'adminhtml_customer',
);
$attribute->setData('used_in_forms', $usedInForms);
$attribute->save();

$installer->endSetup();


texts:
I have a method, that returns me a lowest price product and it works fine:

    /** @var Mage_Catalog_Model_Resource_Product_Collection $productCollection */
    $product = Mage::getModel('catalog/product');
    $productCollection = $product->getCollection();
    $productCollection->addAttributeToSelect('*')
        ->setOrder('price', 'ASC')->load();
    $productCollection->getSelect()->limit(1);
    $product = $productCollection->getFirstItem();
    if ($product->getId() != $productId) {
        return $product;
    } else {
        return false;
    }

But if I add filtering by category, it`s return NULL

    /** @var Mage_Catalog_Model_Category $category */
    $category = Mage::getModel('catalog/category');
    $category->load($categoryId);

    /** @var Mage_Catalog_Model_Resource_Product_Collection $productCollection */
    $product = Mage::getModel('catalog/product');
    $productCollection = $product->getCollection();
    $productCollection->addCategoryFilter($category);
    $productCollection->addAttributeToSelect('*')
        ->setOrder('price', 'ASC')->load();
    $productCollection->getSelect()->limit(1);
    $product = $productCollection->getFirstItem();
    if ($product->getId() != $productId) {
        return $product;
    } else {
        return false;
    }


texts: Magento 2 di:compile error - Directory not empty

texts: How to solve the following error, The directory "C:/xampp/htdocs/mage/generated/code/Magento/Framework" cannot be deleted Warning!rmdir(C:/xampp/htdocs/mage/generated/code/Magento/Framework): Directory not empty


texts: Extending newsletter functionality correctly

texts:
I have previously made a module which would allow a user to sign up for newsletters and decide on which type of newsletters they would receive e.g. promotion, new lines etc. This module was my first one and only one so far.

It took no consideration of the magento database. Basically I created two tables one for the users names and one for the users preferences. customer_entity_varchar was not used as the user did not have to be a member of the site (so no password is needed) to receive a newsletter.

I would like to try and bring my module more into line with the Magento standard now so I have completed the Alan Storm tutorial, to see how the tables can be created in an EAV style and read this article to get a better understanding of how to extend it properly but i'm really confused as to what tables i should add and even if I should use the customer_entity_varchar table to enter a users name who is not a site member as one column requires a password.

AIM OF MODULE

allow users to sign up for newsletters without becoming a site member
allow users to decide on which newsletters they want to receive
allow admin to add new newsletter options on the frontend
allow admin to see what a user is wanting to receive

After downloading the database chart I can see newsletter_subscriber and customer_entity are linked. I have come up with this

(the top two are current magento tables)

and would be interested in

advice on how to improve it
what considerations need to be taken into account when expanding the magento database?
can/should tables always follow the EAV structure when using Magento?


texts:
I am looking for the cart .phtml file so I can edit a img line in there or a static block for my storeviews like in below picture:

I cannot locale the file to edit. Which location do I need to search?

My magento_checkout folder:

My magento-checkout folder:


texts: Product Page - Add Span Class - Price Symbol

texts:
I wish to add a simple span class on the product view page for the price.

$
$99.90


texts: sql files not being run when installing extensions

texts:
The last couple of manual (not through Magento Connect) extensions I've had to install have all had issues with the database tables not being created. These are the extensions which the installation consists of uploading two folders.

The database setup file should be triggered after a page reload so that database tables are created however they aren't. In the backend the extension shows up under System > Configuration > Advanced > Advanced – however, they doesn't show up under core_resources in the database.

Is there a setting somewhere that I've somehow flicked off? Or a way I can repair or track down what is causing these sql setup files from not being triggered?


texts: Send email using SMTP in PHP with PHPMailer

texts:
I tryed this code:

<?php

// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

//Load composer's autoloader
require '/home/username/public_html/vendor/autoload.php';

/**
     * @param type $array
     * @param type $int
     * @return type
     */
    function send_mail_customer($nickname, $email, $total_value)
    {
        $to      = $email;
        $subject = 'DISTRIBUIÇÃO DE LUCRO: ' . $nickname ;

        $from = "myname@mydomain.com";
        $name = $nickname;

        $message = "";
        $message .= "
 DISTRIBUIÇÃO MENSAL DE LUCRO
";
        $message .= "Total ganho: " .$total_value. " euros";
        $message .= "";

        $mail = new PHPMailer(true);                              // Passing `true` enables exceptions
        try {
            //Server settings
            $mail->SMTPDebug = 2;                                 // Enable verbose debug output
            $mail->isSMTP();                                      // Set mailer to use SMTP
            $mail->Host = 'mail.mydomain.com';                   // Specify main and backup SMTP servers
            $mail->SMTPAuth = true;                               // Enable SMTP authentication
            $mail->Username = 'Myname@mydomain.com';          // SMTP username
            $mail->Password = 'Mypassword';                       // SMTP password
            $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
            $mail->Port = 465;                                    // TCP port to connect to 587

            //Recipients
            $mail->setFrom($from, 'MyDomain');
            $mail->addAddress($to, $nickname);     // Add a recipient
            //$mail->addAddress('contact@example.com');               // Name is optional
            $mail->addReplyTo($from, 'MyDomain');
            //$mail->addCC('cc@example.com');
            //$mail->addBCC('bcc@example.com');

            //Attachments
            //$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
            //$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name

            //Content
            $mail->isHTML(true);                                  // Set email format to HTML
            $mail->Subject = $subject;
            $mail->Body    = $message;
            //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

            $mail->send();
            echo 'Message has been sent';
        } catch (Exception $e) {
            echo 'Message could not be sent.';
            echo 'Mailer Error: ' . $mail->ErrorInfo;
        }

    }

    $x="NunoSousa";
    $email="myemail@gmail.com";
    $total_value = 15;
    send_mail_customer($x, $email, $total_value);

?>

And I receive the error:

  2018-09-26 08:06:21 SMTP ERROR: Failed to connect to server: (0) SMTP
  connect() failed.
  https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message
  could not be sent.Mailer Error: SMTP connect() failed.
  https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

I read the wiki but I just can't see what's wrong.
I tried also TLS encryption with the port 587 and the issue still the same.


texts: How to send Product Image in Mail. Magento 2

texts:
I want to send the Product Image in email I'm getting the ID of the product from my custom table now from that ID how can I get the image of the product and send it in the email

public function sendAdminEmail($data)
{
    $mail = $data['email'];

    $product_id = $data['product_id'];      //Product Id for Image

    // $product = $this->_productRepositoryFactory->create()->getById($product_id);
    // $imgg = $product->getData('image');

    $store = $this->_storeManager->getStore()->getId();
    $transport = $this->_transportBuilder->setTemplateIdentifier('makeanoffer_adminhtml_template')
        ->setTemplateOptions(['area' => 'frontend', 'store' => $store])
        ->setTemplateVars(
            [
                'store' => $this->_storeManager->getStore(),
                'name'  => $data['name'],
                // 'email' => $data['email'],
                // 'img'   => $imgg,
                'pnumber' => $data['pnumber'],
                'offeramount' => $data['offeramount'],
                'message' => $data['message'],
                'product_name' => $data['product_name'],
                'product_price' => $data['product_price'],
            ]
        )
        ->setFrom('general')
        // you can config general email address in Store -> Configuration -> General -> Store Email Addresses
        // ->addTo($this->_helper->adminEmail(), 'Veronica')
        ->addTo($mail, 'Veronica')
        ->getTransport();
    $transport->sendMessage();
    return $this;
}

as you guys can see that I'm passing $data which returns data of my custom table in the form of array and my custom email template is

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

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

Email: {{trans "%email" email=$email}}

Phone Number: {{trans "%pnumber" pnumber=$pnumber}}

Offer Amount: {{trans "%offeramount" offeramount=$offeramount}}

Message: {{trans "%message" message=$message}}

Product Name: {{trans "%product_name" product_name=$product_name}}

Product Price: {{trans "%product_price" product_price=$product_price}}

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


texts: table sales_flat_quote_item_option extremely large

texts:
Whilst investigating as to why my magento 1.8.2 store DB was very large (over 7.4gb) I ran a query to see the table sizes and sort in order and I discovered that the sales_flat_quote_item_option table is 6880.58 MB  in size which is most of the DB space.
I do use custom options extensively (every product) but I think this cant be right. My guess is that this data is the custom option data customer have filled in when placing an order but for some reason it is not purged when an order is place or it is due to orders not being completed and the data remains. Would this be correct?

How do I deal with this? Is it ok to truncate this data or delete anything over 30 days for example? Im not sure if this is safe or not so am asking for advice.

Also , is there a way to stop this building up? For example having a cron hat deletes data over a certain age? Again, any advice is appreciated.


texts: Question related to Shipping Adress and registeration

texts:
How can I disable the editing of Shipping address by a customer once he registers on my site?
And it should auto select if am logged in to the site and moves to the checkout


texts: How to convert Date format in magento 2?

texts:
I am getting date from system config using datepicker date format is dd/mm/yy

I want to convert it in to yy/mm/dd H:i:s and able to convert date in format: yy/mm/dd but time is not coming.


texts: does magento load up all blocks and functionality that comes in standard right or left unless explicitly disabled?

texts:
i'm working on a custom theme for our magento based site, we're using latest available enterprise edition 1.13.1.0 and i wanted to find out if we need to explicitly disable functionality via the layout xml files for all blocks that we don't use on our pages?

ie - we don't use any ecommerce and poll functions (shopping cart, checkout, etc.) - and our template is 1 column throughout the entire site. do we need to turn off all shopping cart related functions on the layout pages or do those functions not get processed until they actually are called?

thank you.


texts: Is a shared cart possible in a multi-store with multi-domain [v1.9]?

texts:
I have a single Magento install that hosts several stores, each with their own domain and catalog but under the same main brand.

What my client want's to achieve is a way for all the stores to share a single cart. For example;
I add a product in store A and then add a product in store B.
I could then checkout at either store A or B and pay for both products.

I stumbled across this post where Marius refers to his blog with a solution. link to the blog

From the comments I gather this is working for most but for me things don't seem to change. If I add something to the cart in website A and then visit website B the cart is empty.

Hope you guys have some suggestions, thanks in advance!


texts: Magento 2 : Rewrite Method savePaymentInformationAndPlaceOrder

texts:
I'm trying to create payment module that rewrite method savePaymentInformationAndPlaceOrder in model \Magento\Checkout\Model\PaymentInformationManagement.

Here is snippet code from my own module in file : /app/code/Mine/Directpaym/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">
    <preference for="Magento\Checkout\Model\PaymentInformationManagement" type="Mine\Directpaym\Model\DirectpaymPaymentInformationManagement" />
</config>

Model /app/code/Mine/Directpaym/Model/DirectpaymPaymentInformationManagement.php:

<?php
namespace Mine\Directpaym\Model;

use Magento\Sales\Model\Order;

class DirectpaymPaymentInformationManagement extends \Magento\Checkout\Model\PaymentInformationManagement
{
    /**
     * {@inheritDoc}
     */
    public function savePaymentInformationAndPlaceOrder(
        $cartId,
        \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
        \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
    ) {
            // this method is not  called
            $this->savePaymentInformation($cartId, $paymentMethod, $billingAddress);
            return $this->cartManagement->placeOrder($cartId);
    }
}

I managed to call my own method in Magento 2 community edition, but in Magento 2 Enterprise it won't work.

I already tried compile, flush cache, and static content deploy as well, still won't work.

Is there specific things I miss here?


texts:
Have a good date.
I tried create form in frontend magento2.

<form data-hasrequired="* Required Fields" method="post" id="contact-form" enctype="multipart/form-data" data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>" data-mage-init='{"validation":{}}'>
 ...
     <input type="date" value="04-07-2016" class="type-date" max="19-07-2016" min="19-06-2016" id="okes" name="date-854" aria-invalid="true">
  ...
</form>
    <script>
     require(["jquery", "jquery/ui", "mage/calendar", "mage/validation"],
     function($){
        $("input[type=date]").each(function(){
           var min = $(this).attr('min'),
               max = $(this).attr('max'), minDate = maxDate = "";
               if(typeof min !== typeof undefined && min !== false ){
                 minDate = new Date(min.replace( /(\d{2})[-/](\d{2})[-/](\d+)/, "$2,$1,$3") );
               }
               if(typeof max !== typeof undefined && max !== false ){
                 maxDate = new Date(max.replace( /(\d{2})[-/](\d{2})[-/](\d+)/, "$2,$1,$3") );
               }
               //alert(minDate);
           $(this).calendar({
               showsTime: false,
                buttonText:"<?php echo __('Select Date') ?>",
                minDate: minDate,
                maxDate: maxDate,
                dateFormat: 'mm-dd-yy'
             });
        });
    });
    </script>

when i submit form error in input type=date. It not show error.
Please tell me  this code what's wrong? Many thank.

this image


texts: Magento 2 Disable Shipping Method Based on Total

texts:
I created a custom shipping module and I want to disable it at checkout if the total is less than 100.  I created an Observer called DisablePayment.php:
namespace Vendor\Module\Observer;

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

    class DisablePayment implements ObserverInterface
    {

      public function execute( Observer $observer )
      {
        $result = $observer->getEvent()->getResult();
        $method_instance = $observer->getEvent()->getMethodInstance()->getCode();
        $quote = $observer->getEvent()->getQuote();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $cartObj = $objectManager->get('\Magento\Checkout\Model\Cart');
        $grandTotal = $cartObj->getQuote()->getGrandTotal();

        if($method_instance == 'methodcode')
        {
          $checkoutLimit = 100;
          $total = $grandTotal;

          if($checkoutLimit > $total)
          {
            $result->setData('is_available', false);
          }
        }
      }
    }

I can't get this to work. Do I need to do anything else?
Thanks,
Stan


texts: How can I install and use the Magento Test Framework (without using pear to install phpunit, on Linux Mint 17)

texts:
I am trying to set up some sort of automated application testing for Magento stores using the MTAF package described at these links: Guide, Docs

These guides tell you to install PHPUnit using pear, but this method is disabled as of Dec 2014.

I was finally able to get PHPUnit installed using the commands from this answer and now I can actually check my phpunit --version, which is
PHPUnit 4.6.7 by Sebastian Bergmann and contributors.

The error that I am getting stuck at now is this:
require_once(): Failed opening required 'SymfonyComponents/YAML/sfYaml.php'

This SO Answer says that the test framework is wanting to use the Symfony 1 version of the YAML module. I cannot find this old version anywhere, so it made me wonder if there isn't something I'm overlooking.
I have already tried the Official SVN repo but it just times out.

Edit: I guess there was some issue with their servers yesterday. Today it is working and I was able to install the necessary YAML module using this command:

sudo pear install symfony/YAML

I'm not really sure if this could be considered a "question" anymore, but I feel it is a good reference for others who might want to install the test framework.


texts: how to downgrade from Magento Professional to Magento Community?

texts:
I would like to get some guidance from someone who has already done this before.

My websites (3) run on a multi store set up of Magento Professional 1.1.0.0
Since it's no longer supported, we like to move back to Magento Community

I was told that our version is equivalent to Community 1.6.1.0

I have already set up a testing server with Community 1.6.1.0 on it.

I need some instructions of proceeding from there.

Thank you all.


texts: Add ToolTip with Custom Product Attribute in Magento2

texts: How can I add a ToolTip with a Custom Attribute on Add/Edit Product page in Magento 2?


texts:
I am New to the Magento, I am using the Magento 1.8.
I am stucked while prepare collection function in custom admin module while adding values to the grid.

I have custom table called foundation [not a EAV table] their are 3 fields

|foundation_id | store_id | member_email|
I want to join it with inbuilt EAV table core_store_group

My prepareCollection Function is as follows

$collection = Mage::getModel('core/store_group')->getCollection()
->addFilter('website_id',2)
->addFilter('root_category_id',3);
$collection->getSelect()->join(Mage::getConfig()
->getTablePrefix().'foundation', 'core_store_group.group_id ='.Mage::getConfig()
->getTablePrefix().'foundation.store_id',array('member_email'));
$this->setCollection($collection);
parent::_prepareCollection();
return $this;

I am getting the following Error
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'core_store_group.group_id' in 'on clause'


texts: How do I display a message to users who pick certain shipping zip codes

texts: I need to display something like a warning message or something like that when a user selects certain shipping zip codes. I would be ok with an extension of some sort. Is this possible? How can I do it?


texts: addAttributeToFilter with dropdown values

texts:
Given a dropdown attribute such as color:

color:
   Red
   Green
   Blue

When loading a product collection how can i load the collection based on either red, blue or green values without knowing the actual option ids?

For example:

Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('color', 'Red');

Will not work as i need to know the option id.

This means loading the attribute and getting the options id - which is going to be innefficient for a large number of attributes/options.


texts: Magento 2 How can i Change Sortorder in fornted order_view.xml in order_total

texts:
I want to change sorting order in order_total block in frontend order view page.

can any one tell me how i can change sorting order.


texts: Magento 2 website no longer loads after running compile command

texts:
I'm currently developing a website on a local installation of Magento 2.
I was following advice on how to add a .phtml file to my pages.
Customize Footer in magento2
I followed one solution that advised to run compile command after making the changes.
php bin/magento setup:di:compile
I did this and now my Magento 2 website no longer loads.
I'm not sure what has happened or how to fix it.
In system.log I'm only seeing the following:
[2020-06-25 00:01:47] main.ERROR: Unable to resolve the source file for 'frontend/_view/en_GB/Magento_Theme/favicon.ico' [] []
[2020-06-25 00:01:47] main.CRITICAL: Unable to resolve the source file for 'frontend/_view/en_GB/Magento_Theme/favicon.ico' [] []

Can I undo this command?
Any solution would be hugely appreciated.


texts: Contact Form Not Working or Displaying Confirmation / Failed Message

texts:
I have a contact form on my Contact Us page as follows;

{{block type='core/template' name='contactForm' template='contacts/form.phtml'}}

The form displays correctly but when I click 'Submit' the page simply refreshes, clears the form, and no confirmation/failed message displays.  I also don't receive any email.

In my System > Configuration > Contacts I have Enable Contact Us set to Enabled and a correct email address in Send Emails To.

For the record, I'm using Magento 1.9.1


texts: Magento 2 Module .phtml needed 100% width on Luma

texts:
I have a Module which added a container under the Luma main menu.

Here's the code:

<container name="area1" label="Your New Container" htmlTag="div" htmlClass="your-new-container" before="-">
    <block class="Magento\Framework\View\Element\Template" name="area1.block" template="Vendor_Module::area1.phtml"/>
</container>

My problem is that I need it to go 100% width. See image below:

How can I do this?


texts: Magento2 update cart on qty change event plugin created

texts: My website i have updatecart on qty btn change event call so with ajax how to created a plugin for this.


texts: What does the Magento 2 ko scope: 'minicart_content' reference?

texts:
Does anyone know what scope: 'minicart_content' references? I have a couple of ideas, I have been trying to track this down. I am converting flat HTML templates to Magento. when I  do

The subtotal outputs with a $0.00 inside of the
 tag

I only want the values from the cart.

Within my theme, I am using the file
Magento_Checkout/templates/cart/minicart.phtml

Thank you!


texts:
I need to use some UI components in a custom module, so I included Magento2 Ui base library in my less file in this way:

@base-dir: "../../";
@import '@{base-dir}css/source/lib/_lib';

This works fine as long as my site is in developer mode. But when I push it to an instance in production mode and launch bin/magento setup:static-content:deploy it fails with this error:

File ../../css/source/lib/_lib.less not found. in reseller.less

There are a couple of bug reports that could to be related to this. Does anyone found a solution?

Edit:

As a workaround I manage to have it working by adding a symlink in my css folder to the lib folder and importing from there, so there are no more relative paths. But it is a very dirty way to accomplish what I need. I would like to see some better and cleaner solutions.


texts: Paypal Express Checkout Don't Skip the order review step

texts: I am stuck in the paypal express checkout order review page.I enable the option of skip order review.But still after payment it redirects me to the paypal/express/review/  and then user have to submit order again.


texts: How center a "picture link" in the header

texts:
I am in charge of a Magento website created by a former guy and I followed this tutorial to add a new Picture Link in my header :

https://kamaradski.com/831/how-to-add-a-picture-link-in-magento-header

This worked but despite the "align = center " the "picture link" stay next to the logo of the company. You can see that on the photo below, the red part is the "picture link" the black next to the red one is the company logo.


texts: To add default filter to grid in Magento2?

texts:
I have created one custom module with title & status field attribute in admin grid.

Grid collections in module_test_grid_block.xml

        <arguments>
             <argument name="id" xsi:type="string">testGrid</argument>
             <argument name="dataSource" xsi:type="object">Namespace\Module\Model\ResourceModel\test\Collection</argument>
             <argument name="default_sort" xsi:type="string">id</argument>
             <argument name="default_dir" xsi:type="string">desc</argument>
             <argument name="grid_url" xsi:type="url" path="*/*/grid"><param name="_current">1</param></argument>
         </arguments>

I want to show the data which are enabled. Have any option to add default filter in admin grid collections?

EDIT

    <block class="Namespace\Module\Block\Adminhtml\Test\Grid" name="namespace_module_test.grid" as="grid">
       <arguments>
             <argument name="id" xsi:type="string">testGrid</argument>
             <argument name="dataSource" xsi:type="object">Namespace\Module\Model\ResourceModel\test\Collection</argument>
             <argument name="default_sort" xsi:type="string">id</argument>
             <argument name="default_dir" xsi:type="string">desc</argument>
             <argument name="grid_url" xsi:type="url" path="*/*/grid"><param name="_current">1</param></argument>
             <argument name="default_filter" xsi:type="array">
                  <item name="status" xsi:type="string">1</item>
             </argument>
         </arguments>
        .
        .
      </block>

In Block - Grid.php

    namespace Namespace\Module\Block\Adminhtml\Test;

    use Magento\Backend\Block\Widget\Grid as WidgetGrid;

     class Grid extends WidgetGrid
        {
          public function _construct()
           {
            parent::_construct();
            if ($this->hasData('default_filter')) {
            // print_r($this->getData('default_filter'));die;
            $this->setDefaultFilter($this->getData('default_filter'));
           }
        }
      }

I have followed this link to create admin grid in magento 2

http://www.mage-world.com/blog/grid-and-form-in-magento-2-admin-panel-part-1.html


texts: Magento 2.2.10 change cancelled order to pending

texts: Is it possible to put orders which been clicked in cancel from admin and do a check if the check fails keep it as pending


texts: Error: Setup version for module 'Namespace_module' is not specified

texts:
During module creation I am getting this error (I followed all steps from the tutorial):

  There has been an error processing your request

  Exception printing is disabled by default for security reasons.

  Error log record number: 1889482824

Where the error message is:

  a:4:{i:0;s:57:"Setup version for module 'Namespace_module' is not specified";i:1;s:1410:

The configuration attribute setup_version (<module name="Namespace_Module" setup_version="1.0.0">) already exist... When I'm trying to run upgrade the module becomes disabled.


texts: Newsletter signup at checkout - Magento 2

texts: Is it possible for customers to sign up to a newsletter at checkout natively? I know there are extension out there to add in this functionality but I just can't believe its not native as it seems like a basic thing to want


texts:
I wondered if you could help with the following? I have a static box which calls a .phtml file.

In this file i am trying to get the advertiser_name attribute (which is id 180).

I've managed to put the following code together and it successfully returns "180" but I want it to return the advertiser name, not its number. I can't seem to figure out how I can change this.

Here's the code

   $productType = Mage::registry('current_product')->getId();
echo "Test".$productType."<---";

$product_id = $productType;
$_resource = Mage::getSingleton('catalog/product')->getResource();
$optionValue = $_resource->getAttributeRawValue($product_id, "advertiser_name", Mage::app()->getStore());
echo $optionValue;


texts: Shipment section in admin pannel is not shown

texts:
In admin panel under sales > order  while trying to create shipment , no tabs under the Items to Ship is shown.

After enabling and disabling every module one by one i found that one of custom module is the reason for this.

I am using this custom module to have a custom importer/exporter which is working fine.

So when that custom module is disabled this section is hidden, and when that module is enabled this section is shown.

Can any one suggest which part of a module can do this.

NOTE:Can i post the complete custom module here for reference.or any specific part.


texts: Magento 2: How I can call country and region use UI in checkout?

texts:
I want to show country and region in custom step checkout but its just show input not select.

<item name="region" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
    <item name="config" xsi:type="array">
        <item name="template" xsi:type="string">ui/form/field</item>
        <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
    </item>
    <item name="provider" xsi:type="string">checkoutProvider</item>
    <item name="dataScope" xsi:type="string">billingAddress.region</item>
    <item name="sortOrder" xsi:type="string">6</item>
    <item name="label" xsi:type="string">State/Province</item>
    <item name="visible" xsi:type="boolean">false</item>
</item>
<item name="region_id" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/region</item>
    <item name="config" xsi:type="array">
        <item name="template" xsi:type="string">ui/form/field</item>
        <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
        <item name="customEntry" xsi:type="string">billingAddress.region_id</item>
    </item>
    <item name="sortOrder" xsi:type="string">7</item>
    <item name="label" xsi:type="string">State/Province</item>
    <item name="customEntry" xsi:type="string">region</item>
    <item name="validation" xsi:type="array">
        <item name="required-entry" xsi:type="boolean">true</item>
    </item>
    <!-- Value of region_id field is filtered by the value of county_id attribute -->
    <item name="filterBy" xsi:type="array">
        <item name="target" xsi:type="string"><![CDATA[${ $.provider }:${ $.parentScope }.country_id]]></item>
        <item name="field" xsi:type="string">country_id</item>
    </item>
</item>
<item name="postcode" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
    <item name="config" xsi:type="array">
        <item name="template" xsi:type="string">ui/form/field</item>
        <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
    </item>
    <item name="provider" xsi:type="string">checkoutProvider</item>
    <item name="dataScope" xsi:type="string">billingAddress.postcode</item>
    <item name="label" xsi:type="string">Zip/Postal Code</item>
    <item name="sortOrder" xsi:type="string">8</item>
    <item name="validation" xsi:type="array">
        <item name="required-entry" xsi:type="string">true</item>
    </item>
</item>
<item name="country_id" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/country</item>
    <item name="config" xsi:type="array">
        <item name="template" xsi:type="string">ui/form/field</item>
        <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
        <item name="customEntry" xsi:type="string">billingAddress.country_id</item>
    </item>
    <item name="label" xsi:type="string">Country</item>
    <item name="sortOrder" xsi:type="string">9</item>
    <item name="validation" xsi:type="array">
        <item name="required-entry" xsi:type="boolean">true</item>
    </item>
</item>

Let me know where I am wrong or if anything is missing here.


texts: Magento 2: How to add a product to the admin items ordered grid?

texts:
I am currently developing a module which pre prefills the order items grid automatically when a backend user creates an order from our CRM.

This is done via the observer event:

adminhtml_sales_order_create_process_data_before

Here's the (reduced) code:

public function execute(\Magento\Framework\Event\Observer $observer)
{
    /** @var \Magento\Sales\Model\AdminOrder\Create $orderCreateModel */
    $orderCreateModel = $observer->getData('order_create_model');

    $crmProduct = $this->someFunctionWhichGivesMeTheProductFromTheCrm(1);

    $params = [
        'qty' => $crmProduct->qty,
        'custom_price' => $crmProduct->price
    ];

    $orderCreateModel->addProduct(25, $params);

    /** just tried several methods in desperation - none of them worked... **/

    $orderCreateModel->recollectCart();
    $orderCreateModel->getQuote()->collectTotals();
    $orderCreateModel->recollectCart();
    $orderCreateModel->saveQuote();
}

This is the result:

The products are added but all the totals are not calculated correctly. If I hit the button "Updated Items and Quantities" manually the prices are calculated - but with the result you see below:

Can someone please give me an advice on how to add the products correctly and or collect the totals?


texts: Magento 2 : How to validate confirm password

texts:
Password confirmation not working, code is given below

                                        <?= $block->escapeHtml(__('Password')) ?>

                                            <input type="password" name="password" id="password"
                                                title="<?= $block->escapeHtmlAttr(__('Password')) ?>"
                                                class="input-text"
                                                data-password-min-length="<?= $block->escapeHtmlAttr($block->getMinimumPasswordLength()) ?>"
                                                data-password-min-character-sets="<?= $block->escapeHtmlAttr($block->getRequiredCharacterClassesNumber()) ?>"
                                                data-validate="{required:true, 'validate-customer-password':true}"
                                                autocomplete="off" style="width:550px;">

                                                    <?= $block->escapeHtml(__('Password Strength')) ?>:

                                                        <?= $block->escapeHtml(__('No Password')) ?>

                                        <?= $block->escapeHtml(__('Confirm Password')) ?>

                                            <input type="password" name="password_confirmation" title="<?= $block->escapeHtmlAttr(__('Confirm Password')) ?>" id="password-confirmation" class="input-text" data-validate="{required:true,'validate-customer-password':true, equalTo:'#password'}" autocomplete="off" style="width:550px;">


texts:
On my checkout page I have Post(Online API) shipping method, in which I have many shipping points available, customer can choose whatever he want.

By default the first shipping point is selected, I want to remove this preselected thing and want customer to choose before placing the order.

Any tips??

I tried this https://www.magemonkeys.com/how-to-uncheck-default-shipping-method-magento-2/ but doesnt help


texts: Magento Read data from reviews table and display the json

texts: I want to create a module that read reviews data from database table in magento and display it in the form of json. How can i read data from database in magento?


texts: Top-menu renderer isn't fully configured (urgent help)

texts:
Top-menu renderer isn't fully configured

Ok, i have the same problem that is the post above, but i will explain it better:

I deleted a category in magento, after editing other products i went to the main wabsite to see how the products are shown but, now is showing me this error: "Top-menu renderer isn't fully configured.".
After finding the post that i mentioned before, i created a new root category and just move all the other categories in it, but that didn't work as i thought, then i went to the files of magento and look for Categoriesmenu.php and in the line 25 i edit this: 'id_path' => 'category/2', to this 'id_path' => 'category/709',.
709 because the new root category that i created has 709 as ID and i thought that just declaring it in that line will solve the problem, but it didn't.
I thought that i need to re-index as usual but now i go to re-index (hoping that it will re-index all urls and solve the problem) i'm not able to re-index because it get stuck in "Working" forever.
I ended up looking how to re-index manually but the only way that i found was connecting by SSH to the server, i generate a key in the SSH section of my cPanel,  i tried using PuTTY with the key that i just create but i get an error which is "Network error: Software caused connection abort". With that happening i re-think what i should go back to find a problem with the code, but i ended up with the same problem again.


texts: How to create a mix and match configurable product option?

texts:
I am trying to create a mix and match product but cant work out how to do it! The product is a two piece bikini.

For any one Bikini Set for example there will be in stock:-

Top Size

2 x size 6, 2 x size 8, 2 x size 10, 2 x size 12, etc

Bottom Size

2 x size 6, 2 x size 8, 2 x size 10, 2 x size 12, etc

The customer can select any top size that they want and any bottom size that they want. So they can go Size 12 Top, Size 6 Bottom, when they order that however I need it to delete the stock total of both the top and the bottom. Eventually the shop could be left with 1 size 8 top and 1 size 14 bottom but the whole concept of the store is mix and match.

How is it best to set up this product?


texts: How to truncate magento table using collection?

texts:
I have a custom table. I want to truncate the table using Magento collection without SQL query.

Hope someone will provide some useful information.


texts: Get collection of recently updated products

texts:
I'm trying to create a collection of all products that have been updated in my store the past 24 hours.

The following code seems to be ok to me. Although I have tried numerous altering versions of it, the collection always ends up with 0 products.

$now = date('Y-m-d H:i:s', time());
$last_allowed_update = date('Y-m-d H:i:s', strtotime($now.'- 24 hours') );

$productCollection = Mage::getResourceModel('catalog/product_collection');
$productCollection->addAttributeToSelect('*');
$productCollection->addAttributeToFilter('updated_at', array('from'=>$last_allowed_update));


texts: How does one add a custom filter to the admin customer grid for a custom attribute in Mage2 CE?

texts:
I'm working on a module that helps sync our CRM database with Magento2 as needed. One of the fields that syncs over is the ID of the person in the CRM database. This ID is well known as a 'go-to' field in our company to know which person we are talking about. I need to add a filter to the Magento admin UI customer grid for this custom attribute which I have added programatically.  I've searched, and I have found no solutions.

I'm searching for a solution which I can add to our module programatically. This needs to work in a CI environment, when the module is added to the latest version of Magento, the filter needs to be automatically added to the options in admin. No manual admin configuration explanations please. I don't think that is possible even, but still...

As I ask this question, I'm going to begin reverse engineering how Magento Core creates the filters. Hopefully, by the time I gain some knowledge on how they are built, I'll be able to implement any solution provided with ease.

EDIT:
I've added the following code to my /view/adminhtml/ui_componenet/customer_listing.xml file in my module. The field appears, and so does the filter, but it is not populated with the value inside the customer object.

<?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="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
        <column name="constit_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Constit ID</item>
                    <item name="sortOrder" xsi:type="number">5</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>


texts: Is there any way to delete files from var directory, if the file name matched with a condition. I need to delete log files based upon given date. Please let me know how to achieve this in magento2?


texts: How to convert base price currency to currency currency price in js Magento2?

texts:
I have product item price with 30KWD and i want to display it checkout order summary  with converting currency price

like: selected currency  is USD

so it will be display like $96

how to convert in js


texts:
I am sending ajax request to save data in my custom field in sales_order table , It saves data successfully in case of exit, but not with out exit, any suggestion

//Not working
public function updateCommentSection($order)
{
    if ($order) {
            $orderId =  $order->getEntityId();
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

            $order = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);
            $order->setSkCanceledAt('13');
            $order->save();

        }
}

//Working
public function updateCommentSection($order)
{
    if ($order) {
            $orderId =  $order->getEntityId();
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

            $order = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);
            $order->setSkCanceledAt('13');
            $order->save();
            exit;
        }
}


texts: Magento custom product export profile - need some guidance

texts:
I have to develop module and as a part of it, I have to create custom product export profile but I'm not sure how to reach this step.

I find code like this so I could insert this to data-installer but it must be configurable: must have predefined map but it should let admin changes it, change format (csv/xls)

$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$profile = Mage::getModel('dataflow/profile');
$data = array(

    'name' => "Import affiliate Products Feed",
    'actions_xml' =>   '<action type="dataflow/convert_adapter_io" method="load"><var name="type">file</var>
<var name="path">var/import</var>
<var name="filename"></var>
<var name="format"></var>
</action><action type="dataflow/convert_parser_csv" method="parse"><var name="delimiter"></var>
<var name="enclose"></var>
<var name="fieldnames">true</var>
<var name="store"></var>
<var name="number_of_records">1</var>
<var name="decimal_separator"></var>
<var name="adapter">catalog/convert_adapter_Product</var>
<var name="method">parse</var>
</action>'
);
if (isset($data)) {
   $profile->addData($data);
}
try {
      $profile->save();
} catch (Exception $e){
            die($e->getMessage());
}

Is there any easy way to do this because code I found rather won't work even after rebuilding...

Other idea I have is to create custom link in admin menu and there build  block with whole export settings and leave behind above code and standard magento export system but it will consume large amount of time.

Can someone give me some tips or have any idea how to resolve this?


texts: When exactly to use php bin/magento setup:upgrade

texts:
There are lots of situations in which I change some files in my module in the developer mode but the changes didn't take place in frontend until I run php bin/magento setup:upgrade
Just wanted to know when should we run setup:upgrade command and what's the purpose of it in Magento 2?
It's just so strange for me, because every time I'm doing some changes, they won't be visible until after I run the setup:upgrade command. Even if I delete the var/cache, it's still not visible. Does anyone know any reason for this?


texts: How can I set a maximum order amount for a particular customer?

texts: I'm looking for an extension or customization that allows me to cap a particular customer from ordering over a given amount. For example, a customer cannot checkout if their Order Total is beyond $500.


texts: Product List Grid only displaying 6 products

texts:
I'm currently using Magento 1.13 and am using this to display products from this specific category id:

{{block type="catalog/product_list" name="" category_id="224" template="catalog/product/list.phtml"}}

By default, it is only show 6 products, though I have more than 6 in that category.  Is there a way to remove the limit?  Where is the limit being generated?


texts: Magento logouts after saving product image

texts:
I'm using magento 1.9.1.1 And strange thing happened after installing security patches.
When I try to edit product image, upload works normally. But when I click save product, Magento automatically logouts from admin panel and image won't save. This only happens when I try to change or set product image. Any other information changes without any issues.

Enabled and checked the logs. NGINX, system, exception etc.. Nothing strange shows up.

Anyone had this issue?


texts: Magento 1.9 all admin extension changes not showing up

texts:
app/code/local extension php file changes not reflected in admin panel
templete phtml file working well

DEMO Site-

New Site (Not reflected)-


texts: remove amazon pay icon from shipping step

texts:
How do I remove the "amazon pay" icon from the shipping step?
If i set "Configuration"->"Payment Method"=>"Amazon Pay"=>"Advanced"->"Display Amazon Pay Method" to "No", then it'll be removed, but it also remove the Amazon Pay option in the "Review & Payments" step.
I would like to remove it from the "shipping step" only, how can i achieve that?


texts: Only one image showing on product page - Mage 1.9 CE

texts:
Basically I no matter how many image I add I only seem to display one image on the front end on the product view.

I have tried across templates so imagine this is related to the config in Magento.

Can someone please help! I'm a bit of a noob to Mage!


texts:
Is there a responsive grid system in Magento's new 1.9 RWD theme?

If this new theme is not using a grid system how is the theme responsive?

I've looked through the CSS & SCSS &  I can't find one?


texts: Magento Transaction E-Mails Not Working (admin)

texts:
I'd like to receive e-mails when someone buys something on my Magento website. I've added my e-mail to be 'BCC' in the sales e-mail section but nothing is received. Customers however do receive e-mails after making a purchase. Can anyone point me towards a troubleshoot process for this? I don't understand why customers are receiving the e-mails but as the store admin I am not.

Thank you very much


texts: How to get Best Selling Product Collection in Magento 2 using Object Manager

texts: How can I get "Monthly Best selling product" in Magento 2?


texts: Get Currency Code and Rate inside controller

texts:
How to get Currency Code & Currency Rate inside controller?
So that I can use it in my Ajax response and show it on the frontend.
Update: Now I am getting CurrencySymbol(the symbol is not changing for each store view ) also CurrencyRate is empty by using the below code
<?php
namespace Ishaq\CheckoutTotal\Controller\Index;

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

class Index extends Action
{
    protected $resultPageFactory;
    protected $_storeManager;
    protected $_currency;

    public function __construct(
                                Context $context,
                                PageFactory $resultPageFactory,
                                \Magento\Store\Model\StoreManagerInterface $storeManager,
                                \Magento\Directory\Model\Currency $currency

    )
    {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
        $this->_storeManager = $storeManager;
        $this->_currency = $currency;

    }

    public function execute()
    {
        $post = $this->getRequest()->getPost();
        $data['getBaseCurrencyCode'] = $this->getBaseCurrencyCode();
        $data['getCurrentCurrencyCode'] = $this->getCurrentCurrencyCode();
        $data['getDefaultCurrencyCode'] = $this->getDefaultCurrencyCode();
        $data['getCurrentCurrencySymbol'] = $this->getCurrentCurrencySymbol();
        $data['getCurrentCurrencyRate'] = $this->getCurrentCurrencyRate();
        $data['store_view'] = $this->getStore()->getCurrentCurrency()->getCode();

        var_dump($data); exit;

        $response = $this->resultFactory
            ->create(\Magento\Framework\Controller\ResultFactory::TYPE_JSON)
            ->setData($post);
        return $response;
    }

    /**
     * Get store base currency code
     *
     * @return string
     */
    public function getBaseCurrencyCode()
    {
        return $this->_storeManager->getStore()->getBaseCurrencyCode();
    }

     /**
     * Get current store currency code
     *
     * @return string
     */
    public function getCurrentCurrencyCode()
    {
        return $this->_storeManager->getStore()->getCurrentCurrencyCode();
    }

    /**
     * Get default store currency code
     *
     * @return string
     */
    public function getDefaultCurrencyCode()
    {
        return $this->_storeManager->getStore()->getDefaultCurrencyCode();
    }

    /**
     * Get current currency rate
     *
     * @return float
     */
    public function getCurrentCurrencyRate()
    {
        return $this->_storeManager->getStore()->getCurrentCurrencyRate();
    }

    /**
     * Get currency symbol for current locale and currency code
     *
     * @return string
     */
    public function getCurrentCurrencySymbol()
    {
        return $this->_currency->getCurrencySymbol();
    }

    /* Get Store Name
       *
        * @return \Magento\Sales\Model\StoreManagerInterface
        */
       public function getStore() {
         $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
           $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
           return $storeManager->getStore();
       }

}


texts:
I am working custom payment method in Magento 2. I referred Magento documentation http://devdocs.magento.com/guides/v2.1/payments-integrations/base-integration/payment-option-config.html where
they mentioned using Payment method facade.

But I reviewed core model module-authorizenet where they have not used Payment method facade

They used "Magento\Authorizenet\Model\Directpost" instead of Payment method facade.

I am bit confused with when to use Payment method facade.

So when to use Payment method facade?


texts: email is coming with tags without interpretation

texts:
Guys I have a module for sending e-mail, that when sending the e-mail it is arriving with the html tags, example: br span, that is, it is not being interpreted. I think the code is read by php as a string, and sent as text, but I don't know how to fix it. I need help please. Below is my controller code....
$SenderText = $post['text'];

 $text = "";

        foreach ($senderItens as $itens) {
            $text .= $itens . "
";
        }

        $text .= "";

$sender = [
 'itens' => $text
]

->setTemplateVars([

 'itens' => $text
])

my html template has the following tag

            Products: {{var itens}}


texts: Magento 2 removing shipping methods if product attribute exists

texts: If a customer places an order with a specific product attribute then I need to remove a particular shipping method. Does anyone know which method I would need to write a plugin for to overwrite which methods are available?


texts: Magento2 - Is it possible to run jasmine tests without having a magento installation configured?

texts:
Is it possible to run jasmine tests without having a magento site configured?

As in purely from the project as it is on github (so without database)?

The furthest I’ve got is

  setup:di:compile

but than

  setup:static-content:deploy -f

fails because The default website isn't defined. Set the website and try again.


texts: Apply Discount if a certain payment method selected, Magento 1.7.0.2

texts:
I am trying to set a discount for a certain payment method, discount should be applied only if that method is selected, I already tried to create a cart price rule but the logic of cart price rule is not created for One step checkout.

I have two problems;

1 - Discount is being applied after the order is created, but not shown in Checkout process review page. I can see it in the order confirmation email.

2 - After going to review page if I turn back to cart, I see the discount in cart but this is not logical since the payment method is not defined any more. So discount must be taken back or should not be applied if the payment method is not selected yet, but since it is applied once after the selection of payment method Magento keeps it which is buggy in my case.

Is there any body who did such a thing with using One Step Checkout?

I also tried to control the discount on session quote by coding it myself but it also did not work since there can be other rules applied to that cart. I can not really control which one was applied and what to calculate on which amount.

Any help will be appreciated.

Cheers

PS: I already checked all the articles and code snippets which might be helpful but none of them really solved the buggy parts as I described.


texts: HelloSign iframe display in magento2 custom page

texts:
I need to integrate the HelloSign API in my phtml file. I followed this way but iframe is not coming.

<script type="text/javascript" src="https://s3.amazonaws.com/cdn.hellosign.com/public/js/hellosign-embedded.LATEST.min.js"></script>

<!-- Script code -->
<script type="text/javascript">
    HelloSign.init("0005fc6cf93ce7ce6116778265107d5a");
HelloSign.open({
    url: "https://app.hellosign.com/editor/embeddedSign?signature_id=78caf2a1d01cd39cea2bc1cbb340dac3&token=b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
    uxVersion: 2,
    allowCancel: true,
    debug: true,
    skipDomainVerification: true,
    height: 640
});
</script>

Console error:

{url: "https://app.hellosign.com/editor/embeddedSign?sign…c3&token=b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", uxVersion: 2, allowCancel: true, debug: true, skipDomainVerification: true, …}
allowCancel:true
debug:true
height:640
skipDomainVerification:true
url:"https://app.hellosign.com/editor/embeddedSign?signature_id=78caf2a1d01cd39cea2bc1cbb340dac3&token=b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"
uxVersion:2
__proto__:Object

Can anyone help me.


texts: Magento 2 - What will be the future of Magento Community (Open Source) Edition after acquisition by Adobe

texts:
Recently, I got a news that Magento has been acquired by Adobe for $1.68 billion.

I have also read here, that Adobe likely has plans to change things around the way Magento is made available to developers and businesses.

What will happen after the deal completes in the third quarter of 2018?

Will Magento Community (Open Source) Edition still available for free?

As we all know that none of the products from Adobe are Open Source, will Magento become restricted to the developers like Shopify?

Will there be only Cloud Edition of Magento in the future?

There are many such comments on the web to support my concern:

https://www.linkedin.com/feed/update/urn:li:activity:6404580085004849152


texts: How to add order summary in e-mail templates? Magento 2.3

texts:
I want to edit email templates. For now i can see billing info, payment info and items. I want to add order summary below items but i can't find any variable for this section.

Could you help me with this problem?


texts: System, Reports Menu not show in magento 1.9

texts:
Today i just try to login at my magento website backend and "Report" and "System" menu is not showing, I google it alot to find the solution but i didn't get any thing. I am using magento 1.9.2.3 i didn't update any thing.
yesterday i just disable the module paypaluk and today i just try to activate cloudflare.com with my polorepublica.biz website and disable it.

Please guide me what should i do to recover my menus back.
thanks


texts: How Exporting PhpMyAdmin data in Zipped or gzipped

texts: I am a learner with Magento i have created dummy website on my localhost Xmapp server. Now i want to move it to live server but when i am exporting Mysql data base it is directly downloaded in sql and for importing data in cpanel i required databse in .sql.zipped or .sql.gzipped. Please guide me how can i import my data in cpanel.


texts: Not able to add filters on getItemsCollection in admin order page

texts:
I am implementing a feature, where I need to filter the order item list in order admin page. I have checked and found the list is getting from method getItemsCollection(). But when I am trying to filter the items collection, its not working.
Then for further debugging, I have tried to add filter in getItemsCollection() method of Magento\Sales\Model\Order class.
public function getItemsCollection($filterByTypes = [], $nonChildrenOnly = false)
{
    $collection = $this->_orderItemCollectionFactory->create()->setOrderFilter($this);

    if ($filterByTypes) {
        $collection->filterByTypes($filterByTypes);
    }
    if ($nonChildrenOnly) {
        $collection->filterByParent();
    }

    if ($this->getId()) {
        foreach ($collection as $item) {
            $item->setOrder($this);
            $this->productOption->add($item);
        }
    }
    return $collection;
}

Here when I added filter using below code, it was working if it added before foreach but if I add below code just before return, its not working.
$collection->addFieldToFilter('custom_variable', 'value');

If anyone faced this issue earlier or know why this is happening please let me know.


texts: Magento 1: implementing an autologin link in an email

texts:
So the idea is to have a link in the email that automatically logs a customer in when clicked.

I know it is critical especially in terms of security, here's what I've got for now:

store the generated links in a database table
generate a random hash value stored against the customer id
both hash and customer id in the URL
in case the hash does not match the one stored for the customer_id, reset the hash (to avoid brute forcing)
make the links one use only
set an expiration time on the links

I'm looking for any good recommendation on this approach, and how can I improve it ? What did I miss ? What are the risks left with such approach and how to overcome them ?


texts: How to added placeholder to the newly created custom Address attribute

texts:
I need to add two different fields to the Magento checkout page.
For that, I created one of the attributes using the admin panel
[Stores -> Attributes - > Customer Address Attributes].
In this case, added attribute display in the checkout page. But I need to add a placeholder to it.
I tried to add a placeholder by using LayoutProcessor.php. but it was not a success.
or is there any way to added two text fields.
anyone can provide me with the solution?


texts: Cart becomes empty if Console is opened in Chrome

texts:
We have a strange issue on onepage checkout:

If developer console is opened in our Google chrome browser, When we are come to onepage checkout method, we are getting the error captured in console as below

I investigated this issue and found below,

On app\code\core\Mage\Checkout\controllers\OnepageController.php under protected function _expireAjax() method $this->getOnepage()->getQuote()->hasItems() gives null. Which means that shopping cart is empty.

My question is why does this error occur only when console opened in Google Chrome browser?

Also, sometime I am directing to Shopping cart empty page. It also not happens all the times, sometimes, lets say 4 out of 10 times. As per other posts I adjust all cookie settings from the backend. But no luck,

Edit:

Yes the site is enabled with www.
Cookie settings as below

Cookie Lifetime: 3600
Cookie Path: /
Cookie Domain: .<MY_DOMAIN.COM>
Use HTTP Only: Yes
Cookie Restriction Mode: No

Any suggestion on this?


texts: How to make one cart rule like 1 Shirt =Rs.1900 , 2 Shirt =Rs.3200 , 3 Shirt =Rs.4400 in magento-2.2?

texts:
Original Price of shirt is different like Rs.3199 ,Rs.3799,Rs.2999.
I want to make a cart price rule with following conditions:
If cart having 1 shirt it will give in Rs.1900
1 Shirt =Rs.1900 ,
2 Shirt =Rs.3200 ,
3 Shirt =Rs.4400
How can make it that type of rule in magento-2.2?


texts: Where does Magento keeps it's business logic?

texts:
I went through some articles which describes Magento architecture.

As we all knows Magento uses MVC ( Model-View-Controller ) architecture. It separates the business logic, data access layer and user view.

Some articles say business logic resides in Block classes whereas some other articles say it is in Model classes (With respect to Magento modules). This is bit conflicting information.

Can anyone provide better explanation on this?


texts: Adding a quantity field to list.phtmls layout

texts:
I want to give my customer the possibility to enter the desired quantity on the category page itself.

How can I do that? Adding a quantity field simply puts it on there, but it has no function.


texts: Magento 2 : Exception #0 (InvalidArgumentException): Invalid return type

texts:
Exception

 Exception #0 (InvalidArgumentException): Invalid return type
    #0 /var/www/html/magento/folder/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
    #1 /var/www/html/magento/folder/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
    #2 {main}

  Controller

 protected $wishlist;

    public function __construct(
        \Magento\Wishlist\Model\Wishlist $wishlist,
        \Magento\Framework\App\Request\Http $request,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
    ) {
        $this->wishlist = $wishlist;
        $this->request = $request;
        $this->customerSession = $customerSession;
        $this->resultJsonFactory = $resultJsonFactory;
        parent::__construct($context);
    }

      public function execute()
{
    $productId = $this->request->getPostValue('productId');
    $resultJson = $this->resultJsonFactory->create();
    $resultJson->setData(['productId' => $productId]);
    $customerId = $this->customerSession->getCustomer()->getId();

    $wish = $this->wishlist->loadByCustomerId($customerId);
    $items = $wish->getItemCollection();

    /** @var \Magento\Wishlist\Model\Item $item */
    foreach ($items as $item) {
        if ($item->getProductId() == $productId) {
            $item->delete();
            $wish->save();
        }
    }
}
}

  Ajax

  var pdtId = $(this).attr('data-pdtId');
                $.ajax({
                    type: "POST",
                    url: customRemoveurl,
                    data: {
                        productId: pdtId,
                    },
                    success: function(response) {
                        console.log(response);
                    },
                    error: function(error) {
                        // console.log(error);
                    }
                });


texts:
i use this code to assign a image to a drop product attribute named stock_status (a dropdown att):

<?php $_stockStatus = $_product->getAttributeText('stock_status'); ?><img src="/media/atticons/<?php echo $_stockStatus; ?>.png">

every thing is allright .but in product pages which are not connected to this attribute or do not have any value of this attribute, a broken image with this location address will shown: mysite.com/media/atticons/.png.
how to remove this image from product pages which are not connected to stock_status attribute?


texts: how to add product to cart in magento 2 using custom controller?

texts:
I have tried the following controller file to add product to cart in my custom extension.
<?php

namespace MS\Recommendeditems\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $productRepository;

    protected $cart;

    public function __construct(
        \Magento\Catalog\Model\ProductRepository $productRepository,
        \Magento\Checkout\Model\Cart $cart
        ) {
        $this->productRepository = $productRepository;
        $this->cart = $cart;
    }
    public function execute()
    {
        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();

        $params = $this->getRequest()->getParams();
        $options = $params['options'];
        $superAttribute = $params['super_attribute'];
        $product = $this->productRepository->getById($params['product']);
        $paramater = array('product' => $params['product'],
                          'qty' => $params['qty'],
                          'options' => $options,
                          'super_attribute' => $superAttribute
                );
        $this->cart->addProduct($product, $request);
        $this->cart->save();
        $this->_view->renderLayout();
    }
}

but this code is not working and it shows the blank page.
Please help me to fix this issue.
Thanks


texts:
I created custom fee based on following link.

(Please look at my module at : https://github.com/sivajik34/Delivery-Signature-Magento2)

how to add fee to order totals in magento2

Everything is working fine.but in order view page I'm getting following issue.

i think issue with following function

 /**
     * Initialize all order totals relates with tax
     *
     * @return \Magento\Tax\Block\Sales\Order\Tax
     */
    public function initTotals()
    {

        $parent = $this->getParentBlock();
        $this->_order = $parent->getOrder();
        $this->_source = $parent->getSource();

        $store = $this->getStore();

        $fee = new \Magento\Framework\DataObject(
            [
                'code' => 'fee',
                'strong' => false,
                //'value' => 1090,
                'value' => $this->_source->getFee(),
                'label' => __('Fee'),
            ]
        );

        $parent->addTotal($fee, 'fee');
        // $this->_addTax('grand_total');
        $parent->addTotal($fee, 'fee');

        return $this;
    }

update:
   InstallData.php

<?php

namespace Kensium\DeliverySign\Setup;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Sales\Setup\SalesSetupFactory;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * Sales setup factory
     *
     * @var SalesSetupFactory
     */
    protected $salesSetupFactory;

    public function __construct(
        SalesSetupFactory $salesSetupFactory
    ) {
        $this->salesSetupFactory = $salesSetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {

        /** @var \Magento\Sales\Setup\SalesSetup $salesSetup */
        $salesSetup = $this->salesSetupFactory->create(['setup' => $setup]);
        $options = ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL, 'required' => false];
        $salesSetup->addAttribute('order', 'fee', $options);
        $salesSetup->addAttribute('order', 'base_fee', $options);

    }
}

fieldset.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
    <scope id="global">
        <fieldset id="sales_convert_quote_address">
            <field name="fee">
                <aspect name="to_order" />
            </field>
            <field name="base_fee">
                <aspect name="to_order" />
            </field>
            </fieldset>
        </scope>
    </config>

Order fields added in sales_order table.but still values are not saved.


texts: How to export file after use XSLT to transfer to data?

texts:
I tried to export. But it's not working?

I checked https://firebearstudio.com/blog/magento-2-import-xslt-transformation-how-to-import-any-xml-to-magento-2.html but not succeded.


texts: Why some options are missing in new product

texts:
I am using Magento 1.7 and problem is this I have already some product in Magento admin when I edit any product then I find all options in inventory section but when I create new product then I couldn't find some options please see attached screenshots

This is following screenshot of product edit


texts: Magento2 retrieve custom customer attribute

texts:
i'm working on a 2.1.9 magento2 CE installation,

i've added a custom attribute to the customer, everything it's working OK, but when the attribute is not set and I try to retrieve it with the code

$customer->getCustomAttributes()["custom_field"]->getValue() I get an exception, instead a null value.

if the attribute is set on the customer this method will retur the correct data.

the exception is this one:

Exception #0 (Exception): Notice: Undefined index: custom_field in /var/www/magento/[INSTALLATION_DIR]/app/design/frontend/[TEMPLATE_DIR]/Magento_Customer/templates/form/edit.phtml on line 33

Exception #0 (Exception): Notice: Undefined index: custom_field in /var/www/magento/[INSTALLATION_DIR]/app/design/frontend/[TEMPLATE_DIR]/Magento_Customer/templates/form/edit.phtml on line 33

in phtml files right now i'm working with a try catch block to avoid the exception, but when I'm working on a plugin the exception will stop the execution even in a try catch block.

any suggestion to check if custom attribute exist?

thanks


texts: lastname, telephone fields as optional in onepage checkout shipping address

texts:
I would like to make lastname, telephone, zipcode and city as optional field in billing address column since our site is internal. So created a mysql script and changed the version in config file. After clearing the cache I loaded the page. In eav_attribute table those fields are updated as non required field, but still I am getting the validation message as attached.

Whats the wrong with this?

mysql upgrade script:

<?php
    $installer = $this;

$installer->startSetup();
/*** Update customer address attributes*/
$installer->updateAttribute('customer_address', 'lastname', 'is_required', 0);
$installer->updateAttribute('customer_address', 'telephone', 'is_required', 0);
$installer->updateAttribute('customer_address', 'city', 'is_required', 0);
$installer->updateAttribute('customer_address', 'postcode', 'is_required', 0);

$installer->endSetup();
?>


texts: Passing mysql protocol parameter in local.xml

texts:
I have to connect to mysql database specifing the protocol as in this command line:

mysql -P port_number -u user -ppassword --protocl=tcp -D database -h hostname

Well, port number I think is possible to pass adding ":port_number" to the "hostname" in  tag. User name, database and password have their own tag as in the next example:

<connection>
    <host><![CDATA[hostname:port_number]]></host>
    <username><![CDATA[user]]></username>
    <password><![CDATA[password]]></password>
    <dbname><![CDATA[pierpape_reciele]]></dbname>
    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
    <model><![CDATA[mysql4]]></model>
    <type><![CDATA[pdo_mysql]]></type>
    <pdoType><![CDATA[]]></pdoType>
    <active>1</active>
</connection>

What about some other parameter like "protocol"?


texts: How to setup paypal payment method and test it , if its working properly in magento 2.3.4?

texts:
I want to setup payment methods ,
Starting with paypal , how can i configure it and make into work ?


texts:
I have to options size and colour for a simple product.

I want to group some of the options of colour, e.g, reds, greens, blues, and show multiple swatches for each of them.. 3 reds, 4 blues, 2 greens. Each of the reds, blues, greens should share the same price.

Is this possible? Are you aware of any extension that does this?

I don't care about inventory.. products are always on stock.


texts: Programmatically hide filter per category

texts:
I have custom field (custom attribute) on category edit page. It holds the list of attribute that need be removed when users view that particular category page.

How can I programmatically disable specific filters based on that list?


texts: Magento 2 Custom Product Collection Size Problem after Removing Products from Collection

texts:
In Category list view I want to create a custom collection where some products are not shown OR the entire collection is re-sorted. To test this I created an observer for the event catalog_block_product_list_collection and modified the collection removing all simple products with the following code :

 /**
 * Execute observer
 *
 * @param \Magento\Framework\Event\Observer $observer
 * @return void
 */
public function execute(
    \Magento\Framework\Event\Observer $observer
) {

    $productCollection = $observer->getEvent()->getCollection();

    if ($productCollection instanceof \Magento\Framework\Data\Collection) {

        foreach ($productCollection as $k => $product){

            if ($product->getTypeId()==='simple')
            {
                $productCollection->removeItemByKey($k);
            }
        }

    }

}

The collection is modified but the original collection size is not updated resulting in the frontend pagination showing 24 products, but listing only 10.

When I try and sort this collection at this point either via the observer or directly in the core code only the first page of the collection is sorted and not the entire collection.

It seems that the collection being passed to the observer is just the paginated collection for the frontend list. I need to modify the entire product collection as it is made, either by removing products or re-sorting the collection.

How can I correctly remove products or re-sort the entire product list collection so that the modified collection properties are correct i.e. collection size, and displayed normally with the correct pagination in the frontend?


texts: Disable entire cart functionality & checkout in Magento 2

texts:
From the admin side I can disable the one step checkout, but still users can add products to the cart. I want to display only products without checkout.
Is there any extension there?
I mean disable mini cart, add to cart links on the entire site.
Where can I customize through plugins or observers or rewrite (mostly in single shot) so that it will hide add to cart links everywhere.
By editing list.phtml I can do this. But is there any better way?


texts: How do I 'fork' a community module so as to be maintainable?

texts:
I want to quickly get started with a community module, one that has its own backend tables and plenty else. I need a few extra columns in those tables and a few modifications to the template files. I would also like the community module to be upgradeable.

Currently the community module is on version 1.2.3.4, I can put my own sql file in there with 1.2.3.5, update the config.xml accordingly and be good to go. However another developer is going to come along and wonder what the reason was for this 'upgrade'. They may even pull down the latest version of the official community module, to then find it too wants to upgrade to 1.2.3.5, which it won't be able to do.

Also, do I make any of my changes in the 'local' namespace or stick with the module's 'community' structure?


texts: Magento2 currency switcher using rest API

texts:
I am creating a Magento website with currency switcher, It works fine in webview. I need the same for mobile app. If the user changed the currency once, all the prices should change to selected currency.

Are we need to add any extra parameter on every API call to get chosen currency value?


texts: Enabling store switcher issue in Magento 2.3

texts:
I have created 2 stores, one is english and one is of some other language for example italian language.

Now, I am trying to enable store switcher, I have tried this thing:

<block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" before="-" template="Magento_Store::switch/stores.phtml"/>
<move element="store_switcher" destination="header-wrapper" after="top.links" />

in Magento_Theme/layout/default.xml
but unfortunately it is not working .


texts: magento CE 1.9 freezing/unresponsive when hitting save config button on payment methods page

texts: I am trying to enable the authorize.net direct post payment method.  After filling in the fields, and clicking the save config button, the admin freezes and becomes unresponsive for a few seconds to a minute.  I have also gotten a fatal error: exceeded allocated memory php message a time or two.  Any ideas as to what's happening here.  There are now errors reported in any of the logs and no console errors either.  Thanks for your help.


texts:
Midst installation it has decided to crop up with the error:

This webpage has a redirect loop

ERR_TOO_MANY_REDIRECTS

I have attempted to delete var/cache and var/session but still the error is there. Checked permissions and files: all files present and right permissions. If I delete local.xml then the error goes until I have inputted the information in the configuration section of the installation again and pressed next, then the that error reappears?

My question is different as for one I have been through al the points in the step there yet still no cause identified, also my issue occurs in middle of installation process, not after!

If it help, the server has the OS centos 7 and Apache. The server is a new dell poweredge.

Also, when I previously attempted an upgrade, I came across this same error and overcame it by running the db repair tool, but in hindsight I believe this is not a valid solution as the installation is still in mid installation and running the repair tool will give an incorrect installation and possible huge errors later on.

Installation Error - Redirect loop(Magento 1.9.0.1)

Tried that in hope again still no luck!!!! I shall go down the database repair root if I cannot get this sorted soon, as I believe I have done everything that I can and that being my only solution.

UPDATE:

This has to be a database issue, using same copy of files I managed to install onto a fresh new database. So, this redirect loop error is being caused by something in the database, which I need to figure out now?

What could cause a redirect loop in db ?

Tried looking for the web/base_url_redirect field in core_config_data but no such field exists.


texts: How to add a Megamenu programmatically in Magento 2?

texts:
I need to add Megamenu via an install/upgrade script. I've added my megamenu. I've figured out which tables get updated when I add Megamenu.

The table which gets updated is

mgs_megamenu
mgs_megamenu_store

How can I achieve it programmatically like for cms block
I referred this link for cms block

  How to add a CMS block programmatically in Magento 2?

The queries which I prepared for megamenu, requires lots of insert and select

query1

INSERT INTO `mgs_megamenu`
(`title`,`menu_type`,`category_id`,`position`,`columns`,
`dropdown_position`,`use_thumbnail`,`static_content`,
`left_col`,`right_col`,`status`,`parent_id`,`store`) VALUES
('WHAT''S NEW',2,0,0,6,1,2,'<div class="mega-menu-content">
</div>',1,1,1,1,0);

query2

SET @mgs_megamenu_id = (SELECT max(megamenu_id) FROM mgs_megamenu);

query3

INSERT INTO `mgs_megamenu_store` (`megamenu_id`,`store_id`) VALUES (@mgs_megamenu_id ,0);

Modal class of MGS is
   MGS\Mpanel\Model\Category;


texts: Magento 2.2.1: Add Custom Upload file attribute in Checkout

texts:
I tried to add an Upload file attribute to the Checkout form, I am now able to add custom field, but still, I am unable to save values to database -

I used add Plugin -

added Below code

  Amit\Fileupload\etc\di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="file_upload" type="Amit\Fileupload\Model\Plugin\Checkout\LayoutProcessor" sortOrder="100"/>
    </type>
</config>

  Amit\Fileupload\Model\Plugin\Checkout\LayoutProcessor.php

<?php
namespace Amit\Fileupload\Model\Plugin\Checkout;
class LayoutProcessor
{
    /**
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */
    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {

            $fileupload = 'file_upload';
            $datascope = 'shippingAddress.custom_attributes';

            $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
            ['shippingAddress']['children']['shipping-address-fieldset']['children'][$fileupload] = [
                'component' => 'Magento_Ui/js/form/element/media',
                'config' => [
                    'customScope' => 'shippingAddress.custom_attributes',
                    'customEntry' => null,
                    'template' => 'ui/form/field',
                    'elementTmpl' => 'ui/form/element/media',
                    'tooltip' => ['description' => 'Field to Upload File'],
                    'id' => $fileupload
                ],
                'dataScope' => $datascope,
                'label' => 'File Upload',
                'provider' => 'checkoutProvider',
                'visible' => true,
                'validation' => ['required-entry' => true],
                'options' => [],
                'sortOrder' => 250,
                'id' => $fileupload
            ];

        return $jsLayout;
    }
}

Now, further how to save the data of this field, looking for help on this thanks


texts: Exception occurred during order load - Sales => Orders

texts:
Error under Sales => Orders: Exception occurred during order load
Kindly tell me, why this error is coming ? How to I can fix this issue ? I am using Magento 2.4.0.


texts: getItems() and getData(). What is the different?

texts: Sometimes, i used function getData() and get a different result with getItems(). what is different of them?


texts: Magento 2 : Change Page Main Title Locally For a Single Page

texts:
I want to change the Page.Main.Title styling for my login. I need to apply a css class to the element. But the block, title.phtml is a globally used block and will change all titles.

How can I reference only the login page?

I've tried overwriting the title.phtml in Magento_Customer (in my custom theme), but this applies the changes globally as well.


texts: Magento community 2.1.2 schedule product csv upload from ftp

texts:
I want to import product csv file automatically from ftp.
I am using magento community 2.1.2 edition.

There is no schedule import/export option available in this edition.

Please suggest me a good method of doing so.

Thanks.


texts: How to Override Mage_Sales_Model_Quote_Address::requestShippingRates Method

texts:
In my attempt to fetching shipping rates, I want to override/rewrite this core file Mage_Sales_Model_Quote_Address to put my custom code. So that, I can call the original method using PHP's parent:: construct.

However, I found the Mage_Shipping_Model_Rate_Request object is created and used locally in the method Mage_Sales_Model_Quote_Address::requestShippingRates, hence I confused how to override/rewrite it.

public function requestShippingRates(Mage_Sales_Model_Quote_Item_Abstract $item = null)
{
    /** @var $request Mage_Shipping_Model_Rate_Request */
    $request = Mage::getModel('shipping/rate_request');
    $request->setAllItems($item ? array($item) : $this->getAllItems());
    $request->setDestCountryId($this->getCountryId());
    $request->setDestRegionId($this->getRegionId());
    $request->setDestRegionCode($this->getRegionCode());

    /** My custom code shall added in my override class */
    $request->setDestCityId($this->getCityId());
    $request->setDestDistrictId($this->getDistrictId());
    ...
}


texts: Is it necessary to do security patches before upgrading Magento?

texts:
I am new to Magento. I got a Magento project which I need to upgrade. To do so I read in some tutorials that there are security patches to be performed before upgrading Magento.

I am curious if those security patches can be done after the upgrade? Since the patches are often available for multiple Magento versions.


texts: Magento 2 override template file using custom module

texts:
I need to override below template file using custom module

  Magento_ConfigurableProduct::product/view/type/options/configurable.phtml