texts:
How to override Magento/Catalog/view/base/templates/product/price/amount/default.phtml

My layout file:

Dckap/Cnet/view/base/layout/catalog_product_prices.xml

<?xml version="1.0"?>

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices">
        <arguments>
            <argument name="custom_option_price" xsi:type="array">
                <item name="default_amount_render_template" xsi:type="string">Dckap_Cnet::product/price/amount/default.phtml</item>
            </argument>
        </arguments>
    </block>
</layout>

View file:
Dckap/Cnet/view/base/templates/product/product/amount/default.phtml

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

// @codingStandardsIgnoreFile

?>

<?php /** @var \Magento\Framework\Pricing\Render\Amount $block */ ?>
Custom File
<span class="price-container <?= /* @escapeNotVerified */ $block->getAdjustmentCssClasses() ?>"
        <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
    <?php if ($block->getDisplayLabel()): ?>
        <?= /* @escapeNotVerified */ $block->getDisplayLabel() ?>
    <?php endif; ?>
    <span <?php if ($block->getPriceId()): ?> id="<?= /* @escapeNotVerified */ $block->getPriceId() ?>"<?php endif;?>
        <?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
        data-price-amount="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>"
        data-price-type="<?= /* @escapeNotVerified */ $block->getPriceType() ?>"
        class="price-wrapper <?= /* @escapeNotVerified */ $block->getPriceWrapperCss() ?>"
    ><?= /* @escapeNotVerified */ $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?>
    <?php if ($block->hasAdjustmentsHtml()): ?>
        <?= $block->getAdjustmentsHtml() ?>
    <?php endif; ?>
    <?php if ($block->getSchema()): ?>
        <meta itemprop="price" content="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>" />
        <meta itemprop="priceCurrency" content="<?= /* @escapeNotVerified */ $block->getDisplayCurrencyCode() ?>" />
    <?php endif; ?>

```


texts: How to prevent paypal auto changing order status from processing to complete magento 1

texts: noticed that the paypal standard module automatically transfers orders to the status of complete. How to prevent him from doing this? it does not work correctly, since the status complete means that the products were sent.


texts:
I'm using Magento 2 and I have a js file that was called like this:
default.xml
<?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">
    <body>
      <referenceContainer name="after.body.start">
          <block class="Vendor\Module\Block\Ajax\Login\Js" template="Vendor_Module::login-ajax.phtml" name="login.ajax" as="login.ajax" before="head.components" ifconfig="loginpopup/general/enabled" />
      </referenceContainer>
    </body>
</page>

login-ajax.phtml
<script type="text/x-magento-init">
{
    "*": {
        "vm/loginajax"    : <?php echo $block->getJsOptions(); ?>
    }
}

requirejs-config.js
var config = {
    map: {
        '*': {
            'vm/loginajax': 'Vendor_Module/js/login-ajax'
        }
    }
};

Vendor_Module/js/login-ajax
define([
    'jquery',
    'mage/translate',
    'jquery/ui',
    'mage/validation/validation',
    'vm/mycustom'
], function ($, $t)

the js file size is 3KB , i noticed the js file is rendered not at the very beginning, how can i set the priority so this js file will load first?


texts:
I have installed Magento2 in AWS server. After deploying, I get this warning message on top of admin dashboard.

  Warning : One or more integrations have been reset because of a change
  to their xml configs

I checked in google, but no one has reported this error.


texts: Magento CE 1.9.0.0 downloadable product does not open uploader

texts:
In Magento CE 1.9.0.0 I have the problem that when I add a downloadable product in backend and want to add the file by clicking  "Add new row" nothing happens.

The console reports:

SyntaxError: unterminated string literal
'Dieser Inhalt erfordert die neueste Version des Adobe Flash

Does someone know in which file the error occurs?


texts: How to load custom JS and dependencies using RequireJS

texts:
I'm struggling to understand where and how to correctly configure RequireJS to load my custom JS and it's dependencies. What I have below is working but I don't think it's set up correctly.

My theme requirejs-config.js

var config = {
    paths: {
        'myapp': '"js/myapp"',
        'owlcarousel': 'js/vendor/owl.carousel',
    },
    shim: {
        'myapp': {
            deps: ['jquery','owlcarousel']
        },
        'owlcarousel': {
            deps: ['jquery']
        },
    }
};

My custom JS myapp.js

require(['jquery','owlcarousel'], function($){

    var myCarousel = $(".carousel").owlCarousel();
    console.dir($);
    console.log(myCarousel);

});

To get myapp.js to output as expected, I have to put the following in one of my template files but if I load it just after the body tag it gives an error, which suggest that my script it not waiting for require resources before it runs and only works by chance if it's loads later.

<script>
    require (['js/sozoapp'], function() {});
</script>

Can anyone explain what I'm missing here?


texts: Import Orders to magento no stock products

texts:
Trying to import orders to magento from other platform.
I have almost done except import products with attribute stock_data is_in_stock set to 0. If I set manually the value to 1 imports correctly. I've tried it setting the value temporally to 1 and once is imported set it to 0 when needed, but i think is not the best way. Is there any other way to do it? any help will be appreciated.

function _order_create($data){
        if(is_array($data) and !empty($data['product'])){
            $quote = Mage::getModel('sales/quote')
                    ->setStoreId(Mage::app()->getStore('default')->getId());

            $customer = Mage::getModel('customer/customer')
                            ->setWebsiteId(1)
                            ->loadByEmail($data['customer_email']);
            $quote->assignCustomer($customer);

            // add product(s)

             foreach ($data['product'] as $id => $pdata) {

                $product = Mage::getModel('catalog/product')->load($pdata['id']);
                $buyInfo = array('qty' =>$pdata['qty']);
//****************** here set is_in_stock to 1
                $quote->addProduct($product, new Varien_Object($buyInfo));
                $quote->save(); // without saving the quote here I get error

                $quoteItem = $quote->getItemByProduct($product);
                $quoteItem->setOriginalCustomPrice($pdata['price']);
                $quoteItem->setCustomPrice($pdata['price']);
                $quoteItem->setIsSuperMode(true);
                $quoteItem->save();
// ****************** here set is_in_stock to 0
                 }

            foreach ($data['address']['shipping'] as $key => $value) {
                $addressDataShipping[$key] = $value;
            }

            foreach ($data['address']['billing'] as $key => $value) {
                $addressDataBilling[$key] = $value;
            }

            $billingAddress = $quote->getBillingAddress()->addData($addressDataBilling);
            $shippingAddress = $quote->getShippingAddress()->addData($addressDataShipping);
            $shippingAddress->setCollectShippingRates(true)->collectShippingRates()
                            ->setShippingMethod($data['methods']['shipping'])
                            ->setPaymentMethod($data['methods']['payment']);

            $quote->getPayment()->importData(array('method' => $data['methods']['payment']));
            $quote->setTotalsCollectedFlag(false)->collectTotals()->save();

            $service = Mage::getModel('sales/service_quote', $quote);
            $service->submitAll();

            $order = $service->getOrder();
            $order->setCreatedAt($data['order']['createdat']);
            $order->setData('state', $data['order']['status']);
            $order->setStatus($data['order']['status']);

            $order->save();
            //printf("Created order %s\n", $order->getIncrementId());
        }
    }

This is the method im using

Thanks for reading!

EDIT: the easiest way is before start adding products set manage_stock to 0 and once finished set it back to 1


texts: Remove specific dates and days from the Magento Calendar

texts:
The two solutions work if implemented separately:
Disable selected dates in default Magento2 calendar
Disable/Remove Sunday and it related date from calendar
How to implement both solutions with the beforeShowDay function? Is there otherwise another approach for including both solutions?


texts: Get product data between 2 dates using filters in get product rest API magento2

texts:
I am using this API to get products between given end_date

  "http://localhost/test/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=end_date&searchCriteria[filter_groups][0][filters][0][value]=2019-07-22
  00:00:00&searchCriteria[filter_groups][0][filters][0][condition_type]=gteq&searchCriteria[filter_groups][0][filters][0][field]=end_date&searchCriteria[filter_groups][0][filters][0][value]=2019-07-22
  00:00:00&searchCriteria[filter_groups][0][filters][0][condition_type]=lteq"

but it is not giving me correct response. I am getting response like this

"{
    "items": [],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "end_date",
                        "value": "2019-07-22 00:00:00",
                        "condition_type": "lteq"
                    }
                ]
            }
        ]
    },
    "total_count": 0
}"

seems like API considering only last filter.


texts: Magento1 : Get the total price from the quantity of products before adding to the cart

texts:
Goodmorning everyone.
I am a web designer not a developer, my coding knowledge is extremely limited.
Despite all the tutorials I've read, I have a hard time understanding the magento logic for creating modules and I rely on this online tools to create simple modules:
https://modulecreator.silksoftware.com/magento-module-creator/#.VG-SJ_nF9Zo
I'm trying to create a widget that displays on product pages.
The widget must retrieve the price of the product and multiply it by the quantity entered by the customer in the input quantity before placing the product in the cart.
The aim is to inform the customer about how much the quantity of products will cost him.
in case of tier price or special-price The data that the widget must retrieve must always be the final price.
Do you know something that already exists?
If not, do you have any suggestions?
Thank you all.


texts: locally installed grunt, "grunt exec:blank" fails with "/bin/sh: grunt: command not found"

texts:
I am hosted at Nexcess and tried to implement Grunt to assist with LESS development. I followed the Magento 2 docs for installing grunt. NodeJS 10.10.0 is installed.

The first deviation from the instructions has to do with how grunt, grunt-cli, and lessc were installed. The instructions say to install globally, with the -g parameter, but as this is shared hosting, that's not possible.

So instead I install locally to ~/public_html/. This creates a node_modules folder. This was followed up with npm install and npm update. I can now run grunt with its full path from the magento public_html folder, but I get an error:

~/public_html/node_modules/grunt-cli/bin/grunt exec:blank

 [public_html]$ ./node_modules/grunt-cli/bin/grunt exec:blank
Running "exec:blank" (exec) task
  /bin/sh: grunt: command not found
  Exited with code: 127.
  Error executing child process: Error: Process exited with code 127.
Warning: Task "exec:blank" failed. Use --force to continue.

Aborted due to warnings.

Running the clean: or less: commands both work on the blank theme. Only exec fails.. That is, I should say.. clean:blank works while less:blank results in some additional messages that I am not sure how to explain:

 public_html]$ ./node_modules/grunt-cli/bin/grunt less:ms
Running "less:ms" (less) task
>> Destination pub/static/frontend/MS/theme-frontend-ms/en_US/css/styles-m.css not written because no source files were found.
>> Destination pub/static/frontend/MS/theme-frontend-ms/en_US/css/styles-l.css not written because no source files were found.
>> Destination pub/static/frontend/MS/theme-frontend-ms/en_US/css/email.css not written because no source files were found.
>> Destination pub/static/frontend/MS/theme-frontend-ms/en_US/css/email-inline.css not written because no source files were found.


texts: Reset “Use Secure in Front End or Admin” in Database is not working

texts:
I have carefully follow instruction to setup SSL in Front-end and Admin panel by using

System -> Configuration -> Web -> Use Secure URLs in Frontend

and

System -> Configuration -> Web -> Use Secure URLs in Frontend

to "Yes"

After that I can't access my Administrator Panel anymore, it always redirected to https.

I have tried to revert the config. But still no luck, I also have change database table : core_config_data. web/secure/use_in_frontend and web/secure/use_in_adminhtml to 0 and web/secure/offloader_header is SSL_OFFLOADED.

Also, remove cache and session data. Still no luck.

I using Magento 1.9 and Nginx.

I got it, it was the Magento cache problem, somehow it was cache inside the folder /tmp/magento/var/cache of my Linux (not Magento tmp folder). After I delete it, I can finally access my adminhtml using HTTP.


texts: Magento 2 What is the fastest way to get construction changes?

texts: Whenever I made any changes on the construction method, I need to do bin/magento setup:di:compile to get any changes on my code. It was wasting my time, how can I get any changes faster than have to run that command, please?


texts: Set custom field value in customer registration

texts:
I created a custom field named location_city in customer. In the admin, under Account Information tab, the name of the field is: account[location_city]

Now during new registration, I want to set the value of this field. I wanted to get the city, state etc. of user from ip address. Here is my code:

        include('Ipinfo\Host.php');
        include('Ipinfo\Ipinfo.php');

        $ipInfo = new Ipinfo\Ipinfo();

        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } else {
            $ip = $_SERVER['REMOTE_ADDR'];
        }

        $host = $ipInfo->getFullIpDetails($ip);

        if(isset($host))
            $city = $host->getCity();
        else
            $city = "N/A";

        $customer->setData('location_city', $city);
        $customer->setData("account['location_city']", $city);
        $customer->setLocationcity($city);
        $customer->setLocationCity($city);
        $customer->setLocation_city($city);

None of the last five lines are working, city is always blank in admin.

The script I used to create the custom field is this:

$installer = Mage::getResourceModel('customer/setup', 'customer_setup');
$installer->startSetup();

$installer->addAttribute('customer','location_city', array(
'label'             => 'Source City',
'type'              => 'text',    //backend_type
'input'             => 'text', //frontend_input
'global'            =>  Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible'           => true,
'required'          => false,
'default'           => '',
'frontend'          => '',
'unique'            => false,
'note'              => ''
));

Mage::getSingleton('eav/config')
->getAttribute('customer', 'location_city')
->setData('used_in_forms', array(
    'customer_account_create', 'customer_account_edit', 'customer_address_edit',
    'checkout_onepage_register', 'checkout_onepage_register_guest', 'checkout_onepage_billing_address',
    'adminhtml_customer','checkout_onepage_shipping_address','checkout_multishipping_register'
))
->save();
$installer->endSetup();

Please help what to do,

Thanks


texts:
Without changing anything my checkout now redirects to the cart page.

It happens after selecting the payment method. When i click on the order now button and it redirects me to the cart .

I have the following settings at my admin panel

in system -> sales -> checkout "allow guest checkout" set to "yes"

I don't know why it happens and the strange thing it is that the order is taken by Magento, but the order mail it is not sent.

Do you know why it would happen something like that? the logs do not tell anything about that?

this is the system.log

2017-05-10T08:25:40+00:00 ERR (3): Notice: Undefined index: type_product  in /home/max3322/public_html/ecommerce/app/code/local/Magentothem/Ajaxcartsuper/controllers/AjaxcartController.php on line 26
2017-05-10T08:29:13+00:00 ERR (3): Warning: include(Mage/Import/Model.php): failed to open stream: No such file or directory  in /home/max3322/public_html/ecommerce/lib/Varien/Autoload.php on line 94
2017-05-10T08:29:13+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Import/Model.php' for inclusion (include_path='/home/max3322/public_html/ecommerce/app/code/local:/home/max3322/public_html/ecommerce/app/code/community:/home/max3322/public_html/ecommerce/app/code/core:/home/max3322/public_html/ecommerce/lib:.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php')  in /home/max3322/public_html/ecommerce/lib/Varien/Autoload.php on line 94

and this is exception.log

    #0 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Tipo blocco non...')

1 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('relatedslider/p...', Array)

2 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('relatedslider/p...', 'magentothem_rel...')

3 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('relatedslider/p...', 'magentothem_rel...')

4 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))

5 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))

6 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()

7 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()

8 /home/max3322/public_html/ecommerce/app/code/local/Magentothem/Ajaxcartsuper/controllers/AjaxcartController.php(63): Mage_Core_Controller_Varien_Action->loadLayout()

9 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Magentothem_Ajaxcartsuper_AjaxcartController->addAction()

10 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('add')

11 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))

12 /home/max3322/public_html/ecommerce/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()

13 /home/max3322/public_html/ecommerce/app/Mage.php(684): Mage_Core_Model_App->run(Array)

14 /home/max3322/public_html/ecommerce/index.php(83): Mage::run('', 'store')

15 {main}


texts: get scope_id value from current store-view

texts:
How i can get the scope_id value from core_config_data table of the current store-view?. I've tried using:

Mage::app()->getStore()->getStoreId();

But this doesn't return the scope_id value.

Thanks!


texts: blank page on M2 on ubuntu on aws after 'successful' install

texts:
I've successfully installed a t2.small instance on AWS with Ubuntu 14.04. I installed apache 2.4.7 and php 5.6.18 and mysql 5.6.x. Prior to installing M2-ce I could access docroot no problem from any browser getting the basic "Index of" message from apache.

I installed M2.02 from the command line with sample data and it reported a successful installation of all components and sample data

  Post installation file permissions check...
  For security, remove write permissions from these directories: '/var/www/html/magento2-ce/app/etc'
  [Progress: 363 / 363]
  [SUCCESS]: Magento installation complete.

Now when attempting to access magento2-ce docroot, I get a completely blank page. Same thing for /admin_XXXX.

Chrome reports the dreaded server side 500 error. I've set all permissions per the installation guide. I'm posting this here because the problem arose AFTER installing M2. I'd appreciate any info on where to look to solve this. I've dug through the apache2 access log and error log and they indicate no problems with apache.

I have updated apache.conf to modify docroot to /var/www/html/magento2-ce.

My magento2-ce directory and all of its descendants are owned by magento:www-data.

phpmyadmin runs perfectly from the docroot.

Chrome reports the server is barfing on favicon.ico but says nothing more (e.g. no 404 etc.)


texts:
I am trying to add some text to the page below-

/html/vendor/magento/module-customer-custom-attributes/view/frontend/templates//customer/form/register.phtml

I created a file at

/name/name/Magento_Customer_Custom_Attributes/templates/customer/form/register.phtml

I flushed all the caches multiple times but it still pulls the old file.

How can I get the correct template file to show?


texts: Magento2 How to add custom validation for password?

texts:
I want to change default validation for all password field.

I want to change for all password field and validation is minimum 8 characters and at least one number include.

Can anyone help me with this?


texts: How to remove all special prices for a specific customer group

texts:
I accidentally uploaded special prices for an erroneous group of customers.
How to remove all special prices for a group of customers, not login
(customer_group_id = 0) for all products and items from the table catalog_product_entity_tier_price
Help please with writing a request!


texts:
I am very new to Magento and did not know much about this so pardon my mistakes. Actually, I have deployed it on the local server and it is running fine. I want to customize this like I want to change the heading logo colors. I have worked on CodeIgniter but that was simple, having HTML. How can I customize it? It will be a great help.

P.s The default theme is I think LUMA.

What I have tried: I have tried from going to the admin panel but the only option was the logo. I have tried the code but I was not able to locate the file where I can change these things.


texts: Magento 2.4 REST API for get order Details thought order Id issue

texts:
<route url="/V2/order/:orderId" method="GET"> <service
class="Custom\Test\Api\OrderDetailsRepositoryInterface" method="getOrderDetails"/>
<resources> <resource ref="self" /> </resources> <data> <parameter name="customerId"
force="true">%customer_id%</parameter> </data> </route>

Using this for getorderDetails thought order Id
In my module function using this
$orderId = 219;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('\Magento\Sales\Model\OrderRepository')->get($orderId);
$custLastName = $orders->getCustomerLastname();
print_r($custLastName)

But getting this issue
 "message": "No such entity with %fieldName = %fieldValue",
"parameters": {
    "fieldName": "orderId",
    "fieldValue": null
},

Steps to reproduce:

Headers: Authorization Bearer + [TOKEN]
Create a order with get /V2/order/219

How can i solve?? it's a bug or i forgot something? i've seen a lot of thread but no one can help me.
Thanks in advance!


texts:
I have a problem with my Magento installation. I have set up the website with 21% Tax. When you look in the cart, you see a completely wrong price calculation.

The excluding price is right, but the tax amount and including tax price are not. An example:

Total without Tax: €2.149,00
Shipping: €99,-
Tax: €468,47
Total with Tax: €2.699.29.

As you can see, nothing makes sense:

21% of €2.149,00 = €451,29.
21% of (2.149+99) = €472,08.

The total of the amounts: €2.149 + €99 + €468,47 is not: €2.699,29.

Can anyone please help with this problem? All the taxes are set up in the right way, and I am completely lost here.


texts: How to display sales_order (only pending orders) grid in custom module

texts:
How we can display sales_order grid in custom module with only pending status.
For now I display sales_order_grid using ui component. I only want to display pending orders in this grid


texts: Custom validation not working in checkout

texts:
I followed this guide in order to add a new validation to my checkout. I deployed the content, cleared the cache and enabled the module several times but the validation is not working.

I also added a console.log('foobar'); to the isGmail.js file inside the validate function, but it never gets printed. I also checked the pub folder for the content and it is right there.

Magento 2.2.3

Any ideas what might be wrong?

Thanks!


texts: How to use group by in magento collection with join query

texts:
In module's admin grid I am using this code to get collection and group them by customer id

$collection = Mage::getModel('referafriend/statistics')->getCollection();
$collection->getSelect()->group('entity_id');
$this->setCollection($collection);

but here i have to use renderer and filter functions for customer info like name and email against each entity_id.
i want to join customer model with my module's table. for this i have written this code

 $collection = Mage::getModel('customer/customer')->getCollection()
 ->addNameToSelect();
$collection->getSelect()->join(array('refer' => 'table_name'),'refer.entity_id = e.entity_id'
          );
   $collection->getSelect()->group('entity_id');
   $collection->addAttributeToSelect('*');

but it gives me this error

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'entity_id' in group statement is ambiguous

any help will be highly appreciated.


texts: Magento2 : Bulk Product upload csv for compare Prodcut Sku then result back to in CSV

texts:
How to upload csv for compare Product Sku then result back to in CSV

I want to create a simple backend from there  backend which can Upload CSV and
populate Product Collection which not available set an array and return back to csv format.


texts:
I'm working on customization of extension functionality. I have to add my custom code with it, but when I have checked code all the codes are encoded and I can't see actual code there.

So can anyone please help me how to decode and get code in original form?

Code of Block file is as below.

$qfQUcKlNMJarFuvYADxSwGtijZhHTXoPBLOVmRnebzWgsyEIpkC1507437326 = file(__FILE__);eval(base64_decode("aWYoIWZ1bmN0aW9uX2V4aXN0cygid1VQRVZHeEZBSldxb2NTcnNIT1lNTHBLQmZYTmdtUWtoSWV0aXVqVHlhdm5sYnpSRFpDMTUwNzQzNzMyNiIpKXtmdW5jdGlvbiB3VVBFVkd4RkFKV3FvY1Nyc0hPWU1McEtCZlhOZ21Ra2hJZXRpdWpUeWF2bmxielJEWkMxNTA3NDM3MzI2KCRnLCRiPTApeyRhPWltcGxvZGUoIlxuIiwkZyk7JGQ9YXJyYXkoMTEzNSwzNDQsNDApO2lmKCRiPT0wKSAkZj1zdWJzdHIoJGEsJGRbMF0sJGRbMV0pO2Vsc2VpZigkYj09MSkgJGY9c3Vic3RyKCRhLCRkWzBdKyRkWzFdLCRkWzJdKTtlbHNlICRmPXRyaW0oc3Vic3RyKCRhLCRkWzBdKyRkWzFdKyRkWzJdKSk7cmV0dXJuKCRmKTt9fQ=="));eval(base64_decode(wUPEVGxFAJWqocSrsHOYMLpKBfXNgmQkhIetiujTyavnlbzRDZC1507437326($qfQUcKlNMJarFuvYADxSwGtijZhHTXoPBLOVmRnebzWgsyEIpkC1507437326)));eval(bfTFLZBezUnhpwNugKliQMWAxHERqJOjVDvcIGCStPYsmaryXok1507437326(wUPEVGxFAJWqocSrsHOYMLpKBfXNgmQkhIetiujTyavnlbzRDZC1507437326($qfQUcKlNMJarFuvYADxSwGtijZhHTXoPBLOVmRnebzWgsyEIpkC1507437326,2),wUPEVGxFAJWqocSrsHOYMLpKBfXNgmQkhIetiujTyavnlbzRDZC1507437326($qfQUcKlNMJarFuvYADxSwGtijZhHTXoPBLOVmRnebzWgsyEIpkC1507437326,1)));__halt_compiler();aWYoIWZ1bmN0aW9uX2V4aXN0cygiYmZURkxaQmV6VW5ocHdOdWdLbGlRTVdBeEhFUnFKT2pWRHZjSUdDU3RQWXNtYXJ5WG9rMTUwNzQzNzMyNiIpKXtmdW5jdGlvbiBiZlRGTFpCZXpVbmhwd051Z0tsaVFNV0F4SEVScUpPalZEdmNJR0NTdFBZc21hcnlYb2sxNTA3NDM3MzI2KCRhLCRoKXtpZigkaD09c2hhMSgkYSkpe3JldHVybihnemluZmxhdGUoYmFzZTY0X2RlY29kZSgkYSkpKTt9ZWxzZXtlY2hvKCJFcnJvcjogRmlsZSBNb2RpZmllZCIpO319fQ==7684758833c134efc3f1b29ad86df4505b819d2erVddT+M4FH1H4j9YXVZpEd3OvFJRTekyDKthF8HM7AOtIie+bb04ceQ4LR3Ef99rO0mTJgVmdi0eXOfe4/txfGwODw4PYhpBmtAQyLV4nE5kvAKlLzNI9fRcyPBhOmYRj5c6EtO/FAM1PESnUNA0JReMawKPGmKWkuk1XUCs5fSchg+4knv/zdkC9PSjVJEB15THoA4Png4PCI7B8bGbkGMykQqIggVPtdoUq+XXDyuqtnt8VBj1WqqH6e2Ow8BNEiU1hBoYOfJDBC7MyBmJMyFsErsBfEgowr6SiMkBUyZHoZvs9W6GSI52syucqFIUPzOq6W4eWSB4SOZZHGouY+JjNjFCZKHu5qY4fizkkxbHl6Kt2FcCxUrez9yXHnnamhzpJU/7o92ql2jDrSkmj5ufnlaTKoN0u/Ry8+e2hl3FXHMq+HcgYZQi3AIIGE4GJv0mhRToTMVkJTnbS5dtpbcx9ZxRS5Iy+AfdrphZOyMeZsP1xufMGzZtbVCXSmaJtcXT5ldPW5uLqYWSQoCyLrQ4ib40J9ErWVwrZiXumgGfk24BzNOxEHINbGyT7TaiOT0N3a+F+eX281O6Aq9X63Yl2iDTWsafscn9UZZg86DrWY8T4gkagMCJ73e9O4cyfBWEMtatG5lhMWnMTG14nCF80+a+uWRdXRjkbFQGQhCJTHIoK2herwXQelvRs955XnvsDG99qrXimA1Yhz0BWfMIadvnSOXXLK21K5Az9WCFLd9GNI5ZkYrNBAuvqUIJcCa/mLPhz1GJvdme2M3Y923WXG4z7b9/966+Wm31MwGRwhsYpCCSq4JBNYT/l9MMBOgfZHXus8Pr3wuk/5JuEU494VreVQW8BWQZsoBYgcfWkiVQTAu3hQi5QRgkeB/weEFQ0oTEb8zq5F5xbLkRbpaKpqXHnosJWfbJbv0FI2lRzGqnqleDSd3Nul6zPV6vP0LkK9ZtNigPGEvfsQ+RGyP/3q/vvc5JUWFIQ5rAJ1TMn9/7C9cCcPvX27oNyPsT1jaeNzdysoTwgSSgIp6mpp6mlwnqDfaL2go3O+beDhi+aS/er6nMVAhXrNHTQErxhgtv9wBVIJv9zKGLstJML6Xi36nx7I9KqBrIS3f5JWiNvJVzkilhs+809LlD3JEpnTQN8LIlay4ECczjMRH4kGUk2CDxU67c9I87IvDcqr2cdyV8Q4WQDnd1nf2qRAvZ68VBL2NWo9jgeJDfjfeeH2ZKFUKONzegsAT4kHOqDbmSGxaswMeU3frTk8v++dmbvVjZGywLvg2wBhuZ6b1FaDn43zispxdOSabjAMuEQZxX31Yv1Cpx2362u7bUaHC8nRcsMnfTXah4otP7Gb54OvUDVoJruVgIe8dJ1W0IgxlGbrBBm+vJxW9GQPBJROMQzjcoJZ5TfvvQxKr3yJn7p6AVyIwCCB4hnMgoQk52vSiEMbM8wBcaNmhOURKwTzvgwyZku3q8ttmtvSF+ar/60nPFpDMse2hGToXyKbnTwy3L8O9f


texts: Magento 2 Commerce. Delete/Remove a scheduled update (Content Staging)

texts:
Magento 2 Commerce comes with a feature called Content Staging.
As far as I can see there is no clear way to delete an update.

I had a scheduled update with a catalog rule associated to it. After I deleted the rule the update was removed as well(or at least is not visible in the grid)

I now have a scheduled update with no objects(cart rules, catalog rules etc) assigned to it(I removed them) yet the update is still there.

Questions:

How do I remove a scheduled update?
If there are any reasoning behind a scheduled update can not be removed?


texts: dataflow advanced profiles export with custom decimal separator

texts:
I need to change dot to comma on product price when I export using dataflown advanced profile. I tried this way:

...
<action type="dataflow/convert_parser_csv" method="parse">
     <var name="delimiter"><![CDATA[;]]></var>
     <var name="enclose"><![CDATA["]]></var>
     <var name="fieldnames">true</var>
     <var name="store"><![CDATA[0]]></var>

     <var name="decimal_separator"><![CDATA[,]]></var>

     <var name="adapter">catalog/convert_adapter_product</var>
     <var name="method">parse</var>
</action>
...

But this not work, how I can do this only for this profile? I'm trying to do this programming, copying from core to local, but without success.

Thank you!


texts:
API magento 2.4 get image of product
Hello i am trying to get the base64 image's code from the api using this endpoints
Enpoint 1
"/rest/default/V1/products/" + sku + "/media"
Result
[{"id":1,"media_type":"image","label":"Image","position":1,"disabled":false,"types":["image","small_image","thumbnail"],"file":"/m/b/mb01-blue-0.jpg"}]
Endpint2
"/rest/default/V1/products/" + sku + "/media/" + 1
Result
{"id":1,"media_type":"image","label":"Image","position":1,"disabled":false,"types":["image","small_image","thumbnail"],"file":"/m/b/mb01-blue-0.jpg"}
I added de 1 as id in the second endpoint i used but i get the same answer


texts:
Here, I am using the magepal SMTP Extension.

  https://github.com/magepal/magento2-gmail-smtp-app

This is Through the Error Could Not Open Socket

  https://drive.google.com/file/d/1ufNUzil1IthL_OTUQTeMU9_R5bsyj80D/view?usp=sharing

Config. Setting :
 Gmail SMTP server address: smtp.gmail.com
 Gmail SMTP username: Gmail address
 Gmail SMTP password: Gmail password
 Gmail SMTP port (SSL): 25


texts:
I am trying to update checkout page layout. What I want to do is to merge progress bar and checkout steps templates.

I have updated my app/code/Vendor/Module/view/frontend/web/template/onepage.html file and updated it like below.

                 // Renders my progress bar template successfully.
                 // To render step template, but not working
                 // not working either

What I am trying to do is to display navigator step first and after step, there will be the content for particular step.

I have tried using $parent.getTemplate() to call template of parent foreach but its not working. I have also tried assigning a variable to getRegion('steps') foreach and then use step.getTemplate() but its not working either.

Does anyone have idea how can I achieve this?


texts: Return bool gives error "Invalid return type" for Ajax Controller

texts:
I want to call this controller through Ajax and have it return true or false. the methods all work correctly, however I get the error

  Invalid return type
  C:\Sites\retracted\wwwroot\vendor\magento\framework\App\Bootstrap.php(258):
  Magento\Framework\App\Http->launch()

So I assume with extends Action I can't simply return a boolean - but what should it be to allow me to return a bool?

use \Magento\Framework\App\Action\Action;

class IsEmailRegistered extends Action implements \Magento\Framework\DataObject\IdentityInterface
{

    ...

    public function execute()
    {
        $result = $this->voucherHelper->validateEmail($email);

        return $result;
    }
}


texts: Magento 2 stuck in "Update pending" when trying to uninstall a Magento Extension

texts:
I'm currently trying to uninstall an extension that I installed using "Magento Marketplace" on a Magento 2.2.7 install but every time I try it gets stuck in the "Update pending" stage.

There are no errors in the developer console or in the console log.

Is there a solution for this or any other way to uninstall the extension?


texts:
I am working on a website , I have installed porto 2.2.0 there are 2 issues I was unable to solve,

1) Email on order did not work.

2) I want to remove .00 from price.

I have tried many articles but all in vain.


texts: How to Remove the items from a category automatically based on date?

texts: I have created one category for displaying new arrivals and have added all items under this category. Now i need to delete old items (30 days old & 7 days old) from that category. This should happen daily and automatically.


texts: Composer vs component manger vs manual install

texts:
Trying to see which method is the best to install extensions by. I would always lean towards composer however it looks as though many articles online would suggest using Magento's Component manager is the best way.

Is there any advantages of using the Magento's Component manager over composer?


texts: Magento 2 login customer programmatically without password

texts:
Need code for login customer programmatically without password in magento 2 enterprise edition?

If I have customer email id and I want to login without password in magento 1.X by code Here the code:

$email = 'test@m2s.com';
 $customer = Mage::getModel('customer/customer');
 $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
 $customer->loadByEmail(trim($email));
 Mage::getSingleton('customer/session')->loginById($customer->getId());

But i want to use this in Magento 2 EE.

Any solution, Thanks in advance!


texts: What is the difference between base_grand_total and grand_total?

texts:
what is the difference between base_grand_total and grand_total?
What is base?


texts:
I made an upgrade from v2.3.3 to v2.3.4 and now when I try to edit a product I receive this error:

Warning: Invalid argument supplied for foreach() in /vendor/magento/module-catalog/Model/ProductLink/CollectionProvider.php on line 185

Any idea where this error might be?

BR


texts: How to add custom attachments files in order emails

texts:
I have a custom cron job in my magento store from where I send order email to customer second time but this time I want to attach some custom files to this order email.

I am using sendNewOrderEmail() function.

How to attach custom files in my cron job file?


texts: Email customer when price changes on the product

texts:
At the moment I have managed to create a form that will insert product_ID, customer_Email and customer_Price to a table I created in The database.

the customer inputs there email and desired price.

I need some sort of script that when its ran, will check the table column product_ID and if customer_Price is more than the actual product_ID_Price then output a string.

I can think about the email part another time.

All the products are configurable products.


texts: Fatal error: Maximum function nesting level of '256' reached, aborting! in app/code/core/Mage/Core/Model/Config.php on line 596

texts:
Magento ver. 1.9.2.1

Getting fatal error while setup magento project on localhost.
Localhost config:
PHP 5.6.33-3+ubuntu16.04.1+deb.sury.org+1 (cli)
mysql  Ver 14.14 Distrib 5.7.11
apache


texts: Search by sku not working for particular product in solarium

texts:
I have solarium extension names JeroenVermeulen_Solarium.
I am facing product with search by sku. For particular sku i am not getting that product. I have sku ANK15120-00SPC. If i search for 15120 it should give me ANK15120-00SPC this sku product.
I am using solr version 3.6.2.
How can i solve this problem?


texts: Get All orders using rest API with specific feilds

texts:
I am using this

  http://domain.com/index.php/rest/V1/orders/7??fields=billing_address,customer_firstname,customer_lastname

it return the billing_address,customer_firstname,customer_lastname of order id 7, I want to get these details of all orders so i try

  http://domain.com/index.php/rest/V1/orders?searchCriteria=all

it work return all orders But i want to get specific feilds for example billing_address,customer_firstname,customer_lastname.

How can I get specifics columns of all orders?


texts: Magento2.3 Reservations inconsistencies issue

texts:
First I run this command sudo php bin/magento inventory:reservation:list-inconsistencies
  The output was displaying

  Order 000006617:
    - Product SRN should be compensated by -1.000000 for stock 1

  Then, I ran the cmd sudo php bin/magento inventory:reservation:create-compensations 000006617:SRN:-1.000000:1

  The output was  Following reservations were created:
  Product SRN was compensated by +1.000000 for stock 1

  Now, even if once again if I run the cmd (php bin/magento inventory:reservation:list-inconsistencies) then also it is displaying
  Order 000006617:

  Product SRN should be compensated by -1.000000 for stock 1

  The only difference is that Salable Qty got reduced Initially before creating compensation SRN: Quantity = 93, Salable Quantity = 92

  After compensation SRN: Quantity = 93, Salable Quantity = 91

Can someone let me know whether this is the correct scenario? or I am missing something.


texts:
From the code below I get the image of a product from a url:
$media = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail());

And with that it returns me the image from the URL by picking directly from the product:
http://urlsite.com/media/catalog/product/u/m/uma-flor-alaranjada-com-mensagem-cart_o-14896928_1_1.jpg

But for my need, in this way, even resizing the image, it gets distorted and I needed to get the image through the cache and in case it would have to return the image from the URL below, however I do not know what I should change to do that:
http://urlsite.com/media/catalog/product/cache/1/thumbnail/50x50/9df78eab33525d08d6e5fb8d27136e95/u/m/uma-flor-alaranjada-com-mensagem-cart_o-14896928_1_1.jpg


texts: Error in Zend validator: "Internal Error: DNS validation failed"

texts:
I am having the following problem with my magento install (version 1.3.2.3):

When someone tries to check out with an @bluewin.ch email address the following error is produced:

URL: https://www.example.com/checkout/onepage/
Time: 2014-11-13 14:38:03 GMT
Error:
Internal error: DNS validation failed

Trace:
#0 /lib/Zend/Validate/EmailAddress.php(184): Zend_Validate_Hostname->isValid('bluewin.ch')
#1 /lib/Zend/Validate.php(157): Zend_Validate_EmailAddress->isValid('nothing@bluewin...')
#2 /app/code/core/Mage/Customer/Model/Customer.php(674): Zend_Validate::is('nothing@bluewin...', 'EmailAddress')
#3 /app/code/core/Mage/Checkout/Model/Type/Onepage.php(251): Mage_Customer_Model_Customer->validate()
#4 /app/code/core/Mage/Checkout/Model/Type/Onepage.php(195): Mage_Checkout_Model_Type_Onepage->_processValidateCustomer(Object(Mxperts_NoRegion_Model_Quote_Address))
#5 /app/code/core/Mage/Checkout/controllers/OnepageController.php(253): Mage_Checkout_Model_Type_Onepage->saveBilling(Array, false)
#6 /app/code/core/Mage/Core/Controller/Varien/Action.php(376): Mage_Checkout_OnepageController->saveBillingAction()
#7 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('saveBilling')
#8 /app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch()
#10 /index.php(72): Mage::run()
#11 {main}

When I dig a bit deeper, I find the following line is throwing the error:

// Check each domain part
$status = @preg_match($regexLabel, $domainPart);
if ($status === false) {
    /**
     * Regex error
     * @see Zend_Validate_Exception
     */
    #require_once 'Zend/Validate/Exception.php';
    throw new Zend_Validate_Exception('Internal error: DNS validation failed');
} elseif ($status === 0) {
    $valid = false;
}

This is lines 354-365 of /lib/Zend/Validate/Hostename.php

I can tell you that the values of pattern and subject of the preg_match are as follows at the moment this error is thrown:

$regexLabel = '/^[a-z0-9\x{00EO}-\x{00F6}\x{00F8}-\x{00FF}\x{0153}\x2d]{1,63}$/iu';
$domainPart = 'bluewin';

However, I have no idea why this preg_match would return false

As a little side note: the presence or absence of the u modifier make no difference.

Any suggestions would be greatly welcomed!

Thanks in advance!
nanos


texts: Change the "Sort By" option of a category with code

texts:
I want to change the Sort By (Default product sort order in the front end) option that is available in the Catalog -> Manage Categories -> Display Settings  with a php script. I want to set that to position for all categories.

Is there a way to do that in both Magento 1 and 2 ?

Thanks in advance.


texts:
I'm trying to replace the "Sign in" Link in header.links with an icon. Search stack exchange I was only able to add
 <referenceBlock name="header.links">
        <block class="Magento\Customer\Block\Account\Link" name="my-account-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">My Account</argument>
                <argument name="sortOrder" xsi:type="number">110</argument>
                <argument name="class" xsi:type="string" translate="true">account-link</argument>
            </arguments>
        </block>
    </referenceBlock>

this to default.xml
That's all nice and good but it only adds a new link "My Account" which I could replace with an icon with CSS. I can also hide the "Sign in" with CSS but if signed in, then there is no Sign Out since the "My Account" link will only forward to the account.
In short: How to replace the Sign in and Sign out with an icon?


texts:
I want to remove the captcha and its input field from the forgot password form and admin.

Please help me to remove that.


texts: Magento 2: URL rewrite to home doesn't work

texts: I'm new to Magento and have an issue with some rewrites. I want to redirect some URLs like https://www.example.de/en/category to the homepage https://www.example.de/en/. What do I have to put as target_path? I tried / but then it is redirecting to https://www.example.de/en//. Would be great if someone can help me with that issue :)


texts: I have show this type Order ID - Order Data - Order Status and I click on order id then redireck go to order details page in magento 2?

texts: I have show this type Order ID - Order Data - Order Status and I click on order id then redirect go to order details page ? how to do this ? exmaple order id is 2 then I click on 2 then go to order details show ?how to create this in magento 2?


texts: Subdomain multi-site with separate files

texts:
Is it possible to run a site (beta site, beta.subdomain.com) with separate files in the subdomain rather than using symlinks?

I want to test this way so the files in the subdomain are separate from the main website and can be modified and tested without risk.


texts: Magento2 : How To Get Shipping Amount Order Item Wise

texts:
I want to get shipping  amount order items wise

e.g :

products      Shipping Amounts
-------------------------------
Product 1     10

Product 2     5

Product 3     10
----------------
Total Shipping  25

So I want to get a shipping amount of product1 only.
So does anyone know how can I do that?


texts: Is there a Way to Create Customer Segment based on Order Values for a specific period in Magento enterprise? I would like to create customer segment for customers who did any transaction of an order value of $1000 or more for a month.. Is that possible? If i do it based on Sales Value , it take the complete total sales value on a particular transaction?


texts:
I want to hide the store switcher of the top of my page.
I'm using Magento 2.1.9
How can I do this?


texts: Marketplace Extension - Marketing feedback cannot be completed

texts:
I currently have feedback from the Marketing review phase which is impossible for me to implement, and I am unsure how to proceed.  There doesn't seem to be anyone to contact, and I cannot leave a comment as part of the process.

The exact feedback is that I must include a link to the website for the application that we build(It is linked directly with our extension), but this website does not exist.  We're an industry product and we don't advertise our services openly.  I have linked to our main website where people can contact us, with full email and telephone support, but this has been rejected twice now in a row because our website does not specifically mention this product.

The second bit of feedback is that we must supply more detailed information about what our extension does.  Unfortunately our extension only adds a button to two menus, and the button converts an order into XML and then downloads it to the users machine.  That is its entire functionality and I am struggling to expand the description beyond four bullet points.

Any help would be greatly appreciated.


texts: How to create filters and complex filters on custom API's Magento

texts:
Hi Folks,

I have success on creating a custom api v1 in magento and it is giving me the data i am looking for, i am exhausted searching for solution where i could add up filters for my custom api's.

My custom API's should be give me records based on limit i pass and it should support filters also. As i could figure out how to use filters in predefined Magento SOAP API's. But i couldn't find how to limit the number of records coming out from Magento end.

Expecting speedy response from Magento Techies.

public function getCustomers() {
    $customerCollection = Mage::getModel('customer/customer')->getCollection(); //Fetch all Customers from magento
    $defaultData = array();
    $finalData = array();
    foreach ($customerCollection as $cust) {
        $data = array();
        $customer = Mage::getModel('customer/customer')->load($cust->getId()); // Get Customer info from Customer Id
        $defaultData = $customer->getData(); //Get Customer data

        if (array_key_exists('default_billing', $defaultData)) {
            $billingAddress = Mage::getModel('customer/address')->load($defaultData['default_billing']);
            $data['default_billing'] = $billingAddress->getData();
        }

        if (array_key_exists('default_shipping', $defaultData)) {
            $shippingAddress = Mage::getModel('customer/address')->load($defaultData['default_shipping']);
            $data['default_shipping'] = $shippingAddress->getData();
        }

        $finalData[] = array_merge($customer->getData(), $data);
    }
    return $finalData;
}

The Above API will POP out all Magento Customers With Billing and Shipping Address.
Now just i need to add up filters and limit records which Magento pops. I dont have any idea how to do this, plz help.


texts: How to replace cart items programmatically?

texts:
I tried two different approaches for this, but both failing at different point.

By calling $cart->truncate()->save() and then $cart->addProduct($product, $qty). But instead of replacing the whole cart with new items, overlapping items (with or without the same quantity) will be deleted anyways.
I also tried $quote->removeAllItems()->collectTotals()->save() and then $cart->addProduct($product, $qty), but when the quantity of an overlapping item is collectively larger than stock level, it will prompt a false out of stock error message.

More on 2

I have dived into the code which checks stock level, which is Mage_CatalogInventory_Model_Observer::checkQuoteItemQty().

Every time I test with code in 2), a total of four times it checked and in the 3rd time the $qtyForCheck  of that particular overlapping item is summed up with quantities before AND after removeAllItems(), effectively generating a false error prompt.


texts: Magento send order conformation mail not send to customer

texts: I try to place order in magento but customer can't get mail  and also admin copy also not getting how i fix this.


texts: CSV Import: (M2) How to assign multiple image roles to one image

texts:
I'm an issue where i want to assign multiple image roles (base, small, thumbnail) to 1 image using the CSV import.
This is what it looks like after the import
This is how i want it

How can i achieve this? Any ideas?


texts: How to change invoice status paid to pending_payment when order status is processing

texts:
I have used Magento version 1.9, when order is placed then order status is pending. when submit invoice then order status changes to processing but invoice status is showing paid.

But I want to change invoice status paid to pending_payment while order status processing and when ship order then invoice status change to paid.

How to do that?


texts: How to display sold product qty in list.phtml

texts:
I use module to display sold product qty on product page.
Here is code from custom module .phtml file
<?php
/**
 * Solwin Infotech
 * Solwin Most View Sold Extension
 *
 * @category   Solwin
 * @package    Solwin_MostViewSold
 * @copyright  Copyright © 2006-2020 Solwin (https://www.solwininfotech.com)
 * @license    https://www.solwininfotech.com/magento-extension-license/
 */
?>
<?php
$enabled = $viewenabled = $soldenabled = '';
$helper = $this->helper('Solwin\MostViewSold\Helper\Data');
$enabled = $helper->getConfigValue('most_viewed_section/most_viewed_group/active');
$viewenabled = $helper->getConfigValue('most_viewed_section/most_viewed_group/most_viewed_enable');
$soldenabled = $helper->getConfigValue('most_viewed_section/most_viewed_group/most_sold_enable');

$viewed_btn_label = $helper->getConfigValue('most_viewed_section/most_viewed_group/viewed_btn_label');
$sold_btn_label = $helper->getConfigValue('most_viewed_section/most_viewed_group/sold_btn_label');

if ($enabled) {
    $soldcount = $viewedcount = 0;
    $_product = $block->getProduct();
    $pid = $_product->getEntityId();
    $producttypeid = $_product->getTypeId();
    ?>

        <?php
        /*
         * Get counts for most viewed
         */
        if ($viewenabled) {
            $viewedcount = $helper->getMostViewCount($pid);
            ?>

                <?= $block->escapeHtml(__($viewed_btn_label.':')) ?>
                <span class="solwin_count" data-count=<?= /* @noEscape */ (int) $viewedcount ?>>0

        <?php } ?>
        <?php
        /*
         * Get sold quantity
         */
        if ($soldenabled) {
            $soldcount = $helper->getMostSoldCount($pid, $producttypeid);
            ?>

                <?= $block->escapeHtml(__($sold_btn_label.':')) ?>
                <span class="solwin_count" data-count=<?= /* @noEscape */ (int) $soldcount ?>>0

        <?php }
        ?>

    <?php
} ?>

Which code should I copy to display also sold product qty under product name on list.phtml?
I have tried in several ways but I get an error every time.


texts:
I cannot access the Admin panel, I'm getting error ERR_TOO_MANY_REDIRECTS. I try replace localhost to 127.0.0.1 in base url, clean cache, cookies, there is no underscore in url and frontend working fine.
Please help me to resolve the issue. Is there any way to change cookies configuration in store/general/web with PhpMyAdmin?


texts: How echo json data in a Magento controller on a valid way?

texts:
I have created a Magento plugin. In this plugin I call (with ajax) a custom controller where I echo some json data:

public function testAction()
{
   echo json_encode('test');
   exit;
}

But when I try to upload my plugin to the Magento Marketplace, I get 2 errors:

Use of exit language construct is discouraged.
Use of echo language construct is discouraged.

How can I output json data in a controller on a valid way?


texts: Is it possible to link to a bundled product with pre-selected options and quantity?

texts:
I have read that we could have pre-selected configuration by using # (has tag) followed by attribute id = value id, but how can we achieve the same for a bundled product?
For example in the demo Magento store
http://83.136.86.180/magento/ee11421/home-decor/electronics/mp3-player-with-audio.html
How can I pre-select "Madison 8GB Digital Media Player" with 5 quantity plus "Madison Over-ear Headphone" with 3 quantity and the whole bundle with 2 quantity?

I want to achieve the pre-selection by passing get parameter to the URL.


texts:
The Sitemap page in Magento 1.9 is by default one column layout.
I changed it to a 3 columns layout by adding this to local.xml:

<catalog_seo_sitemap>
    <reference name="root">
        <action method="setTemplate"><template>page/3columns.phtml</template></action>
    </reference>
</catalog_seo_sitemap>

It works, however both left and right sidebar are empty and don't show the static blocks in them.
I found that in catalog.xml these are removed by default:

<catalog_seo_sitemap translate="label">
        <label>Catalog Seo Sitemap (Common)</label>
        <remove name="right"/>
        <remove name="left"/>
</catalog_seo_sitemap>

Now to bring them back I could:

Comment above code out in catalgo.xml. But I don't want to change Magento core files.
I could use Alan Storm's unremove plugin. Maybe, but I don't like to install too many plugins.

Now my qeuestion:

Is there any way to unrmove right and left for sitemap using the local.xml ?

Thanks


texts: Disable “Add To Cart” For specific Categories Magento

texts:
I wonder If there is any way to disable Add To Cart For selected category Products. I found the way to disable on the products behalf but didn't find any way to do with categories. Like I have a categories e.g...

Brands //Parent Category
  |-- Diamonds   //Child Category of Brands
  |-- Jewllery  //Child Category of Brands
  |-- Watches   // Child Category of Brands. Disable "add to cart" for this category products


texts: Magento 2 - How to get stock of a product?

texts:
I want to instantiate CatalogInventory model in Magento 2 by calling  loadByProduct() just like I used to do in Magento 1:

$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);

How can I do this or similar in Magento2?

UPDATED ANSWER:

I have tried getting the stock of a product this way:

 use Magento\CatalogInventory\Api\Data\StockItemInterface;
 use Magento\CatalogInventory\Model\ResourceModel\Stock\Item;

 $model = $this->_objectManager->create('Magento\CatalogInventory\Model\ResourceModel\Stock\Item');
 $stock=$model->loadByProductId(StockItemInterface $item, $productId, $stockId);

But I get,

  Parse error: syntax error, unexpected '$item' (T_VARIABLE)


texts: How to add extra information in items ordered tab? Magento ver 2.x

texts:
I am new to M2, I need help to add extra information in the order.
I already have the information in the sales_order_item table.

Any ideas? Thank you very much

https://i.stack.imgur.com/xhCSa.png


texts:
I have a image, for example a\m\amding.jpg and I am replacing image file in database with v/o/void.jpg. How can I move file from a\m\ to \v\o and change her name from amding to void?
I want to copy first image from her folder, rename.it, and set to other folder.


texts: Magento 2.15 override PackagesData.php in setup

texts:
How can I override the class PackagesData.php in namespace Magento\Setup\Model?

I created the file app/code/local/Magento/Setup/Model/PackagesData.php but this is not working.


texts: SUPEE-9652 ZEND PATCH- DISCUSS ISSUES HERE!

texts:
Long waiting patch has been released. Seems like a light patch. Discuss installation related issue in this topic!

https://magento.com/tech-resources/downloads/magento/


texts:
Hi I'm adapting a Luma based theme. So I created the file _extend.less in

app/frontend/design/MyTemplate/theme_new/web/css/source/

  In that file I have:

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m){
    .page-header {
        background:#f0bd70;
    } }

  And also tried:

@media only screen and (min-width: 768px) {
    .page-header {  border: 0;  margin-bottom: 0;   height: 120px;  background-color: #73C70F ; } }

  Both are not working?

  I also have included:

.page-header {
    height: 250px;
    background-color: #73C70F ;
}

Which works fine.

So what am I doing wrong?

I use client side Compilation Module. I know css but are not familiar with less unfortunately. So how to get a media query to work in Magento2 Theme?


texts:
Sorry for the stupid question, but I'm trying to figure out, what kind of pruduct this one is:
Product

If you'll click on the color it takes you to another product... With diferent image gallery, but the same sizes and it also maintains the colors available. So I suppose these product's are linked somehow. How to achieve that?

Is this somekind of Grouped configurable product or what?

Thanks,


texts: How can I create custom form in Magento 2?

texts:
I want to create custom form for support in my Magento 2 website

So how can I achieve this with the use of only one file(.phtml)?
(All html and php code should be in one file)

It means I want to create only one file for this. Actually I have a support form in Magento 1 website but I don't know how to use this code in Magento 2


texts:
I have a custom theme that has no parent specified in the theme.xml.

But it still loads the styles-l.css and styles-m.css specified in the blank theme.
(specified in: /vendor/magento/theme-frontend-blank/Magento_Theme/layout/default_head_blocks.xml)

So it looks like it falls back on the blank theme. When i change the xml file in the blank theme the changes also appear in my custom theme.

The CSS files themself are not loaded from the blank theme.

So how does this fallback actually work?
Does it always fallback to the base theme for layout updates or something? Even when no parent is entered in the theme.xml.


texts: Show default additional product attributes in Category list.phtml

texts:
On the Product view page you have a default tab 'More information'. In this tab you see attributes from the default Attribute Set.

I want to show those attributes on the Category list page, under the Product Titel for example.

How do I achieve this?


texts: Magento 2.2.0 - checkout_index_index.xml shippingAdditional not working

texts:
When adding code:

<item name="shippingAdditional" xsi:type="array">
       <item name="component" xsi:type="string">uiComponent</item>
       <item name="displayArea" xsi:type="string">shippingAdditional</item>
       <item name="children" xsi:type="array">
            <item name="additional_block" xsi:type="array">
                 <item name="component" xsi:type="string">Vendor_Namespace/js/view/checkout/shipping/additional-block</item>
            </item>
       </item>
</item>

In checkout_index_index.xml in shippingAddress children section it has no effect (js file is not loading). This solution can be found on several webpages. However when using plugin created for

\Magento\Checkout\Block\Checkout\LayoutProcessor::process with added fields in children dimension:

  $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shippingAdditional']
  = [           'component' => 'uiComponent',           'displayArea' => 'shippingAdditional',          'children' => [...

fields are displayed in div onepage-checkout-shipping-method-additional-load.

My question is: has this ever worked? I'm facing this problem in newest magento version (2.2.0).

I need to display additional content depending on selected carrier and I'm looking for the best place to pin in (don't want to use javascript to manipulate DOM to put my html in right place). There is before-shipping-method-form item in checkout layout xml but I need to put my content after carriers list or even in single carrier row. Ofcourse I can't use any overrides. Any solution?


texts: M2 - Translate newsletter status message

texts:
I need to translate this message:

  {"status":"OK","msg":"Thank you for your subscription."}

I've done a search in all the files but I cannot find this string to translate... I have a Ajax notification when you subscribe for a newsletter, but I need to translate "Thank you for your subscription."

I've already entered the sentence into the i18n nl_NL.csv file but with no result so far...


texts: How to get Magento Invoice & shipment comment visible on frontend through SOAP API?

texts:
I am writing a custom order handling script for magento CE. If a new order is picked up by the script through cron it should create an invoice and notify the user and send a comment. I use the SOAP api for this purpose.
This works when sending an email, but how can I make the comment visible to the user on the frontend?
If I manually login to Magento admin, I can add a comment to an order and then check Visible on Frontend.
I would like the comments I add with sales_order_invoice.create and sales_order_shipment.create to be visible to the customer in the Frontend the same way. I know that is not possible with default settings in the backend, but I would like to do that.
If this is really hard to do, I would at least like the comments added with sales_order.addComment to be visible to the customer on the frontend just as when I manually comment and check Visible on Frontend.

Here is my code for the SOAP proxy:

class magentoProxyHandler{

    protected $proxy;
    protected $session;

    function __construct(){

        $this->proxy = new SoapClient('http://www.magento.nl/index.php/api/soap/?wsdl');
        $this->session = $this->proxy->login('change_order', 'password');
    }

    function __destruct(){

        $this->proxy->endSession($this->session);

    }

    function addComment($orderId, $status, $comment = '', $notifyCustomer = true){

        $orderId = ($orderId > 100000000 ? $orderId : $orderId + 100000000);
        $notify = $notifyCustomer ? true : false;

        $changeOrder = array('orderIncrementId' => $orderId, 'status' => $status, 'comment'=> $comment, 'notify'=> $notify);

        return $this->proxy->call($this->session, 'sales_order.addComment', $changeOrder);

    }

    function createInvoice($orderId, $status, $comment = 'Invoice ready', $notifyCustomer = true){

        $orderId = ($orderId > 100000000 ? $orderId : $orderId + 100000000);
        $notify = $notifyCustomer ? true : false;
        return $this->proxy->call($this->session, 'sales_order_invoice.create', array($orderId, array(), $comment, true, true));

    }

    function shipOrder($orderId, $status, $comment = 'Order shipped', $notifyCustomer = true){

        $orderId = ($orderId > 100000000 ? $orderId : $orderId + 100000000);
        $notify = $notifyCustomer ? true : false;
        return $this->proxy->call($this->session, 'sales_order_shipment.create', array($orderId, array(), $comment, true, true));

    }

} //end of class

I know I can do some little improvements to this code, this was simply for testing the the soap API.

I also asked this question in stackoverflow. I hope thats OK.
If It get answered there, I'll post the answer here. Hope you guys can help me.
Thanks in advance.

Edit:
Ok , I found out this flag has to be set in database: is_visible_on_front . Is there anyway to pass this through the SOAP api? Of course I tried adding it to the call, as well as isVisibleOnFront but it doesn't work...


texts: How to make customers to stop placing order after shop closing time in magento1.9?

texts: Am designing one restaurant website and their delivery time 10:00 Am to 10:00 Pm. How to make customers to placing order after the working hours. Is there any simple way?


texts: When Configurable swatches enabled, thumbnails not loading picture to main

texts:
I have an issue with magento 1.9.4

When i enable configurable swatches the thumbnails not load picture in the main but on click it goes to top of page.

Do anyone know what file or template is enabled with Configurable swatches to try re-install or debug them?

On fresh installation it work. It is something wrong on my app. This magento installation is started with 1.8, many updates are installed....


texts:
I'm working on creating a file that I can use to send any orders received on a particular day via a post API call. Magento's code appears to have changed dramatically now so I'm finding getting started a little difficult.

Is there any good documentation available that would show how to perform basic tasks such as getting recent order information, getting an image location based on a products ID, getting a custom attribute value of a product etc?


texts: Magento 2 : AND condition in addAttributeToFilter not giving desired result

texts:
According to answer to this related question
the AND condition in addAttributeToFilter is added by adding consecutive addAttributeToFilter so my statement is something like;

$_productCollection->addAttributeToSelect('*')->addAttributeToFilter('manufacturer', array(
                    array('nin' => $brands)
                ))->addAttributeToFilter('warehouse1', array(
                    array('nin' => 0)
                ))->addAttributeToFilter('warehouse4', array(
                    array('nin' => 0)
                )); // I want product to be excluded when both warehouse1 and warehouse4 is 0

As in the code above I need the product to be removed from collection when both "warehouse1" and "warehouse4" are simultaneously 0 but instead the code is first filtering collection based on "warehouse1" and then the filtered collection is filtered again for "warehouse4".
   As a result I am also excluding products which have 0 for "warehouse1" but not a 0 for "warehouse4".
Please help me resolve this.

EDIT:

The answer by @Murtuza Zabuawala worked for me, it was not working before as some of the attributes had null for them even though they were supposed to be 0 by default.
 However, this does not answer the core question of how to add AND to addAttributeToFilter but nonetheless I am going to award the bounty.


texts: Magento 1: why the upgrade process drastically changed?

texts:
So back in the days (not too far though as upgrades before 1.5 were super painful), the upgrade process for Magento 1 could basically be done by one of those two lines (depending if you installed/upgraded Magento via command line before or not):

./mage upgrade-all
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force

However, for the last year (maybe more ?), the upgrade documented officially (available here: http://devdocs.magento.com/guides/m1x/install/installing_upgrade_details.html) recommends a way longer and more painful process, especially the steps were you have to:

archive the custom themes and extensions,
download fresh Magento files
transfer the archives to the new Magento folder

So my questions are:

can one still upgrade via ./mage ? if so, what are the risks ?
why did Magento stop recommending the usage of ./mage to upgrade ?


texts: Exchange Server Not Receiving Magento 1.9.0 Transactional Emails

texts:
We have Magento CE 1.9.0 running on CENTOS 6.5 x86_64, with Apache 2.4/PHP 5.  I have an issue where my exchange server is not receiving any transactional email from my Magento box.

I do receive transactional emails to @hotmail.com, @yahoo.com and @gmail.com but not to my Exchange server corporate account.

SPF record looks good.

Any tips would help.


texts: Merge two installs, products only - how to proceed?

texts:
We want to merge two magento installs into one, combine two different product ranges and their respective websites into one backend. All we need is to combine the products and websites of both installs. (And I realise that "all we need" is more complex than it seems at first sight.) Old orders can still be opened in the old install, old customers with login will loose their account on one install.

Websites, categories, attributes, bundled products and more have to be handled as well. Product images, product stock... Some of these will probably be done manually.

I would like to get an idea of what else has to be handled, what I'm forgetting here. I would like to know if you have done this before, successfully, and how you did proceed.


texts:
I'm not planning to use GraphQL in my Magento 2.3 and I would like to remove it at all for now, not just disable it.

How could I do it?


texts:
I'm trying to install Magento 2.1.3 in my local but there are lots of problem.

And I am really new and have no idea in Magento and I can't find reliable articles in this new versions error. How do I fix this one?


texts: Is it possible to track the quantity of clicks I have on my store?

texts:
I need to develop a report module on my store and I need to track the quantity of clicks the site have.

is it possible :

to get the quantity of clicks
And/or the quantity of clicks on a given time


texts: Category product count not showing properly in magento2

texts:
I have assigned more than 30k products to one category in my website, but when i visit that category on frontend it is shwoing only 10000 products on the category list page.

In admin panel the count is 32500 for that category. Why it is not showing accurate count? Is there any setting to for setting the limit.?

Please someone advise me.


texts:
I have integrated Facebook Pixel in our Magento 1 Web site. When we check in Facebook Pixel Helper it will show and working fine but in Facebook Pixel Catalogue Manager it will show Error.
See screenshot for more detail.


texts: Magento 2 bind ko scope to a non-html/virtual element

texts:
I want to bind customer scope to a non-html element as I do not want html to be loaded if customer is not logged in.
In the OOTB magento inside vendor/magento/module-theme/view/frontend/templates/html/header.phtml
li tag is loaded even if customer is not logged in. Visually the li is hidden in this case but the accessibility screen reader reads it.
I want to bind a scope to a non-html element so that I can write a condition something like below.

            <span class="logged-in"
                  data-bind="text: new String('<?= $block->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)">

But scope is not bound.
knockout.js:3381 Uncaught ReferenceError: Unable to process binding "if: function(){return customer().firstname }"
Message: customer is not defined.

Any other way to achieve this?


texts:
I have a dashboard for a vendor, I want to display the top 3 categories on the page,
No luck till now.
Anyone who has done something like? Or provide some reference


texts:
I have recently have read that the Credit Card (saved) payment method is not meant to be used on a live site.

What are the reasons for this?

I understand this method stores the credit card number encrypted in the database. Does this violate PCI compliance?

Is there any other reason then security risks?


texts: Can someone explain what this is in the ui component xml

texts:
Can someone explain what ${$.$data} is doing in sales_order_grid.xml

 <columns name="sales_order_columns">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="childDefaults" xsi:type="array">
                <item name="fieldAction" xsi:type="array">
                    <item name="provider" xsi:type="string">sales_order_grid.sales_order_grid.sales_order_columns.actions</item>
                    <item name="target" xsi:type="string">applyAction</item>
                    <item name="params" xsi:type="array">
                        <item name="0" xsi:type="string">view</item>
                        <item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
                    </item>
                </item>
            </item>
        </item>


texts: How save value in custom_attribute of "sale_order_grid"

texts:
I have to save value in custom_attribute(current_seller_id) in "sales_order" table. using event below  code But now i want to save same value in custom_attribute(current_seller_id) of "sale_order_grid" table.
am new in magento guide me which observer or anything used for copy data from sales_order table to sales_order_grid.

  public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getData('order');
        $quote = $observer->getData('quote');

       // $cartdata=$this->cart->getQuote()->getItemsCollection();
        $quoteItems = $quote->getItems();
        foreach ($quoteItems as $quoteItem){
            if ($quoteItem->getCurrentSellerId() != ""){
                $items[]=$quoteItem->getCurrentSellerId();
            }
        }
        $seller_ids=implode(',',$items);
        $order->setCurrentSellerId($seller_ids);
        return $this;
    }


texts:
I copied a site from one domain to another.  On new site, images are missing on Web-Pages. I can see the images in back end.

I cleaned all caches in

Admin > Configuration > Cache Management

and Reindexed data from Index Management.

Still images are missing from product page. I have gd installed on the server. I tried uploading a new image, that shows properly. Only problem is with old images.


texts: How to edit and modify the main page of Luma theme?

texts:
For the Luma theme, how to:

How to reach and edit the main page of magento 2 Luma theme?
How to replace the images there with my images?
How to edit the hot sellers section?
How to reach and edit the "What's new" page?


texts: how to get quote id before placing order M2

texts:
I am struggling to find which event I should use to get the quote id?
I want to save some data in db, want to save customer session id and quote id before placing an order?

Can someone suggest which I should use?


texts: How can I Disable the "add to cart" when user is not logged in.


texts: Customer and order Item Data on Order Succes page

texts:
I am trying to getting order,customer and item details on order success page.

<?php
 $orderid =$block->getOrderId();
 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
 $order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($orderid);

echo "<pre/>";
print_r($order->getData());
?>

Is anyone have idea how to get using by directly Object Manager?

Please help me.

Thanks


texts: How to create a user with access to given web shop in Magento 2 multi-store

texts: How to make a user in Magento 2 multi-store configuration with giving access him to only 1 sub web shop?


texts: Changes in js file not getting reflected in frontend in magento 2.3

texts:
I did some changes in js file of a third party extension. The path shown on frontend is

  /pub/static/version1574138983/frontend/Smartwave/porto/en_US/Mageplaza_LayeredNavigation/js/view/layer.min.js

I did changes in

  app/code/Mageplaza/LayeredNavigation/view/frontend/web/js/view/layer.js

This is the only file i think is responsible.
Any changes done in this file is not getting reflected on frontend.
I had run static-content deploy command also,but still did not work.


texts: Magento 2 - Getting an order item tax percentage

texts:
I need to get an order item tax percentage

<?php
namespace Company\Module\Plugin;

class myClass
{
    protected $_orderRepository;

    public function __construct(
        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
    ) {
        $this->_orderRepository = $orderRepository;
    }

    public function processOrder($orderId)
    {
        $order = $this->_orderRepository->get($orderId);
        foreach ($order->getItems() as $item) {
            var_dump($item->getTaxPercent());
        }
    }
}

I always get the value of 0.00 even though I know the percentage is 20.00.

Could anyone advise how I should get the tax percentage


texts: Problem with the Address Template Magento 2.4

texts:
I am having problems with the address template, when I add a new client it adds fine, but when registering the addresses it does not do it correctly, it leaves all the instructions for this untranslated, example:
Default Billing Address
{{depend prefix}} {{var prefix}} {{/ depend}} {{depend middlename}} {{var middlename}} {{/ depend}} {{depend suffix}} {{var suffix}} {{ / depend}} {{depend firstname}} ...
I leave a screenshot


texts:
We wants to display the product collection in /vendor/magento/module-catalog/Model/Product/Gallery/entry.php

Thanks


texts: Attributes not added to custom product type

texts:
I'm trying to create new product, I followed several guides to help me achieve this. my product_types.xml file looks like this:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
    <type name="custom_product_type_code" label="Subscription" modelInstance="GraphQl\Subscription\Model\Product\Type">
        <priceModel instance="GraphQl\Subscription\Model\Product\Price" />
    </type>
</config>

Type class:
namespace GraphQL\Subscription\Model\Product;

    class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
    {

        const TYPE_ID = 'custom_product_type_code';

        public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $product)
        {

        }

Price Model:
namespace GraphQL\Subscription\Model\Product;
class Price extends \Magento\Catalog\Model\Product\Type\Price
{
    public function getPrice($product)
    {
        return $product->getData('price');
    }

}

And InstallData class in which I'm associating attributes with new product type:
namespace GraphQL\Subscription\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use GraphQl\Subscription\Model\Product\Type;

class InstallData implements InstallDataInterface
{

    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    protected $eavSetupFactory;

    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        //associate these attributes with new product type
        $fieldList = [
            'price'
        ];

        // make these attributes applicable to new product type
        foreach ($fieldList as $field) {
            $applyTo = explode(
                ',',
                $eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $field, 'apply_to')
            );
            if (!in_array(Type::TYPE_ID, $applyTo)) {
                $applyTo[] = Type::TYPE_ID;
                $eavSetup->updateAttribute(
                    \Magento\Catalog\Model\Product::ENTITY,
                    $field,
                    'apply_to',
                    implode(',', $applyTo)
                );
            }
        }
    }
}

I have associated price attribute with my new product and should be able to see it when I'm creating that product, however I see different attributes:

And no price which I have associated. I'm very new to Magento BTW.
Edit
Also I have created custom attribute like montly_price and it's not saved in eav_attribute table, this is likely why it's not shown, but I have to clue why it's not saved.


texts: Magento 2 - Data Migration not migrating customers

texts:
I migrated my data, but the customer table was not moved from M1 to M2.
I executed these commands:

php bin/magento migrate:settings vendor/magento/data-migration-tool/etc/opensource-to-commerce/1.9.4.4/config.xml

php bin/magento migrate:data -a vendor/magento/data-migration-tool/etc/opensource-to-commerce/1.9.4.4/config.xml

Products were successfully migrated though.


texts: Magento2 custom module admin menu not showing on production

texts:
I have created a custom module in magento2 in my localhost and it is working fine.

But when I import it on live server and install.
It is showing in module list as enabled and custom table also cretaed on live server by module, but menu is not showing in admin panel.

I have cleared cache and reindex indexes, also di:compile setup but still menu is not showing on live server.

What is going wrong on live server? Is there any error in my module or anything else?

Thanks in advance.

EDIT :

My menu.xml :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Vendor_Custom::manager" title="Vendor" module="Vendor_Custom" sortOrder="999" resource="Vendor_Custom::manager"/>
        <add id="Vendor_Custom::add_row" title="Row" module="Vendor_Custom" sortOrder="10" parent="Vendor_Custom::manager" action="custom/custom" resource="Magento_Backend::content"/>
    </menu>
</config>


texts: Do not redirect to another admin page url using observer

texts:
I Used below code Observer called but can not redirect to admin product page.

path: local/Package1/Test1/etc/config.xml

 <adminhtml>
    <events>
       <controller_action_layout_generate_blocks_before>
                <observers>
                    <module_block_observer>
                        <type>singleton</type>
                        <class>test1/observer</class>
                        <method>testredirect</method>
                    </module_block_observer>
                </observers>
        </controller_action_layout_generate_blocks_before>
    </events>
 <adminhtml>

path: local/Package1/Test1/Model/Observer.php

public function testredirect($observer)
{
  $url = Mage::helper("adminhtml")->getUrl("adminhtml/catalog_product/index/");

        Mage::app()->getFrontController()->getResponse()->setRedirect($url);
        Mage::app()->getResponse()->sendResponse();
}

I want to redirect to admin catalog product page('product grid page') using observer but my redirect code does not work and browser throw error. Error is This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS


texts:
Quite often we get the following error in Magento when we try to make a change to one of our Categories.

  SQLSTATE[HY000] [1205] Lock wait timeout exceeded; try restarting
  transaction, query was: UPDATE catalog_category_entity SET
  entity_type_id = ?, attribute_set_id = ?, parent_id = ?,
  created_at = '2015-10-30 11:24:57', updated_at = '2016-11-27
  07:33:07', path = ?, position = ?, level = ?, children_count =
  ? WHERE (entity_id=250)

It seems to only be occurring after we have moved around or reorganised a category and I can see from System > Index Management that Catalog URL Rewrites is still being processed.  Once the indexing is finished we can make changes to categories, but this is a recurring problem which really slows things down.

I've checked Catalog > URL Rewrite Management and we have almost 500,000 rewrites, we have 4 store views, 350,000 plus of them are custom although we obviously did not create them all.  I believe this is what is slowing everything down.

I'm not sure what to do here, if I truncate the core_url_rewrite database table with TRUNCATE TABLE 'core_url_rewrite'; and re-index Catalog URL Rewrites in System > Index Management will that fix it?  Is there anything I should be aware of before I cary try this?  I'll do a table & db back up first of course and test it in a local environment.


texts: Iterate through existing/newly saved objects or use addCommitCallback?

texts:
I have a query regarding magento 1.6.

I have a number of objects that I am creating, calling a method on and saving to the database with the Mage_Core_Model_Resource_Transaction transaction model.

The method now requires the primary key value of the object, which obviously isn't going to be available until after the object has been saved to the database.

Can I just loop through the created objects after they've been saved to the database? Instead, do I need to use the transaction's addCommitCallback method?

In other words, can I do:

$collection = [];
$transaction = Mage::getModel('core/resource_transaction');
for ($i = 0; $i <= 10; $i++) {
    $obj = new ObjectFoo;
    $transaction->addObject($obj);
    $collection[] = $obj;
}
$transaction->save();
foreach($collection as $collected) {
    $this->doSomething($collected);
}

(And assume that each $collected item will now have a valid id value)

Or do I need to use something like:

$transaction->addCommitCallback(array($obj, 'doSomething'));

One thing that I have noticed with addCommitCallback is that you can not specify any parameters for the callback, which is rather... restrictive.


texts:
I am trying to do a query of the form:

SELECT TableA.id,

    (
    SELECT MAX(TableB.qty) FROM TableB WHERE TableB.parent_id=TableA.id
    )

FROM TableA

the important thing being that the select clause has a subquery.

My question is, how would you use joinAttribute() or other ZendDB functions to implement the subquery?  And this is important: I CANT DO A JOIN ON THE OUTER TABLE!!!  It must be a subquery like that.  This is a simplified version.

I am trying to use a collection's getSelect(), column(), addAttributeToSelect() etc functions to do this. Is this possible? This is for use within an _initSelect() call.


texts:
Hi i want to validate the mobile number in custom module my code is

<input type="text" class="input-text required-entry validate-length maximum-length-10 minimum-length-10 validate-digits" id='adcontact' name='adcontact' data-validate="{required:true, 'validate-number':true}"/>

but it is not working. when i enter only 2 or 3 digits form get submitted


texts: Magento 2 Not Building Product Thumbnails Cache

texts:
There are other, similar questions out there but non of which have the correct answer for me.

I have a fresh Magento 2 installation, built using composer. I have done nothing on it apart from install sample data using the php bin/magento sampledata:deploy command followed by setup:upgrade, setup:di:compile and setup:static-content:deploy.

When I go to a category page, the images are all 404-ing. The folder pub/media/catalog/product/cache is not being generated. The permissions are as per the Magento 2 docs:

pub/media/catalog/product$ ll
drwxrwsrwx  8 matt     www-data 4096 Apr 21 10:38 ./
drwxrwsr-x  3 matt     www-data 4096 Apr 20 14:02 ../
drwxrwsr-x 35 www-data www-data 4096 Apr 21 10:35 cache/
drwxrwsrwx  3 matt     www-data 4096 Apr 20 14:02 g/
drwxrwsrwx  4 matt     www-data 4096 Apr 20 14:02 l/
drwxrwsrwx  9 matt     www-data 4096 Apr 20 14:02 m/
drwxrwsrwx  4 matt     www-data 4096 Apr 20 14:02 u/
drwxrwsrwx  9 matt     www-data 4096 Apr 20 14:02 w/

I have GD installed and am running PHP 5.6.

The memory limit in my php.ini file is set to 2048M. I know this is far too high but I was ruling out the memory limit as a cause.

I have reinstalled Magento 2 several times.

I have created PHP script to create folders and files within the product cache directory and that works without issues.

When I go to a product view page or run php bin/magento catalog:images:resize, the pub/media/catalog/product/cache folder is generated.

I have no idea what to do from here! Let me know if you need anything else from me.

Would really appreciate any kind of help on this!

For reference, here is a list of enabled PHP modules:

[PHP Modules]
calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zlib

[Zend Modules]
Zend OPcache


texts: Fatal error: Uncaught Exception: can't create directory on upgrading Magento from 1.9.2 to 2.0.0

texts:
When I tried to upgrade Magento from 1.9.2 to 2.0.0 got the following error

  Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory vendor/magento/framework/Code/Generator.php on line 103

Please could anyone help me solve this issue?


texts: Saving form data in configuration observer in Magento 2

texts:
I have a field in store configuration that has a select per store that contains a language setting.

I've also written an observer that fires when this section of store configuration is saved. However the request's parameters don't contain the select choices from the store configuration form. $this->_resquest->getParams() only yields [section], [key], [form_key], [config_state], and [groups].

Why aren't the choices from the select elements present in the request?


texts:
I have a custom form in my magento store, and use varienform validation. Everything works fine. But requirement is, I need a clear button so that I can click that button to reset the form inputs including the validation error messages.

the below image is my current form:

after clicking Clear buton it should become like this:

How can I do this? Can anyone help?


texts:
My design requirement is to show latest products on homepage with infinite scroll. During my search for the solution, i checked this article so i first of all installed Strategy Infinity scroll, and then showed products on homepage with pagination following this tutorial. This seem not to be working.

When i showed products on homepage with pagination, there doesn't appear the ajax loader, indicating that on homepage infinite scroll plugin isn't taking any effect. I've carefully added in Layout Update XML field under Design Tab with the following:

  <reference name="head">
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
    <type>js</type>
    <name>jquery/jquery.latest.min.js</name>
  </action>
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
    <type>js</type>
    <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
  </action>
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
    <type>js</type>
    <name>jquery/infinitescroll2/behaviors/infinitescroll-magento.js</name>
  </action>
  </reference>

But still these javascript files were not included in homepage's source codes. Which indicate that this condition didn't met (only on homepage):

ifconfig="infinitescroll2/general/enabled"

However when I deleted this condition in xml to include the files anyway, the js files got included, but desired functionality didn't occur.

Can someone point out what could be the problem.


texts:
I have a problem with newsletter css. I created a new template and added the css in the box below the template Template Styles. I also addes two widges in my template. when i preview newsletter is fine but when i sen it for test as email it does not load any of the css just the html.

Any suggestion what have i done wrong ?
thanks in advance


texts: Problem with Magento 2.3.6 Multi Source Inventory

texts:
I have a Magento 2.3.6 installation using multi inventory. I have the following setup:
There many websites. Each website is assigned specific and unique stock. Also, each stock is assigned a unique source. As a result, there do not exist any common sources between websites (each source "feeds" one specific website).
The expected result is the following:
The products are common between websites (global products) and when you browse a specific website, each product should read the stock that corresponds to current website. So, the same product could be available in website A because it reads stock from stock A, and unavailable in website B because it read stock B.
Actual result:
In reality, it seems that magento fails to manage multiple sources in   combination with many websites. When I browse a category page of a website and filter products, it seems that stocks are not taken into account.
Hint:
I checked the records in cataloginventory_stock_item and cataloginventory_stock_status. In both tables the column 'website_id' is '0' for all records. I expected to see records from all websites.  I have also logged mysql queries, as you see in the attached photo the website_id and stock_id correspond to we website 0, despite browser being in another website.
I have attached some photos to help you understand.
Has anyone ever faced the same problem? Any solution? Also, if anyone knows an extension that solves the problem it would be nice.
Thanks in advance


texts: How to add customer name and subscription email in transactional email template of invoice and newsletter

texts:
I want to add a new newsletter and invoice email template, I did this through a Transactional email from Magento admin section.
In newsletter template I want --> subscription email
In Invoice email template --> I need the name of the customer
I tried it through
{{var order.getCustomerFirstName()}}

But I won't be able to do this.
Can any one suggest a solution?


texts:
Is there anyway to upload .flv extension on magento custom category attribute?

I have this certain file upload, and it's front-end input is file,

Originally it's image, but I changed it to file, but it still doesn't work.

It does not upload the video to any of the media folder on Magento.

Is there any way to upload video on file upload Magento?


texts: Injecting Dependencies into a Magento 2 CRUD/Abstract Model

texts:
Is it possible to inject a dependency into a Magento 2 CRUD model?

That is -- Magento 2 has a base abstract model class: Magento\Framework\Model\AbstractModel.  If you want to create a simple Create, Read, Update, Delete model object, you extend this class with your own class.

class Foo extends Magento\Framework\Model\AbstractModel
{
}

Is it possible to have injected dependencies in your model's __construct method?  When I try, I end up getting the following error.

  Fatal error: Cannot instantiate abstract class Magento\Framework\Model\ResourceModel\AbstractResource

The culprit seems to be the AbstractModel's __construct method.

public function __construct(
    \Magento\Framework\Model\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
    \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
    array $data = []
) {

There are two type hints in this constructor (Magento\Framework\Model\ResourceModel\AbstractResource, Magento\Framework\Data\Collection\AbstractDb) that are not Magento object manager interfaces.  They're abstract classes.  When I extend this class and try to add my injected dependency

class Foo extends Magento\Framework\Model\AbstractModel
{
    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = [],
        \Package\Module\Model\Mine $mine,

    ) {
        //...
        parent::__construct($context, $registry, $resource, $resourceCollection, $data);

    }
}

Magento bails when the object manager tries to instantiate the abstract classes.

I can "fix" this by moving my object dependency in front of the abstract classes

    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,

        \Package\Module\Model\Mine $mine,

        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = [],
    ) {

However, this changed the argument order.  In a class that was fully object managed, this wouldn't be a problem.  However, the fact that these abstract class type hints exists imply there are parts of the Magento system that will manually (i.e. not via the object manager or DI) instantiate CRUD objects and pass in objects that conform to the type hints in that specific order.

Is this safe?  i.e. Are these abstract classes in an abstract model's constructor just legacy code, and not used?  Or will parts of the system still use these, meaning it's not possible to inject dependencies into a CRUD model?