texts: In frontend menu, the links are not popping out when in hamburger menu is clicked

texts:
In magento 2 ..while responsive mode the hamburger menu gets displayed. but when clicking on the menu the hamburger menu is not popping out links. I don't know why.?

this is my sections.phtml file placed in

E:\xampp\htdocs\magento2\app\design\frontend\vendor\theme\Magento_Theme\templates\html\sections.phtml

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php

/**
*  General template for displaying group of blocks devided into sections
*/

$group = $block->getGroupName();
$groupCss = $block->getGroupCss();
$groupBehavior = $block->getGroupBehaviour() ? $block->getGroupBehaviour() : '{"tabs":{"openedState":"active"}}';
?>
<?php if ($detailedInfoGroup = $block->getGroupChildNames($group, 'getChildHtml')):?>
    <div class="sections <?php /* @escapeNotVerified */ echo $groupCss ?>">
        <?php $layout = $block->getLayout(); ?>
        <div class="section-items <?php /* @escapeNotVerified */ echo $groupCss ?>-items" data-mage-init='<?php /* @escapeNotVerified */ echo $groupBehavior ?>'>
            <?php foreach ($detailedInfoGroup as $name):?>
                <?php
                    $html = $layout->renderElement($name);
                    if (!trim($html) && ($block->getUseForce() != true)) {
                        continue;
                    }
                    $alias = $layout->getElementAlias($name);
                    $label = $block->getChildData($alias, 'title');
                ?>
                <div class="section-item-title <?php /* @escapeNotVerified */ echo $groupCss ?>-item-title" data-role="collapsible">
                    <a class="<?php /* @escapeNotVerified */ echo $groupCss ?>-item-switch" data-toggle="switch" href="#<?php /* @escapeNotVerified */ echo $alias; ?>"><?php /* @escapeNotVerified */ echo $label; ?>

                <div class="section-item-content <?php /* @escapeNotVerified */ echo $groupCss ?>-item-content" id="<?php /* @escapeNotVerified */ echo $alias; ?>" data-role="content"><?php /* @escapeNotVerified */ echo $html; ?>

            <?php endforeach;?>

<?php endif; ?>

thanks in advance


texts: Fixed shipping rates by quantity and product type

texts:
A client of mine is interested in calculating shipping using fixed prices. These prices change by product type and quantity.

For example:

Clothing

| Quantity | Shipping Amount |
|----------|-----------------|
| 1        | $3              |
| 2        | $5              |
| 3        | $7              |
| 4        | $8              |
| 5        | $9              |

Misc. Products

| Quantity | Shipping Amount |
|----------|-----------------|
| 1        | $2              |
| 2        | $4              |
| 3        | $6              |
| 4        | $7              |
| 5        | $9              |

1x clothing + 2x misc. items = $3 + $4 = $7 (total shipping)

Achieving this is Magento 2

Before building this as a custom module, or purchasing an existing module, I would like to know if this is possible in the out-of-the-box Magento 2.1 platform. Table rates appear to be the closest match to the functionality I'm after, but the conditions assume the calculations are affected by destination.

Purchase a Module

I've identified several "advanced shipping" modules. Some allow pricing by attribute, which is an almost-solution. Are there any known modules that I may have overlooked, which can achieve what I'm looking for?

Custom Module

My initial thoughts are to create a rate management module where my client may enter a list of quantities and their corresponding rates, then assign those rates to a value of a custom attribute. A default set of rates would be used if a product does not contain the custom shipping attribute.

Ideally, I would prefer to avoid building a new module if an existing solution is available. I'm looking for recommendations from developers who have more experience with the Magento 2.* platform.

thank you


texts: override community controller in local codepool

texts:
i need to override community controller with my extension controller in local. Here is path for community controller class.

app\code\community\Unirgy\DropshipPo\controllers\Adminhtml\Order\PoController.php

here is config.xml for community module.

<admin>
    <routers>
        <udpoadmin>
            <use>admin</use>
            <args>
                <module>Unirgy_DropshipPo_Adminhtml</module>
                <frontName>udpoadmin</frontName>
            </args>
        </udpoadmin>
    </routers>
</admin>

Code in my config.xml is as

           <admin>
                 <routers>
        <udpoadmin>
            <args>
                <modules>
                    <Guru_Parallelpaypalcheckout before="Unirgy_DropshipPo_Adminhtml">Guru_Parallelpaypalcheckout</Guru_Parallelpaypalcheckout>
                </modules>
            </args>
        </udpoadmin>
                 </routers>
           </admin>

My code is not working and controller is not overidden.

Thanks in advance.


texts: Injecting object through virtual type not working

texts:
I am using this config in di.xml

 <virtualType name="ourFirstVirtualType" type="Test\Testmod\Model\Newmodelclass">
        <arguments>
            <argument name="test_object" xsi:type="object">Test\Testmod\Model\Example2</argument>
        </arguments>
    </virtualType>

    <type name="Test\Testmod\Model\Modelclass">
        <arguments>
            <argument name="the_object" xsi:type="object">ourFirstVirtualType</argument>
        </arguments>
    </type>

This is the Modelclass

<?php

namespace Test\Testmod\Model;
class Modelclass
{
    public $testProperty;
    public function __construct(Newmodelclass $the_object)
    {
        $this->testProperty = $the_object;
    }
}

and this is Newmodelclass

<?php

namespace Test\Testmod\Model;
class Newmodelclass
{
    public $newTestProperty;
    public function __construct(Againnewmodelclass $test_object)
    {
        $this->newTestProperty = $test_object;
    }
}

Now I am trying to test virtual type with this controller

<?php
namespace Test\Testmod\Controller\Index;

use Test\Testmod\Model\Modelclass;
use Test\Testmod\Model\Newmodelclass;
use Test\Testmod\Model\Againnewmodelclass;

class Index extends \Magento\Framework\App\Action\Action
{
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        Modelclass $Modelclass,
        Newmodelclass $Newmodelclass,
        Againnewmodelclass $Againnewmodelclass
    ) {
        parent::__construct($context);
        $this->Modelclass = $Modelclass;
        $this->Newmodelclass = $Newmodelclass;
        $this->Againnewmodelclass = $Againnewmodelclass;
    }

    public function execute()
    {
        echo "<pre>";
        var_dump($this->Modelclass);
        var_dump($this->Newmodelclass);
        var_dump($this->Againnewmodelclass);
        die;
    }

}

I think this should work correct right but giving this error instead

  PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Test\Testmod\Model\Newmodelclass::__construct() must be an instance of Test\Testmod\Model\Againnewmodelclass,
      instance of Test\Testmod\Model\Example2 given, called in /var/www/html/magento226/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111
      and defined in /var/www/html/magento226/app/code/Test/Testmod/Model/Newmodelclass.php:7


texts: Get Disabled Products Quantities by Sku And Id

texts:
is this possible?  I can't restructure the tables over again every time I need to run a certain dependent function.

        $catSQL = "SELECT *
        FROM `catalog_product_entity_int`
        WHERE `attribute_id` =96 //our status attribute id
        AND `value` =2"; //disabled value

This  gets all disabled products.  However, this table is indexed by Id.  I'm passed a number of sku's, how can I merge this table with something like
catalog_product_entity and search by an array of skus? Essentially I need to get the Id of all disabled products and then check their quantities in the stock_item table.

Thanks to Marius below i've acomplished the above with the following:

function getDisabledIdsFromSkus($arraySkus){
        $conn = Mage::getSingleton('core/resource')->getConnection('core_write');

        $ComponentSkustring = $this->format($arraySkus);

        $anotherRoute = "SELECT k.`qty`
        FROM `catalog_product_entity` i
        LEFT JOIN catalog_product_entity_int e ON i.entity_id = e.entity_id
        RIGHT JOIN cataloginventory_stock_item k ON i.entity_id = k.item_id
        WHERE e.`attribute_id` =96
        AND e.`value` =2
        AND i.`sku` IN ($string)
        ORDER BY i.`sku` ASC ";

        $componentQuantities = ($conn->fetchAll($anotherRoute));
        Mage::log(print_r($componentQuantities, true));
            return;
}

private function format($array)
{
    // initialize variable
    $formattedArray = array();

    //for each element
    foreach ($array as $string) {
        //append quotes
        $formattedArray[] = "'" . $string . "'";
    }

    //convert formatted elements to string and return
    $formattedString = implode(',', $formattedArray);
    return $formattedString;
}


texts:
I am trying to rewrite app/code/core/Mage/Catalog/controllers/Product/CompareController.php. In my config.xml I have the following:

<frontend>
  <routers>
    <catalog>
      <args>
        <modules>
          <Slice_CustomCompare before="Mage_Catalog">Slice_CustomCompare_Catalog_Product_Compare</Slice_CustomCompare>
        </modules>
      </args>
    </catalog>
  </routers>
</frontend>

and in app/code/local/Slice/CustomCompare/controllers/Product/CompareController.php I have:

<?php
require_once(Mage::getModuleDir('controllers','Mage_Catalog').DS.'CompareController.php');
class Slice_CustomCompare_Product_CompareController extends Mage_Catalog_Product_CompareController {

  public function removeAction() {
    Mage::log('Slice_CustomCompare_Product_CompareController:removeAction');
  }
}
?>

When I try to remove a product from the compare list I don't get Slice_CustomCompare_Product_CompareController:removeAction in my logs. Instead I get output that I added to the method in the core code. What am I missing? Why is my rewrite not working?


texts: In magento2 after installation and setting luma as default template why there is no blocks and images in frontend end

texts:
I did complete installation backend is good but frontend doesnt load images and blocks . Whats the reason for it
Backend is working preety fine
Need some help


texts: Magento 2.4 installation using composer MagentoHackathon/Composer/Magento/Plugin.php failed to open stream: No such file or directory), rolling back

texts:
I am trying to install Magento2.4 Open source on the following setup.
VirtualBox 6.1 on Windows 10
Nginx server
Ubuntu 20.4 server installed on the Virtualbox
Php  7.3.20
Command used:
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .
I have given 0777 permission to /var/www/html/qa.magento.com/ directory
I am getting following error
Plugin installation failed (include(/var/www/html/qa.magento.com/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php): failed to open stream: No such file or directory), rolling back
Detailed Error:
muk@muk:/var/www/html/qa.magento.com$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .
Creating a "magento/project-community-edition" project at "./"
Installing magento/project-community-edition (2.4.0)
  - Installing magento/project-community-edition (2.4.0): Loading from cache
Created project in /var/www/html/qa.magento.com/.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 526 installs, 0 updates, 0 removals
  - Installing magento/magento-composer-installer (0.1.13): Loading from cache
Plugin installation failed (include(/var/www/html/qa.magento.com/vendor/magento/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php): failed to open stream: No such file or directory), rolling back
  - Removing magento/magento-composer-installer (0.1.13)

  [RuntimeException]
  Could not delete /var/www/html/qa.magento.com/vendor/magento/magento-composer-installer/src/MagentoHackathon:

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

Following sudo chown -R www-data:www-data /var/www/html/ command is not changing the ownership.
Update:
All the above works if I use Ubuntu Server 18.04 instead of Ubuntu Server 20.04


texts: Magento 1.9 Obsever testing failed - Mage::log not generated

texts:
My observer :

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

config.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Gta_ExtraFeesRemove>
            <version>1.0.0</version>
        </Gta_ExtraFeesRemove>
    </modules>
    <global>
        <models>
            <gta_extrafeesremove>
                <class>Gta_ExtraFeesRemove_Model</class>
            </gta_extrafeesremove>
        </models>
    </global>
    <frontend>
        <events>
            <salesrule_rule_save_before>
                <observers>
                    <Gta_ExtraFeesRemove_Model_Observer>
                        <type>singleton</type>
                        <class>Gta_ExtraFeesRemove_Model_Observer</class>
                        <method>beforecheckout</method>
                    </Gta_ExtraFeesRemove_Model_Observer>
                </observers>
            </salesrule_rule_save_before>
        </events>
    </frontend>
</config>

observer :

 <?php
    class Gta_ExtraFeesRemove_Model_Observer
    {
        public function beforecheckout(Varien_Enent_Observer $Observer)
        {
            $event = $observer->getEvent();
            Mage::log($event->debug());
            Mage::log('Hy observer called', null, 'logfile.log');
        }
    }
?>

log file not generated at var/log location


texts:
I am allowing user to apply some discount amount on cart page. When user clicks on checkbox or enter manually, it will call ajax action and display the discount amount in cart totals block as shown below.

How can I load cart totals block using ajax and show discounted amount, when user clicks on checkbox ?

[EDIT]

Note: This question has been asked before, but as I still do not have an answer for it or some code flow, it compelled me to ask it again. You can still post some reference close to this question in terms of ajax with magento and container updaation.

Thanks.


texts:
Is the best way to build up an array of attributes from a configurable

if($_product->getTypeId() == "configurable")
{
   $simpleProducts = $_product->getTypeInstance(true)->getUsedProductCollection($_product);

   $attributeOptions = array();
   foreach ($simpleProducts as $simpleProduct)
   {
       $myproduct = Mage::getModel('catalog/product')->load($simpleProduct->getId());
       $baseColour = $myproduct->getAttributeText('basecolour');
       $attributeOptions[] = $baseColour
    }
}


texts:
In my file

  app/design/frontend/Eadesignro/a1turbo/Magento_Catalog/templates/product/view/attribute.phtml

I have to test if user is logged and if he is a b2b user.
I test if user is logged with these lines of code:

$_loggedin = $this->helper('Magento\Checkout\Helper\Cart')->getCart()->getCustomerSession()->isLoggedIn();
if( $_loggedin )
    echo 'LOGGED';
    else echo 'NOT LOGGED';

But how can I check if the user is a b2b user? thank you!


texts: How to get URL rewrites working correctly?

texts:
When trying the URL rewrites, all the links break in a clean install of Magento 1.9.0. I would rather have mysite.com/category/category instead of mysite.com/index.php/category/category. How do you get this configured correctly? I already have the correct settings under the apache config.

I also don't know enough about Magento yet, so I don't know what data to provide. Anything else needed and requested I will provide to help get this issue resolved.


texts:
I need an observer to be executed when I add a new comment to an order. On Magento 1.9 I used sales_order_save_after event but it does not exist on M2 anymore.

Anyone can help me with an event to do that or any idea to solve this ?

Basically the observer reads the new comment, looks for some content, if it is found it executes some code.

Thank you !


texts:
I have a problem with my Magento, since I added some customer custom attributes... Here we can see siret_number, function, structure_type.

Fields are display on the create form customer, but when I want to create the account, I have this error

"Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Eav\Model\Attribute\Data\Text::validateLength() must be of the type string, null given"

So, I try to debug the file vendor/magento/module-eav/Model/Attribute/Data/Text.php and on line 80, before the call of the function

validateLength(\Magento\Eav\Model\Attribute $attribute, string $value), for one call the $value is NULL.

How to fix this ?

Thanks (I'm a beginner in Magento ;)


texts:
EDIT: After recreating the folder structure the default.xml worked. It was somehow not loaded.

I am trying to add a js file to the backend of Magento 2. I have seen several posts about it and it seems pretty straightforward. However, I can not get it to work... I am working in developer mode so no need to deploy.

This is my code:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Qxs_SerialCodes::js/save.js"/>
    </head>
</page>

app/code/Qxs/SerialCodes/view/adminhtml/layout/default.xml
app/code/Qxs/SerialCodes/view/adminhtml/web/js/save.js


texts:
I'm trying to validate input field in Magento 2. I have added js to same page, so validation like this data-validate="{required:true, 'validate-email':true}" works.

But how to validate min_text_length or max-words or something that requires number, not just true or false?

This is how I tried but it does not work.

<input value="Name" name="first_name" id="first_name_field" class="input-text" data-validate="{required:true, 'min_text_length':'20'}" type="text">


texts: Magento 2 - How to include custom e-mail template?

texts:
I added a custom .html email template at THEME\Magento_Email\email\usp_block.html (i also tried THEME\Magento_Email\view\frontend\email\usp_block.html).
Then I added the file THEME/etc/email_templates.xml with this content:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="design_email_usp_block_template" label="USP Block" file="usp_block.html" type="html" module="Magento_Email" area="frontend"/>
</config>

Now I added a new template in the Magento Backend at Marketing -> E-Mail Templates and tried to include my template like this:
{{template config_path="design/email/usp_block_template"}}

Then I flushed the cache. But if I preview, then I get this:

Error while filtering the template: The email template
'design_email_usp_block_template' is not defined.


texts:
I want to add contacts us form on product details page.On this form product name will be send.Also product name will be send to mail.
 Need to help me how will i do it.


texts: Setting (and updating) product group prices

texts:
It might be quite a simple question, but I've found no valid related answer yet.

I'm trying to import sales prices from CRM with a custom module.

I've tried:

$item->setData('group_price', array(array ('website_id'=>0, 'cust_group'=>$custGroup->getId(), 'price'=>$price->precio)));

But when the price for the customer group does exist I get the following error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '14729-0-784-0' for key 'CC12C83765B562314470A24F2BDD0F36'

I've tried several things, including obtaining existing data with:

$group_prices = $item->getData('group_price');

in order to merge results with the new one, deleting all group prices before I set them again. But I don't seem to get the group prices array I was expecting...

Can anyone help to get this solved?


texts: How to disable Orders and Returns: "/sales/guest/form/"

texts:
I notice that magento 1.7 offers an option on the frontend where customers can look up their orders using email, order number and billing name.
The form is usually located here:

domain.com/sales/guest/form/

Any ideas how can I disable this option? Not necessarily delete it from the footer, but actually disable this option.


texts: I have added Custom field in checkout but not able to save field in quote_address and sales_order_address

texts:
I need to save the value of the custom attribute in the quote address and sales_order_Address,
anyone have an idea please suggest me


texts:
How to install packages php7.2-hash php7.2-openssl php7.2-pdo_mysql if they are not found by apt.
php7.2-hash php7.2-openssl php7.2-pdo_mysql
root@sample:~# apt install php7.2-hash
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-hash
E: Couldn't find any package by glob 'php7.2-hash'
E: Couldn't find any package by regex 'php7.2-hash'

root@sample:~# apt install php7.2-openssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-openssl
E: Couldn't find any package by glob 'php7.2-openssl'
E: Couldn't find any package by regex 'php7.2-openssl'

root@sample:~# apt install php7.2-pdo_mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-pdo_mysql
E: Couldn't find any package by glob 'php7.2-pdo_mysql'
E: Couldn't find any package by regex 'php7.2-pdo_mysql'


texts: Load Simple Products' Description in Bundle-Products

texts:
I want to display the shortdescription of simple products within my bundle-products. There already is an answer/question to that here:  How to display the image, name and short description for a bundle product items
And I do understand the answer theoretically, but I am far off from being able to use it. Maybe someone could guide me a bit on how to do that more in details:

take the product_id of the $_selections,
load the product by this product_id
give the resulting product object to
Mage_Catalog_Helper_Product::getImageUrl. (I guess in my case, something like getShortDescription ?)

I guess, I need to start it in the foreach-loop of the select.phtml-file something similar to this:

<?php foreach ($_selections as $_selection): ?>

<?php /*Step 1 could be that? */ $this->getProductId() ?>

<?php endforeach; ?>

But you see, step 2 is already too complicated too me. Could anybody be that kind to guide me a bit more in details?

Thanks so much.


texts:
Having a issue with figuring out how to get this working.

file path for custom template:

  app/design/frontend/VENDOR/THEME/custom/custom.phtml

In my CMS page, I have it written as:

{{block class="Magento\Framework\View\Element\Template" template="VENDOR_THEME::custom/custom.phtml"}}

What am I doing wrong here? Please help


texts:
Hello as you can see in the title:

I have nginx installed it is working fine
PHP 7.1
Installed PHP-XML
Installed PHP-DOM
But still getting this problem when i for example want to clear cache.

pelase Help meeeee

PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /var/www/magento/vendor/magento/framework/Config/Dom.php:384
Stack trace:
#0 /var/www/magento/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('__construct('_createConfigMerger('Magento\\Framewo...', '_readFiles(Object(Magento\Framework\Config\FileIterator))
#4 /var/www/magento/vendor/magento/framework/App/ObjectManagerFactory.php(275): Magento\Framework\Config\Reader\Filesystem->read('primary')
#5 /var/www/magento/vend in /var/www/magento/vendor/magento/framework/Config/Dom.php on line 384


texts: Linking Customer's Old Orders placed as guest with new account created by customer later

texts:
I was having guest checkout enabled on my magento store, But later regular customers started orders using registering themselves to the store.

So Now i want to link their old orders(they ordered as guest) to their created accounts, They are using same email id they used previously when they ordered as guest.

I want this functionality because i want customers can see there all order history by their accounts.


texts: I added a Prescription Field in my Magento 1.9 Form Page

texts:
$fieldset->addField('prescription', 'file', array(
          'label'     => Mage::helper('surgery')->__('Upload'),
          //'value'  => 'Upload',
          'name' => 'prescription',
          'required'  => true,
          'disabled' => false,
          'readonly' => true
        ));

I have added code for adding or Uploading a Prescription File....But after uploading the Prescription File...The File is not getting saved in the Database on clicking the Save Button....Any possible solutions please reply back to this post....


texts:
I wish to create a series of rewrites so that the following redirect occurs:

Request: Category/ProductName.html
Target: category/productname.html

At present, visiting Category/ProductName.html renders a 404. When I try to create a URL rewrite to this, I get 'Request Path for Specified Store already exists.' and I think it's because of the casing.

Does anyone know a way around this?
These really need to be 301 redirects as they're from the old system, they're being transferred over to the new one and we can't have lots of 404s around the site because of a casing issue.


texts:
Recently I had upgraded version from 2.2.6 to 2.3.0 everything is working fine except frontend.It is showing below exception.Admin working perfectly.

  1 exception(s):Exception #0
  (Magento\Framework\Exception\RuntimeException): Type Error occurred
  when creating object:
  Magento\Cms\Model\Wysiwyg\CompositeConfigProvider

  Exception #0 (Magento\Framework\Exception\RuntimeException): Type
  Error occurred when creating object:
  Magento\Cms\Model\Wysiwyg\CompositeConfigProvider
  0/var/www/magentohost/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108):
  Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Cms\Mod...',
  Array)


texts: I can't color the entire newsletter popup

texts:
I have created a backend button that makes me choose the color of the popup.I have created another button, but for the font color.
The font color works without any problem, but the background color gives me this problem

What can i do?


texts: magento 2 order grid loading issue after data migration

texts:
PHP Fatal error:  Uncaught Error: Call to a member function getAdditionalInformation() on null in /var/www/magento/vendor/magento/module-sales/Model/OrderRepository.php:172
Verified found that file method contains below code

/**
     * Set additional info to the order.
     *
     * @param OrderInterface $order
     * @return void
     */
    private function setPaymentAdditionalInfo(OrderInterface $order): void
    {
        $extensionAttributes = $order->getExtensionAttributes();
        $paymentAdditionalInformation = $order->getPayment()->getAdditionalInformation();

        $objects = [];
        foreach ($paymentAdditionalInformation as $key => $value) {
            /** @var PaymentAdditionalInfoInterface $additionalInformationObject */
            $additionalInformationObject = $this->paymentAdditionalInfoFactory->create();
            $additionalInformationObject->setKey($key);

            if (!is_string($value)) {
                $value = $this->serializer->serialize($value);
            }
            $additionalInformationObject->setValue($value);

            $objects[] = $additionalInformationObject;
        }
        $extensionAttributes->setPaymentAdditionalInfo($objects);
        $order->setExtensionAttributes($extensionAttributes);
    }

Verified and understand that the issue sales_order records count is not matching with sales_order_payment count.

Ex: sales_order count is: 99999
      sales_order_payment is: 88888

Here Could you please help me & advise.


texts: How do I get Magento Cron Jobs running on my test site?

texts:
I recently transferred all of my data from my Magento 1.9.1 to Magento 2.1.7.

The data transfer went fine, but I can't reindex the data therefore not allowing me to access products and categories. The error is within the cron jobs and I've tried every solution I've found online but nothing work for me.

My original site is in: my username/public_html/ folder and my new site is in: username/public_html/magetest/ where I only see cron.php in the public_html/magetest/pub/ folder.

Can someone help me to find out the correct commands to enter in cpanel cronjobs ?


texts: Magento 2 404 saving CMS page/block after moving to new server

texts:
Just as the title says, after moving my install over to a server I get 404 when saving a page or block.   I cleared cache and re-compiled.

Any ideas?  Nothing in logs with errors.

Versions is 2.1.2


texts: Magento-2 How to show reset password options to first login customer

texts:
I have imported customer recently. customer imported by default password which I have set same password for all customer.
Now I need two things to do for customer.

How I can get customer login count, I want to check if customer login first time or not.
if customer login first time to website, it should be redirect to reset password options.

How to show customer reset password options, reset password page to show if customer login first time.

How can do these tasks to complete to best way?


texts: Read data from File in magento2 InstallData.php

texts:
I have my InstallData but i want to read a file in SQL/CSV format in magento 2

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

    $tableName = $setup->getTable('custom_table');

        $data = [
            [
                //Read file in sql/CSV format.
            ],

        ];

        $setup
            ->getConnection()
            ->insertMultiple($tableName, $data);

    $setup->endSetup();
}

How do i go about this in magento2...


texts: Magmi seems to update correctly but products grid doesn't reflect changes

texts:
Magmi says for updating products two columns are necessary:

sku
store

As it's not obvious what store should contain I use store code which is english. I went for updating two products as following:

"sku","store","name"
"100000000001","english","Test1"
"100000000008","english","Test2"

Selected the file containing above rows in var/import then chose Update existing items only.... It then took a few seconds to finish.

Runtime infos
Initialized attribute_set_infos!
Skus imported OK:2/2

Now as I see in both products edit pages, name fields are updated. But products grid in admin (admin/catalog_product/index/) doesn't reflect changes. It still shows previous values. This is where I ended:

mysql> select * from catalog_product_entity_varchar where entity_id = 5000 and attribute_id = 71;
+----------+----------------+--------------+----------+-----------+-------+
| value_id | entity_type_id | attribute_id | store_id | entity_id | value |
+----------+----------------+--------------+----------+-----------+-------+
|   601412 |              4 |           71 |        0 |      5000 | MS506 |
|   602135 |              4 |           71 |        1 |      5000 | Test1 |
+----------+----------------+--------------+----------+-----------+-------+
2 rows in set (0.33 sec)

I tried to add store_id column in CSV header line with corresponding 0 values but it didn't change the one with store_id=0 in above result set.

What am I missing in updating products with Magmi?


texts: Joining Tables in UI Component Collection

texts:
My goal is to join another (custom) table to the collection of the customer list ui component in adminhtml and by that add a condition which customers are shown.

What is the best (or any way) to do that?

I ve tried preferences for the DataProvider Magento\Customer\Ui\Component\DataProvider as well as the Grid Collection Magento\Customer\Model\ResourceModel\Grid\Collection.
But they didnt work, because from what i ve seen, those classes are instantiated with new XYZ via Object Manager.

I tried changing the used collection via .xml in di.xml

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="customer_listing_data_source" xsi:type="string">MYCUSTOM\MODULE\..\Customer\Grid\Collection</item>
            </argument>
        </arguments>
    </type>

I ran out of ideas to accomplish my goal.


texts: urgent help fatal error magento 2 website is working but all the styles are gone after running command

texts:
need serious and urgent help.
i was trying to disable a module in magento2.2 by command line.
first i run the command: php bin/magento setup:upgrade

and after that i ran the command to disable the module : php bin/magento module:disable My-ModuleName

after doing that when i went ot my website and dashboard it was all like the following screen shot

i tried to clear cache but nothing is working. can someone please help me!!!


texts:
I need to update an attribute of a configurable:

$product = Mage::getModel( 'catalog/product' )->load( 3268 );
$configurableAttributesData = $product->getTypeInstance()->getConfigurableAttributesAsArray();
$product->setCanSaveConfigurableAttributes( true );
$configurableAttributesData[ 0 ][ 'values' ][ 0 ][ 'pricing_value' ] = abs( 17.99 - 32.00 );
$product->setConfigurableAttributesData( $configurableAttributesData );
$product->getResource()->save( $product );

It doesn't work, how do I update the configurable option?


texts: I followed This tutorial for Hiding shipping method. I am using webkul shipping but it wont work for this? How i fix it


texts: NULL Values for Attributes in the Database

texts:
All of the products on this Magento CE site I'm working on are imported through a modified Dataflow importer. Almost all of the changes to products are made with the Mage_Catalog_Model_Product_Action model. (There is a call to the normal product save model when categories are changed though.) The issue that I'm seeing is a ton of NULL values in the database tables. For instance, if there is a Dropdown attribute called Type and only 10% of products actually have a value for the attribute, the other 90% will be given a NULL value in the database.

Right now the site has around 60,000 SKUs. As an example, the catalog_product_entity_int table has just shy of 1,000,000 rows. 700,00 of those rows contain NULL for the value field.

Does Magento benefit in any way from having a row for every product/attribute combination for all products that have been saved since an attribute was added? I'm sure that NULL values in the catalog_product_entity_int table take up very little hard drive space, but I could see it slowing down joins a lot, (especially left joins.)

Should I be trying to clean these NULL values out?


texts:
I am using Magento 2.3.2, I change the default color  {CSS : luma theme } to a custom color.

After a certain time, it returns to the default. How to solve this


texts: Is there a method how I can check the security of magento store?

texts: is there a way to check whether Magento store is secured or not just by entering the URL of the store


texts:
We are interested in using Magento, but advanced promotion management is a must for us. How does Magento handle the following scenarios?

What happens if I define the following as separate promotions:

Buy X, get Y for 50% off
Buy Y, get Z for 50% off

and user adds X,Y and Z to the cart?

What happens if I define the following as separate promotions:

Buy 5 A, and save 20%.
Buy 10 A, and save 50%.

and user buys 15 A.


texts: Get changing variables from Magento block in knockout js

texts:
Want to pass entityId to the getInfo method:
This block.phtml is on the catalog page (list) that gets called per Item on the page and sends each entity id to the getInfo method. The getInfo method then calls a controller that returns the info. If I add entityId to the initialize method only the first / last value gets passed to the getInfo method...

block.phtml

custom-component.js

define([
  'uiComponent',
  'ko',
  'mage/url',
  'mage/storage',
  ], function (Component, ko, urlBuilder,storage) {
        'use strict';
        return Component.extend({

            initialize: function () {
                this._super();
            },

            getInfo:function () {
                var serviceUrl = urlBuilder.build('acme/getinfo?id=' + #ENTITIYID);
                storage.post(
                  serviceUrl,
                 ''
             ).done(
                 function (response) {
                     var jsonObj = JSON.parse(response);
                     this.info = jsonObj.info;
                 }
             ).fail(
                 function (response) {

                 }
             );

            }

        });
    }
);

custom-component.html


texts: Magento 2 How to combine custom module JS in one JS file?

texts:
I have multiple modules installed on my website, all modules have scripts in phtml file. I need to move that all scripts into one JS file so it can reduce the page size and merged them as a JS file.
I did in require-js
map: {
        '*': {
            'mergescript':'Magento_Theme/js/mergescript'
        }
    }

then in phmtl file called
require([ "jquery", 'mergescript'], function($, mergescript) {
    mergescriptJs();
});

then in the mergescript.js file
define(['jquery','lazyLoad','bootstrap','jquery/ui'], function($){
        "use strict";
        return function mergescriptJs()
        { alert('Test'); }
    });

it showing an error in the console as "mergescriptJs" is not defined.


texts: Get original image file from a cache URL

texts:
Is there any function that given a cache image product file return the original one?

Example :

=> Cache URL:

{BASEURL}/media/catalog/product/cache/2/image/9df78eab33525d08d6e5fb8d27136e95/a/l/IMAGE.jpg

=> Desired outcome:

BASEURL/media/catalog/product/a/l/IMAGE.jpg


texts: Browser Cookies are killing our LIVE site

texts:
we have a LIVE magento site from last one year.

recently we are facing very difficult problem from Browser cookies.

Frontend is not opening and keep on loading and never load.

we are using HTTPS for secure pages.

we are facing problem in chrome, mozilla , opera, safari and all other browsers.

1)If we clear the BROWSER COOKIES, than its working.

2)If we clear the VAR/SESSION folder, than its working.

3)If we open the site in freshly installed browsers, its working for some time. again same problem. as cookies will occupy after visiting site.

There is no problem in Backend

we followed this : https://stackoverflow.com/questions/15491819/magento-admin-login-not-working-in-chrome-but-works-fine-for-firefox but it did't worked.

IS it related to only cookies problem or our template code problem?

we face issue as in images sometimes.


texts: Set cache-control in HTTP headers for UI Components (Magento 2)

texts:
The main delay in Magento page loading into client browser is the js/html files summary delay. So, my homepage is loading about 9 sec., DOMContentLoaded = 1.75 sec. (PHP generated HTML) and all other time is for CSS/IMG/JS/HTML loading.

I see that HTTP headers contain "Cache-Control:no-cache" in the responses for JS & HTML files. Can I set up "Cache-Control" headers for these files on Magento level or web server level (I use apache2)?


texts: Magento 1.9.4.5 - Customer Registration Sends Passwords in Plain Text, Why?

texts:
I've been reviewing the source code of the latest Magento 1.9.4.5 installation and noticed that once a customer registers an account, they receive a confirmation with their account details including a password in plain text.
If one goes to /app/locale/en_US/template/email/account_new.html
they will notice that the email template has a password field with the following code {{htmlescape var=$customer.password}}

I know that Magento 2.X doesn't send the password in plain text, but Magento 1, still does. Even the latest version.

Any ideas ? I haven't found a clear answer for this practice.


texts:
I have the element inside the UI-form:

return [
    'arguments' => [
        'data' => [
            'config' => [
                'componentType' => Modal::NAME,
                'dataScope' => '',
                'provider' => static::FORM_NAME . '.product_form_data_source',
                'id' => 'unique-id-html-attribute',
                'options' => [
                    'title' => __('Select Options'),
                    'buttons' => [
                        [
                            'text' => __('Save'),
                            'class' => 'action-primary',
                            'actions' => [
                                [
                                    'targetName' => 'index = create_something_form',
                                    'actionName' => 'save',
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
    'children' => [],
];

But I can not add the ID-attribute to the element. Line 'id' => 'unique-id-html-attribute' does not work:

So question is: How to add the ID-attribute to the UI-form element?


texts: How can I show products from the same category under my product page?

texts:
Under my product page, I wish to have some products shown from the same category.

How can I achieve this in Magento 2 without having to manually set the related products?

Thanks


texts: Magento 2: order email does not translate

texts:
I am working with Magento version 2.0.7. I set up the de_DE.csv file in my own theme and put all the translation text for email into this CSV file.
However, when I try to create a new order and receive an email. The order email is always in English text.
Other emails (new account, forgot password ..) are still in correct German text.

Does anyone have the same problem like me and already found the solution. Can you give some advises?


texts: Only display attributes that are visible on product view page on front-end if a value exists

texts:
If we have a custom attribute with the frontend properties for "Visible on Product View Page on Front-end" set to yes, then these attributes show up in our additional info box.

Even if the attribute does not have a value, it will still show up but say something like No or N/A in the additional info box.

Is there any way to make it so it will only show the value if a value exists?  For example we may have an attribute like production dimensions.  If we don't have the dimension available, I'd prefer to leave it off completely, not show N/A.


texts: How to Disable Customer Accounts/Sign In Without Breaking the Shopping Cart in Magento 2.0.4?

texts:
So I have installed a fresh install of Magento 2.0.4, on my old magento 1.9.2.3 site, I have disabled the customer accounts through various methods and the cart works fine. customers are directed to paypal express checkout.  I have now spent the better part of all morning with customers disabled through the advanced section of the configuration for the site.

HUGE PROBLEM

This for some reason totally breaks the shopping cart.  I cant remove items.  Items don't show up in the basket, but are really there after i add another item, again not being able to remove it.

So I now have the customer enabled in the backend advanced section, but i dont want ANY customer data locally and only have that stored in paypal.  This is for my safety, and theirs (the customer) as I, just like many other magento store owners have well been versed on all kinds of hacks.

Is there some sane way to disable the customer/account/sign in without breaking the shopping cart?


texts: Importing customers with their hashed passwords from Oxid

texts:
We are running Magento 1.9.3.2 and need to import >100k customers from oxid.

Here is how Oxid generates the passwords:

public function encodePassword( $sPassword, $sSalt )
{
    $oDb = oxDb::getDb();
    return $oDb->getOne( "select MD5( CONCAT( ".$oDb->quote( $sPassword ).", UNHEX( '{$sSalt}' ) ) )" );
}

Here is how Magento 1.9.3.2 does that:

public function getHash($password, $salt = false)
{
    if (is_integer($salt)) {
        $salt = $this->_helper->getRandomString($salt);
    }
    return $salt === false ? $this->hash($password) : $this->hash($salt . $password) . ':' . $salt;
}

So I have naturally tried to do it this way:

1.) Tool a salt that was saved in oxid DB and then run it through SQL HEX()
2.) Saved the Oxid password with the new salt (after HEX()) in Magento database like this: Oxid_pass:new_salt
3.) Overwrote Magento getHash method to this (swaped $salt and $password place):

public function getHash($password, $salt = false)
{
    if (is_integer($salt)) {
        $salt = $this->_helper->getRandomString($salt);
    }
    return $salt === false ? $this->hash($password) : $this->hash($password . $salt) . ':' . $salt;
}

However, this change still does not allow me to login using password from Oxid.

The question is: what is the best practice if any to move users with password from Oxid to Magento?


texts: How to get config values by website or webstore in Magento 2

texts:
In Magento 1 it was possible to set/retrieve config values by website or store i.e

by website:

Mage::app()->getWebsite()->getConfig('settings/reference/prefix');

or via store

 Mage::app()->getStore()->getConfig('settings/reference/prefix');

However in magento 2 the config is set via the

Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig

$this->_scopeConfig->getValue('settings/reference/prefix')

My question now is, how can I retrieve the values by website/store?


texts: Customer export not working after creating custom attributes in magento 2.2.5

texts:
I have created a custom attribute named "Approve Account" while export getting below error.

  Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Framework\View\Element\UiComponentFactory::argumentsResolver() must be of the type array, null given, called in /var/www/html/tgbl222/vendor/magento/framework/View/Element/UiComponentFactory.php on line 220 and defined in /var/www/html/tgbl222/vendor/magento/framework/View/Element/UiComponentFactory.php:172 Stack trace: #0 /var/www/html/tgbl222/vendor/magento/framework/View/Element/UiComponentFactory.php(220): Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('approve_account', NULL) #1 /var/www/html/tgbl222/vendor/magento/module-ui/Component/Listing/Columns/Column.php(77): Magento\Framework\View\Element\UiComponentFactory->create('approve_account', 'int', Array) #2 /var/www/html/tgbl222/vendor/magento/module-ui/Component/MassAction/Filter.php(184): Magento\Ui\Component\Listing\Columns\Column->prepare() #3 /var/www/html/tgbl222/generated/code/Magento/Ui/Component/MassAction/Filter/Interceptor.php(63): Magento\Ui\Component\MassAction\Filter->p in /var/www/html/tgbl222/vendor/magento/framework/View/Element/UiComponentFactory.php on line 172

/app/code/Namespace/Module/view/adminhtml/ui_component/customer_listing.xml

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="customer_columns">
    <column name="approve_account">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">select</item>
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                <item name="dataType" xsi:type="string">select</item>
                <item name="label" xsi:type="string" translate="true">Account Active</item>
                <item name="sortOrder" xsi:type="number">280</item>
            </item>
        </argument>
    </column>
</columns>

/app/code/Namespace/Module/setup/installData.php

/**
 * {@inheritdoc}
 */
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

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

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

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

    /**
     * Create customer attribute account_approve
     */
    $customerSetup->addAttribute(Customer::ENTITY, self::APPROVE_ACCOUNT,
        [
            'type' => 'int',
            'label' => 'Approve Account',
            'input' => 'select',
            "source"   => "RBC\Customersegment\Model\Config\Source\CustomerYesNoOptions",
            'required' => false,
            'default' => '1',
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 215,
            'position' => 215,
            'system' => false,
        ]);
    $approve_account = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, self::APPROVE_ACCOUNT)
        ->addData([
            'attribute_set_id' => $attributeSetId,
            'attribute_group_id' => $attributeGroupId,
            'used_in_forms' => ['adminhtml_customer','customer_account_create','customer_account_edit'],
        ]);
    $approve_account->save();

    $setup->endSetup();
}


texts: Magento 1.9.3 category custom attribute validations

texts:
I have created custom attribute in Magento 1.9.3.

$pro_attribute = [
    'input' => 'text',
    'type' => 'int',
    'label' => 'Pro Position',
    'visible' => true,
    'required' => true,
    'visible_on_front' => true,
    'unique' => true,
    'searchable' => true,
    'filterable' => true,
    'validate' => true,
    'class' => 'validate-number',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//SCOPE_STORE,
];

Field is sucessfully created and has the "required entry" validation. How can I add the "number" validation?


texts: Clone Configureable Product with all its simple products

texts: Is there any way to clone/copy a conf. product with all its simple products without needing to use code/coding?


texts:
In the cart I want to display in the totals block, always a free shipping line.
We ship our products always for free, so is there a way to display between the subtotal.phtml and tax.phtml always the shipping.phtml?

Currently this is only displayed when the fields of the checkout are filed.


texts: Magento2: Error in order creation even after successful payment and redirection

texts:
We use custom-SMTP mailer to send mails on order confirmation, invoice etc,

magentov2.1.8

The heidelpay returns a positive ACK and Transaction succeed alert. and proper redirection to success page. But because of this exception order is not getting created in the backend.

  Fatal error: Uncaught TypeError: Argument 1 passed to
  Magento\Payment\Helper\Data::getInfoBlockHtml() must implement
  interface Magento\Payment\Model\InfoInterface, null given, called in
  /home/vapewun0/public_html/vendor/magento/module-sales/Model/Order/Email/Sender/OrderSender.php
  on line 152 and defined in
  /home/vapewun0/public_html/vendor/magento/module-payment/Helper/Data.php:204
  Stack trace: #0
  /home/vapewun0/public_html/vendor/magento/module-sales/Model/Order/Email/Sender/OrderSender.php(152):
  Magento\Payment\Helper\Data->getInfoBlockHtml(NULL, '2') #1
  /home/vapewun0/public_html/vendor/magento/module-sales/Model/Order/Email/Sender/OrderSender.php(125):
  Magento\Sales\Model\Order\Email\Sender\OrderSender->getPaymentHtml(Object(Magento\Sales\Model\Order\Interceptor))

  2
  /home/vapewun0/public_html/vendor/magento/module-sales/Model/Order/Email/Sender.php(71):

  Magento\Sales\Model\Order\Email\Sender\OrderSender->prepareTemplate(Object(Magento\Sales\Model\Order\Interceptor))

  3 /home/vapewun0/public_html/vendor/magento/modul in
  /home/vapewun0/public_html/vendor/magento/module-payment/Helper/Data.php

  on line 204

NOTE: This issue happens only for transaction which involve Heidelpay. Paypal payments goes through successfully.


texts: addAttributeToFilter with OR and BETWEEN

texts:
I'm adding a couple of filters with addAttributeToFilter. I have the fields "year", "year_from", "year_to". I either want to match the year exactly to the "year" attribute or make a "between" by using "year_from" and "year_to". I know how to use addAttributeToFilter to make "OR" conditions. However
I don't know how to make an "OR" filter with a grouped "AND", something like year = 1999 OR (year_from <= 1999 AND year_to >= 1999).


texts: I deleted /var/package by accident, what are the consequences?

texts:
As the title says, I accidentally deleted /var/package/.

What kind of issues can this cause, is it possible to recover or rebuild the tree, and if so, how?


texts:
It seems that in magento 2 the cms_page_view layout handle has a higher priority then then the cms_index_index layout handle. (wich seems very illogical)

The scenario is that for all the cms pages I want to place the page.main.title element in a different container then standard and I use a diffrent template file for it. With the exception of the home page where I want it in yet another container.

So in Magento_Cms module I placed the following layout update in cms_page_view.xml

<referenceBlock name="page.main.title" template="html/cms-subtitle.phtml" />
<move element="page.main.title" destination="cms.page.title" after="-" />

then in the Magento_Theme module i placed the following layout update in cms_index_index.xml

<referenceBlock name="page.main.title" template="html/title.phtml" />
<move element="page.main.title" destination="content.container" before="-"/>

In the cms_index_index I can't seem to interact with the page.main.title anymore the above code doesn't work. I also try'd to remove it but also no success. Creating a new instance of the title.phtml will result in the block giving me the meta_title instead of the content heading so that's not an option either.

Does anybody have an idea how I can move the page.main.title to the content.container on the homepage? Is there maybe a layout handle I don't know about that does work?


texts:
Read this great reference for creating a csv for import but this was for Magento 1
and it states you only need store_id, id_path,request_path, target_path, options but these headers won't work for Magento 2.

In Magento 2 it looks like the entity_id is required and this would be painful indeed. Does anyone know what fields I need to import to get a massive amount of 301 rewrites into url_rewrites or a table that has paths and entity_id in it so I can cross reference?

Thank you.


texts:
Here I found the example shows how to create an order using REST api is there any example to do the same with SOAP api in Magento 2.

Any suggestions, please?


texts:
In my module I created \view\frontend\layout\catalog_product_prices.xml

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <referenceBlock name="render.product.prices">
        <arguments>
            <argument name="default" xsi:type="array">
                <item name="prices" xsi:type="array">
                    <item name="msrp_price" xsi:type="array">
                        <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item>
                        <item name="render_template" xsi:type="string">MyVendor_MyModule::product/price/msrp.phtml</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</layout>

but my custom product/price/msrp.phtml template did not override core template. What am i doing wrong?


texts: customer account data and order data mismatched

texts:
One of my website having different issue.

If I logs in from account A, I can see orders ordered from account A and someone else's account.

This is happening for most of the customer account. Website running on 1.6

Was anyone having same issue in past?


texts: I design one payment gateway But It's hosted payment so i want remove that payment method for admin order and reorder.so please some one tell me how to disable this method only for admin orders like Paypal standard.


texts: Magento 2: Product price reindexing error

texts:
I initiated php bin/magento indexer:reindex command in my ssh

But unfortunately one of the indexes gives me an error. Attached below is the error of the product index.


texts: Magento [There has been an error processing your request]

texts:
Suddenly the website homepage started showing the "There has been an error processing your request". When I have tried to login in the admin panel. The login page open but after submitting password there is same error.

I have tried to open the record number but don't understand.

Please help.


texts:
I want to make a join like

SELECT * FROM catalog_product_entity as c
 INNER JOIN catalog_product_entity_varchar AS cv ON (c.entity_id = cv.entity_id) and(cv.attribute_id =
 (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name'))

How can I add this in a join in magento with collection?


texts:
I know about the default.php, and the abstract.php

I saw in one tutorial that there are phtml file mentioned for Magento PDF invoices.

Does someone knows where are from informations in Magento pdf invoices pulled from? Are there any phtml files that can be edited and to affect content of Magento PDF invoices?

Also, I see that the recommendation is always to copy magento files in your own theme? How can I do that? In what folder?

Thanks!

Josip


texts: Product Image is not showing in magento 1.9.2.4

texts: I am using Magento 1.9.2.4. I have imported products by admin but I have faced problem product that image is not showing on search result page but when we open that particular product then the image is showing. I have configured all possible things but the problem couldn't be solved. Could anyone please suggest me any solution regarding this.


texts: Database Storage and catalog:images:resize

texts:
Newly uploaded images are not appearing on the Magento Front End when using Database as the media storage mechanism, in Magento CE 2.3.

I have tried almost everything, including cache clean, flush, resize images command.

One issue I've noticed is that the catalog:images:resize script returns an error complaining that File 'xyz.png' does not exist., which is correct, it does not exist - not on the filesystem at least, it's stored in the database (and I can see it in the database with the same directory).

Magento permissions are all fine. Hoping for some tips if anyone can help!


texts: Show configurable product descriptions only, not simple products

texts:
In Magento2. How do you set all configurable products in the front-end to only show the description and short description of the main configurable product. Not the descriptions of the simple products?

It seems by default, that when you toggle and change between colours and sizes, it pulls the description content from the simple product that has been selected. Not the main configurable product.

We have a store with circa 10,000 products, where the simple products have description fields empty. So want to pull from the main configurable product where the descriptions are completed for main description and short description.


texts: Magento - How to restrict coupon codes to specific email id?

texts: I'm generating Coupon codes from shopping cart rules and assigning coupon codes to Newsletter subscribers but at the moment that coupon code is getting used on any email address so, I would like to attach that coupon code to specific email address only, so that coupon code won't work on other email addresses. can anyone please help me on this.


texts:
I want to add a span in nav top menu after every li. Also in this span I want to add an image (arrow-down).

I added this code in top.html but nothing show!!!

How can I add a span in top menu?

This is the code of top.html:

<?php $_menu = $this->renderCategoriesMenuHtml(0, 'level-top', 'sub-wrapper' ) ?>
<?php if($_menu): ?>

        <?php if (Mage::getStoreConfig('celebritysettings/celebritysettings_header/navigation_home')): ?>

            <a href="<?php echo $this->getBaseUrl(); ?>">
                <?php echo $this->__('Home'); ?>

     <?php endif; ?>
        <?php
        echo $_menu;
        $custom_tab = Mage::getModel('cms/block')->load('celebrity_navigation_block');
        if($custom_tab->getIsActive()) {
            echo '

                    '.$custom_tab->getTitle().'

'.$this->getLayout()->createBlock('cms/block')->setBlockId('celebrity_navigation_block')->toHtml().'

';
        }
        ?>

<?php endif ?>


texts:
Dear community I currently upgrade my magento store manually, by replacing my files with the newer versions files manually using FTP (coda).

Has got me through many upgrades but is rather long winded. Thus, I was wondering if anyone could recommend a more suitable way to upgrade a magento store.

I know the different ways. i.e, connect manager but that is not a suitable way.

Looking at magento download site for the latest version (1.9.3.7) I see the ability to download a .diff file, which I believe checks differences from my version and new version and applies the changes.

https://pasteboard.co/GVXdOns.png

I was hoping someone could kindly elaborate further on this, like what is different between the .diff and .sh files of each of the relative patches. i.e, SUPEE-10415?


texts: Product category update issue in magento2

texts:
I am updating product category from admin.. getting below error.

"Could not save product \"41859\" with position 0 to category 8",

Referred this link as mentioned it is fixed in 2.2.4,

How to solve the error : "Could not save product "20072" with position 0 to category 7" in magento 2

I am also using using magento version 2.2.4. but still same error is there.

Category is not updating even if we update from admin side.

Is any fix available for this? Please anybody help me. Thanks


texts: magento 2 conn't login to admin panel in local host with xampp

texts:
when i given correct logins also it conn't login

Thnaks


texts:
I created a custom module and its gives a error "fatal error: bms_class_helper_data not found " after that i removed the complete module, layout file and data enabler file and database, but still it is displaying a same error, why the error still displaying, even i cleared the cache also. and in AWS server instance screen shot it is showing out of memory : kill process or sacrifice child what may be the problem

And Cache files are not storing in /var/cache folder, in testing same error occur, i removed cache manually from /var/cache and its woking fine, but in live cache files are not storing in /var/cache folder


texts: Magento 2.2.1 : Product disappeared every time after edit

texts:
Each time when I modify a product (image or quantity) it disappears from the site.

Then it comes back after the site is re-indexed.

Any ideas how can I stop this from happening?

I have also tried following solution but its not working.

Magento2 - Products suddenly disappeared on frontend


texts: how to refresh mini cart programmatically in magento2

texts:
after customer login ,i am add filter on current customer quote, and remove items form quote which are not match. so item are delete successfully but  front side in minicart  cart item count are not updated .

use : "customer_login" event


texts: Images are not showing in WYISWYG editor

texts:
I will explain this issue with example :

For example I want to set image for any product's description area so I go to WYSIWYG editor and click on image insert icon so it's open insert image section and after that we can see different media folder to select image.Now problem is here. we can't see any image here and instead of Image it's showing ALT tag.For selected Image url is something like this https://test.hotdiamonds3.bathcomms.com/index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvR2lmdENhcmRzL0NBUkQ2LmpwZyJ9fQ,,/key/d5d8fc754dd85fc475b1a8e17ae890c2/

I have set 777 permission for media and it's subfolder.

I have attached image for better understanding.


texts: Checkout last step issue (Magento 1.9.3)

texts:
I am working on a custom theme for magento 1.9.3, and I am facing an issue with the last step of the checkout proccess (review step). It loads something meaningless which I don't understand why, it loads the main template, like the main-wrapper I have, the leftsidebar, main-content, logo, etc. But nothing inside.

This problem occurs only when trying to follow the checkout process as a guest, but when I'm logged in, it works fine.

I am not allow to share the test url publicly but I can send it as a private message.

I am new working with magento so I am not sure what could be the reason so any clue would be appreaciated.

Thanks :)

Edited:

Checking the var/logs I found a system.log file which has these lines that appears when trying to reproduce my issue. But don't know what that means and how to fix it.

2017-10-27T16:02:54+00:00 CRIT (2): Not valid template file:frontend/base/default/template/account/checkout/onepage/parcelannouncement.phtml
2017-10-27T16:03:05+00:00 CRIT (2): Not valid template file:frontend/base/default/template/paypalplus/form/payment.phtml
2017-10-27T16:03:05+00:00 CRIT (2): Not valid template file:frontend/base/default/template/pnsofortueberweisung/form/sofortueberweisung.phtml
2017-10-27T16:03:09+00:00 CRIT (2): Not valid template file:frontend/base/default/template/paypalplus/payment/info.phtml


texts: Skip choosing customer in new order page in admin area

texts:
At the following page:

Sales -> Orders -> Create New Order

I want to skip the page where you choose the customer, so instead it loads the page as if you had clicked a certain customer, and the customer I want it to load is the currently logged in admin.

I'm not sure how to go about this however I am able to retrieve the logged in admin id.

If I take a JavaScript approach, I think I may need to somehow call productGridRowClick(grid, event) on the "order" object.

Or maybe I could load the block directly in PHP, skipping this:

<block type="adminhtml/sales_order_create_customer" template="sales/order/create/abstract.phtml" name="customer">
    <block type="adminhtml/sales_order_create_customer_grid" name="grid" />
</block>


texts: How to add multiple products to cart programatically in Magento 2

texts:
This is the code snippet that I am using

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$quote = $objectManager->get('\Magento\Checkout\Model\Cart');
$_product = $objectManager->get('\Magento\Catalog\Model\Product')->load(1058);
$params = array (
    'qty' => 1
);
$quote->addProduct($_product, $params);
$quote->save();

$quote = $objectManager->get('\Magento\Checkout\Model\Cart');
$product = null;

$_product = $objectManager->get('\Magento\Catalog\Model\Product')->load(1059);
$params = array (
    'qty' => 3
);
$quote->addProduct($_product, $params);

$quote->save();

The code seems fine but it updates the quantity of 1st product and results into 4 quantities of first product added to cart.

Please help.


texts: Sorting attributes are not working Magento 2.3

texts:
I'm trying to apply sorting from the toolbar on listing page, but none of the sorting properties like price, new, name etc. are working.

As you can see I have applied sort by price, but it's not sorting it by price same comes with other sorting options also.

Note: I'm using elasticsuite 2.8.3 and Magento 2.3.3


texts: I am trying to install a Magento 2 in Linux Mint 19. I am facing issue in file permission.


texts:
I currently have a login form which opens when a customer clicks a link in the header (instead of going off to /customer/login). Apart from a few field ID's, it's pretty much unchanged from customer/templates/form/login.phtml.

How do I call the current url into the form so it doesn't redirect to the account page? (I have disabled that feature in the CMS also)

I know from various tutorials this can be achieved using this as url:

$url  = $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);
$login_url = $block->getUrl('customer/account/login', array('referer' => base64_encode($url)));

But I'm not quite sure how to integrate that into the custom form.

Thanks


texts: How can I get the product attributes with GraphQL without knowing them?

texts: I have a shop with several products and each product have his own attributes. I'm trying to get those attribute values of each product with GraphQL but I don't know what are the attributes. I want to make a query that returns all the products and each product have his attributes specified. Is there a way to make that?


texts:
I am trying to add a class name to a product attribute on my site so that I can change the colour of one of the attributes to green. I am able to to do this by simply using the class name "Last" which is fine at the moment.

However I have also customised the attributes so that that when the product attribute is empty it does not display on the frontend. This means that my styling using the class name "last" to add the green text is no longer working correctly because it means if my attribute is empty this green styling is added to the next attribute in the list which is not what I want.

Any advise is appreciated.

thanks in advance!


texts: Order amount credit memo partial refund not correct

texts:
Unfortunately, I have a issue with magento 1.9.2.0.

I made a partial refund credit memo for a customer. However, the total order amount is wrong. How can i fix this issue?

I found this and this as well, but don't know if that is the best way to fix this issue.

Can someone help me?

Thanks!

Update: still no solution found after a month.

Here is the English version of image which helps to understand the question.


texts: Best practices of 404 product page redirection in magento

texts:
We have so many product which are no longer there in our website, but they are already crawled in google. I need to know what are the best practices to redirect them to any other page or something, which will prevent our visitors from 404 error page. Any suggestions on this.

Thanks


texts: Customer login not working after Data migrated from Magento 1.5.1.0 to 2.3.1

texts:
I recently migrated customers from Magento 1.5.1.0 to 2.3.1 then my magento 1 customers are not able to login getting error like:

Error : The account sign-in was incorrect or your account is disabled temporarily.Please wait and try again later

sometime bellow error also

 Error : 'Invalid login or password.'

I tried to upgrade customer has using command but also getting error like

php -f bin/magento customer:hash:upgrade
Error :Notice: Undefined index: 0:1 in /var/www/html/vendor/magento/framework/Encryption/Encryptor.php on line 198

anyone have idea how to fixed this ?


texts: Paypal Authorization is voided in magento

texts:
I am getting following error in magento admin panel :
PayPal gateway has rejected request. Authorization is voided (#10600: Authorization voided).
I have voided the transaction from paypal account and now want to cancel the order from magento but above error occurs.
The credit memo correlated to the voided Paypal transaction cannot be created since the invoice of the transaction is in cancelled status.


texts: Extends another model from another module issue in Magento 1

texts:
This is the model which I want to overwrite:

class Dotdigitalgroup_Email_Model_Newsletter_Sub extends Mage_Newsletter_Model_Subscriber
{
    public function sendConfirmationSuccessEmail()
    {
        if (Mage::helper('ddg')->isNewsletterSuccessDisabled($this->getStoreId())) {
            return $this;
        } else {
            parent::sendConfirmationSuccessEmail();
        }
    }
}

This is how it is declared in the config.xml , the models:

...
<models>
    <ddg_automation>
        <class>Dotdigitalgroup_Email_Model</class>
        <resourceModel>email_connector_resource</resourceModel>
    </ddg_automation>
....

This is my try:

<global>
    <models>
        <ddg_automation>
            <rewrite>
                <model>Aschroder_SMTPPro_Model_Newsletter_Sub</model>
            </rewrite>
        </ddg_automation>
.....

The the model:

class Aschroder_SMTPPro_Model_Newsletter_Sub extends Dotdigitalgroup_Email_Model_Newsletter_Sub
{
    public function sendConfirmationSuccessEmail()
    {
        parent::sendConfirmationSuccessEmail();
    }
}

and the settings:

<config>
    <modules>
        <Aschroder_SMTPPro>
            <active>true</active>
           <codePool>local</codePool>
            <depends>
                <Dotdigitalgroup_Email/>
            </depends>
       </Aschroder_SMTPPro>
    </modules>
</config>

It always gets to Dotdigitalgroup_Email_Model_Newsletter_Sub instead of  Aschroder_SMTPPro_Model_Newsletter_Sub. Why ?


texts: Magento 2.3: Redirect the customer to a custom page after logging in is not working

texts:
I'm aware, by default, Magento 2 provides us with a feature, that allows redirecting the customer to account dashboard after logging in, we can enable this feature by going to Stores → Settings → Configuration → Customers → Customer Configuration → Login Options. I have enabled that option to redirect the customer to account.

However, It's not working at all. I'm using Magento 2.3 EE. Is this feature was deprecated in Magento 2?

Could anyone please suggest me a way in redirecting the dashboard after login?


texts: What is the replacement for Varien_Data_Collection in magento 2? I know that Varien_Object has been replaced with \Magento\Framework\DataObject.


texts: Detect if payment has been placed in sales_order_save_after observer in Magento 2?

texts:
I have a custom extension that uses sales_order_save_after basically i want to create an invoice after the customer put a payment data , the problem is the order seems not been created at so i got an error like this:
Call to a member function getAdditionalInformation() on null in vendor/magento/module-sales/Model/OrderRepository.php:172

then i remove the create invoice function from my observer, then it does not got any error.
After i successfully place an order , i try this create invoice function again using the success order , the create invoice function run smoothly.
It seems the function is triggered before the payment has been placed, is there a way to detect if the payment has been placed using this observer or order?


texts: Create a block, that lists all products from one store on a CMS page

texts: I just want to add a block into home page, it list all the products from particular store. Forget about functionality, Can anybody help me to create a block that can be included in home page via cms page. like {{block type="mycategoryproducts/listing"}}.


texts: How set order with custom field column magento 2

texts:
I want to setOrder with custom field column in get list product. I override toolbar.php but it's not working

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

<type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
        <plugin name="Namespace_Company::addPriceDecendingFilterInToolbar" type="Namespace\Product\Plugin\Product\ProductList\Toolbar" />
    </type>

</config>

Namespace\Product\Plugin\Product\ProductList\Toolbar
in  Toolbar.php

namespace Namespace\Product\Plugin\Product\ProductList;
class Toolbar
    {
    /**
     * Plugin
     *
     * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $subject
     * @param \Closure $proceed
     * @param \Magento\Framework\Data\Collection $collection
     * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
     */
    public function aroundSetCollection(
        \Magento\Catalog\Block\Product\ProductList\Toolbar $subject,
        \Closure $proceed,
        $collection
    ) {
        $currentOrder = $subject->getCurrentOrder();

            $subquery = new \Zend_Db_Expr("<query get min price>");

$collection->getSelect()->columns(array('price_sort' => $subquery));
//to debug

        $result = $proceed($collection);

        if ($currentOrder) {
            if ($currentOrder == 'price_high') {
                 $subject->getCollection()->setOrder('price_sort', ' DESC');
               # $subject->getSelect()->order('price_sort DESC');
            } elseif ($currentOrder == 'price_low') {
                $subject->getCollection()->setOrder('price_sort', 'asc');
            }elseif ($currentOrder == 'price_low') {
                $subject->getCollection()->setOrder('position', 'desc');
            }elseif ($currentOrder == 'bestseller') {
                $subject->getCollection()->setOrder('price', 'asc');
            }
        }

        return $result;
    }

    public function aftergetAvailableOrders()
    {
        $sortFilter=array(
                            'price_high'=>__('Price High To Low'),
                            'price_low'=>__('Price Low To High'),
                            'position'=>__('Newlastest'),
                            'bestseller'=>__('Bestseller'),

                            );
        return $sortFilter;
    }
}

In product/list.phtml, I debug query but in order by it's not showing.

I want to show my query <query sql> order by price_sort DESC

But if in toolbar.php, I replace

$subject->getCollection()->setOrder('price_sort', ' DESC');

to

$subject->getCollection()->setOrder('price', ' DESC');

and then  I debug the query, then in query it shows

 order by price DESC

I want use column price_sort in setOrder.


texts: How can I add State and Country attribute for customer in Admin, Magento2

texts:
I need to create State and Country attribute for customer registration and Admin.

How can I Achieving State and Country field functionality in Admin under customer Account Information


texts:
I can't upload images on my CMS home page, it says "Memory limit has been reached", i've been searching on internet a fix, and i found this one saying to change this code on Gd2.php ( /lib/Varien/Image/Adapter/Gd2.php ) :

    protected function _convertToByte($memoryValue)
{
    if (stripos($memoryValue, 'M') !== false) {
        return (int)$memoryValue * 1024 * 1024;
    }
    elseif (stripos($memoryValue, 'KB') !== false) {
        return (int)$memoryValue * 1024;
    }

   return (int)$memoryValue;
}

to

protected function _convertToByte($memoryValue)
{
     /*
     if (stripos($memoryValue, 'M') !== false) {
         return (int)$memoryValue * 1024 * 1024;
     }
     elseif (stripos($memoryValue, 'KB') !== false) {
         return (int)$memoryValue * 1024;
     }

     return (int)$memoryValue;
     */
     return 2147483648;
     //1024*1024*1024*2 = 2G
}

(Yes i removed the commentary codes )

but in my Gd2.php the code is different, here's the code i have:

protected function _convertToByte($memoryValue)
    {
        $memoryValue = trim($memoryValue);
        if (empty($memoryValue)) {
            return 0;
        }
        if (preg_match('~^([1-9][0-9]*)[\s]*(k|m|g)b?$~i', $memoryValue, $matches)) {
            $option = strtolower($matches[2]);
            $memoryValue = $matches[1];
            switch ($option) {
                case 'g':
                    $memoryValue *= 1024;
                    // no break
                case 'm':
                    $memoryValue *= 1024;
                    // no break
                case 'k':
                    $memoryValue *= 1024;
                    break;
                default:
                    break;
            }
        }
        $memoryValue = (int)$memoryValue;

        return $memoryValue > 0 ? $memoryValue : 0;
    }


texts:
I have two tables, one for a list of poll questions and another for the answers to a specific poll. I want to be able to display the list of questions in a grid, then save the question and the answers together in an admin form.

I know how to join the tables together, but when I do, in the grid, the lines are duplicated for each corresponding answer. Also, I can't edit them and get the error item with same id already exists.

Here is my join :

public function _construct(){
    $this->_init("Vendor\Module\Model\Poll","Vendor\Module\Model\ResourceModel\Poll");
}

protected function _initSelect()
{
    parent::_initSelect();

    $this->getSelect()->joinLeft(
            ['secondTable' => $this->getTable('poll_answers')],
            'main_table.PollId = secondTable.PollId',
            ['AnswerId','AnswerText']
        )->group('main_table.PollId'); //EDIT
    $this->addFilterToMap('PollId', 'main_table.PollId');
}

Are joins actually the way to go for this problem ?

EDIT : I can use the group function on my select to remove the duplicates inside my grid, but that prevents me from getting all the answers in my form. How can I get around that ?


texts: Magento 1.9 - Product not being added to basket for logged out users

texts:
Like most Magento related issues, banging your head against the wall is often necessary to find a solution. This time however, nothing.

I am having a strange issue for customers who are logged out and trying to add items to an empty cart. It won't work for some specific product types.

I have extended the Cart Controller to add support for user inputted values instead of the standard Magento dropdown approach. This means that users could potentially input a number that doesn't yet exist yet as an associated product to my configurable (see image below).

Therefore I have implemented a system that will create the product should it not exist, then add it to the basket. This works beautifully for logged in users (and even logged out users with existing items in the basket). But it doesn't work when a logged out user has an empty cart despite it adding the success message.

My initial thought was that it was a Session related issue because users without accounts don't access the database, and also because it randomly starts working once a logged out user has items existing in the basket.

I have attempted refreshing sessions, initialising the cart, adding it twice for good measure but still nothing.


texts:
If I use this kind of price rule in Magento (1.9.2.2)

Buy X (1) get Y (1) for free (the step is 1) within a certain category - the rule only applies if customer puts 2 products with the same SKU (article number) in the cart. But that isn't the point of setting up the rule (to be valid within a certain category) is it?

I want the customer to be able to chose any kind of product as long as it is within the specific category, and when 2 is in the cart, the rule should apply.

Isn't this possible in Magento?


texts: Extended Module for Subscription Newsletter in Magento 2

texts:
I have extend a module for subscription newsletter in magento 2 for change in NewAction.php file.
After enabling the Module it doesn't work As, i want to remove newsletter popup on subscription success.

My di.xml file is

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Newsletter\Controller\Subscriber" type="News\Newslettermodule\Controller\Subscriber" />
</config>

My module.xml file is

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="News_Newslettermodule" setup_version="0.0.1" />
</config>

but it didn't work for me.


texts:
I am using Magento 2.2.2.

I want to restrict the number of SKU characters to be entered in the Admin Product Detail Page. How to achieve this.


texts: Price of bottle shown as price of one shot

texts:
I hope it isn't too bold to ask for help.
I sell bottles of liquor and I want to show under price of bottle (item) converted price of one shot.

My idea is this

  If attribute 'show_shot_price' says 'Yes', then it should find out
  what price is current whether price or special_price.

  Then I have several options with volume.

  If attribute volume has options 1 liter it should divide the
  price by 25 (40 milliliter shot).

  0,7 liter price/17,5.

  0,5 liter price/12,5.

And the result should be round to whole number.


texts: Customer Session works differenlty with cache

texts:
I got one site to fix issues and noticed one very odd issue.

Below code is work well in DISABLE cache mode but not in ENABLE mode. If I enable cache then it only works on customer-account (customer/account) section but not other parts/pages of site.

Code snippet of path:

  app/design/frontend/Company/developer/Magento_Theme/templates/html/header.phtml

$objectManagerlogin = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManagerlogin->get('Magento\Customer\Model\Session');
$baseurl = $objectManagerlogin->get('Magento\Store\Model\StoreManagerInterface')->getStore(0)->getBaseUrl();
 if($customerSession->isLoggedIn()) {

      echo "Logout";

 }else {
      echo "Login";
}

PS: I am aware that Object Manager should not be used  and commands (static content, reindex, cacha clean, di compilation) ran completely.


texts: Best way to handle product images on Magento 1.9.x?

texts:
Magento 1.9.1 and 1.9.4

I defined our front page image size to be 300 x 350 but some photos do not show that size (I guess based on the side ratios of the original product image?).

It does not look good at all to have images of different sizes on the front page next to each other. How can we make it so that all images show the same size on the front page?


texts:
my site is like a platform between multiple websites. So I don't want a homepage for each website, and I want to be directly in the first category.

How can I do that? I search for about 1h30 but find nothing wich could help me.

I know how to display custom phtml from a module on a home page, so maybe I can redirect, if I can, how I get the corresponding category of the current website?

Anyone know how to do it?


texts: Can't create Configurable Product with attribute error

texts:
When I try to add Configurable product

I got this error

  Only attributes with scope "Global", input type "Dropdown" and Use To
  Create Configurable Product "Yes" are available.

I check the attribute set and remove all attribute except system attribute

but I still got error. I check description attribute it's textfield type

Description attribute only textfield is needed

I'm confusing how to create configurable product .. what am I missing?


texts:
Any one know how we can use AWS CloudFront for magento2 for Catalog Images and Possible for CSS as well.
Thank you in advance for help.


texts:
I want to validate the form on our Magento 2.3 store instant.
So when a value is added into the input field, it should validate this instant and add some css class or id to the input field.

In that case we can add a validation check to the input, so the customer knows that the input is right.

This is quite easy for M1, but I can not find a solution for M2.

How can we achieve that?


texts: Magento new order email going to customer but no copy sent to me

texts:
So I am dealing with a customers Magento site and has just had this problem start.
I have no idea whats causing it or how to fix it

When a new order is placed the email goes straight out to the customer which is fine however we/store owner doesn't receive a copy of this email thus having no idea a new order has been placed.

The site is running Magento ver. 1.9.1.0 and all emails are correct in system>configuration>sales emails


texts:
I'm attempting to assign some variable used in a custom modules model.  This variable will be defined in the CMS page.  How can I pass this variable in such a way as it will be used in the model?  I'm assigning the variable like this:

{{block type="catalog/layer_view" name="view" myvariable="5" template="catalog/layer/view.phtml"}}

How can I access this variable within the model?

Specifically.. here:

class Mage_Catalog_Model_Layer extends Varien_Object{
    public function prepareProductCollection($collection){
        //access variable
    }

}


texts:
Translate checkout text input fields
How to translate checkout label text?


texts: Class hierarchy of Shopping Cart Price Rules

texts:
Class Mage_SalesRule_Model_Validator has an object of salesrule/rule_collection, and that object calls a function validate of class    Mage_SalesRule_Model_Rule_Condition_Product_Found, what I didn't understand is how the object of salesrule/rule_collection is related to Found class, and if we add any other function to this class and try to access it will throw an Exception Undefined Function, I just want to understand whats going on behind the scenes

UPDATE

Mage_SalesRule_Model_Rule_Condition_Product_Found extends the class Mage_SalesRule_Model_Rule_Condition_Product_Combine but when from process function of the
Mage_SalesRule_Model_Validator called it calls the validate function of the Found class Mage_SalesRule_Model_Validator object call to process

try {
   $validator = Mage::getModel('module/validator')
                    ->init($customer->getWebsiteId(), $customerGroupId);
} catch (Exception $e) {
   Mage::log('Exception: ' . $e . ' in ' . __CLASS__ . ' on ' . __LINE__);
}
$v  = $validator->process($quote);

And the process function of Mage_SalesRule_Model_Validator which calls the validate function of Found class

public function process($_quote)
{
         $quote           = $_quote;
         $customerSession = Mage::getSingleton('customer/session');
         foreach ($this->_rules as $rule) {

            if ($rule->getIsValid() === false) {
              continue;
            }
            if ($rule->getIsValid() !== true) {
                $rule->afterLoad();
                if (!$rule->validate($quote)) { // quote does not meet rule's conditions , //Call Found.php
                $rule->setIsValid(false);
                continue;
                }
                $rule->setIsValid(true); // passed all validations, remember to be valid
            }
    }
    return $this;
}

And the validate function of Found class

   public function validate(Varien_Object $object)
   {
//Called form Validator.php
    $all       = $this->getAggregator() === 'all';
    $true      = (bool)$this->getValue();
    $found     = false;

    $Count =  count($object->getAllItems());
    $i = 0;
    foreach ($object->getAllItems() as $item) {
        $found = $all ? true : false;
        foreach ($this->getConditions() as $cond) {

            $validated = $cond->validate($item); // Call to Product.php's function 'validate'

            if($validated) {
                $this->_ProductId[] = $item->getProductId();
            }

            if($i == $Count) {
                if ($all && !$validated) {
                $found = false;
                break;
                } elseif (!$all && $validated) {
                $found = true;
                break 2;
                }
            }

                }
            if($i == $Count) {
            if ($found && $true) {
                break;
            }
            }
            $i = $i + 1;
        }
    return false;
}

Now what I didn't understand is if I write any other function in Found class let it be public function Foo() and try to call it from process function of class Validator like

    $rule->Foo();

it will throw an Exception Undefined Function
I just want to know the reason why I can't write any function in Found class and call like process
Thanks


texts: How to create custom product image attribute in magento2.2.5?

texts:
I want to create custom product image attribute in magento2.2.5?

Created a custom product image attribute but not able to save the image

  /var/www/html/magento2/app/code/Amy/ImageUploader/Model/Attribute/Product/Image.php

<?php

namespace Amy\ImageUploader\Model\Attribute\Product;

use Magento\Framework\App\Filesystem\DirectoryList;

class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend {

    protected $_uploaderFactory;
    protected $_filesystem;
    protected $_fileUploaderFactory;
    protected $_logger;

    public function __construct(
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Filesystem $filesystem,
        \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory
    ) {
        $this->_filesystem = $filesystem;
        $this->_fileUploaderFactory = $fileUploaderFactory;
        $this->_logger = $logger;
    }

    public function beforeSave($object)
    {
        //echo $this->getAttribute()->getName();
        //Out Put: custom_product_image
        //echo '<br>';
        //var_dump($object->getData($this->getAttribute()->getName()));
        //Out Put: NULL
        //var_dump($this->getAttribute()->getName() . '_additional_data');
        //Out Put: NULL
        //var_dump($object->getData('name'));
        //Out Put: string(16) "Joust Duffle Bag"
        //exit;
        $value = $object->getData($this->getAttribute()->getName() . '_additional_data');
        echo"aaa";
        exit;

        if (empty($value) && empty($_FILES)) {
            return $this;
        }

        if (is_array($value) && !empty($value['delete'])) {
            $object->setData($this->getAttribute()->getName(), '');
            $this->getAttribute()->getEntity()->saveAttribute($object, $this->getAttribute()->getName());
            return $this;
        }

        $path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('catalog/product/');

        try {

            $uploader = $this->_fileUploaderFactory->create(['fileId' => $this->getAttribute()->getName()]);
            $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
            $uploader->setAllowRenameFiles(true);
            $result = $uploader->save($path);

            $object->setData($this->getAttribute()->getName(), $result['file']);
            $this->getAttribute()->getEntity()->saveAttribute($object, $this->getAttribute()->getName());
        } catch (\Exception $e) {
            if ($e->getCode() != \Magento\MediaStorage\Model\File\Uploader::TMP_NAME_EMPTY) {
                $this->_logger->critical($e);
            }
        }

        return $this;
    } }

Any help would be appreciated.


texts: How to display customer name in header after logged in

texts: How can I display customer name in the header after logged in successfully?


texts: How to delete cart Item by SKU or productId in magento 2

texts:
I have retrieving all cart items and deleting the quote item by match with the product Sku,

Here is my code.

protected $checkoutSession;
protected $_itemModel;
protected $cart;
public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Checkout\Model\Session $checkoutSession,
    \Magento\Checkout\Model\Cart $cart,
    \Magento\Quote\Model\Quote\Item $itemModel
    {
     $this->cart = $cart;
     $this->checkoutSession = $checkoutSession;
     $this->_itemModel = $itemModel;
     parent::__construct($context);
    }

 public function execute() {
       $quote = $this->checkoutSession->getQuote();
                $quoteItems = $quote->getAllVisibleItems();
                foreach($quoteItems as $item) {
                    $cartquote = $this->cart->getQuote();

                    $productSku = $item->getProduct()->getSku();
                    //$this->logger->info('ItemproductSku'.$productSku);
                    $checkExistedSKu  = $this->getExistedSKu($productSku);
                    if($checkExistedSKu){
                        $itemId = $item->getItemId();
                        //$this->cart->removeItem($itemId)->save();
                        $this->_itemModel->load($item->getItemId())->delete();
                    }

                    $cartquote->updateItem($item->getId(), array( 'qty' => 1));
                    $cartquote->save();
                }

    public function getExistedSKu($productSku){
       $connection = $this->getConnection();
       $sql = "select * from custom_table where sku='".$productSku."'";
       $resultProduct = $connection->query($sql);
       $resultQuery = $resultProduct->fetchAll();

      if(!empty($resultQuery)){
        $parent_sku = $resultQuery[0]['parent_sku'];
        return true;
       }
      }else{
       return false;
      }
      }

I am getting the product Sku by itemId and checking against my custom table, if Product Sku present in the table I am deleting that quote item and updating all other Items by Qty 1.

This code is not working for me, can anyone look into it where i am doing wrong here,

Any help will be Appreciated!!