texts: Magento not fetching PayPal Settlement reports

texts:
I have properly set PayPal settlement reports - username, pass, everything.

When in Magento's admin panel I go to Reports > Sales > PayPal Settlement Reports and click Fetch Updates in var/log/system.log I see these messages (actually much more then these but with the same pattern):

2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: TransactionID  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: InvoiceID  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: PayPalReferenceID  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: PayPalReferenceIDType  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: TransactionEventCode  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: TransactionInitiationDate  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: TransactionCompletionDate  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: TransactionDebitOrCredit  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: GrossTransactionAmount  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: GrossTransactionCurrency  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: FeeDebitOrCredit  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: FeeAmount  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: FeeCurrency  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: CustomField  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: ConsumerID  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301
2015-04-22T15:46:15+00:00 ERR (3): Notice: Undefined index: PaymentTrackingID  in /www/app/code/core/Mage/Paypal/Model/Report/Settlement.php on line 301

and in the web interface of the admin panel I get a green ("succesful") message

  Fetched 0 report rows from '...myusername@reports.paypal.com'

I have tried to debug the code but all I see on line 301 is:

$bodyItem[$rowMap[$flippedSectionColumns[$i]]] = $line[$i];

and I can't understand what is the problem. It seems ok at first glance.

I have tripple checked and debugged - the CSV files get properly downloaded from PayPal and the $line array is filled up with values. Still I am getting this error and the data is not fetched into Magento.

How to fix that?


texts: How to remove payment method step in checkout process in Magento 2.3.2

texts:
I have magento Open Source 2.3.2 setup my client don't want any payment method now. How to remove payment method step in checkout process. I just want to place order without selection payment method.

Any suggestion welcome in advanced.

Below is the exact representation of the requirement.


texts: Magento 2 : fetch checkout session on new route page after place order

texts:
How can I fetch checkout session on new route controller (redirecting to new page after place order) after order is placed. Adding checkout session to constructor and fetching getlastorderid using it is not working.

Block :

protected $_coreRegistryl;
protected $_checkoutSession;
protected $_remote;
protected $orderFactory;
protected $_objectManager;

public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Checkout\Model\Session $checkoutSession,
    \Magento\Framework\Data\FormFactory $formFactory,
    \Magento\Sales\Model\Order $order,
    \Magento\Framework\ObjectManagerInterface $om,
    \Magento\Sales\Model\OrderFactory $orderFactory,
    \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remote
        ) {
    $this->_coreRegistry = $registry;
    $this->_checkoutSession = $checkoutSession;
    $this->_order = $order;
    $this->_objectManager = $om;
    $this->_remote = $remote;
    $this->orderFactory = $orderFactory;
    parent::__construct($context, $registry, $formFactory);
}

public function getOrder()
{
    $orderId = $this->_checkoutSession->getLastOrderId();
    return $this->orderFactory->create()->load($orderId);
}

protected function _prepareForm()
{
    $model = $this->getModel();
    $order = $this->getOrder();
    if($order->getId() && $this->_checkoutSession->getData('session_check') == '1') {
        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create( .....


texts: Lack of Magento order creation after paypal payment

texts:
We had a customer contact us (and forwarded their paypal order confirmation) of an order placed with us (and paid successfully through PayPal, which showed all order items and details) but on Magento there is no trace of this order, no order was created and no invoice raised.

How could this happen?  Is there anything we can do to stop it happening?


texts: Rogue Extension posting unauthorized stuff to peoples blogs

texts:
How can I find out what extension actually posted a big spammy advertisement to blog/cat/news on our site?  More specifically where the parasite code may be?

It looks they they've done this to TONS of other people as well.

https://www.google.com/search?q=inurl%3Ablog%2Fcat%2Fnews%20aheadworks&rct=j

I'm all for a "powered by" or similar branding...but seriously...our customers don't care what kind of magento extensions we're using.  This is very blatantly just done for SEO purposes...and I'm certain that site owners have no clue it's happening.

Thanks for the help.


texts: How to edit a template file in Magento2?

texts:
I am new in Magento2. I need to edit a already existing template file in magento2. For ex: I need to shipping.html in Magento_Checkout. I don't know where to edit this file, and moreover it is like .html file. But I want to edit phtml file of this.

Please can anyone help me?


texts: how to Integrate Magento content into your WordPress website?

texts:
I am install this plunging but is not working. when i am add shortcode then his seen like this error:- "Unable to login to host with that username/password combination."

how i am fix it this issues please give me a suggestion..


texts: Magento 2 - How to make ajax show messages

texts:
I want to display messages on the cart page. I have made a custom module so that the shopping cart will automatically reload when the qty changes using AJAX.
Here is my js code:
define([
'jquery',
'Magento_Checkout/js/action/get-totals',
'Magento_Customer/js/customer-data',
'domReady!'
], function ($, getTotalsAction, customerData) {

$(document).on('change', 'input[name$="[qty]"]', function(){
    var form = $('form#form-validate');
    $.ajax({
        url: form.attr('action'),
        data: form.serialize(),
        showLoader: true,
        success: function (res) {
            var parsedResponse = $.parseHTML(res);
            var result = $(parsedResponse).find("#form-validate");

            $("#form-validate").replaceWith(result);

            //reload minicart
            var sections = ['cart'];
            customerData.invalidate(sections);
            customerData.reload(sections, true);

            //reload total summary
            var deferred = $.Deferred();
            getTotalsAction([], deferred);

        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
});

});

If I update qty in cart so that the qty is higher than the quantity available. I want to display a message like "The requested qty is not available"?
Can I use customerData to show error messages and display them on the page?
Thanks.


texts:
After trying to update attributes for 4 products in Magento 2.3.2 the Bulk Actions log shows that the update tasks have not started.
My Magento cron jobs appear to be running ok, why are bulk action tasks not starting?

UPDATE
After upgrading to Magento 2.3.3 I still had this problem. I had been using www-data as the file owner for my development system which I know is a bad practice. After resetting permissions as per Magento documentation and ensuring cron job was running as correct file owner the bulk actions run correctly.
UPDATE Magento 2.4.x
This problem has appeared again in Magento 2.4
See the following issue https://github.com/magento/magento2/issues/29797


texts:
Was working on my database and discovered I had a foreign Key error. No problems, fixed that. However, whilst I was working on the database, a website order came through.

The order shows up in the sales_flat_quote in the database. However, it is not in the following tables:

sales_flat_invoice
sales_flat_invoice_grid
sales_flat_order
sales_flat_order_grid
sales_flat_quote
sales_flat_shipment
sales_flat_shipment_grid

My question is, how can i take the information from the sales_flat_quote table and apply it to these other tables so that it shows up in the order section of the back end of my website? Can't seem to find any information on the process to achieve this.

I am currently running Magento 1.7.0.2

Thanks in advance hopefully :)

EDIT:

I need to convert the quote to an order. I have found this script (as I have all quote, quote items, quote payment and quote address). The order is valid, as the paypal invoice even has an order number. The foreign key error prevented the invoice from being created.

However, when I run the script, I get this error:

PHP Fatal error:  Uncaught exception 'Mage_Core_Exception' with message 'Cannot retrieve payment method instance.' in /home/user/public_html/app/Mage.php:594

Stack trace:
0 /home/user/public_html/app/code/core/Mage/Payment/Model/Info.php(82): Mage::throwException('The requested P...')

Here is the script:

$quote = Mage::getModel('sales/quote')->load(5428);

$convert = Mage::getModel('sales/convert_quote');

$order = $convert->toOrder($quote);
$order->addressToOrder($quote->getAddress(),$order);

foreach($quote->getAllItems() as $item){
    $orderItem = $convert->itemToOrderItem($item);
    if ($item->getParentItem()) {
       $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
    }
    $order->addItem($orderItem);
}

$quote->getShippingAddress()->setPaymentMethod('paypal_express');
$quote->getShippingAddress()->setCollectShippingRates(true);

$payment = $quote->getPayment();
$payment->importData($data);
$quote->save();

$payment = $convert->paymentToOrderPayment($quote->getPayment());

$order->setPayment($quote->getPayment());

$message = '[Notice] - Order converted from quote manually';
$order->addStatusToHistory($order->getStatus(), $message);
$order->place();
$order->save();

$quote->setIsActive(false)->save();

Hopefully someone can help......


texts: How can I update all products names via sql query in magento2?

texts:
Hi I have a list of sku's of all products at my store , I want to update all the names of products I have on store via sql query with respect to it's sku .

There is a table name : catalog_product_flat_21 and catalog_product_flat_19 at my database

Just for checking I have updated the column of (name) in these both tables and refresh the caches but still name on site is not update !

Tell me if you have solution of this using sql query , Thanks!


texts: Magento 1.7.0.2 Inserting remarketing tags on category page using Anaraky plugin

texts:
I'm trying to insert some dynamic remarketing tag on a Magento 1.7.0.2 page using a free plugin called Anaraky.

The plugin works well enough (for a free plugin), but I am having trouble with one of Google's requirements:

I must include a tag called ecomm_prodid before the </body> tag on every page of my site, this ecomm_prodid must show the SKU for each product shown on a page. So for example if a category page shows 3 products, the tag will be written as

ecomm_prodid: ["Prod1","Prod2","Prod3"],

Here's the code I'm trying to use

 case 'category':
            $category = Mage::registry('current_category');
            $items = $category->getAllVisibleItems();

            if (count($items) > 0) {
                $data  = array();
                foreach ($items as $item)
                {
                    $data[0][] = $this->getEcommProdid($item->getProduct());
                    $data[1][] = (int)$item->getQty();

                }

                $params = array(
                    'ecomm_prodid' => $data[0],
                    'ecomm_pagetype' => 'category',
                    'ecomm_quantity' => $data[1],

                );
            }
            else
                $params = array( 'ecomm_pagetype' => 'other' );

            unset($cart, $items, $item, $data);
            break;

But it is not working.

My question is, how should I modify this script so that it detects which products are being show on a page and then writes their skus on the ecomm_prodid tag?


texts: MailChimp integration error magento 2.3.3

texts:
I am trying to configure MailChimp with my Magento 2.3.3. As I enter the API and leave the field a popup appears "Attention" without any error or any other text.

Help me to sort it out.


texts: change content of div based on usergroup

texts:
I have a static block that loads an image with a link on the main page. However what I need is if the user is logged in and is a wholesaler to have the image have a different url. So I am using jquery which I have loaded in our Magento CE website. My issue is it does not seem to be changing the url. However when I look at the code inspector in Chrome I do not see any errors?
What happens is even when I am logged in my div with id demo does not have the wholesale content in it.

Here is my code (which I have in the header.phtml file)

       <?php
            //switch url for brestcancer awareness month
            //slider that links to a product
         if(Mage::getSingleton('customer/session')->isLoggedIn())
            {
                // Get group Id
                $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
                //Get customer Group name
                $group = Mage::getModel('customer/group')->load($groupId);
                $agroupcodename = $group->getCode();

                 if($agroupcodename =='US-Wholesale')
                    {
       ?>

       <?php
                    }
           }
        ?>

I then have a static we will call slider1


texts: Magento 2 - eshop | Technologies that should be used

texts:
I recently assigned the implementation of my eshop to an agency, using magento 2. What I would like to ask, is what should I have in mind, in order to be sure the latest technologies are implemented given that my experience is minimal to say the least.

The eshop will host between 10000 to 15000 products

From what I know some key factors are:

the PHP version, to my best knowledge must be 7 and above

For the frontend CSS3 and HTML 5 should be used

Varnish Cache should be enabled

What else should I ask to be implemented considering this is 12000 dollars investment.

Some server recommended specs will be very much appreciated, thanks!


texts: Unable to get custom customer Address attribute value to customer grid

texts:
I've created custom customer address attribute through admin panel. Attribute value is inserting in customer_address_entity_int table. I'm able to see custom attribute in grid options but attribute value is not displaying in  customer grid.

Any Help, Thank you.


texts:
I need to show a popup when the store loads and need to ask users to select the city, then only products deliverable to these cities must show.

In the backend, I added some cities to a new attribute 'location'. So in the popup, I need to, maybe query those data in attribute and show them.

Previously I made modules for separate pages. Which has a route id and all? But here I need it on the main page.

Which template, layout should I extend? And all.


texts: How to refresh Magento Cache Management using CMD Prompt?


texts: Magento2 activate custom module that extended core module

texts:
lets say I've created a custom module that will extend some functionality as plugins from Magento_Catalog core module and lets call it MyModule.
MyModule has already been registered and activated.

I have defined my module and the sequence for Magento_Catalog in module.xml
I have created the plugins and declared them in etc/adminhtml/di.xml file

1) Does the Plugin that extend the core Magento module class has to be in the same directory structure as the parent that it extend? For example, plugin for MyVendor\MyModule\Block\Adminhtml\Product\Edit.php  to be in

namespace MyVendor\MyModule\Block\Adminhtml\Product\MyEdit.php

2) I am not entirely sure what exactly should I do so MyModule gets invoked when I go to the page ?

http://mydomain/admin/catalog/product/edit/id/8

Thank you.


texts: Magento2 on list page click page 2 or 3 at the bottom of the page. Go about 8 products down. No product image is coming only the loading image

texts: On list page magento2 click page 2 or 3 at the bottom of the page. Go about 8 products down. No product image is coming only the loading image. The issue is random, if you click CTRL-F5 sometimes the products images comes.


texts: Efficiently upgrading multiple environments to 2.2.5

texts:
We are a multi-environment shop where each dev has their own environment, then we have a development, staging, and production.

I am trying to find the cleanest, most efficient way for each dev to be able to upgrade their own environments, and then of course upgrade dev, staging, and prod.

Is there a possibility of upgrading one environment via composer/command line, committing the changed files to a branch, and then merging that branch with the other environments?  If not, I'm open to suggestions here.

Thank you!


texts: M2 - How to make page-header zoon out (25%) content center background color full width

texts: The background color of the page-header full width but the content should center, how to do this?


texts:
We are going to migrate our products to Shopify and we need to download the products in a CSV file? Is that possible?  How do you do that?

using Porto theme


texts: How to use cookie-free domains in magento 2.3.X

texts:
I have recently create gtmetrix report for my site, in that report I found Use cookie-free domains to 0 means nothing. My question is that how to use cookie free domain in magento 2.3.4
and i see here same question but not any answer

Any help would be appreciated.
Thanks.


texts: Include 3columns.phtml in my Custom module template folder

texts:
How do i replicate the the below template 3columns.phtml in Magento2 in my Custom module.

I believe there is no 3columns.phtml in Magento2?
How to configure the same?

<reference name="root">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_Module::page/3columns.phtml</argument>
        </action>
     </reference>

I also need to know what exactly is the look or behavior of 2columns-left or 1-column as we specify in layout xml file.
When and what situation we use it?


texts:
How do I filter a product collection so that it includes only products in store 2 that are not in store 3. It can include any other stores as long it is in store 2 but not in store 3.

product->storeids() = 2,1 (yes)
product->storeids() = 2 (yes)
product->storeids() = 1,2,3 (no)
product->storeids() = 3 (no)
product->storeids() = 1 (no)


texts: Magento 1.9 Downloadable Product: Show download link except of add to cart in product view

texts:
I'm a little bit disappointed how the product type downloadable works in magento. I'm really wondering why you can buy a downloadable several times (i know you don't have to but it just looks like this with the add to cart button still there).

Is it possible to show the download link instead of the "add to cart" button – if a user is logged in, who already has purchased the product?

And furthermore mark the product as "already bought" in the category view e.g. remove the price?

That would improve the usability and
user-friendliness so much and i absolutely don't get why it's not already standard behaviour in magento.


texts: Magento2: How to move VAT field in checkout

texts: I need to move the VAT field to top, I can not find the file with the form or the file where I can modify it


texts:
Is it possible to somehow see that Magento caching is enabled in the front-end?
The question only related to the standard setup of Magento CE 1.9 or Magento-EE 1.14.

I'm asking that to check the state of the caching by Selenium tests, though I'm not happy adding custom extension to output the state of caching settings.

UPDATE:
When caching is disabled on dev system, some tests might fail because of timeouts.
We want to add explicit check to understand better why test-suite failed.
Just increasing timeouts will only mask the issue.

I understand that I can see that in the backend, but I don't want to store admin user credentials in selenium test.

I also understand that Selenium is not a benchmarking tool, that is why we do not want to assert performance by Selenium in any form.


texts: Magento 1 - setTemplate in block class constructor does not work

texts:
I try to overwrite the template app\design\frontend\venedor\custom\template\catalog\product\view\options\type\select.phtml with app\design\frontend\base\default\template\wr\catalog\product\view\options\type\select.phtml

So I have rewritten the constructor of the class Mage_Catalog_Block_Product_View_Options_Type_Select.

Hint: My Extensions Namespace is "WR" and the name of the Extension is "EPO".

class WR_EPO_Block_Catalog_Product_View_Options_Type_Select extends Mage_Catalog_Block_Product_View_Options_Type_Select
{

    public function __construct()
    {
        Mage::Log('my constructor was called', 7, "p.log");
        parent::__construct();

        $this->setTemplate('wr/catalog/product/view/options/type/select.phtml');
    }

The rewrite works fine, I get the log entry in p.log.

But the old template is still getting loaded. I already cleared the cache.

I successfully replaced another template in adminhtml the same way, so why does it not work in this case?


texts: Best way to reduce time for duplicate product

texts:
When I 'duplicate' one of my simple product, it takes 8 ~ 11 seconds to complete duplicate process. I create new clean store on my same server, and the new store take less than 2 seconds to complete duplicate product so I don't think it's server problem

My store have 90,000 sku products. is this the reason to take 8 ~ 11 seconds to duplicate? If so, is there any method to reduce time for duplicate process much?


texts: My magento 2 website's menu is not displaying, it is loading in esi.include tag

texts:
Please see the console highlighted tag below :

https://lh3.googleusercontent.com/-bbh1XSOt524/Wfcce1p3G3I/AAAAAAAAAv0/rRGBZ28R8403rTGKUc6U-wQCfeQzHZe7wCL0BGAYYCw/h800/2017-10-30.png


texts: How to add new Template Variable in magento

texts:
I want to add new template variable and use it in transactional email template from backend. Same as "Confirmation URL". Please refer to screen shot:

Thanks!!!


texts: Magento 2 : How to Create Custom Pricing Calculator on Category Page?

texts: I want to know that how to create an Extension for Custom Pricing Calculator on Category Page.The functionality of Pricing Calculator is use Based on the bellow Image. when I fill the all details and click on Place Order button. It will show cart page.


texts: Magento2 : Auto Select Options for Products with Multiple Options

texts:
I'm trying to get url with already selected options.

If I have only one options, code is working fine adding #{attribute_id}={attribute_value} after url.

https://nyhomedecor.com/cordless-dual-sided-led-lighted-vanity-mirror-1x-5x-or-1x-10x.html#159=28

This code is not working when I have more than one option.

https://nyhomedecor.com/surround-lighttm-wall-mount-mirror-5x-or-7x.html#155=21&163=115&159=32

Any idea how can I make this work?


texts: Difference in quoted shipping and charged shipping

texts:
I am using Magento ver. 1.9.0.1 and shipping_override.  However, the problem existed before the addition of shipping_override (and after).

The system gets UPS rates using my UPS account.  However, the checkout always shows about 6% LESS on any selected rate.  When logged in viewing the shopping cart you can see BOTH amounts.

This has nothing to do with the tax rate, or shipping_override.  The flat rates from shipping_override are also reduced and I've tested with no-tax states.  There is no added charge setup (either fixed or percentage).

Its a mystery. . .


texts: Security problem: catalog/product_list Error message in system.log

texts:
This morning I got the error 2016-02-12T12:51:12+00:00 DEBUG (7): Security problem: catalog/product_list has not been whitelisted. in the system.log file.

I don't want to whitelist it before knowing what it is!

But i can't find any file or block called product_list.  How would one go about finding any file, block or CMS page containing "product_list"?


texts:
I just made a custom module in Magento 2 and now the header and Magento admin panel is not being rendered properly.
I already upgrade the setup and clean the cache and reindex all the grid.
When I click on any module on the sidebar, it is not working. What could be the problem?


texts:
The website I am currently working on needs to separate orders in stock and orders in backorder. For example, when customer buys 1 in stock item and 1 backordered item, in the backend, there needs to be a separate orders with the ones in stock and backorder. I bought the extension Split order http://www.mlx-store.com/magento-extensions/sales/split-order-for-magento.html and it does the job I need it to do, but it can only separate 1 backorder. For example, when a customer buys 1 in stock item and 4 backorder items, when you go into the backend, only one of the backorder item is separated.

Is there any way to fix this extension or any other way to create an extension that will do the job that I need?

Thank you!


texts: Magento 2 | Override title.phtml in module

texts:
I want to override this file in my custom module:

  /var/www/magento2-dev/vendor/magento/module-theme/view/adminhtml/templates/title.phtml

How can I achieve this?

Thanks for any help!


texts: magento 1.9 add custom product image type

texts:
how can I add a custom product image type in the image gallery?

e.g, see banner_landing type in the image below.


texts:
Apologies for my ignorance in advance.

This is a question that I suspect is more connected to PHP/Zend, but it also has relevancy to Magento.

When running a dataflow import why does the page not timeout, what are the mechanics that make it work.

Additionally, how does the script output updates before (such as: successfully imported product 'N') the script finishes. Usually when I run a script in Magento it only provides the echo text after the script finishes.

How does this work?


texts: Remove Tax calculation from cart page and calculate only in checkout

texts:
I need to remove tax calculation from cart page. And need to only calculate tax when in checkout.

Example :
Cart Page (After stop all the tax calculations and tax displaying)
Sub Total : $300
Grand Total : $300

Checkout Page - (assuem tax rate is 10 %)
Sub Total : $300
Tax : $10
Grand Total : $330


texts: Magento 2 - change text of PDF invoice for purchase order

texts:
How can I change the text of "purchase order" section in the PDF invoice which Magento creates?

When the payment method is "purchase order" (instead of credit card or paypal), Magento prints the purchase order number in the PDF invoice. I would like to add specific payment instructions to the PDF when order is done with the "purchase order" method.

Thank you for your time


texts: Magento 2: Using dockerize-magento2 create enviroment to install magento 2

texts:
I am a beginner using docker to create web environment. I want to install magento 2.
I use https://github.com/arvatoSCM/dockerize-magento2/ to create images, container and install magento 2.
But when I'm installing, it has a error: bin/magento permission denied.
I change command line at file bin/console in executeInDocker function:

  line 137 - docker exec -it -u www-data $phpContainerName bash -c
  "bin/magento $*"

to:

  line 137 - docker exec -it -u root $phpContainerName bash -c
  "bin/magento $*"

It works. But when install completed. I cannot go to frontend or backend.

  Error 404 nginx

Now, I'm just wanted to create environment with: nginx, php, mysql, alpine, redis, phpmyadmin with docker, and config nginx config, php extensions to install magento 2?


texts: Truncate report_event table in Magento 2

texts:
Can I truncate report_event table in Magento 2?

I am migrating from Magento 1 to Magento 2 and I find that report_event table has too many records which will slow down the migration process.

Is it safe to truncate the report_event table?

What is the consequences of the truncation of data ?


texts: Magento 2: Plugin before/around/after Interaction

texts:
In Magento 2, when you create an "around" plugin

public function aroundRenderResult(
    \Magento\Framework\Controller\ResultInterface $subject,
    \Closure $proceed,
    ResponseHttp $response
) {
    //...
    $proceed($response);
    //...
}

you can proceed to the next around plugin, culminating with call the actual original method, by calling/invoking the passed in $proceed method.  This is a common design pattern, often seen in PHP Frameworks middleware implementations.

However -- it does present some confusion w/r/t to implementation details.  Specifically

  If, in addition to an aroundPlugin, an object/class has a before or after plugin defined, when do they fire in relation to the chain of around plugins?

i.e. will all the before methods fire before any around plugin methods fire?  Or will before plugins only fire before the final, actual real method fires?

The specific problem I'm trying to track down is, I can't seem to get a plugin attached to the dispatch method the a Magento 2 front controller when Magento's in full page caching mode.  The full page cache operates by an around plugin that does not call $proceed($response).  I've tried digging into some of the code around these plugins and have found the system difficult to reason about without knowing how its intended that plugins work.

i.e. -- the description on the dev docs page appears, in this one specific instance, to be inaccurate.  It's unclear if the documentation is wrong, or if this is a recently introduced bug, if it's an edge case, or if my plugin configuration is wrong.

Does anyone know, by direct observation, or by cultural knowledge, how this prioritization is supposed to work?


texts:
i'export a csv file by using export data workflow profile(export all products) by using magento admin, and i see the exported image path like /1/3/1330519_1.jpg.

/0/7/07aledtv_26.jpg
/0/7/07aledtv_26.jpg
/1/3/1330519_1.jpg
/1/3/1330511_1.jpg
/0/2/0210265_1.jpg
/2/9/2960019_1.jpg
/0/7/07aledtv_27.jpg

/0/7/07aledtv_28.jpg
/0/7/07aledtv_28.jpg
/0/7/07aledtv_28.jpg
/1/3/1330520_1.jpg
/0/7/07aledtv_28.jpg
/0/7/07aledtv_28.jpg
/2/5/2550075_3.jpg
/7/6/7630004_5.jpg
/0/2/0210317_1.jpg
/2/3/2310321_1.jpg
/0/7/07aledtv_28.jpg
/1/3/1330521_1.jpg

So, anyone know what is the /1/3/ is actually referring? categoryID?

And i use magmi try to import, how do i map the using Image attributes processor v1.0.25, what is the new csv format should be?


texts: Translation doesn't work on breadcrumbs added by xml

texts:
I'm building a custom page.

I add breadcrumbs like this (and it works well).

<brand_brand_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb">
                <crumbName>Home</crumbName>
                <crumbInfo>
                    Home
                    <title>Home</title>
                    <link>/</link>
                </crumbInfo>
            </action>
            <action method="addCrumb">
                <crumbName>All Brands</crumbName>
                <crumbInfo>
                    All Brands
                    <title>All Brands</title>
                </crumbInfo>
            </action>
        </reference>
        [[...]]
    </brand_brand_index>

The problem is label not translated in front-end. It shows Home / All Brands instead of translated version.

The things I made sure:

Added translate="label" to handler
Cache cleared (acctually I turned off caching)
Translation syntax is correct (I put in Mage_Core.csv)
Label is translated properly by php code (eg: $helper->__('All Brands');

Help me to figure it out, please.

Thank you.


texts:
How do I exclude certain SKUs from Price Promotions? (Category Rules or Shopping Cart Rules)
I do have Amnesty Special Promotions Extension. I just have 3 items that are special order only and I want to excluded them from all promotions.

Thanks


texts: getting all products instead of getting the products from current category in Layer.php

texts:
I looked around, and i found something similar but still can solved my problem. So i decided to ask here. sorry if there is a duplicate question already asked.

I want to override the getProductCollection() in Layer.php in magento, but here is my problem.

below is the original code with my own code:

public function getProductCollection()
{

    if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {

        $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];

    } else {

        //Original collection code
        //$collection = $this->getCurrentCategory()->getProductCollection();

        /* I want to do the below code*/
        $collection = Mage::getModel('catalog/product')->getCollection();
        $collection->addAttributeToSelect('customYesNoAttribute');
        $collection->addFieldToFilter('customYesNoAttribute', 1);
        /*custom code ends*/

        $this->prepareProductCollection($collection);
        $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
    }

    return $collection;
}

what this code does is that it will get all products for every category, then filter the products for a attribute carry with the Category.

For example:

Category: Cup
Custom Category Attribute: isCup

Product: Coffee Cup
Custom Attribute: isCup->Yes

Product: T-Shirt
Custom Attribute: isCup->No

when i open the "Cup" category, the above code gets the isCup attribute from the category, and filter all products with isCup=Yes, and show on the category.

The main reason why i want to do this is I don't want to manually add products to category because my client has over 5k products. It will be a nightmare to maintain them.

But my problem with the above code is now a blank white page with nothing. Any help will be greatly appreciated.


texts: Can DEBUG level messages be excluded from system.log?

texts:
I'm working on a large Magento installation setup by another developer.  Logging is disabled in the live environment which struck me as odd.  While testing the code with logging enabled locally it seems it's extremely verbose, generating a huge number of DEBUG entries.

Is it possible to limit the system log to capture only higher threshold messages?  If not then am I incorrect in assuming logging should be enabled on the live site?


texts: Magento 2 REST API: What's the difference between carts and guest-carts?

texts:
Our team is developing a store using Magento 2 as the backend, with a decoupled client-side layer using Node.js/Express/React/Redux. So obviously we are relying heavily on the REST API, which is far from being well documented.

I am now developing the cart operations, and I noticed there are different endpoints for carts:

/V1/carts/
/V1/guest-carts/

Which is strange, because:

the cart objects that they provide as responses are identical
their responses have a customer key (why would guest-carts have this?)
their responses have a customer_is_guest key (why would both have this, since the endpoints already provide this distinction?)

Anyway, how should I deal with both endpoints? Should I necessarily use both, since most of the logic is handled by ourselves in the frontend/middlewares?


texts: SQL error in [stage: data migration][step: EAV Step]: started

texts:
I have this issue where I get the following error in the [stage: data migration][step: EAV Step]

  In Mysql.php line 110:

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
  error in your SQL syntax; check the manual that corresponds to your
  MariaDB server version for the right syntax to use near ')) ORDER BY
  entity_attribute_id ASC    LIMIT 216' at line 1, query was: SELECT
  eav_entity_attribute.* FROM eav_entity_attribute WHERE
  (entity_attribute_id >= 0) AND (attribute_id IN ()) ORDER BY
  entity_attribute_id ASC    LIMIT 216

The issue is related to this part "attribute_id IN ()" because the selection is empty. However I do not know where this comes from.

In the map.xml I have both source and destination ignoring the eav document as such

<ignore>
   <document>eav_entity_attribute</document>
</ignore>

The migration tool is CE to CE from 1.9.4.5 to 2.3.5-p1. No other error appears prior to this step.


texts: change product-grid class to row class in Boilerplate - Bootstrap

texts:
Assuming that I'm new to Magento and I would like to create a Magento theme changing the current product-grid classes etc to the Bootstrap structure and I'm using the Boilerplate theme. I would like to change the product-grid list with a row class, but I can't understand in which file I have to do this and if it's a good practice or not.

Isn't the right path app\design\frontend\boilerplate\default\template\catalog\product\list.phtml?

I've tried to change this file changing the class name, but nothing happens.

What should I do?

Here is the screenshot of the webpage:


texts:
I have a weird problem regarding a order checkout form the back end section. I have a product that is not is stock.
It has 0 qty, no back-orders, and the out of stock status.

When i try to make an order with this product, surprisingly the order goes throw with no issues causing the stock qty to become -1.

I would like to stop an admin from making an order if the product is not in stock.

This behavior was tested on Magento 1.6.2.0.

Any help regarding this issue would be appreciated.
Thank you.


texts: How do I enable Template Path and Block Name hints

texts:
I am trying to find where in Magento's massively complex system, the templates are located and what blocks need to be modified.

I can use Chrome or Firefox web developer tools to see the code and easily test the modification, but when it comes down to actually making that change, I find myself wading through Magento's template directory and lost.

How do I find where the template is? How do I find the block name?


texts: Problem with customer group on multi-site

texts:
I am having an issue because I cannot create a new user. The admin panel is telling me the "Group" is required but there is no drop down which I could use to select a group.

Is there any modification to do in the code to get this appearing? How should I proceed to find the cause of this problem.

Thank for the help in advance.


texts:
Like in the title.

What is the data encryption / hashing key management method used in Magento 2?

I found this question Encryption Method Used by Magento Enterprise, however, is the same method used on Magento 2 Community Edition?

I think admin account passwords are hashed using MD5 if I'm not wrong...


texts: What is purpose of blank.html in js directory?

texts:
In Magento CE 1.7.0.2 in js directory there is file blank.html

What is purpose of this file exactly?


texts:
magento can send new user mail confirmation, newsletter subscription, invoice and shipment success but can't send new order mail and send order email to customer in admin panel.

in database core_email_queue is full of not sent emails

also i did:

sudo crontab -u www-data -e

and add:

* * * * * /bin/sh /home/salar/public_html/cron.sh

this is my AOE Scheduler:


texts: I create a new product and type price= $1.2222. But when I click Save and Continue edit the price = $1.22. I don't want to round the price, i want the price=$1.2222. How can I do that? Thank you!


texts:
I have followed the guide here and created a custom tab on CMS Pages:

I now want to add a Category tree to this custom page.  I have an answer here but I'm confused by this step:

In your form file where you add the tabs of your custom entity add this also:

$this->addTab('categories', array(
    'label' => Mage::helper('[module]')->__('Associated categories'),
    'url'   => $this->getUrl('*/*/categories', array('_current' => true)),
    'class'    => 'ajax'
));

I am not sure what is meant by "form file".  Can anyone point me in the right direction?


texts: 2.3.5 - New Orders with approved payment are created as 'Pending' as opposed to 'Processed' status - using third party payment method (Mercado Pago)

texts:
Magento ver. 2.3.5-p1
Third party Module used: Mercado Pago
https://www.mercadopago.com.br/developers/pt/guides/plugins/official/magento-two
Description:
users are able to pay for orders and their payments are approved and authorised correctly.
However new orders are created as 'Pending' and therefore a confirmation email is not sent.
If I go to the order (Sales > Order > Order #00000) I can change the status manually to Processing by invoicing the order, however I would like to configure for new orders, with approved payments, to be created as processing.
There is an option on the Module (Stores > Configuration > Sales > Payment Method > Mercado Pago global Configuration), where we can define the status of new orders, which since installation has been selected as 'Processing' but still new approved orders are created as 'Pending'.
Please if anyone could help me on getting new orders to be created as Processing, that would be much appreciated.
Thanks


texts: HHVM is breaking display in Manage Currency Rates

texts:
Our Magento store is running on an NGINX server & HHVM.

I've noticed that when you go to System > Manage Currency Rates the currency fields are displayed in the wrong order, they've all been shifted to the right.

Our base currency is Euro but the field with the euro rate is displayed beneath the GBP column.

They are:

As opposed to:

When I inspect the field with the 1.000 curency rate it has name="rate[EUR][EUR]" for which confirms the fields are in the wrong position.

There is nothing showing up in my HHVM or NGINX error logs.

Also I have hhvm.enable_zend_sorting = 1 & hhvm.enable_obj_destruct_call = 1 set in my /etc/hhvm/php.ini and /etc/hhvm/server.ini files.

Has anyone else using HHVM and Magento noticed this or have a solution?


texts: Get a dropdown attribute value from ProductInterface, without breaking interface contract

texts:
I have an instance of \Magento\Catalog\Api\Data\ProductInterface. This product has a product attribute 'custom_attribute', which is a dropdown. Now, if this was an instance of \Magento\Catalog\Model\Product I could just do: $product->getAttributeText('custom_attribute') to get the custom attribute text.

In the interface, getAttributeText is missing. So how do I get the dropdown value from ProductInterface, without breaking the interface contract?

I know that the interface has a method getCustomAttribute($attributeCode)->getValue(), but this only returns the value ID of the attribute.


texts: Magento 2 : Add custom products to shopping cart price rule

texts:
I set a custom shopping cart price rule with this code

 $rule
        ->setName('Loyalty card')
        ->setDescription('Loyalty card')
        ->setFromDate('2016-11-15')
        ->setToDate(NULL)
        ->setUsesPerCoupon(null)//unlimited
        ->setUsesPerCustomer(null)//unlimited
        ->setCustomerGroupIds(array($regularCustomerGroup->getId()))
        ->setCustomerGroupId($regularCustomerGroup->getId())
        ->setIsActive('1')
        ->setSortOrder('1')
        ->setCouponType('2')
        ->setSimpleAction('by_percent')
        ->setDiscountAmount(20)
        ->setDiscountStep('0')
        ->setSimpleFreeShipping('0')
        ->setApplyToShipping('0')
        ->setTimesUsed('0')
        ->setUseAutoGeneration('1')
        ->setIsRss('0')
        ->setWebsiteIds(array('1'))
        ->setCouponCode(NULL);

    $rule->getResource()->save($rule);

Now I need to add custom products to this rule using cron. How can I add an array of custome, previously selected products to this with some sort of method like setProductIds() or something of that kind?

Thank you!


texts: How to specify directory for image uploader in install script

texts:
I have an install script that works, but doesn't upload the files where I want them:

$installer->addAttribute('catalog_category', 'category_banner_image',  array(
    'type'     => 'varchar',
    'label'    => 'Category Banner Image',
    'input'    => 'image',
    'backend'  => 'catalog/category_attribute_backend_image',
    'global'   => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'           => true,
    'required'          => false,
    'user_defined'      => true,
    'default'           => '',
    'nullable'          => true,
    'group'             => 'Category Promo'
));

It uploads everything to /media/catalog/category but I would like for them to go to /media/categories/banners.  How can I specify that in the install script?


texts: Customer admin grid new customer add where form customer attribute get in ui grid in magento2?

texts:
In default
Account Information label working but in my side it's not display
see:

Do anyone know the flow for it?


texts: Magento 2 get store information on checkout page by knockoutJs

texts:
I wanted to display store name with item name on checkout page.

I am beginner in knockoutJs, please help me to solve this.


texts: Magento 1.9 Get post data from contact form in a view

texts:
I'm trying to get a success message on the contact page. When the form is send i want to show the message. So i need the post data from the form. I tried this:

$postdata = Mage::app()->getFrontController()->getRequest()->getPost('email');

And

$postdata = $this->getRequest()->getPost('email');

And

$postdata = $this->getRequest()->getParams();

But i don't get the post data

I want to display a success message, i thought that when i have the post data in the view i can make a if statment in the view to show the success message


texts: How to create Catalog attribute in Magento 2 Using Upgrade Script

texts:
I created attribute in Magento 2 using install script.
By this code.

namespace Custom\Features\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 Magento\Catalog\Setup\CategorySetupFactory;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;

class InstallData implements InstallDataInterface
{
   private $eavSetupFactory;
   private $attributeSetFactory;
   private $attributeSet;
   private $categorySetupFactory;

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

   public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
   {    // TO CREATE PRODUCT ATTRIBUTE
       if (version_compare($context->getVersion(), '1.0.6') < 0) {
       $setup->startSetup();
       $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
           $eavSetup->addAttribute(
                   \Magento\Catalog\Model\Product::ENTITY,
               'feature_1',
               [
                    'group' => 'Autosettings',
                    'type'  => 'varchar',
                    'label' => 'Feature 1',
                    'input' => 'text',
                    'frontend' => '',
                    'required' => false,
                    'global' => 1,
                    'visible' => true,
                    'required' => false,
                    'user_defined' => true,
                    'default' => null,
                    'searchable' => false,
                    'filterable' => false,
                    'comparable' => false,
                    'visible_on_front' => true,
                    'used_in_product_listing' => true,
                    'unique' => false,
                    'apply_to' => '',
                    'note' => 'Feature 1'
           ]
       );

       $setup->endSetup();
   }
   }
}

Now I want create some attribute in catalog using Upgrade.

How to process same with another attribute in catalog using upgrade script.


texts:
First of all I am not a developer.
I am using Magento 2.1 community edition and it is hosted in ehost.com.
I installed it using FTP. The setup has done successfully and front end and back end are working good.
Once I try to install a new theme/extensions, I am getting an error on readiness check saying: Cron job is not configured.
I contact ehost customer support, they are saying cronjob has to be created from my side. I go through the help on Magento. I realised that there is no cron on var folder, but I found it in folder /update.
Is there anybody who can help me to solve this issue?


texts: Run external bash script using Magento 2

texts:
I'd like to create a file (e.g. script.sh) that will reside on the same server as my Magento 2 instance.

I'd like to be able to call a URL (e.g RunScript.php) that would in turn execute this script

Is this possible?

Thanks


texts: Magento2.2 getCollection from Factory deprecated

texts:
I get in my editor (PhPStorm) on getCollection the message that it is deprecated.

In my controller i got the function

public function __construct(
    Registry $registry,
    TableRepositoryInterface $dataRepository,
    PageFactory $resultPageFactory,
    ForwardFactory $resultForwardFactory,
    Manager $messageManager,
    TableInterfaceFactory $dataFactory,
    DataObjectHelper $dataObjectHelper,
    Context $context,
    Logger $logger,
    DirectoryList $directoryList,
    File $ioFile,
    Menu $helper,
    Costs $costsModel,
    CostsRepositoryInterface $costsRepository,
    CostsFactory $costsFactory
) {
    $this->costsFactory     = $costsFactory;
    $this->costsRepository  = $costsRepository;
    $this->costsModel       = $costsModel;
    $this->helper           = $helper;
    $this->ioFile           = $ioFile;
    $this->directoryList    = $directoryList;
    $this->logger           = $logger;
    $this->messageManager   = $messageManager;
    $this->dataFactory      = $dataFactory;
    $this->dataRepository   = $dataRepository;
    $this->dataObjectHelper = $dataObjectHelper;
    parent::__construct($registry, $dataRepository, $resultPageFactory, $resultForwardFactory, $context, $logger);
}

And here i call the function

public function existingColorRange($data)
{
    // Check the color_amount/from/till with database
    $costsCollection = $this->costsFactory->create()->getCollection();
}

Got my model build just like in following
link

How do i call the collection the right way without deprecated function?


texts:
Im trying to send email using transportbuilder but I'm getting this error.

  Exception #0 (Magento\Framework\Exception\MailException): No body
  specified Exception #1 (Zend_Mail_Transport_Exception): No body
  specified

The template is already in and everything is already put in. Im using the following code to send email.

$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
                    ->setTemplateOptions(['area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, 'store' => $storeId])
                    ->setTemplateVars($vars)
                    ->setFrom($sender)
                    ->addTo($email, $name)
                    ->getTransport();

                $transport->sendMessage();

Can anyone help me on this.


texts:
When I am trying to add downloadable product from back end at that time below error gets popped up

  Link URL's domain is not in list of downloadable_domains in env.php


texts: Block add to cart action and return to product page

texts:
I need ot check if the user can add the product to the cart and if not return to the product page with an error, I lsten to this event: controller_action_predispatch_checkout_cart_add.
And this is what I have written:

public function checkProductOnAdd(Varien_Event_Observer $observer){
    if(!self::isModuleEnabled()){
        return;
    }

    if($observer->getEvent()->getControllerAction()->getFullActionName() == "checkout_cart_add"){

        $productId  = Mage::app()->getRequest()->getParam('product');
        $collection = Mage::getModel('country/product')->getCollection()
                                                       ->addFieldToFilter('product_id', $productId);

        $country = Mage::getSingleton('core/session')->getRazorphynCountry;

        foreach($collection as $res){
            if(($res->allowed==0 && strpos($res->country, $country) !== false) || ($res->allowed==1 && strpos($res->country, $country) === false)){
                Mage::getSingleton('core/session')->addError(Mage::helper('country')->__("Sorry, this product isn't available in your country"));
                //NOW?
                die();
            }
        }
    }
}

in my config.xml:

<controller_action_predispatch_checkout_cart_add>
    <observers>
        <razorphyn_country_controller_action_predispatch_checkout_cart_add>
            <class>Razorphyn_Country_Model_Observer</class>
            <method>checkProductOnAdd</method>
        </razorphyn_country_controller_action_predispatch_checkout_cart_add>
    </observers>
</controller_action_predispatch_checkout_cart_add>


texts: How to get extension attributes in product list by using api in magento2

texts:
I am using "http://localhost/rest/V1/products" api to get product details but not able to get product quantity in response.

So I searched and found that we can get product quantity with extension attributes.
eg. extension_attributes": {
    "logo size": "small",
    "stock_item" : {
      "status" : "in_stock"
      "quantity": 70
    }
  }
but these are not showing in API response. I am using admin token for authentication.


texts: Is there any different if I upload a large image?

texts: For example I'm gonna upload a 3000x3000 product image and Magento is scaling it down to 1000x1000 or I will upload a 1000x1000 and Magento doesn't need to scale it down. Are there any downsides? I tested the loading times and there were no differents.


texts: Why does my extending block duplicate the content of Mage_Page_Block_Html_Head?

texts:
I've created a module with a block that extends Mage_Page_Block_Html_Head but when I add it to the original head block, it duplactes almost every meta tag like <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> and <meta name="robots" content="NOINDEX,NOFOLLOW" /> and so on.

I just added an item via layout.xml to that block and only that item is rendered in the getCssJsHtml function of my block. But I don't want the rest of the original head block being rendered  twice.

Can somebody tell me how I can get rid of that?

Here is my block code:

class Mr_Global_Block_Head extends Mage_Page_Block_Html_Head
{
    /*
     * override getCssJsHtml, so it doesn't throw an error when no item is added to the block
     */
    public function getCssJsHtml()
    {
        if (!isset($this->_data['items']) || !count($this->_data['items']))
            return '';
        return parent::getCssJsHtml();
    }
}

Here is the initial block xml:

<default>
    <reference name="head">
        <block type="mr_global/head" name="mr.head.scripts"></block>
    </reference>
</default>

And here I add some script to the block (in another xml file):

<default>
    <reference name="head">
        <reference name="mr.head.scripts">
            <action method="addItem">
                <type>js</type>
                <name>mediarocks/yags/jquery-yags.js</name>
            </action>
        </reference>
    </reference>
</default>

My source problem, I want to solve is the following:
I want to add external js too with the addText function that needs a seperate block that is then rendered by the getChildHtml() from the original head block (like described here: https://stackoverflow.com/questions/4654822/adding-external-javascript-file-to-magento#answer-11674174), which is after the getCssJsHtml() function. But I want to make sure that the external js files are added before my internal js files, so I thought I can simply add another head block in the original head block, that is also rendered by the getChildHtml() function..

Thanks in advance!


texts: Magento 1.9 - Can't edit customer in backend

texts:
I have only one customer which is me. I tried to edit the name and I get redirected to the startpage of the backend and the error PHP Fatal error:  Call to a member function setAttribute() on boolean in /srv/www/vhosts/hausfux/app/code/core/Mage/Eav/Model/Attribute/Data.php on line 80 is logged.

This is the line: $dataModel->setAttribute($attribute);

I logged $attribute and get this:

[_oldFieldsMap:protected] => Array
    (
    )

[_syncFieldsMap:protected] => Array
    (
    )

Im not sure what causes this error and how to solve it, please help.


texts: magento 2 createBlock from argument item

texts:
My custom module xml file contains the block code. I want to call that block code directly using createBlock method and set template to show in specific template. My block code is adding animated fancing lines to form.

If i mention in xml using following format then it works fine. How can i display same block using createBlock method?

<referenceContainer name="form.contact.additional.info">
        <block class="Jackson\Wyss\Block\Frontend\Wyss" name="Wyss-reca" after="-"
               template="Jackson_Wyss::wyss.phtml">

            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="wyssdata" xsi:type="array">
                            <item name="component" xsi:type="string">Jackson_Wyss/js/reca</item>
                            <item name="zone" xsi:type="string">contact</item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </block>
    </referenceContainer>

for example:

 $block->getLayout()->createBlock('Jackson\wyss\Block\Frontend\Reca')->setData('jsLayout', '5')->setTemplate('goodtest/test.phtml')->toHtml();

In above xml code zone is form type name. I want to set different name for all the forms in createBlock method. is there anyway we can createBlock method for above xml code?

How can i make createBlock method of my above xml code?


texts: Catalog price rule remains applied on expired date ranges

texts:
I create a catalog rule in my store, and I set a date range.
When this period expires, prices in the store window do not update, only when the customer places the product in the cart. Can anyone help me with this?
I made sure the cron is running every minute.
#~ My Store START

/usr/bin/php /var/www/html/mystore/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/html/mystore/var/log/magento.cron.log

sudo /usr/bin/php /var/www/html/mystore/update/cron.php >> /var/www/html/mystore/var/log/update.cron.log

/usr/bin/php /var/www/html/mystore/bin/magento setup:cron:run >> /var/www/html/mystore/var/log/setup.cron.log
#~ My store END

In the table in the database, cron_schedule, all jobs are completed with status 'success'.
Well, I can only update the store prices after running the commands:

bin / magento indexer: reset
bin / magento indexer: reindex
bin / magento cache / clean

This store runs with Magento v2.1


texts: When trying to edit a configurable product … lost on this error… how to fix it

texts:
Notice: Undefined offset: 0 in
  /home/magento2/www/vendor/magento/module-configurable-product/Model/Product/Type/VariationMatrix.php
  on line 43

Magento 2.2.8


texts:
In Magento 1 I could get the current page layout handle like this

$handle = Mage::app()->getFrontController()->getAction()->getFullActionName();

This would return for example for a product page catalog_product_view or cms_index_index for homepage.

How can I do the same thing in Magento 2?

I need to get a page handle from within an observer. What should I inject in the constructor in order to be able to access it?


texts: Security patch SUPEE-6285 - packages_prepare.phtml hunk FAILED - (SOLVED)

texts:
patching file downloader/template/connect/packages_prepare.phtml Hunk
  1 FAILED at 33. 1 out of 1 hunk FAILED -- saving rejects to file
  downloader/template/connect/packages_prepare.phtml.rej

I apply the patch SUPEE-5994 first as required, but the issue came up anyway.

First solution :

Download a fresh version of magento 1.9.2 and replace your packages_prepare.phtml with the fresh packes_prepare.phtml file from the zip.

Then reapply the patch. Instead of "FAILED" you will have the same issue with "IGNORED" because the file already exist with the right content.

Second Solution :

Download a fresh archive of Magento 1.8.1 here : http://www.magentocommerce.com/download/noregister

Replace your current packages_prepare.phtml file with fresh one from this archive.

Apply the patch again, and it will works.


texts: soap api v1 way to request customer_adress.list for all customers who updated after xxx date

texts:
Is there a way to retrieve the entire list of adresses that have changed after a given datetime?
It now fails because it wishes an user id.
I'd hate have to loop through all the adresses(which are more than 100.000 eventually....)

$this->mage->call('customer_address.list',
     array(
       array(
            'updated_at' => array('from' => '2009-06-10')
            )
          )
      );

and this is the error that is produced

Fatal error: Uncaught SoapFault exception: [101] Customer not exists. in public_html/config/core/magento.php:277 Stack trace:
#0 public_html/config/core/magento.php(277): SoapClient->__call('call', Array)
#1 public_html/config/core/magento.php(277): SoapClient->call('564bdd334d7eab1...', 'customer_addres...', Array)
#2 public_html/modules/magento/controllers/ajax.php(44): MagentoConnect->call('customer_addres...', Array)
#3 [internal function]: ajax->getNewAndChangeCustomers()
#4 public_html/index.php(30): call_user_func(Array)
#5 {main}   thrown in public_html/config/core/magento.php on line 277


texts: Magento2 - how to set item specific delivery dates in same order

texts:
Is it possible to choose different delivery dates for some products alone if they exists in cart? Is Multi-shipping the way to achieve this?

On the Admin panel, click
Stores > Configuration > Sales > Multishipping Settings > Allow Shipping to Multiple Addresses = "Yes"

Please advice on how to achieve this. Thank you in advance.


texts: How to change the default group id when certain condition occurs?

texts:
How can I change the default group id when certain condition occurs?

For instance, the default group id is 1 which is general. But I have a new group which is 4 (memebership).

And I want to set the customer to this group when they are purchasing a club item, I have this code in onepage/billing.phtml

<?php if($orderHasWineClub === true):?>
    <?php Mage::getSingleton('customer/session')->setCustomerGroupId(4); //4 being the customer group id ?>
<?php endif;?>

after this,

<?php if(!$this->isCustomerLoggedIn()): ?>

                            <input type="checkbox" name="billing[create_account]" id="billing:create_account" value="1" title="<?php echo  $this->__('Create your account for later use') ?>"<?php if($orderHasWineClub === true):?> class="required-entry"<?php endif;?>/>
                            <?php echo  $this->__('Create your account for later use') ?>

....
....

But I still get general as my customer group. so I think the code is not working.

Any idea?

I am suing IWD_OPC onestep checkout by they way.


texts:
I am using Codazon Fastest Theme in my Magento 2 Store. I tried to edit the Main Menu. Suddenly I found that Height of Main Menu is increased.

How can I fix it?

Any Codazon Fastest Theme user can help in this regard.


texts: My backend module work in window but not in linux

texts:
when i access the module in my linux server using this link

domain/index.php/AdminLog/adminhtml_adminlog/index/key/0ae0ba00e17e37611025f3cd9f49a395/

it redirect me to frondend and display 404 error, how can i debug this? which files should i post here?

config.xml

<?xml version="1.0"?>

<config>
    <modules>
        <RayMan_AdminLog>
            <version>1.0.0</version>
            <title>Admin log module</title>
        </RayMan_AdminLog>
    </modules>
    <global>
        <models>
            <adminlog>
                <class>RayMan_AdminLog_Model</class>
                <resourceModel>adminlog_mysql4</resourceModel>
            </adminlog>
            <adminlog_mysql4>
                <class>RayMan_AdminLog_Model_Mysql4</class>
                <entities>
                    <adminlog>

admin_log

                    </adminlog>
                </entities>
            </adminlog_mysql4>
        </models>
        <helpers>
            <adminlog>
                <class>RayMan_AdminLog_Helper</class>
            </adminlog>
        </helpers>
        <blocks>
            <adminlog>
                <class>RayMan_AdminLog_Block</class>
            </adminlog>
        </blocks>
        <default>
            <adminlog>
                <general>
                    <enable>1</enable>
                </general>
            </adminlog>
        </default>

    </global>
    <admin>
        <routers>
            <adminlog>
                <use>admin</use>
                <args>
                    <module>RayMan_AdminLog</module>
                    <frontName>adminlog</frontName>
                </args>
            </adminlog>
        </routers>
    </admin>
    <adminhtml>
    <layout>
        <updates>
            <adminlog>
                <file>adminlog.xml</file>
            </adminlog>
        </updates>
    </layout>
    <events>
        <sales_order_invoice_pay>
            <observers>
                <rayman_adminlog_controller_action_predispatch_observer>
                    <class>Rayman_Adminlog_Model_Observer</class>
                    <method>sales_order_invoice_pay</method>
                </rayman_adminlog_controller_action_predispatch_observer>
            </observers>
        </sales_order_invoice_pay>
    </events>
    </adminhtml>
</config>

layout.xml located at "app\design\adminhtml\default\default\layout

<?xml version="1.0"?>
<layout>
    <adminlog_adminhtml_adminlog_index>
        <update handle="adminlog_adminlog_index"/>
        <reference name="content">
            <block type="adminhtml/template" name="adminlog" template="adminlog/adminlog.phtml"/>
        </reference>
    </adminlog_adminhtml_adminlog_index>
</layout>


texts: Magento varien session start very slow on category pages with MEMCACHE session storage

texts:
I am using memcache for session storage and on category pages I have noticed in new relic transactions where varien session start can take over 30 seconds.

It can possibly be something to do with session locking, but I thought this wasn't really an issue when using memcache.

Anybody ever faced this or have ideas what could be causing this.


texts: Set product's category based on its current category children

texts: I have a lot of products on database, and every single one has a single category asociated, now I want to assign every category parent linked with its current category children. For example, in the case of sunglasses, I would like to associate the "Accesories" categories to it, because the current category of sunglasses is "Eyewear", because is the category child of "Accessories". I could do this with 5 or 10 products, but I have hundreds, so I want to do this by code, my little problem now is I can't identify the table with the category parent-children association.


texts: How to read file to string from pub/media directory?

texts: I want to read a html file to string that is located in the pub/media directory, how should I do it?


texts: Magento 2.1.8: How to get Name on Card for my Payment Module

texts: I'm trying to populate credit card details form from Magento/Payment module. This module doesn't show me Name on Card. How do I populate this field?


texts: Magento 2 How to add Product Review Form to Popup?

texts:
I want to add a Popup for product review form.

I was able to create pop up with js:

define(
    [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function ($) {
        "use strict";
        //creating jquery widget
        $.widget('vendor.modalForm', {
            options: {
                modalForm: '#modal-form',
                modalButton: '.open-modal-form'
            },
            _create: function () {
                this.options.modalOption = this._getModalOptions();
                this._bind();
            },
            _getModalOptions: function () {
                /**
                 * Modal options
                 */
                var options = {
                    type: 'popup',
                    responsive: true,
                    title: '',
                };

                return options;
            },
            _bind: function () {
                var modalOption = this.options.modalOption;
                var modalForm = this.options.modalForm;

                $(document).on('click', this.options.modalButton, function () {
                    //Initialize modal
                    $(modalForm).modal(modalOption);
                    //open modal
                    $(modalForm).trigger('openModal');
                });
            }
        });

        return $.vendor.modalForm;
    }
);

I need to make it work to were when people click link it shows the review form:

Here is my html for the .phtml file:

    <?php include ($block->getTemplateFile('Magento_Review::form.phtml')) ?>
    // here should go the code for the form

    Review Product

Any Suggestions to make this work?

I added the code: <?php include ($block->getTemplateFile('Magento_Review::form.phtml')) ?>  but it doesn't bring the product form it shows as if I had to register or login to create the review. Is there a way to pass the product id variable? I have that on my .phtml


texts: How to move notification message top of the page for all page

texts:
I am trying to move all notification message on the top below header(or any specific location)

I followed this link but this only achieve top for customer page only

  Magento 2: Change message location

So that means to place message at the top (below header) i have to each and every xml file of every module?

Is there any shorthand for the same, for all pages.


texts: Magento 1.9: Show my Additional Information Details into Short Description Section

texts:
My additional information :

  app\design\frontend\default\theme327k\template\catalog\product\view\attrubutes.phtml

        <col width="25%" />
        <col />

            <?php foreach ($_additional as $_data): ?>

                    <?php echo $this->htmlEscape($this->__($_data['label'])) ?>
                    <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

            <?php endforeach; ?>

I want to add my additional information into my short description section :

  app\design\frontend\default\theme327k\template\catalog\product\view.phtml


texts: Share database/backend changes with team

texts:
We are normaly sharing source code with others using version controlling system. Is there any way to sharing database changes/admin changes with others using version controlling system or any other system? I'm using magento 2.1 and svn

Thanks


texts: Magento 2 - Load .css file on checkout page

texts:
I need to load the css file THEME\Magento_Checkout\web\css\checkout\index\index.css in the checkout page only.

So I created the file THEME\Magento_Checkout\layout\checkout_index_index.xml and added a layout instruction:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Magento_Checkout::css/checkout/index/index.css"/>
    </head>
</page>

I can see in the source code that it tries to load the script, but if I open it then I get

  Compilation from source: LESS file is empty:
  frontend/company/base/de_DE/css/checkout/index/index.less


texts: How to view related products for all products in compare list?

texts:
I want to add the related products block to the compare list, however I am getting a fatal error Call to a member function getRelatedProductCollection() on a non-object.

I suspect this is because I am trying to view related products on a non-product page, therefore Mage::registry('product') is null.

How do I add related products for all products in my compare list in one block?

[edit]

I have decided to extend the related products block and create the collection myself.

Doing a var_dump on $this->_itemCollection->count() is giving me 0.

protected function _prepareData() {
    //compare products list
    $_products = $this->getLayout()->getBlockSingleton('Mage_Catalog_Block_Product_Compare_List')->getItems();

    //get related products for all products in compare list
    //more or less copied from @see Mage_Catalog_Block_Product_List_Related::_prepareData()
    $this->_itemCollection = Mage::getModel('catalog/product')->getLinkInstance()
        ->useRelatedLinks()
        ->setGroupBy()
        ->getProductCollection()
        ->setIsStrongMode()
        ->addAttributeToSelect('required_options')
        ->setPositionOrder()
        ->addStoreFilter()
        ->addProductFilter($_products)
    ;
    var_dump($this->_itemCollection->count());die; //returns 0
    $this->_addProductAttributesAndPrices($this->_itemCollection);
    Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);

    $this->_itemCollection->load();

    foreach ($this->_itemCollection as $product) {
        $product->setDoNotUseCategoryId(true);
    }

    return $this;
}

By trial and error, when I remove setIsStrongMode and addProductFilter the collection count returns my total product count.

For testing purposes, only one of my products has related products so I know the expected output should be '3' (this product has three related products).


texts: Magento2: Do we need to run set up upgrade command each time to see any changes?

texts:
I have created an observer controller_action_predispatch that should call on each time page load.

Its working fine but only for the first time page load. After that i have to run command php bin/magento setup:upgrade to make it work again.

This doesn't seems correct.

events.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="controller_action_predispatch">
    <observer name="akhil_event_observer_eachpageload" instance="Akhil\Event\Observer\EachPageLoad" />
</event>
</config>

EachPageLoad.php

<?php
namespace Akhil\Event\Observer;

use \Psr\Log\LoggerInterface;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

 class EachPageLoad implements ObserverInterface
{

protected $logger;

   public function __construct(LoggerInterface $logger)
{
    $this->logger = $logger;
}

public function execute(Observer $observer)
{
    $this->logger->warn('PAGE Loaded..!!');
}
}


texts: Magento 2, how to do getViewFileUrl in html file

texts:
In phtml file I use

<img src='<?php echo $this->getViewFileUrl('images/logo.png'); ?>'

How to do same in html file ?


texts: Date formats interpreting “european” date format DDMMYY for “American” format MMDDYY

texts:
Could some one please let me know the reason of this happpening that sometimes European date format is being taken in the customer database instead of American.

We have selected the time zone as PST in the locale under configuration.

This happens only in few cases.


texts:
I am trying to filter with multiple category and custom attribute but the code its not working please let me know whats wrong with my code

$type1=array();
foreach($_REQUEST['type'] as $tyof)
{
$implodetype=$tyof.',';
$type1[]=$implodetype;
}
foreach($type1 as $categoryid){
$category = Mage::getModel('catalog/category')->load($categoryid);
// get product collection, filter it by category,
// add the color attribute to select to be able to filter using it later
$obj = Mage::getModel('catalog/product')
->getCollection()
 ->addAttributeToSelect('*')->addCategoryFilter($category)
->addAttributeToFilter('product_location', array('like' => '%'.$location.'%'));
$_product = $obj->load($product_id); // Enter your Product Id in $product_id
$prdId1s[]=$_product;
}


texts: I am unable to get checkout as guest in checkout page

texts:
When I click proceed to checkout on cart page and redirect to checkout page it only shows
"Login
Already registered?", I also want checkout as guest there but I am unable to show it. Please help me how can I show checkout as guest functionality on checkout page.
Thanks in advance.


texts: move / copy mass number of products to other categories

texts:
I have a large number products that I need to move or copy to other categories in Magento 1.9.1.1.  How is this possible?

Is this also possible through database? If it is, which table(s) should modified?


texts:
How to write if condition in below script

<script id="some-template" type="text/x-magento-template">
    <div class="wrapper">
if(data.id == 10) {
        <input id="<%- data.id %>" name="<%- data.name %>" placeholder="<%- data.placeholder %>" />
}
    </div>
</script>


texts: Question about specific product configuration (type, abilities...)

texts:
I would like to have following (maybe simple, but i don't know):

Create a set-product containing simple products.
Set-product has no options.
Set-product should have inventory shared with simple products.
Set-product should have its own price and everything else custom like its a simple product itself.

Can this be done with bundle?

Thx


texts: Get Grouped Products Associated Child Product Custom Attribute

texts:
I've created a few product attributes with these settings:

Scope: Store View
Add to Column Options: Yes
Visible on Catalog Pages on Storefront: Yes
Used in Product Listing: Yes
Used for sorting in Product Listing: Yes

In my grouped product, I have a value:

[![enter image description here][1]][1]

But, in my custom /design/frontend/Vendor/Theme/Magento_GroupedProduct/templates/product/view/type/grouped.phtml file, I've got this:

<?php
    $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/trey.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);

    foreach ($_item->getAttributes() as $attr)
    {
        $logger->info(
            $attr->getAttributeCode(). ': '. $attr->getFrontend()->getValue($_item)
        );
    }
?>

Which produces these (skimmed) results in the log file:

2019-12-03T10:23:01+00:00 INFO (6): entity_id: 228
2019-12-03T10:23:02+00:00 INFO (6): type_id: simple
2019-12-03T10:23:02+00:00 INFO (6): attribute_set_id: 4
2019-12-03T10:23:02+00:00 INFO (6): status: Enabled
2019-12-03T10:23:02+00:00 INFO (6): name: Bulb 501 w5w 12v
2019-12-03T10:23:02+00:00 INFO (6): sku: BULB-501-SIN001
2019-12-03T10:23:02+00:00 INFO (6): price: 1.1900
2019-12-03T10:23:02+00:00 INFO (6): ref_code:
2019-12-03T10:23:02+00:00 INFO (6): image_ref:
2019-12-03T10:23:02+00:00 INFO (6): required:

As you can see, ref_code, image_ref and required is empty, but I'm not sure why as the values are there in the database. I've tried re-indexing fully and clearing cache via rm -rf /var/cache/*

The methods listed in:

Magento 2: How to display custom attribute in catalog
Magento 2: Get custom attribute value of product

didn't work.

I didn't try the Object Manager method as I don't wish to use it as I know it's not the right way to go.

Edit:

snappy of my attribute:

Edit 2:

I created a module as advised, but couldn't get it 100%. This is the code I implemented:

|-app
|-----code
|---------Vendor
|-------------Module
|-----------------etc
|---------------------frontend
|-------------------------di.xml
|---------------------module.xml
|-----------------Plugin
|---------------------Model
|-------------------------Product
|-----------------------------Type
|---------------------------------Grouped.php
|-----------------registration.php

  di.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\GroupedProduct\Model\Product\Type\Grouped">
        <plugin name="addAttributes" type="Vendor\Module\Model\Plugin\Product\Type\Grouped" />
    </type>
</config>

  module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="0.0.1">
        <sequence>
            <module name="Magento_Catalog" />
            <module name="Magento_GroupedProduct" />
        </sequence>
    </module>
</config>

  Grouped.php

namespace Vendor\Module\Model\Plugin\Product\Type;

class Grouped
{
    /**
     * @param $subject
     * @param $result
     *
     * @return mixed
     */
    public function afterGetAssociatedProductCollection($subject, $result)
    {
        $result->addAttributeToSelect('*');

        return $result;
    }
}

  registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Vendor_Module',
    __DIR__
);


texts: copy column value from `sales_shipment` to `sales_shipment_grid`

texts:
I create custom attribute("custom_feild") in sales_shipment table and save value.
And also make attribute("custom_feild") in sales_shipment_grid.
How can copy data from custom_feild of sales_shipment table into custom_feild of sales_shipment_grid table ?


texts:
I have a mysterious cron job that appears once per day in my cron_schedule table. I have spent several hours studying the problem, and I have linked this cron job to an extension that I installed many years ago. I am 100% sure that this cron job is associated with that extension.

But it's not that simple. I removed every single file from this extension several years ago. Since then I have migrated my database and themes to several new clean installs on different servers. Naturally I have flushed my caches hundreds of times since I uninstalled this extension.

Because this extension's files are gone, Magento writes an error message into system.log every time it tries to executes the job, because the associated model file does not exist. The message is along the lines of:

  ERR (3): Warning: include(Mage/REDACTED/Model/Observer.php): failed to
  open stream: No such file or directory

Note that I have redacted the name of the module above because it is a commercial module and I do not want to mention the developer here.

In cron_schedule, the cron job is flagged with an error status and the following message appears after attempted execution:

  exception 'Mage_Core_Exception' with message 'Invalid callback: REDACTED/observer::someRedactedFunctionName does not exist'

Here's what I have done to try to exorcise this ghost from my system:

Used folder diff to ensure every file from the extension has been deleted
Purged all db tables created by the extension
Removed all db entries associated with this extension from core_config_data and core_resources
Ensured there are no old compilation files under includes/src
Flushed caches a million times
Did text searches on the entire directory system looking for references to this missing file / module
Checked every config.xml file in my system with a <crontab> tag

I just cannot find where this cron job is coming from. Is there any way to debug the system overall to record the origin of each cron job in a log file?


texts: How do I consume the REST API in Magento 2, using AJAX with session-based authentication?

texts:
I am having issues successfully making an AJAX call to Magento 2 REST API endpoints, using session-based authentication.

When I run the following javascript, I always receive a 401 (Not Authorized) error.

I am logged into the admin area as a user with all ACL privileges.

Here is the code that I am using to test the API:

require(['jquery'],function($){
    $.ajax({
        url: '/rest/V1/customers/1',
        type: 'get'
    });
});

From what I can tell, by reading the Magento 2 docs, session-based authentication for the admin area, should work.

http://devdocs.magento.com/guides/v2.1/get-started/authentication/gs-authentication-session.html

Can someone please tell me if it's possible to consume the API this way, and how to get it working correctly.

Thanks.


texts: How to save custom attribute in Magento module

texts:
I have this hidden input that I am submitting along with my checkout form:

<input id="text_value" type="hidden" value="This is a test Value" name="text_value"></input>

I was wondering How I could save this value to my custom attribute field I have saved in Magento. I already have the attribute created in the attribute tables, and I already created some columns for the attribute in the quote_item table, the order table, and a couple others. Using this code, and observer I am able to save the entered text to the quote_item table, but I'm unable to fetch any values from the product page itself when they add an item to the cart

Config observer:

<sales_quote_item_set_product>
    <observers>
        <m_p>
            <class>m_p_Model_Observer_Quote</class>
            <method>salesQuoteOptions</method>
        </m_p>
    </observers>
</sales_quote_item_set_product>

Observer function contents:

$quoteItem = $observer->getQuoteItem();
$product = $observer->getProduct();
$quoteItem->setMuProductembroideryOptions('TEST VALUE');

Using the above code I was able to save "TEST VALUE" to my custom attribute column in the quote_item table when I clicked the add to cart button. I would like to do this exact thing but using the hidden input box as my value. I already tried fetching the post request and looking for "text_value" in the request, but nothing comes up. Any help would be great


texts: InstallScheme Script for dynamic rows Magento 2

texts:
I have created dynamic rows on product creation form. I have to save their value in custom table and retrieve as a dropdown on frontend product detail page w.r.t product ID.
I am aware of the event

  catalog_product_save_after

All I want to know is how to save these values into table (the installschema script) and get values on frontend.
 My dynamic rows are in screen shot for more clear understanding.


texts:
Can we create virtual quote and copy all current quote data into it ?
I wanna create a copy of quote data and remove or edit current quote data .
What is best solution for this


texts:
I have just made a fresh magento 2.0 install. However, all styles and images seems to me missing. Can I fix this without reinstalling?

Demo: http://tiny.cc/80t27x

Thanks!


texts: Product page Image Gallery Loading Issue

texts:
I'm getting images of product and using custom slider to load the product images in product details page,

The product is loading normally but sometimes when we refresh the page, Images wont showup. In HTML image URLs will be there, but it wont show up in the frontend. In console I'm getting only below error.

Uncaught TypeError: Cannot read property 'concat' of undefined
at jquery.mobile.custom.js:44
at jquery.mobile.custom.js:523
at jquery.mobile.custom.js:15
at Object.execCb (require.js:1650)
at Module.check (require.js:866)
at Module.<anonymous> (require.js:1113)
at require.js:132
at require.js:1156
at each (require.js:57)
at Module.emit (require.js:1155)

since this error is related to jquery mobile and showing in every page, I assume this is not the cause.
The issue is is arising sometimes, not every time. once i refresh the page images are loading properly.

Tried fushing chache, clear browser cache, etc.. nothing helped.

You can check the error in below website

https://mytraveller.shop

Since there are no error from JS end, I'm undable to figure out the issue.

Thanks.


texts: Cms homepage not showing correctly in magento2

texts:
I have some issue in mgento2. Everything running fine but suddenly Homepage not show correctly only one products show. I have checked in inspect element and find no any file in  also other pages are working fine like category page,search page etc..but homepage not show.

Also i have flush cache as well reindex but homepage not work.

Any idea what wrong with it?


texts:
How can I execute Cron from command line manually.

In Magento 1.x we can run cron like :

www.testsite.com/cron.php

but in magento 2 how can I do this ?

Please also help me for how can I execute cron from cmd. I already used below command which is not working :

sudo php bin/magento cron:run [--group="customgroupname_cron"]

This is returning exception :

[RuntimeException]
Too many arguments.

cron:run [--group="..."] [--bootstrap="..."]

------- Update -------

crontab.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">

    <group id="customgroupname_cron">
        <job name="customgroupname_cron" instance="Namespace\Modulename\Cron\Customcronjob" method="execute">
            <schedule>* * * * *</schedule>
        </job>
    </group>
</config>

In execute method of above file I put log. But after 1 minute also that is not generated.So how can I came to know that my method is executed.


texts: CE 1.8 - attribute with 2 values display in additional information

texts:
I am working on Ceramic website, and my Client want to display the Technical details of their products. The challenge is that each Technical specification has 2 values, additional information tab would displayed in 3 columns.

e.g.

Characteristics    Standard Value   KIT Value

1) Dimension       + 0.5 %          + 0. %

2) Thickness       + 0.6 mm         + 0.2 mm

How do I create attribute and publish in product detail page in additional information tab? Or any other way?

Thank you in advance.


texts: Magento 2 Create custom adminhtml form to save data

texts:
I am trying to capture one information from admin panel through a custom form .
In admin dashboard I have a link which on click will redirect to a controller .
 $html .= '<button type="button" class="scalable back" onclick="redirectLocation(\'' . $this->getUrl('mpadmin/marketplace/sellerAccountEnable', ['id' => $data['entity_id'],'status'=>$sellerStatusData]) . '\')">' . __($sellerText) . '</button>';

In controller if it finds that $sellerStatusData ie the status is 0 , I want it to redirect to a seperate adminform to  get the reason for 0 from the admin user . That is capture a comment and store in database .
Which approach would be better . i have created the UI component but not seems to be working .
 if($getData['status']==0)
                {
redirect to form ,capture the comment , store it with id and status
}


texts:
I have created a new page template here:

/template/page/category.phtml

and copied inside the content of 1column.phtml.

What I want to accomplish is to get the category data variable in this new template.

Any help would be greatly appreciated.

<html>
<head>
<?php echo $this->getChildHtml('head') ?>
</head>
<body>

<!-- Instead of getting the category content through the function below, I want to get it without this function-->
<?php echo $this->getChildHtml('content') ?>

</body>
</html>


texts: I am getting an error as invalid template file when i tried to add a custom payment method in custom module file

texts:
Invalid template file: 'RW_CustomPaymentMethod::info/custompaymentmethod.phtml' in module: 'RW_CustomPaymentMethod' block's name: 'info\custompaymentmethod_0'

Should we declare this template somewhere else too.
And also in view folder, i have only adminhtml folder no frontend folder as this payment method has to be only from admin panel.


texts: New order emails from Paypal are sending twice

texts:
I'm using Magento 1.7.0.2 and I'm having a problem with New orders emails when the payment is done through Paypal only.

The email is arriving twice to the warehouse and it is complicating things.

In my configuration is set as "CC"

What could be the problem?


texts: Programatically saving customer and address in the same controller

texts:
Is it possible to save the customer details as well as the address details in the same controller? When I try, it fails saying "customer email is required".

Here's my code:

$customer = Mage::getModel("customer/customer");
$customer   ->setWebsiteId($websiteId)
        ->setStore($store)
        ->setFirstname('John')
        ->setLastname('Doe')
        ->setEmail('jd1@ex.com')
        ->setPassword('somepassword');

$address = Mage::getModel("customer/address");
$address->setCustomerId($customer->getId())
    ->setFirstname($customer->getFirstname())
    ->setMiddleName($customer->getMiddlename())
    ->setLastname($customer->getLastname())
    ->setPostcode('Test')
    ->setCity('Test')
    ->setTelephone('01234567890')
    ->setFax('01234567890')
    ->setCompany('Test')
    ->setStreet('Kersov')
    ->setIsDefaultBilling('1')
    ->setIsDefaultShipping('1')
    ->setSaveInAddressBook('1');

try {
    $customer->save();
    $address->save();
}
catch (Exception $e) {
    Mage::getSingleton('core/session')->addError('There has been a problem with your registration. ' . $e->getMessage());
}

If I comment out $address->save() it successfully saves the customer (but obviously not the address).


texts: Add to cart ajax not working with secure and unsecure url

texts:
All Ajax is working perfectly when we are using secure base url = https or http and unsercure base url = https or http.

When we add secure base url = https and unsecure base url = http. Now we have access store using https, Ajax working perfect. But we are using http, ajax not working.

Thanks in advance.


texts: Add Qty to Product before adding to cart

texts:
I am looking for an event observer which is suitable for my requirements.

My requirement is I add to cart the product but qty I want to add to this cart will be decided by the product attribute.

I will be having a custom attribute called attribute1 which will have an integer number.

So when I add to cart the product, I will get the attribute and number which is defined in it and I set this number as a qty to the product which is getting added to cart.

So following are the observers I tried, but not getting any success
 checkout_cart_product_add_after and I am looking for event something like checkout_cart_product_add_before but it seems not their.

Please help me.


texts: where in Magento core is the logic between category active means show products, and inactive means show a 404?

texts:
We have a well-established instance of Magento 1.4 running, though guys before me have modified core files which is unfortunate.

For a category, under Catalog > Manage All Categories > General Information, if I set "Is Active = yes", then the catalog/category list page is rendered.

If I set "Active = no", then a "404" page is rendered.

I want to modify the logic (by extending core) that does that just slightly, to say this:

if('category is active OR a special viewing cookie is set'){
    //render the list page
}else{
    //show the 404 page as you normally do.
}

Where is this located?  I would think it's pretty deep inside core.

== EDIT ==

Just wanted to re-state my comment to the accepted answer, the canShow() method leading to getIsActive() is where the decision is made.  Override that, and it appears the category page will show exactly as it otherwise would if the category was active.  Magento appears to make no further checks beyond that point.

I can't vouch for that in every instance or if category relationships are more complex though.


texts: Is there an easy way to convert Magento module name to composer names and vice versa?

texts:
I am in a process where I want to compare two columns in my spreadsheet. The problem is one column has Magento module names (like Magento_Swatches). The other one has composer names (like magento/module-swatches).
Question: Is there an easy way to convert those name this without manual work?
Magento_Swatches to magento/module-swatches
magento/module-swatches to Magento_Swatches


texts: Add configurable products to cart display waring message instead of redirecting

texts:
In magento 2, by default, if I try to add configurable products to cart when not selecting any swatch values, I will be redirect to product page.

How can I prevent this and display a message like in product detail page instead of redirecting?