texts:
i am working on magento 1.5 i am getting this error

Notice: Trying to get property of non-object in /var/www/html/app/code/core/Mage/Core/Model/Config.php on line 1173

Notice: Trying to get property of non-object in /var/www/html/app/code/core/Mage/Core/Model/Config.php on line 1173

Notice: Trying to get property of non-object in /var/www/html/app/code/core/Mage/Core/Model/Config.php on line 1173

Notice: Undefined index: _resource_singleton/core/store in /var/www/html/app/Mage.php on line 258


texts: Frequently used functions in model or helper

texts: I made a curl function so that I can make an api call. Now the function I created is in helper and I call it with Mage::helper('xyz')->curlGet($url). This works but I am not sure whether this is the  proper way. I have seen functions created in models. Is there some kind of function convention in magento? Sorry for sounding silly, I am a beginner.


texts: How to Change Block class for sales order status history tab

texts:
Below is the Block

            <action method="addTab">
                <argument name="name" xsi:type="string">order_history</argument>
                <argument name="block" xsi:type="string">Magento\Sales\Block\Adminhtml\Order\View\Tab\History</argument>
            </action>

I want to use my block class but not able to change it.

I have tried with below code.

<referenceBlock class="\Mymodule\MyBLock" name="order_history" >

But not working.

Please help


texts: Magento 2 - add data attributes on product page to main img

texts:
I need to add few data attributes to main image on product page (using Magento 2.3).
I tried following code in block, which I added to product page. But it is not working. Alert outputs code, but data attributes are not on product image.
<script type="text/javascript">
require(['jquery'], function($){
    jQuery(document).ready( function() {

        jQuery('[data-gallery-role=gallery-placeholder]').on('gallery:loaded', function () {

            console.log("gallery loaded.");

            var $img = jQuery(".gallery-placeholder img");

            $img.attr('data-tl-spcode', '54341-40');
        });
    });
});

I can't find any working solution for it. Thank you!


texts: How to get country code from the store object

texts:
This is my code:

 $store = Mage::getModel('core/store')->load(1);

1- stands for Germany

I want to get the country code. In my case: "DE". How do I get that  ?


texts: Magento 2.3 customer beforeAuthenticate plugin not working

texts:
I am facing allowed memory size of bytes exhausted when ever trying to login customer in magento 2.3.2

I have used beforeAuthenticate plugin to do some functionality after sometime customer can not logging In. i have disabled my custom extension but still facing same issue.

File 1. Demo\Common\etc\di.xml

<type name="Magento\Customer\Model\AccountManagement">
    <plugin name="xxx_set_password_if_empty" type="Demo\Common\Plugin\Customer\Model\AccountManagement" sortOrder="1"/>

File 2 Demo\Common\Plugin\Customer\Model\AccountManagement.php

namespace Demo\Common\Plugin\Customer\Model;

use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Model\CustomerRegistry;
use Magento\Framework\Encryption\EncryptorInterface as Encryptor;
use Magento\Framework\Exception\InvalidEmailOrPasswordException;
use Magento\Framework\Exception\NoSuchEntityException;

class AccountManagement
{
private $customerRegistry;
private $customerRepository;
private $encryptor;
private $connection;

public function __construct(
    CustomerRegistry $customerRegistry,
    Encryptor $encryptor,
    \Magento\Framework\App\ResourceConnection $resource,
    CustomerRepositoryInterface $customerRepository

) {
    $this->customerRegistry = $customerRegistry;
    $this->encryptor = $encryptor;
    $this->_resource = $resource;
    $this->customerRepository = $customerRepository;
}
public function beforeAuthenticate(\Magento\Customer\Model\AccountManagement $subject, $username, $password)
{

    try {
        $customer = $this->customerRepository->get($username);
    } catch (NoSuchEntityException $e) {
        throw new InvalidEmailOrPasswordException(__('Invalid login or password.'));
    }

    /* START : Logic to set customer's password if found empty within our database */
    $customerSecure = $this->customerRegistry->retrieveSecureData($customer->getId());

    try {
        if(empty($customerSecure->getData('password_hash'))) {

        }
    } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
            return array($username, $password);
        }
    return array($username, $password);
    /* END : Logic to set customer's password if found empty within our database */
}

}


texts: Move Customer Extension Attribute to new tab

texts:
I've successfully created several customer extension attributes that display on the customer form and save and load data.

When I try to move these fields to a new custom tab on the customer admin page, they break.  The source models still load, but the data isn't populated or saved.  I can see when I inspect that the form name changes from customer['my_attribute'] to my_tab[my_attribute].

I suspect I need to change my UpgradeData.php script to use a custom form, but I'm having trouble finding resources on how to go about this.

Relevant snippet from UpgradeData.php:

        $exemptionTypeCode = 'my_exemption_type';
        $eavSetup->addAttribute(
            CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
            $exemptionTypeCode,
            [
                'group' => 'General',
                'type' => 'varchar',
                'label' => 'Exemption Type',
                'input' => 'select',

                'required' => false,
                'visible' => true,
                'user_defined' => true,
                'position' => 501,
                'system' => 0,
                'sort_order' => 50,
                'default' => 'non_exempt',

                'source' => 'Custom\Module\Model\Attribute\Source\CustomerExemptionType',
                'backend' => 'Custom\Module\Model\Attribute\Backend\CustomerExemptionType',
                'frontend' => 'Custom\Module\Model\Attribute\Frontend\CustomerExemptionType',
                'global' => 'Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL',

                'is_used_in_grid' => false,
                'is_visible_in_grid' => false,
                'is_filterable_in_grid' => false,
                'is_html_allowed_on_front' => true,
                'visible_on_front' => true
            ]
        );
        $eavSetup->addAttributeToSet(
            CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
            CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER,
            null,
            $exemptionTypeCode);
        $exemptionType = $this->eavConfig->getAttribute(
            CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
            $exemptionTypeCode);
        $exemptionType->setData('used_in_forms', ['adminhtml_customer']);
        $exemptionType->getResource()->save($exemptionType);

Snippet from customer_form.xml, changing fieldset name from 'customer' to 'my_tab' breaks the extension attributes.

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="customer">
    <field name="my_exemption_type" formElement="select">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Exemption Type</item>
                <item name="source" xsi:type="string">customer</item>
            </item>
        </argument>
        <settings>
            <visible>true</visible>
        </settings>
    </field>
</fieldset>

Any help with either moving attributes to different tabs, creating a new admin form, or a different approach I haven't considered are appreciated!


texts: Custom script for custom attribute not running

texts:
I have created a script to update a custom attribute for all of my products and for some reason it isn't running. I have it located in the base folder of magento and I'm calling it using (base siteurl)/fitment.php and it's not executing. I've tested another script using echo and it works. Are there restrictions on reading a file from the base url or something?  The file in question is below.

     require_once('app/Mage.php');
     umask(0);
    Mage::app('default');
    Mage::app ()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

    $path =  Mage::getBaseDir('var') . '/import/YMM.csv';
    $myfile = fopen($path, "r") or die(Mage::log("failed to open" . $path));

    if ($myfile) {
    $sku = array();
    while (($line = fgets($myfile)) !== false) {
        try {
            //split file by comma
            $array = explode(",", $line);
            $count = 0;
            $yearMakeModel = array();
            $make = "";
            $model = "";
            foreach ($array as $ymm) {
                if ($count == 1) {
                    $make = $ymm;
                } elseif ($count == 2) {
                    $model = $ymm;
                } elseif ($count > 1) {
                    array_push($yearMakeModel, $ymm);
                }

                $count++;
            }
            sort($yearMakeModel);
            $fullText = $make . " " . $model . " ";

            $count = 1;
            $yearsText = "";
            $multiple = false;
            $set = false;
            $previous = 0;
            $lastElement = end($yearMakeModel);
            foreach ($yearMakeModel as $years) {

                if (!empty(trim($years))) {
                    if (!$set) {

                        $yearsText = $years;
                        $previous = $years;
                        $set = true;
                    } elseif ($previous + 1 == $years) {
                        if($years == $lastElement){
                            $yearsText = $yearsText . " - " . $years;
                        }
                        $previous = $years;
                        $multiple = true;
                    } else {
                        if ($multiple) {

                            $yearsText = $yearsText . " - " . $previous . ", " . $years;
                            $previous = $years;
                            $multiple = false;
                        } else {
                            $yearsText = $yearsText . ", " . $years;
                            $previous = $years;
                            $multiple = false;
                        }
                    }
                }
                $count++;
            }

            $fullText = $fullText . $yearsText;

            if (array_key_exists($array[0], $sku)) {
                $sku[$array[0]] = $fullText . "
" . $sku[$array[0]];
            } else {
                $sku[$array[0]] = $fullText;
            }

        } catch (Exception $e) {
            Mage::log("error updating fitment attribute field");
            Mage::log($e->getMessage());
        }
    }

    /**
     * insert fitment info into the fitment attribute
     */
    try {
        while ($year = current($sku)) {
            echo key($sku) . "
";

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

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

            if($product->getId()){
                $product->setData('fitment', $year)->getResource()->saveAttribute($product, 'fitment');
            }

            next($sku);
        }
    }catch(Exception $e){
        Mage::log($e->getMessage());
    }

}


texts: How to add product to compare products using product id programmatically in Magento 2

texts:
How to add product to compare products using product id  programmatically.

Please give me suggestions.


texts: View,Clicks and Wishlist for specific Product in Magento

texts:
I am working on website where i need to show unique Views,Clicks,Wishlist and Overall views of that product.For Unique Views i use this code :

$from = '2001-01-01';
        $to = now();
    $productIds = '2';
    $reports = Mage::getResourceModel('reports/product_collection')
    ->addViewsCount($from, $to)
    ->addFieldToFilter('entity_id', $productIds);
    $result = $reports->getData();

    return $result['0']['views']);

Now the problem is that the

views = clicks ? if not how can i get the clicks.
Above code is for
unique views can i write custom code for overall views on product
details page etc.
How can i get no of wishlist that have this
product.I think collection with product filter can work.Do this is
the right way ? Hope i can find any help for above any questions.


texts: How to set default currency for different stores?

texts:
we have created different stores with one base currency, But i need to show each store in different currency automatically, i had already changed

  Catalog Price Scope to : website

Now i had set Default Display Currency to preferred one for each websites by changing 'Current Configuration Scope'. But even after switching to different store the default currency defined is showing always.


texts: How to get custom attribute value from adminhtml customer custom field using observer

texts: How to get custom attribute value from admin_html customer field using observer customer_save_after event?


texts: How to edit magento 2 grouped products page?

texts:
How do I edit and change Magento 2 grouped products page? I wish to be able to add more table cells on the page so I can add more information that I need to show from each product in the grouped products. Unfortunately, it seems I'm missing something very important to be able to do this.

Here's what iv done so far:

Copied the

magento/module_grouped_product/view/frontend/templates/product/view/type/grouped.phtml

and created a new folder in

theme/Magento_Grouped_Product/view/frontend/templates/product/view/type

Iv also included the view/type/default.phtml and layout/catalog_product_view_type_grouped.xml in my theme.

After copying these files I tested the grouped.phtml and added a new <th> with just a text TEST and ran setup:upgrade and setup:static-content:deploy, to ensure the updates would get loaded, but nothing has changed. Have I copied the wrong file(s) to my theme or done the whole process wrong?


texts: Slow Magento 2 saving for configurable products

texts:
when I save a Simple Product it goes through quite fast. When I do a Configurable product with lots of associated Simple Products as options, it takes a whole lot of time to save (20+ seconds).

Magento is currently in production mode with all products indexed by a cron job.

Is there a way to make this faster? I think that it might be saving all Simple Products associated with the Configurable product, which is making it slow. Can it maybe be set to save only the particular Simple Product?


texts:
Fatal error: Call to undefined method
  Mage_Adminhtml_Helper_Sales::escapeHtmlWithLinks() in
  /app/design/frontend/base/default/template/mageworx/ordersedit/sales-order-view.phtml
  on line 78

Line 78:

<?php echo Mage::helper('adminhtml/sales')->htmlEscapeWithLinks($_historyItem->getComment(), array['b','br','strong','i','u', 'a']); ?>

Is this related with SUPEE-7405? I'm using Magento 1.7.0.2.
This error is related to customer frontend when attaching documents to order.
http://prntscr.com/n6wvmk


texts: ReflectionException; Class...\Foo\BarV1Interface does not exist

texts:
When running the compile command setup:di:compile it leaves me with this error;

[ReflectionException]
Class \Magento\Framework\Module\Service\Magento\Framework\Module\Service\Foo\BarV1Interface does not exist

The full stack trace;

Exception trace:
() at ./setup/src/Magento/Setup/Module/Di/Code/Scanner/PhpScanner.php:173
ReflectionClass->__construct() at ./setup/src/Magento/Setup/Module/Di/Code/Scanner/PhpScanner.php:173
Magento\Setup\Module\Di\Code\Scanner\PhpScanner->collectEntities() at ./setup/src/Magento/Setup/Module/Di/App/Task/Operation/ApplicationCodeGenerator.php:77
Magento\Setup\Module\Di\App\Task\Operation\ApplicationCodeGenerator->doOperation() at ./setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
Magento\Setup\Module\Di\App\Task\Manager->process() at ./setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:187
Magento\Setup\Console\Command\DiCompileCommand->execute() at ./vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at ./vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at ./vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at ./vendor/magento/framework/Console/Cli.php:96
Magento\Framework\Console\Cli->doRun() at ./vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at ./bin/magento:23

I've found this particular class in;

vendor/magento/module-webapi/Test/Unit/_files/test_interfaces.php

And the module-webapi is indeed included, so I wouldn't know why it isn't included

Running Magento 2.1.8 and php 7.0.22.

I tried all kinds of things; emptying the var/generation directory, clearing the whole var directory, clearing only the cache, deleting the vendor dir and run a composer update, but nothing helped me out... I don't know where to start debugging this.


texts:
I have a image, that situated

vendor/mymodule/magento2/Checkout/view/frontend/web/images/dynamicimageweb.gif

And in the plugin I need to set URL, that will open this image and which I will insert in the future in src. How i can do it?

EDIT


texts: How to Remove the invoice & Shipment link from my Account pages?

texts: How can I remove invoices & shipment links from my account/myorder page ? I am using Magento ver. 1.9.2


texts: Magento2 - product bulk assign to website

texts:
I am about to setup a different "website" in my Magento 2 Shop. I want to assign all products to that Website and copy the data from one specific store-view within the base-website. Is there a solution to create this in bulk ( SQL maybe ? )

Did anyone already accomplished a task like that?

TLDR - short explanation ( I want to ):

  • Copy the product data from website1 - storeview1

  • Assign the product to website2

  • Assign the storeview data from website1 storeview1 to website2
  storeview2


texts:
How can I check whether all bundle items are available?
I read somewhere about this $_product->getStockItem()->getIsInStock() but it doesn't work for me.

I need to make bundle product not saleable if one of bundle items is not saleable.


texts:
I have bootstrap slider and I want to put it in magento2 can any one tell me how I do this

my code is below

js:bootstrap.js
js:bootstrap.min.js

Add code in requirejs-config.js

var config = {
    paths: {
        "jquery.bootstrap": "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min"
    },
    shim: {
        'jquery.bootstrap': {
            'deps': ['jquery']
        }
    }
};


texts: Can't login to admin page with no errors

texts:
I tried with this way but it doesn't work.

What causes this problem occur?
Because after one month installation, everything is okay and suddenly this is happened.


texts: Product pagination for customer group not working in Enterprise Edition

texts:
I am using Magento Enterprise ver. 1.14.0.1, when I log in with a particular customer group(Sales Representative) other than general customer group category product list not working as per general customer group. I add two identical products in admin both are simple products, pagination is not working as it works in general customer group, default I can see 1 product loaded for (Sales Representative) whereas for general it has 12.

Debug code and found that product collection give result 1 below is a query which gives all proper result but on the page, it displays 1 product

 SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`,
    `price_index`.`tax_class_id`, `price_index`.`final_price`,
    IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price,
        price_index.tier_price), price_index.min_price) AS `minimal_price`,
    `price_index`.`min_price`, `price_index`.`max_price`,
    `price_index`.`tier_price`
FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_category_product_index` AS `cat_index`
    ON cat_index.product_id=e.entity_id
    AND cat_index.store_id=1
    AND cat_index.category_id = '54'
INNER JOIN `catalog_product_index_price` AS `price_index`
    ON price_index.entity_id = e.entity_id
    AND price_index.website_id = '1'
    AND price_index.customer_group_id = '6'


texts:
I'm looking to run a .csv dump file in magmi that updates the products url_key to ensure that all products keep their original key after a full export and import of products. (url_key may change due to name change after initial reindex therefore this is necessary to keep original paths to products in tact).

The issue I encounter is that if I run Magmi with my .csv file the url_keys don't update, that is unless I alter the url_key and save manually through magento admin. Then if I run magmi again only the products that I updated manually have their url_keys modified correctly.

Its a weird one but does anyone have any idea why the url_key wont update via Magmi unless I manually alter it in admin first?

Thanks.


texts:
Rookie question, as I am trying to find a way to work with our B2B sales (at lower prices than RRP).
If i have an additional website set up within my Magento 2 install and set up special prices for that website, but no domain is pointing to that website, will those prices only be available to the store admins?
Alternatively, can i make that website visible, but only to logged in users?


texts:
I’m kind of new with magento and I'm making an up-sell for some of my products, and they are showing at the end of the page, but they are without the price, and I want to know how can I make magento to show the prices of the up-sells products that are linked, also if there’s a possibility to show the description of the products too that will be great.

Thanks in advantage


texts: Magento 2 - How to debug indexer. error on customer_grid reindex

texts:
newly created customers are not appearing in the customer grid.
Then i noticed that my customer_grid index is not validating properly.
if i reset the index and reindex again. it will take forever and it wont finish at all.
php bin/magento indexer:reset customer_grid
php bin/magento indexer:reindex customer_grid

NOTE: i already tried to leave it overnight. it wont finish reindexing
the next time you reindex. then it will skip customer_grid because its still processing.
no errors on var/logs, apache logs and php logs.
can someone give me idea on how i can debug this. or maybe someone knows a solution for this one.
the solution on editing vendor/magento/module-customer/Model/Indexer/Source.php will not be helpful for me since im working on 2.4 and that issue was already fixed.
Thank you


texts: Error while trying to upgrade magento through composer

texts:
I am trying to update magento/product-community-edition 2.0.5 to version 2.1.0. To do that I replaced version in composer.json and tried to run composer update -vvv. Unfortunately, script is failing due to an error:

[UnexpectedValueException]
  Package magento/composer's source key should be specified as {"type": ..., "url": ..., "reference": ...},
  {"type":"git","url":"https:\/\/github.com\/magento\/composer.git","reference":null} given.

I am attaching full exception trace below. Any ideas?

Steps I made:

I tried to run it from vagrant, as well as from my mac console.
I updated composer to newest alpha.

Any help will be highly appreciated as I am pulling my hairs from my head for over an hour.

Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Reading /home/vagrant/.config/composer/composer.json
Loading config file /home/vagrant/.config/composer/composer.json
Reading /home/vagrant/Code/tandh/magento/public_html/vendor/composer/installed.json

  [UnexpectedValueException]
  Package magento/composer's source key should be specified as {"type": ..., "url": ..., "reference": ...},
  {"type":"git","url":"https:\/\/github.com\/magento\/composer.git","reference":null} given.

Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Package/Loader/ArrayLoader.php:83
 Composer\Package\Loader\ArrayLoader->load() at phar:///usr/local/bin/composer/src/Composer/Repository/FilesystemRepository.php:63
 Composer\Repository\FilesystemRepository->initialize() at phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:181
 Composer\Repository\ArrayRepository->getPackages() at phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php:250
 Composer\Plugin\PluginManager->loadRepository() at phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php:76
 Composer\Plugin\PluginManager->loadInstalledPlugins() at phar:///usr/local/bin/composer/src/Composer/Factory.php:361
 Composer\Factory->createComposer() at phar:///usr/local/bin/composer/src/Composer/Factory.php:552
 Composer\Factory::create() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:308
 Composer\Console\Application->getComposer() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:420
 Composer\Console\Application->getPluginCommands() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:131
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:123
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:102
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:43
 require() at /usr/local/bin/composer:24


texts: configurable products and simple products properties

texts: I removed a configurable product but its simple products remained in that category. Is this how it works?Shouldn’t the properties of the parent determine the properties of the simple products beneath it?


texts: How do I display two products side by side?

texts:
I'm having a difficult time setting up my organization's online store. It will consist of 2 products (Silicone wristbands, and little concrete Africas). I've followed a few instructionals but they were directed towards stores with multiple products and categories.

This is a link to the original theme.
http://demo.emthemes.com/everything/index.php/?___store=beauty_eng

I would just like my two items to display side by side, as pictured in the screenshot I've attached. Can someone please explain how to do this.


texts: How to add a custom link to header but not in the top links

texts:
In my custom module, I want to add a custom link in the header, but not within the top links.
I can't edit the header.phtml. I prefer add link through layout

http://i.prntscr.com/971IF0J_SGm72aCvgkq1GQ.png


texts: Send an order to a Fax machine automatically?

texts: I have a question regarding a placed order: Can a placed order automatically be sent to a Fax machine besides an E-Mail address?


texts: How to pass data from UI Form to PHP Class

texts:
I have created a form using UI component, This form has a select dropdown which displays option related to current entity id if form is in edit mode and all options if a new entity is being added by form.

UI Form

<fieldset name="EntityFields">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true"></item>
        </item>
    </argument>

    <!-- This field represents form id and is hidden -->
    <field name="question_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">questionmanager_entity</item>
                <item name="visible" xsi:type="boolean">false</item>
            </item>
        </argument>
    </field>
    <field name="question_type">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Ricky\QuestionManager\Model\UiForm\TypeList\Options</item>
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Ricky_QuestionManager\js\form\element\options</item>
                <item name="dataScope" xsi:type="string">question_type</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="default" xsi:type="string">0</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="label" xsi:type="string" translate="true">Question Type</item>
                <item name="notice" xsi:type="string" translate="true">Question will use Field type on store front according to selected Question type.</item>
                <item name="required" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">30</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>
</fieldset>

I want to pass current question id to following class (* if form is in edit mode)

<item name="options" xsi:type="object">Ricky\QuestionManager\Model\UiForm\TypeList\Options</item>

*Edit
This is my option class

class Options implements OptionSourceInterface
{

/**
 * Product collection
 *
 * @var \Ricky\QuestionManager\Model\ResourceModel\Question\Collection
 */
protected $collection;

/**
 * Construct
 *
 * @param CollectionFactory $collectionFactory
 */
public function __construct(
    CollectionFactory $collectionFactory
) {
    $this->collection = $collectionFactory->create();
}

/**
 * Get options
 *
 * @return array
 */
public function toOptionArray()
{
    foreach ($this->collection as $type) {
        $optionList[] = [
            'label' => $type->getTitle(),
            'value' => $type->getQuestionId(),
            'is_active' => $type->getIsDeleted()?false:true,
        ];
    }
    //echo "<pre>";print_r($optionList);exit;
    return $optionList;
}
}

Thankyou for you suggestion ans answer. :)


texts:
I am running Magento 2.2.6 and just tried to purchase and install an extension from the Magento market place but when I goto the admin I don't have the web setup wizard to install extensions.

Please can someone advise how to install extensions purchased on Magento market place.

Thanks

Chris


texts: Could not create an acl object: Invalid Document- Magento 2

texts:
After logged in to my Magento 2 admin, I got the below exception..

Can anyone help me to fix that issue?

1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 15

Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 15

#0 /home/xxxx/public_html/generated/code/Magento/Framework/Acl/Builder/Proxy.php(95): Magento\Framework\Acl\Builder->getAcl()
#1 /home/xxxx/public_html/vendor/magento/module-backend/Model/Auth/Session.php(227): Magento\Framework\Acl\Builder\Proxy->getAcl()
#2 /home/xxxx/public_html/vendor/magento/module-backend/Model/Auth.php(159): Magento\Backend\Model\Auth\Session->processLogin()
.......


texts: Magento1.9: Price changes to zero after selecting an option

texts:
I updated my Magento version to 1.9.2.2 recently.

After updated to new version, if I select the price of the product, that cost is showing normally fine till here.

The main problem is if I select any option like color, size That product's price is showing ZERO.


texts: How to Change Order Status After Successful PayPal Express Order

texts:
Many payment methods provide the option to specify an order status which should be set after an order has been placed with the respective method. I think that was even possible for PayPal itself in older Magento versions. In the meantime (at least 1.7 - 1.9), this is not possible any more. So how can I set a specific order status after an order has been successfuly paid with PayPal Express? I tried the following:

Changing the status on the events checkout_submit_all_after / sales_order_payment_capture / sales_order_payment_pay / sales_order_invoice_pay: These events are dispatched too early. If I change the order status on one of these events, the PayPal module / Magento will set the status to processing again afterwards.
I also tried to rewrite the method Mage_Paypal_Model_Ipn#_registerPaymentCapture and tried to set the status at the end of this method. But it seems as this method is not even called...

So is there any event how I can set the order status after a PayPal Express order? If it is not possible with events, I would also go for a rewrite solution.

By the way here is also the code how I set the order status. But this code works. The status is changed, but changed again by PayPal/Magento afterwards.

$order->addStatusHistoryComment('', 'my_custom_status')
$order->save();


texts: How do I get custom variable, billing address, shipping address in Invoice using SOAP API of magento1.7?

texts:
I am using SOAP API in Magento 1.7

Its easy pretty to fetch Invoice details using invoice id.

But it provide billing_address_id and shipping_address_id only

How I can fetch corresponding addresses using above ids using SOAP API?

And one more question

I have tracking number from vendor saved in database associated to invoice id

How I can access this tracking number from SOAP API?


texts: magento 2.2.2 - How to transfer the product thumbnail to the left side

texts: How can i set thumbnail images to the left side? I set thumbnail image to vertical in view.xml but it displays a thumbnail image right side.


texts: When uploading a lot of products admin hangs but can be accessed from different browser

texts:
We have dedicated server with 6 cores and over 20GB of ram.
The problem we have is that after importing products, its not possible to do anything in the admin section. It simply hangs.  If we try different browser than we can get in.

From googling around we found that this is related to indexing.  When we switched indexing to manual, everything is fine. We upload products and admin works normally. Then we manually index everything.  I found some plugins for asynchronous indexing etc. But I'm interested, is there some kind of setting on the server that we can tweak which will allow to have auto indexing on and admin section wont hang  after uploading products ?

Also order processing hangs after products are uploaded.

We went through all mysql settings recommended on the web. But it feels like we are missing something here.

Or this is simply how magento works and we need to deal with it ?


texts: Magento2: different kind of composer.json files

texts:
In Magento2 I see different vendors follow different composer.json formats given below to name their modules.
1st:

 "autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Amit\\SamplePage\\": ""
    }
  }

2nd:

   "extra": {
        "map": [
            [
                "*",
                "Amit/SamplePage"
            ]
        ]
    }

1. What's difference between them and which one I should follow?
2. registration.php is used to to register a module then why composer.json is needed in all modules ?


texts: Magento 2: replacement for the ,  etc... product type specific layout handles

texts:
In Magento 1, we had some specific layout handles for each product types:

<PRODUCT_TYPE_simple>
<PRODUCT_TYPE_configurable>
<PRODUCT_TYPE_grouped>
<PRODUCT_TYPE_bundle>
<PRODUCT_TYPE_virtual>
<PRODUCT_TYPE_downloadable>

It has been explained on this post that those handles were deprecated in Magento 2: Magento2. Layout Handle customer_logged_in

Question is: what do we use instead of those handles ?


texts: Getting exception - Element move is not expected

texts:
Site Link :  https://www.leis.synergixfast.com

  1 exception(s): Exception #0
  (Magento\Framework\Config\Dom\ValidationException): Element 'move':
  This element is not expected. Expected is one of ( action, arguments,
  block, container, referenceBlock, uiComponent ). Line: 834

  Element 'referenceBlock', attribute 'ifconfig': The attribute
  'ifconfig' is not allowed. Line: 891

  Element 'referenceBlock', attribute 'ifconfig': The attribute
  'ifconfig' is not allowed. Line: 903

  Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'move': This element is not expected. Expected is one of (
  action, arguments, block, container, referenceBlock, uiComponent ).
  Line: 834

  Element 'referenceBlock', attribute 'ifconfig': The attribute
  'ifconfig' is not allowed. Line: 891

  Element 'referenceBlock', attribute 'ifconfig': The attribute
  'ifconfig' is not allowed. Line: 903

I just copied the website from the main domain and set up on a subdomain and I found many errors. Please help.

Waiting for a quick response.


texts: Magento2 render custom block in adminhtml layout.xml

texts:
I can not render my custom block within my custom template,

Point is on newsletter subscriber, I extend newsletter_subscriber_form.xml,

Add container within my block but it says that template is invalid,

When is added in existing reference block nothing happened,

When I put a template in an existing block of this layout

  (e.q. Magento\Backend\Block\Widget\Grid\Massaction)
  It renders but I need my custom functionality.

Layout block

 <container name="content">
            <block class="Pool\Module\Block\Adminhtml\Subscriber\Button" name="button" template="Pool_Module:button.phtml" />
 </container>

path of template is on Pool/Module/view/adminhtml/templates/button.phtml

Block

<?php
namespace Pool\Module\Block\Adminhtml\Subscriber;

use Magento\Framework\View\Element\Template;

class Button extends Template
{
    public function __construct(Template\Context $context, array $data = [])
    {
        parent::__construct($context, $data);
    }

    public function addNewSubscriber()
    {
        var_dump('hi');
    }
}


texts: How to create a tier price table/grid in Magento2 frontend?

texts: I want to table formate for tier price. please see below screenshot.


texts: Get rewritten URL for custom link in customer account dashboard

texts:
To my customer account dashboard (and index) I want to add a custom (direct) link to a product category. This product category is only visible to logged in customers, that's why I want to have it here, too (not just in the basic store category view /listing)

I managed to list the link with adding

<action method="addLink" translate="label" module="customer">
    <name>downloads_category</name>
    <url>catalog/category/view/id/93</url>
    <label>Downloads Category</label>
</action>

to the <customer_account> block in my customer.xml file.
But I struggle on getting the rewritten URL (downloads.html, as set in rewrite management). The rewrite-URL works fine in the frontend.

Using downloads.html as the <url></url> parameter will end up adding a link to /.../downloads.html/ (with that unwanted trailing slash).

Edit: I'm running Magento CE 1.9.2.2


texts: Magento2 How to show sku in order summary?

texts:
I want to display sku in order summmary after product name.

I've created pluging which will called afterGetConfig to modified totalsData you can see below code for it.

class ConfigProviderPlugin extends \Magento\Framework\Model\AbstractModel
{
    public function afterGetConfig(\Magento\Checkout\Model\DefaultConfigProvider $subject, array $result)
    {
        $items = $result['totalsData']['items'];

        for($i=0;$i<count($items);$i++){
        $items[$i]['sku'] = "dgd";

        }

        return $result;
    }
}

Then in detail.html i've added

But i can't see sku value there. i can only see lable. see below screenshot.


texts:
I am trying to get the subtotal that is in the cart. To do this I am calling Mage::getBlockSingleton('checkout/cart_totals') this appears to be returning a collection.

I need to get a single value from this collection so I am currently using the below code

$collection = Mage::getBlockSingleton('checkout/cart_totals');
$total = $collection->getTotals();
echo $total['subtotal']['value'];

While the code returns the expected value I know this is not the way to do it. In the past I have used mage::getModel('namespace/file')->addFieldToFilter() but in this case I am getting an error when I try to use this method (obviously because I using a block not a model).

This leads me to believe that I am not getting a collection, so my questions are:

1 What is being returned?

2 Am I pulling the sub total value from the correct place?

3 How do I pull a single value out from all that information the correct way?


texts: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away on running cron job magento

texts:
I am working on site .suddenly i got this message on running cron job multiple times.i check my website for the same error but it works.I remove the cache and try to exit the code but after the error no code works in cron job.This is my code perhaps someone can guide me where the issue is :

<?php

class Namespace_Module_Model_Observer
{

   public function importemails(Varien_Event_Observer $observer)
   {
        echo "Hi Dear";exit();

      /* connect to gmail */
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = 'myid@gmail.com';
$password = 'mypass';

/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());

/* grab emails */
$emails = imap_search($inbox,'ALL');

/* if emails are returned, cycle through each... */
if($emails) {

  /* begin output var */
  $output = '';

  /* put the newest emails on top */
  rsort($emails);

  /* for every email... */
  foreach($emails as $email_number) {

    /* get information specific to this email */
    $overview = imap_fetch_overview($inbox,$email_number,0);
    $message = imap_fetchbody($inbox,$email_number,2);

    /* output the email header information */
    $output.= '
seen ? 'read' : 'unread').'">';
    $output.= ''.$overview[0]->subject.' ';
    $output.= ''.$overview[0]->from.'';
    $output.= 'on '.$overview[0]->date.'';
    $output.= '
';

    /* output the email body */
    $output.= '
'.$message.'
';
  }

  echo $output;
}

/* close the connection */
imap_close($inbox);

  }

}

this code works for several hours but all of sudden it showing me the error of mysql gone away.Thanks in advance


texts:
i came accros this script ( link ) that allows you to create multiple subcategories at once by creating a list of the subcategories in a csv file and then the scripts takes the ID of the root category to hold these subcategories. It seems to work fine on magento 1, but not on magento 2

This is the script:

Needed changes to change into below script:

$rootCateId - here you need to set the ID of root category under
which you want to add sub categories
$path = here I set this as "1/2/" mostly in magento by default this
is same but cross check it once.

<?php

set_time_limit(0);
ini_set('memory_limit', '1024M');
umask(0);
require_once 'app/Mage.php';
Mage::app('admin');
if (($handle = fopen("category.csv", "r")) !== FALSE) {
    $counter = 1;
    while (($data = fgetcsv($handle)) !== FALSE) {
        if ($counter > 1) {
            $cateName = $data[0];
            echo $cateName . "\n";
            $rootCateId = 559; // here we need to assign root cate Id under which you want to create your new category
            if ($cateName) {
                createCategory($cateName, $rootCateId);
            }
        }
        $counter++;
        if ($counter > 2) {
            // if want to break the scrip
            // exit();
        }
    }
}
function createCategory($name, $rootCateId)
{
    $path = "1/2/" . $rootCateId; // here 1/2 is my store root category path you can check this in database table 'catalog_category_entity' table
    $cateName = $name;
    $category = Mage::getModel('catalog/category');
    $category->setStoreId(0); // 0 = default/all store view. If you want to save data for a specific store view, replace 0 by Mage::app()->getStore()->getId().
    if ($id) {
        //if update
        //$category->load($id);
    }
    $general['name'] = $cateName;
    $general['path'] = $path; // catalog path
    //$general['description'] = " Category";
    //$general['meta_title'] = "My Category";
    //Page title
    //$general['meta_keywords'] = "";
    //$general['meta_description'] = "";
    //$general['landing_page'] = "";
    //has to be created in advance, here comes id
    $general['display_mode'] = "PRODUCTS"; //static block and the products are shown on the page
    $general['is_active'] = 1;
    $general['is_anchor'] = 0;
    //$general['page_layout'] = 'two_columns_left';
    //$general['url_key'] = "cars"; //url to be used for this category's page by magento.
    //$general['image'] = "cars.jpg";
    $category->addData($general);
    try {
        $category->save();
        echo "Success! new category Id: " . $category->getId() . "\n";
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}

I have made the necessery changes but when i run the script through my browser i get an error messege that no such file as mage.php exists. I have very little php knowledge but it would seem the scrip is not compatible with magento 2. Please could someone help me figure out how to get the script working on magento 2.
Thanks in advance.


texts: magento 2.2.2 : After Adding new theme product image is not displaying on product page

texts:
I have added a new theme in Magento 2.2.2, everything works fine except product image. Product image display in listing page but not display in product view page when product have only one image when I add another image then it displays in product view page.

Can anyone help me out to solve this issue? Thanks in advance.


texts: How to set a custom price of a product when adding to cart using an observer in Magento 2?

texts:
I want to set a custom price of the product when adding to cart using an observer.
For that, I added this code but it's not working

  app\code\Webkul\Hello\Observer\CustomPrice.php

<?php
    /**
     * Webkul Hello CustomPrice Observer
     *
     * @category    Webkul
     * @package     Webkul_Hello
     * @author      Webkul Software Private Limited
     *
     */
    namespace Webkul\Hello\Observer;

    use Magento\Framework\Event\ObserverInterface;
    use Magento\Framework\App\RequestInterface;

    class CustomPrice implements ObserverInterface
    {
        public function execute(\Magento\Framework\Event\Observer $observer) {

            $item=$observer->getEvent()->getData('quote_item');
            $product=$observer->getEvent()->getData('product');
            // here i am using item's product final price
            $price = $item->getProduct()->getFinalPrice()+10; // 10 is custom price. It will increase in product price.
            // Set the custom price
            $item->setCustomPrice($price);
            $item->setOriginalCustomPrice($price);
            // Enable super mode on the product.
            $item->getProduct()->setIsSuperMode(true);
            return $this;
        }
    }

  app\code\Webkul\Hello\etc\frontend\checkout_cart_product_add_after.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="checkout_cart_product_add_after">
        <observer name="customprice" instance="Webkul\Hello\Observer\CustomPrice" />
    </event>
</config>


texts: How to change layout of blocks in homepage?

texts:
I need to figure out a way to change the layout of different blocks on my homepage.

Primarily this is what I want to do

Move the featured slider & new arrivals sliders up, ie right below the main slider.

I am a newbie to Magento. I have enabled template hints on my site. I am not sure from where I should start.


texts: Observer not working sales_order_invoice_save_after

texts:
This function not working because what i'm trying to achieve is if this invoice contain a product with sku "FBA" then assign this status.

Looking forward to hearing from you.

But it doesn't work as i'm getting this:

exception 'Varien_Exception' with message 'Invalid method Mage_Sales_Model_Order_Invoice::addStatusHistoryComment(Array
(
    [0] => Amazon FBA
    [1] => amazonfba
)

public function changestatus2($event)
{
    $_order = $event->getEvent()->getInvoice();
    $_state = 'amazonfba';

    foreach($_order->getAllItems() as $item) {
        $sku = $item->getSku();
        if (substr($sku,-4) == '_FBA') {
        $_order->addStatusHistoryComment('Amazon FBA', $_state)
            ->setIsVisibleOnFront(false)
            ->setIsCustomerNotified(false)
            ->save();
            break;
        }
    }
}


texts:
The category name input field is a required field * but is there a way to save it without a category name?
I see the elements here:

<input class="admin__control-text" type="text" data-bind="
        event: {change: userChanges},
        value: value,
        hasFocus: focused,
        valueUpdate: valueUpdate,
        attr: {
            name: inputName,
            placeholder: placeholder,
            'aria-describedby': noticeId,
            id: uid,
            disabled: disabled,
            maxlength: 255
    }" name="name" aria-describedby="notice-TSAJULD" id="TSAJULD" maxlength="255">

        This is a required field.

Any way to get around adding the Category Name.. I have an image that i want to add instead of the category name.
Second question is... it renders an html page
mynewcategorypage.html
Where is this stored?
Would it be better to remove the validation, can i remove the validation? I notice sometimes in the URL rewrites that there is a request path but no target path.. how was that achieved?


texts: Can't Login Admin Panel, Return's Blank Page

texts:
I've moved my project from local to live but I can't login to my admin panel, it's returning a blank page I've tried giving permission to var/session var/cache(and cleared them) media folders etc. but still the problem persist.

But the frontend is working fine...


texts: What is the field sales_order_item.description field used for?

texts:
Can anyone provide any information on what the "description" field in the sales_order_item table is used for?   I never see it populated with any data, and it's not listed in the docs that I can find.
https://docs.magento.com/mbi/data-analyst/data-warehouse-mgr/sales-flat-order-item-table.html
I need to add a field to store notes on individual order items, then I noticed this apparently un-used field.   Can anyone tell me what is supposed to be stored here?


texts: I have been trying to find something out there that would let me tie more then one cost and qty for each wholesaler I have for a product.  Really what I need is to not just add a new cost and qty tie to a product over what is in the product model but that I'd need to be able to overwrite the qty to have the output be the total of all the tied entries to that product.  My first thought was to just make a table where it had a list of the supplier with their cost and qty that ties to a product.  Not totally clear where to start on that, but then I figured someone has made this already.  Anyone have an idea how to start it or a stub or module already sort of close to what I'm asking about?


texts: what are the place local storage used in magento2

texts:
What are the place local storage used in magento2,

please explain

how to use effectively
the configurations , classes involved in local storage


texts: Error redirected you too many times upon trying to install Magento 2.4

texts:
I just downloaded latest version of Magento 2.4 and I am trying to install it on Namecheap hosting but upon entering the URL of my website in the browser to start the setup wizard, it keep re-loading.
Before it immediately showed me error of "redirected you too many times", but now it just keep re-loading.
I contacted Namecheap support and they said that the issue is from htaccess file that causing redirecting issue. I also tracked the log in chrome network and I noticed that it keeps looping.

All files are raw and I did not change anything.
Any idea to fix this issue?


texts:
I am trying to create an category that displays all products on the website that are currently set as out of stock.

I have created a subcategory for this and thought that I would be able to modify the list.phtml file and apply afilter when getting the product collection however this file seems to use the following call $_productCollection = $block->getLoadedProductCollection(); This call doesn't seem to allow you to add any filters on to it.

I have searched and tried various methods to try and get and filter a product collection to no avail.

I am looking for a way to get every product set as out of stock, regardless of category, and display it in the category grid template is there a way to do this with $_productCollection = $block->getLoadedProductCollection();?

Alternatively I've also considered the possibility of programmatically adding a product to the "out of stock" category when it goes out of stock and then removing it when it comes back in stock - if anyone has any experience or ideas on how this might be achieved then it would be helpful if you could share!

Thanks.


texts:
We only use flat rate shipping and I always want to display the shippingcost.
Is there a way to always load the /tax/checkout/shipping.phtml file into the cart?

We use always the same shipping costs to all adresses.


texts: create country drop down on cart page with same functionality as on onestepcheckout page magento 1.9

texts:
On onestepcheckout page, in billing section we have a country field select box, on selecting country from drop-down, ajax request is send and the selected country is set as billing address's country.
I want to create a country drop down with same functionality on cart page. I have created the country select box using the following code

  <?php $_countries = Mage::getModel('directory/country')
                                              ->getResourceCollection()
                                              ->loadByStore()
                                              ->toOptionArray(true);?>

and using foreach loop to show the options in a select box. Now I have problem with the functionality.
On onestepcheckout page when the country is selected, an ajax request is send and the following country gets selected.
I am trying to copy this process but could not succeed.Here is my ajax code in cart.phtml file

jQuery('#country').change(function(){
var countryName = (jQuery(this).val());
jQuery.ajax({
    type: 'POST',
    url: "<?php echo $this->getUrl('checkout/cart/estimatePost')?>",
    data: {'country_id' : countryName},
    success: function(data){
        alert(data);
    }

});
});

On onestepcheckout page ajax request hits the following url

  url: "<?php echo $this->getUrl('onestepcheckout/ajax/save_billing')?>"

I am trying to copy this function on cart page but could not understand how to proceed. Please any one have any idea on how to proceed.

save_billingAction() in Ajaxcontroller.php has lot of functionalities which I  could not understand. I just want to save the country so that when the page is reloaded that country is set as billing address's country. Any one could help me how to proceed


texts: Adding a 'Reviews' tab to the product view page removes 'Short Description'

texts:
I am having problem  with 'Review' tab that I added to our product view page. The tab itself works fine but for some reason my 'Short Description' does not show up anymore.
I added the following code under

    <catalog_product_view translate="label">
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">

in catalog.xml

<block type="review/product_view_list"
 name="product.info.product_additional_data" as="product_review"
template="review/product/view/list.phtml"> <block type="review/form"
 name="product.review.form" as="review_form"/> </block>

and then called it in my product view.phtml

<?php echo $this->getChildHtml('product_review') ?>

'Short Descr' is called in product view.phtml as below:

<?php if ($_product->getShortDescription()):?>

               <?php echo $_helper->productAttribute($_product,$_product->getShortDescription(),'short_description') ?>

  <?php endif;?>

Could someone please point me to the directions as to why 'Short Description' would stop displaying ? As soon as I comment out the code I added in catalog.xml 'Short Descr' comes back.
Thanks a lot!


texts: Getting Product Admin Area URL from code

texts:
Inside an observer, I need to get the URL to edit the product in the Admin Area.

Using the following code :

$product->getUrlModel()->getUrl($product)

I get an URL which is not working (and it also have the session value)

http://magento.web/the_admin/catalog/product/view/id/1/s/joust-duffle-bag/key/53cdbf2e9e53cfd4950692664e643710ececac42a2d15156d531dde51454576f/

Which one is the best way to fetch the product URL of the Admin Area?


texts: What table stores # times a product has been viewed

texts:
I want to manually run a query to make a specific product SKU has zero # times its been viewed. What would the table and or MySQL query be to make a specific SKU (say the SKU is abcd) have zero views instead of the number of views it currently has.

What I am trying to achieve is make the items that have the most views show up first in my Magento CE 1.9.1 catalog listing page. However, I have a few products that have high viewed but I want them to appear last because they do not sell well. So I want to manually change them to have zero views so they will show last in the sort order.


texts:
Anyone have any idea about How to move toolbar before left and right sidebar in magento2 using XML?

Currently it is showing in Right side-bar.


texts:
I want to call a image <myvendor/mytheme>/web/images/image.png

in

\Magento_Checkout\web\template\minicart\content.html

can anyone let me know how can i call image in <img src=""/> tag ?


texts: Magento 2. How can I properly extend vendor/composer/installed.json?

texts:
I assume that installed.json contains all the dependencies needed for Magento.
How can I properly extend vendor/composer/installed.json?

Context:

Magento has a hard dependency on one of the libraries, more specifically a specific version of a third party module msp/recaptcha:2.0.2. I want to update it to 2.1.2.
Now if it were a softer dependency (~2.0.2) I could have done so from composer.json as described in the answer of this question

By this point it should be clear what I need to achieve and why. Please ask for any more details if needed. Thanks.


texts:
I have created a customer attribute to capture the company name on registration, not as part of the address field.

The field is created in eav_attribute

  //add Company Name to customer attributes
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$entityTypeId     = $setup->getEntityTypeId('customer');
$attributeSetId   = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$installer->addAttribute("customer", "company_name",  array(
    "type"     => "varchar",
    "backend"  => "",
    "label"    => "Company Name",
    "input"    => "text",
    "source"   => "",
    "visible"  => true,
    "required" => true,
    "default" => "",
    "frontend" => "",
    "unique"     => false

        ));

$attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "company_name");

$setup->addAttributeToGroup(
    $entityTypeId,
    $attributeSetId,
    $attributeGroupId,
    'tamper_company_name',
    '3'  //sort_order
);

$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
        $attribute->setData("used_in_forms", $used_in_forms)
                ->setData("is_used_for_customer_segment", true)
                ->setData("is_system", 0)
                ->setData("is_user_defined", 1)
                ->setData("is_visible", 1)
                ->setData("sort_order", 3)
                ;
$attribute->save();
$installer->endSetup();

The field displays and populates properly from the account creation page:
\app\design\frontend\base\default\template\MYMODULE\customer\widget\name.phtml
Which I overwrote using config.xml

    <label for="<?php echo $this->getFieldId('company_name')?>" class="required">*<?php echo $this->getStoreLabel('company_name') ?>

        <input type="text" id="<?php echo $this->getFieldId('company_name')?>" name="<?php echo $this->getFieldName('company_name')?>" value="<?php echo $this->escapeHtml($this->getObject()->getTamper_company_name()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->getStoreLabel('company_name')) ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company_name') ?>" <?php echo $this->getFieldParams() ?> />

I have two issues:

In the customer dashboard, create address does not return anything for the above code, even through it uses the same template.  Name and surname work, but Company Name does not - it does not return any value or labels.
$this->getObject()->getFirstname() returns the name $this->getObject()->getCompany_name() returns nothing. getAttributeValidationClass also does not work.
In the address templates, using {{depend company_name}}{{var company_name}}{{/depend}} does not return anything.

If i Mage::Log $this->getObject() from the address entry screen, I get a data array including name, pre/post fix, initial but no company_name.

Do I need to override when of the helpers to add this field in?


texts: make email optional in magento 2 and login is working through mobile

texts:
I have a Magento 2.3.4 installation and I wish to convert the e-mail field to be non-required, and i have already made the phone number instead.  I have searched in the source code, there are so many places are using field email, and as it's validation.
Mobile login is working fine for me ,i just want to make email optional so that customers can place order without email using phone


texts:
So i'm very new to Magento. I am struggling to find a way to manage my inventory effectively.

My store has a bunch of simple products for sale. I want to take two of these products, create a bundle product and offer this bundle with a monthly billing agreement where the customer gets the product sent to them each month. The issue I'm having is for the first month, I want to the customer to receive both products, but for the recurring months, I only want them to receive one product.

Is there a way to do this in Magento? Currently I have the product I want to bundle as a simple product and having to keep track of my inventory manually and check to see if it's the customers first order so I know to send them both products.

Thanks


texts: Possible issues after removing images of deleted products from media/catalog/product folder

texts:
From what I understood Magento2 deleting product behavior, associated images of the deleted product are not removing from media/catalog/product folder.

I need to manage around 11.000 new products in the database 4 seasons/year... after almost 1 year in production, I found 4,5gb of unused images.

I don't really understand possible issues after deleting this images since products are no more in the database. How should I manage such disk usage increase in a Magento2 way?


texts: Updating the product stock quantity in a safe way

texts:
There is a problem that got me confused about updating the stock quantity in a safe way. A simple scenario, suppose I have 10 of product X in warehouse and there is zero orders so, also in Magento inventory I have 10 pieces. Suppose that I received another 10 pieces, and when I opened the product inventory to change 10 to 20, some customer placed and order and then I pressed the submit button. As a result Magento inventory will show that I have 20 pieces while I actually have 19.

I tried to write a module to update the product programmatically. But this solution may reduce the risk, because it will use the value + what I want to add. So it adding not replacing. But also there is a risk.

A second thought is to do it in the database level by preforming a SQL UPDATE STATEMENT, but I found another risk of doing it, I need to update more than one row in a table and more than one table. The data may be inconsistent.

Is there a way to use the lock method, like locking the product until the update occur, or another work around ?

Edit one:

After I tested Magento with this test case: I have 6 pieces, I opened the product inventory then changed the 6 with 7 without pressing the submit button. Then I ordered the 6 of them. Then I pressed submit in the product page, Magento shows that I have 1 in stock not seven which is correct. But is it guaranteed? And can I have an explanation how Magento handle it?


texts: Repeat a product on category listing page after list of 9 Products

texts:
I have a scenario, i want to list a marketing/ads product on interval of 9 product on category listing page. So every 10th number of product is a marketing/ads product. For example i add following images. In the image the ads product coming after every 2 products.

Any ideas how to get solution around this?


texts: Subcategories cannot been seen on their me the route category on homepage

texts: I made subcategories under my route categories on my Magento for some reason I cannot see them on my homepage.


texts:
I want to show feature product on my home page but when I click on add to cart it take me to cart page and show empty cart but when I add product form category page or on detail page its working fine this is my cms block code

{{block type="ultimo/product_list_featured"  category_id="6" product_count="24" hide_button="0"   is_responsive="1"  breakpoints="[0, 1], [320, 1], [480, 2], [768, 3], [960, 4], [1280, 5]" move="0" loop="1"  block_name="Featured Products" template="catalog/product/list_featured_slider.phtml"}}


texts:
Synopsis

I'm getting this error:

  Cron.php undefined index 'SCRIPT_FILENAME'

Why is the following code in the magento core cron.php?

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);

So my crontab has the following (in cPanel - yes, I hate cPanel but I have no choice):

*/5 * * * * /bin/sh /home/user/public_html/cron.sh 2>&1

When run, I get this output:

Array
(
    [MAILTO] => ***
    [SHELL] => /usr/local/cpanel/bin/jailshell
    [USER] => ***
    [PATH] => /usr/bin:/bin
    [PWD] => /home/***
    [LANG] => en_US.UTF-8
    [HOME] => /home/***
    [SHLVL] => 2
    [LOGNAME] => ***
    [_] => /usr/bin/php
    [PHP_SELF] =>
    [REQUEST_TIME_FLOAT] => 1427981401.51
    [REQUEST_TIME] => 1427981401

    [argv] => Array
        (
            [0] => /home/***/public_html/cron.php
        )

    [argc] => 1
)


texts:
I have a requirement where I need to save multiple rows to a custom table at once.

so used

  CASE 1:

foreach($dataCollection as $data){
    $customModel->setData($data)
                 ->save();
    $customModel->unsetData();
}

but this seemed to be a little inefficient way as everytime the loop is executed, there was an insert query. Went through these questions:

How to optimize saving multiple models?
Magento catching exceptions and rolling back database transactions

  CASE 2:

$transactionSave = Mage::getModel('core/resource_transaction');
foreach($dataCollection as $data){
     $customModel->setData($data)
     $transactionSave->addObject($customModel);
}
$transactionSave->save();

But this method seems to use the save() method inturn. So this might be slower than the previous case.

So which is better case 1 or case 2?


texts: create a button by Extends Mage_Adminhtml_Block_Sales_Order_View not show the button

texts:
I'm trying to add a button on sales order view.but nothing appears.
this is my block in my config.xml

                PMC_Manutention_Block_Adminhtml

                                   PMC_Manutention_Block_Adminhtml_Sales_Order_View

and my file view in PMC/Manutention/Block/Adminhtml/Sales/Order/View.php

class PMC_Manutention_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View
{

public function __construct()
{
    parent::__construct();

    if ($this->_isAllowedAction('reorder')
    ) {
        $orderId = $this->getOrderId();
        $order = Mage::getModel('sales/order')->load($orderId);
        $shipment = $order->getShipmentsCollection()->getFirstItem();
        if($order->hasShipments()){
            $this->_addButton('order_printSticker', array(
                'label'     => Mage::helper('sales')->__('Print Sticker'),
                'onclick'   => 'setLocation(\'' . $this->getPrintStickerUrl() . '\')',
                'class'     => 'go'
            ));
        }
    }

}

/**
 * add by ismo
 * Return back url for view grid
 *
 * @return string shipment_id
 */
public function getPrintStickerUrl()
{
    $orderId = $this->getOrderId();
    $order = Mage::getModel('sales/order')->load($orderId);
    $shipment = $order->getShipmentsCollection()->getFirstItem();

    return $this->getUrl('*/sales_order_shipment/sticker', array('shipment_id'  => $shipment->getEntityId()));
}

}


texts: Get category 'thumbnail' image and text within product pages

texts:
We'd like to use the category thumbnail and text as brand info to show the logo and description on the product page. How can I get these information on the product page?

I'm working in:
.../template/catalog/product/view.phtml


texts:
If products in a group need an additional option, how would I create that option?

  For example; if they're ordering ceiling lights, the grouped products
  are the different sizes, but afterwards they need to select either a
  handheld remote or a wall switch.


texts:
Today I'm learning Upgrading schema and Upgrading data, for this I am created simple table with version0.0.1 and it's working fine. Later I written code  for UpgradeSchema. But it is not working for me. For this stuff I have written below code.

UpgradeSchema.php

<?php

namespace Training\HelloWorld\Setup;

use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;

class UpgradeSchema implements \Magento\Framework\Setup\UpgradeSchemaInterface
{

    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context){

        $installer = $setup;

        $installer->startSetup();
        if (version_compare($context->getVersion(), "0.0.1", "<")) {
            //Your upgrade script
        }
        if (version_compare($context->getVersion(), '0.0.1', '>')) {
            $installer->getConnection()->addColumn(
                $installer->getTable('helloworld'),
                'long_description',
                [
                    'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    'length' => 255,
                    'nullable' => false,
                    'comment' => 'Long Description'
                ]
            );
        }
        $installer->endSetup();

    }

}

after this I run the  php bin/magento setup:upgrade CLI Command. it's working fine and setup_module table also converted versions as below.

Previously Training_HelloWorld 0.0.1 0.0.1
After upgrade command Training_HelloWorld 0.1.1 0.1.1 converted successfully.

but My table is not added new column.

Could you please suggest me where I went wrong?


texts: Create new VPS save images and file download on magento

texts:
My sites very large size with image and file upload.

So, I would like to setup as CDN from another my server2 VPS from current server1 VPS. That server will be storage images and files upload.

I knew magento can change url storage from baseUrl and baseSecureUrl. However I dont know how to map 2 server and sync that.

Anyone can suggest me step by step create storage like that?


texts: Get add to cart URL and image without loading product object

texts:
Kind of a spinoff of this question. I'm trying to extend Mage_Catalog_Block_Product_Widget_Link to make a widget template that displays the product image and an add to cart button along with the product link. Is there any way to get this info without doing Mage::getModel('catalog/product')->load()?

What Have You Tried

The working-but-ugly way: I know I could split the product id off the id_path string supplied by the widget and use it to load the full product, like so:

$idPath = explode('/', $this->_getData('id_path'));
if (isset($idPath[1])) {
    $id = $idPath[1];
    if ($id) {
        $product = Mage::getModel('catalog/product')->load($id);

        /* Use $product to get the needed info */

    }
}

but this means I'm fetching a big giant product object with lots of data I don't need, possibly several times per page. I'm under the impression that this is not desirable. (Am I wrong?)
Use getAttributeRawValue in the resource model: I have the resource model available in $this->_entityResource but I can't use getAttributeRawValue to get the add to cart URL since it's not an attribute. I can get the value of the image attribute this way but can't figure out how to use that to actually display the image. All the templates I've looked at use $this->helper('catalog/image') which eventually requires a product object. I'd like to be able to use the cache if possible so just straight-up appending it to /media/product/catalog seems like a bad idea. (Wrong?)
Use the getAddToCartUrl function: This also appears to require a product object as the first argument.

Is there a better way I'm not aware of?

This is on CE 1.9, if that makes a difference.


texts:
I'm trying to display upsell products on product page by getting upSellCollection as such:

$_product = Mage::registry('current_product')->getId();
$upsell_product = $_product->getUpSellProductCollection();

After this I'm getting:

  Fatal error: Call to a member function getUpSellProductCollection() on
  a non-object

Any advice?


texts:
On our Magento store the sitemap which Magento automatically generates from the admin panel at Catalog > Google Sitemap adds the home url to our homepage like:

<url>
    <loc>http://our-domain.com/home</loc>
    <lastmod>2014-11-17</lastmod>
    <changefreq>daily</changefreq>
    <priority>0.2</priority>
</url>

Is there a way to change it to

<url>
    <loc>http://our-domain.com/</loc>
    <lastmod>2014-11-17</lastmod>
    <changefreq>daily</changefreq>
    <priority>0.2</priority>
</url>


texts: Cant install Magento 2.3.2 on wamp server 3.1.9

texts:
I have put the magento folder in www of my wampserver and created a databas folder in the wamp server but when try to access the magento on my local host (http://localhost/magento/) i get these errors in the apache error file

[Tue Sep 10 10:21:06.563236 2019] [mpm_winnt:notice] [pid 4372:tid 812] AH00428: Parent: child process 6740 exited with status 3221226356 -- Restarting.
[Tue Sep 10 10:21:06.830367 2019] [mpm_winnt:notice] [pid 4372:tid 812] AH00455: Apache/2.4.39 (Win64) PHP/7.2.18 configured -- resuming normal operations
[Tue Sep 10 10:21:06.830367 2019] [mpm_winnt:notice] [pid 4372:tid 812] AH00456: Apache Lounge VC15 Server built: Mar 28 2019 11:59:33
[Tue Sep 10 10:21:06.831361 2019] [core:notice] [pid 4372:tid 812] AH00094: Command line: 'c:\wamp64\bin\apache\apache2.4.39\bin\httpd.exe -d C:/wamp64/bin/apache/apache2.4.39'
[Tue Sep 10 10:21:06.834999 2019] [mpm_winnt:notice] [pid 4372:tid 812] AH00418: Parent: Created child process 12400
[Tue Sep 10 10:21:07.272319 2019] [mpm_winnt:notice] [pid 12400:tid 752] AH00354: Child: Starting 64 worker threads.
[Tue Sep 10 10:31:37.346310 2019] [core:alert] [pid 12400:tid 1236] [client ::1:58979] C:/wamp64/www/magento/.htaccess: Invalid command '


texts: Display product types in mutiselect options system configuration in magento 2.2.3

texts:
app/code/Vendorname/Modulename/etc/adminhtml/system.xml

<field id="display_product_types" translate="label" type="multiselect" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Display Product Types</label>
    <source_model>Vendorname\Modulename\Model\Config\Source\DisplayProductTypes</source_model>
</field>

  app/code/Vendorname/Modulename/Model/Config/Source/DisplayProductTypes.php

<?php
namespace Vendorname\Modulename\Model\Config\Source;

use Magento\Framework\Option\ArrayInterface;

class DisplayProductTypes implements ArrayInterface
{
    public function toOptionArray()
    {
        return [
            ['value' => '1', 'label' => __('Simple Product')],
            ['value' => '2', 'label' => __('Configurable Product')],
            ['value' => '4', 'label' => __('Virtual Product')],
            ['value' => '6', 'label' => __('Downloadbal Product')]
        ];
    }
}

Note: Now product types static how to this option dynamic display in multi select  in system configuration


texts: Disable payment option in checkout when specific shipment is used via js only

texts:
I've disabled alost all payment modules when in store pickup i set as shippemnt.
I'm using for this plugin for Magento\Payment\Model\Method\AbstractMethod and is working fine.

Only one module payu/magento2-payment-gateway that i cannot disable. it is not using Magento\Payment\Model\Method\AbstractMethod

Maybe someone can show how to disable it in js?
I've tried to hide it when some one chose shipping method, but payments options do not exist yet.


texts: Magento 2 not able to read the query parameters passed to category page on live server

texts:
I am trying to read the GTM parameters passed on page before page is redirected to external resource for authentication. I can read this query parameters on local server but on production server it gives me null value. Below is my code.
https://domain.com/blankets.html?utm_source=email&utm_medium=email&utm_campaign=test_gtm_campaign
I want to get above url as it is before redirected to external resource for authentication.
$request = $observer->getEvent()->getRequest();
        $pageUrl = $this->_urlInterface->getCurrentUrl();

        $currentCategoryUrl = $this->_storeManager->getStore()->getCurrentUrl(false);
        $this->logMessage("current url from observer: ".$currentCategoryUrl);
        $params = json_encode($this->request->getParams());

        $this->logMessage("rquest param from observer: ".$params);

        $this->logMessage("page url from observer: ".$pageUrl);
        if(isset($_SERVER['HTTP_REFERER'])) {
            $refUrl = $_SERVER['HTTP_REFERER'];
        }
       else
       {
           $refUrl = $pageUrl;
        }
        $this->logMessage("referal url from observer: ".$refUrl);

        $signInStatus = $this->_customerSession->isLoggedIn();

        if((!$signInStatus)) {

               $redirectURI = $this->_helper->getSignInRedirect();
               header("Location: $redirectURI");

        }
        else {
            return;
        }

I tried this code on local and it is working fine, $this->_urlInterface->getCurrentUrl(); $params = json_encode($this->request->getParams()); $_SERVER['HTTP_REFERER'] this all methods give me the query parameters passed with url on local server but not works on production server.
Any help appreciated.


texts: Why Does the mageUtils module Directly Call require

texts:
In Magento 2, there's a mageUtils RequireJS module alias that points to mage/utils/main.  If you look at the source of this module

#File: vendor/magento/magento2-base/lib/web/mage/utils/main.js

define(function (require) {
    'use strict';

    var utils = {},
        _ = require('underscore');

    return _.extend(
        utils,
        require('./arrays'),
        require('./compare'),
        require('./misc'),
        require('./objects'),
        require('./strings'),
        require('./template')
    );
});

You can see this code directly calls require to pull in dependencies rather than listing them as define dependencies.  I'd expect to see  something more like this

define(['./arrays',
        './compare',
        './misc',
        './objects',
        './strings',
        './template'], function (Arrays, Compare, Misc, Objects, Strings, Template) {
    'use strict';

    var utils = {},
        _ = require('underscore');

    return _.extend(
        utils, Arrays, Compare, Misc, Objects, Strings, Template
    );
});

It's my understanding that directly calling require or requirejs to fetch a module reference only works if the module's already been loaded.  Therefore, this means the mage/utils/main module can only be used if it's loaded in a particular order as part of the Magento bootstrap process.

Is this an incorrect assumption about directly calling require?
Is there a technical reason the mage/utils/main utility doesn't use define dependencies to pull these modules in?


texts: Why does toggling the Display Out of Stock Products setting trigger design/cache issues?

texts:
Background

Our site has used Google Commerce Search for a few years now. That program is being discontinued so now we're moving to Solr in our Enterprise 1.13.0.2 store. A requirement of Solr (that our implementation of GCS did not require) is to have Catalog > Inventory > Display Out of Stock Products turned on if you want to have OOS products listed in search results (we do). Enter, problems.

When cataloginventory/options/show_out_of_stock == 1

To summarize, weird stuff starts happening that does not happen otherwise. For example, tons of max execution time errors:

[11-Mar-2014 18:20:46 UTC] PHP Fatal error:  Maximum execution time of 600 seconds
  exceeded in www/app/code/core/Enterprise/PageCache/Model/Processor.php on line 483
[11-Mar-2014 18:25:42 UTC] PHP Fatal error:  Maximum execution time of 600 seconds
  exceeded in www/app/code/core/Mage/Core/Model/App.php on line 0
[11-Mar-2014 20:18:31 UTC] PHP Fatal error:  Maximum execution time of 600 seconds
  exceeded in www/lib/Zend/Cache/Backend/Memcached.php on line 180

Memory size errors:

[11-Mar-2014 18:26:42 UTC] PHP Fatal error:  Allowed memory size of 536870912 bytes
  exhausted (tried to allocate 519577601 bytes) in www/app/Mage.php on line 826

Page Block! errors:

2014-03-11T18:54:17+00:00 ERR (3): Notice: Undefined variable: type  in
  www/app/code/core/Mage/Page/Block/Html/Head.php on line 134
2014-03-11T18:54:17+00:00 ERR (3): Notice: Undefined variable: name  in
  www/app/code/core/Mage/Page/Block/Html/Head.php on line 135
2014-03-11T18:54:17+00:00 ERR (3): Warning: Missing argument 1 for
  Mage_Page_Block_Html_Head::addItem()  in
  www/app/code/core/Mage/Page/Block/Html/Head.php on line 128
2014-03-11T18:54:17+00:00 ERR (3): Warning: Missing argument 2 for
  Mage_Page_Block_Html_Head::addItem()  in
  www/app/code/core/Mage/Page/Block/Html/Head.php on line 128

Question

Why would changing the display out of stock setting cause these errors?

BTW

We've absolutely confirmed that these errors happen only after the setting in question is changed to Yes, clearing cache, and reindexing. And that they do not occur when the setting is changed to No, cache is cleared and reindexed.


texts: How to show custom option in checkout page in the view detais in magento 2?

texts:
I'm developing a custom module in magento 2. I need to show  the custom options in checkout page which file i edit and show there custom option in magento 2

anyone help me please ?


texts:
After upgrading to Magento 1.9.3 none of my product thumbnails are showing in the backend.

My old and new images aren't showing, folder permissions are set to 777.

All was fine in the previous version of magento. Shall I roll back? If so what's the best way to roll back now my store has taken orders in the new version?


texts: Filter product collection by custom attribute

texts:
I'm filtering a product collection by the custom attribute ean with the following code

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('name');
$collection->addAttributeToSelect('ean');
$collection->addFieldToFilter('ean', '678678');

foreach ($collection as $product)
{
     Mage::Log('product found');
}

There is product with this ean but no product is found.


texts: i get a notification submit your tax forms and then resubmit the extension to Marketing Review.But i don't know how do it? I need help to everyone!


texts: Magento 1.9.3.4 -> 2.1.8 data migration tool error

texts:
I have tested steps of the import one at a time to determine that the issue occurs right after the map step. When I migrate customer and sales data using the data migration tool I get the following error during the Map step:

[WARNING]: Mismatch of entities in the document:
catalogrule_product_price

[WARNING]: Volume Check failed

Another symptom that occurs after the Map step is the phone # and zipcode fields are missing from the checkout page.

Here is my config.xml:

<steps mode="data">
    <step title="Data Integrity Step">
        <integrity>Migration\Step\DataIntegrity\Integrity</integrity>
    </step>
    <step title="Customer Attributes Step">
         <integrity>Migration\Step\Customer\Integrity</integrity>
         <data>Migration\Step\Customer\Data</data>
         <volume>Migration\Step\Customer\Volume</volume>
    </step>
    <step title="Map Step">
         <integrity>Migration\Step\Map\Integrity</integrity>
         <data>Migration\Step\Map\Data</data>
         <volume>Migration\Step\Map\Volume</volume>
     </step>
     <!-- Issue Occurs Here -->
     <step title="OrderGrids Step">
         <integrity>Migration\Step\OrderGrids\Integrity</integrity>
         <data>Migration\Step\OrderGrids\Data</data>
         <volume>Migration\Step\OrderGrids\Volume</volume>
     </step>
     <step title="SalesIncrement Step">
         <integrity>Migration\Step\SalesIncrement\Integrity</integrity>
         <data>Migration\Step\SalesIncrement\Data</data>
         <volume>Migration\Step\SalesIncrement\Volume</volume>
     </step>
</steps>


texts: Login with one of the two passwords - Magento 1.9

texts:
I have created a customer attribute custom_password witch I would check if the user didn't insert the natif password, I check in the second one getCustomPassword() if it's correct i log it, What is the best way to do it.

public function loginPostAction(){
        if (!$this->_validateFormKey()) {
            $this->_redirect('*/*/');
            return;
        }

        if ($this->_getSession()->isLoggedIn()) {
            $this->_redirect('*/*/');
            return;
        }
        $session = $this->_getSession();

        if ($this->getRequest()->isPost()) {
            $login = $this->getRequest()->getPost('login');

            if (!empty($login['username']) && !empty($login['password'])) {

                if (strpos($login['username'], '@') === false){
                    Mage::log('Customer has entered a phone number ');

                    //pin code authentification
                    $customer2 = Mage::getModel('customer/customer')->getCollection()
                        ->addAttributeToSelect('*')
                        ->addAttributeToFilter('phone_number', $login['username'])
                        ->addAttributeToFilter('custom_password', $login['password'])
                        ->getFirstItem();
                    Mage::log($customer2); // here i get the right customer

                    // Here we will log a customer
                    try{
                        if($customer2->getEntityId()){
                            $session->setCustomerAsLoggedIn($customer2);
                            Mage::log('Customer logged');
                        }else{
                            throw new Exception($this->__('Customer not found'));
                        }
                    }catch (Exception $e){
                        $session->addError($e->getMessage());
                    }
                    $this->_redirect('customer/account');
                //end pin code authentification
                }

                try {
                    $session->login($login['username'], $login['password']);
                    if ($session->getCustomer()->getIsJustConfirmed()) {
                        $this->_welcomeCustomer($session->getCustomer(), true);
                    }
                } catch (Mage_Core_Exception $e) {
                    switch ($e->getCode()) {
                        case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:
                            $value = $this->_getHelper('customer')->getEmailConfirmationUrl($login['username']);
                            $message = $this->_getHelper('customer')->__('This account is not confirmed. Click here to resend confirmation email.', $value);
                            break;
                        case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD:
                            $message = $e->getMessage();
                            break;
                        default:
                            $message = $e->getMessage();
                    }
                    $session->addError($message);
                    $session->setUsername($login['username']);
                } catch (Exception $e) {
                    // Mage::logException($e); // PA DSS violation: this exception log can disclose customer password
                }
            } else {
                $session->addError($this->__('Login and password are required.'));
            }
        }

        $this->_loginPostRedirect();
    }


texts: same phtml on same page in magento commerce

texts: I want to add one static block above product details on product description page. So i turned on template path hints. And there are two attribute.phtml on same product page.


texts: How can I see all the orders down my orders tab on onclick my orders

texts: I am trying to get my order list down below my orders tab on clicking my orders. how can I get that??


texts: How to redirect to 301 instead of 302 in Magento 1.9.2.4?

texts:
How to redirect to 301 instead of 302,
My Magento site contains 302 redirects and its effects to SEO.

So I want to do a permanent redirect (301).

My Magento website converted HTTP to HTTPS and the problem is when browsing with "HTTP" first it 302 then 200.

Its fine to browse URL with "https" it shows 200


texts: Set condition for mass action checkbox visibility in magento

texts:
I have a magento module that I'm developing for importing products into magento.
I Have a grid where the user can select his products, and import them all (Mass Action).
If the user has products already imported in the list, then it's shown in the grid, but the user shouldn't select it (check it's product checkbox) to avoid re-importing the product.

My question is, how can I add a condition for a mass action checkbox visibility ?

Here is my Grid's _prepareMassaction:

protected function _prepareMassaction()
{
    $this->setMassactionIdField('sku');
    $this->getMassactionBlock()->setFormFieldName('import');
    $this->getMassactionBlock()->setUseSelectAll(false);
    $this->getMassactionBlock()->addItem('import', array(
        'label' => Mage::helper('import')->__('Import'),
        'url' => $this->getUrl('*/*/massImport'),
        'confirm' => Mage::helper('import')->__('Are you sure?')
    ));

    return $this;
}

Any Help someone ?


texts: Mage 2.4.2 3rd party Payment Gateway issue

texts:
When payment is by credit card, "Invoice" button is missing on backend of Magento. The Invoice is automatically created and sent to customer by the 3rd party module.
Is that a normal behavior in such a module ?
Why am I posting this: order status is not updated to "complete" after "ship" button is clicked. Status remains as "processing".


texts: Magetno 2 custom module how to Update DB Table row with model

texts:
How do I update instead of inserting new row on save using model

My code:

$question = $this->_objectManager->create('Vendor\HelloWorld\Model\Question');
$question->setTitle('Simple Question');
$question->setDescription('Question Description');
$question->setQuestion('I have an Updated question');
$question->save();

If a user already exist this way it isn't updating is creating new row
with the same user user_id.

How do one update the row using model example above?

Thanks


texts: Magento 2: how to make a module compatible with Varnish Cache?

texts:
This week, I noticed an interesting tweet (linked by Ben Marks in the comment below) that was saying something like this:

  Please make your Magento 2 modules compatible with Varnish as it is supported out of the box by Magento 2 CE

AFAIK, one thing to do is the implementation of the getIdentities method in the block classes (see here: What is IdentityInterface in Magento2)

Apart from that, is there anything else that needs to be done to make a Magento 2 module Varnish compatible ?


texts:
I have a gift card application where minimum price of any gift card is already set. eg: 5$
But I want to give an option to the user so that they can add more money to their card eg: 50$. So I will charge them for 50$ now. How to add an input field so that user can add the amount from product page.


texts: How to navigate between the thumbnails in the photogallery from external link?

texts:
I want to change the active/current picture in the product photo gallery through an external action.

So trying to find the proper js to do it I've tried this:

require([
    'jquery'
], function ($) {
               $(window).load(function () {
                                      var $fotoramaDiv = $('#fotorama').fotorama();

                                        // 2. Get the API object.
                                        var fotorama = $fotoramaDiv.data('fotorama');

                                        // 3. Inspect it in console.
                                        console.log(fotorama);

                                        fotorama.show(2);
                                  }
                        });
                    });

But keep saying TypeError: fotorama is undefined


texts: Class observer in config.xml doesn't work

texts:
I have some issue in my Event Observer in config.xml whose the class doesn't work:

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Prince_Cart>
            <version>0.0.1</version>
        </Prince_Cart>
    </modules>
    <global>
        <models>
            <cart>
                <class>Prince_Cart_Model</class>
            </cart>
        </models>
        <resources>
            <prince_cart_setup>
                <setup>
                    <module>Prince_Cart</module>
                </setup>
            </prince_cart_setup>
        </resources>
    </global>
    <frontend>
        <events>
            <controller_action_predispatch_checkout_onepage_index>
                <observers>
                    <Prince_Cart_Model_Observer>
                        <type>singleton</type>
                        <class>prince_cart/observer</class> <!--This doesn't work-->
                        <!--<class>Prince_Cart_Model_Observer</class>--> <!--This works but is not a good practice! -->
                        <method>blockProceedToCheckout</method>
                    </Prince_Cart_Model_Observer>
                </observers>
            </controller_action_predispatch_checkout_onepage_index>
        </events>
    </frontend>
</config>

Another detail: in which case we know that we can put <type>singleton</type> or <type>model</type> or nothing ?

Observer.php

class Prince_Cart_Model_Observer extends Varien_Event_Observer {

    public function blockProceedToCheckout($observer){
        ...
    }
}


texts: How the unit tests in magento 2 are useful?

texts:
I'd like to know, what are the core benefits of running tests in
magento ?
How & what can be determined from the tests ?
How to run a test ?


texts: Fatal error on cart REST API calls: Cannot instantiate interface Magento\Framework\MessageQueue\ConfigInterface

texts:
I'm having issues on the cart page and checkout of my Magento 2.3.1 CE store.

Most of the site is working totally fine but on the cart and checkout pages the shipping estimate and payment methods sections refuse to load.

Looking in the browser's network queue I see some AJAX requests are failing with a 500 internal server error like the following:

// AJAX POST request to
// https://example.com/uk/rest/uk/V1/guest-carts/[cart_token]/estimate-shipping-methods

// Response:
PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\Framework\MessageQueue\ConfigInterface in /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#1 /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#2 /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'queueConfig', 'Magento\\Asynchr...')
#3 /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php( in /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

I've not disabled any default modules or anything like that, and I've run the usual checklist of clearing caches, composer update, setup:upgrade, etc. etc.

Mostly everything else is working after a successful migration from Magento 1. Just this issue remains.

Any ideas?