texts: How to fix "Call to a member function setTitle() on boolean"?

texts:
I'm developing a module, which was working fine on my local environment, and today I was testing it on my online store and a certain view from my module is returning 500 from Nginx. Here is what shows on the log:

  2017/03/12 16:02:55 [error] 1156#1156: *65909 FastCGI sent in stderr:
  "PHP message: PHP Fatal error:  Call to a member function setTitle()
  on boolean in
  /var/www/magento/htdocs/app/code/core/Mage/Customer/Block/Form/Register.php
  on line 43" while reading response header from upstream, client: ,
  server: fingerstore.com.br, request: "GET
  /chatbot/chatdata/telegram/webhook/r43u9ukey HTTP/1.1", upstream:
  "fastcgi://127.0.0.1:9000", host: "store.com"

And here is my controller:

class Werules_Chatbot_ChatdataController extends Mage_Core_Controller_Front_Action {
    public function telegramAction()
    {
        $this->loadLayout();
        $this->getLayout()->getBlock('root')->setTemplate("werules_chatbot_view.phtml"); // use root block to output pure values without html tags
        $this->renderLayout();
    }

This view is a webhook for Telegram/Facebook chat integration, and that's why I'm using the root block to output a blank page with no HTML. This is required by Facebook Messenger API. But I also tried to remove the line that sets the root block, but it didn't worked.

How can I fix this? I'm on it for hours now.

EDIT: So I found out the problem, I had another module that was putting a block (customer_form_register_ajax) in every Magento page. I fixed it by adding <remove name="customer_form_register_ajax" /> to my XML file. But that's a mare workaround, is there a way to remove all blocks, custom or not, from my module page? Like overrite everything?


texts: Magento 2 - Session based authentication doesn't work

texts:
I don't know if this is a bug in Magento 2 API or not, so I didn't post it on Magento 2 Github issues.

According to this link: http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-session.html:

  Customers can access resources that are configured with anonymous or
  self permission in the webapi.xml configuration file.

I tried login Magento 2 storefront, then I went to magento_host/rest/V1/customers/me on the browser (which has "self" permission), I still got error

  Consumer is not authorized to access %resources

I tried to create a custom API which also has "self" permission, I got the same error.

I'm using Magento 2.1.7.

Anyone know why?
Thank you.


texts: How to add column in customer group table using script?

texts:
We need to add 3 more column in the customer group table.

How to add it using script?


texts: How can I redirect 404 page to home page?

texts:
Can anyone let me know how can I redirect 404 page to the homepage?
I want to redirect any not found page to home page.


texts: Getting Fatal error: Call to a member function setUrl() on null in Magento 1.9

texts:
Fatal error: Call to a member function setUrl() on null in
  /app/code/local/Ced/CsProduct/Block/Media/Uploader.php on line 37

I'm using the below code

$this->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/*/upload'));


texts: Hi i would need a custom table rate for Magento 2. The CSV file should be with these fields (Country, Region/State, ZIP/PostalCode, ProductSKU, ShippingPrice). Is there a way to do it without buying a module? In the attached file there is an example of what i need.


texts: How to get all active categories and subcategories in product listing page?

texts:
My categories and subcategories hierarchy to a product listing page :

Products

Refrigerator

back-bar fridges

Product listing(here)

Now, what i'm trying to get is while i'm in product listing page i want to get all the parent categories and subcategories with respective links.

I got answer from this question
But, i failed to get all parent items (subcategories and subcategories)

$path = $category->getPath();
What i get is : 0(root)/2(Magento root)/444(products)

And it escapes all the middle subcategories. In my case it escaped Refrigerator/backbar fridges


texts: Magento 1.9.2.1 unable to print invoice PDF

texts:
To give a bit of background, I've upgraded my Magento from 1.4.1 to 1.9.1 then to 1.9.2.1. Since then I've applied all of the patches needed including the patch that address's php 5.4. I've checked all frontend functionality through on my site and it's working fine. All of my dashboard function work fine apart from the print invoice

Here is an example of the url

siteurl/index.php/admin/sales_order_invoice/view/invoice_id/10058/order_id/10258/key/website-key

But instead of downloading the invoice I get a webpage with a lot of text that looks like it's firing a long line of error code. It looks to be over 5000 lines long.

Array ( [0] => Zend_Pdf_Page Object ( [_dictionary:protected] => Zend_Pdf_Element_Object Object ( [_value:protected] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] => Array ( [Type] => Zend_Pdf_Element_Name Object ( [value] => Page [_parentObject:Zend_Pdf_Element:private] => ) [LastModified] => Zend_Pdf_Element_String Object ( [value] => D:20150910113836+00'00' [_parentObject:Zend_Pdf_Element:private] => ) [Resources] => Zend_Pdf_Element_Dictionary Object ( [_items:Zend_Pdf_Element_Dictionary:private] =>

This is just a small snippet of the code on my page. Can anyone help?


texts: I've added and removed some of the links that come in the footer e.g. privacy policy, search terms, order etc and added some custom links but can't figure out how to order them the way I want. Currently the Magento 2.1 links sit on top of my added links.


texts: Magento 2, How to override a layout template from a thirdy-party module with another custom module

texts:
To clarify, I have two(2) modules. One provided by a third-party vendor and one I have created.
The first piece of code is from the third-party vendor setting the "default" success_message.

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<container name="root">
    <block class="Magento\Catalog\Block\Product\View" as="thirdpartyvendor_success_message"
           template="Thirdpartyvendor_Module::thirdpartyvendor_success_message.phtml">
    </block>
</container>
</layout>

I have a custom product page being loaded where I need to override the thirdpartyvendor_success_message.phtml with custom_success_message.phtml inside my custom page layout. I have tried overriding the block(thirdpartyvendor_success_message) with a referenceBlock and setTemplate method as detailed below but this does not work.

<?xml version="1.0"?>
  <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>

    ...

      <referenceBlock name="thirdpartyvendor_success_message">
        <action method="setTemplate">
        <argument name="template" xsi:type="string">Mycompany_Module::custom_success_message.phtml</argument></action>
      </referenceBlock>

    ...

  </body>
</page>

Any advice on where I am going wrong would be greatly appreciated.


texts: Magento 2 render duplicated products in category page

texts:
I want to show duplicate products on category page based on visual swatch attribute.

For example:

  an configurable product has color swatch with 3 colors

It must render it 3 times on category page (can be in different order) but on product page (on those products) it must open main configurable product with pre selected color swatch.

Is there a way to do it?


texts:
Is it possible to start an indexing process and then deliberately pause it maintaining the processing status for testing purposes?

The example in specific that I am trying to debug is a rare occurrence during which Product Prices index becomes stuck during processing and stops product saves from occurring due to SQL deadlocks & serialization failures.

I'd like to simulate this behaviour so that I can test potential solutions for the problem (i.e verifying var/locks directory & attempt an event-observer approach to stop the serialization failure issues)


texts:
Whenever I try to save an email template I get this:

  Fatal error: Call to undefined method
  Mage_Adminhtml_Helper_Data::hasTags() in
  /app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php
  on line 133

How can I fix this error?


texts: Magento2 how to prevent loading 10k products on category page?

texts:
our website is having 200000 products. One category is having 122000 products.
when user load that category page it's fetching 10k products in one short(magento is limiting it to 10k instead of 122k products).

How to change this 10k products limit to 500 products on that category page?


texts: Add quantity input to product detail page

texts:
I have an 1.5 Magento shop without quantity fields on the product detail pages. I can only add one product to the cart by pushing the addtocart button.

Now I added an input and label above my addtocart button. The input field has the name "qty". I found it in newer templates from 1.9.
As far as I can see the addtocart button has a JavaScript onclick. The new input field seems to has no effect.

What am I missing? Do I have to modify the onclick JavaScript? In newer versions the template has also no changes.


texts: Magento 2 custom module shortened url with query string goes 404

texts:
I have a custom controller page :

http://dev.test/myfrontend/

The above works fine. also the bellow one works

http://dev.test/myfrontend/index/index/

Now if I add query string:

http://dev.test/myfrontend/index/index/viewid/2

this loads the page fine and I can get parameters fine

But if I load like the this:

http://dev.test/myfrontend/viewid/2   // It fail Miserably goes 404

This should work without adding /index/index !

Does anyone have nay idea ?

Thanks


texts: How will the selected layered navigation apply to all categories?

texts: I have a set of attributes which can be filtered with layered navigation. But when I set the filter in one category it should stay when I list the products in another category. But unfortunately I have to set the filter again when changing to another category. How can I solve this? Thanks


texts: How to update product position according to the sku in specific category programmatically

texts:
We have set the products position according to the sku in excel work sheet.
for example:
sku-1 | 1 , sku-2 | 2
.....
because we have thounsands of product in a specific sku, so we hope we can do this programmatically.


texts: Magento 2: filter results by date, ->addAttributeToFilter

texts:
I am using the object manager (directly and intentionally) to get the sales quantity of a product.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product_id = 101;
$sold_products = $objectManager->get('Magento\Reports\Model\ResourceModel\Product\Sold\Collection')
                             ->addOrderedQty()
                             ->addAttributeToFilter('product_id', $product_id)
                             ->getFirstItem();

This successfully allows me to get the quantity sold of a product by passing in the product ID to the attribute filter. Now I want to filter the results by a starting and end date...

$start_date = '2001-12-12 12:12';
$end_date = '2019-12-12 12:12';

... by adding this to the object manager parameters:

->addAttributeToFilter('created_at', array('from' => $start_date,'to' => $end_date))

But I can't seem to get this code to work. How do I filter results by a starting and end date?

EDIT: Workaround solution -
The accepted answer works perfectly, however I ended up having to use the following workaround, which is a little slower but works perfectly fine too. Posting in case it helps anyone in a similar situation.

$salesRepository = $objectManager->get('\Magento\Sales\Model\Order\ItemFactory');
$sold_products = $salesRepository->create()
                                 ->getCollection()
                                 ->addAttributeToFilter('product_id', $product_id);

foreach ($sold_products as $sold_product) {
    $created_at = $sold_product->getData('created_at');
    if ($created_at < $start_date || $created_at > $end_date) {
        continue;
    }
    echo $created_at."<br>";
}

This will get you only the products within the specified date range.


texts:
I'm trying to get the subtotal of my cart in a variable. However, I need the subtotal including tax and at the moment it gives me the subtotal without the tax. This is my code:

 var second_number = <?php echo Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal(); ?>;

Any help?


texts:
I have a two websites I just merged to be one magento2.2.5 based multi-site. One website but multi-store views. Now when I login as one of my test customers on one website view it works however if i test logging into the site as a customer on another store view I get a blank white page and when I view my server error log I see the below.

Allowed memory size of 792723456 bytes exhausted (tried to allocate 12288 bytes) in /vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 291

However this is a aws ec2 server that has 60Gig of RAM so idk why or how I could be out of memory . the sites worked fine when they were independent.

Suggestions for how i can troubleshoot what might be causing the memory issue?


texts: How to display template file in popup model in Magento2?

texts:
I want to show phtml file inside popup on click of a button but it shows by default open how to resolve it anyone has an idea ?? I want to open when I click on button

    Notify Me

                <?php include ($block->getTemplateFile(Vendor_Module::notifyoutofstcoks.phtml')) ?>


texts: Magento 2 checkout input field validation possibility

texts:
I have searched in web two days how to validate checkout fields without any luck. All the research I have made have risen some questions because tutorials I have found are all about custom-form validation.

When I add additional fields to checkout step below or before shipping-method, inside already existing form and I want to validate them to be required. Can I add only the fields needed or should I add the fields with form element? All the tutorials and Magento 2 official documentation are teaching to validate forms but no where is any reason why forms should be used?

Is it even possible to validated single input field inside Magento already existing form? I know I can add input fields without form and get the information in admin section without any issues if the field can be left blank but otherwise.

Example: I add the input field inside shipping method form below the radio buttons as additional field and I want alert to be raised when customer has not filled the field when next button is clicked?

Additional questions (not required): Can anyone suggest steps I should make to find out(debug...) how Magento 2 denies customer to go on, if required fields are not filled? I have tried chrome dev-tools, but i am beginner using it. How to find last executed if statement (based on assumption)?


texts: I want to create a custom page in magento (that is a simple php page unrelated to magento) but I want to use magento's admin authentication to let anyone access that page. How can I do that?


texts: Magento 2 : I need to change add to cart success message after adding product into cart through plugin

texts:
I need to change add to cart success message after adding product into cart through plugin.

Currently i have used below code for override cart method and its working fine.

<preference for="Magento\Checkout\Controller\Cart\Add" type="CustomPackage\Checkout\Controller\Magento\Checkout\Cart\Add" />

but i need to go through plugin so how can i do that ?
I seen some documentation and in plugin its used aroundExecute method.

so i don't understand that how my code execute without use Add method ? and how can i edit success message ?

I need to below message :

    $message = __('This Product has been added to your Shopping Cart.
    Click here to view your Shopping Cart.
    or you can Continue Shopping. close', $this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl(),$this->_storeManager->getStore()->getBaseUrl());
    $this->messageManager->addSuccess($message);

any idea please share.


texts: Custom Extension - empty observer on sales_order_save_after causes 502; checkout redirects to Cart

texts:
I'm trying to build a custom extension for an existing Magento setup which will fire on the sales_order_save_after observer.

With the extension disabled, the checkout completes fine, going through to the success page. The only thing HTTPfox records is a single successful call to:

/sgps/payment/onepageSaveOrder/?SID=<removed> - {"success":"true","response_status":"OK"}

With the extension enabled, the checkout seems to go through OK, but returns to the Cart - the order is not saved. HTTPfox records the same URL is called, but returns an Nginx 502 error:

<title>502 Bad Gateway</title>

502 Bad Gateway

nginx/1.6.2

This is what comes up in my error log:

2015/08/06 12:31:02 [error] 29163#0: *240923 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: <removed>, server: <removed?, request: "POST /sgps/payment/onepageSaveOrder/?SID=o$

This is the relevant config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <WS_FirstOrder>
            <version>0.0.4</version>
        </WS_FirstOrder>
    </modules>
    <global>
        <models>
            <ws_firstorder>
                <class>ws_firstorder/observer</class>
            </ws_firstorder>
        </models>
        <events>
            <sales_order_place_after>
                <observers>
                    <first_order_handle>
                        <class>ws_firstorder/observer</class>
                        <method>handleCustomerFirstOrder</method>
                        <type>singleton</type>
                    </first_order_handle>
                </observers>
            </sales_order_place_after>
        </events>
    </global>
</config>

I've tried using loads of different observers (sales_order_save_after, sales_order_save_after_commit), all seem to do the same thing. I've also tried altering the dependencies so that my module fires first on that observer, and last. I've upped the max_children php_fpm can run; restarted php-fpm - I'm pretty confident php-fpm is not at fault.

I've also completely emptied out the method so that all it does is return $this; the same thing seems to happen.

I'd really appreciate any pointers on what might be causing this.

Edit 1: I've also tried adding a die(...) statement within the relevant method. It seems to make no difference.


texts: Set pager default value in product form in adminhtml

texts:
I need to set some very high value as default in pager in product grid in adminhtml. Or to disable it whatsoever.
Here's excerpt from my product_listing.xml

 <listingToolbar name="listing_top">
    <paging name="listing_paging">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sizesConfig" xsi:type="array">
                    <item name="value" xsi:type="string">66</item>
                    <item name="options" xsi:type="array">
                        <item name="66" xsi:type="array">
                            <item name="value" xsi:type="string">66</item>
                            <item name="label" xsi:type="string">66</item>
                        </item>
                    </item>
                </item>
            </item>
        </argument>
    </paging>
</listingToolbar>

Neither of those work: nor value, nor option. What did I do wrong?


texts: Admin panel is down due to compilation issues. Admin panel is down with 500 error

texts:
One of my website admin panel is down usually.

Once i disable the compilation it works normally but after few hours site goes down and in mentioned file first line changed by its own.

/var/www/html/includes/config.php

Warning: include(/var/www/html/includes/src/Magpleasure_Filesystem_Helper_Data.php): File not found  in /var/www/html/includes/src/Varien_Autoload.php on line 94

    #0 /var/www/html/includes/src/Varien_Autoload.php(94): mageCoreErrorHandler()
    #1 /var/www/html/app/Mage.php(546): Varien_Autoload->autoload()
    #2 /var/www/html/includes/src/Mage_Adminhtml_Block_Page_Menu.php(325): Mage::helper()
    #3 /var/www/html/includes/src/Mage_Adminhtml_Block_Page_Menu.php(144): Mage_Adminhtml_Block_Page_Menu->_isEnabledModuleOutput()
    #4 /var/www/html/includes/src/Mage_Adminhtml_Block_Page_Menu.php(171): Mage_Adminhtml_Block_Page_Menu->_buildMenuArray()
    #5 /var/www/html/includes/src/Mage_Adminhtml_Block_Page_Menu.php(98): Mage_Adminhtml_Block_Page_Menu->_buildMenuArray()
    #6 /var/www/html/app/design/adminhtml/default/default/template/page/menu.phtml(30): Mage_Adminhtml_Block_Page_Menu->getMenuArray()
    #7 /var/www/html/includes/src/__default.php(3428): include()
    #8 /var/www/html/includes/src/__default.php(3459): Mage_Core_Block_Template->fetchView()
    #9 /var/www/html/includes/src/__default.php(3473): Mage_Core_Block_Template->renderView()
    #10 /var/www/html/includes/src/Mage_Adminhtml_Block_Template.php(81): Mage_Core_Block_Template->_toHtml()
    #11 /var/www/html/includes/src/__default.php(2617): Mage_Adminhtml_Block_Template->_toHtml()
    #12 /var/www/html/includes/src/__default.php(2335): Mage_Core_Block_Abstract->toHtml()
    #13 /var/www/html/includes/src/__default.php(2279): Mage_Core_Block_Abstract->_getChildHtml()
    #14 /var/www/html/app/design/adminhtml/default/default/template/page.phtml(53): Mage_Core_Block_Abstract->getChildHtml()
    #15 /var/www/html/includes/src/__default.php(3428): include()
    #16 /var/www/html/includes/src/__default.php(3459): Mage_Core_Block_Template->fetchView()
    #17 /var/www/html/includes/src/__default.php(3473): Mage_Core_Block_Template->renderView()
    #18 /var/www/html/includes/src/Mage_Adminhtml_Block_Template.php(81): Mage_Core_Block_Template->_toHtml()
    #19 /var/www/html/includes/src/__default.php(2617): Mage_Adminhtml_Block_Template->_toHtml()
    #20 /var/www/html/includes/src/__default.php(28881): Mage_Core_Block_Abstract->toHtml()
    #21 /var/www/html/includes/src/__default.php(14360): Mage_Core_Model_Layout->getOutput()
    #22 /var/www/html/app/code/core/Mage/Adminhtml/controllers/DashboardController.php(43): Mage_Core_Controller_Varien_Action->renderLayout()
    #23 /var/www/html/includes/src/__default.php(14388): Mage_Adminhtml_DashboardController->indexAction()
    #24 /var/www/html/includes/src/__default.php(18880): Mage_Core_Controller_Varien_Action->dispatch()
    #25 /var/www/html/includes/src/__default.php(18410): Mage_Core_Controller_Varien_Router_Standard->match()
    #26 /var/www/html/includes/src/__default.php(21346): Mage_Core_Controller_Varien_Front->dispatch()
    #27 /var/www/html/app/Mage.php(683): Mage_Core_Model_App->run()
    #28 /var/www/html/index.php(102): Mage::run()
    #29 {main}`

Is any third party is the culprit for this?


texts: Query if a product is set to be visible on the website

texts:
I have modified the bundled product view template so that the "checkboxed" product options are displayed with links back to their component products using $_product = Mage::getModel, etc.

The problem I'm having is, I need to not show a link if the item is not visible in the website/catalog, and include the link only if the item is visible in the catlog.

Here's a recent version of the code:

<?php $_option = $this->getOption() ?>
<?php $_selections = $_option->getSelections() ?>

....

$_product = Mage::getModel('catalog/product');
$_product->load($_selection->getProductId());

....

<?php if($_selection->getVisibleInSiteVisibilities()) echo 'getProductUrl().'" target="_blank">'; ?>
<?php echo $this->getSelectionQtyTitlePrice($_selection) ?>
<?php if ($_selection->getVisibleInSiteVisibilities()) echo ''; ?>

I've tried $_selection->getVisibleIn SiteVisibilities() and that provides me with a boolean "false" regardless of how the visibility is set.

I tried $_selection->isVisibleInSiteVisibility() and that returns an array which seems to be the same for all products regardless of how the visibility is set as well.

Is there a simple way to find out if a product is set to be visible (or rather not set to "Not Visible Individually"?)


texts: Setting up a reverse proxy, server specs?

texts:
We currently have two servers in a 1+1 setup. 1 apache, 1 mysql. Both dedicated with 32 cores and 64GB of RAM. With a 300K+ catalog. Magento EE 1.11

Following Magento's 'Optimizing for peak performance' I was wondering what would be the optimal server specs if we were to add a reverse proxy such as Varnish or nginx based on the current 1+1 setup?

In the guide the test hardware specs for all the servers were:

CPU: 2 x Intel® Xeon® CPU E5645 @ 2.40GHz - 12 cores, 24 threads
HDD: RAID1 - LSI MegaRAID SAS 9260-4i; 2 x SAS 164GB 15,000rpm
RAM: 24GB ECC
Network Interface Card: Intel 1GB 82576

I feel like adding another server with the specs of the current setup is overkill. All the reverse proxy is doing is handing out cached content and if something is dynamic it gets send down to apache/PHP for processing. Any good guides or books on this subject?


texts: magento 2 after adding multiple currency, sales order in admin showing two currencies

texts:
I have two currencies set - Ruppes and USD.
Ruppes is my base currency.

I am facing problem is - USD orders in admin sales shows both currencies as shown in below image:

What can be done to show only one USD currency(and not rupees) when USD order is placed.

Is there any currency setting in admin where it can be handled? or Any extension?? Any Idea to solve this problem.


texts: Magento 2 : How to create custom webapi?

texts: How to implement web API in custom extension in magento2?


texts:
I try to load a product by it's ID into my block template. Currently I am using this code which works fine:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $objectManager->get('Magento\Catalog\Model\Product')->load($item->getProductId());

But I heard that this is not clean.
How can I improve this?

I tried it like this:

Block:

<?php

namespace Anshu\Bestsellerwidget\Block\Product\Widget;

use \Magento\Catalog\Model\ProductRepository;

class BestsellerWidget extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface
{
    protected $_productRepository;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        ...
        ProductRepository $productRepository,
        array $data = []
    ) {
        ...
        $this->_productRepository = $productRepository;
        parent::__construct($context, $data);
    }

    public function getProductById($id)
    {
        return $this->_productRepository->getById($id);
    }

    ...
}

Template:

$_product = $block->getProductById($item->getProductId());

But I get Type Error occurred when creating object: Anshu\Bestsellerwidget\Block\Product\Widget\BestsellerWidget

UPDATE

I found this in Magento/var/log/system.log:

  Type Error occurred when creating object:
  Anshu\Bestsellerwidget\Block\Product\Widget\BestsellerWidget, Argument
  5 passed to
  Anshu\Bestsellerwidget\Block\Product\Widget\BestsellerWidget::__construct()
  must be an instance of Magento\Catalog\Model\ProductRepository, array
  given, called in
  /srv/www/vhosts/hausfux_m2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116 [] []

NOTE: Argument 5 is the line ProductRepository $productRepository, in the constructor


texts: Using a new attribute as product description

texts:
Using Magento 2.3.2.
We currently sell through our website, and Amazon and Ebay via the M2E Pro extension.
Our current product description is used for the website and Ebay, and the short description is used for Amazon.
The product description is not really suitable for the website, as it contains a lot of ebay related content, so I was wondering if it was possible to create a new attribute, say, 'web_description' and use that as the description on the website.
Any help in solving this problem would be greatly appreciated.
Thank you.


texts: Magento 2 - Checkout Issue - Invalid state change requested - Customer is charged but order not created in the admin

texts:
We are facing an issue that is not constant, it happens very randomly and we are trying to understand. In the last 60 days, we have had 3 customers that they clicked on Place Order and the credit card was charged (authorize.net), but they never saw the success page and the order wasn't created in the backend either.
I've checked the logs and the error below appeared on the exact time of the charge in the customer's credit cart. The same error is created for all customers that had the issue:

  [2019-08-21 20:07:43] main.CRITICAL: Invalid state change requested
  {"exception":"[object]
  (Magento\Framework\Exception\StateException(code: 0): Invalid state
  change requested at
  /home/originsa/public_html/vendor/magento/module-quote/Model/QuoteRepository/Plugin/AccessChangeQuoteControl.php:45)"} []

I have found that as per the log the error occurs when passing through here: https://github.com/magento/magento2/blob/2.3/app/code/Magento/Quote/Model/QuoteRepository/Plugin/AccessChangeQuoteControl.php#L45

We are using:
Magento ver. 2.3.1

Any help is very appreciated.


texts:
I'm trying to extend Products in carts report grid. I needed to separate products for each customer and add a Customer name column. So for example a product with id number equal to 123 may exist in two different carts which means for two individual customers. So I need two rows for product id=123.

But at the moment when this happens I get a familiar message:

Item (Mage_Sales_Model_Quote) with the same id "123" already exist

I tried to rewrite my query starting from sales_flat_quote_item as main table (to have unique entities) but since I'm extending Mage_Reports_Model_Resource_Quote_Collection this fails with this error message:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.entity_id'
in 'field list', query was: SELECT STRAIGHT_JOIN COUNT(DISTINCT main_table.entity_id)
FROM `sales_flat_quote_item` AS `main_table` ...

Currently my prepareForProductsInCarts function starts with:

$collection = Mage::getResourceSingleton('sales/quote_item_collection');

and ends with:

// reset methods may be redundant
$this->getSelect()
    ->useStraightJoin(true)
    ->reset(Zend_Db_Select::COLUMNS)
    ->reset(Zend_Db_Select::DISTINCT)
    ->reset(Zend_Db_Select::GROUP)
    ->reset(Zend_Db_Select::WHERE);
$this->getSelect()->setPart(Zend_Db_Select::COLUMNS, $collection->getSelect()->getPart(Zend_Db_Select::COLUMNS));
$this->getSelect()->setPart(Zend_Db_Select::FROM, $collection->getSelect()->getPart(Zend_Db_Select::FROM));
$this->getSelect()->setPart(Zend_Db_Select::GROUP, $collection->getSelect()->getPart(Zend_Db_Select::GROUP));
$this->getSelect()->setPart(Zend_Db_Select::WHERE, $collection->getSelect()->getPart(Zend_Db_Select::WHERE));

What can I do to allow or work around duplicated entities?


texts: Magento 2 : How to override a source model?

texts:
I am trying to override/rewrite Magento\Fedex\Model\Source\Generic by using preference but to no avail.

Is there some other way that is used to override source models in Magento 2?


texts: Account sales order history get item images

texts:
Inside the account, I want to edit the order history page (/sales/order/history/).
Currenty the items of the order are not loaded on this page.

How can I load the items of the specific order, to get the productimages.
I want to show the purchased productimages inside the order history table.

So I want to load the items inside the <?php foreach ($_orders as $_order): ?>.

How can I achieve that?

I am running Magento 1.9.3.7


texts: Magento 2.x - Adding product to quote, but quote is not stored in properly

texts:
[edit: one problem solved, one remaining (details at the end of this post)]

I am trying to add products programmatically to the shopping cart but have problems with storing the cart. I am using the quote object because cart is marked as deprecated (as are load() and save() but i have not found an alternative to them, yet).

I have the following Controller (actually a simplified copy of my controller, but it works in the same way):

namespace [Vendor]\[Module]\Controller\Index;

use Magento\Catalog\Model\ProductFactory;
use Magento\Checkout\Model\Session;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Store\Model\Store;
use Magento\Quote\Api\CartRepositoryInterface;

class AddNewProductToCart extends Action

public function __construct(
        Context $context,
        PageFactory $resultPageFactory,
        ProductFactory $productFactory,
        Session $customerSession
        Store $store,
        CartRepositoryInterface $cartRepositoryInterface
    ) {
        parent::__construct($context);
        $this -> resultPageFactory = $resultPageFactory;

        $this -> session = $customerSession;
        $this -> productFactory = $productFactory;

        $this -> store = $store;
        $this -> cartRepositoryInterface = $cartRepositoryInterface;
    }

    public function execute()
    {
        $this -> simplifiedExecute();
        die();
    }

    private function simplifiedExecute()
    {
        $products = array(
            0 => array(
                'id' => 173,
                'qty' => 1
            ),
            1 => array(
                'id' => 174,
                'qty' => 3
            )
        );

        $quote = $this -> session -> getQuote();
        $quote -> setStore($this -> store);
        $quote -> setCurrency();
        $this -> cartRepositoryInterface -> save($quote);

        echo '[before simplifiedExecute()] $quote -> getId(): ' . $quote -> getId() . '

';

        foreach ($products as $k => $v) {
            $product = $this -> productFactory -> create() -> load($v['id']);
            $quote -> addProduct($product, $v['qty']);
        }
        $quote -> save();

        $items = $quote -> getAllVisibleItems();
        echo 'Testing items from quote via getAllVisibleItems():
';
        foreach ($items as $item) {
            echo 'id: ' . $item -> getId() . '
';
            echo 'qty: ' . $item -> getQty() . '

';
        }

        echo '[after simplifiedExecute()] $quote -> getId(): ' . $quote -> getId() . '
';
    }
}

and get the following output:

[before simplifiedExecute()] $quote -> getId(): 115

Testing items from quote via getAllVisibleItems():
id: 152
qty: 1

id: 153
qty: 3

[after simplifiedExecute()] $quote -> getId(): 115

[update: rewrote this part, due to halfway solving the problem]

After adding in the CartRepositoryInterface and saving the quote after getQuote() i now have a quote that persists through page refresh.

But the items i added are not showing up on the cart page.
So there must be something else I am missing.

Any answer welcome.


texts: Magento 2 Product Attribute Swatch Image

texts:
I have created a product attribute that is using an image swatch for each attribute value.

My question is how can I go about retrieving the image swatch URL from the attribute within my product view?

I am familiar with how to retrieve an attribute value but can't seem to figure out how to retrieve the image swatch.

Any help would be great.


texts: How do auto add datetime in InstallSchema magento2?

texts:
in InstallSchema

        ->addColumn(
            'created_at',
            \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
            [],
            'Creation Time'
        )
        ->addColumn(
            'updated_at',
            \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
            [],
            'Update Time'
        )

so how do updated_at, create_at auto add datetime when execute action?


texts: Reg plus (+ amount) symbol displaying for user

texts:
I have configured a simple product and the configuration is as below

100 gm - MRP 44 150 gm - MRP 62
I used the custom option(when adding a product) and added the price, base price was set for 100 gm as MRP 44 and for 150 gm i have configured the +18.Now in the front end its is displaying as

100 gm 150 gm +₹18.00
Is there a way i can hide the +₹18.00 so that users doesn't see this?


texts: Magento 2.2 registration.phtml dob field calendar not loading

texts:
I have a Magento 2.2 based dev site setup, I enabled the dob field via the admin panel so now the customer registration form registration.phtml shows the date of birth field. however when you click on the dob text box no calendar is shown and there is no button under the text input to make the calendar/datepicker show up??

Below is my register.phtml file

<?php if ($_dob->isEnabled()): ?>
        <?php //echo $_dob->setDate($block->getFormData()->getDob())->toHtml() ?>

             Date of Birth

               <input type="text" name="dob" id="dob" class="_has-datepicker" data-validate="{required:true}" autocomplete="off" aria-required="true" />
                                    <button type="button" class="ui-datepicker-trigger v-middle">Select Date</button>

<?php endif ?>


texts: Checkout Onepage Item.phtml doesnt care about changes

texts:
im trying to edit the Onepage Checkout Item view for hours now.
After many ways of trying I´ve found out that especially this one file seems to be loaded from somewhere else.

Loaded files: /app/design/frontend/base/default/template/checkout/onepage/review/
button.phtml, info.phtml, totals.phtml, -item.phtml-> changes doesnt appear.
If I change something in each single file its displayed so it should be loaded or used at this point.

If I change the item.phtml nothing happens so there should be another "item.phtml" file somewhere else. I´ve already searched the whole directory of the shop - no item.phtml found (just this one).

Im getting crazy... Someone got a solution or idea?


texts: Can't read from file "http:///rest/default/schema?services=all" in Magento 2.2.6

texts:
And Error response is

{"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://<SITE_URL>/rest/default/schema?services=all"}]}


texts: Magento 2.3.3 Mini Cart Disable Checkout Button When A Product = $0.00

texts:
I want to disable the checkout button from the mini cart when an (or any) item is added that has $0.00 as a price.

I have copied the minicart.phtml file from: /var/www/html/vendor/magento/module-checkout/view/frontend/templates/cart and added it to my theme. I am confused because the calls look like they are in Javascript and PHP. How would I approach this?


texts: .php file auto converting to php.suspected

texts:
I am facing new problem within 2 days. My Many PHP file are showing extension as suspected. However, i renamed all as earlier , it again came as php.suspected within 8 hrs. Kindly Suggest me the solution.

Earlier ;     model.php
Now ;         model.php.suspected
And same for many other files


texts: Magento 2.3.0: Module Manager not showing

texts:
I have updated to Magento 2.3.0

Now the Module Manager module grid is not showing:

Expected result

It should open and let me display all modules that are currently installed.

Actual result

URL encounters 404 http://storeurl/setup/index.php/moduleGrid/modules

Can you check anyone and let me know, how to fix these issues.


texts: Some of products are giving error not found cms page in magento 2 multistore website

texts:
I have a website in Magento 2 with multistore functionality with Italian and English store. The same products are working fine in the english store but in the Italian store giving an error: There was no 404 CMS page configured or found.
Ursl of both stores :

English: https://europe.ibamboli.store/ibambolicolors

Italian: https://www.ibamboli.store/ibambolicolors

Everything was working fine I don,t know what is an issue with multistore or its product URLs.

Thanks in Advance


texts: How to override pub/error folder in my module for magento 2 cloud?

texts:
How to override pub/error folder in my module for magento 2 cloud ?
I want override pub/errors folders in my module for magento 2 cloud enterprise edition.
I tried following method

Copy pub/errors/local.xml.sample to pub/errors/local.xml

Then made a copy of pub/errors/default (let's say
pub/errors/custom).

Changed the skin value of the pub/errors/local.xml to the newly created errors skin:
<config>
    <skin>custom</skin>
    ....

But cloud is not allowing me to mkdir create directory over there.
Any solution for cloud enterprise edition ?


texts: Magento 2: Round Cents in 2 digit format

texts:
I have some products with 2 decimals, as eg: 28.88, I would like to round the last decimal so the product price would be 28.89.

Also if the price is 28.84, round them to 28.80.
Which means if price last digit is >5 then round up, ad if last digit is <5,then round down.

Thanks for your help, I've followed some tutorials but I only make the price to be cutted off into a 1 decimal.


texts: Getting latest record when using Group by in magento

texts:
I am facing one issue that I want to get latest records from collection when using group by & sort order but getting the first record from groups (not the latest one). I am grouping the collection by email id so that means I should get one record per email id. Now I am getting that but the real issue is the record which comes is the older one not the latest one. I am ordering the collection with ID but still not luck.

Here is my code :-

$collection = Mage::getModel('messagebox/messagebox')->getCollection();
$collection->AddFieldToFilter('toemail',$this->escapeHtml($this->helper('messagebox')->getUserEmail()));
$collection->getSelect('*')
    ->columns('MAX(messagebox_id) as max_id')
    ->group(array('fromemail'))
    ->order('max_id desc');

First I am getting the collection then doing filter, then grouping it & then ordering it. In this case the records are not coming latest but the older.

I am explaining with the table & output. My table is like this :-

messagebox_id  fromemail  toemail     message      created_time
1              an@el.com  kl@el.com   sample msg   2015-09-10 07:26:49
2              an@el.com  kl@el.com   Hi Hello     2015-09-10 07:28:28
3              an@el.com  kl@el.com   Hi Fine?     2015-09-10 07:30:20
4              hk@el.com  kl@el.com   Hi Kl        2015-09-16 07:37:20
5              hk@el.com  kl@el.com   Hi 2nd Msg   2015-09-16 07:38:49

Now if we hit the above query, the output will come like this :-

messagebox_id  fromemail  toemail     message      created_time
1              an@el.com  kl@el.com   sample msg   2015-09-10 07:26:49
4              hk@el.com  kl@el.com   Hi Kl        2015-09-16 07:37:20

The expected output is :-

messagebox_id  fromemail  toemail     message      created_time
3              an@el.com  kl@el.com   Hi Fine?     2015-09-10 07:30:20
5              hk@el.com  kl@el.com   Hi 2nd Msg   2015-09-16 07:38:49

Thanks in advance for helping :)


texts: Why updates are not showing on Magento 1.9 front end

texts:
I change in my file and when I see at frontend, no changes are affected.

I am very confused even after flushing Magento cache, updates are not showing on the front end.

Does anyone have any idea about this?


texts: Image resizing command not working in Magento 2.1.6

texts:
I'm trying to run this php bin/magento catalog:images:resize in my magento 2.1.6 but I'm getting following error

  Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error:
  Premature end of JPEG file  in
  vendor/magento/framework/Image/Adapter/Gd2.php
  on line 65


texts: How to handle a timeframe in which checkouts are not possible?

texts:
Our Magento is attached to a second database which is responsible for commodities management.
Now this second database is quite strange as it developed over years and one of the strange things is that it cannot handle inserts while it's beeing backuped.

The problem is that the Shop could theoretically sell things, even thought the commodities DB is backuping.

Now what I need is to somehow disable checkouts for a certain time every night.
How could I go for it?


texts: Helper Data not found - Can't access admin panel

texts:
Admin Panel only shows the following message:

  Fatal error: Class 'Mage_Sean_Adminmerchant_Helper_Data' not found in /home/makeyou/public_html/app/Mage.php on line 546

I deleted all files within:

app/code/local/Sean/AdminMerchant

Since I don't have access to the admin panel I cleared the cache by deleting my var/cache folder.

Then I went to includes/config.php and commented out both lines, then one line then the other (every possible combination) but still no luck it keeps complaining about,

  Fatal error: Class 'Mage_Sean_Adminmerchant_Helper_Data' not found in /home/makeyou/public_html/app/Mage.php on line 546

How can it still be bothered by this if it isnt there anymore?

On my remote host there is no trace is Adminmerchant anywhere!!


texts: Will changing the category name affect SEO?

texts:
As you can see here

I want to just name the products "For Kompakt, Elscooter, Trehjulet" etc as the parent category is already named "Elscooter". This is mainly because I want all the sub-categories to be aligned perfectly horizontal with each other.

If I change the "Name" to "Kompakt" f.ex. Will this affect SEO? I thought just leaving the Page title for meta would be good on its own ?


texts:
I read all the installer script not working threads and still can't figure it out.

I want to run a simple installer script for my module eg:
community/Aquiver/Productslider1/

The install php file is:

sql/productslider1_setup/install-0.1.0.php

echo 'Running Script: '.get_class($this)."\n";
die("Exit for now");

and the config is:

<?xml version="1.0"?>
<config>
    <modules>
        <Aquiver_Productslider1>
            <version>0.1.0</version>
        </Aquiver_Productslider1>
    </modules>
    <frontend>
        <routers>
            <productslider1>
                <use>standard</use>
                <args>
                    <module>Aquiver_Productslider1</module>
                    <frontName>productslider1</frontName>
                </args>
            </productslider1>
        </routers>
    </frontend>
    <global>
        <blocks>
            <productslider1>
                <class>Aquiver_Productslider1_Block</class>
            </productslider1>
        </blocks>
         <helpers>
            <productslider1>
                <class>Aquiver_Productslider1_Helper</class>
            </productslider1>
        </helpers>
        <models>
            <productslider1>
                <class>Aquiver_Productslider1_Model</class>
                <resourceModel>productslider1_resource</resourceModel>
            </productslider1>
            <productslider1_resource>
                <class>Aquiver_Productslider1_Model_Resource</class>
                <entities>
                    <theproduct>

theproduct

                    </theproduct>
                </entities>
            </productslider1_resource>
        </models>
        <resources>
            <productslider1_setup>
                <setup>
                    <module>Aquiver_Productslider1</module>
                    <class>Aquiver_Productslider1_Model_Resource_Setup</class>
                </setup>
            </productslider1_setup>
        </resources>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <aquiver_productslider1 before="Mage_Adminhtml">Aquiver_Productslider1_Adminhtml</aquiver_productslider1>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

The install page never works.


texts: How to display a category on my homepage?

texts:
I'm just making my own Magento website and I was wondering if it is possible to display a specific category? I have two categories and I would like to display them separately.

I'm using this CMS code:

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="4"}}

Alle producten

{{block type="catalog/navigation" name="catalog.category" template="catalog/category/merken.phtml"}}

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="4"}}

Alle producten

{{block type="catalog/navigation" name="catalog.category" template="catalog/category/merken.phtml"}}

and the merken.phtml contains the following information:

<?php
    $class_check=1;
?>
<?php foreach ($this->getStoreCategories() as $_category): ?>

<?php $open = $this->isCategoryActive($_category); ?>
<?php

$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
?>
<div class="col-md-2 col-sm-4 col-xs-3 merken-holder <?php if($class_check == 1){echo 'class_first';}?>">
<a href="<?php echo $this->getCategoryUrl($_category); ?>" class="link-img">

<img  src="<?php echo $immagine; ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()); ?>" class="merk-image"/>

<?php else: ?>
<div class="col-md-2 col-sm-4 col-xs-3 merken-holder <?php if($class_check == 1){echo 'class_first';}?>">
<a href="<?php echo $this->getCategoryUrl($_category); ?>" class="link-img">

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

<?php
endif;
$class_check++;
endforeach; ?>

I have 2 of dose codes and also 2 cat ID's

Can anyone help me?


texts: Missing required argument $adapters of Magento\Search\Model\AdapterFactory

texts:
This error is showing up on a clean installation of Magento 2. I've tried to re-install a clean Magento 2 version on another domain and it's giving me the same problems.
To replicate:

Get a domain.
Login SSH.
Run command /usr/local/bin/composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <installation-folder-here>
Enter that folder and run bin/magento setup:install \ --base-url=http://domain.com \ --db-host=localhost \ --db-name=database_name \ --db-user=database_user \ --db-password=database_pass \ --admin-firstname=Name \ --admin-lastname=LastName \ --admin-email=test@test.com \ --admin-user=Admin \ --admin-password=test \ --language=en_US \ --currency=EUR \ --timezone=America/Chicago \ --use-rewrites=1.
Halfway through the installation, I get the message that it can't connect to "Elesticsearch", so I run this code to disable it bin/magento module:disable {Magento_Elasticsearch,Magento_InventoryElasticsearch,Magento_Elasticsearch6,Magento_Elasticsearch7}.
Re-run step 4.
Refresh the cache/index and run the magento setup:upgrade + setup:static-content:deploy. -f bin/magento cache:clean -f bin/magento cache:flush -f bin/magento setup:upgrade -f bin/magento setup:static-content:deploy -f.
Login to the back-end and create a category.
Go to the front-end, open the category and now you're greeted by the error message (http://prntscr.com/v74ane).

Am I doing something wrong? Isn't this way of installing Magento 2 supposed to download everything straight from Magento 2 themselves? Also if this is relevant information, it downloads/installs Magento 2.4.1.


texts: how to get current page url from controller

texts:
is this possible?  I'm using one controller for (almost) the same functionality for two different pages.  Is it possible to distinguish the source of the request in order to vary functionality?

Note: This controller is used to process ajax calls.


texts: Mobile hamburger menu action doesn't work at first page load on Magento 2.2

texts:
I'm using Magento 2.2.x with a free theme

  http://www.venustheme.com/theme/ves-fasony-free-magento2-theme/

And my problem is that the hamburger menu action, and also the cart action, doesn't work as it should. The menu doesn't work properly, and the cart, sends you to the demo page, instead of opening the cart popup.
I think there is some javascript not loading, cause after a while of clicking around, and browsing some pages, it works, any idea?


texts: Is there a way to get Tier Price List in our custom module template file

texts:
As we use in :

/opt/lampp/htdocs/magento_composer/vendor/magento/module-catalog/view/base/templates/product/price/tier_prices.phtml

How can i use getTierPriceList() in my custom module's template file ?

also is it available in product collection ?

I tried a lot but is unable to load product collection as we used to do in magento 1.x.

Tried:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load(2);

in this

$product->getPrice();

is working but how can i get tierprice in template file?
i.e. my main concern.


texts: Magento doesn't have CSS after installed?

texts:
I have below page after install:

I have referenced to this link but it not solved my problem.

When I run php bin/magento setup:static-content:deploy -f, I got this error:


texts:
When the Magento2 site is in production mode and I want to modify some html/phtml/php/js files how can I update the edited files while remaining in production mode?
For the moment I have done this:
$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento c:f

Finally I ran this command:
$ php bin/magento setup: static-content: deploy

When I ran the "setup: upgrade" command I saw that my files written by the production mode had already disappeared and the site did not work well.
Finally I ran the "setup: static-content: deploy" command and it returned me an error saying that it was not possible to compile the less files.
Consequently I had to go back to default mode.
What could have been the mistake?


texts: How to get the all the reviews of the product posted by the customer in magento 2

texts:
I have removed review tab and placed my review form as a popup modal in product page.How to get the all the reviews of the product posted by the customer in Product page.Now I need to get all the reviews collection and want to displayed it in product page. Please provide me a solution

catalog_product_view.xml

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

        <referenceBlock name="product.info.review">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">XXX_YYY::review.phtml</argument>
            </action>

            <block class="Magento\Framework\View\Element\Template" name="custom.review.popup" template="XXX_YYY::popup.phtml">

                <block class="Magento\Review\Block\Form" name="custom.product.review.form" as="custom.review_form" template="XXX_YYY::form.phtml">
                    <container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before"/>
                </block>
            </block>

        </referenceBlock>
        <referenceBlock name="product.info.details">
            <referenceBlock name="reviews.tab" remove="true" />
        </referenceBlock>
        <!--Created new section before the footer-->
        <referenceContainer name="page.bottom.container">
            <container name="custom.product.section">
                <block class="XXX_YYY\Block\Form" name="custom.product.section.info" template="XXX_YYY::abc.phtml"/>
            </container>
        </referenceContainer>
    </body>
</page>


texts: Magento 2.3.* - How to override ViewModel for override block?

texts:
Magento 2.3.*

I want to override ViewModel for the override block (custom.block.name). But the issue is my .phtml a file called from the block and it is calling on some condition. Not every time call.

My frontend layout.xml file content is,

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="core.block.name">
            <block name="custom.block.name" class="Vendor\Module\Block\CoreBlock" before="-">
            </block>
        </referenceBlock>
        <referenceBlock name="custom.block.name">
            <arguments>
                <argument name="viewModel" xsi:type="object">Vendor\Module\ViewModel\CustomModel</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

My .phtml file render from block file. If I set the template in .xml then it is working properly.

Any help will be appreciated.


texts: Set Default Shipping Price in Cart When Customer Isn't Signed In

texts: I am trying to set up Magento so that if a new customer that isn't signed in and they add a product to their cart, it has a pre-selected shipping method and shows the price for that shipping method, in addition to the total being updated. How would I do this?


texts: Why do CLI commands return no errors/exceptions?

texts:
Problem:

I'm writing a custom module, and everything is output just fine when there are no errors/exceptions.  But as soon as I experience an error, nothing is displayed in the command line (using SSH via PuTTY to a shared host).  It just executes the command, outputs nothing, and returns to the prompt.

Also, nothing is being written to any of the usual server logs within "/var/logs".

I'm basically flying blind.  I don't know why things fail when they do, and I'm not sure how to proceed.

Example:

sharedhostingname@sharedhost [~]# php /home/sharedhostingname/public_html/bin/magento --list
sharedhostingname@sharedhost [~]#


texts: Fatal Error on Controller Accessing Session

texts:
I am trying to access the session so I can redirect if the user is not logged in. Used what should be correct, from several sources:

protected $_session;

 public function __construct(\Magento\Framework\App\Action\Context $context,
                            \Magento\Framework\View\Result\PageFactory $resultPageFactory,
                            \Magento\Backend\Model\Auth\Session $authSession)
{
    parent::__construct($context);
    $this->resultPageFactory = $resultPageFactory;
    $this->_session = $authSession;
}

However I get the message on page load:

  Fatal error: Uncaught TypeError: Argument 3 passed to

  \Controller\Index\Index::__construct() must be an instance of Magento\Backend\Model\Auth\Session, none given, called
  in
  ..\wwwroot\var\generation....\Controller\Index\Index\Interceptor.php
  on line 14 and defined in
  ..\wwwroot\app\code....\Controller\Index\Index.php
  on line 15

Why is this? Have I missed something obvious (as far as I can work out this works fine on a block I have - but not on this controller and I can't see any difference.

Edit: full code
Differs slightly from above because I've tried a couple of things since.

<?php
namespace ..\Subscription\Controller\Index;

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

class Index extends Action implements \Magento\Framework\DataObject\IdentityInterface
{
    /** @var  \Magento\Framework\View\Result\Page */
    protected $resultPageFactory;
    /**
     * @param \Magento\Framework\App\Action\Context $context
     * @param \Magento\Customer\Model\Session $sessionSession
     */
    public function __construct(\Magento\Framework\App\Action\Context $context,
                                \Magento\Framework\View\Result\PageFactory $resultPageFactory,
                                \Magento\Customer\Model\Session $sessionSession)
    {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
        $this->_customerSession = $sessionSession;
    }

    /**
     * Subscription Index, shows overview of their subscriptions.
     *
     * @return \Magento\Framework\View\Result\PageFactory
     */
    public function execute()
    {

        // Check the user is logged in
        if($this->_customerSession->isLoggedIn()){
            return $this->resultPageFactory->create();
        }
        else {
            return $this->_redirect('customer/account/login');
        }
    }

    /**
     * Return identifiers for produced content
     *
     * @return array
     */
    public function getIdentities()
    {
        return [\..\Subscription\Model\Post::CACHE_TAG . '_' . 'list'];
    }

}


texts: Cron script readiness check failed while updating the Module

texts:
When I tried to update my module, Readiness check fails.

My cron job is already running.

Error from Updater Application Cron Script:

Found non-writable path(s):

generated/code/Magento/Cron
generated/code/Magento/Cron/Model
generated/code/Magento/Cron/Model/ScheduleFactory.php
generated/code/Magento/NewRelicReporting/Model/ModuleFactory.php
generated/code/Magento/NewRelicReporting/Model/CronEventFactory.php
generated/code/Magento/NewRelicReporting/Model/Apm
generated/code/Magento/NewRelicReporting/Model/Apm/DeploymentsFactory.php
generated/code/Magento/NewRelicReporting/Model/SystemFactory.php
generated/code/Magento/NewRelicReporting/Model/CountsFactory.php
generated/code/Magento/NewRelicReporting/Model/ResourceModel
generated/code/Magento/NewRelicReporting/Model/ResourceModel/Counts
generated/code/Magento/NewRelicReporting/Model/ResourceModel/Counts/CollectionFactory.php
generated/code/Magento/NewRelicReporting/Model/ResourceModel/Module
generated/code/Magento/NewRelicReporting/Model/ResourceModel/Module/CollectionFactory.php
generated/code/Magento/Indexer/Model/Processor
generated/code/Magento/Indexer/Model/Processor/Interceptor.php
generated/code/Magento/Catalog/Api/Data/CategoryTreeInterfaceFactory.php

But all my folders have 775 and files have 664 permission.

Any Idea ?


texts: Magento 2. Add attribute (image) to Catalog Price Rule

texts:
Is it possible to add additional (image with Image Uploader) attribute to the Catalog Price Rule? If it is, please, tell about it in details. Better with working code example.

What I have now

Now I have only field with image uploader, but it just shows spinner and nothing more.

Code example

        <field name="img">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Image</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="source" xsi:type="string">catalog_rule</item>
                    <item name="formElement" xsi:type="string">fileUploader</item>
                    <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                    <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item
                    <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="string">catalog_rule/promo_catalog/image</item>
                    </item>
                </item>
            </argument>
        </field>

[UPD]

I have no frontend/routes.xml in my module. module-catalog-rule also doesn't have it. I use DI to inject ModelCollectionFactory of this module, where I need it.


texts: How can I add JQuery to magento 2 custom module

texts:
I have test.js file like below

function Calculation(){

//area calculation
    var width = document.getElementById('width').value;
    var height = document.getElementById('height').value;

    var area = (parseInt(width) * parseInt(height) / 1000000);
    document.getElementById("area").innerHTML = "Area : " + area;

    //circumeference calculation
    var width = document.getElementById('width').value;
    var height = document.getElementById('height').value;

    var circumeference = (2*(parseInt(width) + parseInt(height))/1000);
    document.getElementById("circumeference").innerHTML = "Circumeference : " + circumeference;

and I have import this file in my layout example_index_index.xml file head like below.

<script src="Test2_Helloworld::js/test.js"/>

Instead of JavaScript can I use JQuery?


texts:
I want to show some specific product on product listing page :

like product_collection.phtml

there is a code that grab the collection

  $_productCollection=$this->getLoadedProductCollection();

It show all products in particular category but I want to show few product by there ids may be array of product ids like

$productids=array(11,22,1,4);

how can I do that add filter or any other way ?..

i tried below code but it is not working .
code of product_collection.phtml:

        <?php
/* added code for filter start */
        $productIds = array(1,3,2);
        $_productCollection=$this->getLoadedProductCollection()->addAttributeToFilter('entity_id', array('in' => $productIds));

/* added code for filter ends */
/*order code
$_productCollection=$this->getLoadedProductCollection();

*/
        $_helper = $this->helper('catalog/output');

    ?>
    <?php $_collectionSize = $_productCollection->count() ?>
    <?php $_columnCount = !empty($cols)?$cols:$this->getColumnCount(); ?>

        <?php echo $this->getToolbarHtml(); ?>

        <?php $i=0; foreach ($_productCollection as $_product): ?>
            <?php if ($i++%$_columnCount==0): ?>

            <?php endif ?>

                    <?php echo $_product->getName().'
';?>

                <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>

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

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


texts: Plugin for Magento 2 site using TaxJar API in a drop ship model to address sales tax

texts:
Is there a plugin that will work with the TaxJar API to support a drop ship model where we can  set  our site to collect tax or not based on if a manufacture requires us to collect sales tax?  We are building the site on Magento 2.

For example, if manufacture A is going to charge us sales tax in VA but no other vendor is, would we be able to set up a plugin using TaxJar API to only collect in VA for manufacture A and no other manufactures? Is there a plugin that would allow us to code for that?

At my previous company we had built fulfiller manager. This had each vendor listed and then the ability to determine by state for each vendor if tax should be collected or not. That system then communicated with our tax software through API to determine if it should or should not be a taxable transaction.


texts: locked out due to 2FA after upgrading to 2.4.0

texts:
As the question title says I was locked out of my admin page after upgrading to 2.4.0 due to the enforced 2FA. Now I see this page

The email that is sent though is not going to my user's email address but instead it goes out to owner@example.com. So I'm unable to follow the instructions. Clicking on change your password just makes me return to the same page and sends another email to owner@example.com
How do I recover from this situation?
--Additional info for troubleshooting --
After a lot of looking around in the logs, I experimented with adding a different address in owner@example.com . This had an interesting aspect because it made me receive a bounce message. It seems that magento 2 is trying to send the email as owner@example.com to the user email, however because SPF validation fails the message is silently discarded. The resulting email I saw towards owner@example.com was the bounce message of the original email.
I then experimented with adding an account I own the top level domain for, and edited the SPF record to allow sending the email. I received the email normally and unlocked my account.
However I'm still curious why it's picking up owner@example.com as the sender of the email and not the general contact email address.


texts: magento 2 how to override product views report for custom admin report

texts: Please tell me all the steps to override product view report in my custom module, i am new in magento so i don't know how to do that, thank you


texts: Trying to make certain category names dynamic results in 100% server memory usage

texts:
My custom module has certain categories that are linked to certain customers and should return that customer's company name instead of the category name, I have written a plugin like this:

public function afterGetName(Category $subject, $result) {
    $customerCollection = $this->customerCollectionFactory
        ->create()
        ->addFieldToFilter('custom_category_id', $subject->getId())
        ->setPageSize(1);

    if ($customerCollection->getSize()) {
        return $this->customerRepository->getById($customerCollection->getFirstItem()->getId())->getAddresses()[0]->getCompany();
    }

    return $result;
}

This works perfectly, but when I clear the cache the server starts using 100% memory and will slow to a crawl. I have narrowed it down to the $this->customerRepository->getById call, but I don't see how this seemingly results in an infinite recursion. I have tried using an AddressRepository instead, but that somehow breaks all $customer->getCustomAttribute calls.


texts: How to change the template file of a block progammatically

texts:
Is there a way to change the template file of a block through code?
I understand overriding the template file in theme but I want to override it on some condition.


texts: Can I use Magento_Theme/layout/default.xml for all layout updates?

texts:
In magento2 Layout updates are usually spread accross multiple files in your custom theme. e.g.

Magento_Catalog/layout/catalog_product_view.xml
Magento_Theme/layout/default.xml
Magento_Customer/layout/customer_account.xml

Is it good practice to put everything in Magento_Theme/layout/default.xml, and if not why?

For instance you could have have the below all in default.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="register-link" remove="true" /> <!-- This occurs on every page -->
        <referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/> <!-- This occurs on only on the account pages -->
        <referenceBlock name="product.info.review" remove="true" /> <!-- This occurs on only the product details page -->
    </body>
</page>

If everything is put in one file, the default.xml, perhaps it's overkill as not all instructions are required for each page view or is the same layout file compiled and loaded for each page view, in which case it would make no difference.


texts: REST API accessible without authorization

texts:
I'm testing the REST API of magento.

According to the docs: "To make a web API call from a client such as a mobile application, you must supply an access token on the call."

I can successfully get the token for my admin account using the code below.

$userData = array("username" => "admin", "password" => "...");
$ch = curl_init("http://localhost/magento2/index.php/rest/V1/integration/admin/token");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Content-Length: " . strlen(json_encode($userData))));

$token = curl_exec($ch);

Strangely, I can call the REST API even without using the token like so:

curl -H "Content-Type: application/json" -X POST -d '{"customer": {"email": "test@invalid.com", "firstname": "Test", "lastname": "Customer"}}' http://localhost/magento2/index.php/rest/V1/customers

No token is used in this call, however the customer is still created. Why does the REST API of my magento API not require credentials and how do I change this?


texts: Magento 2 Adding extension attributes to Magento\Sales\Api\Data\ShipmentTrackInterface

texts:
I'm trying to add a custom track url to the trackings, using extension attributes, i added these in extension_attributes.xml
  <extension_attributes for="Magento\Sales\Api\Data\ShipmentTrackInterface">
    <attribute code="track_url" type="string"/>
  </extension_attributes>
    <extension_attributes for="Magento\Sales\Api\Data\ShipmentTrackCreationInterface">
        <attribute code="track_url" type="string"/>
    </extension_attributes>

Cleared the generated codes and caches, interfaces are populating correctly, I used \Magento\Sales\Api\ShipOrderInterface::execute to save the shipment:
            $this->shipOrderService->execute(
                $order->getId(),
                $items,
                $data->isCustomerNotify(),
                false,
                $comment,
                [$data->getTracking()]
            );

and the $data->getTracking() has data looking like this:
  {
    "track_number": "1Z37X3X41217934386",
    "title": "ups",
    "carrier_code": "ups",
    "extension_attributes": {
      "track_url": "blah"
    }
  }

So everything looks fine and the extension attributes data are passed fine down to Magento\Framework\Model\AbstractExtensibleModel, however in Magento\Framework\Api\AbstractSimpleObject which is what Magento\Sales\Api\Data\ShipmentTrackExtension extends from, $data becomes an empty array, i still can’t figure out why this is happening, i’m in dev mode and shouldn’t need to run DI or something like that, any ideas?


texts: 1.9.4.x to 2.3.6 data Migration not able to ignore table

texts:
When migrating data using Adobe's data migration tool I am receiving the following error... (see below). I have added sales_flat_quote to the source ignore document section. Yet I am still receiving the error.
Output Error
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'a6b7f26c_restore.sales_flat_quote'
doesn't exist, query was: SELECT DISTINCT  `child`.`quote_id`
   FROM `email_abandoned_cart` AS `child`
   LEFT JOIN `sales_flat_quote` AS `parent` ON child.quote_id = parent.entity_id WHERE
 (child.quote_id IS NOT NULL) AND (parent.entity_id IS NULL)

and
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'a6b7f26c_restore.sales_flat_quote'
doesn't exist

map.xml file
        <ignore>
            <document>sales_flat_quote</document>
        </ignore>


texts: Magento 2.1 Rest API - Adding to Extension Attributes for VI/Orders/?searchcriteria

texts:
I have some custom data that I gather on checkout. Using etc/extension_attributes.xml, I was able to add this data to the extension_attributes output on VI/Order/#id, but when I use VI/Order?searchcriteria api calls, the data is not in the extension attribute output.

Any ideas why it doesn't show up both places?  Here's my etc/extension_attribute.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Checkout\Api\Data\ShippingInformationInterface">
        <attribute code="tdv_customfield" type="anyType"/>
    </extension_attributes>
    <extension_attributes for="Magento\Quote\Api\Data\PaymentInterface">
        <attribute code="tdv_customfield" type="anyType"/>
    </extension_attributes>
    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="tdv_customfield" type="anyType" />
    </extension_attributes>
</config>


texts: How to remove index.php and default store code from url in magento?

texts:
I want to remove default store code and index.php from my url.

I have installed one module for remove default store code form url but after remove store core from url my site can not open without index.php.

If I allow default store code in url than I can remove index.php and site working fine.

so can anyone help to remove both("index.php" and "store code") from magento URL.

Thanks
Dhvanit


texts: How to login and register (signup) customer in Magento 1.9 rest api ? and also solve the below error

texts:
I am using http://myurl/api/rest/customers and getting the below access denied error even I had set user role for the customer under SYSTEM > WEBSERVICES > REST ROLE and also give permission from SYSTEM>PERMISSION>USERS.

I am very confused how to get this error 403:

  access denied as I had done each step to give permission from Magento backend.


texts: Magento 1.9 - Sign up - Cannot save the customer

texts:
Installed MailChimp on Magento 1.9, now the signup customer not working. It throws "Cannot save the customer".

Reviewed the exception log got the below issues.

2019-03-21T10:19:57+00:00 DEBUG (7): Exception message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ajaffeproduction.mailchimp_interest_group' doesn't exist
Trace: #0 /var/www/html/app/code/core/Mage/Newsletter/controllers/SubscriberController.php(64): Mage_Newsletter_Model_Subscriber->subscribe('ingewolli@hotma...')
#1 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Newsletter_SubscriberController->newAction()
#2 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('new')
#3 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /var/www/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 /var/www/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /var/www/html/index.php(97): Mage::run('', 'store')
#7 {main}

Can anyone help us to fix this?.


texts: magento 2 how dependency injection worked

texts: I know this question is asked many time by another user but all of them describe "how we can use magento DI" ? they does not speak about how magento pass object that constructor method needed or how magento find  constructor need which object


texts: Magento 2.2.3 showing error on checkout page on payment time

texts:
Error is :

  JQMIGRATE: jQuery.browser is deprecated

And infinite loop image not removing and no payment going to succeed in PayPal payflow .

Paypal responce is :

  Some required information is missing or incorrect. Please correct the
  fields below and try again.   Error: Secure Token is not enabled.
  Please return to the website from where you started your purchase and
  try again.

Please check : http://prntscr.com/jgky72 and http://prntscr.com/jgjswp

Anyone know what is solution?


texts: Problem pulling attribute with a specific store view

texts:
I have a Magento with only one store view. However this store is not default one. The news store view was created (ID: 2) and the default one deleted.

Then I have products and images imported with some tool. In admin everything is sparky. The correct thumbnail, small image and base image are selected and image is not excluded. In the front end image shows up correctly at the products info page but is not showing up at products listing.

If I print out the product object at the category listing I can see that no images are even loaded. No properties at all. However image labels are loaded well.

Here is the example row of my catalog_product_entity_varchar:

value_id    entity_type_id  attribute_id    store_id    entity_id   value
--------------------------------------------------------------------------------------------
1004        4               86              2           101         /2/7/271074_2.jpg

Where 86 coresponds to small_image attribute.

And now the last thing. If I change the store ID to 0 image is shown correctly. I can easily set it to 0 for all products as long as I have only one store view, but shouldn't it also be shown with 2? Why with 2 it displays at products details page and not in the listing?

PS: Default store view, no extensions.


texts: Load products in grid serializer after CSV import through AJAX

texts:
I want to use import feature like attached screen-shot in my custom module. please refer the attached screen-shot.

Actually I want to load the products in grid which are mentioned in CSV after import the CSV in tab.

Here is the live demo to understand the question in detail http://demo-extension.magestore.com/inventory/index.php/inventoryadmin/adminhtml_supplier/edit/id/165/key/9966a1319b9d12110d856f159165ed2f/. After login navigate to Inventory > Manage Suppliers > click on row in grid > click in Products tab.

Please help! Thanks in advance.

I have set bounty here for this question https://stackoverflow.com/questions/28515864/load-produts-in-grid-serializer-after-csv-import-through-ajax . You can answer here also to get extra benefit.


texts: How to extend sales order grid using event observer?

texts: I was extending my magento sales order grid and I was having an error with it because of a conflict with the other extension on rewriting the grid.


texts:
<cache>
             <backend><![CDATA[memcached]]></backend>
             <memcached><!-- memcached cache backend related config -->
                 <servers><!-- any number of server nodes can be included -->
                     <server>
                         <host><![CDATA[server1]]></host>
                         <port><![CDATA[11211]]></port>
                         <persistent><![CDATA[1]]></persistent>
                         <weight><![CDATA[1]]></weight>
                         <timeout><![CDATA[10]]></timeout>
                         <retry_interval><![CDATA[10]]></retry_interval>
                         <status><![CDATA[1]]></status>
                     </server>
                     <server>
                         <host><![CDATA[server2]]></host>
                         <port><![CDATA[11211]]></port>
                         <persistent><![CDATA[1]]></persistent>
                         <weight><![CDATA[1]]></weight>
                         <timeout><![CDATA[10]]></timeout>
                         <retry_interval><![CDATA[10]]></retry_interval>
                         <status><![CDATA[1]]></status>
                     </server>
                 </servers>

             </memcached>
         </cache>

I am trying to configure two memcache servers with my magento.
It works perfectly with one, But once i add the second one it gives me following error

Fatal error: Call to a member function setSaveHandler() on a non-object in app/code/local/Mage/Core/Model/Session/Abstract/Varien.php on line 53


texts: After upgrade to magento 2.2.7 The element 'gallery' already has a child with alias 'content' give error on exception.log file

texts:
After upgrade to magento 2.2.7 then give following error in exception.log file

main.CRITICAL: The element 'gallery' already has a child with alias 'content' {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): The element 'gallery' already has a child with alias 'content' at /vendor/magento/framework/Data/Structure.php:609)"} []


texts:
I get this error when trying to register an account :

  No such entity with customerId = 13818

I think it might be some old custom attribute that is the root of the problem.

How can I clean the customer_eav_table and customer_eav_website tables from all custom attributes ? I would like to clean everything up.

Magento 2.2.6


texts: Customer could not get order email when order is placed on magento store CE 1.9.2.1

texts:
I have used SMTP Pro extension for mails configuration. All emails works perfectly except email for order. Cron is setup correctly in server. Code to run on server is :

php -f /home/magento/public_html/project/cron.php

and I have setup cron to run on every one minute.
For quick fixes what i did is change in order.php (public_html/app/code/core/Mage/Sales/Model/Order.php)

From

$mailer->setQueue($emailQueue)->send();

To

$mailer->send();

And the emails are sent instatly whenever customer orders the product instead of queuing. But, what i need is the order need to be send through cron.
Can you suggest me the best way to solve this problem.?

Thanks.!


texts: Fatal error when i go to admin-> manage category

texts:
I got this error when i go to "manage category" in admin side.

  Fatal error: require_once(): Failed opening required
  '/home/shopnow/public_html/errors/report.php'
  (include_path='/home/shopnow/public_html/app/code/local:/home/shopnow/public_html/app/code/community:/home/shopnow/public_html/app/code/core:/home/shopnow/public_html/lib:.:/usr/local/lib/php')
  in /home/shopnow/public_html/app/Mage.php on line 925

when i go to error folder, i couldn't found report.php.
what should I do to see "manage category" again?


texts: Magento: Changing Icon for Top Level Menu Items

texts:
Is there a standard, framework supported way to add a new Icon to a Magento 2 top level Menu item?

When you add a new top level Menu Item to Magento 2's backend, you end up with a generic hexagon as the icon.

Is there an officially supported way to add a custom icon here?  The <li/> tag has an id element, so I can think of an infinite number of ways to jam an icon in there via CSS. What I'm interested in here is how core Magento modules do it -- i.e., what's The Right and True Way™ to add an icon.

Update: Re: Duplicates -- I'm trying to avoid a solution like the one outlined here.  i.e. all that does is jam some additional, unstructured CSS rules into a module in order to add an image.   At minimum, Magento's own rules (seem to?) use a structured _menu.css file to style those icons.  I'm operating from the point of view that there's a structured way to do this, and what I'm looking for is that structure, not another "this happens to work now but might break in the future because it doesn't follow the implicit design of the core system".


texts: Workaround for Mage::getModel('catalog/product') and foreach loop

texts:
Currently used code for retrieving filtered product collection:

    $products = Mage::getModel('catalog/product')
        ->setStoreId($storeId)
        ->getCollection()
        ->addAttributeToSort()
        ->addStoreFilter()
        ->addAttributeToFilter('category_id', array('in' => $rootCategoryId))
        ->addAttributeToFilter('type_id', 'configurable')
        ->addAttributeToFilter('sku', array('neq' => $attribute_set_id2))
        ->addAttributeToFilter('visibility', array('in' => array(4) ))
        ->addCategoryFilter(Mage::getModel('catalog/category')->load($categoryID));

   $products->getSelect()->order(new Zend_Db_Expr('RAND()'));

Which I think is fine.
Issue begins when I use following code for displaying products from previous collection as:

    foreach($products as $product):
        if ($counter == 6) { return $productArray; }
        $fullProduct = Mage::getModel('catalog/product')->load($product->getId());
        $images_obj = $this->helper('catalog/image')->init($fullProduct, 'small_image')->resize(252, 308);
        $images[] = (string)$images_obj;
        $productArray[$product->getId()]['image'] = (string)$images_obj;
        $productArray[$product->getId()]['url'] = $fullProduct->getProductUrl();
        $productArray[$product->getId()]['name'] = $fullProduct->getName();
        $productArray[$product->getId()]['price'] = Mage::helper('core')->currency($fullProduct->getFinalPrice(),true);
        $productArray[$product->getId()]['category'] = $fullProduct->getCategory();
        $counter++;
    endforeach;

Real performance killer here is:

$fullProduct = Mage::getModel('catalog/product')->load($product->getId());

Wondering is it possible to somehow store product IDs from collection and use later in foreach loop?
Or any different workaround on this issue so script does not hit DB so harsh.
Many thanks


texts: Here I have created modal inside edit tab using ui component. Now I have to save that form inside modal using ui-component in  Magento2.


texts:
The following piece of code provided by SuperDicq Remove products from all categories when price is zero) gives me a HTTP 500 error, anyone knows what's wrong?

I changed the name of htaccess, put memory limit on 1024mb. I have other scripts which are causing no problems. Also when I add this one below they start giving errors as well.

  require_once 'app/Mage.php';
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::app();
$products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToFilter(
        array(
            array('attribute'=>'price', 'eq'=>'0'),
            array('attribute'=>'price', 'isnull'=>true),
        )
);
$category_id = 863; // "Old models" category ID.
foreach($products as $product) {
    $product->setCategoryIds($category_id);
    $product->save();
}


texts: Magento 2.3.5 checkout page not loading ( captcha error in console)

texts:
I have installed fresh setup of magento 2.3.5 and was testing the overall checkout flow. But when I add product to cart and go to checkout page, loader continues to load and basically nothing happens and form section is not visible.
I tried to check these ref. but no luck:
https://github.com/magento/magento2/issues/23518
Magento CE 2.3.2 TypeError: setCouponCodeAction.registerDataModifier is not a function
Here is the console error I get:
captcha.js:44 Uncaught TypeError: setCouponCodeAction.registerDataModifier is not a function
at UiClass.initialize (captcha.js:44)
at UiClass.initialize (wrapper.js:109)
at new UiClass (class.js:49)
at Object.initComponent (layout.js:137)
at fire (jquery.js:3238)
at Object.fireWith [as resolveWith] (jquery.js:3368)
at Object.deferred.<computed> (jquery.js:3467)
at fire (jquery.js:3238)
at Object.fireWith [as resolveWith] (jquery.js:3368)
at Object.deferred.<computed> [as resolve] (jquery.js:3467)

Any help much appreciated,
Thanks


texts: Magento2: How to disable product image cache url?

texts: I want to disable product cache URL. How to get product image URL directly into the path.


texts: Magento 2 : Not able to save admin form after adding multiple tabs

texts:
I have created an admin form with 2 tabs. 2nd tab contains product grid. Before adding tabs save button works perfectly but now getting an error

  TypeError: $.data(...) is undefined

and I'm not able to save the form. Used this link for adding product grid:
http://www.webspeaks.in/2016/05/magento-2-add-products-grid-to-custom-admin-module.html


texts:
I try to add a new field to the customer form , on the create account page.

What I don't understand is where can I find the file which holds the script with the database insert values. Like the "model" file from the MVC systems.


texts: Magento 2: How to add Grand Total in base currency to the PDF invoice?

texts:
I need to display the grand total base currency value on invoices that have been generated using other currencies than base. And want to display all the values on the PDF invoice could be displayed in both currencies. Please see attached image for better understanding.

Thank you.


texts: Add column in sales order grid without join

texts:
Since I got on stackoverflow the comment to post my problem here, I'll give it a try. I hope this is ok because of duplicate posting. https://stackoverflow.com/questions/34336110/magento-add-column-in-sales-order-grid-without-join

I need to add a custom column in the sales order adminhtml grid.
Since I get the data for that grid from an external REST API by asking for data to a specific increment_id, I can't use the tutorials which are using a magento database to join the needed tables.

Is there another way like:

function rendering_sales_order_row_before($rowdata)  {
    $columnContent = $restapi->callByIncrementId($rowdata['increment_id']);
    $this->addColumn("Custom Column", $columnContent);
}

(This code should just illustrate my goal and I know that the solution will look completely different)

Is it possible to achieve that in magento in an elegant way?

I'm using magento 1.9.2.1


texts:
I'm making a custom invoice grid. I want to add one column "expire date" which is in "sales_flat_order_payment". I retrieve the data but can't add it in the column. Someone knows what's wrong? Probably the join function is wrong.

class Mage_Adminhtml_Block_Sales_Invoice_Grid extends Mage_Adminhtml_Block_Widget_Grid {

protected function _prepareCollection() {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $resource = Mage::getSingleton('core/resource');

        $items = Mage::getModel('sales/order_payment')->getCollection()->addAttributeToSelect('expire_date');
        //Holds expire date data
        Zend_Debug::dump($items->getData());

        //Something goes wrong here
        $collection->getSelect()->join('sales_flat_order_payment', 'main_table.entity_id = sales_flat_order_payment.parent_id', array('expire_date'));

        //Gives an error: Column not found: 1054 Unknown column 'sales_flat_order_payment.expire_date' in 'field list'
        Zend_Debug::dump($collection->getData());

        $this->setCollection($collection);
        return parent::_prepareCollection();
}

    protected function _prepareColumns(){

    $this->addColumn('expire_date', array(
                'header'    => Mage::helper('payment')->__('ExpireDate'),
                'index'     => 'expire_date',
                'type'      => 'datetime',
            ));

    }
}


texts: How get Mage::helper('core')->urlEncode in Magento 2?


texts: I want to create one seprate page. In this seprate page I will take amount in input box and need to take payment with all active payment method. How can I show all active payment method?


texts: send an email based on smtp.gmail.com from magento

texts:
I don't have any mail servers.

So how to configure the mail settings(settings->configuration->advanced->system->Mail sending settings) in magento admin panel using smtp.gmail.com

and how to send an email based on that settings ?


texts:
With Magento 2 being around for a bit now, some of you probably have experience with the optimal setup already.

What would be the best server configuration for an optimised Magento store? Backend cache, sessions, PHP/Opcode caching - any combination of Redis, Varnish, Memcache, APC, or something that I'm not aware of. I will be experimenting with setups and would like to know what is working best for you guys and if something has changed with Magento 2.


texts: Magento\Framework\Exception\LocalizedException : Could not read config file Magento 2

texts: I created a new theme in magento2, after creating theme, I reloaded my local site, getting this issue.


texts: Magento2 Rename "Company" attribute with custom name from Customer address

texts: I am customizing checkout fields and attributes for my client needs, and my client wants to Rename Company name with some other custom field, any idea from where i can change the company title?


texts:
After Upgrade from Magento 1.7 to 1.9 OnePage Checkout Sidebar Not working properly.

During the first step it is appearing. When we click a button the sidebar disappears.
<div> tag having the id checkout-progress-wrapper is showing empty.

How to resolve this?


texts:
How can I get recent 100 orders in magento 2.Currently I am getting orders but those are coming from starting onwords.I want recently placed 100 orders only. Can you help me on this ? I am getting orders collection using this

$this->_orderCollectionFactory->create()->addFieldToSelect('*')->setPageSize(200);


texts:
Your requirements could not be resolved to an installable set of packages.

Problem 1

Installation request for symfony/finder v3.4.4 -> satisfiable by
symfony/finder[v3.4.4].
symfony/finder v3.4.4 requires php ^5.5.9|>=7.0.8 -> your PHP version
(7.0.4) does not satisfy that requirement.

Problem 2

Installation request for symfony/stopwatch v3.4.4 -> satisfiable by symfony/stopwatch[v3.4.4].
symfony/stopwatch v3.4.4 requires php ^5.5.9|>=7.0.8 -> your PHP version (7.0.4) does not satisfy that requirement.

Problem 3

fabpot/php-cs-fixer v1.13.3 requires symfony/finder ^2.1 || ^3.0 -> satisfiable by symfony/finder[v3.4.4].
Installation request for fabpot/php-cs-fixer v1.13.3 -> satisfiable by fabpot/php-cs-fixer[v1.13.3].

I am trying to install Magento2 in ubuntu. My installation directory under the /var/www/public.

Can anyone help me to solve this error!

Thanks


texts: Product Attributes not updating. Screen just appears to refresh on save

texts: I am trying to update a custom attribute field.  When I add the content and hit save   no changes are made and the screen only to appears to refresh.


texts: muliple versions of jquery are added in magento

texts: We need to either modify the existing product image code to load these images up and allow swipe through jQuery OR possibly embed an existing jQuery library to handle this. How can i add muliple versions of jquery in magento local.xml file?.


texts:
I recently installed magento2 with sample data on my server.

But i see that every css, js also catalog images permission is not readable for user..

For that i m getting so many require.js errors. Also product view page is not working..

I run php magento setup:static-content:deploy and the static content deployed successfully. But seeing that file permission are not readable.

What i need to do now??


texts: Exporting and importing attributes and sets

texts: I'm looking to export all my product attributes and sets into a fresh install. But I'm struggling to find a solution. Any help would be appreciated


texts:
I have a dev site and a production site on the same VPS but on different cpanels.

The dev is a not a sub domain, but a resolved domain.

They both have different databases.

The production site is fine.

The frontend of the dev site is fine.

When I go to log into the admin of the dev, it redirects to the base url of the production site, and of course throws an error.

The structure should be https://domain-staging.com/new_admin_login

but it redirects to https://domain.com/mew_admin_login

I have done the following:

edited the env file correctly with new DB & new admin URL
updated the information in the core_config_data (base url for secure and unsecure)
Upgraded, compiled, deployed
Flushed, cleaned and reindexed

The sites are both on Magento 2.1.6 on a cloud VPS running Centos 7.4 and PHP 7.0.


texts: magento checkout success page not showing after order placing

texts:
Magento checkout success page not showing after order placing.it's redirecting to checkout/cart showing empty,but order is placed.

I checked ajax call response, it's showing as below

I am also hitting checkout/onepage/success direct from url after comment all code in successAction(), but it's still redirecting to checkout/cart

Please help me for above issue.

Thnaks in advance