texts: Load selected category products in list page magento2

texts:
I have loaded a custom template in the category view page. with content all categories in the drop down.

I am looking for functionality once drop down changes the corresponding category products should load in the list page.

Example: I have the drop down like below in list page before toolbar.

Test Category

test1
test2
test3

Once test2 category selected from the dropdown, All products belongs to that category should load in the content section of list page.

Is something like that can be achieved?

Please, anyone, look into it and update your thoughts. Thanks


texts: duplicate position entries in catalog_category_entity - can I edit the table directly?

texts:
I was looking at the answer given on Rearranged Subcategory Does not Reflect Store View but can't comment on it because I have low rep

My question is, am I safe to edit the position values in the catalog_category_entity table to fix duplicate entries? If not, is there a safer way of doing it?


texts:
I maintain a large number of Magento installations. I tend to find Google verification scripts littered across many production servers and many times the file is created directly on the box, failing to make it into source control, e.g.:

google950c6bee82c9eed7.html

I'm aware of the other ways of verification including meta tags, DNS records. I would be open to any suggestions that detail how you work with site verifications in your production environments.

I'm also curious if anyone has written up a blog or found some explanation of best-practices with regard to maintaining multiple verifications over time which, though I use Google in my example, obviously apply to more than just Google.


texts: Magento ver. 2.2.4 default billing & shipping address

texts:
How to save default shipping & billing in magento2.2.4 while placing an order using custom code?
Can any one please advise. how to achieve this.


texts: Blocked resources > /customer/section/load/?sections=cart&update_section_id=false&_=15382656000

texts: This message is coming from the Google Webmaster Tools (section Blocked Resources); has anyone an idea why this happens? Is this something to correct (if so, how this could be done?). Thanks for your collaborations


texts:
Currently the only way to remove a product on the cart page is if you enter 0 in the quantity field and click update shopping cart. Is there any settings I can enable or extension I can use to add a remove button on each line item?

I have found http://pradeepsanku.wordpress.com/tag/delete-product-from-cart-in-magento-programmatically/ which I could use to build my own extension but wanted to see what was available first before wasting my time


texts: Failed to load JS and other support files while trying to checkout

texts: I am trying to add a product in cart and check out the product, page still loading and it shown error message. enter image description here


texts: php bin/magento setup:upgrade Notice: Undefined index:

texts:
I have recently installed and then uninstalled an extension (Cart2Quote) and now when I attempt to run the command:
php bin/magento setup:upgrade

I am getting the following error:
Notice: Undefined index: quotation_quote in /home/49555.cloudserv.com/ngjhhhsssf/public_html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 153

Any ideas?
TIA,
Rob


texts:
I get an exception Missing argument 2 for Mage_Catalog_Block_Product_List_Upsell::setItemLimit() but it only occurs when I have Magento Developer Mode enabled.

However, this occurs only when I have Magento DeveloperMode enabled.  I assume this has something to do with bad XML configuration data?  But I'm not sure exactly how to track down the source of the problem.

UPDATE: I need to open this back up for help as it turns out the fix (which should have been fixed) actually did not solve the warning message.


texts: Contact Us Success Message Not Displaying Properly

texts:
I'm using the standard Contact Us page in Magento and it is not in a CMS page. When a customer sends a message, the success message does display. However, the page header is moved down and displays on top of the success message. I have looked everywhere and have no idea how to fix this. Feel free to send me a test message to see what I mean. Use the Contact Us link in the footer of www.shademountainarmory.com.

The only thing I could find in the Magento files relating to the success message was found in app/code/core/Mage/Contacts/controllers/IndexController.php. Here's the message code...

$translate->setTranslateInline(true);
                Mage::getSingleton('customer/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
                $this->_redirect('*/*/');
                return;
            } catch (Exception $e) {
                $translate->setTranslateInline(true);

                Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
                $this->_redirect('*/*/');
                return;

I can't find anywhere to modify WHERE the message appears since it seems to bump my page header down.


texts: Magento 2.4.1-p1 CE?: "main.ERROR: Can not resolve reCAPTCHA parameter..."

texts:
In /var/log/exception.log, I've been getting the following ERROR for over a week and can't figure out how to fix it:
main.ERROR: Can not resolve reCAPTCHA parameter. {"exception":"[object] (Magento\\Framework\\Exception\\InputException(code: 0): Can not resolve reCAPTCHA parameter. at /var/www/html/magento/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25)"} []

reCAPTCHA seems to be working, despite the error msg.
[edited to add]: I'm using reCAPTCHA v3 Invisible on Storefront, so I suppose I wouldn't know if it was allowing everyone through - not sure how to test that it is rejecting when it should.
I've tried re-setting the file and directory permissions, clearing and flushing cache, re-indexing.  None of these things have resolved it.
BTW, I switched my store from production mode to developer mode, but receiving the reCAPTCHA ERROR in the exception.log regardless of mode.
Please tell me how to fix this?
Thanks,
Evelyn


texts: rm($filename) method in Varien_Io_Sftp does not delete remote file

texts:
I'm pretty new to Magento dev so forgive me if some of my terminology isn't quite right.

My module needs to download and delete XML files from a remote FTP server using the sftp protocol. I'm using the Varien_Io_Sftp class to do that.

I'm able to open the connection, change to the needed directory and retrieve the file but when I try to delete it using the Varien_Io_Sftp rm method the remote file is not deleted.

<?php
    $vcXMLOut   = "/XML/export";
    $filename   = "test.txt"
    $sftpGetFiles = new Varien_Io_Sftp();
    $sftpGetFiles->open(
        array(
            'host'  => "ftp.test.com",
            'username'  => "test",
            'password'  => "test",
            'timeout'   => '100'
        )
    );
    $sftpGetFiles->cd($vcXMLOut);
    $file = $sftpGetFiles->read($filename); //Contents of file are read successfully
    $sftpGetFiles->rm($filename);   //File remains

I've ruled out permissions problems on the file.

I'm not sure why I'm not getting any errors anywhere. Is it because this code is being run in a cron schedule? The database says the scheduled jobs were successful. Nothing that I can find in any logs.

Any idea what I'm doing wrong here? Anyone have any ideas how I could better debug this code?


texts:
I'm trying this script to detect browser language and redirect to
  Italian store view if the language is Italian or English store view if
  the language is not Italian. The country code is correctly detected
  but I'm not able to redirect to the store view. I've also tried using
  header('Location: ' . $lang), lang was 'Italian' or 'default'. It
  works but I don't want to have in the URL the store view code.

  Here is the script:

function getCountryCode(){
  $CountryCode = substr(getenv('HTTP_ACCEPT_LANGUAGE'), 0, 2);
  if ($CountryCode=='it') {
    $lang = 3;
  }
  else{
    $lang = 1;
 }

 return $lang;
}

$lang = getCountryCode();

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();

$objectManager->get('\Magento\Store\Model\StoreManagerInterface')-
>setCurrentStore(0);


texts: Is there another step needed to enable memcache in magento?

texts:
memcache is installed on my vps environment

i have addd the necessary coding in file app/etc/local.xml

Should i not enable his function somewhere in Magento admin panel too?

Edit:

as requested:

<cache>
    <backend>memcached</backend>
    <memcached>
        <servers>
            <server>
                <host><![CDATA[127.0.0.1]]></host>
                <port><![CDATA[11211]]></port>
                <persistent><![CDATA[1]]></persistent>
            </server>
        </servers>
        <compression><![CDATA[0]]></compression>
        <cache_dir><![CDATA[]]></cache_dir>
        <hashed_directory_level><![CDATA[]]></hashed_directory_level>
        <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
        <file_name_prefix><![CDATA[]]></file_name_prefix>
    </memcached>
</cache>

According to the hosting company memcached is configured correct on server en also in xml file... they told me that magento doesn't seem to address the cache and that i needed to find a setting in backend to enable it... propably they dont know what they are talking about?


texts:
I have a problem i want to translate the date data in the column grid (for example : from 03 April 2020 00:00:00 to 03 Avril 2020 00:00:00) , but it's not translated even if I set the attribute 'translate=true'
Ps : this problem is related to upgrade from Magento 2.2 to 2.3
<column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date"
                component="Magento_Ui/js/grid/columns/date">
            <settings>
                <filter>dateRange</filter>
                <dataType>date</dataType>
                <label translate="true">Order Date</label>
                <sorting>desc</sorting>
            </settings>
        </column>

this is the class Date.php in Magento\Ui\Component\Listing\Columns

public function prepare()
    {
        $config = $this->getData('config');
        $config['filter'] = [
            'filterType' => 'dateRange',
            'templates' => [
                'date' => [
                    'options' => [
                        'dateFormat' => $this->timezone->getDateFormatWithLongYear(),
                    ],
                ],
            ],
        ];

        $localeData = $this->dataBundle->get($this->locale);
        /** @var \ResourceBundle $monthsData */
        $monthsData = $localeData['calendar']['gregorian']['monthNames'];
        $months = array_values(iterator_to_array($monthsData['format']['wide']));
        $monthsShort = array_values(
            iterator_to_array(
                null !== $monthsData->get('format')->get('abbreviated')
                    ? $monthsData['format']['abbreviated']
                    : $monthsData['format']['wide']
            )
        );

        $config['storeLocale'] = $this->locale;
        $config['calendarConfig'] = [
            'months' => $months,
            'monthsShort' => $monthsShort,
        ];
        if (!isset($config['dateFormat'])) {
            $config['dateFormat'] = $this->timezone->getDateTimeFormat(\IntlDateFormatter::MEDIUM);
        }
        $this->setData('config', $config);

        parent::prepare();
    }

    /**
     * @inheritdoc
     */
    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
                if (isset($item[$this->getData('name')])) {
                    $date = $this->timezone->date(new \DateTime($item[$this->getData('name')]));
                    $timezone = isset($this->getConfiguration()['timezone'])
                        ? $this->booleanUtils->convert($this->getConfiguration()['timezone'])
                        : true;
                    if (!$timezone) {
                        $date = new \DateTime($item[$this->getData('name')]);
                    }
                    $item[$this->getData('name')] = $date->format('Y-m-d H:i:s');
                }
            }
        }

        return $dataSource;
    }
}


texts: How do I extend Magento_Checkout/js/checkout-data.js?

texts: How do I extend Magento_Checkout/js/checkout-data.js in a custom theme?


texts: how to change menu type of sub-category in magento 1.9

texts:
i'm creating a navigation bar for a website built in mango theme. i have set menu type for my top-category "classic", now i want to set my sub-category in "static-width" menu type. any one know how to do it.
this screen shoot is of product category whose menu type i have selected classic, i what to change menu-type of the sub-category of product to static width


texts: I am getting 'Permission denied' every time when a mail is send

texts:
I have my Magento 1.9 installed on CentOS 6.6 locally and every time I send a mail I get permission denied. Same mail settings works perfectly fine on Production (AWS).
I tried on different installation on same system all are giving same error.


texts: Specific product price render in magento 2

texts:
I want to render specific product price render in my custom page in block file.

I get reference from here . But, It returns error :

main.CRITICAL: Wrong Price Rendering layout configuration. Factory block is missed [] []

How to render price box ?

Please help me.

Block File :

<?php
namespace Vendor\Helloworld\Block;

class Helloworld extends \Magento\Framework\View\Element\Template {
    /** @var  \Magento\Framework\View\Result\Page */
    protected $_product;
    protected $_layout;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\Product $product,
        \Magento\Framework\View\LayoutInterface $layout
    ) {
        $this->_product = $product;
        $this->_layout = $layout;
        parent::__construct($context);
    }

    public function getPrice($productID) {
        $product = $this->_product->load($productID);
        $price = '';
        $arguments = [];
        $priceType = \Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE;
        $priceRender = $this->getLayout()->getBlock('Magento\Framework\Pricing\Render', 'product.price.render.default');
        $arguments['zone'] = \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST;
        if ($priceRender) {
            $price = $priceRender->render($priceType, $product, $arguments);
        }
        return $price;
    }
}

Controller File :

<?php
namespace Vendor\Helloworld\Controller\Index;

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

    protected $_customBlock;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Vendor\Helloworld\Block\Helloworld $customBlock
    ) {
        $this->_customBlock = $customBlock;
        parent::__construct($context);
    }

    public function execute() {
        return $this->_customBlock->getPrice(1);
    }
}

layout xml : (helloworld_index_index.xml)

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
  <referenceContainer name="content">
   <block class="Vendor\Helloworld\Block\Helloworld" name="formbuilder" template="Vendor_Helloworld::helloworld.phtml"/>
  </referenceContainer>
</body>
</page>

I take reference from this both answer :

1) Click here
2) Click here

Thanks.


texts: How to remove html from exported order csv?

texts:
I have added item quantity with product SKU in order grid. I have an option to load more or load less if the items more than 3 in a single order. Item quantity is displaying fine in the order grid. But when I export the order CSV, the load more or load less html code is displaying in the order csv. How can I prevent the html for the order csv.

I am using below code for SKU with item quantity:

public function render(Varien_Object $row)
{
    /** @var MageWorx_OrdersGrid_Helper_Data $helper */
    $helper = Mage::helper('mageworx_ordersgrid');

    $orderitemqty = array();
    $$orderitemsku = array();
    $order=Mage::getModel('sales/order')->loadByIncrementId($row['increment_id']);//increment_id,like 100000004
    $ordered_items = $order->getAllItems();
    foreach($ordered_items as $item){
      $orderitemqty[] = $item->getSku(). ' (' .floor($item->getQtyOrdered()).')';
    }

    $prCount = count($orderitemqty);
    if ($prCount > 3) {
        $orderitemqty[$prCount - 1] .= 'getData('increment_id') . '_' . $prefix . '\').style.display=\'none\'; $(\'a_' . $row->getData('increment_id') . '_' . $prefix . '\').style.display=\'block\'; return false;" style="float:right; font-weight:bold; text-decoration: none;" title="' . $helper->__('Less..') . '">↑'
            . '
'
            . 'getData('increment_id') . '_' . $prefix . '" onclick="$(\'hdiv_' . $row->getData('increment_id') . '_' . $prefix . '\').style.display=\'block\'; this.style.display=\'none\'; return false;" style="float:right; font-weight:bold; text-decoration: none;" title="' . $helper->__('More..') . '">↓';
        $orderitemqty[2] .= '
getData('increment_id') . '_' . $prefix . '" style="display:none">' . $orderitemqty[3];

        unset($orderitemqty[3]);
    }

    $data = implode('
', $orderitemqty);
    if (strpos(Mage::app()->getRequest()->getRequestString(), '/exportCsv/')) {
        $data = str_replace(array('&nbsp;','
'), array(' ','|'), $data);
    }
    return $data;
 }

}


texts: Autoshipping module outputting HTML Code in one storeview

texts:
I have a weird issue with https://github.com/integer-net/Autoshipping module.

Though it works fine in most of my stores/storeviews, in one of the stores/storeviews the output of template/checkout/cart/country.phtml is shown as HTML instead of processed as HTML.

This is what I get:

(source: smarterliving.nl)  .

While the output should be like this:

(source: smarterliving.nl)  .

Now why is this happening? Why is Magento outputting a .phtml like this?

This is the content of the .phtml file:

<?php /** @var $this IntegerNet_Autoshipping_Block_Country */ ?>

<?php echo $this->__('Shipping cost to', $this->getShippingCostPageUrl()) ?>

<?php echo $this->getCountryHtmlSelect($this->getSelectedCountryId(), 'country_id', 'autoshipping_country') ?>

So all stores/storeviews are:

in the same installation
using the same template

The only difference is that the store and storeviews I get this error on are using https://github.com/sitewards/B2BProfessional to disable pricing info and shopping cart for not logged in users. Obviously I get this error while logged in.

I have to assume that there is some incompatibility between integernet_autoshipping and sitewards_b2bprofessional, but what would it be, why is it? More importantly: how do I troubleshoot this?

Update: I have tried to see what happens when I would disable the sitewards_b2bprofessional extension, but the problems stays in this specific website and both its storeviews.

Update 2: The line in country.phtml that gives the troubles is:
    getCountryHtmlSelect($this->getSelectedCountryId(), 'country_id', 'autoshipping_country') ?>

Specifically the $this-getCountryHtmlSelect(). This leads back to app/code/community/IntegerNet/Autoshipping/Helper/Data.php.
The contents of this file are:

class IntegerNet_Autoshipping_Helper_Data extends Mage_Core_Helper_Abstract
{
public function getCountryHtmlSelect($defValue=null, $name='country_id', $id='country', $title='Country')
{
    if (is_null($defValue)) {
        $defValue = $this->getCountryId();
    }
    $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_'.Mage::app()->getStore()->getCode();
    if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) {
        $options = unserialize($cache);
    } else {
        $options = $this->getCountryCollection()->toOptionArray();
        if (Mage::app()->useCache('config')) {
            Mage::app()->saveCache(serialize($options), $cacheKey, array('config'));
        }
    }
    $html = $this->getLayout()->createBlock('core/html_select')
        ->setName($name)
        ->setId($id)
        ->setTitle(Mage::helper('directory')->__($title))
        ->setClass('validate-select')
        ->setValue($defValue)
        ->setOptions($options)
        ->getHtml();
    return $html;
}
}

Update 3: One would think the problem is in this file. However, if I enable template-hints for this storeview AND I comment out the line that calls this function in country.phtml, the actual template hint is not rendered but output as HTML as well:

frontend/foundation/default/template/checkout/cart/country.phtml
 Shipping cost to NL

Currently I'm clueless as to why Magento is behaving this way.


texts: Magento loading very slow in MAMP Pro, 10 times slower than remote instance

texts:
My Magento site is taking about a minute to load each page, but my remote instance, which is the same, loads in a few seconds.

Anything I can find about a similar issue, like this post, give a solution that is not working for me.

Also, my other sites in MAMP Pro don't have this issue.

Anyone have a suggestion about how to solve this?


texts:
I have One wholesaler folder in magento root in which one index.php file
in that file i found this code

/**
 * Compilation includes configuration file
 */
$compilerConfig = 'includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = '../app/Mage.php';
$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";
    }
    exit;
}

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';
    exit;
}

require_once $mageFilename;

#Varien_Profiler::enable();

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);

umask(0);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

//Mage::run($mageRunCode, $mageRunType);

Mage::run('wholesale', $mageRunType);

I am Upgrading Magento version.
My Issue is my site is redirecting on live site when I put Mage::run('wholesale', $mageRunType); instead of //Mage::run($mageRunCode, $mageRunType); in index.php.

Actually, i don't know actual use of $mageRunCode.


texts: Magento 2: How can I remove the attribute value in the product view page?

texts:
I'm using Magento 2.1.6 and am wondering how can I hide an attribute from being displayed on a product view page?

I have tried setting 'Visible on Catalog Pages on Storefront' to 'No' from within admin for the attribute. however, it is still showing on the product view page.

Please help me in resolving this.


texts: What is the preferred way to get entity_type_id in Magento 2?

texts:
When looking around the M2 source trying to figure out how to get the entity_type_id I see a lot of this :

$this->_entityTypeId = $this->_objectManager->create(
        'Magento\Eav\Model\Entity'
    )->setType(
        \Magento\Catalog\Model\Product::ENTITY
    )->getTypeId();

However, I thought never invoking the ObjectManager directly was the new mantra in M2. Is this the best way to get the entity_type_id?


texts: Magento 1.9 API Performance - Retrieving All Sales Order Info

texts:
I'm creating a page that shows order sales data such as sales revenue, total quantity of orders and also best sellers which consist of products from all sales orders.

The problem is that this takes 20 minutes to run for a database with only 1200 orders. I'm certain this is because an API call needs to be made for each order separately to retrieve the item information:

$orderDetails[] = array($client->salesOrderInfo($sessionId, $orderNumbers[$d]));

Here's an example of my code:

    // API Connection.
    $client = new SoapClient('htps://www.mysite.com/api/v2_soap/?wsdl');
    $sessionId = $client->login('API Username', 'API Password');

    // Filter orders for this year only.
    $filter = array('complex_filter' => array(
           array('key' => 'created_at', 'value' => array('key' => 'gt', 'value' => $currentYear . '2017-01-01 00:00:00'))
       )
    );

    // Call the API and retrieve the orders.
    $orders = $client->salesOrderList($sessionId, $filter);

    // Loop through orders and store order numbers against the $orderNumbers array.
    $orderNumbers = array();
    for ($i = 0; $i < count($orders); $i++) {
        $orderNumbers[] = $orders[$i]->increment_id;
    }

   // Loop through order numbers and store the order details against the $orderDetails array (this seems to be the problem area).
   $orderDetails = array();
   for ($d = 0; $d < count($orderNumbers); $d++) {
      $orderDetails[] = array($client->salesOrderInfo($sessionId, $orderNumbers[$d]));
   }

Is there a way of improving my script so that it performs much better? I cannot find a way of retrieving sales order info for more than one order at a time.

Thanks so much for any help.


texts: Using order details on success page multiple times

texts:
I would like to be able to bring the order specifics into variables so I can reuse for various tracking apps on the success page. I'm still learning php with some knowledge of magento so appreciate detailed help if possible.
Example details I'll need to output:

order id
sku
ean
brand
product name
quantity
grandTotal

Magento 2.3
Cheers in advance
Andy


texts:
I've applied a captcha and have prevented the creation of any further spam accounts, but have an unknown large number of accounts to delete. Is there a way to filter accounts by length of user name (as they are all very long) or by empty fields (most of the rest of the fields are blank)?

An example 'name':

  вера, сегодня Китaйcкий Новый Гoд! и мы раздаeм купоны от 2019p вceм пoсетитeлям: https://www.google.com/#%62%74nI=381p&q=%65Bo%6EuSELO - успей получить в течение 24 часов! Для получения информации перейдите по ссылке выше


texts: How can I know what does a magento function do?

texts:
I am a developer trying to learn magento. I learned the basic things like make a simple module, a simple widget nothing complicated at all.

But when I have to use a object function, I do not know what it does. How can I know what does that function do?

I am not saying a concret function because I want to know how to find out what it does without asking here the concret function.

Also there is a web page where all the functions are located? (and easy to use)


texts: Cart Price Rules not reflected on google analytics

texts:
Does anyone know how to make the discounts created in Magento 2 through Marketing > Cart Price Rules reflected in my Google Analytics account?
I need help with this as I have been wanting to fix it for a long time and I can't.
This is the problem I have:
I set up a 30% discount if someone buys x product.
In Magento the total purchase is 70% of the value, while in Google Analytics it continues to show me 100%.
Thanks in advance!


texts: Is there a way to perform a test payment on a live site?

texts:
Does anyone have any methods to perform a test transaction on their live production sites, without it charging the user or sending the order to the warehouse?

Other platforms seem to have a method to do this.


texts: Dislpay custom attribute in Product view page - in Product description template

texts:
I am working on magento 1.9.2 RWD theme and I am trying to display the product additional info via custom attribute.

I have created the attribute -
    Admin   Default Store View
    faq       FAQ

I added a new block FAQ in the layout.xml and it is displaying on the product page.When I am adding an cms block it is displaying properly.

But When I am trying to get the value of faq attribute through admin panel it is giving error and not displying. My code of faq.phtml  in the product/view/faq.phtml are as follow-

/**

 * Product description template

 *

 * @see Mage_Catalog_Block_Product_View_Description

 */

?>

<?php

 $_product = $this->getProduct();

//$pid= $_product->getId();

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

/*  $ids = $_product->getCategoryIds();

 $categoryId = (isset($ids[0]) ? $ids[0] : null); */

?>
 <?php

 if($_product->getFAQ()){ ?>

    <?php echo $_product->getFAQ();?>

 <?php } ?>

I am getting the below Error:

  Fatal error: Call to a member function getFAQ() on null in /home/berkowitsclinic/public_html/hairwits.com/app/design/frontend/rwd/default/template/catalog/product/view/faq.phtml on line 107

please help.


texts:
The progress bar in my shop is not updating the address data and so on. I debugged the code and the problem is this line in progress.phtml:

<?php if($this->getCheckout()->getStepData('billing', 'complete')): ?>

This is never true, even though, I am completing the OPC steps. What could be the reason. There are no errors in the logs.

Thanks!


texts:
i got this error at localhost/rest/V1/hello/name/Jim.

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<error>
<messages>
<error>
<data_item>
500
<message>
<![CDATA[
Fatal Error: 'Uncaught TypeError: Argument 2 passed to Magento\Framework\Reflection\TypeProcessor::resolveFullyQualifiedClassName() must be of the type string, null given, called in /var/www/html/m2/vendor/magento/framework/Reflection/TypeProcessor.php on line 535 and defined in /var/www/html/m2/vendor/magento/framework/Reflection/TypeProcessor.php:640 Stack trace: #0 /var/www/html/m2/vendor/magento/framework/Reflection/TypeProcessor.php(535): Magento\Framework\Reflection\TypeProcessor->resolveFullyQualifiedClassName(Object(Zend\Code\Reflection\ClassReflection), NULL) #1 /var/www/html/m2/vendor/magento/framework/Reflection/MethodsMap.php(139): Magento\Framework\Reflection\TypeProcessor->getParamType(Object(Zend\Code\Reflection\ParameterReflection)) #2 /var/www/html/m2/vendor/magento/framework/Webapi/ServiceInputProcessor.php(156): Magento\Framework\Reflection\MethodsMap->getMethodParams('VENDOR\\New...', 'name') #3 /var/www/html/m2/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(101): Magento\Fram' in '/var/www/html/m2/vendor/magento/framework/Reflection/TypeProcessor.php' on line 640
]]>
</message>
<trace>
<![CDATA[ Trace is not available. ]]>
</trace>
</data_item>
</error>
</messages>
</error>

etc/webapi.xml

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

etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Vendor\News\Api\NewsInterface" type="Vendor\News\Model\NewsManagement" />
</config>

api/NewsInterface.php

<?php
namespace Vendor\News\Api;

interface NewsInterface
{
    public function name($name);
}

Model/NewsManagement.php

<?php
namespace Vendor\News\Model;
use Vendor\News\Api\NewsInterface;

class NewsManagement implements NewsInterface
{
    public function name($name) {
        return "Hello, " . $name;
    }
}

How can i fix it?


texts: Admin infinite redirect after trying to change admin URL

texts:
I attempted to change my admin url.

Originally I was going to set it up on a subdomain but apparently followed a bad or outdated tutorial. I changed "Use Custom Admin URL" to Yes and then "Custom Admin URL" to https://admin.example.com/admin_abc123. I also configured apache and dns for the subdomain but I'm not sure that's relevant.

It didn't initially work, so I attempted to revert by modifying these values in the database to what they were.

But now I get an infinite redirect. When I go to https://admin.example.com/admin_abc123/ I appear to be redirected to https://admin.example.com/admin_abc123/admin_abc123/admin/.....

And I get an error:

  This page isn’t working

  example.com redirected you too many times.

How can I solve this issue?

Edit: Also tried php bin/magento setup:config:set --backend-frontname="admin_abc123" which showed a success message but did not fix the problem.


texts:
I require some assistance on Magento 1.14. I am currently coding a new theme for a an existing Magento website and require the Catalog layouts all to be 1 column as opposed to the default "2 Columns With Left".

When I change the "page layout" under one of the categories it changes on the front-end as you would expect. However I don't want to have to go through each category and set these to 1 column.

I have tried an override in local.xml file but this doesn't seem to affect anything, please could someone advise. This is the code I added to the local.xml file

<catalog_category_view>
    <reference name="root">
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
    </reference>
</catalog_category_view>

Regards


texts: How can I run prototype.js version 1.7+ I need to

texts:
I need to run prototype.js version 1.7 or above and I have version 1.6.0.3 installed.
When I run version 1.7+ I can not see images for products in my admin section making it impossible to use. I have Magento community version 1.5.1

The reason I need to run version 1.7+ is because I want to use JW video player with Chromecast support - when I do on prototype.js 1.6.0.3 Chromecast on IOS does not work ( works on flash for desktop).
When I run 1.7+ prototype.js the Chromecast IOS bug is fixed.

Please does anyone know how I might solve this conundrum?
Regards
Mark


texts:
I've got a site which at some point in the past used SEO friendly category pagination for example :

category/subcategory/40.html
category/subcategory/4.html
category/subcategory/15.html
category/subcategory/45.html
category/10.html
category/34.html
category/45.html
category/65.html

The site has since reverted to the default functional URL's such as :

  category/subcategory?p=40
    category/subcategory?p=4
    category/subcategory?p=15
    category/subcategory?p=45
    category?p=10
    category?p=34
    category?p=45
    category?p=65

Could anyone help with any possible rewrite rules that wouldn't conflict with any other part of the site,  but would capture and 301 the previously used to the current?

Thanks in advanced.


texts: Change simple product to configurable product

texts:
We have a lot of simple products imported into Magento.
There is a new section of the store that allows to configure some of these products. More specific: They can be rented and we ask the user to select the duration.

How best to achieve it without creating new products and manually copying the product contents?

We found an extension that changes the attribute set, but still we should change the product type from simple to configurable...

Any advices?


texts: Magento 1.9.2 :how to take data though API from android app to magento database?

texts: We are having android app where we are tracking the location and timing of our sales guys! but how we can save this log in time and log out time in magento database ? how I can interact with android app? how to create API to interact with app ?


texts: custom message based on total for free delivery

texts:
Is it possible to display a message in a pop-up box or alert on the cart page when a customer is close to the free delivery threshold i.e.

"Spend another £5 and you qualify for free delivery"


texts: Magento 2 :Display attribute option values

texts:
I have created a field in system->config to save an attribute code which is already created.(For eg:color)

Based on that value, I need to get all the option values of that attribute.(ie ,In my admin form drop down, I need to display its option values as red,blue,green).

How it is possible ? Please help.


texts: Why do I need to save Configurable Products 2x times?

texts:
I am having problems on putting my product in stock.
I create it, I associate simple products to it, and it works fine.
Visibility and simple products stock are also correct.

The big problem here is that when I refresh the homepage it just won't show up.

Then i found an issue:

When i go to Magento Admin Page -> Catalog -> Manage Products , and click on the configurable product, It looks like it is well configurated.

Associated products page:

Inventory page:

What happens next: When I save again (this time manually, not programmatically) it just works without any problems. I also noticed that when i give categories to the product It won't associate it on FrontEnd but it will link in BackEnd only. The fix for this one is the same as the first problem!


texts: Magento2: Adding the same custom attribute to all products of a certain Type?

texts: How can I add the same custom option (checkbox) to all products of the same Type? In my case, certain products are of type "Event Ticket Product", due to changes from a 3rd party extension (Magenest_Tickets). I wish to add the product options programmatically rather than manually. (To add it manually for a single product, in most cases I would edit that Product and go to Custom Options.) I need to include in the program the text that goes next to the checkbox. Also where do I call the code? In a Controller, Block, or somewhere else?


texts: Magento 2 Checkout show Order Summary in popup div window

texts:
Good Afternoon All,
I am currently working on a small module that requires a copy of the Order summary is shown in a pop-up window after the checkout has loaded.
I have been working with the data-bind="afterrender: myFunctionCall" and have tried this at the summary level, side-bar level and the item render loop level to see if I could pop the information in a div. The problem I am facing is that the items are still being loaded after the fact and therefore I do not have all the information.
I was wondering if anyone has a solution for the detection of when the checkout page has loaded or if there is a better approach for this.
Any help and guidance would be very welcome.


texts: How can I add captcha to newsletter form?

texts:
I've added captcha to contact us form by following this

I'm wondering while its not working with newsletter form ?

here's what I tried.

<cms_index_index translate="label">
        <reference name="newsletter-validate-detail">
               <block type="core/text_list" name="form.additional.info">
                <block type="captcha/captcha" name="captcha">
                    <reference name="head">
                        <action method="addJs"><file>mage/captcha.js</file></action>
                    </reference>
                    <action method="setFormId"><formId>newsletter_captcha</formId></action>
                    <action method="setImgWidth"><width>230</width></action>
                    <action method="setImgHeight"><width>50</width></action>
                </block>
            </block>
        </reference>
    </cms_index_index>

  config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Contact_Captcha>
        <version>0.1.0</version>
    </Contact_Captcha>
</modules>
<default>
    <captcha>
        <frontend>
            <areas>
                <contact_page_captcha>
                    Contact Page
                </contact_page_captcha>
                <newsletter_captcha>
                    Newsletter Form
                </newsletter_captcha>
            </areas>
        </frontend>
    </captcha>
</default>
 <global>
    <models>
        <contact_captcha>
            <class>Contact_Captcha_Model</class>
        </contact_captcha>
    </models>
    <events>
        <controller_action_predispatch_contacts_index_post>
            <observers>
                <captcha>
                    <type>model</type>
                    <class>contact_captcha/observer</class>
                    <method>checkContactPage</method>
                </captcha>
            </observers>
        </controller_action_predispatch_contacts_index_post>
        <controller_action_predispatch_newsletter_subscriber_new>
            <observers>
                <captchanews>
                    <type>model</type>
                    <class>contact_captcha/newsletterObserver</class>
                    <method>checkNewsletterPage</method>
                </captchanews>
            </observers>
        </controller_action_predispatch_newsletter_subscriber_new>
    </events>
</global>
</config>

Any help would be appreciated.


texts:
I have a single product and I'd like to link straight to it from the category button is this possible?

For example I have a category called "custom Cut Board"

I only have one product attached to the category. To reduce clicks I would like it when they click the category title it goes straight into the product page.

Any ideas?

Thank you.


texts: Query Regarding topLinks in ../template/links.phtml

texts:
Now I have a code

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

which gives me some set of menus like Login, MyWishlist,  My Account, Checkout, and Mycart. But, now i need to change the label of these above mentioned links. What should I do?


texts: Magento2 error message not showing in admin

texts:
I'm validating max sale qty when admin create order, I want to throw the error, it's redirecting back to order index page but error message not showing there? what's wrong here?
<?php

    namespace Vendor\Sales\Plugin;

    class Orderplugin {

     public function __construct(
            \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
            \Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId,
            \Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
            \Magento\CatalogInventory\Api\StockRegistryInterface $stockItemRepository,
            \Magento\InventorySales\Model\GetProductSalableQty $salableQty,
            \Magento\Framework\Message\ManagerInterface $messageManager,
             \Magento\Framework\UrlInterface $url,
                \Magento\Framework\App\ResponseFactory $responseFactory
            ){

                $this->_productRepository = $productRepository;
                $this->maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId;
                $this->quoteRepository = $quoteRepository;
                $this->_stockItemRepository = $stockItemRepository;
                $this->_salableQty = $salableQty;
                $this->messageManager = $messageManager;
                $this->url = $url;
                $this->responseFactory = $responseFactory;
        }
        public function beforeSave(\Magento\Sales\Model\Order $subject)
        {

            $quoteId =  $subject->getQuoteId();
                $quote_cart = $this->quoteRepository->get($quoteId);
                $quote_cart_items = $quote_cart->getAllItems();
                foreach($quote_cart_items as $item){
                    $stock_data = $this->_stockItemRepository->getStockItem($item->getProductId());
                if($item->getQty()>$stock_data->getMaxSaleQty()){
                    $messge =  "Max allowed qty for product id with ".$item->getProductId().' is '.$stock_data->getMaxSaleQty();
                    $this->messageManager->addNotice($messge);
                    $CustomRedirectionUrl = $this->url->getUrl('sales/order');
                    $this->responseFactory->create()->setRedirect($CustomRedirectionUrl)->sendResponse();
                    exit();
                 }
                }
        }
    }

Di.xml
<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
 <type name="Magento\Sales\Model\Order">
    <plugin name="apr_sales_create" type="Vendor\Sales\Plugin\Orderplugin" sortOrder="10" disabled="false"/>
</type>
</config>


texts: how to manually set order status to "Complete"?

texts:
I created an invoice for an order, then created a shipment from my magento admin and I encountered a rare problem, for some reason when I pressed "Submit Shipment" the website went to a 404 page, server side issues, being looked at separately. Now the order has an invoice and shipment, literally the order is complete but the status still remains as processing. when I check the invoices tab, the invoice is there, when I check shipment tab the shipment is there. has anyone else ever encountered this?
I believe when the system crashed it recorded the shipment however didn't change the status to "Complete" So is there a way to manually change the status to "Complete"? Perhaps from the database?

thanks


texts: how to get store information by locale code

texts:
How can get store id by locale code right now I have

$locale='en_US';

reverse of this code

Mage::getStoreConfig('general/locale/code', $storeId);

now based on this I want to get store id I could not find possible way. any suggestion?


texts: Magento 2: Use Zend_Pdf easily while making PDF file

texts:
How to make a dynamic PDF easily while sending an email with this PDF attachment using Zend_Pdf because of this type of code

 $page->drawText(__("Image"), $x + 60, $this->y-10, 'UTF-8');
 $page->drawText(__("Sku"), $x + 200, $this->y-10, 'UTF-8');
 $page->drawText(__("Name"), $x + 310, $this->y-10, 'UTF-8');

It is very complicated.
how to convert this in a table format?

Or can we call phtml while making PDF file?


texts: Magento 2 reindex process stuck on Category Products and Product Categories

texts:
I am working on Magento 2.3.2. I am doing reindex but the process is never ends for Product Categories and Category Products for total of 60K Prducts

I tried to reset these both and tried to reindex one by one. But nothing worked. It is just showing processing. No error or anything.

Can anyone help me how to complete reindex for these both ?


texts: Can't checkout when remove country field

texts:
I tried to hide the country field in the checkout page and billing page.
Here's my code :

<item name="region_id" xsi:type="array">
    <item name="visible" xsi:type="boolean">false</item>
    <item name="config" xsi:type="array">
        <item name="componentDisabled" xsi:type="boolean">true</item>
    </item>
</item>
<item name="country_id" xsi:type="array">
    <item name="visible" xsi:type="boolean">false</item>
</item>

I could do checkout when i remove this code :

<item name="country_id" xsi:type="array">
    <item name="visible" xsi:type="boolean">false</item>
</item>

But, when i remove it, the country field still appeared. How can i hide the country field? I can't hide with CSS because the class for country field is class="field _required"


texts: Updating Magento1.9 Associated price from backend

texts: I want to change the associated product price from back end but with out adding Super product attributes configuration with adding and subtracting price.


texts: Store view default currency doesn't change in admin while adding product?

texts:
I have created 5-6 store view with single currency in all of then
e.g Yen for japan, CAD for canada.

Every thing works fine , but while adding product from admin and selecting the respective store view then in price tab it always show USD . Please check the attached snapshot.


texts: Product details page image zoom issue - Magento 2

texts:
In product page the Zoomed Image will display when I click on the product image. If I click the Close Icon on zoom it displays a blank page sometimes.
I expect the zoom window should close. I don't know why it is coming like this.

I think this problem coming in default theme also.

Kindly help me out.


texts: After upgrade to 2.3.3, got SQLSTATE[23000]: Integrity constraint violation: 1022 when trying to run bin/magento setup:upgrade

texts:
I just upgrade to Magento 2.3.3 from Magento 2.2.9 following these steps (https://magento.stackexchange.com/questions/251778/how-to-upgrade-magento-version-from-2-2-x-to-2-3-0). However, at the step

  php bin/magento setup:upgrade

i got the error message below

  SQLSTATE[23000]: Integrity constraint violation: 1022 Can't write;
  duplicate key in table '#sql-1767_f1786', query was: ALTER TABLE
  catalog_product_entity_text MODIFY COLUMN value_id int(11)  NOT
  NULL  AUTO_INCREMENT COMMENT "Value ID", ADD CONSTRAINT  PRIMARY KEY
  (value_id), ADD CONSTRAINT
  CAT_PRD_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID FOREIGN KEY
  (attribute_id) REFERENCES eav_attribute (attribute_id)  ON
  DELETE CASCADE, ADD CONSTRAINT
  CAT_PRD_ENTT_TEXT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY
  (entity_id) REFERENCES catalog_product_entity (entity_id)  ON
  DELETE CASCADE, ADD CONSTRAINT
  CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID_STORE_STORE_ID FOREIGN KEY
  (store_id) REFERENCES store (store_id)  ON DELETE CASCADE, ADD
  CONSTRAINT
  CATALOG_PRODUCT_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID UNIQUE
  KEY (entity_id,attribute_id,store_id), ADD INDEX
  CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE_ID (attribute_id), ADD INDEX
  CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID (store_id)


texts: How to display subtitle/scope (global, store view) with UI component form element heading

texts: I am creating a custom module in the admin which is EAV and is supporting multi store view. I want to show the scope with the field as In attached image. How can this be accomplished using UI Component.


texts: Magento2 : Mini cart removeItem is not working

texts:
I have a magento2 live store, that was working properly. But today mini cart remove item functionality stopped working.

When I checked in developer mode, I found that the Request Url /checkout/sidebar/removeItem/ returning 302 found response status.

How to resolve this issue?


texts: add to cart message is displaying in other pages , but button is present in my account page

texts:
Edit

Once we click on "ADD TO CART" in "My account" page and if we open any other pages like home page , catalog page, product page, i can see message there, but not displaying in My account page.

Edit end

In "My designs" section, Under My account we are displaying some products and gave an option for "Add to cart" and its working fine.

now i need to display message on top of the page after customer click on "Add to cart" similar to product view page :

For "Add to cart" button, i am trying same code that we are using in product view page, but its not displaying any message.

app/design/frontend/rwd/Stylebaby/template/example/example.phtml

<?php $collections = $this->getCollection(); ?>

<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = Mage::helper('core')->quoteEscape($this->__('Add to Cart')); ?>

<?php foreach ($collections as $key => $product) {

    echo $product->getName().'
';
?>
<form action="<?php echo  Mage::helper('checkout/cart')->getAddUrl($product);?>" method="post">

<button type="submit" title="<?php echo $buttonTitle ?>" class="button btn-cart" >

    <?php echo $buttonTitle ?>

</button>

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

</form>

<?php

}
?>

Edit

app/code/local/Amasty/Example/controllers/mydesigncontrollers.php  - http://pastebin.com/rpjjMthf


texts:
Maybe I don't know enough about Magento, but is there not a setting for allowing a cart update?
I have a Magento 2.3 site, and when I add items to the cart, it opens up a minicart with the quantities. But, when I close the minicart, and then go back to the cart and update the quantities, it end ups doubling all the quantities, instead of just updating what has been changed.
Is there not an "update cart" option built into Magento?


texts:
As the title of this post suggests, the admin panel of my Magento2 installation wont load. Sometimes after a setup:static content:deploy and deleting all cookies, it will load the login page. After logging in, the page will load but after a few minutes there is still no result. This is my second Magento2 installation and both have the same problem. I suspect it has something to do with my Mamp PRO settings (localhost).

I've been debugging for ages now, but nothing helps. Multiple topics on the internet suggest some solutions and I've came across a couple which almost had the same problem which was a loading 'Luma' theme without the style.

I really hope someone can help me solve this problem. I really want to start developing some modules, but its just not doable like this! :'(

Things I've tried:

  Mamp PRO httpd.conf :: AllowOverride None -> AllowOverride All

  ./magento setup:static-content:deploy (multiple times)

  ./magento cache:flush

  ./magento cache:disable

  ./magento deploy:mode:set developer

  Verified the Apache version, Php version and MySQL version

  Removed all files from pub/static (except from the .htaccess)

  Run composer update multiple times

Best regards


texts:
sudo ./magento setup:install --base-url=http://127.0.0.1:8500
  --db-host=localhost --db-name=magento2 --db-user=root --db-password=1234 --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

After running above command it shows following error

  SQLSTATE[HY000] [2054] The server requested authentication method
  unknown   to the client

  [InvalidArgumentException]     Parameter validation failed


texts: Magento 2: Bulk update "This item has weight" flag for all products?

texts:
Im using shipping method "Weight vs. Destination". For this all items need to have a weight. I can bulk update the weight for all the products but i cant bulk update the flag "This item has weight".

I searched online and found some articles but none of them have a clear solution. Kindly help.


texts:
After running the bin/magento cache:clean the setup gets 500 Error i saw the log means

PHP Fatal error:  Uncaught Zend_Cache_Exception: cache_dir
"/var/www/html/var/page_cache" is not writable in
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php:209\nStack
trace:\n#0
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180):
Zend_Cache::throwException()\n#1
/var/www/html/vendor/colinmollenhour/cache-backend-file/File.php(87):
Zend_Cache_Backend_File->setCacheDir()\n#2
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(153):
Cm_Cache_Backend_File->__construct()\n#3
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(94):
Zend_Cache::_makeBackend()\n#4
/var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):
Zend_Cache::factory()\n#5
/var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(38):
Magento\Framework\App\Cache\Frontend\Factory->Magento\Framework\App\Cache\Frontend\{closure}()\n#6
/var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121):
Magento\Framework\Cache\Frontend\Adapte in
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php on
line 209

After giving the directory access it is showinf the below error

ReflectionException: Class Magento\Framework\App\Http\Interceptor does
not exist in
/var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php:24
Stack trace: #0
/var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php(24):
ReflectionClass->__construct() #1
/var/www/html/vendor/magento/framework/ObjectManager/Definition/Runtime.php(54):
Magento\Framework\Code\Reader\ClassReader->getConstructor() #2
/var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48):
Magento\Framework\ObjectManager\Definition\Runtime->getParameters() #3
/var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56):
Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() #4
/var/www/html/vendor/magento/framework/App/Bootstrap.php(237):
Magento\Framework\ObjectManager\ObjectManager->create() #5
/var/www/html/pub/index.php(28):
Magento\Framework\App\Bootstrap->createApplication() #6 {main}

After run the setup:di:compile it is working. Iam running the command in as superuser (sudo su), and the file owner is ubuntu is there any problem in the working method. Iam using the magento 2.4.2


texts:
I have created a new module which provides a Magento 2 widget. The widget was previously working but now when I go Content -> Widgets in Magento admin I get the following error:

PHP Fatal error:  Uncaught Error: Call to a member function getNamedItem() on null in /var/www/src/vendor/magento/module-widget/Model/Config/Converter.php:51

Its related to thewidget.xml file as if I remove it the error doesn't occur. My widget.xml looks like this:

<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
    <widget id="category_list" class="Mynamespace\CatalogWidget\Block\Category\CategoryList" is_email_compatible="true"
            placeholder_image="Magento_CatalogWidget::images/products_list.png" ttl="86400">
        Catalog Category List
        <description translate="true">List of Categories</description>
        <parameters>
            <parameter name="title" xsi:type="text" required="false" visible="true">
                Title
            </parameter>
            <parameter name="template" xsi:type="select" required="true" visible="true">
                Template
                <options>
                    <option name="default" value="category/widget/content/grid.phtml" selected="true">
                        Category Grid Template
                    </option>
                </options>
            </parameter>
            <parameter name="products_count" xsi:type="text" required="true" visible="true">
                Number of Categories to Display
                <value>10</value>
            </parameter>
            <parameter name="cache_lifetime" xsi:type="text" visible="true">
                Cache Lifetime (Seconds)
                <description translate="true">86400 by default, if not set. To refresh instantly, clear the Blocks HTML Output cache.</description>
            </parameter>
        </parameters>
    </widget>
</widgets>


texts: I'm using magento 2 , and I'm trying to find out what's the file that sets the quality of the image upload, as the images appear to be a bit blurred in the catalog.


texts: How to override customer resource module customer.php

texts:
I have override customer resource module in custom module.
Like : Core_Mage_Model_Resource_Customer
Override this module but not succeed.
I have follow these steps :
Here is config.xml

<?xml version="1.0"?>
<config>
    <modules>
       <Abc_CustomizeCustomers>
       <version>0.1.0</version>
       </Abc_CustomizeCustomers>
    </modules>
    <global>
       <customer_re>
          <rewrite>
            <customer_resource> Abc_CustomizeCustomers_Model_Resource_Customer</customer_resource>
          </rewrite>
       </customer_re>
    </global>
</config>

Here is Customer.php

 <?php
    class Abc_CustomizeCustomers_Model_Resource_Customer extends
      Mage_Eav_Model_Entity_Abstract
     {
         protected function _beforeSave(Varien_Object $customer)
         {
             Mage::log("checkCustomer", null, 'appServer.log');
         }
     }

But when save customer. log file is not create.
I want to override _beforeSave Function.

Please anyone suggest me how to fix this.


texts: Magento css changes not showing - magento 2

texts: I have made some css changes to my custom.css file and it's well uploaded to server but i can't see my changes on frontend.


texts:
What is made changes to Magento 2.4 category if compare to Magento 2.3? Please tell me paths for files where is made changes to Magento 2.4 category?

Issue: Category first page it display oldest products what is added to category? And last page is newest products what is added to category?

All works without issues when was installed Magento 2.3.

First category page is newest products and latest category page is oldest products what is added to category.


texts:
(Magento) On a category page I can filter products by other categories using the ?cat=... parameter. This works just fine (In combination with Amasty improved navigation). But I would like to make the URL SEO friendly. Now my URL looks like:

https://sitedomain/brands/sony?cat=251

Explained:

"brands" is a category containing subcategories for all my brands.

"sony" (example) is a sub category of "brands" containing all Sony products.

"cat 251" is a category named "cameras" with a different parent (so not a sub category of "brands" or "Sony")

This URL shows me all Sony camera's, so that's just fine. But I would the URL to be:

https://sitedomain/brands/sony/cameras
or if that is not possible something like:
https://sitedomain/brands/sony/filter/cameras

I have no idea how to start. My approach was creating a module that triggers a URL rewrite as soon as the cat parameter exists. But I had no luck at all so far. So is this even possible? And if so, please point me into the right direction. Thanks!


texts: Magento 2 : One or more indexers are invalid. Make sure your Magento cron job is running

texts:
I find error admin "One or more indexers are invalid. Make sure your Magento cron job is running"

I've run command Re-Index php bin / magento indexer: reindex but appeared issue another Fatal error: Class 'Locale' not found in / home / qyivmqoz / public_html / magento2 / vendor / Magento / framework / Locale / Bund le / DataBundle php on line 64

I use PHP 5.6 and MySQL 5.6

Is there a solution for my problem.


texts: is there any ways to call hidden phtml files in magento 2?

texts:
When i click

http://localhost/new_magento/fashion.phtml

But there is no files present in root folder in magento.

I have search block then find code from admin panel

And also i have find code from root directory in block.xml file

After all, i can not understand how that file calling in form of  "*.phtml" which is not present.

My question is how to find that file?

Please help me.


texts: Moving large number of categories URL Rewrite management and SEO

texts:
Need some help and understanding on what do to in the following scenario:
My store has a large amount of products (80k with a multilingual brings the total to 160k for 2 store views) and I am looking at the idea of rearranging the main categories by making some more general categories.
Example
Current:

Category 1 / Child / Child
through
Category 5 / Child / Child

I would like to narrow the category list:

New Category A / Category 1 / Child / Child / Category 3 / Child / Child / Category 4 / Child / Child
New Category B / Category 2 / Child / Child / Category 5 / Child / Child

What kind of impact would this have on my catalog rewrites?, will permanent 301 links automatically be created?
Since this is a large database, would there be any benefit to out right clearing all URL rewrites BEFORE making changes to the category structure?
EDIT:
Here is a print screen of the total url rewrites I have, does this make sense?


texts: Magento 2 - Change Order status after invoicing

texts:
I have an observer that triggered on sales_order_invoice_pay event, and after creating the invoice, the order status is automatically changed to complete. after that I try to change it to processing but it doesn't work.

is there any way to change the order status after creating the invoice?

below is the code I use to change the status:

$order->setState(\Magento\Sales\Model\Order::STATE_PROCESSING, true);
                    $order->setStatus('processing');
                    $this->_orderRepository->save($order);


texts: Fatal error when access to categories grid on admin Magento 2

texts:
I have a Magento store in 2.2.9, clients need this version to work with some module, at this moment when I access to the categories admin grid I get this error

Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Framework\View\Element\UiComponentFactory::argumentsResolver() must be of the type array, null given, called in /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php on line 220 and defined in /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php:172 Stack trace: #0 /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php(220): Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('sw_ocat_categor...', NULL) #1 /var/www/html/vendor/magento/module-ui/Component/Form/Field.php(84): Magento\Framework\View\Element\UiComponentFactory->create('sw_ocat_categor...', 'imageUploader', Array) #2 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(159): Magento\Ui\Component\Form\Field->prepare() #3 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(156): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component in /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php on line 172

And I can't see the grid, any ideas what is waiting for the argument?


texts: Product Image on category view not updated with new image

texts:
I am creating a module where the customer can design a product(saved programmatically), so each time he designs the product a new product image which is generated. But it is not updated in the category view page, but it is updated on the product view page. Upon research, I found that the images are loaded from the cache in the category page. Is there a way to overcome this problem?

As the user is re-designing the product( done programmatically in a module), it is impractical to clear cache or re-index from the admin side each time.


texts: After Upgrade: An error has happened during application run. See exception log for details

texts:
After upgrading Magento 2 to the latest version, I started getting the error below each time I try to access the website:
"An error has happened during application run. See exception log for details."
Any suggestion would be much appreciated. Thanks!


texts:
I've been building an enhanced password policy module for Magento 1.9, the specifics of which aren't causing a problem.

At the moment it hooks into admin_user_validate, fired from Mage_Admin_Model_User:563 event and validates the $observer->getUser()->getData('new_password'), which works fine when validating password changes for existing users, however I can't seem to get it to work for validating a new user's password.

I can see from Mage_Admin_Model_User that the event is only fired within the if ($this->hasNewPassword()) conditional, which wouldn't be triggered by a new user, so I guess my question is, does anyone know if there is another event that is triggered by both new and existing users, or is there a better way to validate password changes, preferably via an observer.

Any help is appreciated.


texts: how many orders displaying based on Selected From & To Date

texts:
we are using below code to filter orders based on selected From & To date.

we can able to filter successfully & displaying results on custom page [orders.php].

php

function getDesignerCollection()
    {
        /* date search */
        if (isset($_POST['post_at']) && $_POST['post_at'] != '')
            {
            $orderFromDate = $_POST['post_at'] . " 00:00:00 ";

            }
            else
            {
            $orderFromDate = '';
            }

        if (isset($_POST['post_at_to_date']) && $_POST['post_at_to_date'] != '')
            {
            $orderToDate = $_POST['post_at_to_date'] . "    23:59:59  ";

            }
            else
            {
            $orderToDate = '';
            }
       /* date search end*/

        $accountType = $rows['type'];
        if ($accountType == "admin")
            {

            if ($orderFromDate != '') $order->addFieldToFilter('created_at', array(
                'gteq' => $orderFromDate
            ));
            if ($orderToDate != '') $order->addFieldToFilter('created_at', array(
                'lteq' => $orderToDate
            ));
            }

form

<form name="frmSearch" method="post" action="">

    <input type="text"  id="post_at" value="" name="post_at"  />
    <input type="text" id="post_at_to_date" value=""name="post_at_to_date"  />

    <input type="submit" name="search" value="search" id="searchButton">

    </form>

now we want to display count of how many rows are displayed.  so we tried below code. its displaying like below image. its displaying "rows = 3". because its considering "entity_id" column of "sales_flat_order" table.  but i want "rows : 9" as you can see 9 rows in image.

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

// specify the date picker date-format
$format = 'Y-m-d';

// if posted data are not empty
if(!empty($_POST['post_at']) && !empty($_POST['post_at_to_date']))
{

       if (!empty($_POST['post_at'])) {
           $dateFrom = DateTime::createFromFormat($format, $_POST['post_at']);
       }

       if (!empty($_POST['post_at_to_date'])) {
           $dateTo = DateTime::createFromFormat($format, $_POST['post_at_to_date']);
       }

        // Get the resource model
        $resource = Mage::getSingleton('core/resource');

       // Retrieve the read connection
          $read = $resource->getConnection('core_read');

      // MySQL query
        $query =  'SELECT entity_id, created_at, dproduct_id FROM sales_flat_order WHERE created_at BETWEEN :fromdate AND :todate ;';

// Bind MySQL parameters
$binds = array(
'fromdate' => $dateFrom->format('Y-m-d H:i:s'),
'todate' => $dateTo->format('Y-m-d H:i:s')
);
// Execute the query and store the results in $results
$results = $read->fetchAll($query,$binds);
echo "rows : ".count($results);
echo "<br>";
print_r($results);
}

else {
echo "error you have not specified any dates";
}

complete code : http://pastebin.com/hMUEusvb


texts: Can not override Sales Resource Model Collection class

texts:
I am trying to override Mage_Sales_Model_Resource_Order_Collection

My custom module's config:

<?xml version="1.0" encoding="UTF-8"?>

<config>
    <modules>
        <Abc_Salesextend>
            <version>0.1.0</version>
        </Abc_Salesextend>
    </modules>

    <global>
        <blocks>
            <salesextend>
                <class>Abc_Salesextend_Block</class>
            </salesextend>

            <adminhtml>
                <rewrite>
                    <sales_order_grid>Abc_Salesextend_Block_Sales_Order_Grid</sales_order_grid>
                </rewrite>
            </adminhtml>
        </blocks>

        <models>
            <salesextend>
                <class>Abc_Salesextend_Model</class>
                <resourceModel>salesextend_resource</resourceModel>
            </salesextend>

            <salesextend_resource>
                <class>Abc_Salesextend_Model_Resource</class>
            </salesextend_resource>

            <!-- HERE is i am trying to override-->

            <sales_resource>
                <rewrite>

                    <order_collection>Abc_Salesextend_Model_Resource_Order_Collection</order_collection>

                </rewrite>
            </sales_resource>
        </models>
    </global>

</config>

It's not giving me any kind of error even if I place the wrong custom class name. So it's not finding my custom class.

Please help


texts: Get number of pages in Oberver Magento 2

texts:
I have an Observer and I must get the number of pages (I need to know if there is > 1 page) in it. I tried on both collection and pager but no success :

public function __construct(
    \Magento\Framework\App\Request\Http $request,
    \Magento\Framework\View\Page\Config $layoutFactory,
    LayerResolver $layerResolver,
)
{
    $this->request = $request;
    $this->layoutFactory = $layoutFactory;
    $this->catalogLayer = $layerResolver->get();
}

public function execute(Observer $observer)
{
$this->catalogLayer->getProductCollection()->getLastPageNumber()
}

By trying this it gave me the result "1" but this is not the good one.

Any idea on how I should do it?


texts: ChangeLog (_cl) table implementation for indexing in Magento2

texts: Is there a changelog table implementation for indexing in Magento2 ?


texts: How to make the same name of the customer only once registered


texts: How to change layout of categories on base of categoy level in magento 2

texts:
I have a lot of categories with different levels (parent/child structure) and I want to implement different design/structure of each level category.
Suppose I have these categories
=> Category A (first Level)

=>=> Category B (Second level)

=>=>=> Category C (third level)

=>=>=>=> Category D (fourth level)

I have two solutions

Create a xml file catalog_category_view_id_{{id}}.xml
Issue: I can't implement because I have many categories and it will be difficult to update in futures

Change the category page layout of each category
Issue: It’s not working because I think, I have already updated catalog_catalog_view.xml in my theme or its Magento bug

Please guide me about some better solution


texts: How to implement js and css for phtml template file in Magento 2

texts:
I have been struggling to find a correct way to implement css and js for my template file, which lies in M2's backend. I put a file named default_head_blocks.xml to implement fullCalendar's css:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/fullcalendar.css" />
        <css src="css/fullcalendar.print.css" media="print" />
    </head>
</page>

I don't really know if this is okay or not. Also, requirejs file mapping is quite tricky, at least for me, to implement. The offical devdocs on this is not very helpful. Is there a way to do these with least pain possible?


texts: allow to save empty value for dropdown attribute while importing products through csv in magento2 import

texts:
while importing products in magento2 given feature,my csv has empty values for some columns like gender which are not required case which has to be updated to empty value if empty value exists in CSV file.
 can anyone suggest me how do this with default magento2 import feature.


texts: Magento admin error: Image file was not found

texts:
I have a custom module with two controllers, one for admin and one for frontend:
http://dev.magento18.com/admin/example_myadmincontroller/preview/id/2/
http://dev.magento18.com/example/mycontroller/?id=1&storeId=1

mycontrollerAction(){
  $html = Mage::helper('mymodule/helpername')->myHelperFunction();
  ...
}

myadmincontrollerAction(){
  $html = Mage::helper('mymodule/helpername')->myHelperFunction();
  ...
}

Both controllers call the same helper. Inside helper I do:

myHelperFunction(){
  $_product = Mage::getModel('catalog/product')->load(1);
  //if product doesn't have image it will display placeholder on frontend,
  //in backend triggers error Image file was not found.
  $imgSrc = Mage::helper('catalog/image')->init($_product, 'image');
  ...
  return $html
}

If product doesn't have image, it will display placeholder on frontend. But in backend the same helper triggers error Image file was not found.. Has anybody had the same issue, how could I pass this error and make it display placeholder also in admin?


texts:
As a new Magento student was thinking is it possible to do something like this ...

    var url = product['image'];
    var image = '<?=Mage::helper("imageprocessor")
            ->getImgProcessor( >> js variable here << ,10,20,NULL)?>';

is it possible at all ?
or the only way is ajax request?
I tried "->getImgProcessor('+variablename+')" and similar things but ... it does not work this way.


texts: Place Order button doesn't go to success/confirmation page? (1.9.1.0)

texts:
I'm not quite sure what could be causing this issue, we have absolutely NO extensions or modifications. This happens on a fresh install with one product made being the only change.

It doesn't matter if we're in the the RWD theme or the modern theme. When clicking "place order" the order submits in the backend of Magento, the button disappears for a second and says "submitting order" and then the Place Order button shows back up. No forwarding to the success page, this causes people to just click "place order" over and over, and it submits a new order every time. No theme will take us to the success page.


texts: How to change product price in sub website

texts:
I have Magento ver. 1.9.2.1, I have setup two sub website with two sub domain.
I have more than 30,000 products in magento site which are global to all website.

Main Website has base currency INR and other two sub website has base currency USD, AED.
Frontend on product page for main website price showing correct but for other two website product price showing incorrect.

For Example :

Product price in INR is 5000 Rs

then in USD sub website it is showing 5000 USD => 3,37,552 INR

and similarly for AED sub website

I want to auto set all product price in converted form in their respective base currency, because it is too much time consuming if I do from admin.

It should be :

Product price in INR is 5000 Rs

then in USD sub website it is showing 74.030 USD => 5000 INR

Is there any setting or any php script for solving this?

Thanks in advance.


texts: How to Add Custom Options programmatically

texts:
Products are inserting, but the custom options are not inserting.

$mageFilename = '../app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
Mage::app();
umask(0);

$offerJsonURL    =  'http://affilnow.com/component/controller.php';
$Products        =  'get_product_list_by_category_id_and_or_vendor_id';
$Categories      =  'get_parent_categories';
$Latest          =  'get_latest_products';

$fk_= new vendor_data($affiliateID, $token);
$fk_Categories= new category($affiliateID, $token);
$fk_Latest = new latest($affiliateID,$token);

$stores= vendor_data::getVendor($offerJsonURL, 'json');
$categories= category::getCat($offerJsonURL, 'json');
$latest = latest::getLatest($offerJsonURL, 'json');

$product_id='product_id';
$name='name';
$description='description';
$short_d='short_description';
$quantity='quantity';
$weight = 'weight';
$rate ='price';
$sku='sku';
$tax='tax_class_id';
$visibility= 4;
$status='status';
$meta_title='meta_title';
$meta_description='meta_description';
$meta_keyword='meta_keyword';
$tag='tag';
$model='model';
$upc='upc';
$ean='ean';
$jan='jan';
$isbn='isbn';
$mpn='mpn';
$location='location';
$image='image';
$stock='stock_status';
$category ='categories';
$options = 'options' ;

foreach ($stores['data'][$Products] as $review) {
    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
    $product = Mage::getModel("catalog/product");

    try {
        $product
            ->setStoreId(0)
            ->setAttributeSetId(4)
            ->setTypeId('simple')
            ->setSku($review[$sku])
            ->setName($review[$name])
            ->setWeight($review[$weight])
            ->setStatus($review[$status])
            ->setTaxClassId($review[$tax])
            ->setVisibility(4)
            ->setPrice($review[$rate])
            ->setMetaTitle($review[$meta_title])
            ->setMetaKeyword($review[$meta_keyword])
            ->setMetaDescription($review[$meta_description])
            ->setDescription($review[$description])
            ->setShortDescription($review[$description])
            ->setStockData(array(
                    'qty' => $review[$quantity]
                )
            )
            ->setCategoryIds(array($review[$category]));

        foreach ($review['options'] as $pro_opt) {
            foreach ($pro_opt['product_option_value'] as $pro) {
                $product
                    ->setProductOptions($pro[$options])
                    ->setCanSaveCustomOptions(true);
                $product->save();
                echo $pro['product_option_value_id'] . "
";
                echo $pro['option_value_id'] . "
";
                echo $pro['name'] . "
";
                echo $pro['image'] . "
";
                echo $pro['quantity'] . "
";
                echo $pro['subtract'] . "
";
                echo $pro['price'] . "
";
                echo $pro['price_prefix'] . "
";
                echo $pro['weight'] . "
";
                echo $pro['weight_prefix'] . "
";
            }
        }

        $product->save();
        $err = curl_error($curl);
        curl_close($curl);
    } catch (Exception $e) {
        Mage::log($e->getMessage());
    }

}

CUSTOM OPTIONS JSON FORMAT:

"options": [{
    "product_option_id": "1474614118575",
    "product_option_value": [{
        "product_option_value_id": "14746141182837",
        "option_value_id": "14746141181",
        "name": "XS",
        "image": "",
        "quantity": "2",
        "subtract": "1",
        "price": "0.0000",
        "price_prefix": "+",
        "weight": "0.00000000",
        "weight_prefix": "+"
    }]
}


texts: Show Product Review List Below Review form on product page in magento2

texts:
I want to show Customer Reviews list below review form
Any One know solution?


texts:
I have enabled ssl in my nginx configuration and also enabled https for frontend in magento. When I am trying to hit a custom module controller action from my android device, It's automatically redirected to 302. I am hitting this url "http://www.exampleur.com/data/response" with post datas in body from andorid device. But I am getting this response in access log

146.50.59.80 - - [01/Jan/2017:01:20:27 -0500] "POST /data/response/ HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"

Post datas are going as empty to the secure url. I don't like to hit the secure url directly. Is there any way to pass the post datas to secure url when there is 302 redirect.


texts: Magento 1.9: Product price model increment with (quantity and price) step

texts:
Is it possible to have a mapping for product quantity and price in terms of step, instead of linear scaling?
More specifically, a base price(x$) for base quantity(q) plus additive step price(y$) for every step quantity(p) increment and number of increments(n), so total price is (x + ny)$ for total quantity (q + np) ?  Is it necessary to create new custom product type?


texts: How to save custom value in sales_flat_order_grid on order placement?

texts:
I have to save the stock of each product when an order is placed.

The custom module is Tbb_StockRegistrar. It creates a column called order_stock_message in sales_flat_order and sales_flat_order_grid tables. This is OK.

Then, the observer should save the value in those tables (Not working):

config.xml

<events>
    <sales_order_place_after>
        <observers>
            <checkout_submit_all_after_handler>
                <type>model</type>
                <class>Tbb_StockRegistrar_Model_Observer</class>
                <method>save</method>
            </checkout_submit_all_after_handler>
        </observers>
    </sales_order_place_after>
</events>

Observer.php

<?php

class Tbb_StockRegistrar_Model_Observer
{

    public function save($observer)
    {
        $order  = $observer->getEvent()->getOrder();
        $stocks = $this->saveComment($order);
        $this->saveOrderGridColumn($order, $stocks);
    }

    protected function saveComment($order)
    {
        # Save the stocks as an order comment (Working)
    }

    protected function saveOrderGridColumn($order, $stocks)
    {
        $stockMessage = ... // It populates the message to be saved

        $orderModel = Mage::getModel('sales/order')->load($order->getId());
        $orderModel->setOrderStockMessage($stockMessage);
        $orderModel->save();

    }

}

The method setOrderStockMessage is not saving anything. Why?

Plus, how can I store the same value in sales_flat_order_grid table on sales_order_place_after observer?


texts: Magento 2: Custom Options - info between?

texts: Is there a way for me to place text between the custom options on my product page? I'd like to separate each option (size, message, text field) with some information relating to the option beneath each piece of information.


texts:
Hello everyone I'm a newbie. Can I recover somewhere the user and the password to access the MySQL database? I lost them and I think they are the always the same that I entered when first configuring the Magento installation. Is there a way to access that panel again? Or another solution? The website is hosted on an external server, I don't know if this has nothing to do with it.
Thanks a lot


texts: Only one base currency is displaying in magento admin panel?

texts:
I have a magento store that is pre made by some one. In that in admin panel system configuration in curreny setup base currency, I have found only one currency "Australian dollar".How can i enable or install other currencies By default in magento store it displays all currencies..

Thank You


texts: transcational custom email is observer not loading image header and footer

texts:
my custom transactional email is not loading image for header and footer. i am sending the mail through observer other email are working perfectly only the observer email not loading header and footer properly.

$emailTemplate  = Mage::getModel('core/email_template')
                                ->loadDefault('review_template');
                $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name'));
                $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email'));
                $emailTemplate->setTemplateSubject('Make a Review');
                $email=$order->getCustomerEmail();
                $emailTemplateVariables = array();
                $emailTemplateVariables['test'] = $companyinfo->getCompanyName();
                $emailTemplateVariables['name'] = $order->getCustomerFirstname().' '.$order->getCustomerLastname();
                $emailTemplateVariables['reviewurl'] = Mage::getUrl('test/index/review',array('ref' => $ref));

                $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
                $emailTemplate->send($email,$order->getCustomerFirstname().' '.$order->getCustomerLastname(), $emailTemplateVariables);


texts: Magento 2 Checkout mini-cart need to show reward point phtml block

texts:
I want to show Reward Point content(../vendor/magento/module-reward/view/frontend/layout/checkout_cart_index.xml) :

       <block class="Magento\Reward\Block\Tooltip\Checkout" name="reward.tooltip.checkout" template="tooltip.phtml">
            <arguments>
                <argument name="reward_type" xsi:type="string">Magento\Reward\Model\Action\OrderExtra</argument>
            </arguments>
            <action method="setWrapperClass">
                <argument name="class" xsi:type="string">reward-checkout</argument>
            </action>
            <action method="setRewardMessage">
                <argument translate="true" name="message" xsi:type="string">Check out now and earn %1 for this order.</argument>
            </action>
            <action method="setIsGuestNote">
                <argument name="value" xsi:type="string">1</argument>
            </action>
        </block>

Into vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html to show content of reward point as below :


texts: Product tab not coming in admin in Magento2.2

texts:
My code was working fine for Magento 2.1 but in 2.2 suddendly product tab is not coming in magento admin on product edit page. below is my layout file:-

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product_form">
            <block class="W3solver\Qrcode\Block\Adminhtml\Catalog\Product\Edit\Tab\Qrcode" name="qrcode.tab">
                <arguments>
                    <argument name="config" xsi:type="array">
                        <item name="label" xsi:type="string" translate="true">Qrcode</item>
                        <item name="collapsible" xsi:type="boolean">true</item>
                        <item name="opened" xsi:type="boolean">false</item>
                        <item name="sortOrder" xsi:type="string">191</item>
                        <item name="canShow" xsi:type="boolean">true</item>
                        <item name="componentType" xsi:type="string">fieldset</item>
                        <item name="group_code" xsi:type="string">advanced</item>
                        <item name="dataScope" xsi:type="string"></item>
                    </argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

  In W3solver\Qrcode\Block\Adminhtml\Catalog\Product\Edit\Tab\Qrcode
  file

When I tried to debug then it works till constructor but later its not working. Is there any change with Magento 2 which can result in such issue?


texts: How to implement create, update, delete in magento rest api?

texts:
How to set methods in api2.xml
I create _create(), _retrieve() , _update(), _delete(), _retrieveCollection() functions in Module/Model/Api2/Test/Rest/Guest/V1.php

I think its manage in /app/code/core/Mage/Api2/Model/Resource.php


texts: Found https://magento-analytics.com/5cd060d51e45d.js script in HTML head and footer script in admin

texts:
We are facing one weird problem.

Suddenly we found https://magento-analytics.com/5cd060d51e45d.js script in HTML head and footer script in admin theme.

This script breaks the searching functionality of store.

Anyone have any idea about this script ?? Please let us know.


texts: How can i get the product image size (mb/kb) , and more details about the product in magento

texts: How can i get the all product image file memory size (mb/kb), and image title and image stored path with store wise??


texts: In Magento 2, Why it is not refreshing shipping methods after State field select

texts:
In Magento 2, after Country filed select then shipping methods refreshing automatically. But why it is not refreshing shipping methods after State field select and how to apply refresh to state field also.

<item name="country_id" xsi:type="array">
    <item name="sortOrder" xsi:type="string">115</item>
</item>

<item name="region_id" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/region</item>
    <item name="config" xsi:type="array">
        <item name="template" xsi:type="string">ui/form/field</item>
        <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
        <item name="customEntry" xsi:type="string">shippingAddress.region</item>
    </item>
    <item name="validation" xsi:type="array">
        <item name="required-entry" xsi:type="boolean">true</item>
    </item>
    <!-- Value of region_id field is filtered by the value of county_id attribute -->
    <item name="filterBy" xsi:type="array">
        <item name="target" xsi:type="string"><![CDATA[${ $.provider }:${ $.parentScope }.country_id]]></item>
        <item name="field" xsi:type="string">country_id</item>
    </item>
</item>


texts: How to create a dynamic fields in admin form?

texts:
I want to add add new button template in admin form like this...

How to do that?

Thanks.


texts: How to get Customer custom attribute Label

texts:
I've created some custom attributes for customers. I can retrieve the values normally using $customer->getData('attribute'). But i also need the label for the respective attribute, the frontend label. I know there are a lot of answers out there, i did searched, but all of those answers is related with products, i want the customer custom attributes.

One of those answers i've tried so far: https://stackoverflow.com/a/12469321/4687714
but it return the value formated to frontend store, i want the attribute label.

So, how do i return the Label of a Customer custom attribute?


texts: Differences in Image handling in Magento2 and Magento1

texts:
I have upgraded Magento from 1.9.2.2 to 2.2.1.
I have migrated data using data migration tool.
I have observed that for products for those images are marked excluded are appearing as hidden in Magento2 but in Magento1 which is marked as excluded still appearing on frontend as product base image and thumbnail as it is marked so.

For example, I have a product ABC and it has two images i1 and i2, both are marked as excluded but i2 is selected as base, small and thumbnail.
Now after migration in Magento2 both the images are hidden, which is correct and i2 is also showing correct tags like i2 is marked as small, base and thumbnail but it is not appearing on frontend.

What is the difference between two Magento versions in handling and processing images?


texts: Problem with module installation on staging subfolder (Magento 2)

texts:
I have created a staging magento copy of live site on a sub folder, everything goes fine until now.

When I want to install module, and run magento module:status doesn't appear on the list.

The folder of module is on app/code, but nothing happens.

Any clue about this problem?

Thanks!!!

[More Info]

I'm trying to install this module https://store.plumrocket.com/twitter-facebook-login-magento2-extension.html

module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Plumrocket_SocialLoginFree" setup_version="2.2.0">
    <sequence>
        <module name="Magento_Customer" />
        <module name="Plumrocket_Base" />
    </sequence>
</module>

registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Plumrocket_SocialLoginFree',
    __DIR__
);


texts: Magento2 : Custom modules are not installed by Composer

texts:
I've installed Magento 2.2.4 with no sample data from magento.com/tech-resources/download.

The problem is that none of about 5 modules (not installed by composer, just copied into) in app/code is workig... They are enabled and I can list them using module:status. I've done setup:di:compile and cleaned cache.

Does anybody have the similar problem ?


texts: Magento 2- code-migration installation using git

texts:
I have got the link for the tool to migrate code of Magento 1.x to Magento 2.x.

But have no idea how to execute it.

https://github.com/magento/code-migration

I have tried following command in cmd to install this module -

composer config repositories.code-migration git https://github.com/magento/code-migration

composer require magento/migration:dev-master

I am getting below exception -

Problem 1
    - The requested package magento/code-migration-develop could not be found in any version, there may be a typo in the package name.

Potential causes:
 1. A typo in the package name
 2. The package is not available in a stable-enough version according to your minimum-stability setting
   see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

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

Any idea how to resolve this?


texts: How to ship simple products of Group Product in Magento 2?

texts:
I am working on a web store where I want to add all associated products of group product to cart as whole. Like we do using Bundle Product. I want to restrict the user not to change the quantity or selection of the products. I hope my question is clear :)
If not let me know in comments I will let you understand. So you can help me.

Happy Learning!


texts:
How can I solve direct export error. My store consisting 20k products and I know it's huge.

How can I solve this export error?

  max_execution_time : 99999999; max_input_time : 16000; memory_limit
  : 8048M

Output Screen Shot:


texts: Magento 2 - event observer called multiple time

texts:
I am using sales_order_status_history_save_after event for store data in my custom table.

I need also update comment with a prefix of commentId (entity_id) in to sales_order_status_history table.

While I am doing setComment data in observer than two times data stored in my custom table.

also, I have added log in to the observer file I found that my event call two times. I did not understand why its call two times and my data stored 2 times in my custom table.

is anyone knows how we can solve this issue??

here is the code:

public function execute(Observer $observer)
{
    try {
         $statusHistory = $observer->getEvent()->getStatusHistory();
         $orderId = $statusHistory->getParentId();
         $commentId = $statusHistory->getId();
         $post = $this->request->getPostValue();

         $oldComment = $statusHistory->getComment();

         $newComment = "Comment Id : ".$commentId. $oldComment;

         $statusHistory->setComment($newComment);

         $_orderstatusdata = $post['order_reprint'];
         $bulkInsert = [];

         foreach ($_orderstatusdata as $orderstatusdata) {
            if($orderstatusdata['is_reprint']){

                $customdata = [];
                $customdata['key1'] = 'val1';
                $customdata['key2'] = 'val2';
                $customdata['key3'] = 'val3';
                $customdata['key4'] = 'val4';

                $bulkInsert[] = $customdata;

            }
         }

        $connection->insertMultiple('custom_table',$bulkInsert);

    } catch (\Exception $e) {
        $this->logger->error($e);
    }
}


texts: Override Magento module layout "before/after"

texts: A third-party module inserts a block into the layout via before="-". Is there a way to insert a block before their block without editing the module's xml?


texts: Magento2: Found unrecognizable text in review

texts:
In our Live site there are we found unrecognizable text like below:

We have already implement google captcha also, Still, we facing this issue.
Can anyone please check.

I have edited my Question. Please check that strange string in the image.