texts: How to access a PHP file of Magento 1.9 extension from some external API

texts:
I'm making a new plugin (extension) in Magento 1.9. The API department wants to access some particular PHP file from API externally.

Is there some way to do this?

Is it possible that some API can access the Model or controller file of magento extension?


texts: How http://magentoversion.com determines Magento version ?

texts:
How http://magentoversion.com works ? Is there any similar tool to check Magento version accurately ?

I found a tool call magescan. It is good but it is failing for some of the websites which magentoversion.com is able to find.


texts: Magento 2 How to update custom order attribute after save invoice

texts:
i am using this -
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_invoice_pay">
        <observer name="admin_after_invoice" instance="Companyname\Modulename\Observer\AdminAfterInvoice"/>
    </event>
</config>

AdminAfterInvoice.php
<?php
namespace Companyname\Modulename\Observer;

use Magento\Framework\Event\ObserverInterface;

class AdminAfterInvoice implements ObserverInterface
{
    private $orderRepository;

    public function __construct(
    \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
    ) {

        $this->orderRepository = $orderRepository;
    }

    /**
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return $this
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $invoice = $observer->getEvent()->getInvoice();
        $order1 = $invoice->getOrder();
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/xyz.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('Invoice Order status----------'.$order1->getStatus());
        $logger->info('Invoice Order id----------'.$order1->getId());

        $orderId = $order1->getId();
        try{
            $logger->info('invoice try----------');
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
            $order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId);
            $order->setCustomAttribute1("status2");
            $order->setCustomAttribute2("1");
            $order->save();
        } catch (NoSuchEntityException $ex) {
            $logger->info('invoice catch----------'.json_encode($ex->getMessage()));
        }
    }
}

Does anyone know how to update the custom order attribute?


texts: I am thinking of creating a Magento extension and would like to share my idea. Is it possible?

texts:
We've orocrm which is based on CRM. So, I am thinking of developing an extension similar to it in which;
I will pick the database records (which is given in my Magento database) and perform analysis on it. The analysis would be an algorithm based on data mining. So, is it possible to create such an extension?


texts: Magento 1.9.2.4 is not hiding unused attribute combinations in configurable products

texts:
I have an issue with my Magento shop based on Magento 1.9.2.4.

In backend if you check the screenshots you'll see that I have 2 attributes (global, dropdown, included for configurable products):

Size: A / B
Color: Black / White

After that based on this attributes, you'll see 2 product combinations created:

A + Black
B + White

The problem is, when I choose in frontend Size A, in the second dropdown I should see just Black, and hiding White because I don't have a combination like "A + White"

Same for B, in the second dropdown I should see just white, but i see both white and black.

I found that is a bug just on 1.9.2.4 because I installed an older fresh Magento 1.8 and this bug does not exist.

The customer shouldn't be allowed to choose product combinations which are not created in backend. How can I solve this in 1.9.2.4 ?


texts: Magento 2 : How to add store credits to guest customer?

texts: Is their any way we can add store credits to guest customers  in magento 2 ?


texts:
How can I programmatically add a CSV containing all order information to order emails. By default only a PDF is attached to those emails.

I know I have to write a plugin. But I don't know which class or method I have to modify and how.


texts: I have made a custom theme in magento 2 all is doing well but in the customer checkout page i don't get my header footer is there but the header is missing. can anyone help me to get out of this.


texts: Rewrite server-side validation of product form when add to cart

texts:
I’m implementing a PERL upload on the product page of Magento, with a progressbar, in AJAX with instant upload on the product page.
This upload replaces the standard “file” custom option.

My upload is fine, but I’m facing a problem with the required attribute of the option.

The upload is done directly on the product page, and when it starts, the value of the input file seems to be empty.
I’ve managed to disable the client-side validation when the file is uploaded, but I can’t find where to edit the server-side verification of the custom-options form in the product page.

I’m storing upload data in the session and my aim is to check if the current required custom option is already linked to a file uploaded via PERL upload. If yes, get rid of the validation of this file option.


texts: add attribute in eav_attribute table - Magento 1.9.4

texts:
I'm trying to add attributes to eav_attribute table,
here below the code in mysql4-upgrade-1.9.4-1.9.5.php:

$setup = $this;
$setup->startSetup();
$connection = $setup->getConnection();

$setup->addAttribute('customer_address', 'customer_recipientcode', array(
    'type' => 'varchar',
    'input' => 'text',
    'label' => 'Customer Recipientcode',
    'global' => 1,
    'visible' => 1,
    'required' => 0,
    'is_user_defined' => true,
    'visible_on_front' => 1
));
Mage::getSingleton('eav/config')
    ->getAttribute('customer_address', 'customer_recipientcode')
    ->setData('used_in_forms', array('customer_register_address','customer_address_edit','adminhtml_customer_address'))
    ->save();

$setup->addAttribute('customer_address', 'customer_pec', array(
    'type' => 'varchar',
    'input' => 'text',
    'label' => 'Customer Pec',
    'global' => 1,
    'visible' => 1,
    'required' => 0,
    'is_user_defined' => true,
    'visible_on_front' => 1
));

Mage::getSingleton('eav/config')
    ->getAttribute('customer_address', 'customer_pec')
    ->setData('used_in_forms', array('customer_register_address','customer_address_edit','adminhtml_customer_address'))
    ->save();

$tablequote = $setup->getTable('sales/quote_address');
$query = "ALTER TABLE ".$tablequote." ADD 'customer_recipientcode' varchar(255) NOT NULL";
$setup->getConnection()->query($query);

$query1 = "ALTER TABLE ".$tablequote." ADD 'customer_pec' varchar(255) NOT NULL";
$setup->getConnection()->query($query);

$tablequote1 = $setup->getTable('sales/order_address');
$query2 = "ALTER TABLE ".$tablequote1." ADD 'customer_recipientcode' varchar(255) NOT NULL";
$setup->getConnection()->query($query2);

$query3 = "ALTER TABLE ".$tablequote1." ADD 'customer_pec' varchar(255) NOT NULL";
$setup->getConnection()->query($query3);

$setup->endSetup();

Then I try to install my plugin and flush magento cache, but in db I cannot find my new attributes. What I'm missing?

Thanks


texts: Magento2 How to custom column in sales order item renderer in admin order view

texts:
I need to add custom column in admin sales_order_view for each item listing with the help of renderer.
For example, there are some predefined columns like name, status, price, qty, discount etc are in order item listing. I need to order custom column in that listing.


texts: Add to cart is not working in fresh Magento

texts:
I've installed Magento 2 fresh on localhost. trying add to cart items but it is not working when clicking on add to cart button. It shows You have no items in your shopping cart. Click here to continue shopping

Any suggestion?


texts:
in cart price rules, can someone explain whats the difference between
"For matching items only"
and
"For shipment with matching items"
i cant seem to find a good documentation for this. you set a condition on when it should apply. but whats the purpose on changing the free shipping dropdown.
this is located on the "Actions" section


texts: Moving content of custom header Magento 2

texts:
I created a custom header and called it in the default.xml
this is the code

<referenceContainer name="header.container">
    <block class="Magento\Framework\View\Element\Template" name="custom_header" as="custom_header" template="Magento_Theme::html/customheader.phtml"  before="-" />
</referenceContainer>

        <move element="minicart" destination="custom_header"/>
        <move element="top.search" destination="custom_header"/>
        <move element="logo" as="logo" destination="custom_header"/>

I want to move the content to the empty black area
I'm using Magento 2.2.5
Thanks


texts: How to load the product collection a second time without is_in_stock check

texts:
On the category page the products are normally loaded. Where out of stock products are hidden.
After that I need to load those same category products but also the ones that are out of stock. These are loaded after the page render (but before the response is send) because of an external system.

It is done in an observer

    // only affect the catalog_category_view
    if ( !in_array('catalog_category_view', Mage::app()->getLayout()->getUpdate()->getHandles() ) ) {
        return;
    }

    // where we need to add the other product ID's
    $cacheData = $observer->getCacheData();

    /** @var Mage_Catalog_Model_Resource_Product_Collection $productCollection */
    $productCollection = Mage::getSingleton('catalog/layer')->getProductCollection();

    // few things I tried
    //$select = $productCollection->getSelect();
    //$select->reset(Zend_Db_Select::WHERE);
    //$productCollection->resetData();
    $productIds = $productCollection->getAllIds();
    var_dump($productIds); // only the in stock items :(

I know it should be something with addAttributeToFilter/ removeAttributeToFilter or maybe in the getSelect But I just can't figure it out.
Can anybody help me on my way?


texts: Programmatically create new customer and assign current quote

texts:
I want to create customer programmatically and want to assign current login customer quote but unable to do that. Here is script, Please see and help me.

// create customer

$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$firstname ="Firstname";
$lastname = "Lastname";
$email = "test@test.com";

$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId($websiteId)
         ->setStore($store)
         ->setFirstname($firstname)
         ->setLastname($lastname)
         ->setEmail($email)
         ->setPassword('test123');

$customer->save();
$customer_id = $customer->getId();

// quote assign to new customer
$session = Mage::getSingleton('checkout/session');
$current_quote_id = $session->getQuoteId();
$currentQuote = Mage::getModel('sales/quote')->load($current_quote_id);
$currentQuoteItem = $currentQuote->getAllItems();

$newQuote = Mage::getModel('sales/quote');
$newQuote->assignCustomer($customer);
$newQuote->addItem($currentQuoteItem);
$newQuote->setQuote($newQuote);
$newQuote->collectTotals()->save();

Above script is creating the customer but not assinging the quote in customer's account.


texts:
I made a Magento Admin form before and it was ok. But with help of this tutorial, I added tabs to it. But in HTML output, I have two form tag. one of the has the content of the form and form key and the other just has the form key.

The problem is company_Vendor_Block_Adminhtml_Vendor_Edit_Form._prepareForm() is run two times. So it makes two form and I think, it runs two times because of this line in vendorController.EditAction()

$this->_addContent($this->getLayout()->createBlock('vendor/adminhtml_vendor_edit'))
->_addLeft($this->getLayout()
  ->createBlock('vendor/adminhtml_vendor_edit_tabs'));

when I just have  createBlock('vendor/adminhtml_vendor_edit') this is run only one-time but when I add the tab to left it is run two times. How Can I Solve It?

NOTE: My code is Exactly the same as the tutorial.


texts: Good way to licensing Magento 2 extension for selling

texts:
I am creating some extension for magento 2, I would like to put some extension as Paid extension on my store,but Still one who purchase it I want to give them plain PHP code (means I don't want to encrypt it).
I want to use some license key stuff,
can Any one will help me how can I achieve this ?

Your help will be appreciated.
Thanks in advance.


texts: Magento overwrite payment information block

texts:
I'm writing custom checkout section and I'm trying to overwrite payment information section of Magento and use existing methods defined in Mage_Payment_Block_Form_Container.

What I'm doing?
config.xml contains

  <blocks>
        <zigycheckout>
            <class>Medex_ZigyCheckout_Block</class>
        </zigycheckout>
        <payment>
            <rewrite><form_container>Medex_ZigyCheckout_Block_Form_Container</form_container>
            </rewrite>
        </payment>
    </blocks>

Block class is defined as class Medex_ZigyCheckout_Block_Form_Container extends Mage_Payment_Block_Form_Container

which contains methods which as already defined in Mage_Payment_Block_Form_Container
like

  public function getMethodTitle(Mage_Payment_Model_Method_Abstract $method)
    {
        $form = $this->getChild('payment.method.' . $method->getCode());
        if ($form && $form->hasMethodTitle()) {
            return $form->getMethodTitle();
        }
        return $method->getTitle();
    }

but when I call following function in my phtml I'm not getting any return from my function. I think my block is not properly overwritten due to which it's not hitting my block method?

<?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?>

Even the calls like $method = $this->getMethod() is not working.

Do I need to overwrite Payment information related Models also so that these functions should work properly?


texts: How to display only invoice created date in invoice template and format date?

texts:
I want to display invoice created date in invoice e-mail template.
I am using {{var invoice.created_at}} to display invoice created date. But it displaying 2015-05-25 13:30:55 . I need to only display date as 25 JUL 2015. Please help me. Thanks in advance.


texts: getAttributeText in a safe way / test if attribute exist in product first

texts:
If I call getAttributeText on a non existing attribute, eg:

$product->getAttributeText('some-non-existing-field');

I get the fatal error:

Fatal error: Call to a member function getSource() on a non-object

Which I can't even try-catch because its fatal.

Different magento stores have different attributes (And also different products got different attributes), so how can I access attributes in a safe way that even if they are undefined I won't get fatal (for example get null or empty string if non-existence)?

or as an alternative, how can I test if attribute exists first?

Thanks!


texts: Magento 2 - How to stop order success email programatically

texts:
I am creating a order programatically in magento 2. What property I need to set on $order object so order success email will not trigger. I have tried below methods with (bool) false, parameter but no succes.

$order->setCanSendNewEmailFlag(false);
$order->setEmailSent(false);
$order->setSendEmail(false);


texts: What is the difference between creating a new Map with or without parentheses?

texts:
I'm able to create a new Map without the parentheses like so

const withoutParentheses = new Map;

or like this

const withParentheses = new Map();

Same goes for Set

I haven't been able to find any differences between the two, but are there?


texts: Add user with shell unexpected require_once

texts:
I am trying to add user with shell command I am getting this error

PHP Parse error:  syntax error, unexpected 'require_once' (T_REQUIRE_ONCE) in /var/www/magento/shell/create_user.php on line 4

This is the file in shell folder

                                 shell/create_user.php
<?php

// Create New admin User programmatically.
require_once('app/Mage.php');
umask(0);
Mage::app();

try {
    $user = Mage::getModel('admin/user')
        ->setData(array(
            'username'  => 'username',
            'firstname' => 'firstname',
            'lastname'  => 'lastname',
            'email'     => 'mail@mail.com',
            'password'  => 'password!!',
            'is_active' => 1
        ))->save();

} catch (Exception $e) {
    echo $e->getMessage();
    exit;
}

//Assign Role Id
try {
    $user->setRoleIds(array(1)) //Administrator role id is 1 ,Here you can assign other roles ids
        ->setRoleUserId($user->getUserId())
        ->saveRelations();

} catch (Exception $e) {
    echo $e->getMessage();
    exit;
}

echo "User created successfully";


texts: How to order search results by category?

texts:
When performing a search I am wanting to show the results in order of the categories.
I am aware that magento does not allow this natively as products may be in more than one category, however in this example the products will belong to either one or the other category.
To clarify, I have only two categories containing complete products, and component products - e.g. rc helicopter, and rc helicopter components to repair or whatever.
I want on the search results for the complete products to be listed first.
On my products/list.phtml file I have added:
$_productCollection
    ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
    ->addAttributeToFilter('category_id', 'ASC');

but this does not appear to work.
Is there a way to do this in the local.xml file? Should I create an observer for the search and add the category order-by there (if so, how should I do that)?
Edit
I have also added the following to my local.xml file but also does not work:
<catalogsearch_result_index>
    <reference name="search_result_list">
        <action method="setDefaultDirection"><param>asc</param></action>
        <action method="setSortBy"><param>attribute_you_want_to_use</param></action>
    </reference>
</catalogsearch_result_index>
<catalogsearch_advanced_result>
    <reference name="search_result_list">
        <action method="setDefaultDirection"><param>asc</param></action>
        <action method="setSortBy"><param>attribute_you_want_to_use</param></action>
    </reference>
</catalogsearch_advanced_result>


texts: wysiwyg in custom module, image links are incorrect

texts:
I have a custom module, where I want to add wysiwyg editor to field.
I do it in this way:

    $fieldset->addField('submenu_html', 'editor', array(
        'name'      => 'submenu_html',
        'label'     => Mage::helper('cmsnav')->__('Submenu HTML'),
        'title'     => Mage::helper('cmsnav')->__('Submenu HTML'),
        'style'     => 'width:500px; height:400px;',
        'wysiwyg'   => true,
        'required'  => false,
        'config'    => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
    ));

In xml file I added all necessary JS and CSS files.
Editor is working, but then I upload image I get this kind of link:

<img src="http://linktoproject/index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvVW50aXRsZWQtMS5wbmcifX0,/key/13e9709bba938ba67ff4ab68cb24c7a969aa89da4039bd850d65204116d6e76a/" alt="" />

And I can see image only in Mozilla, in other browsers image doesn't load.
I checked config setting which I get on my module page and in CMS Static Block, they are same. Where can be problem? Thank you.


texts: Magento 2 - Can't log in to backend after changing cookie domain

texts:
My magento project is running on a subdomain redesign.company.de.
I have changed the cookie domain from empty to .redesign.company.de, because I often had issues where my site was loading forever and nothing happend until I delete all magento cookies.
Then I deleted all browser cookies and flushed the magento cache.
Problem:
If I try to login to the backend (admin) then the login form just reloads without any error showing.
My only option is to override the value from the database.
But how should I set the cookie domain correctly?


texts: Magento 2 - Layered Navigation is not coming on search pages

texts:
Issue - Layered navigation Disappeared on Search Pages if Layout is Changed to 1column

Worked Around - Override

catalogsearch_result_index.xml in Magento_CatalogSearch
Change layout="1column" for showing Layered Navigation on top

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <attribute name="class" value="page-products"/>
    <referenceContainer name="content">
        <block class="Magento\CatalogSearch\Block\Result" name="search.result" template="Magento_CatalogSearch::result.phtml" cacheable="false">
            <block class="Magento\CatalogSearch\Block\SearchResult\ListProduct" name="search_result_list" template="Magento_Catalog::product/list.phtml" cacheable="false">
                <arguments>
                    <!-- If argument's position depends on image size changeable in VDE:
                    positions:list-secondary,grid-secondary,list-actions,grid-actions,list-primary,grid-primary
                -->
                    <argument name="positioned" xsi:type="string">positions:list-secondary</argument>
                </arguments>
                <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml" cacheable="false">
                    <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager" cacheable="false"/>
                </block>
                <action method="setToolbarBlockName">
                    <argument name="name" xsi:type="string">product_list_toolbar</argument>
                </action>
                <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
                    <block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
                </block>
                <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="catalogsearch.product.addto" as="addto">
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                           name="catalogsearch.product.addto.compare" as="compare"
                           template="Magento_Catalog::product/list/addto/compare.phtml"/>
                </block>
            </block>
            <action method="setListOrders"/>
            <action method="setListModes"/>
            <action method="setListCollection"/>
        </block>
    </referenceContainer>
</body>

On Category Pages - layout="1column" is working perfect for showing Layered Navigation on Top

Screenshot of Layered Navigation on Category Pages -
Result

On Search Pages -

Show Layered Navigation on top if Layout is changed from "2columns-left" to "1column"

Layered Navigation is Showing and Working Perfectly in Left Sidebar under layout="2columns-left"


texts:
I have installed Magento 2.4.1, Nginx, Mysql8, PHP 7.4 and PHPmyAdmin on Debian 10 on ec2. I have done all the steps from this guide:
https://www.digitalocean.com/community/questions/how-to-install-manually-phpmyadmin-on-ubuntu
My domain is example.mgt.com and when i hit http://example.mgt.com/phpmyadmin i get: Whoops, our bad... I might have done something wrong in /etc/nginx/sites-available/phpmyadmin so nginx can't "see" phpmyadmin.
Can anyone suggest something? Thank you in advance.


texts:
<?php $newCategory = Mage::getModel('catalog/category')->load($newSubCategoryId)->limit(5); ?>

I'm trying to get top 5 catogeries how can i get?


texts: How to add name field in newsletter form Magento?

texts: I want to add new filed in newsletter form like name, pin code, phone number, and Date of Birth field so please suggest or help me.


texts: Change date format of date filter in all admin grids

texts:
I'm a magento newbie. My client asked us to change date format of date filter in all admin grids. He needs to change date format to display as dd/mm/yyyy.

Can anyone help to solve this? Thanks in advance.


texts: Undefined index notice error when trying to add a new user role in magento 2?

texts: I am getting a error "Undefined index: title in \vendor\magento\module-integration\Helper\Data.php on line 24" in magento 2 when trying to add a new user role. please help me


texts: Get all product attributes on product detail page magento 2

texts:
I am trying to gather product attributes on the product detail page. We have the default attributes disabled through xml, and are trying to load them from within a custom phtml template file.

I am able to load certain data points, like weight with the following:

$_product = $block->getProduct();
echo $_product->getData('weight');

However, I would like to do this dynamically from the info loaded in the product page and loop through them, including the default attribute set and custom attributes. This info must be available because it's a product detail page.

I have tried

$attributes = $_product->getAttributes();
$customAttributes = $_product->getCustomAttributes();

but not everything is shown..

Can someone point me in the right direction? Magento documentation is terrible and so are many of the examples I've found. How come Magento can't be as simple as:

$_product = $block->getProduct();
$attributes = $_product->getAttributes();
foreach ($attributes as $attribute) {
    echo $attribute->getLabel();
    echo $attribute->getValue();
}

Can anyone assist? Thanks


texts:
I am comparing my old local.xml file with a new one (both run same version but one store was upgraded since 2010) and my old one is missing some attributes, should I add them? Is there any advantage by doing so?

<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>

Old local.xml

<host>localhost</host>
<username><![CDATA[yyy]]></username>
<password><![CDATA[yyyy]]></password>
<dbname><![CDATA[yyy]]></dbname>
<active>1</active>

New XML

<host><![CDATA[localhost]]></host>
<username><![CDATA[ffff]]></username>
<password><![CDATA[ffff]]></password>
<dbname><![CDATA[fff]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>


texts: Is it possible to turn off multiple addresses in magento?

texts:
The title says it all, is it possible to turn off multiple addresses? Now I can add a different send address and an invoice address, this option breaks a payment option I have since it requires all addresses to be the same.

So my question, is it possible to turn that off? Have the customer only be able to pick 1 address for everything.


texts:
Recently I studied the Magento user guide. I have seen Scheduled
  Grid Updates from the following link.

  http://docs.magento.com/m2/ce/user_guide/sales/order-grid-updates-schedule.html

  But I didn't understand what it is and how it will be useful? Can
  anyone explain this setting?


texts: Why does Magento (appear to) log out administrative users?

texts:
When carrying out a couple of specific (but seemingly unrelated) administrative tasks (see below for details), Magento (1.9.0.1) appears to log out the administrative user, presenting them with the login page.

I say "appears to" because pressing the browser's back button reveals that the user is still logged in (they can navigate to other pages and carry out other administrative tasks).

However, if they try to log in from the login page above, their login always fails.

This initially suggested to me that there was something wrong with the secure key. But disabling secure keys makes no difference.

Are there any circumstances under which Magento would be expected to behave as above?

The two scenarios both involve the use of from different third parties:

With Mageworx's "Advanced Product Options" (4.12.0), the problem occurs when users attempt to navigate to Catalog -> Advanced Product Options
With Bleulliette's "Enhanced Admin Grids (+ Editor)" (0.8.9), the problem occurs when users try to add a category or attribute column to Manage Products

It seems unlikely that they would have the same "bug", so it look like an issue with a common element - such as Magento core, or our site configuration.

Thanks.


texts: Magento 2 : InstallData.php Does Not Seems to be Running While setup:upgrade

texts:
In custom module, I have InstallSchema.php and a InstallData.php files.

InstallSchema.php seems to be running fine, both tables declared in file are created.

But with the InstallData.php nothing happens.

InstallData.php

    <?php
namespace VVV\Comercial\Setup;

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

class InstallData implements InstallDataInterface
{

  protected $customerSetupFactory;

  private $attributeSetFactory;

    private $categorySetupFactory;

    private $eavSetupFactory;

  public function __construct(
    CustomerSetupFactory $customerSetupFactory,
    AttributeSetFactory $attributeSetFactory,
    EavSetupFactory $eavSetupFactory,
    CategorySetupFactory $categorySetupFactory
  ) {
    $this->customerSetupFactory = $customerSetupFactory;
    $this->attributeSetFactory = $attributeSetFactory;
      $this->eavSetupFactory = $eavSetupFactory;
      $this->categorySetupFactory = $categorySetupFactory;
  }

  public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
  {

      $setup->startSetup();

    /** @var CustomerSetup $customerSetup */
    //$customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
      $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

      $eavSetup->addAttribute(
          Customer::ENTITY,
          'is_commercial',
          [
              'type' => 'int',
              'label' => __('Commercial user'),
              'input' => 'boolean',
              'required' => false,
              'sort_order' => 100,
              'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
              //'group' => 'General Information',
              //'is_used_in_grid' => true,
              //'is_visible_in_grid' => false,
              //'is_filterable_in_grid' => true,
          ]
      );

      $setup->endSetup();

    /*$customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
    $attributeSetId = $customerEntity->getDefaultAttributeSetId();

    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

    $customerSetup->addAttribute(Customer::ENTITY, 'is_commercial', [
      'type' => 'int',
      'label' => __('Commercial user'),
      "default" => 0,
      'input' => 'boolean',
      'required' => false,
      'visible' => true,
      'user_defined' => true,
      'sort_order' => 1000,
      'position' => 1000,
      'system' => 0,
    ]);

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

    $attribute->save();*/
  }
}

The attribute is not created in  eav_attribute table, also setup_module table not filled data_version columna when running setup:upgrade.

There is a way to debug a bit more this kind of stuff?

Why InstallData.php does not seems to be running.

For tests, I delete the row in setup_table then run setup:upgrade.

I have to do something else to be able to run the InstallData.php?


texts: Magento 2.2.2: problem with php bin/magento setup:di:compile

texts:
when I try to compile after setup:upgrade

It displays for me blank page with error in log file:

main.INFO: Broken reference: the 'logger' element cannot be added as child to 'after.body.start', because the latter doesn't exist [] []

I used this code too to display errors in index.php

ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
    $error = error_get_last();
    echo("<pre>");
    print_r($error);
}

The home page now display the following error

Array
(
    [type] => 8192
    [message] => Function mcrypt_module_close() is deprecated
    [file] => C:\xampp\htdocs\magento\vendor\magento\framework\Encryption\Crypt.php
    [line] => 112
)

Any suggestion?

Thanks,


texts: Create Customer Groups from frontend after login or registration

texts:
I want to create customer groups from frontend i.e. if customer is logged in or registered then he can click on "Create Customer Group" option in account dashboard.

In "Create Customer Group" option the user have to fill up custom form containing the group details i.e. Group name, Group icon etc... and after filling all the information he can click on create group option in order to create new group.

I have managed to create customer groups but still not able get and save the custom fields mentioned above.

Any advice or guidance would be greatly appreciated.

Thanks


texts: Speed issues and Server requests differ in http and https

texts:
I am trying to speed up a magento 2.3 instance
While running in a https production enviroment pingdom shows 281 requests however when i run the identical dbase and instance on a development server in http it shows only 161 server requests and is 2s faster?
Both servers set up with identical LAMP
Can anyone explain as i feel this may be an indicator of why the production instance is so slow
see https://tools.pingdom.com/#5be5098901c00000
against https://tools.pingdom.com/#5be50a1372400000


texts:
Using terminal in mac, I'm trying to apply patch SUPEE-5344. I've uploaded the patch to the magento root directory, I run the sh script and  I'm receiving this:

    Checking if patch can be applied/reverted successfully...
    ERROR: Patch can't be applied/reverted successfully.

    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

    diff --git app/code/core/Mage/Admin/Model/Observer.php app/code/core/Mage/Admin/Model/Observer.php
    index bd00181..6a5281c 100644
    --- app/code/core/Mage/Admin/Model/Observer.php
    +++ app/code/core/Mage/Admin/Model/Observer.php

    File to patch:
    Skip this patch? [y]
    Skipping patch.
    3 out of 3 hunks ignored
    can't find file to patch at input line 46
    Perhaps you used the wrong -p or --strip option?

   The text leading up to this was:

    diff --git app/code/core/Mage/Core/Controller/Request/Http.php app/code/core/Mage/Core/Controller/Request/Http.php
    index 6513db9..31eb6d6 100644
    --- app/code/core/Mage/Core/Controller/Request/Http.php
    +++ app/code/core/Mage/Core/Controller/Request/Http.php

    File to patch:
    Skip this patch? [y]
    Skipping patch.
    2 out of 2 hunks ignored
    can't find file to patch at input line 91
    Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

    diff --git app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
    index c30d273..36542f9 100644
    --- app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
    +++ app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php

    File to patch:
    Skip this patch? [y]
    Skipping patch.
    1 out of 1 hunk ignored
    can't find file to patch at input line 104
    Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

    diff --git app/code/core/Mage/XmlConnect/Model/Observer.php app/code/core/Mage/XmlConnect/Model/Observer.php
    index e6cb947..36142ac 100644
    --- app/code/core/Mage/XmlConnect/Model/Observer.php
    +++ app/code/core/Mage/XmlConnect/Model/Observer.php

    File to patch:
    Skip this patch? [y]
    Skipping patch.
    2 out of 2 hunks ignored
    can't find file to patch at input line 126
    Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

    diff --git lib/Varien/Db/Adapter/Pdo/Mysql.php lib/Varien/Db/Adapter/Pdo/Mysql.php
    index 2226331..d1c6942 100644
    --- lib/Varien/Db/Adapter/Pdo/Mysql.php
    +++ lib/Varien/Db/Adapter/Pdo/Mysql.php

    File to patch:
    Skip this patch? [y]
    Skipping patch.
    1 out of 1 hunk ignored

Help ASAP please.


texts: Download the magento connect extensions list

texts:
I'm currently building a magento connect extensions search: http://magentoconnect.algolia.com/ but I have a hard time downloading the extensions list + associated metadata. I found http://connect.magentocommerce.com/community/Chiara_PEAR_Server_REST/p/packages.xml but then I cannot find a way to have relevant meta-data per extension.

Any chance someone know where I could find those information? Even crawling the page doesn't provide me all the metadata (like the tags/categories associated to an extension).

Thank you very much!


texts: What is the use of page_types.xml at magento2

texts:
I am seen that some of magento modules has page_types.xml  at configuration section means ../etc/frontend section.

<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd">
    <type id="checkout_cart_configure" label="Configure Cart Item (Any)"/>
    <type id="checkout_cart_index" label="Shopping Cart"/>
    <type id="checkout_onepage_failure" label="One Page Checkout Failure"/>
    <type id="checkout_index_index" label="One Page Checkout"/>
    <type id="checkout_onepage_paymentmethod" label="One Page Checkout Choose Payment Method"/>
    <type id="checkout_onepage_review" label="One Page Checkout Overview"/>
    <type id="checkout_onepage_shippingmethod" label="One Page Checkout Choose Shipping Method"/>
    <type id="checkout_onepage_success" label="One Page Checkout Success"/>
</page_types>

So, my question

Why are use this xml files?
If we assume that is used for declaration of each actions of that
module's  then  if we create any custom module with out
page_types.xml then those custom actions are also worked. Seems it
confusing.Can  anyone clear the idea of use page_types.xml


texts: How to implement domain alias in Magento2

texts:
I have a magento2 website and I am implementing a domain alias/server alias (not redirect) for this website similar to cPanel implementation here:
https://blog.cpanel.com/pointing-two-urls-to-the-same-website/
My primary domain is sub.mydomain.com and I want to add myanotherdomain.com as its alias so the website content is the same for both urls.
I have tried to add ServerAlias in VirtualHost similar to this:
Virtual host setup in local host magento 2
but it didnt work and I have no idea what's wrong.
Is there any best practice to implement this?
FYI: this website is running in a docker which is hosted in Azure VM.
Thanks.


texts: How can I see my newly added product(with all the fields added through adin) in Magento 1.9.2.4?

texts:
For a product, I added all the fields, and the product doesn't show anywhere on front end Magento. These are the things I did:

-I added the product in admin
-Added fields:
-General -> Sku, Weight, Status(Enabled), Visibility(Catalog, Search)
-Prices -> Price, Tax Class
-Added images
-Inventory -> quantity is set
-Inventory -> Stock Availability = In Stock


texts:
Using Magento EE, I have created a CMS Hierarchy (Admin > CMS > Pages > Manage Hierarchy). Each of the hierarchy items are set to Show in Navigation Menu > Yes under Page Navigation Menu Options. I would like to use this page hierarchy as a separate navigation menu in my header (as a super header navigation of sorts). The hierarchy must be its own separate menu, not part of the categories top menu.

In my local.xml layout, I have added a hierarchy menu block to my header, where I will be calling the hierarchy_menu template from:

<layout>
    <default>
        ...
        <reference name="header">
            <block type="enterprise_cms/hierarchy_menu" name="hierarchy_menu" template="cms/hierarchy/menu.phtml" />
        </reference>
        ...
    </default>
</layout>

In my page/html/header.phtml template, I am echoing the block:

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

My issue is that the hierarchy menu block is rendering on CMS pages ONLY. On non-CMS pages, this block either halts the rendering of the rest of the page or simply does not render the menu. I can't seem to figure out why this is occurring. I would like to be able to render the cms/hierarchy/menu.phtml block in the site header on every page.

Does anyone know what is happening here?


texts: Magento 2 - How to add custom discount in cart programmatically?

texts:
I want to apply custom discount amount to cart programmatically. I have tried doing it in following 2 ways, none of which work:

METHOD 1:

I tried following the default way in which Magento2 applies sales-rule discounts. I did it by creating following files in my module:

etc\sales.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd">
    <section name="quote">
        <group name="totals">
            <item name="discount" instance="Vendorname\Modulenmae\Model\CustomFolderName\Quote\Discount" sort_order="400"/>
        </group>
    </section>
</config>

frontend\layout\checkout_cart_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
     <body>
        <referenceBlock name="checkout.cart.totals">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="block-totals" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="before_grandtotal" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="discount" xsi:type="array">
                                            <item name="config" xsi:type="array">
                                                <item name="title" xsi:type="string" translate="true">My Custom Discount</item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Model File

class Discount extends \Magento\Quote\Model\Quote\Address\Total\AbstractTotal
{
    public function collect(
            \Magento\Quote\Model\Quote $quote,
            \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment,
            \Magento\Quote\Model\Quote\Address\Total $total
        ) {

            parent::collect($quote, $shippingAssignment, $total);

            $label          = 'My Custom Discount';
            $discountAmount = -10;
            $total->setDiscountDescription($label);
            $total->setDiscountAmount($discountAmount);
            $total->setBaseDiscountAmount($discountAmount);
            $total->setSubtotalWithDiscount($total->getSubtotal() + $discountAmount);
            $total->setBaseSubtotalWithDiscount($total->getBaseSubtotal() + $discountAmount);
            return $this;
        }
        //fetch function is also defined in this class. Since it is only used for display purposes I have not added its code in this question.
}

However, with this method, my custom discount gets applied but Magento's default sales rules like coupon code, etc. stop working. They throw errors like Invalid Coupon Code even when the coupon code is completely valid. If I revert my changes, the default coupon codes start working again.

METHOD 2:

Another method i tried is applying discount by observing the sales_quote_collect_totals_after event. It is working fine, but i think method 1 might be the best way to achieve it.

Any ideas as to how can I do it correctly ?


texts: Is it possible to have 2 different websites with the same products, categories, and currency; but different shipping methods and payments?


texts: Magento 2: event or plugin after filters applied and removed in category pages

texts:
I want to write customization on after filters are applied and filters are removed in category pages.
I need any event or plugin while filter applied or filter removed in Magento 2.3.2.


texts:
I am working on a functionality to send mass mail on product update.I want to improve code for performance and to avoid spam.

Code:

 $collection = Mage::getModel('newsletter/subscriber')->getCollection();
 $arr = array();

   foreach ($collection as $subscriber)
   {
      $arr[] = $subscriber->getData();
   }

    $html = 'Dear Subscriber,

                    Following product has been updated

 ';

      for($j=0;$j<count($arr);$j++)
      {
         $mail = Mage::getModel('core/email')
             ->setToName($arr[$j]['subscriber_email'])
             ->setToEmail($arr[$j]['subscriber_email'])
             ->setBody($html)
             ->setSubject('Sarees Images Collection')
             ->setFromEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId))
             ->setFromName(Mage::app()->getStore()->getName())
             ->setType('html');
             try{

             $mail->send();
             }
             catch(Exception $error)
             {
             Mage::getSingleton('core/session')->addError($error->getMessage());
             return false;
             }
         }

Problem:

Though mails are being sent to susbscribers it is slowing the page and there is a fear of being spammed.

How can I tackle this?

I am using Magento ver. 1.9.2.4.


texts:
I see this code in toolbar.html

    <?php echo $block->getPagerHtml() ?>

And these in list.html

<?php echo $block->getToolbarHtml() ?>

    <div class="tollbar-bottom">
    <?php echo $block->getToolbarHtml() ?>
</div>

I want to show the pager at the bottom of the pages and keep sort by at the top

Any help would be appreciated

Thanks


texts: How to add Cart items in abandoned cart email template in magento2

texts: How can we add the product list in abandoned cart email template in magento 2?


texts: How to Add Custom Quote Discount on Product Line

texts:
I'm trying to add custom discount amount on quote to specific product line,
I saw event sales_quote_address_discount_item, when I use it like that :

    $item = $observer->getData('item');
    $item->setDiscountAmount(10);
    $item->setBaseDiscountAmount(10);
    $item->save();

In database (quote_item) I can see that column 'discount_amount' and 'base_discount_amount' contains my amount, but nothing on quote table and on quote_address.

How can I apply from code a custom discount on one specific product in quote ?


texts:
I would like to see css changes instantly, without having to return to the command line. I'm in developer mode with all cache disabled, yet I have to remove pub/static var/di and cache directories, recompile dependencies, and run setup:static-content:deploy command for css changes to take effect.
Is there a better way? Can I just make magento monitor css changes and deploy them automatically?


texts: How to create a second bank transfer payment method?

texts:
I'm using Magento 2.3.5-p1 and I need to create a second bank transfer method the same as the default from magento, because the client need to be able to choose between bank transfer in 30 days or in 1 day with a 2% discount.
I think there is no way to make that choice inside a payment method so I thought about creating one method for each option.
I know I need to create a custom module but I don't know how to create a payment method the same as the default from magento.
Best regards,
Rui Silva


texts: How to use subscription payment for downloadable products?

texts:
I have a Magento CE 1.9.1 web store for downloadable products (images) which can be purchased individually.

What do I need to do to make it possible for a customer to pay for a whole month or several months and then be able to download a certain (limited) amount of different images every day or week, or for the whole period. Basically - just like he would by using Shutterstock or similar with a subscription pre-payment.

Is that possible?


texts:
I am unable to get any reports from:

Reports --> Products

Here's an image of Reports --> Products --> Most Viewed.

When I export via CSV or XML there is no data. I've checked to make sure the timezone is correct in the admin panel, config.xml and in the php.ini. I've also properly refreshed the statistics.

Any ideas?


texts: Does anyone know for what is reindex of "salesrule_rule" of Magento 2 EE?


texts: Set individual options out of stock in magento

texts: Is it possible to set individual options out of stock ( or disable in some way, we are not using inventory) in Magento. My client has different colours of her products and if one colour is out of stock there seems to be no way to set that out of stock other than actually deleting the option and putting it in afterwards.


texts:
I want to add custom attribute to quote item called item_delete for example. This attribute it's to know if a a item can or can not be deleted from cart.

I've already created an extension_attributes.xml file with the following.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Quote\Api\Data\CartItemInterface">
    <attribute code="is_delete" type="boolean" />
</extension_attributes>

Also i've  a plugin:

/**
 * @param \Magento\Quote\Model\Quote\Item\Repository $subject
 * @param \Magento\Quote\Model\Quote\Item $result
 */
public function afterSave(\Magento\Quote\Model\Quote\Item\Repository $subject, $result){

                $newItem = ObjectManager::getInstance()->get('\Magento\Quote\Api\Data\CartItemInterface');
                $newItem->setQuoteId($cartId);
                $newItem->setQty(1);
                $newItem->setSku($discount);

               $newItem->getExtensionAttributes()->setIsDelete()

}

So i want to add "is delete" attribute to quote item  api rest response.


texts: Magento 2 Is there a way to use product chooser in ui component form (NOT BLOCK)?

texts:
Im building module using ui components and need product chooser in my form. But can't find any useful info related to product chooser implementation using ui component.
Is it possible to do this without block?
Thanks.


texts: Applying multiple action in Cart Price Rules

texts:
Is it possible to create multiple action for price rules?
Like I am setting a 5% Discounts for customers but the discount is capped at $250.00 When the purchased is greater than $5000.00?
Is this possible?
TIA.


texts: Product shippable and/or downloadable. What's the best option?

texts:
The problem:
I have to sell products which are downloadable but they can be shippable as well as CD or USB Key. Thus, customer can choose if download the product or receive it on DVD or USB Key.
What's the best option to handle this situation in Magento 2?

What I did:
Till now, using Magento 1, I was selling the product in just 2 options: downloadable or shippable on CD. In order to do this I created 3 products: 1 simple product (for CD), 1 downloadable product (for download), and 1 grouped product (to group those 2 products). However, this is very inconvenient because every time I have to insert a new product I have to insert 3 separated products and now that I want to give the USB key option, I should insert 4 separated products.
I tried to use a configurable product in order to create them but since I'm using a custom Attribute Set with many required fields, the child products created from this process inherit the parent Attribute Set and they force me to compile all those fields. I also tried to change it once the child products have been created but I got I mess...
What I was thinking:
I was thinking about alternatives... something like creating just 1 downloadable product for every products and then creating just 1 simple product for CD shipping and another for USB Key shipping for all products so the customer who wants shipping buys 2 products: the downloadable product and the simple product for CD shipping for example. But, in my opinion, this is not an elegante way to handle this situation.
Do you have a better idea?


texts: Magento 2: Get disabled products for a category in a collection programatically

texts:
I want to get disabled products for a category in product collection programatically in Magento 2.2.5. I am using following code:

 public function __construct(
    \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->categoryRepository = $categoryRepository;
    $this->productRepository = $productRepository;
}
public function deleteProductsByCategoryId($id)
{

    $category = $this->categoryRepository->get($id);
    $collection = $category->getProductCollection()->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED);
    foreach ($collection as $product) {
        // no disabled products are gotten
    }

}

But above code does not get disabled products.


texts: Configurable product on sale have an error on variation price

texts:
When I change product variation on the dropdown, the full price of that product is not loaded, it continues to show the price of the default configurable product. I do not know why this error happens and even with the standard Magento files, this error occurs.

It's ok

Don't work

Price that should show


texts: Magento CE 1.9.2 - Spanish (Spain) Language Pack

texts:
I have looked everywhere trying to find the Spanish (Spain) Language Pack for Magento. I found several resources and one in particular where all language packs for the old resource that used to be supported by Magento are now housed.

https://web.archive.org/web/20140717210430/http://www.magentocommerce.com/translations/

However, I can't find the Spanish (Spain) version. It is listed, but not available for download (I receive a 301 error). Anyone else find a different location to download the CE Magento 1.9.2 edition? Any help would be greatly appreciated. Thank you!


texts: After System Backup error Cannot login to admin

texts:
I was using System > Back up  tools to backup media and data file and it took too long to process so I closed the browser and now i cannot login to admin page.

Now first, admin page was 500 error and after I deleted var/cache/ and var/session admin page was back on but when I entered my id and password to login, page looks like it was loading for long time and at last,

  There has been an error processing your request Exception printing is
  disabled by default for security reasons.

  Error log record number: 382662642504

this msg came out.

So, I went var/report and it said

a:5:{i:0;s:91:"SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction";i:1;s:2839:"#0 lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `admin_u...', Array)
#4 lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `admin_u...', Array)
#5 lib/Zend/Db/Adapter/Abstract.php(632): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `admin_u...', Array)
#6 app/code/core/Mage/Admin/Model/Resource/User.php(85): Zend_Db_Adapter_Abstract->update('admin_user', Array, Array)
#7 app/code/core/Mage/Admin/Model/User.php(376): Mage_Admin_Model_Resource_User->recordLogin(Object(Mage_Admin_Model_User))
#8 app/code/core/Mage/Admin/Model/Session.php(91): Mage_Admin_Model_User->login('admin', 'xxxxxxx')
#9 app/code/core/Mage/Admin/Model/Observer.php(69): Mage_Admin_Model_Session->login('admin', 'xxxxxxx', Object(Mage_Core_Controller_Request_Http))
#10 app/code/core/Mage/Core/Model/App.php(1338): Mage_Admin_Model_Observer->actionPreDispatchAdmin(Object(Varien_Event_Observer))
#11 app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Admin_Model_Observer), 'actionPreDispat...', Object(Varien_Event_Observer))
#12 app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#13 app/code/core/Mage/Core/Controller/Varien/Action.php(528): Mage::dispatchEvent('controller_acti...', Array)
#14 app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#15 app/code/core/Mage/Core/Controller/Varien/Action.php(408): Mage_Adminhtml_Controller_Action->preDispatch()
#16 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#17 app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#19 app/Mage.php(683): Mage_Core_Model_App->run(Array)
#20 index.php(87): Mage::run('', 'store')
#21 {main}";s:3:"url";s:16:"/index.php/admin";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}


texts: Block traffic from USA but allow Google, Bing bots and Facebook catalogue uploads

texts:
I recently suffered 2 credit card attacks on my live site with traffic on the first attack coming from Singapore and on the second it came via the USA from someone in Vietnam.

By card attacks I mean someone added the cheapest item on our site to their basket and then submitted hundreds of payment cards through out checkout triyng to find which were valid. The first attack was circa 800 cards attempted and the second was circa 600 before I got alerts and shut the site down.

We don't sell other than in the UK as we run a Butcher's shop so I thought I'd block all traffic excluding EU and UK. We do sometimes get people pre-ordering from outside the UK if they holiday somewhere in the UK but this is rare.

I've added the following to my .htaccess file but now I'm getting Google, Bing and Facebook Catalogue problems and both Facebook catalogue uploads and SEO is being heavily impacted.

GeoIPEnable On

SetEnvIf GEOIP_COUNTRY_CODE UK AllowCountry
SetEnvIf GEOIP_CONTINENT_CODE EU AllowCountry

Deny from all
Allow from env=AllowCountry

I'm not that advanced on how to configure .htaccess and would really appreciate any advice you could offer.

What I'm trying to achieve is to block user traffic but allow services/bots / FB to reach me.

I hope that makes sense.


texts: Magento 2: How to restore the cart after canceled/failed payment?

texts:
I used following code, but it doesn't work, I still get an empty cart.

$comment = __('Payment has been canceled.');
if ($order->getId() && $order->getState() != Order::STATE_CANCELED) {
    $order->registerCancellation($comment)->save();
}
$session->restoreQuote();
$this->messageManager->addNoticeMessage($comment);
$this->_redirect('checkout/cart');


texts:
I am implementing add to cart functionality from ajax using product id.

This is my code of template file

                        11
                        Test 2

                        12
                        Test 2

Here is my controller file.

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

class AddItems extends Action {
protected $formKey;
protected $cart;
protected $product;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Data\Form\FormKey $formKey,
    \Magento\Checkout\Model\Cart $cart,
    \Magento\Catalog\Model\Product $product,
    array $data = []) {
        $this->formKey = $formKey;
        $this->cart = $cart;
        $this->product = $product;
        parent::__construct($context);
    }

public function execute()
 {
   $selectedItems = $this->getRequest()->getPost('selectedItems');
    echo '
';
    print_r($selectedItems);exit;
  try{
      $params = array(
                    'form_key' => $this->formKey->getFormKey(),
                    'product' => $selectedItems, //product Id
                    'qty'   =>1 //quantity of product
                );
        //Load the product based on productID
        $_product = $this->product->load($selectedItems);
        $this->cart->addProduct($_product, $params);
        $this->cart->save();
        $status = 1;
  }
  catch (\Magento\Framework\Exception\LocalizedException $e) {
         $this->messageManager->addException(
             $e,
             __('%1', $e->getMessage())
         );
          $status = 0;
     } catch (\Exception $e) {
         $this->messageManager->addException($e, __('error.'));
          $status = 0;
     }
    $result = array();
    $result['status'] = $status;
    $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
    $resultJson->setData($result);
    return $resultJson;
   }
 }

Here i need to read each element from the selectedItems array and add to cart. How this can be implemented.

If only item passed from the ajax , I need to add only one item to the cart.

Can anyone help me on this issue please.


texts: Magento New Product Page not updating group price

texts:
I'm updating group price for customer group using soap api. I can view the group pirce in detailed porduct page as well as in admin dashboard but not in new product page(home page).

After refresh the "Blocks HTML output" under cache Management & Reindex data(index management) manually, i can see the price.

Or "Manage Product -> Select Product -> Price Tab -> Press Save" without making any changes it appeared.

How can avoid this manual process each time ?


texts: Getting is_used_for_customer_segment error on open source migration

texts:
I am getting the error on a standard install of Magento 1.9.3.9 using Magento Sample Data and using the Migration to for Magento 2.2.6. These are both new vanilla installations.

I am getting the following error when migrating Open source 1.9 to Open source 2.2.6

Record structure does not contain field is_used_for_customer_segment

I thought this was an EE attribute?

I have tried adding this to the ignore in the map.xml and also in the map-eav.xml (Both did not work)


texts: enter button is redirecting to shopping cart

texts:
please visit this link :

http://kidsdial.com/soft-buddies-lying-love-dog-s-white-10-inch-3621.html

type any zip code and type "enter" using keyboard.

than its rediecting to checkout page.

I want to avoid that redirection ,

file for checking zip code = http://pastebin.com/jpXfM3Be

view.phtml = http://pastebin.com/GuWAYxbz

please help me to find solution


texts: Magento Module translations 1.9.3.0 problem

texts:
I am trying to translate a module for a few languages. I don't want to use inline translations because every person which is using module will have to change translations in theirs database, so I found method where I can create translation.csv file and put it in my extension package.

I want to translate labels in admin configuration panel, and after lecture of a few articles about translations, I've added this code inside  tag in config.xml:

<translate>
    <modules>
        <SalesManago_Tracking>
            <files>
                <default>SalesManago_Tracking.csv</default>
            </files>
        </SalesManago_Tracking>
    </modules>
</translate>

And then I created SalesManago_Tracking.csv files in two places:
app/design/adminhtml/default/default/locale/fr_FR/ (for example)
app/locale/fr_FR/

After that I've added translation for one of labels:

<api_secret translate="label">
       <label>Api secret</label>
       <frontend_type>text</frontend_type>
       <sort_order>20</sort_order>
       <show_in_default>1</show_in_default>
       <show_in_website>1</show_in_website>
      <show_in_store>1</show_in_store>
</api_secret>

So I've put a line in my csv file:"Api secret","Check translations!"

Looks ok, but when I change locale to France it doesn't work...
Can someone please tell me, what am I doing wrong ?
Thx!
(I turned off every of caches )


texts: Multiple Select - Render as url and search

texts:
I'm building a bookshop with Magento. I've some multiple select custom attributes for Authors and Translators.

I'd like to render their values as a link to the advanced search to list all products for that Author / Translator.

First Problem: The advanced search does not accept the string
/catalogsearch/advanced/result/?author="Name"
Second Problem: Can I render every item as a Link? for eg. something like this

< a href  =  "/catalogsearch/advanced/result/?author=  < ? php echo $_product->getAttributeText('author') ?>"> < ? php echo $_product->getAttributeText('author') ?>


texts: My site is taking 60 secs to load due to Slow Queries

texts:
My Sub Domain Magento Site /market is taking a full min to load up.

Upon careful scrutiny of Slow Query Log File provided by Webhost, there's one query that is taking a whopping 50 secs., details below,.

SELECT * FROM `sangyugk_sm_market_quickstart`.`catalog_product_index_price_idx`;
# Time: 160204 1:13:00
# User@Host: sangyugk[sangyugk] @ localhost []
# Thread_id: 592321 Schema: Last_errno: 1160 Killed: 0
# Query_time: 50.489651 Lock_time: 0.000041 Rows_sent: 228858 Rows_examined: 228858 Rows_affected: 0 Rows_read: 228858
# Bytes_sent: 3439001

Any thoughts or comments from more experienced Magento Techies ?

Could this be the query resulting on slow load up ?

There are other numerous Slow Queries that take 5 secs +, but this one caught my attention.

Pls help..


texts: How can add credit card, visa etc icon checkout magento 2?

texts: Add Payment Method Logo (credit card, Bank Transfer Payment etc) In checkout/#payment as like paypal icon in magento 2


texts: Magento 2.3.2 : Paypal Credit method not displaying in checkout

texts:
I have to upgrade magento2.2.0 to magento2.3.2. in old version PayPal credit payment displaying & working fine but upgrade version 2.3.2 is not displaying in checkout.

shipping step to payment step pass 3 methods but payment step in displaying only two.

Ref link - https://github.com/magento/magento2/issues/22525


texts:
My Magento store experiences a high amount of products that get added and then deleted. I have been asked to implement a 410 status code on these deleted pages but I am unsure how.

Looking at magento's core code i can see it handles 404's like so in the core indexController:

/**
 * Default index action (with 404 Not Found headers)
 * Used if default page don't configure or available
 *
 */
public function defaultIndexAction()
{
    $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
    $this->getResponse()->setHeader('Status','404 File not found');

    $this->loadLayout();
    $this->renderLayout();
}

/**
 * Render CMS 404 Not found page
 *
 * @param string $coreRoute
 */
public function noRouteAction($coreRoute = null)
{
    $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
    $this->getResponse()->setHeader('Status','404 File not found');

    $pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_NO_ROUTE_PAGE);
    if (!Mage::helper('cms/page')->renderPage($this, $pageId)) {
        $this->_forward('defaultNoRoute');
    }
}

/**
 * Default no route page action
 * Used if no route page don't configure or available
 *
 */
public function defaultNoRouteAction()
{
    $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
    $this->getResponse()->setHeader('Status','404 File not found');

    $this->loadLayout();
    $this->renderLayout();
}

Is there any way I can add a function to a deleted page to send a 410 header?


texts: Which file hold this layout {{layout handle="sales_email_order_items" order=$order area="frontend"}}

texts:
Is there anyone knows how or where to update the file for the email order notification template.

{{layout handle="sales_email_order_items" order=$order area="frontend"}}

Thank you,
JM


texts: What is the best way to change ordered product price when the order is submitted, on sales_order_place_before or similar event.


texts: Magento2 : How to show as separate lines for each discount on cart page?

texts:
In magento2 - Anybody please let me know how we can separate the discounts on cart page on different lines.
For example: I have a basic discount $5 for all products and I'm applying a promotion code which gives $10 discount.
Currently magento2 showing this discount as:

Discount | promotion-code $15

But I need to display it as:

Discount | promotion-name(Promotion without discount code) $5

Discount | promotion-code(Promotion with discount code) $10


texts: Magento 2.3 no files in folder after installation

texts:
No files into installation folder after web installation.

I'm trying to install Magento 2.3 on Aruba hosting  so to avoid the sql permission denied I disabled checkDatabaseName and checkDatabasePrivileges checks in setup\src\Magento\Setup\Validator\DbValidator.php (line number 106).
The php version installed is 7.2.13.
The Readiness check is successful and the installation ended without errors after all the steps, the database has been created without issues and I can see the tables into it.

The installation folder is empty and when I try to restart the setup the message is "Welcome to Magento Admin, your online store headquarters.
To use the Magento setup wizard sign into your Admin account and navigate to System => Tools => Web Setup Wizard".

No errors found into install.log and debug.log.
I could retry to install using command line but I need to understand why this happen?


texts:
A simple question because google didn't help: In magento admin (coupons, price rules etc.) the "from date" and "to date" fields start at 00:01 that day and end at 23:59 on end date (dates are inclusive?)?

Thanks!


texts: Magento 2: Can I set a completely custom API endpoint without /rest/V1/?

texts:
I built a custom module with some API endpoints.
For some technical 3rd party requirements, I need to remove the /rest/V1/ from the URLs (only for my module routes).
e.g. - Instead of domain.com/rest/V1/my-endpoint, use domain.com/my-endpoint
Is there a standard way for doing that?

I know that I can use controllers & routes instead, but I want to use the API.
.htacces is also not a solution.

Thanks.


texts: how to create custom tab with content in product attribute admin magento 2?

texts: i want to add content with file input and current attribute value.


texts: Help with adding script codes between  in success.phtml

texts:
Hope someone can help me with this. It's very easy to do I bet, I'm just not used to magento yet.

I'm adding Google Ads to my magento (1.9).. I need to add this script code:

<!-- Event snippet for ads page -->
<script>
  gtag('event', 'conversion', {
      'send_to': 'AW-8xxxxxxxxxxxxxxxxxx',
      'value': 1.0,
      'currency': 'USD',
      'transaction_id': ''
  });
</script>

only in "order success" page (which is success.phtml). It has to be in Head. I know that I can't just add the code in success.phtml file. From my research, I have to mess with layout/local.xml file.

Could someone explain to me how to do this? Much appreciate!


texts: Sales email layout not showing proper Magento 2

texts:
I am using clue theme for Magento 2.3.There is an issue with my all transactional email.

Please check my order email layout.

If i switch the theme to luma and check order email then it looks fine.

Expected email template like,

I have called css/email.css in my custom module in using this less CSS. Magento_Sales/web/css/source/_email.less.But it not load into the admin.Please check attached screenshot.


texts: How to add Twenty Twenty(Image Before & After) in magento2.4.2

texts:
I need to add a picture comparison function. This is the code Twenty Twenty I need, it looks very good, and it's free. But we don't know how to make it run.
Twenty Twenty Download Link https://zurb.com/playground/twentytwenty
Thank you everyboby.


texts: Magento, Override local controller with other local controller

texts:
I am trying to override local codepool extension controller with the other local extension, but its not working, don't know the reason, firstextension is the extension I want to override by secondextension

here is my code

config.xml

<admin>
    <routers>
        <firstextension>
            <args>
                <modules>
                    <Namespace_secondextension before="Namespace_Firstextension">Namespace_secondextension_Adminhtml</Namespace_secondextension>
                </modules>
            </args>
        </firstextension>

    </routers>
</admin>

and controller

<?php

  require_once 'local/Namespace/Firstextension/controllers/Adminhtml/CustomController.php';
  class Namespace_Secondextension_Adminhtml_CustomController extends Namespace_Firstextension_Adminhtml_CustomController
  {
      public function saveAction()
      {
      }
  }


texts:
I am trying to export magento product on a csv file using Import/Export->Data-Profiles, The profile is running but for some reason the script does not include product qty, I have this on my function

function exportProduct($profileID){
    global $mageFile;
    require_once($mageFile.'app/Mage.php');
    Mage::init();
    $profile = Mage::getModel('dataflow/profile');
    $profile->load($profileID);
    if (!$profile->getId()) {
    Mage::log('error: ' . $profileID . ' - incorrect profile id',null,'product_import.log');
        return;
    }
    Mage::register('current_convert_profile', $profile);
    $profile->run();

}

But after i run my profile qty column is empty. Any help would be appreciated, Thank you in advance.


texts: EAV default attribute value not taking effect

texts:
I'm trying to update an EAV attribute's default value, but the new default is not pulling through.

The attribute is

                'include_in_menu'    => array(
                    'type'                       => 'int',
                    'label'                      => 'Include in Navigation Menu',
                    'input'                      => 'select',
                    'source'                     => 'eav/entity_attribute_source_boolean',
                    'default'                    => '1',
                    'sort_order'                 => 10,
                    'global'                     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
                    'group'                      => 'General Information',
                ),

Mage_Catalog_Model_Resource_Setup::getDefaultEntities() ln 325

It was added in app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.21-1.4.0.0.22.php, with the default value being '1'.

I need to set the default value to '0', and have created an update script:

<?php
/* @var $this Mage_Core_Model_Resource_Setup */
$installer = $this;

$installer->startSetup();

// set Include in Navigation Menu under Display Settings to default NO for new categories
$installer->updateAttribute('catalog_category', 'include_in_menu', 'default_value', '0');

$installer->endSetup();

This affects the new category form, when adding a new root or sub category, but the field still defaults to 'Yes'.

There has not been any other code added to affect that field, but when I debug, when the block gets created in Mage_Core_Model_Layout::createBlock it's returned the field is set to '1' and not '0' as expected.

Could anyone help me analyze this problem? I have checked the DB and the default value was updated by the update script, and when the attributes are loaded the default value of include_in_menu is '0'.


texts: How to Access Magento2.3 Instance with PWA

texts:
I have successfully completed the steps to install the PWA in Our Magento 2.3 version with PWA Studio.

Here is the completion screen.

Even after PWAserver Ready the url not working (Assuming its a Venia local server URL and not be accessible through the Internet)

Can anyone help me out, How to access our magento instance with PWA?

Thanks in advance for your time and Support.

Thanks!!


texts: "Row Size Exceeding 65535" while this seems impossible

texts:
I'm getting this error:

  Row Size Exceeding 65535

There are a lot of posts out there discussing the maximum row size in catalog_product_flat_x exceeding 65535 bytes. I have only about 150 attributes including the double entry _values for the select attributes. If all attributes were 255 bytes (which they aren't), the maximum number of bytes that I could have is 38,250 bytes far less than the 65,535 byte limit. The actual data in each row is significantly lower than that.

I deleted all of the catalog_product_flat_x tables, reindexed and am still getting this crazy error. I am on my way to having 4000 products and need this capability.

Any insight would be helpful


texts: What js is used when add new customer address in Magento 2?

texts:
In Magento 2 when create new customer, there is address tab and when i click new address there is a js running that render the address field, but i don't know which one, i want to extend that js so i can insert my custom function from my extension,

Here's the figure of add new address and inspect element:

when i click add new address there are 2 files which triggered by js, and i want to know what js that calls them

EDIT

i've tried add mixin, requirejs-config.js:

var config = {
    config: {
        mixins: {
            'Magento_Ui/js/form/components/collection': {
               'NamespacE_Module/js/form/components/collection-mixin': true
            }
        }
};

collection-mixin.js :

    /**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
define([
    'jquery',
    'mage/utils/wrapper'
], function ($, wrapper) {
    'use strict';
    return function(collection){
        var newFunction = collection.addChild;
        var newFunction = wrapper.wrap(newFunction, function(original){
            //do extra stuff
            console.log('before');
            //call original method
            var result = original();
            console.log('after');
            //do extra stuff

            //return original value
            return result;
        });

        collection.addChild = newFunction;
        return collection;
    };

});

the function i want to add is after addChild function which is the original function from collection.js


texts: Controller observer is not triggered using ajax request

texts:
I am using this event:
controller_action_predispatch_sales_order_create_showUpdateResult

this is my xml code:

    <controller_action_predispatch_sales_order_create_showUpdateResult>
        <observers>
            <mynamespace_mymodule_controller_action_predispatch_sales_order_create_showUpdateResult>
                <class>Mynamspace_Mymodule_Model_Observer_MyClass</class>
                <method>myMethod</method>
            </mynamespace_mymodule_controller_action_predispatch_sales_order_create_showUpdateResult>
        </observers>
    </controller_action_predispatch_sales_order_create_showUpdateResult>

This is my class:

class Mynamspace_Mymodule_Model_Observer_MyClass
{

    public function myMethod($observer)
    {
        Mage::log('Tralala', Zend_Log::ERR, 'mylog.log', true);
    }
}

This is the controller from ajax :sales_order_create/showUpdateResult/. It s about updating the items from cart from adminpanel. I would like to trigger an observer when that ajax request is called. For some reason it doesn;t work. What am I missing ?

Thank you


texts: Add to Cart button not translating on submission

texts:
The "Add to Cart" Button text is not translating correctly after the product has been added to the cart. Please see below for screenshots of the issue.

On product page load, the translation for the "Add to Cart" is working as expected and button is translated to "Add to Basket" as shown in the image below.

The Product goes through the process of being added to the cart as expected, but when the add to cart process is completed the "Add to Cart" button shows the default string rather than the translation as show in the image below.

How can i fix it, thank you!


texts: How Can I Bulk Import ShoppingCart Price Rule SKU'S into Conditions And Actions

texts:
I want to add bulk SKU's in Conditions and Actions,  is any possible to bulk import sku's to Conditions and Actions,

Screen Shots:


texts:
I am using Magento 2.3.1 Open Source.  I installed it from the .zip file in the public_html folder (I didn't know any better at the time) in my account at my web host, running on Apache.

I did the Magento Security Scan on my website, and it showed the following problem-

Your Web server is configured to run Magento from %MAGENTO_ROOT% directory.

It is recommended to set %MAGENTO_ROOT%/pub as a Web server root directory.

In response I found my way to this page

  https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html

which had instructions to fix the problem, but they seem to only apply to installations
that are not on shared web hosting plans.

I tried to find the files that contain the document root url through SSH-ing into the shared server just in case, but since I don't have root access it didn't show.

I contacted my hosting provider twice to change the document root for me through /var/cpanel/userdata/username/example.com, but since there is a language barrier, they told me that that was beyond their expertise, or something like that.

My site is run under https, of course, if that helps any.

I am not too security savvy with Magento, so what I want to know is, if I use the .htaccess commands below to change the document root, would they alone make my Magento installation in public_html secure?-

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/pub/

RewriteCond %{HTTP_HOST} ^(www\.)?example\.

RewriteRule ^(.*)$ /pub/$1 [L]

Do I need to move/copy any Magento files from public_html to public_html/pub if I use the .htaccess commmands above, if so, which files?

If I leave the Magento files in public_html and use the rewrite commands, will that be a security problem?

Do I need to change any settings in the Magento Admin after using the rewrite commands?

Thank you very much.


texts: Editing home page html code in RWD theme

texts:
I'm using the RWD theme in the latest Magento CE. I want to edit the homepage only to have a 100% width container within the page content section. I realise I can do this in CSS but it will affect any other element with the same class. How do I go about editing the html for this page only? I presumed it would be in the 1 column phtml - I believe below is the relevant code but I can't see the div class in the content.phtml file either.

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

Any help much appreciated.


texts:
What is the alternative of below in magento 2
/** @var Mage_Sales_Model_Order_Creditmemo $creditmemo */
$creditmemo = $service->prepareInvoiceCreditmemo($invoice, $data);


texts:
I am using the fastsimpleimport module to create my custom import. This has a setDropdownAttributes() function to automatically create needed attribute values but it does not remove unused values. Those still show up in my advanced search.

How can I search and remove unused attribute values?

I think they are stored in eav_attribute_option_value but I am not sure how to check if they are used by a product.


texts: How to change the layout of category page when user logged in magento 2?

texts: I want to change category layout when user/customer successfully logged in. I had a normal category page with 2 column layout for public user(not login) and I want to change into 1 column when user logged in.


texts: Magento 2.2.3 slows down server and too many php processes running

texts:
We have magento 2.2.3 configured and has been working fine. Recently we had some issues with our smtp server (which is fixed now) but I notice there are too many PHP processes running all the time. and it slows down the server a lot. any ideas?

I think it may have something to do with the emails and it may be sending the emails it missed during the time our SMTP server had issues, I am getting sales@ourserver.com has exceeded its 24-hour sending limit. Messages to 252 recipients out of 250 allowed have been sent.


texts: Magento 1.8 getBlockHtml('formkey'); ?> code shows " /> and also can't login

texts:
Am using Magento 1.8 in my store all view.phtm page after form showing one code like

<input name="form_key" type="hidden" value="<esi:include src=" https:="" www.abc.in="" varnishcache="" getformkey="" "="">" />

I think this code will shows

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />


texts: How to activate customer accounts in bulk?

texts:
After applying the patches:

SUPEE-10415
SUPEE-10570
SUPEE-10752
PATCH-PHP72

In a Magento v.1.9.3.6 all clients get the message 'This account is not activated.' when trying to login.

How can I restore all customer accounts massively? ('admin' or database)

Can it be a problem with any of the patches?


texts: Magento 2 : How can I test save and delete model?

texts:
I have the problem with writing unit tests. It's my first attempt and I don't know how can I test a couple of cases in my code.

It's action in my controller:

    public function execute()
    {
            $params = $this->getRequest()->getParams();
            $redirect = $this->_redirect('*/*');
            if ($params) {
                $redirect->setMetadata('params', true);
                try {
                    $customerId = $this->_customerHelper->getCustomer()->getId();
                    $this->_reportModel->getCollection()
                        ->addFieldToFilter('customer_id', $customerId)
                        ->addFieldToFilter('type', Entity::CUSTOMER_PREASEASON)
                        ->getFirstItem()
                        ->delete();

                    $this->_reportModel->setData([
                        'customer_id' => $customerId,
                        'type' => Entity::CUSTOMER_PREASEASON,
                        'extra_data' => serialize([
                            'year' => $params['year'],
                            'season' => $params['season']
                        ]),
                    ])->save();
                    $this->messageManager->addSuccessMessage('You request will be processed');
                    return $redirect;
                } catch (Exception $exception) {
                    $this->messageManager->addErrorMessage('Some occurred error');
                }
            }
            $redirect->setMetadata('params', false);
            return $redirect;
}

I have to test such cases:

   $this->_reportModel->getCollection()
                        ->addFieldToFilter('customer_id', $customerId)
                        ->addFieldToFilter('type', Entity::CUSTOMER_PREASEASON)
                        ->getFirstItem()
                        ->delete();

And

$this->_reportModel->setData([
                    'customer_id' => $customerId,
                    'type' => Entity::CUSTOMER_PREASEASON,
                    'extra_data' => serialize([
                        'year' => $params['year'],
                        'season' => $params['season']
                    ]),
                ])->save();

How can I do this? should I initialize $this->_reportModel as real model and save it?  Or create Mock ($this->_reportModelMock) and set condition for it and do like:

$this->_reportCollectionMock->expects($this->once())
            ->method('getFirstItem')
            ->willReturn($this->_reportModelMock);

Maybe I'm wrong and it's not the right way. I will be very grateful if you help me ))) also I will  grateful for an example similar to my problem


texts: Review link problem in review form on product page

texts:
I couldn't understand why short review is linkable and which page  should it be redirect to

it show 404 error
here's my review file it doesn't work for me..

public_html/app/design/frontend/default/sns_nova/template/review/view.phtml

<?php if($this->getProductData()->getId()): ?>

<?php echo $this->__('Review Details') ?>

        <a href="<?php echo $this->getProductData()->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getProductData()->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($this->getProductData(), 'small_image')->resize(125, 125); ?>" height="125" width="125" alt="<?php echo $this->htmlEscape($this->getProductData()->getName()) ?>" />
        <?php if( $this->getRating() && $this->getRating()->getSize()): ?>

<?php echo $this->__('Average Customer Rating') ?>:

             <?php echo $this->getReviewsSummaryHtml($this->getProductData()) ?>
        <?php endif; ?>

<?php echo $this->htmlEscape($this->getProductData()->getName()) ?>

        <?php if( $this->getRating() && $this->getRating()->getSize()): ?>

<?php echo $this->__('Product Rating:') ?>

            <?php foreach ($this->getRating() as $_rating): ?>
                <?php if($_rating->getPercent()): ?>

                        <?php echo $this->__($this->escapeHtml($_rating->getRatingCode())) ?>

                                <div class="rating" style="width:<?php echo ceil($_rating->getPercent()) ?>%;">

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

        <?php endif; ?>

                <?php echo $this->__('Product Review (submitted on %s):', $this->dateFormat($this->getReviewData()->getCreatedAt())) ?>

                <?php echo nl2br($this->htmlEscape($this->getReviewData()->getDetail())) ?>

<a href="<?php echo $this->getBackUrl() ?>">&laquo; <?php echo $this->__('Back to Product Reviews') ?>

<?php endif; ?>


texts: purchase orders are processed in grid table view but in of detail order it shows completed in magento 1.9

texts: I am using magento 1.9.In history some entries are looks processing but in details of this purchase order it is completed.All entries are from last year. How may I get resolution for this.


texts:
I have configured OG tags in "default_head_blocks.xml" head section ,then I open index page in view page source og tags are not there.

<meta property='og:title' content="test" />
    <meta property="og:type" content="website"/>
    <meta property='og:description' content="test" />
    <meta property='og:url' content="test" />
    <meta property='og:image' content="test" />

can any body suggest proper way to do this.I'm using Magento 2.3
Thank you.


texts: Display Custom Options from parent product in Magento 2

texts: I have custom router and if there is a custom attribute in url, simple product is loaded instead of configurable parent. Simple product is loading correctly, but i cant manage to load custom options from configurable parent. Is this possible or simple has to have these options assigned as well?


texts:
I'm looking for a way to add the ability to enforce an end user to acknowledge a policy before they purchase specific items in the store.

I'd prefer it happen when the item is added to the cart. What is the best way to get that done? I'm relatively new to Magento, and I have searched existing add-ons, but am having no luck coming up with a solution.


texts: Show cart contents on onepage checkout 1.9.1

texts:
I am using the RWD default theme, default installation. I've tried a lot of the methods mentioned in other Magento versions to show the cart contents on the onepage checkout in 1.9.1 but have yet to have any success.

The contents do show from the drop-down on-click cart, but would like to see a constant visible 'mini-cart' above or below the onepage checkout progress field. I've seen a lot of "onepage" checkout modules with this feature, but want to try and keep everything as 'core' as possible.


texts: Can you set the selected payment option in admin?

texts:
I'm trying to change the selected payment option in the checkout and noticed its being checked with this:

<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?>

I'm presuming getSelectedMethodCode is coming from the admin somewhere? If so does anyone know where it's being set please?


texts: Magento 2 searches by words inside the text

texts:
How to customize the search so that it searches by words inside the text

I tried <queryReference clause="must" ref="search" />, but it didn't help.

We have part numbers in our catalog and the Magento 2 search would only search if you type a query that PN starts with. For example, I have WD5000AAKS part number, if I search for WD5000 it would give me the right results


texts: How to Remove description text from product slider - Luma Theme

texts:
Please check. Luma Theme

This one is from website Homepage Product tab
This is Product slider / carousel Magento - It's coming from block.

My question is - Can we remove description lines. If yes, then please suggest how to do it?

Thanks


texts: Need hosting suggestion for multiple magento installation

texts:
I want to install 20 magento on single hosting one domain.

this stores will be use for demo purpose not real store.

which is advisable shared hosting plan or vps or reseller plan ?

any recommendation ?


texts: How to show error message in Magento 2 checkout page

texts:
I'm developing Magento 2 extension. I've added controller_action_predispatch_checkout event observer and trying to add a error message via ManagerInterface.

events.xml:

<event name="controller_action_predispatch_checkout">
    <observer name="controller_action_predispatch_checkout" instance="<namespace>\<module>\Observer\CheckoutPredispatchObserver" />
</event>

CheckoutPredispatchObserver.php:

class CheckoutPredispatchObserver implements \Magento\Framework\Event\ObserverInterface {

private $messageManager;

public function __construct(\Magento\Framework\Message\ManagerInterface $messageManager) {
    $this->messageManager = $messageManager;
}

public function execute(\Magento\Framework\Event\Observer $observer) {
    $this->messageManager->addErrorMessage("Custom error message");
}

}

However, my error message is not displayed in checkout page:

Instead, I can see my error message twice in checkout success page:

  How can I make my error message appear in Checkout page but not in
  further pages?


texts: Cannot Initialize the reindexer process?

texts:
I have uploaded the folders of a new theme into the root folder of magento and then when i am trying to re-index all  the files it is showing :

  cannot initialize the re-indexer process.

I have refreshed all cache but its still not working. Please help me to solve this.


texts: I know that by making your own folder in code/local, you can override the Magento 1.9 core model. But if I want to override an 3rd party extension I've installed, what should I do? I don't want to change the code of an extension / module directly in it's folder, since it will cause the problem if there's update version later.


texts: How to set is_in_stock to 0 for configurable product when all associated products are out of stock?

texts:
I am using a third party service to generate and submit the product feed to Google.This service uses is_in_stock field from the cataloginventory_stock_item database table to check if the product is in stock or not?

I have check in the default Magento even if we make all the associated products of a configurable product out of stock the is_in_stock value is set to 1 only.

Or do we have any other attribute in any of Magento table which may help?
Is there any way to work around this thing.


texts:
I want to get URL which is passed in the address bar but problem is that in my .htaccess there is a code for the rewrite I don't know for that reason or something else I got other URL which is not matched with my browser URL

Browser URL is
https://www.example.com/category/112-model+name-azx+xza.html

And with this code "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"

I got http://www.example.com/azx-xza-asd.html" Which is stored in product detail

I want  https://www.example.com/category/112-model+name-azx+xza.html


texts: Magento 2 : How to add a product grid (assign product) in custom module using UI Component?

texts:
I want to add product grid (assign product) in my custom module using UI Component.

I follow this ANSWER:

Magento 2 : How to add a product grid in custom module using ui component?

and I get the error like:

  Fatal error: Call to undefined method
  Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::getProductsReadonly()
  in
  /home/public_html/magento2110/app/code/[Namespace]/[Module]/Block/Adminhtml/Products/Edit/Tab/Product.php
  on line 133

If you already fixed above error so please help me to solve it or
If you have another way to fix it so please let me know.

Thanks in Advance!


texts:
i am using the magento2 api V1/Search for getting search results.
It also returns the filter. The price filter is not coming in this.
Please advise.

http://stage.augvue.com/rest/V1/search?searchCriteria[requestName]=quick_search_container&searchCriteria[filterGroups][0][filters][0][field]=search_term&searchCriteria[filterGroups][0][filters][0][value]=rings


texts: How to get MOQ from the product by using object manager?

texts: HI How can I get MOQ of product by using object manager?