texts: how to add column to manage customers grid and it should work as filter?

texts:
I want to add news letter subscribed or not as column.
but I dont have idea from which table i have to join.
can you any one help me on this?

class Gumbrands_Customergrid_Block_Adminhtml_Customer_Grid extends Mage_Adminhtml_Block_Customer_Grid{
    /**
     * override the _prepareCollection to add an other attribute to the grid
     * @return $this
     */
    protected function _prepareCollection(){
        $collection = Mage::getResourceModel('customer/customer_collection')
            ->addNameToSelect()
            ->addAttributeToSelect('email')
            ->addAttributeToSelect('created_at')
            ->addAttributeToSelect('group_id')
            //if the attribute belongs to the customer, use the line below
            ->addAttributeToSelect('news_letter')
            //if the attribute belongs to the customer address, comment the line above and use the one below
            //->joinAttribute('mobile', 'customer_address/mobile', 'default_billing', null, 'left')
            ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
            ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
            ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
            ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
            ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');

        $this->setCollection($collection);
        //code from Mage_Adminhtml_Block_Widget_Grid::_prepareCollection()
        //since calling parent::_prepareCollection will render the code above useless
        //and you cannot call in php parent::parent::_prepareCollection()
        if ($this->getCollection()) {

            $this->_preparePage();

            $columnId = $this->getParam($this->getVarNameSort(), $this->_defaultSort);
            $dir      = $this->getParam($this->getVarNameDir(), $this->_defaultDir);
            $filter   = $this->getParam($this->getVarNameFilter(), null);

            if (is_null($filter)) {
                $filter = $this->_defaultFilter;
            }

            if (is_string($filter)) {
                $data = $this->helper('adminhtml')->prepareFilterString($filter);
                $this->_setFilterValues($data);
            }
            else if ($filter && is_array($filter)) {
                $this->_setFilterValues($filter);
            }
            else if(0 !== sizeof($this->_defaultFilter)) {
                $this->_setFilterValues($this->_defaultFilter);
            }

            if (isset($this->_columns[$columnId]) && $this->_columns[$columnId]->getIndex()) {
                $dir = (strtolower($dir)=='desc') ? 'desc' : 'asc';
                $this->_columns[$columnId]->setDir($dir);
                $this->_setCollectionOrder($this->_columns[$columnId]);
            }

            if (!$this->_isExport) {
                $this->getCollection()->load();
                $this->_afterLoadCollection();
            }
        }

        return $this;
    }

    /**
     * override the _prepareColumns method to add a new column after the 'email' column
     * if you want the new column on a different position just change the 3rd parameter
     * of the addColumnAfter method to the id of your desired column
     */
    protected function _prepareColumns(){
        $this->addColumnAfter('news_letter', array(
            'header'    => Mage::helper('customer')->__('Mobile'),
            'index'     => 'mobile'
        ),'email');
        return parent::_prepareColumns();
    }
}


texts: URL rewrites are not updated before catalog_product_save_commit_after hook fires

texts:
I have observer for a hook catalog_product_save_commit_after with following XML config

<events>
    <catalog_product_save_commit_after>
        <observers>
            <mymodule_catalog_product_save_commit_after>
                <type>singleton</type>
                <class>My_Module_Model_Observer</class>
                <method>sendProductUpdate</method>
            </mymodule_catalog_product_save_commit_after>
        </observers>
    </catalog_product_save_commit_after>
    ...

I'm sending the product url via API to another service. When user changes the URL key in Magento's catalog product edit view I'm always getting URL containing the outdated URL Key in my observer.

Example:

Store url is http://notarealstore-just-an-example.com/ and I change a product's URL key from linen-blazer (product url being http://notarealstore-just-an-example.com/linen-blazer.html) to cotton-blazer. You would expect the product url to be changed to http://notarealstore-just-an-example.com/cotton-blazer.html. However I'm still getting http://notarealstore-just-an-example.com/linen-blazer.html as a product url in my observer. When I update the product again without changing the url key I get the URL correctly (http://notarealstore-just-an-example.com/cotton-blazer.html).

In short it seems the catalog_product_save_commit_after is fired before the product URLs are saved.

I'm using this method to fetch the product url

/* @var Mage_Catalog_Model_Product $product */
$product_url = $product->getUrlInStore(
    array(
        '_nosid' => true,
        '_ignore_category' => true,
        '_store' => 1,
    )
);

Any idea how to get the correct (updated) product url.


texts: Hi magenticians I need the code of the module magento 2 which allows to add a text input when clicking on a mass action to enter a value like this example


texts: How to solve Unable to load CSS and JS after setup magento 2

texts:
My using Ubuntu 18 and apache2

I downloaded magento2 zip file and extract

uploaded to my /var/www/html/

but always shows the above image

I already setup

htaccess file

Already tried comments:

php bin/magento setup:static-condent:deploy -f

cleared cache and still not working home page also

How i can solve Unable to load CSS and JS


texts: Magento2 Order Date is Wrong in Admin Grid

texts:
We created an order in magento2 with API calls. It is working fine as expected .

  We have created_at field date as 23-01-2020 12:12:12 in database where
  as in admin magento2 order grid it is showing as Order Date as    Jan 23,
  2020, 5:42:12 PM . Which is not matching with database value. How can
  i resolve this?

In Magento2 Store , I selected the Time Zone as India/Kolkata


texts: Magento2.3.2: url shows http instead of https

texts:
I am using magento2.3.2
I'd like to use the https in the url to maintain the website secure. I haven't purchase any ssl certificate. I have used encrypted certificate and installed via putty. There shows https is enabled to your site. But i haven't found the url is with https.
Website url : [Depoto website][1]
I have instance in aws-lightsail and ubuntu server.
[1]: http://depoto.com


texts:
I would like to display the product SKU on the category pages.

I managed to plant it in the short description on every product page using:

<?php echo $this->__('Product Code: ') . $this->htmlEscape($_product->getData('sku'));?>

this was on view.phtml

If i apply the same code inside list.phtml it displays on site "Product Code:" but no actual SKU number.

I am placing it just below:

<?php if ($gc['display_price'] == 1) echo '
'; ?>
                    <?php echo $this->getPriceHtml($_product, true); ?>
                <?php if ($gc['display_price'] == 1) echo '
'; ?>


texts: Is there any way to disable all extensions in magento

texts: I have several extensions on a magento site. I suspect one of them is causing a problem and I want to disable them all and then bring them back one at a time to find the problem. Is there any easier way to do this then going into app/etc/modules/* and disabling them individually?


texts: Magento2 REST API PRODUCTS "category_links" updates

texts:
When I update a prodcut using POST with product ID the "category_links" get updated to. When a product was before in category 1 and now I want it to be in 2 and I post like this

"category_links": [
            {   "position": 0,  "category_id": "2"}
        ]

The product is afterwards in both categories.
The only way would be to post first with

[]

and then again with

"category_id": "2"

Is there any trick to avoid a second POST?


texts: Magento 2: Is it possible to create conditional product options with Magento core functionality?

texts:
I would like to be able to create several drop down options for certain products in the store. These options will show/hide based on the selected options on prior drop down field(s). Would this be possible with the core functionality that comes with Magento 2 (specifically version 2.1.1) or do I need to create a module or use 3rd party module to extend this functionality?

Thank you,


texts: Template/block only showing if customer logged in, not as default or guest

texts:
I have the following code inside my footer.phtml file:

<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>

This should output the the recently viewed products inside my footer. This works if a customer is logged in but when anyone visits the site nothing gets shown?

This code only seems to have changed in this way since CE 1.9.0 upgrade (previously ok on 1.8.1). Is there a way of making it show for everyone?


texts: How to redirect with some parameter in admin

texts:
Hi i try to redirect in magento from back end module. i use the following query.

$this->_redirect('*/*/');

It was working but my module page will not work without category id in GET parameter with in the url.

So i use the following code

$this->_redirect('*/*/?category_id='.$category_id);

but now this time directly going to the home page. please any one have any solution for it?


texts: How to create custom text box attribute for configurable product in magento 2?

texts: I want to create configurable product with dropdown and textbox field attributes. In frontend product detail page, dropdown can be shown but I also want to show textbox. Can anyone please guide me?


texts: How to find enabled modules in Magento 1?

texts:
I am creating a list of Enabled 3rd party modules in magento 1.
What is the quick way to find them & get it in note ?
Thankyou


texts: Modify what happens when adding user to Newsletter list from create account Magento 2

texts:
I want to override the functionality of subscribing to a newsletter so external email system can be kept in sync with Magento store.

I am wondeing which files i can override within Magento 2 to change this functionality?

From what i can tell i think it is:

Vendor/magento/module-customer/Controller/Account/CreatePost.php

This is the controller that the registration points to and has below code:

if ($this->getRequest()->getParam('is_subscribed', false)) {
            $this->subscriberFactory->create()->subscribeCustomerById($customer->getId());
        }

I was hoping i could overwrite one bit of code however so may go deeper to the subscribeCustomerById method however i cannot find the Magento\Newsletter\Model\SubscriberFactory file. There is however the subscriber.php file within Magento\Newsletter\Model which seems to have the neccasary code so will modify this here and see how it goes for now.


texts: Magento 2: Uncaught Error: Call to a member function setProduct() on boolean

texts:
I'm trying to update the product widget to show some custom product data like that
 <?= $block->getChildBlock('name-of-block')->setProduct($_item)->toHtml() ?>

while this code works fine on list.phtml in the CatalogWidget's grid.phtml it cannot set the product


texts: How to get value of custom dropdown product attribute?

texts:
I created a custom attribute in my products page. The attribute is a dropdown list.

The name of the attribute is soldby.

I want to extract the value of that attribute.

I wrote:

$seller= Mage::getModel('catalog/product')->load($item->getProductId())
         ->getData('soldby');

This returns me null.

If I do something similar to an attribute which is a textfield, it works fine.

How can I extract the option selected ?

Please help.


texts:
I'm developing a Magento client which depends totally on REST API. Regarding payment, this is from document:

  POST /V1/carts/mine/payment-information

  Set payment information and place order for a specified cart.

In admin, I configured as Paypal Payments Pro and was able to place an order using native storefront and test credit card number 4111... and see those (2) transactions in Paypal Manager. However when place an order with above endpoint method "payflowpro", it throws an error, and very likely that it doesn't do any credit card processing.

My question is does that endpoint do everything including processing CC and we just need to call that endpoint. Or we have to call Paypal SDK/API to process CC and that endpoint is just for update cart/order information?

Appreciate

Khoi


texts:
I am working on a custom product type for a Magento2 build that I am working on. I have followed the guide linked below and it has served as a brilliant base for me to work from.

How to add a new product type in Magento 2? (MageStackDay mystery question 1)

I am however having trouble in getting the price field show for my custom product type in the admin panel when adding/editing the custom product type and I can not see why, please see image below:

I think I may missed a price layout/model some where that adds the price field in but can not seem to track down where or what I have missed.

Any help/guidance would be greatly appreciated.


texts: How to schedule a shopping cart promotion so that it starts and ends at a specific hour

texts: How do you schedule a shopping cart promotion so that it starts and ends at a specific hour e.g. 9am rather than the default option of midnight?


texts: How to Add customization option for each product in Magento?

texts:
So I have multiple products, which can be customized by the user for some extra fee. Like say add a message for 5$. Gift wrap it for 10 $. These options I want on products page. Now I don't want to add these custom option for each products as it will take a lot of time and I have over 500 products. So is there an easy way to do it, where I can select which products can be customized.

The customization option that I want is exactly like this.

http://www.utsavfashion.in/lehenga/deep-purple-viscose-lehenga-choli-with-dupatta/sllwk419-itemcode

But I don't think this is built on Magento. How can I achieve this in Magento.


texts:
I am currently in the middle of setting up a front end workflow for Magento 2, however I am currently unable to get livereload to work. Everything I have read so far on various tutorials and the Magento dev docs seems to imply that by running "grunt watch" in the root, livereload is automatically fired, however this doesn't seem to be working for me.

Note that I have the Livereload extension installed in my browser (Chrome), and it works fine, as I already use it quite a bit for other non-Magento builds. Anything I missed?

For reference, I am using the sample Gruntfile that ships with Magento 2, and have made no changes.

I should also point out that Grunt works perfectly fine apart from the Livereload side of things, and I am able to execute the various grunt commands to compile Magento LESS files with no problem, again other than the browser refresh/Livereload issue above.


texts: Error In Import: Attribute doesn't belong to attribute_set in row(s)

texts:
I'm trying to import configurable product in magento 2 by CSV. using firegento extension.

For simple product, It is working fine. But for the configurable product it fails.

eg: in CSV file

Simple product row: attribute_set_code = Stem And steerer_diameter = 1-1/8"

Configurable Product Row: attribute_set_code = Stem And steerer_diameter =''"

So in this case Import show error for configurable product:

1: Begin data validation
2: Data validation failed. Please fix the following errors and upload the file again.
3: Attribute steerer_diameter doesn't belong to attribute_set in row(s): 1
4: Broken product SKU VARPRS008 in row(s): 1
5: Checked rows: 1, checked entities: 1, invalid rows: 1, total errors: 2


texts:
How do I enable the frontend secure session cookie?
Is there a setting to enable this?


texts:
We have the option of completely disable the log errors in the backend. but is there any way we can stop getting var log errors from the particular module?

Means I don't want to see any log errors of that module under var/log.....


texts: How to change date format of yyyy-mm-dd for dd-mm-yyyy on admin grid?

texts: Hi i'm new at magento 2 and i want to change the date format on admin grid of yyyy-mm-dd for dd-mm-yyyy.


texts: Magento 1.9 addAttributeToFilter not working

texts:
I need to get all products that have set the SpecialToDate attribute.

I have a code but is not displaying any product.

 $_productCollection = Mage::getModel('catalog/product')->getCollection();
 $_productCollection->addAttributeToSelect('*')

               ->addFinalPrice()
               ->getSelect()
               ->where('price_index.final_price < price_index.price')
               ->addAttributeToFilter('SpecialToDate', 1);

I also tried to add a condition inside the foreach but is displaying only 2 products from 5. The 2 products are id 1 and 2, the other 3 products have ID 6001 and 6002, so like is not retrieve all special products.

 <?php foreach ($_productCollection as $product):

        if($product->getSpecialToDate() != null) {

  ?>


texts: Magento 2 - Category or product page return 404 sometimes for multiple store view

texts: We have setup a store with multiple store view for different languages (e.g. English and French). Sometimes, when we visit the category or product page, it returns 404. But after switching to another language, say French and switching back to English again, the category or product page will show properly. Why will this happen?


texts: Magento EE Create Custom Redirect for old URL

texts:
I have a question regarding URL redirects on product records in Magento Enterprise Edition 1.14.2.1. I am noticing that URL redirects are not being created when a product's URL key is changed, even when the "Create Custom Redirect for old URL" checkbox is checked.

For example, if we change a product's URL key from 'my-awesome-product' to 'my-really-awesome-product' (with the 'Create Custom Redirect for old URL' checkbox checked), we are not seeing any redirect created which maps the request path 'my-awesome-product' to the target path 'my-really-awesome-product'. Instead, a rewrite for the old URL key 'my-awesome-product' is created with a target path to the product route (something like 'catalog/product/view/id/12345').

I understand what the rewrite to the product route is doing, but shouldn't the old URL path point to the new URL path and not to the product route? If the old URL path is still pointing to the product route then the old URL is still active and could potentially have some SEO implications.

Does anyone know what the expected behavior is supposed to be? We recently updated our Magento EE instance to the current latest release, version 1.14.2.1. Did something change, or is this a bug in this release? I can't recall what the behavior had been in previous releases.

Any insight on this would be much appreciated.


texts: Magento2: How can I add Magento_GiftMessage to checkout (billing step > afterMethods)?

texts:
I want to add the "Gift Options" (Magento_GiftMessage) to the checkout billing step.
Currently it's displayed only on cart page:

& I want it (also) on checkout, under the payment methods list.
At first I tried to add this code to checkout_index_index.xml:

<referenceContainer name="content">
    <block class="Magento\GiftMessage\Block\Cart\GiftOptions" name="checkout.cart.order.actions.gift_options" template="cart/gift_options.phtml" cacheable="false" after="-">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="types" xsi:type="array"/>
                <item name="components" xsi:type="array">
                    <item name="giftOptionsCart" xsi:type="array">
                        <item name="component" xsi:type="string">Magento_GiftMessage/js/view/gift-message</item>
                        <item name="config" xsi:type="array">
                            <item name="template" xsi:type="string">Magento_GiftMessage/gift-message</item>
                            <item name="formTemplate" xsi:type="string">Magento_GiftMessage/gift-message-form</item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </block>
</referenceContainer>

& It actually worked, but it's not where I want it (it's now under the whole "checkout.root" block, at the bottom, pretty far from the payment methods list...)
So I played with it a little more & figured out that I need to somehow add this block to the "afterMethods" item inside the "checkout.root" block, but so far I couldn't figure out how to make it work or how can I add a block to this type of structure (if it's even possible).
-- Any idea?


texts: Cannot enable Magento 2 maintenance mode excluding a specific IP

texts:
I have a magento2 web application which I need to enable maintenance mode excluding a specific IP. The following command did enable the maintenance mode without excluding my IP.

php bin/magento maintenance:enable --ip=123.45.67.89

and I tried the following since the above command didn't work.

php bin/magento maintenance:allow-ips 123.45.67.89

var/.maintenance.ip does exist and it has my ip listed in it.


texts: Magento 1.9 date picker with only month and year

texts:
At frontend i have to add Date-picker where have to show only Month and Year(not date) with year in range(like 1990 - 2020).

Please suggest me how can i do this?


texts: Error while running php bin/magento setup:upgrade in magento 2

texts:
When i try to upgrade the setup from the magento root folder in cmd, using

php bin/magento setup:upgrade

i get below error

  Autoload error: An abstract factory could not create an instance of magentosetup
  consolecommandmoduleuninstallcommand(alias: Magento\Setup\Console\Command\Module
  UninstallCommand).

Can anyone suggest what is the issue.?


texts: order info html all data custom page or success page magento 2

texts: I need all product information like in screen shot


texts: Cannot instantiate service class interface while running API in magento 2.3


texts:
When i am installing magento 2.2.7 in my local dev window system using wamp, Than i getting

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'D:/wamp64/www/newcheckout/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js'

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'D:/wamp64/www/newcheckout/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js'
#0 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Element\Template.php(300): Magento\Framework\View\Element\Template->fetchView('D:/wamp64/www/n...')
#1 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Element\AbstractBlock.php(667): Magento\Framework\View\Element\Template->_toHtml()
#2 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Result\Page.php(248): Magento\Framework\View\Element\AbstractBlock->toHtml()
#3 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Result\Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 D:\wamp64\www\newcheckout\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#5 D:\wamp64\www\newcheckout\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#6 D:\wamp64\www\newcheckout\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#7 D:\wamp64\www\newcheckout\generated\code\Magento\Framework\View\Result\Page\Interceptor.php(130): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#8 D:\wamp64\www\newcheckout\vendor\magento\framework\App\Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#9 D:\wamp64\www\newcheckout\generated\code\Magento\Framework\App\Http\Interceptor.php(24): Magento\Framework\App\Http->launch()
#10 D:\wamp64\www\newcheckout\vendor\magento\framework\App\Bootstrap.php(257): Magento\Framework\App\Http\Interceptor->launch()
#11 D:\wamp64\www\newcheckout\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#12 {main}


texts:
In the backend, the sample of the downloadable product is an URL (not a File).
In the frontend, when I click the sample link, it just opens another window and redirects to the product page. Users can't get to the sample.

I'm running Magento 1.9. Just realized the problem today. Any idea?

Downloadable Information screenshot:


texts: Magento2 Add css class to admin ui grid column

texts: I need to add some css rules to one of the columns of my custom admin ui grid. Is there a way to add css class to it from listing xml file?


texts: Magento 2 configure currency rates per website/store

texts:
I have a Magento installation with 2 websites.
For one of the websites, I would like to use currency rates imported by web services but for the second website, I would need to have different fixed rates (to be updated manually).
Unfortunately, by default there's is no way to configure it that way. The configuration for the currency rates only has global scope.
Does anyone have a solution for that?
Thanks!


texts: When i am installing Magento 2.0, following errors have occurred. How to solve them?

texts:
When i am installing the Magento 2.0, following errors have occurred.

How  to solve them?


texts: How to add new store information to email templates Magento 2.3

texts:
I'm trying to change the store_email variable which can be used in all email templates to general/store_information/email (a new system field I created).

This variable loads trans_email/ident_support/email system config value by default from the function addEmailVariables in Magento\Email\Model\AbstractTemplate.

I tried creating an after plugin for this function like this:

<?php

namespace Cmcs\Email\Plugin;

use Magento\Store\Model\ScopeInterface;

class AbstractTemplate
{
    /**
     * Change store email variable
     */
    public function afterAddEmailVariables(
        \Magento\Email\Model\AbstractTemplate $subject,
        $result,
        $variables,
        $storeId
    )
    {
        $store = $subject->getStore($storeId);
        $result['store_email'] = $subject->getValue(
            'general/store_information/email',
            ScopeInterface::SCOPE_STORE,
            $store
        );
        return $result;
    }

}

and this is in my di.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="\Magento\Email\Model\AbstractTemplate">
        <plugin name="Cmcs_Email::addEmailVariables" type="Cmcs\Email\Plugin\AbstractTemplate" sortOrder="1" />
    </type>
</config>

But the store_email variable doesn't get changed...

Any ideas what I'm missing?


texts: Redirct to previous url & redirect from controller not working on https server

texts:
Here is button for controller action

$block->addButton('generate_label', array(
            'label'     => Mage::helper('sales')->__('Generate label'),
            'onclick'   => "setLocation('{$block->getUrl('*/logistics/labelNormal')}')",//if message use: "confirmSetLocation('{$message}', '{$block->getUrl('*/yourmodule/crazy')}')",
            'class'     => 'go'
        ));

This is the controller action where i am trying to redirect to previous page.

public function labelNormalAction() {   //label action

        $order_id = $this->getRequest()->getParam('order_id');

        $this->createLabelAction($order_id,false);

        $this->_redirectReferer();
        return;
    }


texts:
I tried to install magestead using the command composer global require "richdynamix/magestead" and got the following output:

PHP Warning:  Module 'Phar' already loaded in Unknown on line 0
Changed current directory to /home/prabhuchelladurai/.config/composer
Using version ^2.2 for richdynamix/magestead
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
- Installation request for richdynamix/magestead ^2.2 -> satisfiable by richdynamix/magestead[2.2].
- Conclusion: remove symfony/console v2.8.8
- Conclusion: don't install symfony/console v2.8.8
- richdynamix/magestead 2.2 requires symfony/console ^3.1 -> satisfiable by symfony/console[v3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4].
- Can only install one of: symfony/console[v3.1.0, v2.8.8].
- Can only install one of: symfony/console[v3.1.1, v2.8.8].
- Can only install one of: symfony/console[v3.1.2, v2.8.8].
- Can only install one of: symfony/console[v3.1.3, v2.8.8].
- Can only install one of: symfony/console[v3.1.4, v2.8.8].
- Installation request for symfony/console (locked at v2.8.8) -> satisfiable by symfony/console[v2.8.8].

Installation failed, reverting ./composer.json to its original content.

How can I solve this?


texts: Why has Magento 2 made it harder for shop owners to update the exported product csv?

texts:
Magento 2 has now merged all custom attributes in a field called additional_attributes.

That has made it difficult for many shop owners to edit these fields as they have to sift through many attributes separated by commas or pipes. It has made it very difficult for shop owners to edit these files without doing some heavy processing.

Why was it done?


texts: Grid Row Total issue in exported CSV - Magento 2

texts:
I am facing an issue in My custom grid. I have added 'Export to CSV' in Grid and it is working fine.

Issue is I have added a row total in grid but in Exported CSV, total is actually the total of all rows rather then the total of filtered rows.

I am using a below code to add the Total row for a specific column. This code is working in Grid Block but not working in GridExport Block.

protected function _afterLoadCollection()
{
    $collection = $this->getCollection();

    $salesTotal = 0;

    foreach ($collection as $rowData) {
        $salesTotal += (float)$rowData->getPrice() * (float)$rowData->getQuantity();
    }
    $this->setTotals(new \Magento\Framework\DataObject(
        array( 'subtotal'=>$salesTotal )
    ));
    return $this;
}

It seems that, _afterLoadCollection() never call in GridExport Block although both Blocks are extending the same class as

class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { ... }
class GridExport extends \Magento\Backend\Block\Widget\Grid\Extended { ... }

Grid and CSV samples are attached for reference.

Grid

CSV


texts:
In my product detail page, My product image can be Zoom/in and Popup(large image).

I only want product image to be "zoom/in" option.

How can I disable the popup image ?


texts: Order Item detail In custom Email template

texts:
I have created a custom Email template in which i need to show default Order item detail. I have created a template in the admin using
Marketing->email templates

and this email is triggered with a custom action. That custom action is created in custom module.
i am trying to get the order_item value by using
{{layout handle="sales_email_order_items" order=$order area="frontend"}}

But i am not getting any Order related data into me email.


texts: Magento 2 - Is there a way to add a custom help box next to product customizable attributes?

texts:
On a product page, you can have customizable options, like:

There are probably people out there who don't know what "Finish" means. In this case, I'd like to add a small help box, maybe like this:

And when someone hovers or clicks on it, it'll pop up a tooltip.
Is this possible? If so, how can I do it? Is there an extension out there that can do this easily?


texts: Cannot upload images on Magento 2.3.0 in Xampp

texts:
I have freshly installed Magento 2.3.0 successfully in Xampp. After installing, I have tried to upload logo image but couldn't and it says as in the below image

What could be the problem and why am I not able to upload an image?

Can anyone please help me with this?


texts: Permissions problem with Magento 2.2.0, Nginx, Ubuntu Server only in var/cache/mage-tags

texts:
I keep getting the following types of errors:

Exception #0 (Exception): Warning: file_put_contents(/opt/magento2ce/var/cache//mage-tags/mage---3d0_TRANSLATE): failed to open stream: Permission denied in /opt/magento2ce/vendor/colinmollenhour/cache-backend-file/File.php on line 663

and

Something went wrong while saving this configuration: Warning: is_file() expects parameter 1 to be a valid path, string given in /opt/magento2ce/vendor/colinmollenhour/cache-backend-file/File.php on line 512

Originally I noticed a problem only when applying new themes. After doing more testing, the issue seems to only happen when bin/magento setup:upgrade or bin/magento setup:di:compile is run. Both are being run as the correct file system owner appsuser. And there are no errors in the console output when these commands are run. For reference here is web server user and checking groups from root:

# ps aux | grep nginx
root     23987  0.0  0.0  14224   992 pts/0    S+   18:18   0:00 grep --color=auto nginx
root     26437  0.0  0.0 125928  1740 ?        Ss   18:01   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 26438  0.0  0.1 126304  5740 ?        S    18:01   0:00 nginx: worker process
www-data 26439  0.0  0.0 125928  3392 ?        S    18:01   0:00 nginx: worker process
www-data 26440  0.0  0.1 126460  6060 ?        S    18:01   0:00 nginx: worker process
www-data 26441  0.0  0.0 125928  3392 ?        S    18:01   0:00 nginx: worker process

# groups appsuser
appsuser : appsuser www-data

The permissions that end up wrong are always in var/cache/mage-tags/ They have the web server file owner as the user and group owner (appsuser:appsuser) when it should be appsuser:www-data like the rest of '/opt/magento2ce/` directory. All other files get created with correct user and group.

Running the following always resolves the issue (modified from ref "install & configure Magento2" #3 from here ):
chown -R :www-data var/cache/mage-tags/

I don't understand how all newly generated files in var/cache/* except var/cache/mage-tags/* end up with the correct permissions. I even have the SGID set with chmod -R g+s /opt/magento2ce/ and the /opt/magento2ce/var/cache/mage-tags/* directory still ends up doing its own thing.

Does anybody have a permanent fix for this?

The original setup process i used for install is here and here. I modified accordingly because this is hosted on a multi-user system that had an existing web server user and group.

There is a thread that was closed here with original details.

Similar issue here and here


texts: Shopping Cart Price Rule - Configurable Product Buy X get Y Discount

texts:
I would like to know if there is a solution to this with Magento out of the box without any extensions.

We are a Configurable/Simple product association apparel e-commerce site.

I want to set up buy 2 of any simple product associated with a configurable product and get $X off.

Another example: Buy 2 Baseball Tee's and get $X off.

We have numerous simple product associated with the Baseball Tee and when you add in your shopping cart 1 white small baseball tee and 1 black medium baseball tee the shopping cart rule doesn't apply because of the "Discount Qty Step (Buy X)" field in the shopping cart price rule set up is only associated with a single simple item and not a configurable item, therefore you have to add 2 of the same exact items for the discount to apply. We want this discount to work in multiples of 2, so get 2 of these baseball tees and get $8 off then 4 tees is $16 off, etc.

Does anyone know a work around to make this work? Would like to stay away from altering code.

Thank you.


texts: Magento 2 : How to pass variable to controller from observer

texts:
I am not able to pass variables to controller from my observer file.
Below is the code for observer:

 class Sendtogateway implements \Magento\Framework\Event\ObserverInterface
        {
          protected $_responseFactory;
          protected $_url;
          protected $order;
            protected $logger;

            public function __construct(
                \Magento\Framework\App\ResponseFactory $responseFactory,
            \Magento\Framework\UrlInterface $url,
            \Magento\Sales\Api\Data\OrderInterface $order,
                \Psr\Log\LoggerInterface $loggerInterface
            ){
                $this->_responseFactory = $responseFactory;
            $this->_url = $url;
            $this->order = $order;
                $this->logger = $loggerInterface;
            }

          public function execute(\Magento\Framework\Event\Observer $observer)
          {
            $id = $observer->getEvent()->getOrder()->getIncrementId();
            $orderdetail = $this->order->loadByIncrementId($id);
            $url = "affrikpay/index/index/id/".$id;
            $customerBeforeAuthUrl = $this->_url->getUrl($url);
            $this->_responseFactory->create()->setRedirect($customerBeforeAuthUrl)->sendResponse();
            $this->logger->debug('done');
          }

        }

And calling variable in controller with

     public function execute()
        {
           $id = $this->request->getParam('id');
           $this->logger->debug($id);
        }


texts: getting fatal error while creating model config with database in Alanstormdotcom_Weblog

texts:
I want to link the model with the database in magento and get the data from the database but i can not figured it out. Is anybody help me to solve this problem. I spend long time to find its problem but i am fail. so i am here to find its solution, is there any Magento Geek who can help me to solve this problem? Its been very grateful if you can solve this problem.

I got following error when i run the below link:
http://localhost/magentonew/weblog/index/testModel/id/1

Loading the blogpost with an ID of 1
Fatal error: Call to a member function load() on a non-object in C:\xampp\htdocs\magentonew\app\code\core\Mage\Core\Model\Abstract.php

  on line 225

This is my code:
..\Alanstormdotcom\Weblog\etc\config.xml

    <?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Alanstormdotcom_Weblog>
            <version>0.1.0</version>
        </Alanstormdotcom_Weblog>
    </modules>
    <frontend>
    <routers>
        <weblog>
            <use>standard</use>
            <args>
                <module>Alanstormdotcom_Weblog</module>
                <frontName>weblog</frontName>
            </args>
        </weblog>
    </routers>
</frontend>

    <global>
    <!-- ... -->
    <models>
        <weblog>
            <class>Alanstormdotcom_Weblog_Model</class>
            <!--
            need to create our own resource, can't just
            use core_mysql4
            -->
            <resourceModel>weblog_mysql4</resourceModel>
             <weblog_mysql4>
            <class>Alanstormdotcom_Weblog_Model_Mysql4</class>
        </weblog_mysql4>

        </weblog>
    </models>
       <!-- ... -->
    <resources>
        <weblog_write>
            <connection>
                <use>core_write</use>
            </connection>
        </weblog_write>
        <weblog_read>
            <connection>
                <use>core_read</use>
            </connection>
        </weblog_read>
    </resources>
    <!-- ... -->
    </global>
</config>

Contoller file:..\Alanstormdotcom\Weblog\controllers\IndexController.php

<?php

class Alanstormdotcom_Weblog_IndexController extends Mage_Core_Controller_Front_Action {
  public function testModelAction() {
        $params = $this->getRequest()->getParams();
    $blogpost = Mage::getModel('weblog\blogpost');
    echo("Loading the blogpost with an ID of ".$params['id']);
    $blogpost->load($params['id']);
    $data = $blogpost->getData();
    var_dump($data);
    }
}

Blogspot.php: ..\Alanstormdotcom\Weblog\Model\Blogspot.php

<?php

class Alanstormdotcom_Weblog_Model_Blogpost extends Mage_Core_Model_Abstract

{

    protected function _construct()

    {

        $this->_init('weblog/blogpost');

    }

}

:..\Alanstormdotcom\Weblog\Model\Mysql4\Blogspot.php

<?php

class Alanstormdotcom_Weblog_Model_Mysql4_Blogpost extends Mage_Core_Model_Mysql4_Abstract

{

    protected function _construct()

    {

        $this->_init('alanstormdotcom_weblog/blogpost', 'blogpost_id');

    }

}

and i also create table in my database using following query:

>     CREATE TABLE `blog_posts` (
>       `blogpost_id` int(11) NOT NULL auto_increment,
>       `title` text,
>       `post` text,
>       `date` datetime default NULL,
>       `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
>       PRIMARY KEY  (`blogpost_id`)
>     )
> INSERT INTO `blog_posts` VALUES (1,'My New Title','This is a blog
> post','2009-07-01 00:00:00','2009-07-02 23:12:30');


texts: 2 letter value in search not working magento 2.3

texts:
Hello Magento Experts,

I have an issue with the search functionality. My website have products as HP Laptops. And here are the three-issue I faced.

If user type HP then result not showing. The 2 letters search not working.
If I type the SKU like HTIC-12JOL-IJMSF4 then also not work.
If the product name is long or product name with some numbers not work.

Can you please help me step by step solution of each task?

Thank you in advance folks!


texts:
I've been researching endlessly for the past week or so... but is there any way to show AVS/CVN status from Authorize.net to Magento? I know on PayPal, it does show if there's a match/mismatch/denied status.. but not for authorize.net.

I looked in the database and there is a row called cc_avs_status in sales_flat_order_payment -- but it's null and blank. Magento HAS to store this data somewhere, right?

Anyone know how to implement this on Magento? Specifically on the Sales > Customer Order page?


texts: Is there a way to Create Product using Magento 2 Api and assign the product to a source with stock Quantity?

texts:
I am trying to create a product using the Api provided by Magento. So for that I would use this endpoint :
POST <host>/rest/default/V1/products
source : https://devdocs.magento.com/guides/v2.4/rest/tutorials/configurable-product/create-simple-products.html
However I would like in meantime to assign the product to a source and set up a Quantity. This action can be achieve from this endpoint :
POST <host>/rest/<store_code>/V1/inventory/source-items
source : https://devdocs.magento.com/guides/v2.4/rest/modules/inventory/manage-source-items.html
My question is, is it possible to achieve these 2 actions in 1 ? I see that we can set a stock qty during the product creation.. but nothing related with the MSI.
Thanks


texts: How to replace existing values by NULL or removing them using CSV import

texts:
Our client uses Magento CSV import/export functionality to import and export stocks and pricing regularly.

Special prices for the products keeps changing. While importing special prices, if we keep the special price row as blank it won't replace the special pricing in the product. Also, if we pass NULL the special pricing becomes 0 and we start giving customer freebies.

we need to remove the special price when customer imports using CSV. It is fine to pass some parameters if required.

Can anyone guide me how this needs to be done?


texts: How can an attribute be added to invoice line items?

texts:
Our business has recently run into the need to have the actual price of an item on the invoice, as well as what it's price paid is if its on sale.  The price paid is included on the invoice object, but finding actual price of the item is impossible since the actual price may have changed since it was purchased.

I understand the mechanics of the EAV system, and i am going to do a lot of research on this problem and probably have to code a custom solution, but i thought i'd throw the question out here in case i'm missing something obvious.  I am planning on approaching this from the viewpoint of "I need a custom module with table modifications"

I need this feature for audit reasons, so no looking in the admin log for price change history.

EDIT:
Found http://www.atwix.com/magento/custom-product-attribute-quote-order-item/

Also, github project https://bitbucket.org/vovsky/adding-custom-product-attribute-to-quote-and-order-items-in/


texts: I run multiple sites and i notice on both magento sites i have had recurring problems or customers getting all the way through filling out their billing info and getting to the last step of "place your order" and it just simply doesnt work. If there is any insight on this problem please let me know thanks!


texts: Magento 2 Insert data to table that contain foreign key error SQLSTATE[23000]: Integrity constraint violation

texts:
i want to insert data to a table that contain foreign key, but it always gives me an error like this:

  [2017-01-18 04:45:51] main.ERROR: PDOException: SQLSTATE[23000]:
  Integrity constraint violation: 1452 Cannot add or update a child row:
  a foreign key constraint fails (goku.lime_courierservices,
  CONSTRAINT FK_EDC3A7832725FC587764FA1BFF56B114 FOREIGN KEY
  (couriers_id) REFERENCES lime_courier/lime_couriers
  (couriers_id) ON DELETE CASCADE)

  Next Zend_Db_Statement_Exception: SQLSTATE[23000]: Integrity
  constraint violation: 1452 Cannot add or update a child row: a foreign
  key constraint fails (goku.lime_courierservices, CONSTRAINT
  FK_EDC3A7832725FC587764FA1BFF56B114 FOREIGN KEY (couriers_id)
  REFERENCES lime_courier/lime_couriers (couriers_id) ON DELETE
  CASCADE), query was: INSERT INTO lime_courierservices
  (courierservices_id, name, description, couriers_id) VALUES
  (?, ?, ?, ?)

i think the problem is the data that i insert is (?,?,?,?), but i already make sure by printing $model->getData() after $model->setData(), and the data was there, here's how i insert the data from model:

public function setCourierservices()
  {
    $model = $this->_courierserviceModel->create();
    $courierservices = $this->getCourierservices();
    foreach($courierservices as $courierservice){
      $data = array(
        'courierservices_id' => $courierservice->id,
        'name' => $courierservice->name,
        'description' => $courierservice->description,
        'couriers_id' => $courierservice->courier_id
      );
      $model->setData($data);
      try {
        $model->save();
      } catch (LocalizedException $e) {
        $this->_logger->addError($e->getMessage());
      } catch (\Exception $e) {
        $this->_logger->addError($e);
      }
    }
  }

here's how i create the table:

       $table_lime_courierservices->addColumn(
                'courierservices_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                array('identity' => false,'nullable' => false,'primary' => true,'unsigned' => true,),
                'Entity ID'
            );
            $table_lime_courierservices->addColumn(
                'name',
                \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                null,
                [],
                'name'
            );
            $table_lime_courierservices->addColumn(
                'description',
                \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                null,
                [],
                'description'
            );
            $table_lime_courierservices->addColumn(
                'couriers_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                15,
                ['nullable' => false],
                'couriers_id'
            );
         $table_lime_courierservices->addForeignKey(
             $installer->getFkName('lime_courier/lime_courierservices', 'couriers_id', 'lime_courier/lime_couriers','couriers_id'),
             'couriers_id',
             $installer->getTable('lime_courier/lime_couriers'),
             'couriers_id',
             \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
        );


texts: Sort Product Collection By Event Date Custom field

texts:
I have created Events type products using Magento Virtual Product.

A custom product attribute "event_date" has created to mark the event as Active or Past event.

If the event_date field value is a past date then  I showed a label "Past Event" with the Product.

We need to show the all active events first then all past events in product listing page

I successfully did that by setting
Product Listing Sort = "event_date"

( From admin -> STORES -> Catalog -> Storefront -> Product Listing Sort by configuration)

I also set default sort order to "DESC" using catalog_category_view.xml.

After setting default sort order to "DESC", All Active Events are now coming first then Past events in product listing page.

Now the issue is:

I need to implement another second sorting, So the Active event will be listed by "ASC" order.

For Example :

Event :DemoA , Event Date = January 24, 2019

Event :DemoB , Event Date = January 10, 2019

Here both DemoA, DemoB events are active events as the "event_date" value is not past date but since I set
the default sort order to "DESC"  Event DemoA (January 24, 2019) comes first then Event DemoB(January 10, 2019 ) comes.

How can I show  Event DemoB(January 10, 2019 ) first then  Event DemoA(January 24, 2019)

Thanks in advance.


texts: How do I import configurable products? csv?

texts:
I have created a .csv file and then created a profile to import simple products which works absolutely fine.

However when I create a configurable product, it does not associate the simple products to the configurable products?


texts: Product show all on listing page. how to fix it

texts:
I got strange problem. i have install magento 1.9 with sample data and using RWD / Base / our responsive theme without any custom.

I have set admin catalog to show 5,10,15,20. but on listing page alway show all product at one page:

http://dcctoyou.com/dev2/men/new-arrivals.html

How can I fix this issue ?

Note:
I install Lazyload from mgt but I disabled it still show all products.


texts: how to create "Shopping Cart Price Rule" to toggle shipping methods free & flat

texts:
I have enabled both shipping methods free and flat rate.

Now i want to apply a rule, and it's like if total price added of products in cart exceeds $1000 => Free shipping, else (Less than $1000 flat rate shipping).

After i have activated both shipping methods. i made rule like this

And this shows both shipping methods like before i set the rule.
The rule is active and applied to all customer groups.


texts:
I just attached what i'm trying to hide from the product page, and that's is the following:

http://prntscr.com/bg41va


texts: Cart added products are not displayed in cart

texts:
if a user add a product to cart, the cart means 1 Item in cart, if i go to the cart, there are no products displayed.

A user can order, the added products are in the order and at paypal... The only problem is, that they didn't displayed in the cart.

In the past there was no error. I tried to uninstall all plugins, but the error was still the same.

Maybe the Shop URL might help: www.gartenmoebelgigant.de (CE 1.7.0.2)

Thanks for your help.

Edit

The Object is filled, because the total and subtotal is filled normal... Also the Button 1 Item in cart is correct... Only the table with cart details is not filled... There might be an error in it...

Tried already to change the template...didn't changed something... :-(

Thanks for your help

The problem might be here:

$this->getItemHtml($_item);


texts: How to obtain the Object Manager in Unit-Tests?

texts:
I've created the second unit-test for my second class. The second class will take a dependency of a first class instance and in one test I'd like to use the object manager to create the second class.

How do I manage that my unit-test gets the object manager injected in Magento 2 so that I can use it?


texts: failed to open stream: Too many open files in vendor/magento/framework/App/DeploymentConfig/Reader.php on line 113

texts:
I have a magento 2.3.x, after server restart, it shows the errors when i visit the homepage, any one know what is the problem?

Warning: include(/home/m2/public_html/app/etc/config.php): failed to
open stream: Too many open files in
/home/m2/public_html/vendor/magento/framework/App/DeploymentConfig/Reader.php
on line 113
Warning: include(): Failed opening
'/home/m2/public_html/app/etc/config.php' for inclusion
(include_path='/home/m2/public_html/generated/code:/home/m2/public_html/generated/code:/home/m2/public_html/vendor/magento/zendframework1/library:.:/usr/share/pear:/usr/share/php')
in
/home/m2/public_html/vendor/magento/framework/App/DeploymentConfig/Reader.php
on line 113
Fatal error: Uncaught Magento\Framework\Exception\RuntimeException:
Invalid configuration file: '/home/m2/public_html/app/etc/config.php'
in
/home/m2/public_html/vendor/magento/framework/App/DeploymentConfig/Reader.php:115
Stack trace: #0
/home/m2/public_html/vendor/magento/framework/App/DeploymentConfig.php(145):
Magento\Framework\App\DeploymentConfig\Reader->load() #1
/home/m2/public_html/vendor/magento/framework/App/DeploymentConfig.php(70):
Magento\Framework\App\DeploymentConfig->load() #2
/home/m2/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(117):
Magento\Framework\App\DeploymentConfig->get() #3
/home/m2/public_html/vendor/magento/framework/App/Bootstrap.php(211):
Magento\Framework\App\ObjectManagerFactory->create(Array) #4
/home/m2/public_html/vendor/magento/framework/App/Bootstrap.php(126):
Magento\Framework\App\Bootstrap->__construct(Object(Magento\Framework\App\ObjectManagerFactory),
'/home/m2/public...', Array) #5
/home/m2/public_html/pub/index.php(37):
Magento\Framework\App\Bootstrap::creat in
/home/m2/public_html/vendor/magento/framework/App/DeploymentConfig/Reader.php
on line 115


texts: Magento 2: billing address required prior to ordering

texts:
We offer an assortment only for companies. How do I set the customer to fill in his billing address before placing an order (without billing address impossible place order).
Does anyone have any solution?


texts: Lowest price of Configurable product ("as low as")

texts:
I need to display correct prices of configurable products in category page. It should be by default, but Magento takes into account out of stock simple products prices. Therefore configurable product lowest price is displayed incorrectly ("as low as" price).

For instance, there is configurable product which costs 44.95 and has a variation which cost 39.95, but is "out of stock". Configurable product should be 44.95 without extra "as low as 39.95"

I've tryed this answer how magento getting configurable product lowest price of associated products? by changing line $price = $price ? max($price, $productPrice) : $productPrice; to $price = $price ? min($price, $productPrice) : $productPrice; (max to min), but didn't work.

I've also tryed overwriting \Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver simply changing

foreach ($this->lowestPriceOptionsProvider->getProducts($product) as $subProduct) {
            $productPrice = $this->priceResolver->resolvePrice($subProduct);
            $price = $price ? min($price, $productPrice) : $productPrice;
        }

to

foreach ($this->lowestPriceOptionsProvider->getProducts($product) as $subProduct) {
         if ($subProduct->isSaleable()) {
            $productPrice = $this->priceResolver->resolvePrice($subProduct);
            $price = $price ? min($price, $productPrice) : $productPrice;
         }
        }

no luck though. Came up to disable showing "as low as". Any suggestions?


texts: Magento 2.1.1 get custom field added in system.xml file

texts:
In etc/adminhtml/system.xml I add an additioal field which is

<field id="gateway_ID" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
     <label>Gateway ID</label>
</field>

But then I can't call this field in my

js/view/payment/method-renderer/gateway_renderer.js

How can i call this field sa  that i can send it to the third party url in.

afterPlaceOrder: function () {}

and also i need to get payment information like subtotal of the current checkout.


texts: Magento 2 pub/static content will result to 404

texts: I'm having a problem in deploying my magento 2 site. It's weird because after content deploy the site will reload slowly and it's not generating the proper static content path. Please correct me if I'm wrong. Attached is the screenshot of the console log of the site.


texts: Display original price and final price in catalog products list

texts:
I'm using magento enterprise 1.13.0.1.
When I apply special price for a product, base and final price are visible in both product page and catalog products list.But when I apply catalog promotion price rule, final and base price are visible in product page, but in catalog products list only base price is visible. how should I fix it?
Is this a bug?


texts: How to remove index.php from Magento URLs?

texts:
I followed all the steps in this explanation and the index.php has been removed from my URL, but when i click on a product or any link in my store it is a redirect me to root path.

how i can fixes it ? any suggestion ?


texts:
$fileArray= array();
    foreach ($orders as $order) {

        $tracksCollection = $order->getTracksCollection();
        foreach ($tracksCollection->getItems() as $track) {

            $trackNum = $track->getTrackNumber();
            $filename = $trackNum.'.pdf';

            $fileinfo = pathinfo($filename);
            $sendname = $fileinfo['filename'] . '.' . strtoupper($fileinfo['extension']);

            array_push($fileArray, $filename);
        }
    }

    $outputName = "GLSlabels.pdf";
    $cmd = "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=".$outputName." ".implode(" ", $fileArray);
    shell_exec($cmd);

    header('Content-Type: application/pdf');
    header("Content-Disposition: attachment; filename=\"$outputName\"");
    header('Content-Length: ' . filesize($outputName));
    readfile($outputName);

This code is working, but I would like to use something else because the Magento market place does not allow shell_exec. Do you have some ideas?
I need to print pdf and merge it in one pdf.


texts: how to install magento 2.0 theme on shared hosting

texts:
Am building a store in megento 2.0, i successfully managed to install magento 2.0 on shared hosting. I have a premium theme that i purchased from themeforest. But along the way i failed to install this purchased theme.

I have tried researching around the web but everyone is recommending to use composer but remember am on shared hosting, i have no access to the command line.

Please help and advise.

Thanks in advance.


texts: Simple product not display in categories

texts: I created configurable products and relative simple products ( visibility set in Catalog/Search ) but i can not see simple products in categories pages.


texts: Getting quote item data in abstract class

texts:
I'm creating an abstract class that is extending Mage_Payment_Model_Method_Abstract.

When I run

$quote = Mage::getSingleton('checkout/session')->getQuote();
$cartItems = $quote->getAllVisibleItems();

foreach ($cartItems as $item) {
    Mage::log($item->getSku(),null,'test.log',true);
}

I get nothing in the logs about this. How can I get access to the items?

Update

Thanks to Amit's answer below I was able to find out how to get the sku for the order

$orders = Mage::getModel('sales/order_collection');

foreach($orders as $order){
    $items = $order->getAllVisibleItems();
    foreach($items as $item){
        $sku = $item->getSku();
    }
}


texts: Magento 2 : How to set different list.phtml for each category

texts:
I want to do like this list.phtml should be different different call in category page. I created custom category layout and assign phtml file for that. But, layered navigation at bottom after product grid.
It should be display same as like 2-column-left layout. How to solve it?
custom layout code :

app/design/frontend/Vendor/CustomTheme/Magento_Theme/page_layout/category_my_custom.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
  <update handle="2columns-left"/>
  <body>
    <referenceContainer name="content">
    <referenceBlock name="category.products">
        <block name="product_list" class="Magento\Catalog\Block\Product\ListProduct">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Catalog::product/book_list.phtml</argument>
            </action>
        </block>
    </referenceBlock>
    </referenceContainer>
</body>
</layout>

Please help me.
Thanks.


texts: Which event should I use to add product to cart after coupon code is applied?

texts:
I'm developing a custom module on Magento 1.9.2.2 CE which will add a product to cart once a promo code is submitted by the customer. I've got my add product code working and triggering for other events:

$id = '2'; // Replace id with your product id
$qty = '1'; // Replace qty with your qty
$_product = Mage::getModel('catalog/product')->load($id);
$cart = Mage::getModel('checkout/cart');
$cart->init();
$cart->addProduct($_product, array('qty' => $qty));
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

I just need to know which event is appropriate for this situation. It appears to be catalogrule_after_apply but I'm getting mixed results. Thanks in advance.


texts: Paypal - Sorry, your last action could not be completed

texts:
Having some (typical) PayPal trouble which I can't seem to fix. I want to know if this issue is actually in PayPal's court and not mine.

So I've enabled "Website Payments Standard" and added all the API details etc etc.

When I select PayPal in the checkout and get fired off to their servers, I log in and get the error saying "Sorry — your last action could not be completed".

I've tried absolutely everything - I've made sure IPN is set up properly, I've removed the details and re-entered them yet it still yields this error.

I have another Magento site set up in a similar fashion which doesn't give me this problem.

Additionally, I just received an email saying "Please check your server that handles PayPal Instant Payment Notifications (IPN). Instant Payment Notifications sent to the following URL(s) are failing:", which is really odd since I'm certain I'm using the correct url.

So I'm kinda hoping this is a quick fix on my end as PayPal, in my experience at least, are horrible at tech support.

Thanks


texts:
I'm asking you your help because I created two stores in the same Magento installation :

store.example.com : for customers (default store)
b2b.example.com : for retailers

The installation was done and I can access to the both stores.

Unfortunately, the category navigation is not working for the "b2b" store, I got this error :

  Fatal error: require_once() [function.require]: Failed opening required 'app/code/core/Mage/Catalog/controllers/CategoryController.php' (include_path='/home/example/store/app/code/local:/home/example/store/app/code/community:/home/example/store/app/code/core:/home/example/store/lib:.:/usr/local/php5.3/lib/php') in /home/example/store/app/code/local/Etheme/Ajaxshop/controllers/Catalog/CategoryController.php on line 9``

http://store.example.com/shoes.html is OK
http://b2b.example.com/shoes.html is wrong

The others links are working: http://b2b.example.com/checkout/cart/ or http://b2b.example.com/checkout/onepage/

Moreover, the cart is common of the two stores when I switched between the both stores. Is it a normal work please?


texts: I am looking for a solution to Change Add to cart button text based on shopping cart price rule in product list page and product view page.


texts:
I am using web shop which is working on Magento 1.7.02.

MySQL database is just hitting the limit of available size from hosting company (500mb)
As usually I clear those tables:

log_customer
log_quote
log_summary
log_summary_type
log_url
log_url_info
log_visitor
log_visitor_info
log_visitor_online

But slowly running out of the space. Those below take most of space (about 350mb combined)

mg_report_viewed_product_index
mg_report_event
mg_catalogsearch_result

Is any of those ok to be emptied?
Any suggestions which tables can be emptied to trim database size?

Thanks in advance

Marcin


texts: which phtml file should I edit to do with $_category?

texts:
getStoreCategories() as $_category): ?>
            drawItem($_category) ?>

The magento category display, I want to edit the categories tree code, but I do not now where.

For example, the categories code like this, I want to edit the class name. which file should I need to edit?


texts: How to fix "default.js:70 Uncaught TypeError: Cannot read property 'method_code' of null" Magento 2 checkout page error

texts:
On checkout page , this error comes up "default.js:70 Uncaught TypeError: Cannot read property 'method_code' of null"
how to fix it?
or get the value of  'method_code'?


texts:
Does anybody know how to remove the unnecessary code on the checkout screen?(marked in yellow on the picture).

The code for this block is:

Hope somebody could help me, thanks!


texts:
I try to include jQuery 3 to my project so I can use it on some CMS sites.
Attempt:

THEME = app\design\frontend\company\fresh\

THEME\web\js\jQuery\jquery-3.6.0.js
Copy pasted the code from here to the file:
/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.e ...

THEME\requirejs-config.js
var config = {
    map: {
        '*': {
            jquery3: 'js/jQuery/jquery-3.6.0',
        }
    }
};

CMS Site:
Now I inserted this to my CMS Site...
<script>
require([
    'jquery3'
], function ($) {
    $("body").css("color", "black");
});
</script>

...but I get Uncaught TypeError: $ is not a function
What am I doing wrong?
I flushed the cache of course.


texts: Const argument in virtual type breaks magento2

texts:
So, I'm using the code from here sample-payment and I have in di.xml the following code:

<!-- Payment Method Facade configuration -->
<virtualType name="SamplePaymentGatewayFacade" type="Magento\Payment\Model\Method\Adapter">
    <arguments>
        <argument name="code" xsi:type="const">Magento\SamplePaymentGateway\Model\Ui\ConfigProvider::CODE</argument>
        <argument name="formBlockType" xsi:type="string">Magento\Payment\Block\Form</argument>
        <argument name="infoBlockType" xsi:type="string">Magento\SamplePaymentGateway\Block\Info</argument>
        <argument name="valueHandlerPool" xsi:type="object">SamplePaymentGatewayValueHandlerPool</argument>
        <argument name="commandPool" xsi:type="object">SamplePaymentGatewayCommandPool</argument>
    </arguments>
</virtualType>

<!-- Configuration reader -->
<virtualType name="SamplePaymentGatewayConfig" type="Magento\Payment\Gateway\Config\Config">
    <arguments>
        <argument name="methodCode" xsi:type="const">Magento\SamplePaymentGateway\Model\Ui\ConfigProvider::CODE</argument>
    </arguments>
</virtualType>

that when running it in this way it breaks the magento2. Note: the code is under root/app/code stored.

With breaks I mean the following:

when I run a simple php bin/magento list I receive:

root@ea40a2340686:/var/www/magento2# php bin/magento list
Magento CLI version 2.1.10

Usage:
 command [options] [arguments]

Options:
 --help (-h)           Display this help message
 --quiet (-q)          Do not output any message
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version
 --ansi                Force ANSI output
 --no-ansi             Disable ANSI output
 --no-interaction (-n) Do not ask any interactive question

Available commands:
 help   Displays help for a command
 list   Lists commands
We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.

  [InvalidArgumentException]
  Constant name is expected.

And if I try now to do something in the browser I get:

  Fatal error: Cannot declare class Magento\SamplePaymentGateway\Model\Ui\ConfigProvider, because the name is already in use in /var/www/magento2/app/code/Magento/SamplePaymentGateway/Model/Ui/ConfigProvider.php on line 22

The class:

/**
 * Class ConfigProvider
 */
final class ConfigProvider implements ConfigProviderInterface
{
    const CODE = 'sample_gateway';

    /**
     * Retrieve assoc array of checkout configuration
     *
     * @return array
     */
    public function getConfig()
    {
        return [
            'payment' => [
                self::CODE => [
                    'transactionResults' => [
                        ClientMock::SUCCESS => __('Success'),
                        ClientMock::FAILURE => __('Fraud'),
                    ],
                ],
            ],
        ];
    }
}

If I remove this line (and the other one in the other virtual type) in the di.xml:

<argument name="code" xsi:type="const">Magento\SamplePaymentGateway\Model\Ui\ConfigProvider::CODE</argument>

everything works again.

So, my question: What is wrong by this declaration of the const?

As from the config.xsd and types.xsd everything should be ok.

<!-- config.xsd -->
<xs:complexType name="const">
    <xs:complexContent>
        <xs:extension base="argumentType" />
    </xs:complexContent>
</xs:complexType>

and

<!-- types.xsd -->
<xs:complexType name="argumentType" abstract="true" mixed="true">
    <xs:attribute name="name" use="required"/>
</xs:complexType>

PS: I'm using Magento2 V2.1.10 with php 7.0.12 in the magento2devbox.


texts: Magento 2: How to use the Layout Handle customer_logged_in?

texts:
Does Magento 2 have such handle as customer_logged_in? If yes how can I use it?

I tried to create

../view/frontend/layout/customer_logged_in.xml

and added there <referenceBlock name="content" remove="true" />

But content block wasn't removed. I renamed handle file to default and block was successfully removed.

What am I doing wrong?


texts: Shopping Cart Price Rule that excludes products on discount code

texts:
Do we have any configuration in Magento where we can set that if already a discount promotion rule is applied on a product,

2nd promotion rule should not be applied to it?


texts: Discount percentage based on order value

texts:
Please could someone share their wisdom on how to implement a custom discount percentage based on order total? I'm relatively new to Magento but have had a good look through the admin back-end of my site and these forums and can't find anything obvious.

Example:

Order total £125.00 - Discount 0.0%
Order total £200.00 - Discount 2.5%
Order total £250.00 - Discount 5.0%
Order total £300.00 - Discount 7.5%
etc.


texts: bannerslider acl for banner (child module) not work

texts:
here is the adminhtml

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <bannerslider module="bannerslider" translate="title">
                                    <title>Bannerslider</title>
                                    <sort_order>71</sort_order>
                                </bannerslider>
                            </children>
                        </config>
                    </children>
                </system>
                <bannerslider module="bannerslider" translate="title">
                    <title>Bannerslider</title>
                    <sort_order>71</sort_order>
                    <children>
                        <bannerslider module="bannerslider" translate="title">
                            <title>Manage Sliders</title>
                            <sort_order>0</sort_order>
                        </bannerslider>
                    <banner module="bannerslider" translate="title">
                        <title>Manage Banners</title>
                        <sort_order>2</sort_order>
                    </banner>
                        <standard_slider module="bannerslider" translate="title">
                            <title>Preview Slider Styles</title>
                            <sort_order>3</sort_order>
                        </standard_slider>
                        <banner_report module="bannerslider" translate="title">
                            <title>Report Banners</title>
                            <sort_order>4</sort_order>
                            <children>
                                <banner_report_all module="bannerslider" translate="title">
                                    <title>Per Slider</title>
                                    <sort_order>1</sort_order>
                                </banner_report_all>
                                <banner_report_only module="bannerslider" translate="title">
                                    <title>All Sliders</title>
                                    <sort_order>2</sort_order>
                                </banner_report_only>
                            </children>
                        </banner_report>
                        <settings module="bannerslider" translate="title">
                            <title>Settings</title>
                            <sort_order>1000</sort_order>
                        </settings>
                    </children>
                </bannerslider>
            </children>
        </admin>
    </resources>
</acl>

i assigned a role allow them to acccess "manage banner", but it shows access denied when the user access it via menu, anyone knows the problem?

When I comment out the following code in app\code\community\Magestore\Bannerslider\controllers\Adminhtml\BannerController.php it works:

/*protected function _isAllowed() {
    return Mage::getSingleton('admin/session')->isAllowed('banner');
}*/


texts: Magento2: Can't create bundle product at backend

texts:
I'm using Magento version 2.1.1 and trying to create a bundle product in admin. By default the product page chooses "Default" attribute set and when I change it to other attribute set

e.g. "Rooms" (my custom attribute set) its just loading and firebug showing the error attached in the file.


texts: How to fix “403 forbidden” redirect issue happens while adding shopping cart price rule condition in magento 1.9?

texts:
My task is to add new shopping cart price rule in magento admin section. I have added rule information, then I need to add conditions for that rule .When I change the condition select box option, it's redirected to dashboard.

In the chrome console it shows 403 forbidden error in the ajax url.

Somebody told me to disable mod_security. I have written the below code in .htaceess file, but still the problem continues.

.htacesss :

SecFilterEngine Off

SecFilterScanPOST Off

I am using Magento version. 1.9.3.8

How to fix this please help me.


texts:
I have the following urls of an image

original url

http://www.trinca-ferro.com/media/product/7c2/ceramic-melon-knob-big-white-antique-finish-maria-e14.jpg

what is the /7c2/ , how it was generated?

how to  generate the cache url of the imaeg like below?

cache url

http://www.trinca-ferro.com/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/5/5/55550200-ceramic-melon-knob-big-white-antique-finish-maria_2_2.jpg


texts: How to set qty to product on MSI Magento 2.3

texts:
In my custom module, I'm using StockRegistryInterface to set qty and save my product. But on Magento 2.3 I started facing the issue of having 0 salable qty right after saving the product.

After digging a bit, I saw that StockRegistryInterface is deprecated and it was replaced with Multi Source Inventory. How should I save the qty of my product now?

Here is the piece of code where I do it with StockRegistryInterface:

        /* @var ProductInterface $product */
        $stockItem = $this->stock->getStockItemBySku($product->getSku());
        $stockItem->setQty($this->estoque_disponivel);
        $stockItem->setIsInStock(true);
        $this->stock->updateStockItemBySku($product->getSku(), $stockItem);


texts: Magento2 without cart price rule how to add a custom coupon code

texts:
In to Magento 2.2.2 site.

I want to give different price coupon code to the customers.

How to create coupon code programmatically if i create cart price rule then cart price rule is many created.

Please provide me a better solution for that

Thanks in advance.


texts: Magento 1.7.0.2 USPS Shipping Method Issue

texts:
It started out as users not being able to check out - when they added items to their cart through the one page checkout they would get to the shipping methods then get kicked back to the cart page. I have now since disabled USPS and everything works with UPS except, in system configuration I get a blank page when I try to change settings in the ship method settings.

I have getting the following errors:

  PHP Fatal error:  Class Mage_Usa_Model_Shipping_Carrier_Usps contains
  1 abstract method and must therefore be declared abstract or implement
  the remaining methods
  (Mage_Usa_Model_Shipping_Carrier_Abstract::_doShipmentRequest) in
  /public_html/app/code/local/Mage/Usa/Model/Shipping/Carrier/Usps.php
  on line 913, referer:
  http://domain.com/index.php/admin/system_config/edit/section/shipping/key/9c01422374d1f5cdc61d4f9ac85c6a00/

Running magento 1.7.0.2

Really need some help - I have tried applying the patch from the magento website to fix the issue but no luck.


texts: Why I can't save any new CMS page or block in Magento Cloud?

texts:
I'm using Magento 2.4 and when I try to save any CMS block or page I got this screen below, saying The requested URL was rejected.

How could I solve it?


texts: Sort Categories filters alphabetically for search results

texts:
I want to sort the category filters alphabetically by name on my search results page.

Most answers suggest setting the position for every category. However, this seems rather manual. Is there another way to sort the category filters? Ideally through an option?


texts: How to get store currency in cms blocks in magento2

texts:
I have a CMS block which will be used in multi-currency stores.
I have a content,lets say "Grab it for USD 100".Now I want this to change based on store currency selected.How can i achieve this on static block.

Thanks in advance for your help!


texts: Order Processing and Preparing for Delivery happened at the same time

texts:
For few orders I am facing this problem..
Please help me to find the solution


texts:
Currently I'm converting my collection data to json_encode like this:

$collections = $this->modelFactory->create()->getCollection()
                   ->addFieldToFilter('status','1');
$result = array();
foreach($collections as $collection){
  $result[] = $collection->getData();
}
return json_encode($result);

The problem is I need to loop for each collection to get the array data so that I can put it inside json_encode function, is there a way I can convert the collection result to json_encode without looping?


texts: Is it possible to use recently viewed products widget with amasty promo banners?

texts:
I want to use recently viewed products widget with amasty promo banners extension, on different positions. I select the banner type as html text or cms block and insert widget.
But i see in frontend no products, only following text:
{"store":"2","currency":"EUR","displayTaxes":"1","displayWeee":"1","allowWishlist":true}

How can i solve this?


texts: Completely Bypass shipping in Admin order entry

texts:
TL:DR  We need to bypass the shipping option while manually placing an order via the admin.  Currenly this isn't possible.

--

Ive had a request for manual order entry in the admin to be able to bypass shipping.  Its impossible to proceed without selecting something.

The issue at hand is that we only use USPS.  Randomly, we have a customer who can only accept FedEx.  Unfortunately the owners do not want to add FedEx or UPS to Magento, against my recommendation.

Their solution isn't elegant.  They've created a product that is just listed as 'FedEx Shipping' which they add to the order manually, then adjust its price to match what FedEx is charging.  It works, but at the bottom of the admin place order page its requiring a shipping method of what we currently offer.  We'd like to be able to bypass this, or have an option for 'No Shipping' or 'FedEx Shipping' (with no price?) so we can proceed to place the order.  However this 'no shipping' should only be visible in the admin.

Can I add a shipping bypass to the admin order page but only the admin order page?


texts:
Regarding to the post below, how can I add "Login to View Price" if the user is not signed in? What is the code?

Is there a way to hide prices?

Thank you in advance,
Elvis


texts: Class is not defined at captcha.js:25 Magento 1.9

texts:
We have a problem with the Captcha in Magento 1.9. There is an error with JS:

Does anyone know how to fix it?


texts: Force magento to log errors even when in developer mode

texts:
While writing a module, an observer had an undefined variable, which would typically create an E_NOTICE error. However, I also had the Magento Developer Mode enabled. So when Abstract.php caught the error, it sent it over to Mage::printException it did not log it any where. The module was part of an ajax call, the result was that I never saw the error.

Do people actually use Magento developer mode? It is starting to seem counter productive without overriding the Magento core.

Does anyone have a solution to log all errors, even when in Developer mode? Am I missing something or is modifying Mage.php the only way?


texts: Create order programatically without billing and shipping address

texts: I have a couple of virtual products in my Magento 2 website, I’d like to create the order programmatically without inputting shipping and billing address, is that even possible?


texts:
I've multiple sidebars on my website.

1 of them is showing images correctly. But the last one (recently ordered products) is only showing the default magento placeholder.

Screenshot:

Here is the code used in the sidebar.phtml to retrieve the image:

<a href="<?php echo $_item->getProduct()->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?>
    <img
        style="width: 50px; float: right; border: 1px solid lightgray; border-radius: 6px; padding: 5px; margin-right: 5px;"
        src="<?php $_product = $_item->getProduct();
        echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(50, 50); ?>"/>
</a>

How can I retrieve the actual product image (thumbnail) instead of the magento default placeholder?

I already tried this solution, but this ain't working for me.


texts: Get Configurable Products Under Specific Category REST API Magento 2

texts:
I am trying to get configurable products only under specific category using

  http://domain.com/index.php/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=type_id&searchCriteria[filter_groups][0][filters][0][value]=configurable&searchCriteria[filter_groups][0][filters][0][conditionType]=eq&searchCriteria[filter_groups][1][filters][0][field]=category_id&searchCriteria[filter_groups][1][filters][0][value]=3&searchCriteria[filter_groups][1][filters][0][condition_type]=eq&searchCriteria[current_page]=1&searchCriteria[page_size]=26

But the result is not correct.

Is there is something wrong ?


texts: Magento - percentage discount for shipping

texts:
I'm looking for extension or way how to set up cart price rule in magento. I need to set up 100% discount on shipping when total price of cart is higher then.. Why I need this? Because I'm using function which calculate (maximum) shipping distance by google matrix api.
Does anybody know how to do it? I have seen some shipping extension where I would be able to do it but it costs 99$ and it too much since I use just this one little function.
Thank you in advance.


texts: Magento2 disable billing address requirement

texts:
I'm getting this error when I try to create a new order from a quote ID:
{
    "status": false,
    "message": "Please check the billing address information. \"firstname\" is required. Enter and try again. \"lastname\" is required. Enter and try again. \"street\" is required. Enter and try again. \"city\" is required. Enter and try again. \"postcode\" is required. Enter and try again. \"countryId\" is required. Enter and try again."
}

How can I completely disable the requirement for a billing and shipping address?


texts: Magento 2.1 - Display RRP attribute beside price

texts:
I added a custom attribute to use for RRP and I need it to display along side the price on both the product page and product list. From digging around it looks like I can override the price template here...

app\design\frontend[theme]\Magento_Catalog\templates\product\price\amount\default.phtml

I tried, adding...

$_product = $block->getProduct();
$attvalue = $_product->getResource()->getAttribute('rrp')->getFrontend()->getValue($_product);
echo 'RRP: '.$attvalue;

However it produced an error.


texts:
I created a new category in the backend called "Zubehör".

Side question: ↑ Why is Zubehör grayed out? ↑

I have set the url key to zubehoer.

But if I navigate to www.mysite.com/produkte/beleuchtung/zubehoer then the site does not load, I get redirected to the search instead. I also tried www.mysite.com/produkte/beleuchtung/zubehoer.html

Cache is deactivated.
I reindexed everything.
The category is active.

What am I missing?


texts: Magento 2.4.2 : Owl Carousel in Related Products not working

texts:
I am facing a strange issue with setup owl carousel slider to related products on PDP. I've added below code to initialise owl carousel at the end of items.phtml file in my custom theme.
app/design/frontend/My_Vendor/mytheme/Magento_Catalog/templates/product/list/items.phtml
<script>
    require([ 'jquery', 'owl.carousel'], function($){
        $(document).ready(function($) {
            $('#related').owlCarousel({
                loop:false,
                nav: true,
                margin:28,
                dots: true,
                responsive:{
                    0:{
                        items:3,
                        margin:15
                    },
                    1025:{
                        items:4,
                        margin:28
                    }
                }
            });
        });
    });
</script>

It initialize the owl carousel on the element but element nesting is in wrong order as shown in this image
As you can see all the images are nested under one owl-item div, which is breaking the layout and product block is displaying one after one as like this
I've debugged code in items.phtml and when I remove
data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>"
from the code on line no 204 it is displaying related product slider without any issue.
So I am not sure about what is the purpose of this code and why it is causing the issue.
Any help will be appreciated. Thanks in advance.


texts: getAttributeText not returning proper value for attributes of type "select"

texts:
Why does my attribute return only "No" (even though some products have the attribute set to "Yes") when I try to access it from a collection, but does return "Yes" or "No" appropriately I load the product individually?

$attributes = array('my_attribute','another_attribute');

$productsCollection = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect($attributes);
$productsCollection->load();

foreach ($productsCollection as $_product) {
    $value = $_product->getAttributeText('my_attribute'); // only returns "No";
}

I can get it to return the proper value if I reload the product individually, but that's way too inefficient for my needs.

$attributes = array('my_attribute','another_attribute');

$productsCollection = Mage::getSingleton('catalog/product')
    ->getCollection()
    ->addAttributeToSelect($attributes);
$productsCollection->load();

foreach ($productsCollection as $_product) {
    // Reload product individually
    $_product = Mage::getSingleton('catalog/product')
                ->load($_product->getId());
    $value = $_product->getAttributeText('my_attribute');
    //return "Yes" and "No" appropriately;
}

How can I efficiently, grab "select" attribute values for thousands of products?


texts: Magento sample payment module: what is an ENV Request

texts:
I'm working to understand the Magento sample payment module.

In the AuthorizationRequest class (https://github.com/magento/magento2-samples/blob/master/sample-module-payment-gateway/Gateway/Request/AuthorizationRequest.php) there is a comment

/**
 * Builds ENV request
 *
 * @param array $buildSubject
 * @return array
 */
public function build(array $buildSubject)

What the heck is an ENV request?

Sorry if this is a non-intelligent question, I'm new to Magento 2


texts: Cannot re-save product programmatically on 2.1.6

texts:
I have a simple script which updates product's special price:

/** @var \Magento\Catalog\Api\ProductRepositoryInterface $repository */
$repository = $this->getObjectManager()->create('\Magento\Catalog\Api\ProductRepositoryInterface');
$product = $repository->getById(10, true);

$specialPrice = 29;
$from = 1452556800;
$to = 1573516800;
$product->setCustomAttributes([
    'special_price' => $specialPrice,
    'special_from_date' => date('m/d/Y', $from),
    'special_to_date' => date('m/d/Y', $to),
]);

$repository->save($product);

It works OK, but since Magento version 2.1.6, it fails with exception: Magento\Framework\Exception\CouldNotSaveException: Unable to save product

When I dig deeper to ProductRepository.php I found out that the actual exception is: InvalidArgumentException: Required parameter 'area' was not passed.

According it's stack trace it looks like it has something to do with images.

I tried to comment out the code which sets the custom attributes and just load and save the product with any changes - still the same error.

I run clean installation of Magento 2.1.6 with just sample data deployed.

Any help will be really appreciated. Thanks!


texts: Magento 2 - PayPal Express Checkout > Difference between Payment Action

texts:
What is the difference between the following payment actions?

Authorization
Sale
Order


texts:
SOLVED (see my answer below)

Magento 2 installation with sample data gets stuck at 73%. The last thing it installs is:

Module 'Magento_WidgetSampleData':
Installing data...

I have set max_execution_time = 1800 and memory_limit = 2G in php.ini.


texts:
the issue I am facing is that order emails not working on my magento store. I installed AOE scheduler but I am getting this issue

No heartbeat task found. Check if cron is configured correctly.

Though I have set the settings on cpanel

and AOE scheduler settings on magento

I am getting this email every second

Available actions:
    --action listAllCodes
    --action lastRun --code <code> [--secondsFromNow]   Get the timestamp of the last successful run of a job for a given code
    --action scheduleNow --code <code>  Schedule a job to be executed as soon as possible
    --action runNow --code <code> [--tryLock] [--force]         Run a job directly
    --action wait [--timout <timeout=60>]               Active wait until no schedules are running.
    --action flushSchedules --mode (future|all)         Flush schedules.
    --action listAllRunningSchedules
    --action killAll
    --action watchdog
    --action cron --mode (always|default) [--includeJobs <comma separated list of jobs>] [--excludeJobs <comma separated list of jobs>] [--includeGroups <comma separated list of groups>] [--excludeGroups <comma separated list of groups>]

I am stuck I dont know how to resolve this issue, please help


texts: How to overwrite a template that's already overwritten in another module?

texts:
I'm trying to overwrite the catalog list template in a custom module. That template is already being overwritten by another module in one specific magento implementation. How can I write my module to play nicely with that module if it's installed, and still work the same if the other module is not installed?

I.e. if I copy the other module's template file and modify that, then my module won't work without the other module installed. And if I copy the base template and modify that, then the other module won't work.

How do I get around this?


texts: Magento 2 Product not saving into the catalog_product_save_after event. "No such entity" error occured

texts:
I have added a programmatically customizable option into the product via observer "catalog_product_save_after" event but when I add product->save() then the

  no such entity error occurred.

Please check the below my code:

$option = \Magento\Framework\App\ObjectManager::getInstance()
     ->create('\Magento\Catalog\Model\Product\Option')
     ->setProductId($product->getId())
     ->setStoreId($product->getStoreId())
     ->addData($arrayOption);

$this->customoptionOperation($option, 'save');
$product->addOption($option);
$product->save(); // this gives the error no such entity


texts: Magento 2.2 often extremely slow, 100% processor usage after setup:upgrade

texts:
I'm currently running Magento 2.2, php7, Apache2 on an Amazon AWS EC2 c4.large instance, but even the t2.micro instances are usually fine when I'm using it as a development server.

For some reason every once in a while when I run setup:upgrade after updating one of the setup files in one of my custom modules or after installing a third party module my server will become extremely slow, staying at 100% cpu usage whenever I try to load a page, the page loading takes 1 minute+, and will stay at 25% cpu usage when not loading pages.
It only affects the magento website where I called setup:upgrade, pages on other magento installs on the same server will still load at normal speed.

Sometimes the problem is fixed by removing the module I just upgraded, restarting the server and then reinstalling the module without any changes to the code, sometimes a second setup:upgrade fixes the problem, and sometimes it seems the only way I can fix it is by completely reinstalling Magento 2 and the modules.

I have had this occur on Magento 2.1.6, 2.1.8, 2.1.9 and 2.2, all kinds of different combinations of themes and modules that none else seems to have any problems with, on default, developer and production mode.

EDIT: Important note
If you are having this issue and like me are certain you never disabled your caches, there is an acknowledged issue as of right now (Magento 2.3) where running composer update occasionally disables all of your caches. So even if you think your caches are enabled, it's worth to double-check.


texts: Magento 2 - Checkout Issue - Invalid state change requested -when placing an order through Authorize.net payment method

texts:
When I am placing order by my payment gateway I am getting error "Invalid state change requested". when I debug the core code then I found that error is coming from plugin used by core classes.

Magento\Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl.php

public function beforeSave(CartRepositoryInterface $subject, CartInterface $quote)
{
    if (! $this->changeQuoteControl->isAllowed($quote)) {
        throw new StateException(__("Invalid state change requested"));
    }
}

Please anyone have an idea why i m facing this issue ?


texts:
I am facing a weird problem as I am considered as I am placing the order from backend where as I have placed the order from frontend.

        $session = Mage::getSingleton('admin/session');

        if ($session->isLoggedIn()) {

            Mage::log(1);

        }else{

            Mage::log(2)
        }
    }else{

        Mage::log(3);
    }

When this file is called from the front end cart page the output in  log is 1 which is supposed to be 3 because the session is suppose to fetch the data if I am placing order from admin side.


texts: Magento 2 : di.xml on custom param won't work

texts:
I've a class located in \Vendor\Module\Model which is named Test.
Here is the constructor of this class :

public function __construct(array $map = [])
{
    var_dump($map);
    die;
}

I created a di.xml located in \OtherVendor\OtherModule\etc\di.xml
I put in :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Vendor\Module\Model\Test">
        <arguments>
            <argument name="map" xsi:type="array">
                <item name="test" xsi:type="array">
                    <item name="test" xsi:type="string">test</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>

Do you have an idea why on my constructor $map is empty?

Here is the code of my class :

<?php

namespace Test\ImportExport\Model\Import;

class SourceConverterAdapter
{
    /**
     * @var array
     */
    protected $_map;

    /**
     * Factory constructor
     *
     * @param array $map
     */
    public function __construct(array $map = [])
    {
        $this->_map = $map;
    }

    public function process($needle)
    {
        var_dump($this->_map);
        return 1;
    }
}

<type name="Test\ImportExport\Model\Import\SourceConverterAdapter">
        <arguments>
            <argument name="map" xsi:type="array">
                <item name="test" xsi:type="string">hello</item>
            </argument>
        </arguments>
    </type>