texts: Why does reindex of catalog_product_flat disable the frontend?

texts:
I believe older versions of Magento (e.g. 1.5) would drop the flat table and then rebuild it. It seems that in 1.7+, the flat table is not even dropped, just updated.

In either case, why does the frontend need to be disabled?

With 1.5, couldn't the system build the new flat index, then drop the old one and rename the new one to the required name? The only point where the frontend might need to be disabled would be during the relatively brief renaming process.

In 1.7, why disable the frontend at all? I manually changed "working" to "pending" for the catalog_product_flat index process. The frontend worked fine until the indexer got to a point where it expected to see "working" and instead saw "pending" and the website hanged. But that is a technicality. The point is that the frontend can keep working while the indexer is working.

So why disabled the frontend?


texts: RequireJS Error - require.js:166 Uncaught Error: Mismatched anonymous define() module: function (){return Z}

texts:
I'm new to RequireJS and trying to figure out why this is happening. I have a custom file stickyNav.js in <vendor>/<theme>/web/js.

I've added a requirejs-config.js file in <vendor>/<theme>/web/.

var config = {
     map: {
         '*' : {
             'stickyNav': 'js/stickyNav'
         }
     }
 };

This is my js code (to call console.log as a test)

define([
    'jquery',
    'jquery/ui',
    'stickyNav'], function($, stickyNav){
        console.log('Working');
    }
 );

Obviously I have this wrong. I read the official doc's, but i'm still struggling.


texts: Magento 2: How to set visibility and status to product using collection?

texts:
I'm creating a cron to pass through all the products and set them visible and active.

This is my execute of the cron who runs well:

public function execute(){
    /**
     * @var $item \Magento\Catalog\Model\Product
     * @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection
     */

    $items = $this->productCollection->getItems();

    foreach($items as $item){
        echo  $item->getSku() .'<br>';
        $item->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $item->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        $item->save();
    }
    echo 'finish';
}

I've got a product with none visibility and status disabled, but when I run the function the product is still with none visibility and status disabled.

What I'm doing wrong?


texts: Due to permission issue Not able to insert the images using wysiwyg editor in Magento 2.2.7

texts:
Due to permission issue Not able to insert the image using WYSIWYG editor in page or block creation. Insert file and create folders buttons are not working. Suggest me with suitable permissions.
We are using a2hosting VPS server.


texts: Improved import export extension magento 2

texts:
I want to try this extension https://firebearstudio.com/blog/improved-import-export-2-0.html so i found this link on github : https://github.com/firebearstudio/importexportfree but when i installed it i just found this interface :

but i am supposed to have this interface instead

i think that this code miss some folders so have anyone tried this extension free  or buy it how do you find it for resolving problem of import. I really need your help


texts: Add different shipping cost for different products using attributes(without extension)

texts:
I tried to add different shipping costs for different products using http://blog.aajit.com/product-level-shipping-in-magento/ but i am getting 0 rs as flat rate in checkout. I should get different flat rate for different products how can do it?

Flatrate.php

class Mage_Shipping_Model_Carrier_Flatrate
extends Mage_Shipping_Model_Carrier_Abstract
implements Mage_Shipping_Model_Carrier_Interface
{

protected $_code = 'flatrate';
protected $_isFixed = true;

/**
 * Enter description here...
 *
 * @param Mage_Shipping_Model_Rate_Request $data
 * @return Mage_Shipping_Model_Rate_Result
 */
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
{
    if (!$this->getConfigFlag('active')) {
        return false;
    }

    $freeBoxes = 0;
    if ($request->getAllItems()) {
        foreach ($request->getAllItems() as $item) {

            if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
                continue;
            }

            if ($item->getHasChildren() && $item->isShipSeparately()) {
                foreach ($item->getChildren() as $child) {
                    if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
                        $freeBoxes += $item->getQty() * $child->getQty();
                    }
                }
            } elseif ($item->getFreeShipping()) {
                $freeBoxes += $item->getQty();
            }
        }
    }
    $this->setFreeBoxes($freeBoxes);

    $result = Mage::getModel('shipping/rate_result');
    if ($this->getConfigData('type') == 'O') { // per order
        $shippingPrice = $this->getConfigData('price');
    } elseif ($this->getConfigData('type') == 'I') { // per item
        $shippingPrice = ($request->getPackageQty() * $this->getConfigData('price')) - ($this->getFreeBoxes() * $this->getConfigData('price'));
    } else {
        $shippingPrice = false;
    }

    $shippingPrice = $this->getFinalPriceWithHandlingFee($shippingPrice);
    $shippingPrice = $this->get_pro_ship();

    if ($shippingPrice !== false) {
        $method = Mage::getModel('shipping/rate_result_method');

        $method->setCarrier('flatrate');
        $method->setCarrierTitle($this->getConfigData('title'));

        $method->setMethod('flatrate');
        $method->setMethodTitle($this->getConfigData('name'));

        if ($request->getFreeShipping() === true || $request->getPackageQty() == $this->getFreeBoxes()) {
            $shippingPrice = '0.00';
        }

        $method->setPrice($shippingPrice);
        $method->setCost($shippingPrice);

        $result->append($method);
    }

    return $result;
}

public function getAllowedMethods()
{
    return array('flatrate'=>$this->getConfigData('name'));
}

public function get_pro_ship()
{
Mage::getSingleton('core/session', array('name'=>'frontend'));
$session = Mage::getSingleton('checkout/session');
$cart_items = $session->getQuote()->getAllItems();
$_helper = Mage::helper('catalog/output');
$custom_ship=0;
foreach( $cart_items as $items ){

         $cur_fproduct = Mage::getModel('catalog/product')->load($items->getProductId());
    //$cur_fproduct = Mage::getModel('catalog/product')->load($items->getProduct_id());
$custom_ship +=($items->getQty())*($_helper->productAttribute($cur_fproduct, $cur_fproduct->getShippingWorld(), 'shipping_world'));
}

return $custom_ship ;

}// function end

}


texts:
I have used checkout_type_onepage_save_order_after. Means every time someone purchases some product, I want Magento to perform some action.

I have Paypal's "Website Payments Pro" and "Express Checkout" enabled. The above event seems to be working fine with "Website Payments Pro" but doesn't  seem to be working for "Express Checkout". My Config.xml is as follows.

<config>
    <frontend>
        <events>
            <checkout_type_onepage_save_order_after>
                <observers>
                    <checkout_order>
                        <type>singleton</type>
                        <class>classgroupName/observer</class>
                        <method>someMethod</method>
                    </checkout_order>
                </observers>
            </checkout_type_onepage_save_order_after>
        </events>
    </frontend>
</config>

Which method should I use? Is there any common Event for both payment methods?


texts: Magento 2 : How to call static block in category

texts:
In magento 1.9, I can call easily static block in category by assigning the Display mode to static block and select the cms block.

But i want to do it in magento2 also. I am doing same but not getting the cms block content.

I have cleaned the cache and also run following command

php bin/magento setup:static-content:deploy
php bin/magento setup:upgrade
php bin/magento indexer:reindex

Let me know what i am doing wrong.

Note : I am using custom theme. It is coming on default luma theme.

Thanks in advance.


texts: Automatically set inverse related products

texts:
I need to have that when saving a product it should automatically be set as related to its related products

UPDATED so it also removes the inverse related product when removed


texts: Customers cant login to account 1.7.0.2 after SUPEE-8788 Patch

texts:
I had the same problem as User login not work after SUPEE-8788 Patch

The suggested answers did not work for me, so I reversed the SUPEE-8788 Patch OK.

But still I cannot login to customer accounts.  Why would that be?

I am using /template/persistent/customer/form/login.phtml as my login file.

I am also having an issue of not being able to login to admin after logging out. Again I have seen this linked to 8788 (php under 5.6 - I have 5.4).  But still have issue after revert.

what is going on?

EDIT - this is not a duplicate of a question that I specifically referenced in my question that the result did not work.  It is quite lazy to say this is a duplicate as if you read the quection you can see that answer has been considered and does not work. And I said I reverted the patch and still had a problem.


texts:
My website is multi-store

Magento after upgrade 2.2.7 to 2.3.4, facing an issue which creates new order as below

countryId is required. Enter and try again.

On debug I came across that issue is in file

  [2020-02-14 10:14:59] report.CRITICAL: "countryId" is required. Enter
  and try again. {"exception":"[object]
  (Magento\Framework\Exception\InputException(code: 0): \"countryId\"
  is required. Enter and try again. at
  vendor/magento/module-customer/Model/ResourceModel/AddressRepository.php:133)"}

I have verified this link
https://github.com/magento/magento2/issues/14232 but not working

Following code is causing the issue

/*$countryElement = $this->_form->getElement('country_id');

    $this->processCountryOptions($countryElement);

    if ($countryElement->getValue()) {
        $countryId = $countryElement->getValue();
        $countryElement->setValue(null);
        foreach ($countryElement->getValues() as $country) {
            if ($country['value'] == $countryId) {
                $countryElement->setValue($countryId);
            }
        }
    }
    if ($countryElement->getValue() === null) {
        $countryElement->setValue(
            $this->directoryHelper->getDefaultCountry($this->getStore())
        );
    }*/


texts: Why is Magento 2 using the old jQuery 1?

texts:
I opened the developer console and executed jQuery.fn.jquery and I get 1.12.4.

Why does Magento 2 uses that old version, even though the latest version is 3.4.1?


texts: Fatal error: Class 'Mage_Core_Model_App' not found in app/Mage.php on line 670

texts:
I updated from 1.9.1.1 to 1.9.2.

After that first a SQL error showed up, admin panel was still working.
So I decided to do: renew index management and clear cache.

Then it was working again, a few minutes later problem came.

  Fatal error: Class 'Mage_Core_Model_App' not found in /var/www/clients/client1/web1/web/app/Mage.php on line 670

Anyone know how to solve this?


texts: ccavenue is not showing in magento 2.2 frontend

texts:
I have Downloaded and Installed cc avenue in my magento 2.2 website its working fine in back-end, but when i go to my checkout page from front-end
my extension is not showing there. If anyone know please Help.


texts:
I have a really strange problem.

Practically the word "Checkout" has disappeared both in the backend and in the frontend when I try to go to the checkout.
I think it's a translation problem, because en_US works fine in the store view.

But in the store view it_IT you present this bug.
How can I solve it?
I tried to delete the translation of the word "Checkout" but that doesn't change.

Magento 2.2.2 CE


texts: Magento 2 PayPal NVP gateway errors: The totals of the cart item amounts do not match order amounts

texts:
My base currency is U.S. dollar (USD)., when I go to PayPal express checkout, everything is working fine I can checkout in USD. But when I use Canadian Dollars (CAD) in PayPal express checkout,it is not working.
My magento version is magento 2.2.Please help me, thanks.


texts: Mask product URL when there's only one available in category

texts:
I have a product page

  http://www.domain.com/category-with-1-product/ramdom-url

And i need to rename the full url to a fixed url

  http://www.domain.com/fixed-url

ramdom-url changes every 24 hours.

I'm already redirecting to the product page when there's only one product in the category and the product in the category changes automatically every 24 hours.


texts: is possible to send two order email with diffrent diffrent email template with magento

texts:
Is it possible to send two order emails with different email templates?

If yes please let me know how we can solve this ?

or let me know if any extension will achieve this goal


texts: Fishpig - Display featured image outside of wordpress template

texts:
I'm trying to get the featured image from a wordpress page to display outside of the fishpig template. My site uses banners from Magento for product/category pages, but I also wish to use the same banner area for WordPress featured images if possible.

So for example, if I go to a page created in wordpress and that page has a featured image defined, I'd want that to display in the block which I use for Magento banners.

I've included:

<?php if ($featuredImage = $post->getFeaturedImage()): ?>
<a href="<?php echo $post->getPermalink() ?>">
    <img src="<?php echo $featuredImage->getAvailableImage() ?>" alt="<?php echo $this->escapeHtml($post->getPostTitle()) ?>"/>

...in my banner phtml block, but obviously it needs $post to be defined to work.

To do that I've added (based on some other documentation):

<?php $post =  Mage::getResourceModel('wordpress/post')->load(); ?>

But again, I'd need an ID in there and I don't really know how to get that either.

So what I'm really asking is how do I get the ID of the current page/post? If I can't get that, is there a way of getting the featured image to display somehow?

Hopefully I'm not being too numb here!
Tom


texts: Create semantic url to redirect to section on frontpage

texts:
I would like to create a semantic URL for my print material that should look something like mysite.com/newsletter.
However I do not have a specific page for my newsletter at the moment. Therefore I would like to redirect to a specific section on the frontpage. Is this possible


texts: How to rename third-party table from our module in Declarative Schema in Magento 2.3.0?

texts:
I wanted to rename table ThirdParty to NewTable

So I wrote the following code:

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

        <column name="id" xsi:type="int" identity="true" />
        <column name="code" xsi:type="varchar" length="4"/>
        <column name="title" xsi:type="text"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="id" />
        </constraint>

</schema>

After setup:upgrade it is showing error as,

  Element 'table', attribute 'disabled': The attribute 'disabled' is not
  allowed. Line: 4


texts: Fatal error: Class 'Company_OrderReports_Block_Adminhtml_Inventoryreport' not found in /app/code/core/Mage/Core/Model/Layout.php on line 465

texts: Anyone have any clue as to what is causing this error in my custom report module?


texts: Override getValueHtml in Magento\Bundle\Block\Sales\Order\Items\Renderer

texts:
I am trying to override the getValueHtml function inside Magento\Bundle\Block\Sales\Order\Items\Renderer.  When I test this in my order emails it results in the entire item block being empty.  What gives?

I've got my module setup and inside di.xml I've got:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Bundle\Block\Sales\Order\Items\Renderer" type="Vendor\Module\Block\Sales\Order\Items\Renderer" />
</config>

Then under app/code/Vendore/Module/Block/Sales/Order/Items/Renderer.php I have:

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Vendor\Module\Block\Sales\Order\Items;

/**
 * Order item render block
 *
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Renderer extends \Magento\Bundle\Block\Sales\Order\Items\Renderer
{

    /**
     * @param mixed $item
     * @return string
     */
    public function getValueHtml($item)
    {
        if ($attributes = $this->getSelectionAttributes($item)) {
            if($attributes['qty'] == 1) {
                return $this->escapeHtml($item->getName());
            } else {
                return sprintf('%d', $attributes['qty']) . 'x ' . $this->escapeHtml($item->getName());
            }
        } else {
            return $this->escapeHtml($item->getName());
        }
    }

}


texts: How to create my own custom search bar Using Algolia Api's. Magento 2

texts: I want to create a custom search bar in which I can search Orders using Algolia Api's. I know that there is an Algolia extension which is used for to search products but How can I use Algolia Api's to sync with my Media n search Products?? I'm totally blind in this scenario Please just show me the way that how to start with Algolia Api's. Thanks


texts: Add tab to Product Information in admin panel

texts:
I am trying to add a custom tab to the Product Information page:

I have followed the instructions on the following websites but have been unable to get the custom tab to appear:

http://www.webspeaks.in/2012/02/create-custom-tab-in-magento-product-addedit-page.html
http://magento.roars.in/add-custom-tabs-to-the-magento-product-admin/add-custom-tabs-to-the-magento-product-admin/ (Site can not be reached)
http://www.atwix.com/magento/new-tab-product-edit-page/

How do I add a custom tab to the product information page in the admin panel?

I have the FishPig Wordpress Integration plugin that is adding blog tabs to the page - could these be conflicting with my tab somehow?

[edit]

I have set the FishPig plugin as inactive via its xml file, and my custom tab still does not show - so I do not think there is a conflict with this plugin.


texts: “We can't add this item to your shopping cart right now” on cart add product

texts:
How to resolve ???

I has changed in vendor\magento\zendframework1\library\Zend\Cache\Backend\File.php:99

Change 'cache_dir' => null to 'cache_dir' => 'var/cache'. And not resolve this.

Plsssss help me !!! Thank Alls :D


texts: Warning: include(KiTT.php): failed to open stream: No such file or directory

texts:
I am trying to upgrade a Magento installation from 1.8.1.0 to 1.9.3.2. I have followed the guide on Upgrade Roadmap for Magento Community Edition (CE) 1.8 or 1.9 and I am now checking if the system is working as intended.

I get the following error in apache error log when going to the root path of the shop. Klarna Payment extension is a module that implements Klarna payment for the Magento installation.

[Tue May 23 14:45:59.183592 2017] [:error] [pid 14798] [client 111.222.333.444:55470] PHP Fatal error:  Class 'KiTT' not found in /path_to_magento_shop/app/code/community/Klarna/KlarnaPaymentModule/Helper/Api.php on line 83

The KiTT library is present in lib/:

$ find lib -maxdepth 1 -ls | grep KiTT
3148215    4 dr-xr-x---  10 myuser www-data     4096 Mar  9 13:32 lib/KiTT


texts: magento 2 flash message display in a modal

texts:
magneto flash message

display popup in a modal


texts: Magento 2.3.4 version product thumbnails & product image issue on product detail page [PDP]

texts:
I have just updated Magento to 2.3.4 but facing an issue of images on Product Detail Page(PDP).

I have changed the layout of thumbnails as vertical. After changing the thumbnail image layout on PDP product images are not displaying.

If I kept the layout as horizontal then gallery images & product image is showing. But this does not happen with the vertical layout.

I have checked with galley.phtml file as well as by changing its JSON but still facing the issues.

Any quick help will be appreciated.

Thank you.


texts: Why aren't Magento developers using Zend Framework 2 for Magento 2?

texts:
Magento will continue to mostly use the original Zend Framework (version 1) for Magento 2 (source: Magento 2 and Zend Framework 2  )

Seeing as how Magento 2 will not be backwards compatible with Magento 1 anyway, why are they not upgrading to Zend Framework 2?

I'm hoping for an authoritative, technical answer.


texts: Magento : In Controller get POST data and that data added to pdf file after attachment send mail

texts:
In Magento, while submit form from frontend in controller using post method i got every data. I want create one pdf file and keep this data in it after that attachment of this file and send with mail.

Thanks in advance.


texts: Magento 2 : Upgrade from 2.0.2 to 2.1.2 already exist error

texts:
My current magento version is 2.0.2. In this version i override default module by putting that module inside app/code/Magento directory Ex. app/code/Magento/Theme and everything work fine.

Now i upgrade magento from 2.0.2 to 2.1.2

After upgrade it display following error :

  Autoload error: Module Magento_Theme from {magento root}\app\code\Magento\Theme has been already defined in {magento root}/vendor/magento/module-theme.

If i remove theme folder it solve my error.But i can't remove because i already done changes in that.


texts: Updated to 2.3, now Product Pages Just Show Image

texts:
Not even sure where to begin with this one. Updated Magento from 2.2 to 2.3, and now when you go to a product page, only the image loads. There's nothing in the body but that and some javascript, then an error:

Uncaught Error: Call to a member function getOptionsJson() on null in /home/vagrant/code/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml:46

Which is pointing at "options": <?= /* @noEscape */ $block->getGalleryOptions()->getOptionsJson() ?>, but I have absolutely no idea what getGalleryOptions is doing or why it would be null.


texts: What are the possible Argument Namespaces for Logos

texts:
I am tweaking my theme using the xml approach.

I have this xml code:

<referenceBlock name="logo">
    <arguments>
        <argument name="logo_file" xsi:type="string">images/my-override-logo.png</argument>
        <argument name="logo_img_width" xsi:type="number">160</argument>
        <argument name="logo_img_height" xsi:type="number">240</argument>
        <argument name="logo_img_alt" xsi:type="string">Alt string for SEO and Accessibility purposes</argument>
    </arguments>
</referenceBlock>

My alt string is not correctly coded because I can't get the alt attribute string to render to the page. Any suggestions?


texts:
I'm trying to create an admin form in Magento 2 using UI-components and I want to make it have the M1 look with tabs instead of collapsible fieldsets.
I did some digging and found that there are 2 types of layouts defined.

generic (collapsible fieldsets)
tabs.

They are defined in the di.xml of the module Magento_Ui.

<type name="Magento\Framework\View\Layout\Pool">
    <arguments>
        <argument name="types" xsi:type="array">
            <item name="generic" xsi:type="array">
                <item name="class" xsi:type="string">Magento\Framework\View\Layout\Generic</item>
                <item name="template" xsi:type="string">templates/layout/generic</item>
            </item>
            <item name="tabs" xsi:type="array">
                <item name="class" xsi:type="string">Magento\Ui\Component\Layout\Tabs</item>
                <item name="template" xsi:type="string">templates/layout/tabs</item>
            </item>
        </argument>
    </arguments>
</type>

I found also that by adding this inside of my ui component file, changes something but the form does not load.

<item name="layout" xsi:type="array">
    <item name="type" xsi:type="string">tabs</item>
</item>

Also I did not find the template referenced by the di.xml mentioned above called templates/layout/tabs.
Am I missing something or is this an unfinished feature?


texts: Is it possible to add extra amount on authorized amount on PayPal in Magento 2?

texts:
Is there any way to add extra amount or additional charge in authorized payment on Paypal account?

Currently, we are not using the shipping method in Magento 2 order and we are using Paypal payment method and we want to add the additional amount on the authorized amount in Paypal for the shipping method after the order placed.

So can you please let me know how can I achieve this functionality?

Help would be appreciated.


texts: How to add one custom field into register page and get it working?

texts:
I have been looking into some tutorials but none of them works, for example, first they told me to open xxx files and edit something but what I found on my files is just a class with no single method inside it.

Currently I have got register.phtml(/template/persistent/customer/form) to show the custom field named Website but I don't know how to get it working with all functions of the site.

My Magento version is 1.7.0.2

Please advice.


texts: Disapperead All Products and Error on System.log

texts:
congratulations to the community, I use it a lot to find solutions that are always useful, but this time I'm completely blocked.
After doing a setup: upgrade and a setup: di: compile following installation of Welt Pixels, all products in the categories are gone.
I can see them in the Products section (in the backend) but in the Frontend they seem "invisible". In the categories it doesn't tell me that there are no products, they just aren't seen.
I've tried re-indexing, clearing cache, and all ordinary operations, but nothing to do.
I tried to see the log files (system.log) which gives me this error:
main.CRITICAL: Warning: Invalid argument supplied for foreach() in /var/www/html/magento/vendor/magento/module-catalog/view/frontend/templates/product/image_with_borders.phtml on line 27 [] []

In the phtml file mentioned in the logs I find this:
<span class="product-image-container product-image-container-<?= /* @noEscape */ $block->getProductId() ?>">

        <img class="<?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
            <?php foreach ($block->getCustomAttributes() as $name => $value): ?>
                <?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtmlAttr($value) ?>"
            <?php endforeach; ?>
            src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
            loading="lazy"
            <?php if ($borders || $enableLazyLoadingWithoutBorders): ?>
                width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
                height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
            <?php else: ?>
                max-width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
                max-height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
            <?php endif; ?>
            alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>"/>

Specifically, line 27 reads:
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>

I am hoping for your guidance, I can't figure out if it's an array problem or something.


texts: How to change the title text on the sale email?

texts:
How can I change the title text on the sale email?

I always get this in my email when I make an order,

Main Website Store: New Order # 100000016

I want to change it to,

[Name of my Store]: New Order # 100000016

Is it possible? where can I change it?

Also, in the sale email content,

  Thank you for your order from Main Website Store. Once your package
  ships we will send an email with a link to track your order. If you
  have any questions about your order please contact us at
  support@example.com or call us at Monday - Friday, 8am - 5pm PST.

  Your order confirmation is below. Thank you again for your business.

Where can I change all this? Especially Main Website Store?


texts: Magento 1.8.1 SUPEE-8788 "saving rejects to file downloader/lib/Mage/HTTP/Client/Curl.php.rej"

texts:
I am scratching my hair on this. Here is what I did to apply the SUPEE-8788 patch to my 1.8.1 store:

Never installed Revert SUPEE-8788 v1
Reverted SUPEE-1533 successfully
Never installed SUPEE-3941
Trying to Install SUPEE-8788 v2, and here is the only error I get:

  patching file app/etc/modules/Mage_All.xml
      patching file app/locale/en_US/Mage_Media.csv
      patching file app/locale/en_US/Mage_Uploader.csv
      patching file downloader/lib/Mage/HTTP/Client/Curl.php
      Hunk #1 FAILED at 372.
      1 out of 1 hunk FAILED -- saving rejects to file     downloader/lib/Mage/HTTP/Client/Curl.php.rej
      patching file js/lib/uploader/flow.min.js
      patching file js/lib/uploader/fusty-flow-factory.js
      patching file js/lib/uploader/fusty-flow.js

I found a suggestion to replace the Curl.php file with original 1.8.1 download - I did this as well, but I still get the error.

Please help!


texts: How to compile gallery and calendar css with grunt?

texts:
I have put gallery.less and calendar.css in web\mage\gallery and web\mage respectively in my custom theme,  But they are not compile with grunt.

How can i compile these files with grunt like other modules and web\css\source less files ?


texts:
I thought it was simple but i think it is not.
The case is:
I have simple products that for now have 2 own options to it, both with the same sku.
option 1 is preinstalled and option 2 is not preinstalled.
This worked fine but now i need these simple product in a product bundles.

In product bundles simple products with own options are not selectable. So i thought to make configurable products and make the options "installed and preinstalled" as an atribute an insert these in 2 seperate simple products. This works only problem is that now i need to give them a different sku. And for me it is essential that the sku's stay the same, no matter if they have different options.

Please advise


texts:
I'm trying to install Magento 2.1.1 on unix server but when it does system check I keep on getting following error message and application will not install.

  Your PHP Version is 5.6.22, but always_populate_raw_post_data = 0. $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1. If you need more help please call your hosting provider.

After using:

phpinfo();

I get:

Configuration File (php.ini) Path      /opt/alt/php56/etc

Loaded Configuration File         /home/some9753/public_html/php.ini

Scan this dir for additional .ini files         /opt/alt/php56/link/conf

Additional .ini files parsed       /opt/alt/php56/link/conf/alt_php.ini

I don't have access to the directories /opt/alt/php56/etc, apart from that in the php info file always_populate_raw_post_data is set to -1 for Local Value as well as Master Value.

The Loaded Configuration File php.ini was created by myself and and placed in public_html folder. It contains:

always_populate_raw_post_data = -1;

But it is not solving problem. I don't know how the installer is coming up with always_populate_raw_post_data = 0 when it is not set to that value anywhere. Any suggestion as to what I should do to solve problem? All help will be greatly appreciated.


texts: Magento 2: Why do I see an extra IMG tag beside the actual IMG intended for logo on the home screen?

texts: as seen in the image below, my Magento site displays an IMG tag before the IMG tag meant for displaying logo on the homepage. Please tell me how to eliminate the first unwanted IMG tag logo-white.svg. thanks.


texts: How to show Product Attribute name in column?

texts:
I Have a custom table that saves product attribute Id. For E.g

id, color_id, brand_id
1,123,122

Now I wanted to show attribute option value( Color name, brand name) on Admin grid of custom module.

I have added new columns  in _initSelect() function in collection.php file  as follow.

$this->getSelect()->columns(array(
         'brand' => new \Zend_Db_Expr('(select value from eav_attribute_option_value where  option_id = brand_id)')
     ));
$this->getSelect()->columns(array(
         'color' => new \Zend_Db_Expr('(select value from eav_attribute_option_value where  option_id = color_id)')
     ));

But, After adidng above I am not getting values in grid.

<column name="brand">
    <settings>
        <filter>text</filter>
        Brand
        <editor>
            <editorType>text</editorType>
            <validation>
                <rule name="required-entry" xsi:type="boolean">false</rule>
            </validation>
        </editor>
    </settings>
</column>

<column name="color">
    <settings>
        <filter>text</filter>
        Brand
        <editor>
            <editorType>text</editorType>
            <validation>
                <rule name="required-entry" xsi:type="boolean">false</rule>
            </validation>
        </editor>
    </settings>
</column>

How can we display name instead of attribute Id in grid?


texts: How to change product image size on category product view for a specific product only?

texts: I am trying to change the image size for a specific product only without affecting other products, how do I achieve this?


texts:
I searched through the whole internet but it seems im am the only one with this problem?

In the Magento (Version 1.7.02) Scheduler Timeline i got a running cronjob that runs since
15.12.2014 till now. Is there any way to delete / stop this job?
Server reboot, deactivation of the job didn't work.


texts:
I have followed the below steps to install

1) downloaded from https://marketplace.magento.com/mconnectsolutions-trackorder.html

2) extracted and placed code app/code/Mconnectsolutions/Trackorder

3) run the below commands

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy

php bin/magento cache:flush

sudo chmod -R 777 generated pub/media pub/static var/*

5) getting error in the fronted below is the screenshot of error.


texts: getting error during install magento 2.4 with elasticsearch

texts:
i have download setup from Magento site of Magento 2.4 and now i run below command for install Elasticsearch but getting error,
local xampp installation path : H:\xampp\htdocs\magento24

In SearchConfig.php line 81:Could not validate a connection to
Elasticsearch. No alive nodes found in your cluster

im uses windows 7 64 bit PC,
installed Xampp, localhost,

php -dmemory_limit=8G bin/magento setup:install
--base-url=http://localhost/magento24/ --db-host=localhost --db-name=magento24 --admin-firstname=Admin --admin-lastname=User --admin-email=admin@example.com --admin-user=admin --admin-password=admin@123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=127.0.0.1 --elasticsearch-port=9200 --elasticsearch-index-prefix=magento24

is there any mistakes in my command?
please help me on this.


texts: Is there any simple way to install Magento 2.4.1?

texts:
Whenever I am running this command to install Magento 2.4.1
php bin/magento setup:install
    --base-url="http://192.168.1.128/magento"
    --db-host="localhost"
    --db-name="magento2"
    --db-user="root"
    --db-password="Rudra@665"
    --admin-firstname="admin"
    --admin-lastname="sharma"
    --admin-email="abhpri13@gmail.com"
    --admin-user="admin"
    --admin-password="admin@123"
    --use-rewrites="1"
    --backend-frontname="admin"

This is showing the error in the Ubuntu command line

There are no commands defined in the "setup" namespace.


texts: what is the purpose of 'js' folder inside magento root folder?

texts:
I had seen 'js' folders inside my different theme folders, but what is the purpose of 'js' folder inside the root directory of magento ?

while navigating through the folder i found an index file inside it. curiosly When i just entered the url in my browser :

localhost/gk/js

i got this output in my browser

SYNTAX: index.php/x.js?f=dir1/file1.js,dir2/file2.js

this string is also visible in my live store, does this string provide any clues to hackers? im not a magento expert, Expecting more advises from experts.


texts:
i am using MAMP on Mac OSX Yasmite 10.10.5 and getting this error.

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

I have created database and name it magento.

Don't know where is the problem + there is no local.xml in magento/app/etc instead di.xml is available. Thanks in advance for any help.


texts: Transfered Magento website to a VPS and now I have an error

texts:
Unsure how I can remedy this situation. Could this be because I need to update the PHP? Here is the error report I am getting. By the way, how would I read this report so I understand what its asking me to change/fix?

Report:

a:4:{i:0;s:78:"The PDO extension is required for this adapter but the extension is not loaded";i:1;s:2522:"#0 /home/rstern123/public_html/lib/Zend/Db/Adapter/Abstract.php(248): Zend_Db_Adapter_Pdo_Abstract->setFetchMode(2)
#1 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Resource.php(165): Zend_Db_Adapter_Abstract->__construct(Array)
#2 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#3 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#4 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#5 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#6 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#7 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#8 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#9 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#10 /home/rstern123/public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#11 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#12 /home/rstern123/public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#13 /home/rstern123/public_html/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#14 /home/rstern123/public_html/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#15 /home/rstern123/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#16 /home/rstern123/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#17 /home/rstern123/public_html/index.php(87): Mage::run('', 'store')
#18 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}


texts: Magento tax doesnt get calculated based on [subtotal] minus [discount] but just [subtotal]

texts:
I've currently setup a coupon code that when entered gives 10% on everything in the shopping cart.

This works fine, my issue though is that Tax is calculated wrong.
Currently tax is calculated purely based on the  [subtotal]

If discount is applied I need tax to be calculated based on:
[subtotal] - [discount] = [amount_to_base_tax_calculation_on] * [tax_rate] = Correct tax

Is there any settings / options ive missed to make the checkout page do this?


texts: Automatically activating disabled shopping cart pricing rule in Magento2

texts:
I had a shopping cart price rule running last week which automatically applied 40% off at the checkout on full price product. This was expired on last Friday at 12:00 PM but I also disabled the promo at next day. After some days I have just noticed that the promo is again applying. Anyone faced this issue? My Magento Version is Magento 2.1.7
Thanks in advance


texts: Filter does not seem to work (pwa-studio demo)

texts:
I cloned pwa studio 3.0.0 and followed the instructions:

git clone https://github.com/magento/pwa-studio.git
cd pwa-studio
yarn install
MAGENTO_BACKEND_URL="https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/" yarn buildpack create-env-file packages/venia-concept
yarn run build
yarn run watch:all

The shop is running and I can change category, if I select category  bottoms and then click the filter button I get filter options. Then I select price and check $0.00 - $99.99. When clicking apply filter the url changes but the list of articles stays the same.

No errors in console and no XHR in network tab. The CATALOG/FILTER_OPTION/UPDATE action is dispatched and changes are made to the state (before closing the filter slider).

I was wondering if I missed something and/or where to look to hook up the filter to the effect that gets me the data. Am I supposed to hook it up myself or is this a bug?

If I have to it myself then where would I do it, do I do it here?

update

Looks like the filter feature is not implemented. Adding a price variable to runQuery and setting it as a filter will give me filtered results.

I am not sure what the intention is of the dev team but it looks like vinia-ui will get a complete overhaul so maybe not touching it until I'm clear what the dev team intends to do with this.


texts: New option value not inserting in eav_attribute_option_swatch

texts:
i have 700+ text swatch options..
whenever i add new one, it will insert in eav_attribute_option_value but the Admin value which is supposed to be inserted in eav_attribute_option_swatch is not being inserted, instead.. it will just update the last option before the new one.

for example:

last option is 90 ml and the new option is 1 inch.
after i saved it.. it will look like this

take note
its not about the max_input_vars
this is my setting
max_input_nesting_level 128
max_input_vars 100000


texts: One Page Checkout begin at top of screen on next

texts:
I use a vertical one page checkout methode, so that the steps are taken vertical.

When the first billing page is filled in, I want to begin all next steps at the top of the page.

I edit skin/frontend/base/default/js/opcheckout.js and replaced the gotoSection as follow.

Default:

gotoSection: function (section, reloadProgressBlock) {

    if (reloadProgressBlock) {
        this.reloadProgressBlock(this.currentStep);
    }
    this.currentStep = section;
    var sectionElement = $('opc-' + section);
    sectionElement.addClassName('allow');
    this.accordion.openSection('opc-' + section);
    if(!reloadProgressBlock) {
        this.resetPreviousSteps();
    }
},

Replaced with:

gotoSection: function(section, reloadProgressBlock) {

    if (reloadProgressBlock) {
        this.reloadProgressBlock(this.currentStep);
    }
    this.currentStep = section;
    var sectionElement = $('opc-'+section);
    sectionElement.addClassName('allow');
    this.accordion.openSection('opc-'+section);
    if(!reloadProgressBlock) {
        this.resetPreviousSteps();
    }
    jQuery("html, body").delay(10).animate({scrollTop: jQuery("#opc-"+section).offset().top }, 50);
},

That does work for the scroll, but it begin to early on the page and I need to edit it because we have a fixed header.

How can I edit this code, so that it is placed correctly with our fixed header?


texts: Magento 2: is it possible to migrate only customer using migration tool

texts:
I want to migrate all customers from magento 1.9.0.1 to 2.1.5 Magento. I dont want to migrate product and other things. Is it possible?

When i run bin/magento migrate:data this command it will migrate all things product, order and customer but I dont want migrate products and orders.


texts: How can I remove the Select All option from drop down in the Magento 2 admin product grid?

texts: I want to remove the Select All option from the drop down in the Magento 2 admin product grid.


texts: Programmatically updating product stock breaks script

texts:
I have a script which reads a text file which contains sku information.

Then in a loop the script loads each product's ID then creates the product object:

$id = Mage::getModel('catalog/product')->getIdBySku($isbn);
$product = Mage::getModel('catalog/product')->load($id);

Then the stock data is updated:

$product->setStockData(array(
           'manage_stock' => 1,
           'use_config_manage_stock' => 0,
           'is_in_stock' => 1,
           'qty' => $qty
            ));

$product->save();

This works however on larger amount of products to loop through the script just suddenly stops. For example one text file had 14,000 lines and on approximately the 7,000th loop the script just stops with no error message.

If we change the text file the same thing occurs.

I have checked the max_execution_time on the server and it looks fine.

I'm unsure if there's a Magento reason why the script breaks or anything else.

Any help is much appreciated.

Thanks.


texts: Magento2 - PayPal Credit/Debit is not working

texts:
I have enabled PayFlow Pro.

Paypal Credit/debit is not working.

When we enter payment details it does not take them.  Says to enter the valid credit card info.

Anyone have idea about this error.

Please help.


texts: Shopping cart always "empty" after 1.9.3.4 upgrade

texts:
I have upgraded magento to 1.9.3.4 via magento connect from 1.9.3.3 and now whenever I try to add a product to the cart it says shopping cart empty.
I added <?php echo $this->getBlockHtml('formkey') ?>  to all the form sections recommended to my theme (intenso theme) but that didnt work so I tested with both RWD and default themes and both of those behave the same and show cart as empty.

I have checked that <?php echo $this->getBlockHtml('formkey') ?> is in the form sections of both RWD and default themes and it is,so that is not the problem.

I have tried with both formkey validation on and off in the settings and get the same result. Ordering worked before on version 1.9.3.3.

I have cookie lifetime set to 86400, have tried different cookie domain settings and the cookie path is /

Im not sure what to try next as reading through other posts with the same problem they are all resolved by adding <?php echo $this->getBlockHtml('formkey') ?> to the relevent forms.


texts: Issue in 'catalog_block_product_list_collection' observer event

texts:
I need to filter my front end product collection to list product according to a custom attribute value. But the product listing page is not filtering according to my condition.

The code used are:
Vendor/Module/etc/frontend/events.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_block_product_list_collection">
        <observer name="disableproduct" instance="<vendor>\<module>\Observer\Collectionloadafter" />
    </event>
</config>

Vendor/Module/Observer/Collectionloadafter.php

<?php

namespace <vendor>\<module>\Observer;

use Magento\Framework\Event\ObserverInterface;

class Collectionloadafter implements ObserverInterface
{

    protected $_customerSession;

    public function __construct(\Magento\Customer\Model\Session $customerSession)
    {

        $this->_customerSession = $customerSession;

    }

    /**
     * Append review summary before rendering html
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return $this
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $productCollection = $observer->getEvent()->getCollection();

        $productCollection
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('customer_group_data', array('like' => '%1%'));

            return $this;
    }

    /**
     *
     */
    public function getGroupId()
    {
        $customerGroup = '';

        if ($this->_customerSession->isLoggedIn()) {

            $customerGroup = $this->_customerSession->getCustomer()->getGroupId();

        }

        return $customerGroup;
    }
}


texts:
What are the mapping of CE/PE/EE versions to corresponding Zend versions?

If possible I need a list going back before Magento 1.1.


texts: System role "Magento_Braintree::get_client_token" not found - Magento 2.2.6

texts:
Below URL throws the permission issue

https://host/admin/braintree/payment/getClientToken/key/c21228d08eaede792c0256b56e18c861d90c4598adae24e63f6fcc8ea8325e0d/?isAjax=true

  Sorry, you need permissions to view this content.

While debugging, I see the below admin resource in vendor/magento/module-braintree/Controller/Adminhtml/Payment/GetClientToken.php

  const ADMIN_RESOURCE = 'Magento_Braintree::get_client_token';

I don't see this role in anywhere in acl.xml and admin system role.

is this bug?


texts:
I am sending a special welcome email to a registered customer.

eMail is sending fine. The problem is, it takes the logo and footer specified in luma theme Magento_Email.

In my own theme, i created Magento_Email with custom logo and custom footer. but it still takes the luma theme's parts.

Actually i thought my theme has a problem. But, every other customizing work in my theme works fine. So, the theme han't the problem. Any ideas ?


texts: Which block file calls for My Account page when it loads

texts:
I have written some helper functions, which does some database inserts
The problem is I am calling all these functions from my phtml which gets loaded first time when My account is loaded for the first time.

Due to this, the changes on databases doesn't reflect on the first go, when I reload my page again then I see those changes.

There must be some block file which loads before My account phtml file so that I can call my helper function from that block file.

Where can I find those block files/ controller files of My Account and how can i call my helper function from those

Right now i am calling my helper function from my phtml like this:-

$temp_block = $this->getLayout()->createBlock('YX\Catalog\Block\OrderHelper');

$customerHelper = $this->helper('YX\Customer\Helper\CustomerHelper');

 if (!($customerHelper->isCustomer())){
     $customerID = $customerHelper->getCustomerId();
     $orderId = $customerHelper->getOrderId();
     $temp_block->guestToCustomer($orderId,$customerID);

 }

I am converting my guest checkout orders to my account order, When the user places an order as guest on success page he/she is asked to sign up to make an account, on signing up, the user is taken to my account page, so all the logic I wrote in phtml file in recent.phtml which is the first page so I wrote the above code in my recent.phtml , but it doesn't get reflected on the first go as the file is already been loaded, on the second reload I get to see the changes.


texts: How to change module name in magento admin

texts:
I am new in magento and I have made a module with the help of this plugin Easylife_Attr.

In this module I am unable to change display name in admin product tab and template title (See Image).

Now,How can I change display name.


texts: Magento does not show Special Price in Cart and Checkout but everywhere else

texts:
I checked my problem on google and also on stackexchange but could not find any solutions.

Basically this magento function is what I am using to get Price in Cart and also in Checkout from the quote Item.

     <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>

This always returns me the original price. In Catalog view in Product Page and in all other places special price is shown properly but not in cart and checkout.

Also totals are calculated based on original price, special price is not taken at there too.

How can I solve this issue with Magento?

Cheers


texts: How to not display out of stock products in magento?

texts:
I set the Display Out of Stock Products to No, and reindex, clear cache.
But still display.


texts: cannot Enable Template Path Hints for Storefront in Magento 2.3

texts:
Cannot Enable Template Path Hints for Storefront in Magento 2.3

Does anyone knows how to solve it?


texts:
I have some js that does an autocomplete:

jQuery("#city").autocomplete({
    source: "/route/to/countroller",
    minLength: 1,
    select: function( event, ui ) {
        if((typeof ui.item.province !== 'undefined')){
            jQuery("#city").val(ui.item.city);
            jQuery("#region_id").val(ui.item.province);
        }
        else{
            alert("Nothing selected, input was " + this.value );
        }
    }
});

I know the the controller gets hit, because i've debugged all of it and up until the point where i return results, everything works as it should work.

When I return the results, I do it like this:

return Mage::helper('customerdetails_addressvalidation/autocomplete')->jsonEncode($suggestions);

However, the suggestion dropdown under the input never appears to give me the options returned by the controller.

I know that the code works because I previously had the autocomplete JS source option pointing to a file in my magento root (for testing), and the suggestions were returned without a problem.

Is there some trick/special way to return the suggestions from a controller, as opposed to a file in the route?


texts: How to make a list of products from a custom variable?

texts:
I have a customized variable called "brand" and I want to show all products with the same value as this variable.
It is possible to do this with the advanced search. but the look is not very good.
If anyone can help me, I would be grateful.
I'm using Magento 2.3.6


texts: Purpose of magento\generated\metadata\global.php file and is it safe to delete this file?

texts:
I encountered the following issue when I was moved Magento 2 module into production with command setup:di:compile

  Uncaught Error: Call to a member function setActive() on boolean in /opt/bitnami/apps/magento/htdocs/vendor/magento/module-backend/Model/View/Result/Page.php:27\nStack trace:
  /opt/bitnami/apps/magento/htdocs/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('...')

I found a solution to delete magento\generated\metadata\global.php file which worked.

Does anyone know the purpose of global.php file and is it safe to delete it?

Thanks in advance.


texts:
I am running an old version of Magento - 1.3.1

Now - I would like to install the newest version (1.9.1) for a new store (different domain) on the same server. I have done that and it works. However, when I install a new theme - it gives me the following Error - CONNECT ERROR: Package community/AccessShop_Theme 1.0.0: requires PHP version >= 5.4.0 and <= 5.6.0 current is: 5.3.28

What would happen to the old Magento store (version 1.3.1) if I upgrade the pHp on the server to something like 5.6.0? Would it work or would it kill it?

Any other suggestions?


texts: Random Installation Wizard Redirect Magento 1.9.0.1

texts:
I have an install of Magento 1.9.0.1 community edition that is all ready to launch except one problem I continue to run into.  Randomly at different times it will redirect to /index.php/install/.

I have cleared the cache and sessions many times, even restarted the server after clearing the cache and sessions twice as another poster had said worked for him.  But after a short period of time of success, this problem keeps popping up.

I checked to make sure that my local.xml file is there and has the install date in it.  So that checks out just fine.  I compared it to other Magento installs I did (none running 1.9 though as this is my first) and the file looks fine.  Also, I have error and exception logging turned on with nothing being logged on this.

The tricky thing is that it doesn't always do it, but randomly.  I can get around it by just going back to the page I was trying to browse through, but don't want visitors to see this redirect.

There doesn't seem to be a particular category, event, time of day, etc that triggers the redirect more often.  Sometimes I can go 60 minutes without the redirect to install and other times I get the problem a few times a minute.

Any help that anyone can provide is appreciated.

Thanks!


texts:
I have Magento configured to be running from a /shop/ folder in a website build.  The main site is a WordPress wrapper to the shop.

As the homepage is above the Magento folder, ideally I'd like to redirect the Magento homepage (/shop/) back up to the main website homepage.

I.e

/shop/ -> /
/shop/en/ -> /
/shop/de/ -> /

Can this be achieved with the admin URL rewriting system (ideal) or would I be better off achieving this via htaccess/nginx config?


texts: I want to change a product page design and reposition some elements

texts: I want to change the representation of product page like add some new things, reviews at the end of the page and reposition some elements. In which and where in files, I have to change. I am finding all given answers confusing.


texts:
I have a Sahara theme installed and wanted to change the browser tab name to my site name. It was called as per theme "Sahara Home Page".

I changed the title but I thought it was OK to change the URL key as well. Wrong!
Now I don't see my feature products and other modules which are part of the theme. It now says "No Home CMS page configured or found".

Now I don't recall the set url key and I have no idea where to find it.
The fields in the picture are what I believe it was as default however I don't see it restored. Even when I change the title it now stays with my shop name even after re-index, cache re-flush etc. I'm such a Rookie! but hope you can help me. ;-) screen shot of CMS page


texts: "Please make sure your passwords match" - Password error in Checkout with New Registration form

texts:
I have been facing issue with Magento registration, when ever when I try to checkout with new registration, I get an password mismatch error "Please make sure your passwords match."
whereas the password entered is correct, but still I get the mismatch error, because of this, the user is unable to register itself and checkout the order,

The error I am getting in browser console is ,

Update:
By default, when I click "Register" option in checkout step, the registration form shows saved username and password of some other page in "Fax" and "Passwords" fields. So I deleted it and typed new password. Then I tried to print the values of "pass.value" and "conf.value" before the line "return (pass.value == conf.value);" in the file /js/prototype/validation.js. . But When I print the values I got "my saved password" in pass.value variable and "empty value" in conf.value variable.

How can I fix this problem ?
Any help appreciated.


texts: Magento 2.4 Error: The attribute 'length' is not allowed

texts:
I want to change the field type of catalogrule_product table from varchar to text.
<column xsi:type="varchar" name="action_operator" nullable="true" length="10" default="to_fixed"
                comment="Action Operator"/>

For this first I overrided db_schema.xml as below:
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="catalogrule_product" resource="default" >
<column xsi:type="text" name="action_operator" nullable="true" default="to_fixed"
                comment="Action Operator"/>
    </table>
</schema>

But when I'm doing the setup:upgrade I'm getting the below error:
Invalid Document
Element 'column', attribute 'length': The attribute 'length' is not allowed.

Can anyone help me to resolve this issue?


texts: Remove Specific "Store View" settings for products

texts:
While setting up a CSV to import products through Magmi, instead of putting "admin" in the "store" column, I put the name of a "store view."

This in turn has now set unchecked the "use default" and put duplicate entries in the store view for those product. This is becoming an issue when disabling products through import, updating prices, etc..

Is there any way through PHP/SQL to programmatically remove these custom settings for a store view, while limiting the products it is affecting? I have the same prefix on all SKUs affected, and some have already been "cured."

EDIT: THIS ANSWER WORKED FOR ME

<?php

include 'app/Mage.php'; Mage::app();

/** store id for which you would like to KEEP values */
$defaultStoreId = Mage_Catalog_Model_Product::DEFAULT_STORE_ID;

/** @var Mage_Catalog_Model_Product $model */
$model        = Mage::getModel('catalog/product');
$resource     = $model->getResource();
$entityType   = $resource->getEntityType();
$entityTypeId = $entityType->getEntityTypeId();
$adapter      = $resource->getWriteConnection();

/** gather the names of all tables that contain the attribute values to be removed */
$tables = array();

/** get all attribute value tables, making sure to leave out catalog_product_entity */
$attributes = $entityType->getAttributeCollection();
$attributes->addFieldToFilter('backend_type', array('neq' => 'static'));
foreach($attributes as $attribute) {
    /** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute */
    $tables[] = $attribute->getBackendTable();
}
$tables = array_unique($tables);

/** get product ids of all products whose SKU begins with 16- */
$collection = $model->getCollection();
$collection->addFieldToFilter('sku', array('like' => '16-%'));
$productIds = $collection->getAllIds();

$valuesDeletedCount = 0;
foreach($tables as $table) {
    $condition = array(
        'entity_type_id = ?' => $entityTypeId, // here we ensure that we are only dealing with values belonging to PRODUCTS
        'entity_id IN(?)'    => $productIds, // here we make sure that we are only dealing with SKUs beginning with 16-
        'store_id != ?'      => $defaultStoreId, // here we make sure we are deleting from ALL stores except for DEFAULT
    );
    $valuesDeletedCount += $adapter->delete($table, $condition);
}
echo $valuesDeletedCount . ' non-default attribute values deleted.';

?>

saved as "reset_defaults.php" in my "/magento" directory


texts:
Magento 1.9 here, moved website from one hosting to another, now checkout is not working properly. After billing info, when I click "continue" it won't show me shipping info form.
I tried all solution i found in previous answer, but wasn't able to solve. No Javascript errors.
Another problem is that when i click on "Add to cart" button product is added but the waiting wheel doesn't disappear

Can you help ? Here's the website https://www.centocaffe.com/
Thanks
Dan


texts:
I want replacement of the following code in Magento 2.x

class Mage_Catalog_Block_Product_Bestseller extends Mage_Catalog_Block_Product_Abstract{
  public function __construct(){
    parent::__construct();
    $storeId = Mage::app()->getStore()->getId();
    $products = Mage::getResourceModel('reports/product_collection')
        ->addOrderedQty()
        ->addAttributeToSelect('*')
        ->addAttributeToSelect(array('name', 'price', 'small_image'))
        ->setStoreId($storeId)
        ->addStoreFilter($storeId)
        ->setOrder('ordered_qty', 'desc'); // most best sellers on top
    Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
    Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);

    $products->setPageSize(3)->setCurPage(1);
    $this->setProductCollection($products);
  }
}


texts: HOW to fix 404 error on order placement sagepay card on mobile and small screen

texts: 9.3 facing issue on small screen order place by sage show 404 pop not loading card form some help how to fix it


texts: I try to use Elasticsearch, But it doesn't work stability(Elasticsearch die a lot time). How can I use MySQL on Magento 2.4.2?


texts: Magento 2 update progress bar in check out page

texts:
What I've tried:

i18n/en_GB I've changed this line "Review & Payments,Reviewssss & Paymentsssss"

I've also changed this Shipping Methods, This Is my shipping methods and I was surprised to find this in the back end admin:

I know the file is responsible for rendering is progrees-bar.html

And what I am interested is in this pice data-bind="i18n: item.title.

So where this item.title  is coming from if not from a i18n/en_GB.csv file?

Any help appreciate thanks.


texts: Magento 2 change position of billing and shipping address are the same section?

texts:
We would like to change the position of My billing and shipping address are the same section to the top of the payment methods section.

Please refer attached screen shot and advise?


texts: Magento 2- Displaying Custom Category Attribute Option Values alphabatically in dropdown

texts:
If suppose, I want to display Options in alphabetically order for select/multiselect drown-down ADD CMS Block attribute in Magento Admin Category page. What is the best way for doing that?

Note: I am using Magento CE 2.1 version.


texts:
I have migrated my Magento site from shared to VPS, after complete migration it is showing some kind of error. Here it is.

  a:5:{i:0;s:250:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mojaric1_mage767.mgw0_log_visitor' doesn't exist, query was: INSERT INTO mgw0_log_visitor (session_id, first_visit_at, last_visit_at, last_url_id, store_id) VALUES (?, ?, ?, ?, ?)";i:1;s:2645:"#0 /home/mojaric1/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)


texts: Replace code to fertch all Orders from Database

texts:
I am new in Magento. I am trying to fetch Order related values from Database.I used $order = Mage::getModel('sales/order')->loadByIncrementId($orderNumber); this code previously. I retrieved all others values using that code. Here I used a specific OrderNumber. But now I would like to retrieve all values of Orders from Database. I would like to just replace this code $order = Mage::getModel('sales/order')->loadByIncrementId($orderNumber); so that I can use rest of the code.

Which code can I use here ?? Can anyone help me in this regard ??


texts:
I'm using Magento 2 CE Version 2.1.0

I'm following http://www.mage-world.com/blog/how-to-create-a-simple-module-in-magento-2-0.html

I have followed steps when i run it gives below error.

  {folder
  path}\magento2\app\code\Custom\Module\Controller\Index\Index.php

namespace Custom\Module\Controller\Index;

use Magento\Framework\Controller\Result\ForwardFactory;
use Magento\Framework\App\Action\Context;

class Index extends \Magento\Framework\App\Action\Action {

    /**
     * @var \Magento\Framework\Controller\Result\ForwardFactory
     */
    protected $resultForwardFactory;

    /**
     * @param \Magento\Framework\App\Action\Context $context
     * @param \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory
     */
    public function __construct(
    \Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory
    ) {
        $this->resultForwardFactory = $resultForwardFactory;
        parent::__construct($context);
    }

    public function execute() {
        $resultPageFactory = $this->resultPageFactory->create();

        // Add page title
        $resultPageFactory->getConfig()->getTitle()->set(__('Sample Module'));

        // Add breadcrumb
        /** @var \Magento\Theme\Block\Html\Breadcrumbs */
        $breadcrumbs = $resultPageFactory->getLayout()->getBlock('breadcrumbs');
        $breadcrumbs->addCrumb('home', [
            'label' => __('Home'),
            'title' => __('Home'),
            'link' => $this->_url->getUrl('')
                ]
        );
        $breadcrumbs->addCrumb('custom_module', [
            'label' => __('Test'),
            'title' => __('Test')
                ]
        );
        return $resultPageFactory;
    }
}

  1 exception(s): Exception #0 (Exception): Recoverable Error: Argument
  2 passed to Custom\Module\Controller\Index\Index::__construct() must
  be an instance of Magento\Framework\Controller\Result\ForwardFactory,
  none given, called in {folder
  path}\magento2\var\generation\Custom\Module\Controller\Index\Index\Interceptor.php
  on line 14 and defined in {folder
  path}\magento2\app\code\Custom\Module\Controller\Index\Index.php on
  line 21


texts: Warning: Missing argument 2 &3 for Varien_Simplexml_Config::loadString() errors in system.log

texts:
I am getting these errors in system.log. Magento 1.9.3.6

Warning: Missing argument 2 for Varien_Simplexml_Config::loadString(), called in /home/xxx/public_html/app/code/core/Mage/Core/Model/Config.php on line 786 and defined in /home/xxx/public_html/lib/Varien/Simplexml/Config.php on line 507
Warning: Missing argument 3 for Varien_Simplexml_Config::loadString(), called in /home/xxx/public_html/app/code/core/Mage/Core/Model/Config.php on line 786 and defined in /home/xxxx/public_html/lib/Varien/Simplexml/Config.php on line 507

I tried debugging them by adjusting the loadstring function in the config.php file:
public function loadString($string,$el,$filePath)
    {
        if (is_string($string)) {
            libxml_use_internal_errors(true);
            $xml = simplexml_load_string($string, $this->_elementClass);
            if (false === $xml) {
              //$errors = libxml_get_errors();
              echo "<br>";$filePath; die;
            }
            if ($xml instanceof Varien_Simplexml_Element) {
                $this->_xml = $xml;
                return true;
            }
        } else {
            Mage::logException(new Exception('"$string" parameter for simplexml_load_string is not a string'));
        }
        return false;
    }

Anybody a clue on how to troubleshoot further?


texts:
I would like to use the same template(catalog/product/list/upsell.phtml) to display a collection of products that share particular attributes with a specific product. The goal is to have the same design for both list of items.
One way is to edit the view product file and add some php code. Is there any better why to do so and respect the standards of magento ?


texts: How to enable interruptable downloads on downloadable products?

texts:
I have a downloadable product store.

My problem is that some of my files range over 1GB which is quite often, too large to download in one sitting. I want my customers to be able to pause their download session during the product download and restart at a later time.

Such as here

I've found two extensions that claim to do this, one at £150 that simply does not work for us. And one at £1,500 that is simply too much to pay.

I understand this is a common feature with modern browsers however we want to embed this directly into the 'Downloadable Products' tab in a magento account page. Not to mention most browsers have trouble interrupting downloads.

My question is, are there any other extensions which are capable of this? If not how would one start with building this functionality in, programmatically?

Edit: These are my response headers


texts:
I have a little problem. In the image Gallery the size of the image are of 1000px when the image that I have uploaded is 2280px. I would like to put the size at 1140px or max-width of the container.
The size container:

And the image size:

The code set the container to 1140px but the size of the image are 1000px.
How to change the size of the image?
Thanks!


texts: Magento 2: To set 301 URL in Magento URL rewrites for this particular search

texts:
How to set 301 URL in Magento URL rewrites?

From

https://www.example.com/catalogsearch/result/?q=%7Bquery%7D

To

https://www.example.com/catalogsearch/result/?q=query

I have tried with below specified URLs in the request path and target path but not working.

/catalogsearch/result/?q=%7Bquery%7D
catalogsearch/result/?q=%7Bquery%7D

Target Path

catalogsearch/result/?q=query

/catalogsearch/result/?q=query

May be this is duplicate of some 301 redirection related questions.


texts: how to create custom banner layout widget in magento

texts:
Categories row widget:

How to make a widget so I could create rows with categories.

Each row, I can choose how many images in the row (1, 2 or 3).
Each row, I can choose how much percent each image takes.
Each row, I can choose if there are spaces between the images.

The widget allows to upload images to the row and give each one a category link and text.

I am using magento 1.9.0


texts: How Can I Add a Body Class in Magento Go When the Browser is IE8?

texts:
I am using the following Custom Layout Update XML in Magento Go to add a body class if the browser is IE8. Currently this code adds the class for every browser instead of only IE8. How can I write this so it only adds the class for IE8?

<reference name="root">
  <action method="addBodyClass">
    <classname>ie8</classname>
    <if>IE 8</if>
  </action>
</reference>


texts:
I have recently downloaded Magento onto my computer and I keep getting errors, I have checked my php version and it is 5.6.3 but I still get this error.
Whoops,

it looks like you have an invalid PHP version.
Magento supports PHP 5.2.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.

Can anyone advise me on how to go about fixing this any help would be much appreciated :)


texts: How do you remove card design number on Amasty gift cards?

texts: When i set up gift cards and i add different card designs to choose from, when i look at this in store view it adds a row showing the id number of the image. Is it possible to remove the number and just have the image? or alter the id number of the image so it shows are something more relevant?


texts: Magento 2: Add attribute to customer grid

texts:
I want to show an custom attribute in the customers grid.

I created the customer attribute via upgrade script. The attribute is shown in adminhtml_customer so I can save values for this attribute.

Setup/UpgradeData.php

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

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

    if (version_compare($context->getVersion(), '0.2.0', '<')) {
        $customerSetup->addAttribute(Customer::ENTITY, 'phone_order_disallowed',  [
            'type'     => 'int',
            'backend'  => 'Magento\Customer\Model\Attribute\Backend\Data\Boolean',
            'label'    => 'Phone Order Disallowed',
            'input'    => 'boolean',
            'source'   => '',
            'visible'  => true,
            'required' => false,
            'default' => 0,
            'frontend' => '',
            'unique'     => false,
            'note'       => '',
            'adminhtml_only' => 1,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'is_searchable_in_grid' => false,
            'position' => 130
        ]);

        $phone_order_disallowed = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'phone_order_disallowed');
        $used_in_forms = array();
        $used_in_forms[]='adminhtml_customer';
        $phone_order_disallowed->setData('used_in_forms', $used_in_forms)
            ->setData('is_used_for_customer_segment', true)
            ->setData('is_system', 0)
            ->setData('is_user_defined', 1)
            ->setData('is_visible', 1)
            ->setData('sort_order', 130)
            ->save();
    }

    $setup->endSetup();
}

Now I read that I have to add etc/indexer.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Indexer/etc/indexer.xsd">
    <indexer id="customer_grid">
        <fieldset name="customer">
            <field name="phone_order_disallowed" xsi:type="filterable" dataType="int"/>
        </fieldset>
    </indexer>
</config>

And view/adminhtml/ui_component/customer_listing.xml:

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
        <column name="phone_order_disallowed">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="editor" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="label" xsi:type="string" translate="true">Phone Order Disallowed</item>
                    <item name="sortOrder" xsi:type="number">51</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

As you can see I can select the column, but it will be shown without values.

I already read some other questions here on StackExchange, but they couldn't provide the correct answer for me.


texts:
Currently my addExpressionAttributeToSelect method has nested expressions and I would like to make it more readable by splitting it into 2 or more addExpressionAttributeToSelect calls.

Is it possible to use the output of addExpressionAttributeToSelect call as a parameter for another addExpressionAttributeToSelect call, or is there an alternative way to get the same result?

This is my current expression:

$productCollection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect(*)
->addExpressionAttributeToSelect('name_lcase',"IF(SUBSTRING({{name}},4,1) REGEXP '^[A-Za-z0-9]+',LOWER(TRIM({{name}})),CONCAT(SUBSTRING(LOWER(TRIM({{name}})),1,3),SUBSTRING({{name}},5)))", 'name')
->addAttributeToFilter('name_lcase', array('like' => $some_string));

And here is the pseudo code for the simpler split version:

$productCollection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect(*)
->addExpressionAttributeToSelect('name_cleaned',"IF(SUBSTRING({{name}},4,1) REGEXP '^[A-Za-z0-9]+',{{name}},CONCAT(SUBSTRING({{name}},1,3),SUBSTRING({{name}},5)))", 'name')
->addExpressionAttributeToSelect('name_lcase','LOWER(TRIM({{name_cleaned}}))', 'name_cleaned')
->addAttributeToFilter('name_lcase', array('like' => $some_string));


texts: Magento 2: I need to remove .html from category url

texts:
I need to remove .html from category Url.

e.g

https://mysite/categoryname.html

Required url:

https://mysite/categoryname

I am removing from admin. But it's not working.

Does anyone have a solution for this?

Thanks


texts:
When go to admin area and click on system --> configuration I get the below error, how can I fix this? It was working fine before.

Class 'Creare_DynamicSitemap_Helper_Data' not found in /home2/aesaudio/public_html/app/Mage.php on line 546

I am using magento 1.8.0.0

Please advise.


texts:
I have successfully created a custom shipping method using this tutorial. I am unable to display this information in the admin panel correctly. This is my code just like the one in above tutorial

class Excellence_Pickup_Model_Sales_Order extends Mage_Sales_Model_Order{
public function getShippingDescription(){
    $desc = parent::getShippingDescription();
   // print_r($desc);
    $pickupObject = $this->getPickupObject();
    if($pickupObject){
        $desc.= '\r\nShipping Carrier:'.$pickupObject->getShp_carrier();
        $desc.= '\r\nShipping Carrier:'.$pickupObject->getAccountno();
        $desc.= '\r\nShipping Carrier:'.$pickupObject->getShp_method();
    }

    return $desc;
}

}

As you can see i am using "\r\n", i also have tried using "br" tags but they also appear as it is in the admin panel as shown in the image below.

What is the way forward?


texts:
I need a way to create a promotion code linked to a group of products. What I mean is:
Promotion code 1 will add item1, item2 and item3 to the shopping cart for free
Promotion code 2 will add item1, item4 and item5 to the shopping cart for free
etc

My understanding is that this is not possible using the built-in promotion code feature.

QUESTION: Is there a plugin out there to do this?

thanks


texts:
Magento collection has two methods for filtering:

1. Varien_Data_Collection_Db::addFieldToFilter
2. Varien_Data_Collection::addFilter

Seems that both methods add where condition to Zend_Db_Select.
And what advantages does addFilter bring? When should I use it instead of addFieldToFilter ?


texts: Delete or Save category works in bootstrap file but not in my custom API controller when flat categories are enabled

texts:
I am trying to create and delete categories in Magento 2 but am facing some issues while doing it when Flat Categories option is enabled.

The weird thing is, my code works fine when called from a bootstrap file like this.

<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode(\Magento\Framework\App\Area::AREA_FRONTEND);
$registry = $obj->get('\Magento\Framework\Registry');
$registry->register("isSecureArea", true);

$category = $obj->create('\Magento\Catalog\Model\CategoryFactory')->create();
$data = ['name'=>'Test', 'url_key'=> 'test'];
$parentId = 52;
$parent = $categoryFactory->create()->load($parentId);
$category = $categoryFactory->create();
$category->setData($data);
$category->addData([
    'parent_id' => $parentId,
    'path' => $parent->getPath(),
    'default_sort_by' => 'position',
    'display_mode' => \Magento\Catalog\Model\Category::DM_PRODUCT,
    'include_in_menu' => 0,
    'is_anchor' => 1
]);
$category->setStoreId(0)->save();

die('<br>done');

But when I execute the same code form a custom API controller, it fails with the following error while calling $category->save() when storeId is set to 0.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'm23.catalog_category_flat' doesn't exist, query was: SELECT `catalog_category_flat`.* FROM `catalog_category_flat` WHERE (`catalog_category_flat`.`entity_id`='52')

If I set storeId to 1 then I get this error

Uncaught Error: Call to undefined method Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat::getEntityTable()

I solved a similar issue in Magento 1.9 by using this

$category = Mage::getModel('catalog/category', array('disable_flat' => true));

Any idea how to solve this in Magento 2? :/

Thanks


texts: Get refunded items (only simple products: qty and price) programmtically

texts:
I have wrote a script to try to get the refunded items qty and price

foreach($credit_memos as $credit_memo) {

    $items = $credit_memo->getAllItems();
    foreach ($items as $item) {
        echo $item->getSku()." X ".$item->getQty()."<br>";
    }

}

but it print out also the configurable item

test2 X 1.0000
mtk005 X 1.0000
mtk005 X 1.0000
wbk004 X 99.0000
wbk004 X 1.0000

Here are my questions
1) how can i get refunded amount of each item?
2) how can i remove the configurable line?


texts: Why observer->getEvent() gives the option to bring orders ids?

texts:
I don't understand why Magento gives the option to bring orders id's instead of just the recently order id, I'm developing a module and using this on the checkout_onepage_controller_success_action event:

    $orderIds = $observer->getEvent()->getOrderIds();
    $orderShippingMethod = $order->getShippingAddress()->getShippingMethod();

    $mediaBaseUrl = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);;

    foreach($orderIds as $orderId)
    {
        $order = $this->_order->load($orderId);
        /// more code...
    }

Is there a situation when this code will return me more than one id?


texts: Mocked shared instance incomplete on second identical integration test

texts:
I'm writing an integration test on a plugin that changes the action of an existing form.

The plugin calls a helper method that decides whether the url should be changed and returns the result.

I learned from Vinai Kopps very nice tutorials on testing that I could add a mocked sharedinstance to the objectmanager. This mock would then be used when the class is created. I think the following test uses this principe and it runs correctly:

    public function testUrlIsChangedByPlugin()
{
    $mockHelper = $this->getMockBuilder(Helper::class)
        ->setMethods(['getBooleanFromHelper'])
        ->disableOriginalConstructor()
        ->getMock();
    $mockHelper->expects($this->once())->method('getBooleanFromHelper')->willReturn(true);

    $this->objectManager->configure([Helper::class => ['shared' => true]]);
    $this->objectManager->addSharedInstance($mockHelper, Helper::class);

    /** @var FormBlock $formBlock */
    $formBlock = $this->objectManager->create(FormBlock::class);
    $this->assertContains('new/action/path', $formBlock->getFormAction());
}

Directly after this test, I would like to test nearly the same, but now the mocked helper should return false. It looks like this:

    public function testUrlIsNotChangedByPlugin()
{
    $mockHelper = $this->getMockBuilder(Helper::class)
        ->setMethods(['getBooleanFromHelper'])
        ->disableOriginalConstructor()
        ->getMock();
    $mockHelper->expects($this->once())->method('getBooleanFromHelper')->willReturn(false);

    $this->objectManager->configure([Helper::class => ['shared' => true]]);
    $this->objectManager->addSharedInstance($mockHelper, Helper::class);

    /** @var FormBlock $formBlock */
    $formBlock = $this->objectManager->create(FormBlock::class);
    $this->assertContains('old/action/path', $formBlock->getFormAction());
}

This second test fails (Method was expected to be called 1 times, actually called 0 times)

When I look in the debugger, the first time the mocked shared instance looks like this:

The second time it looks like this:

I tried removing the shared instance in tearDown() ($this->objectManager->removeSharedInstance(Helper::class);), but that didn't help.

My questions:

What could be the reason that the mocked shared instance misses the expected return method the second time the nearly identical test is run?
Is this approach any good, or should I have constructed the plugin (or test) in a completely different way? (I am actually most interested in this)


texts: Why magento is redirecting secure url to unsecure url

texts:
I've been using Magento shop on an unsecured host for almost a month. I recently setup a secure host(SSL) and directed it to point to same directory as used for unsecured host. But to my surprise, when i try to login to admin panel using secure url, it redirects me to the unsecured one.

I have changed secure_base_url in core_... table, as well as cleared the caches, but its still not working.

Whats happenning ?

Thanks in advance for the help...


texts:
i don't know why but for some time, When in cancel an order, I get this error :

when i want block the order, i get the same message.

However when I cancel from massAction, it's work.
Anyone have an idea?

Hoping you can help me.


texts: How to add new Checkout step with custom form and save data in Magento 2.3.3

texts:
I am trying to add a new step in checkout and i have only virtual products which does not provide me shipping step so basically i  only get payment method only.
I want to  add a custom step having fields like text boxes check boxes and drop downs.

As you can see all this fields i want to add in my custom step and data should be saved.
What i tried is :

1. Made Shipping Form Visible for virtual product and tried to change mandatory fields but that didn't worked for me.
And other many things i have tried to alter shipping form but i decided to do this thing by making a new step and new form with the values getting saved.
I straggling on this from last 2 weeks but didn't able to solve this.
Again i am repeating i just want a new step with the form and values getting saved.
Form should have values given in the image.
Small Help Will Be Greatly Appreciated.

Thanks in Advanced :)


texts:
We are using Magento 1.5.1.0 version for the main website.

There are around 1000 orders placed in the website and 1500 avg visitors on site.

We are using mongodb to store the sessions the mongodb size was increasing 4GB on every day.

Can you please provide some suggestions to optimize / minimize the storage of sessions.

Thanks


texts:
I am really new to magento,I am trying to add my own html page that I have created using visual studio,
its an html file so I have renamed it to .phmtl
I have places my file in this location

app/design/frontend/default/modern/template/page/profile.phtml

and then I have placed this code

{{block type="core/template" template="page/profile.phtml"}}

in the content area on the cms page.
Once I have done this work nothing happens and page does not use the file profile.phtml
I wanted to know is it possible to add my page this way or am I doing something/everything wrong?
Also the actual profile.html page is not in php its in simple html/css/javascript/jquery  file with jquery library tags etc in it.
Please reply if anybody know the answer to my question.
Thanks in advance


texts: Magento and Varnish (Turpentime) Mini Cart is being cached

texts:
I've just configured correctly the Varnish cache, finally, but now I ran into some issues...

I've notices, at the moment one important error and can't get to fix it.

The thing is that the Mini Cart (in my header) is beeing cached and displayes wrong information when accessed by another visitor.

How can I disable the mini cart caching??

I tryed modyfing the checkout.xml like this:

<reference name="top.links">
    <block type="checkout/links" name="checkout_cart_link">
        <action method="addCartLink"></action>
        <action method="addCheckoutLink"></action>
        <action method="setEsiOptions">
            <params>
                <method>ajax</method>
                <access>private</access>
            </params>
        </action>
    </block>
</reference>

<reference name="header">
    <block type="checkout/cart_minicart" name="minicart_head" template="checkout/cart/minicart.phtml" before="-">
        <block type="checkout/cart_sidebar" name="minicart_content" template="checkout/cart/minicart/items.phtml">
            <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>
            <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>
            <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/minicart/default.phtml</template></action>
            <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/minicart/default.phtml</template></action>
            <action method="setEsiOptions">
                <params>
                    <method>ajax</method>
                    <access>private</access>
                </params>
            </action>
            <block type="core/text_list" name="cart_sidebar.cart_promotion" as="cart_promotion" translate="label" module="checkout">
                Mini-cart promotion block
            </block>
            <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
                Shopping Cart Sidebar Extra Actions
            </block>
        </block>
    </block>
</reference>

By setting the ESI Options, but it didn't help,

Any ideas?

UPDATE

I've managed to retrieve the cart items, by adding this to the local.xml:

<default>
        <reference name="minicart_head">
            <action method="setEsiOptions">
                <params>
                    <access>private</access>
                    <ttl>0</ttl>
                    <method>ajax</method>
                </params>
            </action>
        </reference>
    </default>

But still having an issue with the counter, it's not beeing updated, any help, please?


texts: Create Duplicate quote item instead of updating existing quote item for same product

texts:
Requirement--

I have created a custom Purchase Order module for my Magento Store, in which a same product may be supplied from many suppliers. You will be fully cleared from below

example-

(1) A product P1 has been supplied to my store from three supplier say S1, S2 and S3 with quantity 5,10,15 respectively.
Now I want to show SUM of all quantities i.e (30=5+10+15) to catalog inventory Stock. till Now there is no problem in doing this.

(2) Now When same product P1 is added to cart(Either frontend or backend) with qty 5 or less the  there is no problem, order process will be Normal(as default). But if qty of same product P1 is added or updated greater than 5 (let's say 8) in quote then two rows(one row with qty 5 and second row with qty 3) should be created in sales_quote_item table corresponding to supplier S1 and S2, but in cart (i.e. visisble to user On frontend and Backend as well) there should be only one row having qty 8. Same as if product P1 is added or updated with qty lets say 20 then there should be three rows corresponding to each supplier having qty 5, 10 and 5 but user should see only one row having qty 20.

(3) If user place order of this product P1 with qty 20 then three rows should be there in sales_order_item table with their qty.

(4) In invoice that will be printed out also should have single row for that product P1, so customer can see only one row of that product, he doesnt need to know about suppliers.

(5) In credit memo there should be three rows so admin can decide himself, product of which supplier should be returned .

What I am trying Now--

I am following "fschmengler" approach. I am trying to modify quote items while they are being converted to Order. Now I am stuck at How can I modify price and totals according to changed qty in sales table and How can I add same product multi-times in sales table and then recalculate order totals. I am using event sales_convert_quote_item_to_order_item


texts: Multi vendor + add product - force to choose only 1 category

texts:
So I'm trying to make it so that the vendors can only add their product to one category from the checklist category tree (I'm using CEDCommerce's multi vendor extension).

I'm sort of new to Magento still, so I'm not sure exactly how I would go about starting. I figured I would need to add some extra javascript in the list.phtml but I also see a reference to a script named decorateTable('my-products-table);

Just wondering if I'm on the right track. All help is appreciated!


texts: Magento 2: Can't switch from developer to production: "Command returned non-zero exit code:"

texts:
I've seen two other threads with this issue but I have been unable to resolve it with the solutions provided.

I've increased my memory limit to 1G in php.ini and I've set ini_set('memory_limit','2G'); right under my <?php tag in bin/magento.

In PuTTY I run;
/usr/local/php56/bin/php-cli /home/lfcstage/public_html/bin/magento deploy:mode:set production
which returns;
    Command returned non-zero exit code:
    php -f /home/lfcstage/public_html/bin/magento setup:static-content:deploy en_US 2>&1

However, when I run;

/usr/local/php56/bin/php-cli /home/lfcstage/public_html/bin/magento deploy:mode:set production

it completes successfully so I don't understand why I still can't toggle my mode back to production from developer.

I'm hosted on a cloud solution with SiteGround.
Specs: 1 x 3.0 GHz CPU Cores, CentOS, 2GB RAM, 20GB SSD, cPanel, Cloud Storage, Management Services


texts: What is Progressive Web Apps, or PWAs in Magento 2?

texts:
What does it mean that Magento is becoming a Progressive Web Application
platform?
What will be the code structure of PWAs in Magento?
What is the deal with REST APIs and PWAs?


texts: Magento 2.2.6 products not rendering on frontend after migration

texts:
We migrated products from Magento 1.9 to Magento 2.2.6.

But Products are not rendering on the frontend even after updating attributes on selecting all.

When we open single product in admin panel and then save it, it renders on frontend. But this is not a feasible solution since we have more than 5000 products.


texts: Discount on all products in one category

texts:
I want to have a 15% discount on all products in my "last chance" category. How do I do that? I tried making a rule, but nothing happens in the store.

Thanks :-)


texts: How to remove Magento's password matching in account registration form?

texts:
I am creating a custom user registration page for which I copied registration.phtml to another location and I am working with it.

And for that page I don't want the user to be enforced to enter the password twice.

How do I do that?


texts: How to get reviews collection on homepage in magento?

texts: I want to show product reviews on homepage with star rating, author name and review description but don't want to show product detail.


texts:
I have a problem with pagination in UI Component data grid of Magento2.

First time it loads page correctly and pagination works. But on clicking "back" button in paginator all rows change their original content and become copies of the same one row! Pagination direction does not matter, FIRST TIME it paginates correctly in both directions. The problem is only when visiting paginated data AGAIN.

Here is a link to code sample on GitHub:
https://github.com/mageplaza/magento-2-sample-module