texts: Sorry, but something went wrong. Please contact the seller. Issue : when checkout with credit card (Authorized.net) - Magento-2.1.2

texts:
I am using Magento ver. 2.1.2. Some of our customer complain that they can't checkout with Credit Card (Authorize.net). A sorry message "sorry but something went wrong" showing when checkout. We have checked the issue also found the problem using credit card (testing mode).

But when I check in admin, order was placed as Pending status.

I have contacted with the theme (Porto) support section, but they replied that "payment method integration is core functionality of Magento default, not theme related". So, they are are unable to help about this issue.

Can you please help me resolve the issue.

Regards,


texts: magento1.9 version password reset link not working

texts:
log: [Thu Oct 29 19:23:51 2015] [warn] [client 116.202.135.130] mod_fcgid: stderr: PHP Fatal error:  Call to a member function setEmailValue() on a non-object in /var/www/vhosts/modamstore.com/farklizevkler.com/app/code/core/Mage/Customer/controllers/AccountController.php on line 688

error line : 688:

$this->getLayout()
     ->getBlock('forgotPassword')
     ->setEmailValue(

forgot password link server error 500

http://farklizevkler.com/customer/account/forgotpassword/

help please


texts: Adding Tier Pricing Programmatically - Not Showing in Admin

texts:
I have searched for a week to find the specific solution to my problem maybe one of you can help! It would be very appreciated :)

I have some products with Tier Pricing that I added through the Magento Admin backend manually and it works beautifully.  I am able to update those prices programmatically and the results are amazing!

However here is my problem.  For products with no current tier prices I can't add them programmatically :( I have far too many products and variations to manually go and giev each product 6 tier prices.

Here is some example code:
If I call var_dump($product->getData('tier_price')) on an item with one tier.

array(1) {
  [0]=>
  array(7) {
    ["price_id"]=>
    string(3) "403"
    ["website_id"]=>
    string(1) "0"
    ["all_groups"]=>
    string(1) "0"
    ["cust_group"]=>
    string(2) "12"
    ["price"]=>
    string(7) "84.2400"
    ["price_qty"]=>
    string(6) "1.0000"
    ["website_price"]=>
    string(7) "84.2400"
  }
}

I created a variable called $standardTierPrices which is:
$standardTierPrices = array();
I realize it doesn't have ["price_id"] but how can I add that if it auto increments and starts whenever created?  Even with me custom setting unique ['price_id'] it still doesn't work I tested it!  I also tried without all_groups and website_price, still no cigar.

>$standardTierPrices[0] = array(
    "website_id"  => "0",
    "all_groups" => "0",
    "cust_group" => "8",
    "price" => "1950.0000",
    "price_qty" => "1.0000",
    "website_price" => "1950.0000"
);

Now I call

$product->unsTierPrice()->save()->setTierPrice($standardTierPrices)->save();

If I run $product->getData('tier_prices')
I can see the attribute gets added but it is not updated in the Admin panel
I want the tier prices to show in the admin panel not just the attributes.
Here is a specific picture of what I want and what I get.
http://imgur.com/a/MSLNw

TLDR:: I want to programmatically create this for an item -> http://imgur.com/0VfzI47, a tier pricing in the Admin Panel

From a product that starts with no tier pricing.


texts: How do I extend the Grouped Product Block Class?

texts:
I have a custom module living in:

  app/design/frontend/Vendor/Theme/Magento_GroupedProduct

Inside that, I've got a Block, layout and a templates folder.

I was under the impression that I could extend the class and just add my additional stuff in like so:

namespace Vendor\Theme\GroupedProduct\Block;

use Magento\Catalog\Model\ProductFactory;

class Grouped extends \Magento\GroupedProduct\Block\Product\View\Type\Grouped
{
    protected $productFactory;

    public function __construct(ProductFactory $productFactory)
    {
        parent::__construct(new \Magento\Catalog\Block\Product\Context, new \Magento\Framework\Stdlib\ArrayUtils);

        $this->productFactory = $productFactory;
    }
}

And then override the template file via:

  app/design/frontend/Vendor/Theme/Magento_GroupedProduct/layout/catalog_product_view_type_grouped.xml

<?xml version="1.0"?>
<!--
     /**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <attribute name="class" value="page-product-grouped"/>
        <referenceContainer name="product.info.form.content">
            <block class="Vendor\Theme\GroupedProduct\Block\Grouped"
                   name="product.info.grouped"
                   before="product.info.addtocart"
                   template="Magento_GroupedProduct::product/view/type/grouped.phtml">
            </block>
            <!-- etc. -->
    </body>
</page>

But it renders the product without the associated/grouped products.

I then went to var/log/debug.log to find these messages:

  [2019-12-05 16:13:07] main.CRITICAL: Class Vendor\Theme\GroupedProduct\Block\Grouped does not exist [] []
  [2019-12-05 16:13:07] main.CRITICAL: Invalid block type: Vendor\Theme\GroupedProduct\Block\Grouped [] []

So how do I correctly extend the Magento\GroupedProduct\Block\Product\View\Type\Grouped class for my template file?


texts: contact us page title and meta description changes not reflating in magento2

texts:
<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Contact us </title>
        <meta name="description" content="Drop Down Your Query for the Promt Replies at info@abc.in and for Customer Care Support we have a Contact Number, Contact Us at  0000000000. Chat Support also Available. Track Orders." />
        <meta name="keywords" content=""/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml">
                <container name="form.additional.info" label="Form Additional Info"/>
            </block>
        </referenceContainer>
    </body>
</page>


texts: Magento2 category images not showing and not changing

texts:
I have a strange problem with Magento 2.2.3. A few month ago we added some category images and they were shown correctly. Today we added some new category images and changes some of the old ones. But no new image is shown and also changed images are not shown. Category page always shows old images ... in admin new category image is correctly shown.

We run reindex, ran:

cd httpdocs && find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \; \
&& find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \; \
&& chmod u+x bin/magento

and also tried to set permissions to 777 of folder and files.

Anyone an idea what is wrong?


texts: Magento 2 How to add required to Dob & Gender without use backend option

texts:
I'm trying to create a new custom registration but not same the original one and i need to set Dob & Gender as required fields.

<?php $_dob = $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Dob::class) ?>
<?php echo $_dob->setDate($block->getFormData()->getDob())->toHtml() ?>
<?php $_gender = $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Gender::class) ?>
<?php echo $_gender->setGender($block->getFormData()->getGender())->toHtml() ?>

Thanks


texts: How to show products with a specific attribute?

texts:
I have this code:

$_productCollection = Mage::getModel('catalog/product')
                        ->getCollection()
                        // add sorting to collection optional
                        ->addAttributeToFilter('a_pecas_assinadas', array('eq' => 'Yes'))
                        ->addAttributeToSort('created_at', 'DESC')
                        ->addAttributeToSelect('*')
                        ->load();

foreach ($_productCollection as $_product){
   echo $_product->getId().'
';
   echo $_product->getName().'
';
   echo $_product->getProductUrl().'
';
   echo $_product->getPrice().'
';
   echo $_product->getSpecialPrice().'
';
   echo $_product->getImage().'
';
}

I created the a_pecas_assinadas attribute with yes/no type and I need to get a foreach which selects products that belong to this attribute group.

If I remove the attribute, the foreach work but if I put the attribute, the foreach crashes.


texts: How to sort ordering of store view change list in Magento 2.3.4

texts: I want to sort alphabetically this store view change list. Can anyone help with how can I do this in magneto 2.3.4?


texts: Magento 2: Set Product final price using catalog_product_get_final_price Event

texts:
Using event catalog_product_get_final_price, setting the maximum price to be 100, if the price of a product is greater than 100 then it will set automatically to 100 and the product price is below 100 then it will be displayed that price. But that event is not working. Below is the code.
Ahmad/MarketingPrice/etc/frontend/events.xml
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_get_final_price">
        <observer name="marketing-rule" instance="Ahmad\MarketingPrice\Observer\ProcessFinalPriceObserver" />
    </event>
</config>

Ahmad/MarketingPrice/Observer/ProcessFinalPriceObserver.php
<?php

namespace Ahmad\MarketingPrice\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer as EventObserver;

    class ProcessFinalPriceObserver implements ObserverInterface
    {
        public function execute(\Magento\Framework\Event\Observer $observer)
            {
                echo "test123";
                $product = $observer->getEvent()->getProduct();
                $pId = $product->getId();
                $storeId = $product->getStoreId();
                $finalPrice = 100;
                $product->setPrice($finalPrice);
                $product->setFinalPrice($finalPrice); // set final price here
                return $this;
            }
        }


texts:
I am installing Magento 2.4 with my (Magento 2.3 Database), but Now I am getting this error, anyone can guide me or give me any solution how to I can fix this issue ? Please check below screenshot.
Thanks & Regards


texts: Magento 2.3.5-p2: Send store emails from different email IDs

texts:
I've installed the SMTP extension from Mageplaza link. And configured it to send from we.care@xyz.com, as below.

However it allows for only one email to be configured, as a result despite adding different "Sender Emails" as shown below, all emails get sent out from only the email (we.care@xyz.com) that was configured under the SMTP extension.

All sales emails are set to send from Sale Representative (sales@xyz.com)
Whilst new account creation, newsletter signup are set to send from we.care@xyz.com
But all emails are being sent from we.care@xyz.com
How do I get emails to be sent out from sales@xyz.com as well as we.care@xyz.com?


texts:
i have made a js popup box to verify customers age before enter to a category.

i made a age-verification.js file with this code included, in my templat js/ folder:

var agePrompt=prompt("What is your age?");

if (agePrompt>=18) alert('Welcome!')
else {
alert('Sorry! Come back in a few years!')
document.location=" ";//link if not 18

}

and i added this XML code:

<reference name="head">
     <action method="addItem">
          <type>skin_js</type>
          <name>js/age-verification.js</name>
     </action>
</reference>

to

Admin -> Catalog -> Manage Categories -> {Selected category} -> Custo Design -> Custom Layout Update

  now i want to add some css styles to my js popup window.

how to do that? (with details please)


texts:
I want show relation information from the products under the descriptions, this information shouldn't be inside a tab but as if it were a dynamic block, for example, each product will have a different author. And I want to show this author. How should do it?

Thanks


texts: How to add new field beside other field in admin form

texts:
I have some form filed in my custom module in magento backoffice and I want to add filed that will be shown just beside first filed, not under. Is that possible and how? Now I have:

    $fieldset->addField('name', 'text', array(
        'label' => Mage::helper('mymodule_test')->__('Name'),
        'name'  => 'name',
        'required'  => true,
        'class' => 'required-entry',
    ));


texts:
Shipping from Taiwan to worldwide.

The DHL response XML works on debug log,but Magento always showing : "This shipping method is currently unavailable."

How do I fix that?

Here is the debug dump.

2014-02-27T06:09:55+00:00 DEBUG (7): Array
(
    [0] => Exchange rate TWD (Base Currency) -> USD not found. DHL method Express worldwide skipped
    [1] => Zero shipping charge for 'Express worldwide'
    [__pid] => 53383
)

My test Origin is

TAIWAN
42751
TANTZ

Test Destination is

UNITED STATES OF AMERICA
22602
WINCHESTER

Magento Edition is CE 1.8.1.0


texts: how to get actual price of a product in magento?

texts:
How to add actual price in order email template?

I am using this code $_actualPrice = $_product->getPrice();


texts: Wrong path to js, css and image file when installing magento 2.3

texts:
I have just installed  Magento 2.3. Now when I fire it up, the CSS and JS is not loading.

I looked at the source and it always has the version of the deployment in the path, like

  /pub/static/version1484648587/frontend/... . This does not exist
  though, I only have /pub/static/frontend. even with command line
  bin/magento setup:static-content:deploy -f, path indicated is not
  correct.

please help


texts: Magento1.9 Out of Stock Products in Search Results

texts:
One of my customers wants to search for products which are out of stock.

Is this somehow possible without using any search extension like elastic search or something like that?

Maybe with a modification of the Magento search?


texts: Magento 2 - extension attributes interface

texts:
I'm trying to add an extension attribute to \Magento\Quote\Api\Data\TotalsInterface. My understanting is, that magento should generate getter/setter for the new attribute, but that is not happening. (i tried deleting var/generation var/cache multiple times)

extension_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Quote\Api\Data\TotalsInterface">
        <attribute code="custom_attribute" type="string"/>
    </extension_attributes>
</config>

Is my understanding correct, or is this just not possible?

The interface is instantiated using factory in Magento\Quote\Model\Cart\CartTotalRepository. Could that have an effect?

Any help would be greatly appreciated.


texts: how to i add custom field in checkout page magento 2

texts:
I want to add a custom field in the checkout page Magento 2
how I will add and also store that field values
anyone could help?


texts: Is Possible Main Category URL Rewrite Management?

texts:
My Category Name : Test

URL Rewrite Management

In Localhost If i click the category name Test, the URL redirect to http://194.0.0.24/abcd/catalog/category/view/id/30

How can i solve this issue?


texts: Magento 2 not working on apache2, php7 and ubuntu

texts:
We are working on a magento 2 project. Since Windows lack cron job, magento 2 refused work full fledged. We decided to install ubuntu.

After striving hard I was able to make PHP7, apach2, mySQL and phpmyadmin work. Now the next hurdle is Magento. It says

The localhost page isn’t working
localhost is currently unable to handle this request.
500

After hours of struggle I still have no idea on how to make it work.

Edit:
I created a folder in var/www/html/Magento2 and copied all magento 2.02 files which has support for PHP7. Then I visit the Magento2 url. Bang I get the above error.

I need to confirm again PHP7 is working fine. Other scripts are working. I can even check for phpinfo. All the modules listed in the comment are installed.

PHP error log

  [Sat Mar 12 10:09:29.489176 2016] [:error] [pid 1380] [client 127.0.0.1:44524] PHP Fatal error:  Uncaught Magento\Framework\Exception\LocalizedException: Can't create directory /var/www/html/Magento2/var/generation/Magento/Framework/App/ResourceConnection/. in /var/www/html/Magento2/vendor/magento/framework/Code/Generator.php:103\nStack trace:\n#0 /var/www/html/Magento2/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...')\n#1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...')\n#2 [internal function]: spl_autoload_call('Magento\\Framewo...')\n#3 /var/www/html/Magento2/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...')\n#4 /var/www/html/Magento2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...')\n#5 /var/www/html/Magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runt in /var/www/html/Magento2/vendor/magento/framework/Code/Generator.php on line 103


texts:
I want to try and use Swagger on a local development env running on MAMP, but i'm running into issues with the base url of my dev site. The UI is generated fine when i hit http://127.0.0.1:8888/magento_222/swagger but when i use the "try it out" function, the Request URL that is passed in is:

  http://127.0.0.1/magento_222/rest/all/V1/calculator/add/1/1

and not

  http://127.0.0.1:8888/magento_222/rest/all/V1/calculator/add/1/1

This is kicking the Response Headers:

  "error": "no response from server"

which is to be expected since it's not the correct url.

Is there a way to set the base url for swagger so that it takes in the full url and not the partial that is getting passed in now? When i look at the http://127.0.0.1:8888/magento_222/rest/default/schema?services=all path for the full config file that is passed in, it's clear where the issue is:

{
"swagger":"2.0",
    "info":{
        "version":"2.2",
        "title":"Magento Community"
    },
    "host":"127.0.0.1",
    "basePath":"/magento_222/rest/default"

I need to update the host. How is that possible?


texts:
I'm using Magento CE ver. 1.9.1.0 for one of my store, everything is working fine and as expected but the catalog/category. I'm not able to edit/delete categories from Admin Panel.

The Console details are as follow:

URL being hit each time I click on category name:

BASE/index.php/admin/catalog_category/edit/key/<scurity_key>/?q=index.php%2Fadmin%2Fcatalog_category%2Findex%2Fkey%2Fbdf7b2cc9b890b6cb7e687a31bc7c35c%2Fid/3/&isAjax=true

Get Params:

isAjax : true

q : index.php/admin/catalog_category/index/key/bdf7b2cc9b890b6cb7e687a31bc7c35c/id/3/

POST Params:

active_tab_id : category_info_tabs_group_4

form_key : FeUR7dFe2MutCtcB

This always bring a blank category form.


texts:
I want a trick to add product to cart whitout reloading page, I'm not looking for a paid extension , just code ajax to make product added to cart on my product list.
thank you


texts: Magento model extension experiment, return: "class does not exist"

texts:
trying to create a new model class to be used as a source model for the admin configuration setting of a new module, I got the following message:

  Class Makke\GroupOrders\Model\Config\Source\Sort does not exist
  #0 C:\Projects\Marketplace\wamp\www\magento\vendor\magento\framework\Code\Reader\ClassReader.php(19): ReflectionClass->__construct('Makke\GroupOrde...')
  #1 C:\Projects\Marketplace\wamp\www\magento\vendor\magento\framework\ObjectManager\Definition\Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Makke\GroupOrde...')
  #2 C:\Projects\Marketplace\wamp\www\magento\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Makke\GroupOrde...')

Could you please help me in understanding what's wrong considering the following files?

in my ..\wamp\www\magento\app\code\makke\module-group-orders\etc\adminhtml\system.xml there is the following field:

<field id="sort_mode" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Sort by</label>
    <source_model>Makke\GroupOrders\Model\Config\Source\Sort</source_model>
</field>

and my ..\wamp\www\magento\app\code\makke\module-group-orders\Model\Config\Source\Sort.php is as follow:

/**
 * Used in creating options for Sort config value selection
 */
namespace Makke\GroupOrders\Model\Config\Source;

class Sort implements \Magento\Framework\Option\ArrayInterface
{
    /**
    * Options getter
    *
    * @return array
    */
    public function toOptionArray()
    {
        return [['value' => 'asc_by_km', 'label' => __('ASC by km')],
        ['value' => 'desc_by_km', 'label' => __('DESC by km')],
        ['value' => 'asc_by_popularity', 'label' => __('ASC by popularity')],
        ['value' => 'desc_by_popularity', 'label' => __('DESC by popularity')]];
    }
    /**
    * Get options in "key-value" format
    *
    * @return array
    */
    public function toArray()
    {
        return ['asc_by_km' => __('ASC by km'),
        'desc_by_km' => __('DESC by km'),
        'asc_by_popularity' => __('ASC by popularity'),
        'desc_by_popularity' => __('DESC by popularity')];
    }
}


texts: Send Welcome Email enable when admin create user

texts:
i am using magento(1.9.0.1), when admin create a user, the user will get welcome e-mail based on the "Send Welcome Email" make checked, but default in my pack its disable state, i can not able to checked it.

how to make enable, any idea please suggest me.


texts:
I've set up two color attributes 1 for creating configurable products with the provided colors form the manufacturers, these colors come with a lot of variations.
The 2nd attribute is with main colors for search and filter options.
The problem when I select a color swatch in the filter from the 2nd attribute the product images won't update. If I do the same with the 1st attribute the images do change.
If tried several different options and names of the attributes and colors but no result so far.
I prefer a color swatch for the 2nd attribute and the first attribute must be a image for selection on the product page. Any ideas?


texts: Custom Admin module: empty POST on create, not on edit

texts:
I created a custom admin module.

On create, there is only the form_key in the post. So it saves an empty line in my database.

On edit save, everything is fine...

Anyone has a hint ?


texts: Difference between overriding and extending or even rewrite (abstract class)

texts:
I want to change the method collect() from

Mage_Sales_Model_Quote_Address_Total_Abstract

By what I've read it seems I can't rewrite it since it's abstract and it is never instantiate.

Looking around, the usual dirty trick is to use Magento autoload and copy the file and the exact path under /local/.
E.g.:

core/Mage/Sales/[...]/Abstract.php

to

local/Mage/Sales/[...]/Abstract.php

I also tried xml, but it didn't work (as expected) since you can't override an abstract.

<models>
        <sales>
            <quote_address_total>
                <rewrite>
                    <abstract>Lebernard_Dropship_Model_Sales_Quote_Address_Total_Abstract</abstract>
                </rewrite>
            </quote_address_total>
        </sales>
    </models>

Underlying my question, I feel I misunderstand this part of Magento. What is the difference between

extending (without overriding) and how would you call the model in xml? Using :

parent::collect($address);
Using override in .xml  (like above xml, rewrite)
Using the autoload technique.

Thanks


texts: Adding multiple items with different attributes to cart programmatically

texts:
I'm making a bulk add to cart system.
Please note : i want it to works for simple products with with custom options -> Where custom option are like color(red , green , blue) or Size(Xl, M , S)

Suppose a person wants to order below items:

product A, red color, qty 12
Product A, green color, qty 18
Product B, XL, qty 3
Product C, qty 10

So I want to add these 4 items by code/programmatically at once. How can I do this? Is it possible via query string, or any controller or built in function for that? It doesn't have to be a single query or one function call only per see...


texts: magento 2: error braintree on refund - Notice: Trying to get property of non-object

texts:
I have this error on Magento 2.3.3 when I try to refund (credit memo) an order with braintree.

Notice: Trying to get property of non-object in vendor/magento/module-braintree/Gateway/Validator/ErrorCodeProvider.php on line 41

I did some research, but I didn't find nothing so far. I need your help!


texts: Magento 2 with Stock and Order Management Software

texts:
Hopefully someone can help with this

I am running stock management software.
Currently I am experiencing this isse

Item Stock 3
Sellable Stock 3

Item sells

Item Stock 3
Sellable Stock 2

So far so good

This then feeds through to the order an stock management software
It pings back the new stock level to the various platforms we sell on and magento 2 then looks like this

Item Stock 2
Sellable Stock 1

When I ship the item it shows the below

Item Stock 1
Sellable Stock 1

Basically it is double selling because it is being fed a new stock level from the order and stock management software

Any ideas how I can stop this happening?
If i set manage stock to no then it is causing items to not go out of stock

Thank you for any advice


texts: bin/magento command giving uncaught exception - fatal error

texts:
I have SSH access to a Magento 2 store and attempting to unlock an admin user. I can't run
bin/magento or php bin/magento in the folder of the magento instance. How can I get this command to work? I'm getting the following error:
Warning : Uncaught Exception: Warning: require(/home/{{siteName}}/public_html/setup/config/application.config.php): failed to open stream: No such file or directory in /home/{{siteName}}/public_html/vendor/magento/framework/Console/Cli.php on line 57 in /home/{{siteName}}/public_html/vendor/magento/framework/App/ErrorHandler.php:6
Stack trace:
#0 /home/{{siteName}}/public_html/vendor/magento/framework/Console/Cli.php(57): Magento\Framework\App\ErrorHandler->handler(2, 'require(/home/i...', '/home/{{siteName}}/...', 57, Array)
#1 /home/{siteName}}/public_html/vendor/magento/framework/Console/Cli.php(57): require()
#2 /home/{{siteName}}/public_html/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#3 {main}
  thrown in /home/{{siteName}}/public_html/vendor/magento/framework/App/ErrorHandler.php on line 61

Fatal error: Magento\Framework\Console\Cli::__construct(): Failed opening required '/home/{{siteName}}/public_html/setup/config/application.config.php' (include_path='/home/{{siteName}}/public_html/var/generation:/home/{{siteName}}/public_html/lib/internal:/home/{{siteName}}/public_html/vendor/magento/zendframework1/library:/home/{{siteName}}/public_html/vendor/phpunit/php-file-iterator:/home/{{siteName}}/public_html/vendor/phpunit/phpunit:/home/{{siteName}}/public_html/vendor/symfony/yaml:.:/usr/local/php73/pear') in /home/{{siteName}}/public_html/vendor/magento/framework/Console/Cli.php on line 57```

PHP 7.3.16


texts:
Hi I have a website which experiences some error at the backend such as
- cannot place an order from backend

Fatal error: Interface 'Composer\Installer\InstallerInterface' not found in ..../vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php on line 23

need to refresh every page to make them working properly via CRTL+F5

these are few of errors I have got ...

It seems some file at the core may have been corrupt.

I was thinking to reinstall the Magento same version (not upgrading) M2 2.1.2. Is there a safe way to do it? is run php bin/magento setup:upgrade a good solution or not?


texts: Why is checkout_cart_save_after thrown immediately after sales_quote_save_after?

texts:
The implementation of the Mage_Checkout_Model_Cart::save() method seems to result in duplication of events. Why is the non-standard checkout_cart_save_after event thrown immediately after the generic sales_quote_save_after event would have been thrown by the successful save.

Are there are reasons to listen for one of the events instead of the other? I can see that the sales_quote_save_after event would be thrown by admin or API orders, but they can be excluded from observers via specifying the eventname inside the <frontend> XML node in the module's config.xml anyway.

To provide a more concrete reason for the question, we have inherited code that listens to the checkout_cart_save_after event and I am concerned that it might be missing scenarios when the quote is changed but that event is not thrown.

Reference code from /app/code/core/Mage/Checkout/Model/Cart.php:473:

    Mage::dispatchEvent('checkout_cart_save_before', array('cart'=>$this));

    $this->getQuote()->getBillingAddress();
    $this->getQuote()->getShippingAddress()->setCollectShippingRates(true);
    $this->getQuote()->collectTotals();
    $this->getQuote()->save();
    $this->getCheckoutSession()->setQuoteId($this->getQuote()->getId());
    /**
     * Cart save usually called after changes with cart items.
     */
    Mage::dispatchEvent('checkout_cart_save_after', array('cart'=>$this));


texts: How to create upgrade schema file second time

texts: I want to create a new upgrade schema file in magento2. I already used the install schema and upgrade schema. I need to create a new upgrade schema.


texts: Remove "Add to Cart" Button when Product Price is $0.00

texts:
I have looked through many similar questions, but many seem either far more convoluted than is necessary, or just doesn't make sense for my needs.

As the title states, I would like to remove the button if the product price is set to $0.00.  Or better yet, I'd like to have the button read "Coming Soon" instead of "Add to Cart" when the price is $0.00.

I figure this isn't too difficult for some of you seasoned veterans on here, but I honestly don't know where to start.

This will be implemented on Magento 2.2.5


texts: Magneto2 Make Magento2 Backup command with no Maintenance mode

texts:
I want this command without going to enable maintance mode active
php bin/magento setup:backup [–code] [–media] [–db]


texts:
I need to setTitle using loadLayout() in magento2, i tried follow.

Core code Controller:

$this->_view->loadLayout();
$this->_view->renderLayout();

I overridden controller then change

    $this->_view->loadLayout();
    $this->_view->getLayout()->getBlock('head')->setTitle($this->__('My Custom title'));
    $this->_view->renderLayout();

its throw Uncaught Error: Call to a member function setTitle() on boolean

I refer this link its not working for me.

Suggest Me How to set Title using loadlayout.

Update:

I need to set my custom title instead of Catalog Advanced Search


texts: Product Saving in multiple stores/website in same codebase taking more than 1 min

texts:
I am using Magento 1.9.x and hosted on AWS server. In my store, there are 26 website and stores are available.

Problem: If I create a product without selecting a website and stores then it is saving product very fast but If I add the product in multiple websites then it is taking more than 1 min to save each product.

I have checked the core code and print the log and got 128 SQL queries are executing for one store. So if I select more stores while creating the product it is adding 128*number queries. As I understand this is the reason to take time for saving a product. I need as less time as we can use.


texts:
I am trying to make an extension containing an observer.

But magento search the model in mage instead of my local extension "Test". system.log tells me:

  Failed opening 'Mage/Sync/Model/Observer.php' for inclusion

My /app/code/local/Test/Sync/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Test_Sync>
            <version>0.0.1</version>
        </Test_Sync>
    </modules>
    <global>
        <models>
            <test>
                <class>Test_Sync_Model</class>
            </test>
        </models>
    </global>
    <frontend>
        <events>
            <sales_order_save_commit_after>
                <observers>
                    <test_sales_order_save_commit_after>
                        <type>singleton</type>
                        <class>sync/observer</class>
                        <method>export</method>
                    </test_sales_order_save_commit_after>
                </observers>
            </sales_order_save_commit_after>
        </events>
    </frontend>
</config>

/app/code/local/Test/Sync/Model/Observer.php

class Test_Sync_Model_Observer {
    public function export($observer)
    {
      // code
    }
}

I checked file access and cleared all caches.

Why does he not use my observer?


texts: After upgrade Magento to 2.3.1, Configurable product is not displaying

texts:
We have upgraded our Magento site to Latest Magento version Magento 2.3.1,
After upgrade, We are facing error while opening configurable product as below.

{
    "[data-role=swatch-options]": {
        "Magento_Swatches/js/swatch-renderer": {
            "jsonConfig":

Fatal error:  Uncaught Error: Call to a member function getUrl() on null in /vendor/magento/module-configurable-product/Helper/Data.php:56
Stack trace: #0 /vendor/magento/module-configurable-product/Block/Product/View/Type/Configurable.php(261): Magento\ConfigurableProduct\Helper\Data-&gt;getGalleryImages(Object(Magento\Catalog\Model\Product\Interceptor))
#1 /vendor/magento/module-configurable-product/Block/Product/View/Type/Configurable.php(238): Magento\ConfigurableProduct\Block\Product\View\Type\Configurable-&gt;getOptionImages()
#2 /generated/code/Magento/Swatches/Block/Product/Renderer/Configurable/Interceptor.php(206): Magento\ConfigurableProduct\Block\Product\View\Type\Configurable-&gt;getJsonConfig()
#3 /vendor/magento/module-swatches/view/frontend/templates/product/view/renderer.phtml(16): Magento\Swatches\Block\Product\Renderer\Configurable\Interceptor-&gt;getJsonConfig()
#4 /v in /vendor/magento/module-configurable-product/Helper/Data.php on line 56

Simple product details page is working fine, but having error in configurable product.
Does anybody has solution of this issue? Please help.
Thank you.


texts: Move Sort By and Per Page section in Magento 2

texts: How can I move these two sections in breadcrumbs?


texts: Magento EE 1.14.1 catalog_product_flat table re-indexing issues

texts:
We've recently discovered (after an upgrade) that Magento EE 1.14.1 no longer keeps the catalog_product_flat tables updated unless you have Use Flat Catalog Product in System->Config->Catalog->Frontend enabled.

Even manually re-indexing through the shell does not populate catalog_product_flat_1 like it used to in previous versions. I believe this change was made sometime on or after 1.13.

All previous versions would keep catalog_product_flat_1 up to date regardless of this Use Flat Catalog Product setting.

We do not wish to enable Use Flat Catalog Product on the front-end, but somehow we need to keep catalog_product_flat_1 updated as we have various extensions and feeds that use this table.

Does anyone have any ideas?


texts: magento 1.9 How to set the size of the photo of all products

texts:
I have a problem in picture of product

When a  product`s photo is small, the site can not enlarge the image
The site is a little screwed up and photos of small and large products can be seen
How to set the size of the photo of all products?
thanks


texts: Root taking ownership of generated files. Plesk CP

texts:
I hope someone here can offer me some guidence.

I have recently switched all my accounts from cPanel / WHM to Plesk and part of this was an active development of a Magento 2.3.2 site.

Since moving onto the new system I am having issues with the generated folder being owned by Root. I have followed Magento's steps in terms of ownership and groupings which solved the issue in the var/cache folder but the issue is still present in the generated folder.

Having spent nearly 18 hours on this one issue I am about to pull my hair out. Anyone have any idea what the issue is?


texts:
I use a custom API with Delete Method.
I would get this paramter.

{
    "id":"1"
}

How can i get it in my api response?

etc/webapi.xml

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route url="/V1/news/news/delete" method="DELETE">
        <service class="[Vendor]\[Module]\Api\NewsInterface" method="destroy"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
</routes>

Api/NewsInterface.php

<?php
namespace [vendor]\[module]\Api;

/**
* @api
*/

interface NewsInterface
{

    /**
     * Return Added wishlist item.
     *
     * @param int $customerId
     * @return int
     *
     */

    public function destroy($customerId);

}

Model/NewsManagement.php

<?php
namespace [Vendor]\[Module]\Model;
use [Vendor]\[Module]\\Api\NewsInterface;

class NewsManagement implements NewsInterface
{
    protected $newsFactory;
    protected $request;

    public function __construct(
        \Magento\Framework\Webapi\Rest\Request $request,
        \[Vendor]\[Module]\\Model\NewsFactory $newsFactory
    )
    {
        $this->newsFactory = $newsFactory;
        $this->request = $request;
    }
    public function destroy($customerId) {
        return $customerId;
    }

}


texts: How to remove cookie data from static content request?

texts:
I have created a separate domain to serve static content. Also modified URL values in System->Configuration->General->Web.

When I inspect any static content request with firebug in firefox browser, I can see frontend and adminhtml cookies data are also attached to that request.

I want to remove that cookie data from request. How can I achieve this?


texts:
In order to refresh my client browser with the last styles, I want to change the name of the generated files when I merge them.

What... where that name is generated?

I merge the css with System > Configuration > Developer > Css Settings > Merge CSS Files to Yes.

It generate a css like 9128734598173458912.css, but it's always the same name, and I want to change it each time I merge the css even the content doesn't change.

UPDATE

@xMageStore give me a good clue, but I think my solution is

Mage/Code/Model/Design/Package.php
     public function getMergedCssUrl($files){...}

Maybe @xMageStore solution is better to add a variable after each file, like styles.css?version=1.1 It's a good way to refresh the client browser

I need to check more to find what's the best solution


texts: showing data from db in system config field

texts:
I have a non eav table with two columns namely a and b with some rows in it. I have a custom tab ,section and field  in system config. Now my aim is to show all values containing in those two column in the group fields.Like a's value will be in label field and b value will be in <frontend_type> and like this it will show all the values from db in config.I searched the net regarding this I got the idea to use <frontend_model> for this but how am I suppose to return the data after calling Collection in my model and show in system.xml file.
Here's my code of model

<?php
class Home_Test_Model_Adminhtml_System_Config_Source_Url
{
   public function show()
   {
       $show=Mage::getModel('test/test')
               ->getCollection()
               ->addFieldToSelect('*');

       return $show;
   }
}

EDIT: I don't want to show it as <frontend_type>select</frontend_type>. I want a long list form so  <frontend_type>label</frontend_type>

a    b
a1   b1
a2   a3
..
....
......
and on


texts: Database Changes Don't Reflect in Frontend

texts:
I have a module that allows the user (so far) to add and remove a bike from their garage.

I built my controllers (triggered via an AJAX call) and they seem to work alright. The only problem is, although the data enters the database perfectly fine, I have to run these just to display them on the frontend:

$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento setup:static-content:deploy -f
$ php bin/magento cache:flush

Note: all of the above is done with an alias I created - hence it's one mega compile and deploy

Here are my execute() functions for each controller:

  Insert.php

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

    $customerId = (int) $this->getRequest()->getParam('customer');
    $makeId = (int) $this->getRequest()->getParam('make');
    $modelId = (int) $this->getRequest()->getParam('model');
    $yearId = (int) $this->getRequest()->getParam('year');

    $item = $this->_objectManager->create('Vendor\Module\Model\Garage');

    $item->setCustomerId($customerId);
    $item->setMakeId($makeId);
    $item->setModelId($modelId);
    $item->setYearId($yearId);

    if ($item->save()) {
        $response = array(
            'customer' => $customerId,
            'make' => $makeId,
            'model' => $modelId,
            'year' => $yearId
        );
    }

    $resultJson = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_JSON);
    $resultJson->setData($response);

    return $resultJson;
}

  Delete.php

public function execute()
{
    $result = $this->resultJsonFactory->create();
    $customerId = (int) $this->getRequest()->getParam('id');

    $model = $this->garageFactory->create();
    $model->load($customerId);
    $model->delete();

    $resultJson = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_JSON);
    $resultJson->setData($customerId);

    return $resultJson;
}

After triggering the function I check my Database table:

SELECT * FROM `vendor_module_data`;

Which returns

+--------+---------+----------+---------+-------------+
| row_id | make_id | model_id | year_id | customer_id |
+--------+---------+----------+---------+-------------+
|      1 |      15 |      376 |    4559 |           3 |
+--------+---------+----------+---------+-------------+

on insert and

  Empty set (0.00 sec)

on delete.

However hitting CTRL + F5 shows no change in the frontend. Insert (if nothing is already found) doesn't show the newly added bike on refresh. I run the commands, it's there. I delete the bike. Check the database, it's gone, refresh my browser and the bike is still there. Run the above commands and it disappears.

I'm currently in Magento 2 Default Mode with cache enabled. Ideally, we'd have cache enabled in production, so how do I either force cache flush on each action or make it display what's expected without having to run the commands?


texts: magento not sending email 1.9.1 of invoice

texts:
I'm facing same problem as described here: sales email cron job not sending (1.9)

All emails are being sent, but when I create an invoice, Magento does not send an email.

I do see the emails in the core_email_queue and core_email_queue_recipients the processed_at times are all NULL

cron.php file shows blank when I hit it.

I'm seeing this in my logs:

  2015-07-06T12:31:04+00:00 ERR (3): Warning: call_user_func_array() expects parameter 2 to be array, null given in /home/.../public_html/includes/src/__default.php on line 7703

I need help, please help


texts:
<?php
   $config = Mage::getStoreConfig('tab1/general/enabled');
   if(!$config):?>
   <script type="text/javascript">
   document.addEventListener('DOMContentLoaded', function() {
   var priority = document.getElementById("y");
   priority.className += ' hide';
   });
   </script>
<?php endif;?>


texts: How to get customer information in magento 2

texts:
In my custom module I'm trying to get the Customer, Customer Address, Product and Order information through events/observers but it's not working. When I'm hit the Save Button the website is hanging.

my code is:

Learning/Custom/etc/frontend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
    <event name="customer_save_after">
        <observer name="custom_event" instance="Learning\Custom\Model\Observer" method="getCustomer" />
    </event>
    <event name="customer_address_save_commit_after">
        <observer name="custom_event" instance="Learning\Custom\Model\Observer" method="getCustomerAddress" />
    </event>
    <event name="sales_order_save_after">
        <observer name="custom_event" instance="Learning\Custom\Model\Observer" method="getOrder" />
    </event>
</config>

Learning/Custom/etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
    <event name="catalog_product_save_commit_after">
        <observer name="custom_event" instance="Learning\Custom\Model\Observer" method="getProduct" />
    </event>
</config>

Learning\Custom\Model\Observer.php

<?php

namespace Learning\Custom\Model;

class Observer{

    /**
     * Get the Customer Information
     *
     * @param \Magento\Framework\Event\Observer $observer
     */
    public function getCustomer(\Magento\Framework\Event\Observer $observer)
    {
       /* $customer = $observer->getCustomer();*/

        $event = $observer->getEvent();
        $customer = $event->getCustomer();

        file_put_contents('customer.txt',print_r($customer,true));
    }

    /**
     * Get the Customer Address Information
     *
     * @param \Magento\Framework\Event\Observer $observer
     */
    public function getCustomerAddress(\Magento\Framework\Event\Observer $observer)
    {
        /*$customerAddress = $observer->getCustomerAddress();
        $customer = $customerAddress->getCustomer();*/

        $event = $observer->getEvent();
        $customerAddress = $event->getCustomerAddress();
        $customer = $customerAddress->getCustomer();

        file_put_contents('customerAddress.txt',print_r($customerAddress,true));
        file_put_contents('customer.txt',print_r($customer,true));
    }

    /**
     * Get the Order Information
     *
     * @param \Magento\Framework\Event\Observer $observer
     */
    public function getOrder(\Magento\Framework\Event\Observer $observer)
    {

       /* $order = $observer->getOrder();*/

        $event = $observer->getEvent();
        $order = $event->getOrder();

        file_put_contents('order.txt',print_r($order,true));
    }

    /**
     * Get the Product Information
     *
     * @param \Magento\Framework\Event\Observer $observer
     */
    public function getProduct(\Magento\Framework\Event\Observer $observer)
    {

        /* $product_id = $observer->getProduct()->getId();*/

        $event = $observer->getEvent();
        $Product = $event->getProduct();

        file_put_contents('Product.txt',print_r($Product,true));
    }

}

Any suggestions?


texts:
I'm trying to run an update script to a module as i've changed the way our warehouse module works. I need to update all orders in a collection of orders if it meets a certain requirement. I know that i can save each order as it goes through, but i'd prefer to save the entire collection once it has updated all values. $collection->save(); causes the page to go white with no errors thrown. Can anyone see where i'm going wrong. Here is my script.

    <?php

$installer = $this;

$_last_export_date = Mage::getStoreConfig('warehouse/runtime/sales_last_export');

$collection = Mage::getModel('sales/order')->getCollection()->addAttributeToSelect('*');

foreach($collection as $order) {
    if($order->getCreatedAt() < $_last_export_date) {
       $order->setPointbidExported(1);
    }
}

//$collection->walk('save');

$collection->save();

EDIT ==========================

Thank you Marius for your response, I don't have the authority to answer my own question at this time so a comment will have to do.

I found this error in my apache logs "Found an error : PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 235929601 bytes)" So i don't think there was anything wrong with my method. For those interested my solution was to just directly query the database using sql. See below :

<?php

$installer = $this;

$_last_export_date = Mage::getStoreConfig('warehouse/runtime/sales_last_export');

$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->query('UPDATE sales_flat_order SET pointbid_exported = 1 WHERE created_at < '.'"'.$_last_export_date.'"');

This then wont exceed the allowed memory size as it doesn't use PHP to process.


texts: Stopping the Magento 2 Session from clering on checkout completion

texts:
In the Magento 1 days I'd just take the file from the core Magento files and comment out the session clear function on the checkout page allowing our front end developers to refresh the page as they please without having to keep making new orders to test every new piece of CSS they wrote.

Is there any way to stop the checkout process from having to be done again and again to style the thank you page on Magento 2.1? I can't find anything when trying to Google the issue.


texts: Magento 1.9 404 page showing after changing URL for products

texts: I've edited some urls for products / categories. I've empty the DB table core_url_rewrite, I've reindexed all pages in admin, I've cleaned caches. But the products link on frontpage still showing 404 page not found. What did i miss?


texts: Empty Page (just Header and Footer) on Manage Attribute Sets

texts:
When I click on an attribute set to edit/configure it, Magento loads an empty page. I have searched on here and Google to find a solution, and have tried changing the memory_limit and max_execution_time with no success.

The page I see has the Magento Admin Panel header/footer with all the CSS, but in-between is empty.

I have also tried flushing the cache, etc.

I am using the latest version of Magento 1.7 Community Edition. The PHP version is 5.2.17.

I have tried enabling error logs, but log files don't seem to be generated - there is nothing in /var/log. The permissions on the /var/log directory are correct.

I tried the solution in http://www.magentocommerce.com/boards/viewthread/226412/#t424303 but it didn’t make any difference.

I can't view PHP / Apache server logs as its on shared hosting and they won't allow it.

I also tried using Firebug in Firefox to solve the issue, but got this error:
[21:06:05.016] The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page.

Any help would be appreciated.


texts: How to get drop-down options in more-information tab in Magento 2

texts:
I want to get Configurable products dropdown attributes all options show in more-information tab.
See Below image:- below all options show in more-information tab.

Please Help How to achieve this.
THANKS.


texts: using foreach in order email template magento

texts:
how to print all the product names in order email magento, when customers add more than one product.
how to achieve using for each loop for email template variable
I have tried as below :

foreach($quotecollection as $value){
    $quoteItems[] = $value['name'];
}


texts: How to setup cron job for a /shell script?

texts:
As it says in the title:

I have a script in shell that runs a report by using this command in CLI:

php /shell/myscript.php --profile 1

Now, i want to add it to crontab so it will be something like this:

0 * * * * /usr/bin/php -f PATH_TO_FILE/myscript.php --profile 1

But the above command is incorrect, and in the same time this is how magento works with this shell scripts, so i don't know how to proceed from here:

Any ideas?


texts: Is Magento 2 Stable enough to start developing new eshop?

texts:
I would like to start developing new E-Shop but my current Magento2 experience is too slow and crashy for comfortable development.

I have tried both Master and Dev branches on Windows XAMPP.
Found that both front-end shop and admin panel hangs / crashes constantly with random errors. E.g.: https://github.com/magento/magento2/issues/1734

Is Magento 2 more stable on Unix? Is it worth trying to set it up on VM?


texts: Empty addresses in order when using Paypal Express

texts:
We try to enable the Paypal Express Checkout in EE v1.14.1.0.

However, the shipping and billing addresses are empty when we return from Paypal.
Because of this, we also run into the error on the paypal/express/review/ page that the order can't be created because we need to select a shipping method.

I checked the payment_paypal_express.log file for the response sent back to Magento from Paypal, the address data is actually filled in this response, but somehow lost when trying to create the actual order in Magento:

...
        [FIRSTNAME] => Test
        [LASTNAME] => User
        [COUNTRYCODE] => GB
        [SHIPTONAME] => Test User
        [SHIPTOSTREET] => 1 Main Terrace
        [SHIPTOCITY] => Wolverhampton
        [SHIPTOSTATE] => West Midlands
        [SHIPTOZIP] => W12 4LQ
        [SHIPTOCOUNTRYCODE] => GB
        [SHIPTOCOUNTRYNAME] => United Kingdom
        [ADDRESSSTATUS] => Confirmed
...

We run the Express checkout in sandbox mode, so the payment is verified and all.

What can be the cause of this?


texts: How to setup separate theme for mac-book 13 half size screen

texts:
I created two separate theme for mobile and the Desktop on the live server.
When I am assign Mobile user string to the Mobile theme in admin backend then Ipad layout doesn't work.

If i assign Mobile string to the Desktop top then mobile css doesn't work.
If i resized my macbook 13 half then desktop css should be apply.
Please help me o find correct user string name for macbook half sized screen.


texts: How to load and use tinyMCE in magento2?

texts:
i have element

Editable header

i tried to use


texts: I've been having this issue with auto-generated URLs. The catalog/* URLs keep auto-generating the red box are the URLs that auto-generate, the green box are the URLs that I want. How do I stop the red box URLs from auto-generating? I just deleted a 100 auto-generated catalog/* URLs manually, but more URL's keep getting generated. Please help.


texts: Magento 2 Slow Admin Login and Saving Products

texts:
I am using Magento 2 Enterprise version 2.1.11 hosted on AWS EC2... 2 server which uses load balancer. I am having slow login query with Admin Login and saving products to database. Everything else works normal.

Checked everything like PHP configurations, Magento settings, Redis Cache, CPU Load and its Memory usage. Everything looks good to me.

Around 350 products, 150 attributes, 3 website/store and fresh project in M2.

not sure how to debug this issue.


texts: setup:upgrade Magento Integrity constraint violation

texts:
I've enabled the module Magento_AdminNotification and ran php bin/magento setup:upgrade which threw the SQL error.
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Stoßdämpfer-1' for key 'SEARCH_QUERY_QUERY_TEXT_STORE_ID', query was: ALTER TABLE `search_query` MODIFY COLUMN `query_id` int(10) UNSIGNED NOT NULL  AUTO_INCREMENT COMMENT "Query ID", ADD CONSTRAINT `SEARCH_QUERY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`)  ON DELETE CASCADE, ADD CONSTRAINT `SEARCH_QUERY_QUERY_TEXT_STORE_ID` UNIQUE KEY (`query_text`,`store_id`), ADD INDEX `SEARCH_QUERY_QUERY_TEXT_STORE_ID_POPULARITY` (`query_text`,`store_id`,`popularity`), ADD INDEX `SEARCH_QUERY_STORE_ID` (`store_id`), ADD INDEX `SEARCH_QUERY_IS_PROCESSED` (`is_processed`), ADD INDEX `SEARCH_QUERY_STORE_ID_POPULARITY` (`store_id`,`popularity`)

After that I ran php bin/magento setup:static-content:deploy -f and cache:flush.
The deployment only build en_US assets like
Deploy using quick strategy
frontend/Magento/blank/en_US            2281/2281           ============================ 100%   11 secs
adminhtml/Magento/backend/en_US         2447/2447           ============================ 100%   14 secs
frontend/Magento/luma/en_US             2296/2296           ============================ 100%   13 secs
frontend/myStore/myStore/en_US          2303/2303           ============================ 100%   13 secs

so as I am loading the page theres' no javascript or css being loaded since its not in the public folder.
I've also searched the database for Stoßdämpfer-1 but theres no row containing this string.
I guess everything stands and falls with setup:upgrade and I hope someone can point me the right direction.
Cheers


texts: Outdated AngularJS library found in magento2

texts:
What is solution below Error? Any One Can Help?:
Status: FAIL
Group:  Vulnerability
Scan Name:  Magento Js Libraries
Scan Details:
Outdated JS Libraries - Failed.
Outdated AngularJS library found, response body contains unexpected 'AngularJS v1.2.17-build.178+sha.2406084'
Actions:
Apply the Magento 2.2.7/2.1.16 Security Update immediately.
Review your site for signs of compromise. Find more information about Security Best Practices.


texts:
Admin panel > Reports > Products > Ordered

It's magento's default report and result data is showing in 3rd date  it's actually of 4th date.

Issue is, Data is showing in one day previous in grid.

Can any one help for "Interval" date issue!...


texts:
I have made different group for customers and added different prices as per customer  group for products.From CMS I changed a customer group and added him in wholesale I have different login links for wholesale and general group user now my question how can I validate customer where he is from wholesale or general group?

Price is showing as per group if I login from wholesale or from general but customer from general group also login form wholesale group login

Login URL general customer

www.domain.com/customer/account/login/

Login URL for wholesale

www.domain.com/wholesale

How can I manage this form CMS or by using any extension or module?
Any help will be appreciated


texts: How to validate google recaptcha in Magento 2.3.1

texts:
I am using Magento version 2.3.1
I have enabled the google recaptcha module via backend & given the associated credentials.

Now captcha working fine in the registration page. But I wish to add a new button once captcha is verified.

How do I get the response or verify whether the captcha is verified in jQuery.

Please provide me a solution to check whether the captcha is verified or not.

  I have added i am not a bot captcha


texts: How to remove container from homepage only

texts:
I added  div(container)  in every page  except homepage like this

<main>
        <div class="myclass">
              all content here
        </div>
    </main>

  I tried update layout from admin and cms_index_index.xml file by using remove tag but doesn't work for me. I only need to remove that container class or div not all child blocks & containers

Let's consider my container in my empty.xml (override).

<container name="container_name" htmlClass="myclass" htmlTag="div"/>

It's come as I want  but I don't want it on homepage

How can I remove that container from homepage.


texts: Why is `app/etc/di.xml` stored in `app/etc` and not in (lets say) `vendor`?

texts: The default DI configuration of Magento 2 is placed in app/etc/di.xml alongside other configuration files like env.php and config.php. While the latter are files that you are meant to modify, the di.xml should not be modified at all. If this is so, why is this file not placed in a folder like vendor (for instance vendor/magento2-base/etc/di.xml)? For newbies, this might be confusing as they don't know which files they are allowed to modify and which not.


texts: Magento 2 - Why do I get stupid "compilation from source" errors on setup:static-content:deploy?

texts:
If I execute php bin/magento setup:static-content:deploy then I get alot of errors like:
Compilation from source: /home/company/staging.company.de/app/design/frontend/company/fresh/web/css/source/_mixins/fx.less
variable @theme__color__primary is undefined in file /home/company/staging.company.de/var/view_preprocessed/pub/static/frontend/company/fresh/de_DE/css/source/_mixins/fx.less in fx.less on line 3, column 12
1| .link_hover {
2|     cursor: pointer;
3|     color: @theme__color__primary;
4|     text-decoration: underline;
5|     text-decoration-color: @theme__color__primary;
6| }

It says that @theme__color__primary is undefined in the file fx.less,
so I checked if that is true but it is not true!
This is my _extend.less file:
// Variables
@import 'lib/extend/variables/_layout';
@import 'lib/extend/variables/_colors';

@import '_variables/elements/button';
@import '_variables/responsive';
@import '_variables/icons';
@import '_variables/colors';                     // <-- @theme__color__primary is defined here
@import '_variables/header';
@import '_variables/typographie';
    // Extensions
    @import '_variables/amasty/checkout';

// Mixins
@import '_mixins/fonts';
@import '_mixins/fx';                            // <-- Error is getting thrown here
@import '_mixins/elements/button';

As you can see, the file _variables/colors.less which contains the variable is loaded before _mixins/fx.less, so why is the error thrown?
_variables/colors.less
@defaultBackgroundColor: #EFF1F2;
@color-company-orange-alt: #FF7712;
@theme__color__primary: @color-company-orange-alt;


texts:
I want to get just telephone filed in my customer register page

 <?php if($this->getShowAddressFields()): ?>

I use above code But It's adding all the address fields to my registration page. I want only telephone number field from address section.


texts: Button to track order on homepage- Magento 2

texts: I am trying to put a button on front-end so that Logged In customer can check order status after putting his tracking number, which is already in Customer-Dashboard . How to execute this?


texts: How to add sticky (floating) menu in Magento 1.9?

texts:
I want add a sticky menu (Floating) on top of pages when the page scroll down but the top menu stay on top of browsers and mobile devices.

How to achieve this result in Magento 1.9.x?


texts:
I see that in every version of magento 1 there is this block Mage_Core_Block_Flush. I didn't find any usage of it any layout files. What's the purpose of this block? There is a comment at the top of the class

  Immediate flush block. To be used only as root

but that's not totally clear to me.
A use case when this might be needed should suffice.


texts: Magento Recurring Profiles Custom Options

texts:
When using Magento's recurring profile if you add custom options to the product it brings through the custom options to the customers profile however it doesn't add them to the actual order.

app/code/core/Mage/Sales/Model/Recurring/Profile.php

In the function it adds the item info

public function createOrder()
  {
    $items = array();
    $itemInfoObjects = func_get_args();

    $billingAmount = 0;
    $shippingAmount = 0;
    $taxAmount = 0;
    $isVirtual = 1;
    $weight = 0;
    foreach ($itemInfoObjects as $itemInfo) {
        $item = $this->_getItem($itemInfo);
        $billingAmount += $item->getPrice();
        $shippingAmount += $item->getShippingAmount();
        $taxAmount += $item->getTaxAmount();
        $weight += $item->getWeight();
        if (!$item->getIsVirtual()) {
            $isVirtual = 0;
        }
        $items[] = $item;
    }

There is also this function that seems to get the custom options

protected function _addAdditionalOptionToItem($item, $option)
{
    $options = $item->getProductOptions();
    $additionalOptions = $item->getProductOptionByCode('additional_options');
    if (is_array($additionalOptions)) {
        $additionalOptions[] = $option;
    } else {
        $additionalOptions = array($option);
    }
    $options['additional_options'] = $additionalOptions;
    $item->setProductOptions($options);
}

Also this function in which I have already added one extra field.

    $transferDataKays = array(
        'store_id',             'store_name',           'customer_id',          'customer_email',
        'customer_firstname',   'customer_lastname',    'customer_middlename',  'customer_prefix',
        'customer_suffix',      'customer_taxvat',      'customer_gender',      'customer_is_guest',
        'customer_note_notify', 'customer_group_id',    'customer_note',        'shipping_method',
        'shipping_description', 'base_currency_code',   'global_currency_code', 'order_currency_code',
        'store_currency_code',  'base_to_global_rate',  'base_to_order_rate',   'store_to_base_rate',
        'store_to_order_rate',  'tm_field1'
    );

But I'm not sure what I need to add to the createOrder function so that the custom options come through on the order.


texts:
Magento Version : 1.9.2.2

I have some Custom Options fields for my products which could potentially contain sensitive information. I do not want the data associated with the customer after I have fulfilled the order. I would therefore like to purge just the Custom Options data from the database.

I have crafted the following mysql query which removes ALL the "Custom Options" from both sales and quotes and it appears to work. Obviously I would limit this to just the orders I wanted to clear.

UPDATE `sales_flat_order_item` SET product_options='';
UPDATE `sales_flat_quote_item_option` SET VALUE='' WHERE (`code` NOT LIKE 'info_buyRequest' AND `code` NOT LIKE 'option_ids');

Will the above queries purge all the "Custom Options" data from the database?
Will clearing the data in this way cause any other problems within Magento ?
Is there perhaps a better way of doing this than resorting to manually clearing the fields with a mysql query?


texts:
While testing I've noticed that when a customer creates an account they are shown a message "Thank you for creating an account with English"

Clearly "English" should be replaced with the company name by our default store view name, set by our original developer is "English". If I change the name of the store view in the 'Edit store view section' from "English" to our actual company name will this affect any of Magento's operations? Or is it simply a label?

It would be preferable if the account message called the company name set in config -> General -> Store Information, rather than the store view name. I've found the following code in AccountController.php

$this->_getSession()->addSuccess(
            $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName())
        );

Could this be modified to use the Store Name rather than the Store View Information Name?

Magento 1.9.0.1


texts:
Is there any way to add cities as drop down?

I want to add a city drop down for a specific country, there will be no states and city drop down to be shown on the registration page, checkout out the page and all other address books like shipping address and billing address.


texts:
Yesterday I was working with header minicart because I need to add some CMS block and some text but when I open app/design/frontend/package_name/theme_name/Magento_Checkout/templates/cart/minicart.phtml and I look into this file I didn't get anything but after that I got that minicart block is render using knockout.js.

Below is Minicart.phtml file.

<a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
   data-bind="scope: 'minicart_content'">
    <?php /* @escapeNotVerified */ echo __('My Cart'); ?>

<?php if ($block->getIsNeedToDisplaySideBar()): ?>

        <?php echo $block->getChildHtml('minicart.addons'); ?>

<?php endif ?>

So I want to know How this minicart block (knockout.js) is work with magento2? I want to know code flow of knockout.js in Magento2.

And if I want to create custom module with knockout.js in Magento2 How can I do it?


texts:
when we add a block in a CMS page for our multistore now it can only be done like this (I think)

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

We would much rather use somethin like block_name to add blocks - a little more human readable. Can this be done?

Something like

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_name="my_handle_fot_this_block"}}

thx


texts: How to force catalog price rule over default special price

texts:
Currently in Magento CEv1.9, Minimum price is considered between default special price(entered from prices form for product) and price after discount applied through catalog price rule.
How can we force catalog price rule over default special price?
Thanks in advance !!!


texts: Conditionally hiding and showing block and links

texts:
I am working on an application for which i have two types of user in Magento system. Each user can login and reach to their Dashboard. On the user Dashboard depending on what kind of user is logged in, I want to show/hide blocks from layout.

With understanding i have so far, I was able to reach a solution. Where I am adding blocks for both the users in layout update handler and then conditionally based on what kind of user is logged in, I am removing blocks not required for that particular user from layout.

Even though this solution works but i think this isn't the right approach to do the things, as every time i create new controller action I need to put this check and accordingly modify layout.

What can be a better approach to do the same?


texts:
I used memcached for sessions, but I got error for session_module_name

error is :

Warning: session_module_name(): Cannot find named PHP session module (memcache)  in /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 73

This is my local.xml

<session_save><![CDATA[memcache]]></session_save>
<session_save_path><![CDATA[tcp://127.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10]]></session_save_path>

also this is my memcache result

[root@myserver]# ps ax | grep memcache
19669 ?        Ssl    0:37 memcached -d -p 11211 -u memcached -m 64 -c 5024 -P /var/run/memcached/memcached.pid -l 127.0.0.1
23788 pts/0    S+     0:00 grep memcache

and ports

[root@myserver]# netstat -tulpn | grep :11211
tcp        0      0 127.0.0.1:11211             0.0.0.0:*                   LISTEN      19669/memcached
udp        0      0 127.0.0.1:11211             0.0.0.0:*                               19669/memcached

what is wrong here for memcached configuration?

I can login and logout without problem, also telnet work as well and stats show me every thing!


texts:
I would like to install Magento 2.4.0 on server without Elasticsearch require during installation.
Can anybody tell me the way to disable Elasticsearch require when I run setup:install ... ?
Thank you so much.


texts: Automatically reassign order to a different customer (B2B company account system)

texts:
Is there a way to automatically reassign an order to a different customer? My goal is to build a B2B Company account system. Example:

UserID 1 = Headquarter
UserID 2 = Office
UserID 3 = Office
...

Orders from ID 2 or ID 3 should be assigned to ID 1 because in my ERP system I need all sales to be assigned to the Headquarter.
Any idea on how to achieve this in M2? Maybe I'm thinking in the wrong direction. Any help would be appreciated.
Thank you very much.


texts: After upgrade Magento 2.3.3, sales emails are not receiving. Please refer attached file.


texts: How to configure Magento 2 multiple websites on AWS EC2

texts:
I have an an Apache web server running on AWS EC2 instance serving a fresh Magento 2.3 installation. I want this one M2 instance to serve multiple stores across multiple domains.
For example:
www.coolbooks.com -> serves coolBooks store
www.coolTshirts.com -> serves coolTshirts store
Apache on that one Ec2 server should serve those two domains.

I know how to set up the different websites and stores on the Magento admin site, but I am clueless on how to configure this via Apache and AWS.

I have read and follow the related documentation here but that did not work for me. It would redirect me to these domains in the browser but did not serve any pages. I suspect DNS issues.

Is there a way to do this?


texts: Adding product variations using the configurable product module

texts:
I have issues creating configurable product using the configurable product and EAV modules.

Here is what I currently do :

    // $product is a simple product created before

    $product->setTypeId('configurable');
    $this->_productRepository->save($product);

    $versionAttribute = $this->_attributeRepository->get(4, 'product-version');

    $configurableOption = $this->_configurableOptionFactory->create();
    $configurableOption->setLabel('Version');
    $configurableOption->setAttributeId($versionAttribute->getId());
    $configurableOption->setProductId($product->getId());

    $configurableOptionValues = [];
    foreach ($versions as $version)
    {
        // Just creates a clone of the default attribute set, adding the 'version' attribute
        $versionAttributeSet = getOrCreateVersionAttributeSet();

        $option = $this->_attributeOptionFactory->create();
        $option->setLabel($version['name']);
        $this->_attributeOptionManagement->add(4, 'product_version', $option);

        $configurableOptionValue = $this->_configurableOptionValueFactory->create();

        // Set the value index to the value of the created option (not pretty sure about this)
        $configurableOptionValue->setValueIndex($option->getValue());

        $configurableOptionValues[] = $configurableOptionValue;
    }

    $configurableOption->setValues($configurableOptionValues);
    $this->_configurableProductManagement->generateVariation($product, array($configurableOption));

    return $product;

For information, here is the factories used :

\Magento\ConfigurableProduct\Model\Product\Type\Configurable\AttributeFactory $configurableOptionFactory
\Magento\ConfigurableProduct\Api\Data\OptionValueInterfaceFactory $configurableOptionValueFactory
\Magento\Eav\Api\Data\AttributeOptionInterfaceFactory $attributeOptionFactory

And here is the exception issued :

1 exception(s):
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Attribute with attributeCode "5183" does not exist.

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Attribute with attributeCode "5183" does not exist.
#0 /var/www/mymagentosite.com/vendor/magento/module-catalog/Model/Product/Attribute/Repository.php(90): Magento\Eav\Model\AttributeRepository->get('catalog_product', '5183')
#1 /var/www/mymagentosite.com/var/generation/Magento/Catalog/Model/Product/Attribute/Repository/Interceptor.php(24): Magento\Catalog\Model\Product\Attribute\Repository->get('5183')
#2 /var/www/mymagentosite.com/vendor/magento/module-configurable-product/Model/ConfigurableProductManagement.php(89): Magento\Catalog\Model\Product\Attribute\Repository\Interceptor->get('5183')
#3 /var/www/mymagentosite.com/vendor/magento/module-configurable-product/Model/ConfigurableProductManagement.php(51): Magento\ConfigurableProduct\Model\ConfigurableProductManagement->getAttributesForMatrix(Array)
#4 /var/www/mymagentosite.com/app/code/MyModule/Import/Block/Adminhtml/Index/Load.php(1099): Magento\ConfigurableProduct\Model\ConfigurableProductManagement->generateVariation(Object(Magento\Catalog\Model\Product\Interceptor), Array)
#5 /var/www/mymagentosite.com/app/code/MyModule/Import/Block/Adminhtml/Index/Load.php(1291): MyModule\Import\Block\Adminhtml\Index\Load->createConfigurableProduct(Array, Object(Magento\Catalog\Model\Category\Interceptor))


texts:
for designing purposes I need to retrieve the product category path of each single product. I was able to retrieve the category path and explode the first level using the following code in catalog/product/list.phtml:

<?php $currentCat = Mage::registry('current_category'); ?>
<?php $exp = explode("/", $currentCat->getPath());?>

on the other hand I tried to retrieve category path of each product display in search results in order to display different colors for each product based on their main category but with no good results.

any help will be appreciated. brgds.


texts: Magento 2 Inventory Management based on customer Groups

texts:
I have a condition for example lets suppose I have a product having quantity equals to 100,

Case:1
 b2b customer who can purchase max of 20 products and after that he cannot order any more of that product

Case:2
now I have b2c customer who can order max 3 quantity of that product and after he cannot purchase any more.

Is there anyway to fix that issue ? Or anyone have tried this.
Thanks in advance.


texts:
We are using Magento2.3 and found an issue that is status filter is not working properly in admin.

We have some of the products which is disabled. When I filter the product with Status disabled, I'm also getting the products which is enabled.

Did anyone find the same issue?

Could anyone please help me to resolve this?


texts: Random products "item****" show up in magento regularly

texts:
Recently, something weird happened to my magento site.

Every a few days, hundreds and thousands random products were added. No one did that, and the weird part is that all those products are called "item***" with a specific price which is not the price from my original products. All my original products are still there, while unwanted products were added constantly.

Did anyone encounter similar problem? Any clue about where to start checking?

I am using magento 1.9


texts: Magento 2: How to display Category Image at top of the page after breadcrumbs

texts: I'm trying to display category image after bread crumbs. Is that possible to display after bread crumbs? If possible please let me know how can i do that. Here is the screenshot of my website.


texts:
I created a custom form that search for specific product attribute my form look like this

$location = $this->getRequest()->getParam('location');
$specialization = $this->getRequest()->getParam('specialization');
$name = $this->getRequest()->getParam('name');
$attrSetName = "Group Deal";
$attributeSetId = Mage::getModel('eav/entity_attribute_set')
    ->load($attrSetName, 'attribute_set_name')
    ->getAttributeSetId();
$_productCollection=$this->getLoadedProductCollection();
$_productCollection->clear()
    ->addFieldToFilter('attribute_set_id', $attributeSetId)
    ->addAttributeToFilter('type_id', array('eq' => 'virtual'));
    //Default Count//
    $count = $_productCollection->getSize();

<?php  if(!empty($location)): ?>
    <?php $_productCollection->clear()->addAttributeToFilter('contact_city', array('like' =>$location.'%' )); ?>
<?php endif;?>
<?php  if($specialization>0): ?>
    <?php $_productCollection->clear()->addAttributeToFilter('doctor_specialization',$specialization);?>
<?php endif;?>
<?php  if(!empty($name)): ?>
    <?php $_productCollection->clear()->addAttributeToFilter('name', array('like' =>'%'.$name.'%' )); ?>
<?php endif;?>

The above line of code is how i return my results. How ever when i search with 2 search parameters like name and location im not getting accurate results, Is there any way to improve the search query? Any help would be appreciated very much.


texts: Custom option price changes after product edit Magento 2

texts:
I have big issue in magento 2 backend. When editing product which has custom options with different prices.
After saving the product custom options price is changing automaticaly:

Example

"custom option 1" price is 1500.00

After save:

Expected result:

custom option price should be 1500.00

Actual result:

custom option price is 1.00

Is there any solution for this issiue?


texts: addAttributeToSelect Call to undefined method M2

texts:
I have two custom modules and am calling one collectionfactory in other module and getting `

  Call to undefined method addAttributeToSelect

Collection file look like

    class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
    /**
     * Initialize resource collection
     *
     * @return void
     */
    public function _construct()
    {
        $this->_init('Vendor\Module\Model\Hello', 'Vendor\Module\Model\ResourceModel\Hello');
    }
}

and am calling in block

use Vendor\Module\Model\ResourceModel\Hello\CollectionFactory;

    class Custom extends \Magento\Backend\Block\Widget\Grid\Extended
    {
    public function __construct(
            CollectionFactory $collectionFactory,
            array $data = []
        ) {

            $this->collectionFactory = $collectionFactory;
            parent::__construct($context, $backendHelper, $data);
        }

    protected function _prepareCollection()
        {
            $collection = $this->collectionFactory->create();
            $collection->addAttributeToSelect('*');
            $this->setCollection($collection);
            return parent::_prepareCollection();
        }

    }

  Getting PHP Fatal error:  Uncaught Error: Call to undefined method
  Vendor\Module\Model\ResourceModel\Hello\Collection::addAttributeToSelect()


texts: Magento 1.9.1.0 not creating saleable products

texts:
Hi I'm trying to create products programmatically following the guide at http://www.vodoosolutions.com/importing-products-magento-programmatically-php.html. The products do show up in the categories but when I view the product page the 'Add to Cart' button is not showing up. Looking at the code, the product(s) are obviously not saleable. Any ideas on this? Below is the code I'm using when creating the products.

$product = Mage::getModel('catalog/product');
  /*** Product insertions ***/
  $part_row = array_map('trim', $part_row);
  $product->setSku($part_row['partnum']);
  $product->setName($part_row['shortdesc']);
  $product->setDescription($part_row['longdesc']);
  $product->setShortDescription($part_row['shortdesc']);
  $product->setManufacturer('');
  $product->setPrice($part_row['price']);
  $product->setTypeId('simple');
  $product->setCategoryIds(GetCategory($part_row['category'])); // need to look these up
  $product->setWeight(0);
  $product->setTaxClassId(2); // taxable goods
  $product->setVisibility(4); // catalog, search
  $product->setStatus(1);
  $product->setAttributeSetId(4); // need to look this up
  $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
  /*** Stock Data Array ***/
  $stockData = $product->getStockItem();
  $stockQty = 10000;
  $stockItem = Mage::getModel('cataloginventory/stock_item');
  $stockItem->assignProduct($product);
  $stockItem['is_in_stock'] = 1;
  $stockItem['stock_id'] = 1;
  $stockItem['store_id'] = 1;
  $stockItem['manage_stock'] = 0;
  $stockItem['use_config_manage_stock'] = 0;
  $stockItem['min_sale_qty'] = 0;
  $stockItem['use_config_min_sale_qty'] = 0;
  $stockItem['max_sale_qty'] = 1000;
  $stockItem['use_config_max_sale_qty'] = 0;
  $stockItem['is_salable'] = 1;
  $stockItem['qty'] = $stockQty;
  $product->setStockData($stockData);
  $product->save();

EDIT
Thanks Marius for catching that, after importing products I always reindex/clear the cache. The frontend is still not rendering properly after changing the code to actually set the product stock. While the categories (list.phtml) view does show the 'Add to Cart
' button the product view (view.phtml) does not. The new code is posted below for more information on how I'm importing things.

/*** Stock Data Array ***/
  $stockData = $product->getStockItem();
  $stockQty = 10000;
  $stockData = Mage::getModel('cataloginventory/stock_item');
  $stockData->assignProduct($product);
  $stockData['is_in_stock'] = 1;
  $stockData['stock_id'] = 1;
  $stockData['store_id'] = 1;
  $stockData['manage_stock'] = 0;
  $stockData['use_config_manage_stock'] = 1;
  $stockData['min_sale_qty'] = 0;
  $stockData['use_config_min_sale_qty'] = 0;
  $stockData['max_sale_qty'] = 1000;
  $stockData['use_config_max_sale_qty'] = 0;
  $stockData['is_saleable'] = 1;
  $stockData['qty'] = $stockQty;
  $product->setStockData($stockData);
  $product->save();


texts:
I'm currently writing a Magento 2 extension to add Product attachments. In my extension I add an extra tab on the admin product page called 'Downloads'. In this tab several upload inputs are shown where the user can add a product attachment. My upload function works, but now I want to add the possibility to remove the attachment.

I know how to write the Model functions, but how can I create a route that points to a Adminhtml controller where my delete function is.

I already added an adminhtml/routes.xml which contains the following:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="admin">
        <route id="sample_productdownloads" frontName="sample_productdownloads">
            <module name="Sample_ProductDownloads" before="Magento_Backend" />
        </route>
    </router>
</config>

This is my controller, located in: Controller\Adminhtml\Index folder.

<?php
namespace Sample\ProductDownloads\Controller\Adminhtml\Index;

use Magento\Backend\App\Action;
use Sample\ProductDownloads\Model\Download;

class Index extends Action
{

    /**
     * @var Download
     */
    private $download;

    /**
     * @param Action\Context $context
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Sample\ProductDownloads\Model\Download $download
    ) {
        parent::__construct($context);
    }

    public function index()
    {
        die('test');
    }
}

I'm trying to access the page from: http://magento.dev/admin/sample_productdownloads/index/index

It's very hard to debug why this is not working because I keep getting redirected to Magento backend home.

Thanks.


texts: How can I change the layout of my category (product) page from 2column to 1column using local.xml

texts:
Setting:

Using Magento 1.9
My Default template is 2column_left set at my local.xml (as shown below)

My categories are as follows and isAnchor=No:

Top1
  Sub1-Top1
    Sub1-Sub1-Top1
  Sub2-Top1
  Sub3-Top1
    Sub1-Sub3-Top1
Top2
   Sub1-Top2
   Sub2-Top2
     Sub1-Sub2-Top2

Scenario:

I would like the layout for Sub2-Top1 and Sub1-Top2 (no subcategories) to have the 1column template and the rest should have the 2column_left. But I cannot seem to get it correctly.

I was trying to accomplish this task from the examples:

layout - call left column block within main column (in the 1column.phtml template)
and https://stackoverflow.com/questions/9763350/how-to-change-the-page-layout-in-magento

local.xml

  <ep_catalog_category_template>
    <reference name="root">
      <action method="setTemplate">
        <template>page/2columns-left.phtml</template>
      </action>
    </reference>
  </ep_catalog_category_template>

  <ep_no_catalog_category_template>
    <reference name="category.products">
      <action method="setTemplate">
        <template>page/1column.phtml</template>
      </action>
    </reference>
  </ep_no_catalog_category_template>

  <catalog_category_layered>
    <update handle="ep_catalog_category_template" />
  </catalog_category_layered>

  <catalog_category_default>
    <update handle="ep_catalog_category_template" />
  </catalog_category_default>

  <catalog_category_layered_nochildren>
    <reference name="category.products">
      <action method="setTemplate">
        <template>page/1column.phtml</template>
      </action>
    </reference>
  </catalog_category_layered_nochildren>

The catalog_category_layered_nochildren tag should replace the default template to 1column but it is not working. Instead the output page is 2column with the left side contains no content and the main content has the list of products. I would like the list of products to use all the page -- thus removing the left_column ergo 1column. Can it be done using local.xml? or better yet, how can I do this?


texts: Magento 2.2: Ajax login is not working in Mozilla and IE

texts:
I added ajax login form in my custom theme and it's working fine in chrome but in Mozilla when I try to log in it redirects me to the same page. I am unable to log in.

Here is my ajax code:

<script>
    require([
        'jquery',
        'mage/mage'
    ], function ($) {
        var dataForm = $('#form-login');
        dataForm.mage('validation', {});

        $('.action-login').on('click',function () {
            if(dataForm.validation('isValid')){
                var formData = new FormData();
                formData.append('username', $('#form-login input[name="username"]').val());
                formData.append('password', $('#form-login input[name="password"]').val());
                $.ajax({
                    url: '<?php echo $block->getAjaxLoginUrl(); ?>',
                    data: formData,
                    processData: false,
                    contentType: false,
                    showLoader: true,
                    type: 'POST',
                    dataType: 'json',
                    success: function (response) {
                        console.log(response);
                        if (!response.errors) {
                            location.reload();
                        } else {
                            $('.popup-login .form-login .messages .message div').text(response.message);
                            $('.popup-login .form-login .messages .message').show();
                            setTimeout(function() {
                                $('.popup-login .form-login .messages .message').hide();
                            }, 5000);
                        }
                    }
                });
                return false;
            }
        })
    });
</script>


texts:
I want to overide files located  in

vendor/magento/module-theme/view/frontend/templates/html/header.phtml

to

app/design/frontend/Magento/theme-frontend-luma/Magento_Theme/templates/html/header.php

but the old file is being called from vendor folder, maybe above structure is wrong?


texts: CSV uploader throwing errors randomly for identical entries

texts:
I'm trying to upload 12000 SKU's (1000 at a time) using the CSV uploader.

I'm getting some random errors for identical data.

For example, every cell in the attribute_set_column has a 9, but I get this error

  Invalid value for Attribute Set column (set doesn't exist?) in a
  row(s): 575, 577

Is there any way to fix inconsistencies like this, or at lease get less vague error messages?

Thanks


texts: New custom product type in magento, looking for an expert who can help us

texts:
Looking for an expert in Magento and has knowledge on product types and thinks out of the box.

Case:

Our webshop sells furniture. As an example let's use a chair.

A chair can consist out of multiple parts
Seating
Back seating
Frame
Other Accessories

All of these parts have their own stock details. The customer should not see that a chair consists out of different parts so the default magento configurable products or bundle products are not an option.

Please see the screenshot on what we would need. This will be a paid job! Any comments from the community will be much appreciated.


texts: Set discount price without using coupon in magento 1.9

texts:
Am trying to set discount price without using coupon. Discount apply but i have creating a checkbox in checkout/onepage if i click checkbox discount apply else discount don't apply here.

Following my code:

PHTML:

            <input id="epayment" value="" type="checkbox" name="payment[method]" title="Payment By Your EPayment" onclick=""  class="pull-left" autocomplete="off" data-toggle="collapse" data-target="#demo">
               Payment By EPayment

                Payment To Be Made
                <input type="text" name="cart_amount" id="cart_amount" value="1900">

                Your Balance Amount
                <input type="text" name="epayment_amount" id="epayment_amount" value="2000">

                Left Amount To Be Pay
                <input type="text" name="left_amount" id="left_amount" value="">

Controller:

class EPayment_EPayment_IndexController extends Mage_Core_Controller_Front_Action{
  public function getepaymentAction()
  {
    $params = $this->getRequest()->getParams();
    $cart_amount = $params['cart_amount'];
    if($cart_amount > 0){
      //Mage::dispatchEvent('sales_quote_collect_totals_after', array('cart_amount' => $cart_amount));
      Mage::dispatchEvent('sales_quote_collect_totals_after', ['cart_amount' => $cart_amount]);
      $this->getResponse()->setHeader('Content-type', 'application/json');
      $this->getResponse()->setBody($cart_amount);
    }
  }
}

Model/Observer:

class EPayment_EPayment_Model_Observer
{

public function setDiscount($observer)
{
$quote = $observer->getEvent()->getQuote();
$quote = $observer->getEvent()->getQuote();
  $cart_amount = $quote->getBaseSubtotal();
  $quoteid = $quote->getId();

  $discountAmount = $total;
   // some code here
   // ...
   // ...
}
}

I have pass cart_amount using ajax, And then get ajax data in controller.


texts: Remove file of downloadable product in directory

texts:
in my magento web site i have many Sample of downloadable product. I would like that when i click the red "X" to remove the sample and i save it also the file in the magento directory is deleted

Do you know how i can procede to do that?

If you can give me some suggestion i can try to do that by my self.

I would like to do that because my Magento directory is full of unused documents.


texts: Block code issue on magento 2 Product description page

texts:
I added magento review form like this

<referenceContainer name="content">
    <container name="product.info.breviews" htmlTag="div" htmlClass="product info detailed" after="-">
        <block class="Magento\Review\Block\Form" name="product.review.form" as="review_form">
            <container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before" htmlTag="div" htmlClass="rewards"/>
        </block>
        <block class="Magento\Review\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="product/view/list.phtml"/>
        <block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"></block>
    </container>
</referenceContainer>

But its disturbing functionality of that green bar notification on product add on product description page. Is there anything wrong in code
?

UPDATE

I tried to run by commenting lines issue is in this portion

<block class="Magento\Review\Block\Form" name="product.review.form" as="review_form">
    <container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before" htmlTag="div" htmlClass="rewards"/>
</block>

what I am doing in these 2 lines wrong ?Any help would be highly appericiated


texts: System.xml 'select' field - Can I pass parameter for $addEmpty?

texts:
I was wondering if it is possible to pass parameters to the source model from the system.xml. This is how my system.xml currently looks like:

                <category>
                    <label>Category</label>
                    <frontend_type>select</frontend_type>
                    <sort_order>3</sort_order>
                    <source_model>adminhtml/system_config_source_category</source_model>
                    <comment>I live</comment>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                </category>

It works but I have no empty value at the top of the dropdown because I cant pass the boolean parameter true to the source model. Just to make things easy, this is the source model:

<?php

class Mage_Adminhtml_Model_System_Config_Source_Category
{
    public function toOptionArray($addEmpty = true)
    {
        $tree = Mage::getResourceModel('catalog/category_tree');

        $collection = Mage::getResourceModel('catalog/category_collection');

        $collection->addAttributeToSelect('name')
            ->addRootLevelFilter()
            ->load();

        $options = array();

        if ($addEmpty) {
            $options[] = array(
                'label' => Mage::helper('adminhtml')->__('-- Please Select a Category --'),
                'value' => ''
            );
        }
        foreach ($collection as $category) {
            $options[] = array(
               'label' => $category->getName(),
               'value' => $category->getId()
            );
        }

        return $options;
    }
}


texts: Check tier price is applied or not to product

texts: How can I check whether tier price is applied or not after add product to the cart ?


texts: Magento 2: Custom Validation with Email field in checkout

texts:
I need to verify the entered email address in checkout against the API response. So I'm thinking to add the custom validation field with the email in checkout.
Here I will check the API response.
http://127.0.0.1/magento2/V1/customers/isEmailAvailable
If the email is invalid I need to trigger the custom validation rule.
Please give me some suggestion


texts: 'Yes' to newsetter in checkout - store email and name in Subscriptions database

texts:
I have managed to add a checkbox for newsletter in my checkout by this article from Mageplaza: https://www.mageplaza.com/add-new-input-form-magento-2.html.

So how do I grab this information and store the user email and name in the newsletter subscriptions database, if the checkbox is ticked?

(pls bare with me - I am very new to customizing my site)