texts:
I create Table and Product Attribute but Table is created but Product Attribute is not creating

<?php
$installer = $this;
$installer->startSetup();
$sql=<<<SQLTEXT
create table tablename(tablename_id int not null auto_increment, fname ,primary key(tablename_id));

SQLTEXT;

$installer->run($sql);
//demo
//Mage::getModel('core/url_rewrite')->setId(null);
//demo
$installer->endSetup();

attribute script

<?php
$this->startSetup();

$this->addAttribute('catalog_product', 'preorder', array(
        'group'             => 'General',
        'type'              => 'int',
        'backend'           => '',
        'frontend'          => '',
        'label'             => 'Is it Preorder product',
        'input'             => 'boolean',
        'class'             => '',
        'source'            => '',
        'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
        'visible'           => true,
        'required'          => false,
        'user_defined'      => false,
        'default'           => '0',
        'searchable'        => false,
        'filterable'        => false,
        'comparable'        => false,
        'visible_on_front'  => false,
        'unique'            => false,
        'apply_to'          => 'simple,configurable,virtual,bundle,downloadable',
        'is_configurable'   => false,
        'used_in_product_listing', '1'
    ));

$this->endSetup();

I think Name of the file name is wrong some one will guide me What problem it's


texts: Is it possible to display some products dimensions by yards instead of inches

texts:
I have some products measured in inches, and some in yards. When I go to list a simple product, the only option that I have is inches.

Is there a straightforward way to make the switch, or do I have to write custom code to turn the grayed out "in" into a dropdown with options?

Thanks


texts:
I upgraded from 1.7 to 1.9. At checkout, when client clicks on 'Place Order', it just shows a circling motion (submitting order information) and it reloads the page. I saw somewhere that that solution is: Magento 1.9.1.0 requires that your server has php-mbscript (mbstring) enabled in Apache.

I had a chat with Hostgator and they said they cannot enable this for me as I am on a shared hosting account. Does that mean my clients can no longer checkout in my store? What can I do please? Thank you


texts: Hi I have installed the developed the magento 2 in the path domain.com/new folder and developed in that path. Now I want push the installed file to the public_html file without affecting the code.


texts: Magento2 - After login redirect to previous page instead of My Account page

texts:
Is there a simple way to sovel redirect url customize in Magento?

I'v searched some articles mentions "controller".

But I have no idea about custom extensions.

How to override the base controller action with a extension?


texts: Custom Block “Invalid Block Type”, even-though everything looks correct

texts:
I'm trying to write a module with a custom block that inject some javascript to the page head. no matter what I do I keep getting "invalid block type" error.

Note: I went over all the questions here about "invalid block type" and none of them worked / were relevant.

my extension files look like this:

my config file (Packname/Core/etc/config.xml):

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <Packname_Core>
      <version>0.1.0</version>
    </Packname_Core>
  </modules>

  <global>
    <blocks>
      <packname_core>
        <class>Packname_Core_Block</class>
      </packname_core>
    </blocks>
  </global>

  <frontend>
    <layout>
      <updates>
        <packname>
          <file>packname_core.xml</file>
        </packname>
      </updates>
    </layout>
  </frontend>
</config>

my layout file (design\frontend\base\default\layout\packname_core.xml):

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
                <block type="packname_core/injectjs" name="packnameJs" as="packnameJs" template="packname/injectjs.phtml" />
        </reference>
    </default>
</layout>

and my block file (Packname\Core\Block\Injectjs.php):

<?php

class Packname_Core_Block_Injectjs extends Mage_Core_Block_Template
{
    public function getPacknameJsUrl()
    {
        return Mage::helper('packname_core/config')->getJsUrl();
    }
}

now the error I'm getting looks like this:

exception 'Mage_Core_Exception' with message 'Invalid block type: Packname_Core_Block_Injectjs' in C:\Bitnami\magento-1.9.2.1-1\apps\magento\htdocs\app\Mage.php:595

the name Packname_Core_Block_Injectjs seems correct, I already double checked uppercase/lowercase issues, and I can't figure out what's wrong.. everything seem in place.

note that if I set block type to something like "core/html" I no longer get the error, but then offcourse I can't access my block functions.

any help will be greatly appreciated!
thanks,


texts: Magento2 Docker Container shutdown After Magento2 install

texts:
I have create Dockerfile for setup LEMP then add entrypoint to one script to install magento 2, while create container.

After Create Container our entry point script to call to install magento2, after install magento 2 docker container goes to shutdown. I restart the container, its not started. I check docker logs container_name . no logs throw,

my doubt, magento 2 have any restriction, to install magento 2 while create a container. or any other issue.

Note: if magento2 not installed in this container, container works fine.

Update:

DockerFile:

FROM debian:jessie

USER root

# install editor
RUN apt-get update  && apt-get install -y vim openssh-server sudo  net-tools cron curl wget tar sudo apt-utils monit supervisor git && \
     apt-get clean && apt-get update && apt-get install -y nodejs &&\
     ln -s /usr/bin/nodejs /usr/bin/node  &&\
     apt-get install -y npm  &&\
     npm update -g npm && npm install -g grunt-cli && npm install -g gulp &&\
     echo "root:test" | chpasswd &&\
     sed -i 's/prohibit-password/yes/' /etc/ssh/sshd_config &&\
     ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa &&\
     echo "StrictHostKeyChecking=no" >> /etc/ssh/ssh_config

# install nginx

RUN apt-get update && apt-get install nginx -y

# install php

RUN echo "deb http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
RUN wget https://www.dotdeb.org/dotdeb.gpg
RUN apt-key add dotdeb.gpg
RUN apt-get update && apt-get install -y \
    php7.0 \
    libapache2-mod-php7.0 \
    php7.0  \
    php7.0-common \
    php7.0-gd \
    php7.0-mysql \
    php7.0-mcrypt \
    php7.0-curl \
    php7.0-intl \
    php7.0-xsl \
    php7.0-mbstring \
    php7.0-zip \
    php7.0-bcmath \
    php7.0-iconv \
    php7.0-fpm

# nginx configuration
COPY default /etc/nginx/sites-available/default

WORKDIR /var/www/html

# install magento script
ADD start.sh /
#ADD magento.sql /
RUN chmod +x /start.sh
#RUN chmod +x /magento.sql
ENTRYPOINT ["bash", "-c"]
CMD ["/start.sh"]

start.sh file:

#!/bin/bash

# Start needed service

service nginx start  && service php7.0-fpm start

if [ ${MAGENTO_INSTALL} == "Yes" ] ; then
echo "Magento 2 already installed"
  service php7.0-fpm restart && service nginx restart && service cron restart  && service ssh restart
else

echo "Magento 2 Installation Process Start"

# ownership
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 777 /var/www/html

# Install magento 2
cd /var/www/html

echo "[+] Installing..."
install_cmd="php bin/magento setup:install \
  --db-host="${MYSQL_HOST}" \
  --db-name="${MYSQL_DATABASE}" \
  --db-user="${MYSQL_USER}" \
  --db-password="${MYSQL_PASSWORD}" \
  --backend-frontname="${BACKEND_FRONTNAME}" \
  --base-url="${BASE_URL}" \
  --language="${DEFAULT_LANGUAGE}" \
  --currency="${DEFAULT_CURRENCY}" \
  --timezone="${DEFAULT_TIMEZONE}" \
  --admin-lastname="${ADMIN_LASTNAME}" \
  --admin-firstname="${ADMIN_FIRSTNAME}" \
  --admin-email="${ADMIN_EMAIL}" \
  --admin-user="${ADMIN_USERNAME}" \
  --admin-password="${ADMIN_PASSWORD}" \
  --use-secure=0 \
  --use-rewrites=1 \
  --use-secure-admin=0 \
  --session-save=files"

eval ${install_cmd}

export MAGENTO_INSTALL="Yes"

echo "magento 2 Installation Completed"

fi

nginx Configuration:

  upstream fastcgi_backend {
   server   unix:/run/php/php7.0-fpm.sock;
}
server {
   listen 80;
   server_name 10.1.2.216;

   set $MAGE_ROOT /var/www/html;
   set $MAGE_MODE developer;

   include /var/www/html/nginx.conf.sample;
}

After create the container, start.sh to install magento2, magento 2 installation fine, after install magento2, container goes to shutdown. then start same container, its started but goes to shutdown.

note:  now, I separated mysql machine as new container its works fine.

Suggest me What error in my file or any other way to did this.


texts:
We've been running Magento Enterprise with 30 different store views all sharing the same catalog and attributes.  We're now getting ready to spin of most of the store-views into seperate installs of Magento Community Edition.

How can I take the mySQL backup from the enterprise setup and import the products, attributes, customers into a community single store-view database?


texts: Magento 2 Installation Fatal Error - Cannot instantiate interface

texts:
I have installed a fresh Magento 2.1 over the command line and always get the same fatal error when trying to access the frontend or backend.

  Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface

Anyone experienced the same? I have found some resources but with no real help.

Update
I have deleted var/di and var/generation and set it to developer mode

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface in /shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73 Stack trace: #0
/shop/build/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') #1
/shop/build/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...') #2
/shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'readerPool', 'Magento\\Framewo...') #3
/shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Develo in /shop/build/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73


texts: How to add tab in product Edit Page in Magento2?

texts:
How to add tab in product edit page in  magento2?

I refering some tutorial ...but its not woking for me...

https://webkul.com/blog/add-tab-product-page-magento-admin/

If anyone knows ,Explain me...


texts: Magento2 add new field in bundle item (in option selection)

texts:
i'am new with magento!

I want to add an image-upload-field to a bundle-product in Magento2. I need this field in the selection-items of the options of the bundle items (see the following image for better understanding):

Adding a field in the database via my own module was no problem. Now I need to add the field in the adminhtml-template and the selection-model but I don't know how. I tried to change the original files of Magento to check whether I have found the correct files to change/overwrite with my own module but the changes have no effect. I think I need to change this files:

\vendor\magento\module-bundle\view\adminhtml\templates\product\edit\bundle\option\selection.phtml
\vendor\magento\module-bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Selection.php

I don't know why my changes doesn't affect the output-form (I added something like "abc" in the phtml-template, cleared the whole magento-cache and also the browser-cache). I thought I can extend the template like in this post (but changing the selection-files instead of the option-files): https://stackoverflow.com/questions/24097689/magento-add-another-new-field-in-bundle-item

What am I doing wrong? Do I edit the wrong files?

[edit]

Ok, now i have get the field inside the BundlePanel. The files above were the wrong place to add this field. Ok fine. The right place is:

\Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel.php

Via Plugin in my own new module, i have added some new field "custom_text".

Me\HelloWorld\etc\di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel">
        <plugin name="bundle_panel_newfield" type="Me\HelloWorld\Plugin\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel" sortOrder="1"/>
    </type>
</config>

Me\HelloWorld\Plugin\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel.php

<?php
namespace Me\HelloWorld\Plugin\Bundle\Ui\DataProvider\Product\Form\Modifier;

use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
use Magento\Ui\Component\Form;

class BundlePanel
{
    public function afterModifyMeta(
        \Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel $subject,
        $meta
    ) {
        $meta['bundle-items']['children']['bundle_options']['children']['record']['children']['product_bundle_container']['children']['bundle_selections']['children']['record']['children']['custom_text'] = $this->getSelectionCustomText();

        return $meta;
    }

     /**
     * Get selection custom field structure
     *
     * @return array
     */
    protected function getSelectionCustomText()
    {
        return [
            'arguments' => [
                'data' => [
                    'config' => [
                        'componentType' => Form\Field::NAME,
                        'dataType' => Form\Element\DataType\Text::NAME,
                        'formElement' => Form\Element\Input::NAME,
                        'label' => __('Custom Text'),
                        'dataScope' => 'custom_text',
                        'sortOrder' => 120,
                    ],
                ],
            ],
        ];
    }
}

With the meta array i define and order the new field in the panel.

But now i have two new problems:

First Problem:
You can see in the image below that the plugin places the field correct before my basket image, but not the tableheader. For the th element the option sortOrder will be ignored and so the wrong columns are attached to the wrong titles. Why? Bug?

Second Problem:
After saving (database contains matching column "custom_text" in table "catalog_product_bundle_selection") the input value will not processed to the database and some manually database value will not appear in the BundlePanel. What is missing?

Thanks a lot!


texts: remove the Review step in Onepage checkout in magento

texts:
I want to remove Review step in Onepage checkout. I used url
http://www.magentocommerce.com/wiki/5_-_modules_and_development/checkout/customizing_onepage_checkout_-_remove_shipping_method?do=show

but not clear how to use to remove review step from checkout


texts: Magento 2 bin folder missing can't run any cli commands

texts:
I am working on a client's shop, and the bin folder is missing, how can that be possible? Can I recreate it with the files inside?
Its a noob question but I never faced this issue...

-rw-r--r--  1     88 Sep 29  2015 .anonymizer.cfg
-rw-rw-r--  1    3201 Mar 23 08:06 api.php
drwx--x--x  6    4096 Mar 23 08:06 app
drwx--x--x  2    4096 Aug 21  2015 cgi-bin
-rw-r--r--  1     636 Sep 13  2015 config.rb
-rw-r--r--  1      14 Sep 13  2015 contributors.txt
-rw-rw-r--  1    2928 Mar 23 08:06 cron.php
-rw-rw-r--  1    1621 Mar 23 08:06 cron.sh
drwx--x--x  2    4096 Dec 21  2015 data
-rw-rw-r--  1       3 Mar 23 08:06 deleteme.txt
drwx--x--x  2    4096 Sep  8  2015 deploy
drwxrwxr-x  3    4096 Mar 23 08:06 dev
drwx--x--x  3    4096 Oct 22  2015 dev.bak
drwx--x--x  5    4096 Aug 19  2016 downloader.bak
drwx--x--x  2    4096 Sep 13  2015 .ebextensions
drwx--x--x  3    4096 Mar 23 08:06 errors
-rw-rw-r--  1    1150 Jan 10  2017 favicon.ico
-rw-rw-r--  1    5952 Mar 23 08:06 get.php
drwx--x--x  7    4096 Apr 27 10:51 .git
-rwxrwxr-x  1     830 Feb 26  2018 .gitignore
-rw-rw-r--  1      53 Aug 15  2017 google162ffb936c709b25.html
-rw-rw-rw-  1  670813 Sep 19 23:05 GoogleShopping_full.xml
-rw-rw-rw-  1   90829 Sep 20 00:00 GoogleShopping_inventory.xml
-rw-------  1      31 Sep 13  2015 heartbeat.php
-rw-rw-r--  1    6986 Mar 23 08:06 .htaccess
-rw-rw-r--  1    5886 Jan 10  2017 .htaccess.sample
drwx--x--x  2    4096 Mar 23 08:06 includes
-rw-rw-r--  1    2596 Mar 23 08:06 index.php
-rw-rw-r--  1    2305 Mar 23 08:06 index.php.sample
-rw-rw-r--  1    6442 Mar 23 08:06 install.php
drwx--x--x 22    4096 Mar 23 08:06 js
drwx--x--x 28    4096 Dec  1  2017 lib
-rw-rw-r--  1   10421 Jan 10  2017 LICENSE_AFL.txt
-rw-rw-r--  1   10679 Jan 10  2017 LICENSE.html
-rw-rw-r--  1   10410 Jan 10  2017 LICENSE.txt
drwx--x--x  2    4096 Sep 13  2015 log
-rw-rw-r--  1    2222 Mar 23 08:06 mage
-rwxrwxr-x  1    4970 Mar 23  2017 magebirdpopup.php
drws--s--x 20    4096 Mar 21  2018 media
-rw-r--r--  1   1438 Aug 29  2015 php_errorlog
-rw-rw-r--  1     886 Jan 10  2017 php.ini.sample
drwx--x--x  4    4096 Oct 29  2015 pkginfo
-rwxrwxr-x  1    363 Dec  1  2017 po_compressor.xml
-rwxrwxr-x  1   1300 Dec  1  2017 po_core_new_question_to_support.html
-rwxrwxr-x  1    2889 Dec  1  2017 Potato_Compressor.csv
-rwxrwxr-x  1    2215 Dec  1  2017 Potato_Core.csv
-rwxrwxr-x  1    1501 Dec  1  2017 Potato_ImageOptimization.csv
-rw-rw-r--  1  599428 Mar 23 08:06 RELEASE_NOTES.txt
drwx------  3    4096 Sep 30  2015 scripts
-rw-r--r--  1     228 Sep 13  2015 .scss-lint.yml
drwx--x--x  2    4096 Mar 23 08:06 shell
-rw-rw-rw-  1   30988 Sep 19 23:05 sitemap.xml
drwx--x--x  5    4096 Oct 29  2015 skin
drwx--x--x  2    4096 Sep 21  2015 stage
drwsrwsrwx 13    4096 Aug  9  2017 var
drwxr-xr-x  3       4096 Aug 16  2017 .well-known


texts: Export database through mysqldump, or Magento admin?

texts:
I was looking at this doc:

http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/restoring_a_backup_of_a_magento_database

which says to add a few lines to your dump file or the lines will be included from a database export through the admin.

I just ran one version through the admin, and one version as a mysqldump file, and both of them contain the lines:

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

Is this the correct, expected output? I haven't had any issues importing the database, but want to make sure the auto increments will increase normally (for invoice ids specifically)


texts: Magento 2 Tablet view hamburger menu alignment issue

texts:
Up to width :767px showing hamburger menu, when it reached to 768px (Tablet view) showing web view menu, how to set with 768px showing my hamburger menu?
Note : I am using custom theme inherit from Default blank theme.


texts: How to use session in dependency injection with parent construct?

texts:
Below error is showing when I tried to run with MEQP2 sniff.

Code:

class History extends \Magento\Sales\Block\Order\History
{
    /**
     * @param \Magento\Framework\View\Element\Template\Context $context
     * @param \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory
     * @param \Magento\Customer\Model\Session $customerSession
     * @param \Magento\Sales\Model\Order\Config $orderConfig
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Sales\Model\Order\Config $orderConfig
        array $data = []
    ) {
        parent::__construct($context, $orderCollectionFactory, $customerSession, $orderConfig, $data);
    }
}

How to pass session object in to constructor and parent constructor ?


texts: How to display swatch on cart page for added products in cart. Right now it shows as Text, like Color Blue, but it should show like swatch icon.


texts:
Before marking as duplicate go through once

I'm facing issue with overriding module-sales/view/frontend/templates/email/shipment/track.phtml

I'm using Magento 2.3.3

Answer is here but its not working. Overriding track.phtml in Magento2

I can able to override within my theme but I want some customization I would like to override with module.

I tried below:

  Vendor_Module/view'frontend/layout/sales_email_order_shipment_track.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="sales_email_order_shipment_renderers"/>
    <body>
        <block class="Magento\Framework\View\Element\Template" name="sales.order.email.shipment.track" template="Vendor_Module::email/shipment/track.phtml">
            <arguments>
                <argument name="tracking_url" xsi:type="object">Magento\Sales\Block\DataProviders\Email\Shipment\TrackingUrl</argument>
            </arguments>
        </block>
    </body>
</page>

I tried wrapping block within referenceContainer='content' but still not working.

UPDATE

Make sure you check send email copy to customer while generating shipment.

NO solution worked for me provided in comments. Any other solutions ?

But doesn't seems to work for me. Any ideas ?


texts: get() in CustomerRepository doesn't receive $customer from retrieveByEmail() for password reset

texts:
I've got the weirdest problem I've ever come across, I'm not brilliant with class based systems so maybe its not magento related...
So the basics are that the reset password function isn't working. I've narrowed it down to $customer not being received from a function that is definitely returning it.
resetPassword() in \vendor\magento\module-customer\Model\AccountManagement.php

gets the $customer from
get() in \vendor\magento\module-customer\Model\ResourceModel\CustomerRepository.php

which gets the $customer from retrieveByEmail() in
\vendor\magento\module-customer\Model\CustomerRegistry.php

so retrieveByEmail() definitely gets the customer, but get() doesn't ever receive it.
I've tested it by swapping retrieveByEmail() to just retrieve() with a single customerID and it works ( up to the next problem which is save($customer) but thats for another day.
I just can't figure out why retrieveByEmail() returns a $customer object but get() doesn't receive it?
any ideas?
edit
thanks @Kristoffer, I have checked the storeID is the correct store and retrieveByEmail is sending back the same customerID 67 that I tested with retrieve(67).
I can't see how or why get() isn't receiving the customer that retrieveByEmail is sending, but it is receiving that from retrieve()


texts: Where I find code for inserting in catalog_product_index_price table?

texts: I want to find code that helps inserting in magento catalog_product_index_price table. How can I find it or where?


texts: Create new tabs search results and find customer in magento 2

texts:
I created a tab in search results like this.

The problem is that when I click on the "B" tab it will find what I want to find, ex as customer. Please help me create it step by step. I think i should


texts: Magento 2 : How to get Additional Information in payment info for custom payment method?

texts:
I have created custom payment module. Under that module i have display three additional information field.

How to get that additional data from frontend to backend?


texts: Accidently Delete Some Index Databese Tables

texts: My magento version is 1.9.3.7. Today I try to clean my database. And I accidently truncate catalog_product_index_price and catalog_product_index_eav tables. I always have backup but only in this database backup broken. Now in backend I can see all products but no price,no name,no attributes.


texts: How to update product image based on product name using script. Magento 1.9.2

texts:
I want to update the image of one category shoes .In this category there are 10000 products , I want to update the image of those products only  which have nike brand in their name , using script.

can any one help to write this script.

    <?php

require_once '../app/Mage.php';

Mage::app();
Mage::setIsDeveloperMode(true);

ini_set('display_errors', 1);

    $needle = 'divya';

 $collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*') // select all attributes
->setPageSize(5000) // limit number of results returned
->setCurPage(1); // set the offset (useful for pagination)
 $xProd=$collection->addAttributeToFilter('name', array(
    array('like' => '% '.$needle.' %'),
    array('like' => '% '.$needle),
    array('like' => $needle.' %')
));

// we iterate through the list of products to get attribute values
foreach ($xProd as $product) {
  echo "
Product Name :: ".$product->getName(); //get name

        $images = array(
            'thumbnail'   => 'newimg.png',
            'small_image' => 'newimg.png',
            'image'       => 'newimg.png',
        );

        $dir = Mage::getBaseDir('media') . DS . 'replaceimg/';

        foreach ($images as $imageType => $imageFileName) {

          echo "
".$path = $dir . $imageFileName;
            if (file_exists($path)) {
                try {

                    $product->addImageToMediaGallery($path, $imageType, false);
                } catch (Exception $e) {
                    echo $e->getMessage();
                }
            } else {
                echo "Can not find image by path: `{$path}`
";
            }
        }
}

UPDATE 1.

Above script gives me the desired products but image is not replacing, and no error is thrown.


texts: Recently, I have about 10 new orders that have an id and orderid but can't find them in the sales order grid

texts: I have the time of checkout and the amount as well as shipping_first_name and shipping_last_name. The thing is the status is abandoned and the response is "failed" like their CC didn't process correctly. Why would magento create an increment id if the transaction didn't go through? I've looked in admin and can't find anything. Additionally, i've looked in the sales_order table to no avail. Is there another table that stores this information, failed sales?


texts: How can i add custom text block into cart summary?


texts: Magento2: How to add tracking url in shipment email for customer in magento 2

texts: When I ship any order with ups label and add the tracking number. it shows Track Order in the backend. I want to send this URL to customer email also. Currently, it sends the tracking number and shipment method only.


texts: magento2: PHP Extension sockets rediness check error

texts: How to fix PHP Extension sockets readiness check error in magento 2.3.4.


texts: Indexing issue - keep reverting to manual

texts:
With our Magento version 1.9.1.0 we are having an issue where indexing reverts back to manual as can be seen here

We set the mode to 'Update on Save' and do indexing via command line and it all shows green, but after sometime it some indexes reverts back to 'Manual'. Not sure what the issue could be?


texts: How to get the allowed currency names (NOT CURRENCY CODE) for a store

texts:
I want to get the list of allowed currency names for a store.
Please note that, I know how to get the allowed currency codes, but all I want is , it's name.
For example, Indian Rupee, US Dollar etc.

Please suggest some code without using the Object Manager concept.


texts: Should i use tinymce or tinyMCE in magento 2.3 and also usage for backward compatible

texts:
From magento 2.3 i see core team integrated new version of tinymce. It's a good thing. Maybe future they will add more editor for magento.

But i have a confuse a bit when to use wysiwyg through below 2.3 version

I found this export in module Magento_Tinymce3

var config = {
shim: {
    'Magento_Tinymce3/tiny_mce/tiny_mce_src': {
        'exports': 'tinymce'
    }
},
map: {
    '*': {
        'tinymceDeprecated': 'Magento_Tinymce3/tiny_mce/tiny_mce_src'
    }
}
};

This use tinyme maybe exists in below 2.3. Some files still use this

and this export in Magento_Ui

var config = {
shim: {
    'tiny_mce_4/tinymce.min': {
        exports: 'tinyMCE'
    }
},
paths: {
    'ui/template': 'Magento_Ui/templates'
},
map: {
    '*': {
        --Omit some lines--
        tinymce4:       'tiny_mce_4/tinymce.min',
        wysiwygAdapter: 'mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter'
    }
}
};

I know magento have implemented dynamic mechanism to load tinymce with config version through backend

Currently things i know is always use
'wysiwygAdapter' for load tinymce instead old way require tinymce


texts: What are getResponse, getRequest functions? (Bonus: explanation of getUrl)

texts:
I don't understand getResponse and getRequest functions of the Mage_Core_Controller_Varien_Action class.

EDIT:

See below an explanation of getUrl function!

Thanks!


texts: Magento 1.9.3.x core issues and possible fixes?

texts:
Magento 1.9.3.7

This is not a real question, just a compilation of known bugs in the latest Magento version.

I would like to have a complete list of known bugs, so that they can be fixed in Magento-LTS, if not by Magento itself.

Some I found here....

Default configuration value for serialized_array settings is ignored (since 1.9.3.0)
Magento customer reset password customer_flowpassword error (since 1.9.3.0)
Problem with Data URIs and CSS File Merge (since 1.7.0.0)
Undefined variable: freePackageValue in Tablerate.php on line 130 (since 1.8.0.0)
Customer VS persistent/customer templates (since 1.6.0.0)
Magento 1 is not showing Dataflow Profile History (since ...)
Session validation failure in Magento 1 EE v 1.14.3.x (and CE 1.9.3.x)  (since 1.9.3.0)
Replace special characters (german umlauts) (since 1.1.1)
...

I know there's a lot more, but I don't have them all on the screen. Therefore, please link contributions to real bugs here.

FYI: Magento-LTS is a community driven fork which accepts bugfixes and improvements (in some cases). The project is managed by some AoE people and some well-known names. It is not bloated with features that can be covered by extensions, but mainly refers to core bugs. In my opinion, the better alternative to the official version.

I use it myself and would like to fix as many bugs as possible. It would be nice if you linked known problems here.

FYI2: a small overview of what has already been fixed can be found here: CHANGELOG (not quite up-to-date)


texts: Magento 1.8 not recognizing forward slash after base_url (was working)

texts:
I have posted this to stackexchange.com as well, before noticing that in the details of the forums not accepting new questions

I have noticed the issue when the CSS appeared to be broken. Heres what I have done:

1.) view source and noticed that forward slash "/" isn't being inserted after the URL

<link rel="stylesheet" type="text/css" href="http://myfantasygifts.comjs/mt/extensions/jquery/plugins/flexslider/flexslider.css" />

2.) also have checked phpmyadmin to be sure nothing has changed in the core_config_data table

3.) cleared out the contents within var/cache as well as var/session

4.) Logged into admin panel and reindexed Catalog URL Rewrites, this was a pain considering every click I had to manually add the forward slash after the domain.

5.) Changed permissions back to what magento requires
resetting_file_permissions

6.) Checked all .htaccess files for url rewrite issue

7.) Cleared browser cache and tried in Google Chrome and Safari

I know that this has been posted numerous times and have tried numerous solutions that none of which seem to work so far. Any additional help will be greatly appreciated! And final, a huge Thank You in advance :)


texts: Magento 2: How to display a grid inside the customer edit tab using ui component?

texts: Display a form and grid using ui-component inside customer edit tab on Magento2.


texts: how to override any .phtml or class file in magento2 using custom module?

texts:
Well I have an idea to create custom module in magento2 but when it comes to override code functionality I stucks.

for example I have to override this file default.phtml in

/vendor/magento/module-sales/view/frontend/templates/email/items/order

to gain functionality like product thumbnail and product url in order confirmation mail so how to achieve this.

I have done this in core files which I want to do using overriding. I am confused on overriding .phtml file, and class file so how to achieve this?


texts: How do you configure Grunt to extend magento blank styles?

texts:
I'm trying to setup Grunt with Magento 2.4. But I'm unsure of how to setup the .less files.
I've created a theme that is based on the magento blank theme. In my web/css directory I have:
web/css/source
web/css/styles-l.less
web/css/styles-m.less

Below is my Grunt config:
dev/tools/grunt/configs/local-themes.js
'use strict';

module.exports = {
  dropzone: {
    area: 'frontend',
    name: 'JKS/DropZone2020',
    locale: 'en_US',
    files: [
      'css/styles-m',
      'css/styles-l'
    ],
    dsl: 'less'
  }
}

When I run gulp exec:dropzone I get the following error:
>> Verify entered values of the argument and options. Unable to resolve the so
>> urce file for 'frontend/JKS/DropZone2020/en_US/css/styles-m.less'

What does this mean exactly? Why is it looking in en_US for styles-m? Does this mean I have to build styles for each locale including en_US and en_GB?
Bit confused.


texts: Sub category pictures into main category main content area

texts:
Hi Im building my first Magento store and I have come across the thumbnail in the category section problem.

http://hotelsuppliesstore.com/index.php/bathroom.html

Is the site I'm building I can seem to get the category pictures displaying on the content area.

This is what our other site looks like just to give you an idea on what I'm trying to achieve.

http://www.mellcrest.com/Bathroom__c-p-0-0-19.aspx

Im not too coding savvy so if you could make it in idiots terms that would be great.

Many Thanks

Garry


texts: Restrict Order Grid to Specific Status for User

texts:
How would I restrict access to only show completed orders in the admin for one user or role?  This employee only needs to see new pending orders, and I don't want this employee to be able to look back through the history of old completed orders.  Whenever there is an issue with an order, her supervisor handles it.

Right now she can export the entire order history, because I want her to be able to export pending orders.  Ideally I would prevent her from even looking up old orders, but at a minimum I just want to restrict what's shown in the order grid to make it difficult for her to see completed orders. Thanks.


texts: Magento 2- How I can change my blocks and theme to RTL when change To Arabic Store?

texts:
I have Magento theme with a two-store views English and Arabic the default theme is working great for the English view but for the Arabic view I want to change all the layout to be RTL.

What is the best way to do that?


texts: What is the best way to check if an EAV attribute exists in Magento?

texts:
Who would know how to check if an attribute exists in magento before adding options to it?

Thanks a lot!


texts: Show a tick/message over a bundled product when the product is already in the cart

texts:
I am showing custom products on the product page using this code:

<?php
    $bundle_products = $_product->getbundle_products();
    if ($_product->getAttributeText('bundle') == yes):
    $product_ids = explode(',',$bundle_products);
    $collection = Mage::getModel('catalog/product')
        ->getCollection()
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('entity_id', array('in' => $product_ids));

    foreach($collection as $eachproduct){
        echo 'getProductUrl() . '">getImageUrl() . '" title="' . $eachproduct->getName() . '" height="50" width="50">';
        $combined_price += $eachproduct->getFinalPrice()/100*$_product->getamos_bundle_discount();
    }
    endif;
?>

This works perfectly but what I want is to get cart information and if the bundle product is already in the cart it will have a tick overlay/message beside it. I can sort the design out later.


texts: Magento 2 - List of Order States and Statuses

texts:
I looked for a way to create an option list of order states and statuses but couldn't find a way. I did found something about a statusfactory but couldn't find a way to get a list out of it and especially of the states.

I need a list of available states and a list of available statuses. Can someone help me or point me in the right direction?


texts: "Place Order" button not working - no error - no request

texts:
I have a clean Magento 2.3.4 setup.
When checking out with a product in the basket, nothing happens when I click on the "Place Order" button. No error is displayed, no console.log, no XHR request fired.

Does anyone have a hint how to debug or solve this?

You can test it here:
https://clean.steelman24-dev.powered-by-rackspeed.de/


texts:
So I basically got my own whole css layout and I want to change the layout of my magento frontend. I've looked into this post: https://stackoverflow.com/questions/17050668/how-to-apply-css-to-magento-cms-page but it's not loading my css in. I did this:

I added to Custom Layout Update XML:

<reference name="head">
<action method="addCss"></action>
</reference>

and in my html editor I got this:

&nbsp;

&nbsp;

Css just in case:

.header{
width:80%;
margin-left:10%;
height:15%;

/*border-radius:12px; */
background-color:white;
}

.header_2{
width:80%;
margin-left:10%;
height:5%;
background-color:grey;
font-size:200%;
}

My style.css is in this directory:/skin/frontend/default/csstest I also tried to put it in: skin/frontend/default/default/css

Am I forgetting something?


texts: My css mucks up when i add a grouped product

texts:
I have a one grouped product called called hats, this has about 5 different hats in and work perfectly fine. When i make a second grouped product called shoes and add in products this then mucks up all my CSS for product list pages and also doesn't display my left-col on my search returns page. So i thought i set it up wrong, so i duplicated my hats product and just changed the name, the SKU and also the products. The same happened. So i deleted the duplicated product and tried it again this time checking the item every time i changes something. When i changed the name and SKU the CSS was fine and everything worked perfect. However when i change the items everything went wrong. I have absolutely no idea why this is happening or what is happening. Has anyone else had this problem or knows of this problem.

Sorry for being so vague but i really do not know what is going on here. if you do not like the post please don't just down vote me just write a comment and i will either try to clear it up for you or if this isn't the correct place to ask this question let me know and i will delete it.

Thank you


texts:
I have a problem with my program connecting with magento api. it doesnt connect with https.

i was thinking maybe i could use htaccess redirect to force to use http.

does it make sense?

i was trying something like that but didnt work

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/index.php/api/v2_soap
RewriteCond %{QUERY_STRING} !^api/$1
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

I have rally big problem with that. Please help.

Kuba


texts: Magento getting warning in log file after removing plugin

texts:
I have removed the one step checkout plugin from my store completely but I am still getting warning

include(Idev/OneStepCheckout/Model/Sales/Quote.php): failed to open stream: No such file or directory  in lib/Varien/Autoload.php on line 93

in log file. Do I need to remove any other setting from table core_config_Data? or I am missing anything.


texts: Solved: Magento 2 move productpage title around div

texts:
I want to move the product page title around a container div.
I added the following to my catalog_product_view.xml file, but that does not add the div with class container.

What am I missing?

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="page.main.title">
            <container name="productpage.title" htmlTag="div" htmlClass="container" />
        </referenceContainer>
        <move element="page.main.title" destination="page.wrapper" before="main.content"/>
    </body>
</page>

Solution is:

<referenceBlock name="page.main.title">
            <arguments>
                <argument name="css_class" xsi:type="string">container</argument>
            </arguments>
</referenceBlock>


texts:
We need to show the payment method based on stores. We have 4 type of payment methods(ICICI,HDFC, Paypal,Authorize.net ).
Our client request to show payment based on stores (Store1,Store2). We also checked in admin panel, there is only set country based payment method.
We need show the payment method of stor1 is ICICI and HDFC.
And Stor2 is Paypal and Authorize.net.
How to  do this?


texts: How to disable dates in Datepicker in Magento 2?

texts:
Using below I added the datepicker. I'm trying to disable the date smaller than what input field specifies but it enables picking any date older than input value.

    <script>
        require([
            "jquery",
            "mage/calendar"
        ], function ($) {
            $(document).ready(function () {
                     //Input format --> 02.11.2017
                var str = $("#fix_time").val().split(".");
                var toDate = new Date(str[2], str[1] - 1, str[0]);
                $('#fix_time').datepicker('setDate', toDate);

                $('#fix_time').datepicker({
                    prevText: '&#x3c;zurück', prevStatus: '',
                    prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: '',
                    nextText: 'Vor&#x3e;', nextStatus: '',
                    nextJumpText: '&#x3e;&#x3e;', nextJumpStatus: '',
                    monthNames: ['Jan','Feb','Mar','Apr','May','Jun',
                        'Jul','Aug','Sep','Oct','Nov','Dec'],
                    dayNames: ['Sun','Mon','Teu','Wed','Thu','Fri','Sat'],
                    showMonthAfterYear: false,
                    dateFormat:'dd.mm.yy'
                });

});
    });
</script>

Thanks.!


texts:
I have a store set up on the Uk with the following 3 tax classes 20%, 5%,0%

I have set the tax rule for the uk

I have set the Shipping settings for the Origin as UK

On the shopping cart I have set the prices so that they show as Ex VAT on the catalogue process and also set the same for the shopping cart. The Shopping cart total I want to show the included tax price

On the shopping cart I select the UK. On the tax after the subtotal it has calculated the wrong amount as the correct tax amount should be (£100+20%= £120) I used this tax calculator to check what the correct tax should be as this calculator shows
http://www.vatcalculator.co.uk/


texts: Display products of particular catagory in magento 2 cms page

texts: How to display products of a particular category on cms page.


texts: Magento 2, When qoute calculate subtotal?

texts:
Using magento 2.2, API. I created a web service for add multi-product in to cart, but not calculate subtotal. Help please!

CODE

/**
 *
 * {@inheritdoc}
 */
public function addMultiItemToCart($email, $storeId, $items)
{
    try {
        // Init store information
        $store = $this->storeFactory->create()->load($storeId);
        $websiteId = $this->_storeManager->getStore()->getWebsiteId();

        // init cutomer information
        $customer = $this->customerFactory->create();
        $customer->setWebsiteId($websiteId);
        $customer->loadByEmail($email); // load customet by email address

        // Create Quote
        $quote = $this->quote->create(); // Create object of quote
        $quote->setStore($store); // set store for which you create quote

        // if you have allready buyer id then you can load customer directly
        $customer = $this->customerRepository->getById($customer->getEntityId());
        $quote->setCurrency();
        $quote->setSubtotal(0);
        $quote->assignCustomer($customer); // Assign quote to customer

        // Add items in quote
        $validItem = array();
        foreach ($items as $item) {
            $product = $this->_productFactory->create()->load($item->getId());
            $quote->addProduct($product, intval($item['qty']));
        }

        $quote->save();
        $items = $quote->getAllItems();
        return $items;
    } catch (\Exception $e) {
        return [
            "MESSAGE" => "Add multi item to cart",
            "ERROR" => $e
        ];
    }
}


texts:
I have added custom order status using the data patch by reference to the below link.
Add new Order Statuses to Magento 2.3 using declarative scheme approach
Now I want to delete that custom order status. How can I delete it?


texts: Remove store level value for category attribute

texts: On our shop we have a customer category attribute that has been set against each store. Now we want to remove the store level values and replace it with one global level. Now I know how to do this via the admin but is there a way of sorting this via a setup script.


texts: Price difference between category view page and product view page

texts:
I am trying to update my product prices against each store. When I do that, it shows me correct price on product view page and incorrect price on category view page. And some times it shows prices in regular price and special price form on category view page but it always shows correct price on product view page.
How to remove incorrect prices? Here is my code. Thank You

$prod = Mage::getModel('catalog/product')
                ->setStoreId($storeId)
                ->load($prodId);
$prod->setPrice($newPrice)->getResource()->saveAttribute($prod, 'price');
$prod->setSpecialPrice('')->getResource()->saveAttribute($prod, 'special_price');
$prod->setSpecialFromDate('')->getResource()->saveAttribute($prod, 'special_from_date');
$prod->setSpecialToDate('')->getResource()->saveAttribute($prod, 'special_to_date');

Screen shots:


texts: A product with multiple variations, but not grouped product

texts:
I need to show a product with multiple variations, but not to be sell as a grouped product.
The variations must be sell individually.
To understand, i need to copy this configuration:

https://www.mobiltecnica.com/it/punte-ad-attacco-rapido-per-foratrici-in-hw-micrograna_3_1


texts: Promotions and Discounts are not applied in custom shipping method (module)

texts:
I created a module that calculates the delivery price according to the price of the item and it works well. However promotions (Example: Free Shipping by categories or number of items) and discounts are not applied in my custom shipping method (module).

How can I make the promotions are applied in my custom shipping method?

PS: The promotions are active and work in other shipping methods default.

This is my Model Class:

class Workspace_Transportadora_Model_Carrier_Transportadoracode
    extends Mage_Shipping_Model_Carrier_Abstract
    implements Mage_Shipping_Model_Carrier_Interface
{
    protected $_code = 'transportadoracode';

    /**
    * Collect rates for this shipping method based on information in $request
    *
    * @param Mage_Shipping_Model_Rate_Request $data
    * @return Mage_Shipping_Model_Rate_Result
    */
    public function collectRates(Mage_Shipping_Model_Rate_Request $request){
        if(!Mage::getStoreConfig('carriers/transportadoracode/active')) {
            return false;
        }

        $result = Mage::getModel('shipping/rate_result');

        $shippingPrice = $this->resultadoValor();

        $method = Mage::getModel('shipping/rate_result_method');
        $method->setCarrier($this->_code);
        $method->setCarrierTitle($this->getConfigData('title'));
        $method->setMethod($this->_code);

        $dias = Mage::registry('prazoentrega');
        $method->setMethodTitle($this->getConfigData('name') . ' - Em média '. ($dias ? $dias : $this->getConfigData('diasoff')) .' dias' );
        $method->setPrice($shippingPrice);
        $method->setCost($shippingPrice);
        $result->append($method);

        return $result;
    }

    /**
     * Get allowed shipping methods
     *
     * @return array
     */
    public function getAllowedMethods()
    {
        return array($this->_code=>$this->getConfigData('name'));
    }

    protected function resultadoValor()
    {
        return (($this->getConfigData('porcent')/100) * $this->geraValor()) + $this->getConfigData('adicional');
    }

    protected function geraValor()
    {
        $totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
        $subtotal = $totals["subtotal"]->getValue();

        return $subtotal;
    }
}


texts: What is different between Magento 2.3.5-p1 and 2.3.5 version?

texts: I upgraded Magento 2.3.4 to 2.3.5. But Magento site https://magento.com/tech-resources/download is available version 2.3.5-p1? Something different with versions 2.3.5 and 2.3.5-p1? I want to know that is there any difference between both versions which one I need to update on the store ?


texts: Magento2, remove gift options from cart page

texts:
I made below in my theme, but new xml does not remove the git option block.

/app/design/frontend/Mytheme/themename/Magento_GiftMessage/Magento_GiftMessage/view/frontend/layout/checkout_cart_item_renderers.xml

and

/app/design/frontend/Mytheme/themename/Magento_GiftMessage/Magento_GiftMessage/view/frontend/layout/checkout_cart_index.xml

the xml is:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.cart.order.actions.gift_options" remove="true"/>
    </body>
</page>


texts: Set the checkbox value to checked by default for super product attribute configuration

texts:
I would like when we create a new configurable product the checkbox is checked by default

But, I've found in the .phtml

<input id="__id___label_use_default" type="checkbox" value="1" " checked="use_default" class="attribute-use-default-label">

I would like know where is defined the value use_default?

Thanks, for your help.


texts: Product price is updated with Javascript half down

texts:
I have a strange problem. I have a product with the price 81.50, the tax is 19%, so the regular price is 96.985. In PHP I use rounding with half up. The price on product page is 96.99 which is corect, but when the page finishes loading the price is updated to 96.98. What could be the problem?

Is there a function JS which updates the rounded price on page?

Update 1

The problem is present only for products with custom options (ex: color), even if it has just one option and the price for it is 0.00.


texts: Magento 2.3.1 override view.xsd Using Plugin Not working before 2.3.1 it's Working

texts:
I am trying to override view.xsd using Plugin and it's working on magento 2.1.x and 2.2.x but not working in 2.3.1.

I Add Same code To describe Here.

Extending the complexType named "imageType" with a custom image type


texts: Resolved - Magento Custom Module Grid Redirects to 404 - What am I doing wrong?

texts:
I'm new to Magento. Have developed a custom module which enables to comment on products on product view page.
Now I need to create a grid on the backend and display those comments there.
I used this article for the grid part, except that my database table has more fields.

I created files according to the article for the grid

Here is the layout file .....\app\design\adminhtml\default\default\layout\adminproductcomments.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <adminhtml_productcomments_index>
        <reference name="content">
            <block type="cpstest_productcomments/adminhtml_productcomments" name="cpstest_productcomments_productcomments" />
        </reference>
    </adminhtml_productcomments_index>
</layout>


texts:
I have got complaints from few customers that some are not able to checkout on AOL browsers and they are redirected back to cart page with "empty cart" message.

  Cookie Lifetime   3600  Cookie Path   Cookie Domain  Use
  HTTP Only yes Cookie Restriction Mode    NO Session Validation
  Settings no Validate REMOTE_ADDR no Validate HTTP_VIA
  no Validate HTTP_X_FORWARDED_FOR no Validate
  HTTP_USER_AGENT   no Use SID on Frontend      yes

After reading articles and post on forums I changed above settings to

  Cookie Lifetime   84600  Cookie Path  Cookie Domain  Use
  HTTP Only yes Cookie Restriction Mode    NO Session Validation
  Settings no Validate REMOTE_ADDR no Validate HTTP_VIA
  no Validate HTTP_X_FORWARDED_FOR no Validate
  HTTP_USER_AGENT   yes Use SID on Frontend      no

After this, I am not able to browse my site on AOL and every link redirects me to home page.
For now I have reverted back to my original seetings.
Did anyone face this type of issue?
What is the cause of it and how can I fix the issue "redirected back to cart page with "empty cart" message"?
Any help will be appreciated.


texts:
I want to redirect to specific page.

I have created one script for testing but its not working. I am unable to redirect to another website url.

try {
    require_once __DIR__ . '/app/bootstrap.php';

} catch (\Exception $e) {
    echo 'Autoload error: ' . $e->getMessage();
    exit(1);
}

    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
    $objectManager = $bootstrap->getObjectManager();
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $redirect = $objectManager->get('\Magento\Framework\App\Response\Http');
    $redirect->setRedirect('http://google.in/');

Let me know how can i achieve it.


texts: Magento2 - ProductRepository how to catch Exception if sku does not exist

texts:
I am writing a console command to update catalog stock, but I am facing some weird issue when trying to load products by sku. I am using this code...

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productRepo = $objectManager->create('Magento\Catalog\Model\ProductRepository');

And then, after getting $sku from a csv read function...

try {
    $product = $productRepo->get($sku);
} catch (Exception $e){
    $product = false;
}
echo "1"; exit;

I have placed that echo "1"; just to check but that "1" is never reached... result is always [Magento\Framework\Exception\NoSuchEntityException] Requested product doesn't exist

So, how can I catch that Exception?


texts:
$.widget is not a function when loading a homepage after add custom jQuery on custom theme.

I have define my custom jQuery javascript library on my theme header under

Magento_Theme/layout/default_head_blocks.xml

The js error message

  $.wedget is not a function

which occur when loading homepage sometime ....[not 100% occur].

Is about js definition location problem? please help.

For example one of my jQuery source code:

jQuery(window).scroll(function(){
  var sticky = jQuery('.page-header'),
      scroll = jQuery(window).scrollTop();
  if (scroll >= 30) sticky.addClass('fixed'), jQuery('.panel.header').hide(),jQuery('.page-header').css('border-bottom','1px solid #efefef');
  else sticky.removeClass('fixed'),jQuery('.panel.header').show(),jQuery('.page-header').css('border-bottom','none');
});


texts:
I'm trying to use an unset magic method to delete a row from the table.

Following is the line of code from execute method of my CLI command.

$item->unsEquipmentName($input->getArgument(self::INPUT_KEY_NAME));

What do I need to add more to get this command working.

The command is registered properly when I check it in the command list and it executes on bash with no error however nothing changes in the database.

How should I close my execute method?


texts:
I want to implement customer login using OTP (one time password functionality). Customer should receive sms with code on phone whenever they login, which they fill on magento to login.

Some suggestions please.


texts:
When I try to execute a command, I will encounter the following error by commandline

mmap() failed: [12] Cannot allocate memory


texts:
I have facing problem about manual indexing from cli and my command php indexer.php reindexall will take 3 to 4 day to compelete the indexing.

Here is some states of current catalog.

  Number of stores 4
  Number of categories 300+
  Number of product 40000+
  Number of attributes per product 200+
  Visible attribute on porduct page 150+ (create flat table about 300+ columns)

I'm importing products about every weekend about 4000+ products using mamgi tool. Every thing working fine except indexing.

Is there any other way to improve and speed up the indexing.

Thanks in advance


texts: How to Remove a Tab from showing on Product views?? (Magento 1.9)

texts:
Currently, our product pages are appearing with a size guide tab that we do not want to show,

[

I need to know what I can do to stop this tab from showing?

Where would the location of the code that makes this tab appear be?

Where are the tabs declared??


texts: No old orders, invoices, shipments, etc after Magento upgrade

texts:
I've updated my old 1.4.0 Magento to the recent version 1.9.0.1.

But after the update I noticed that there are no orders, invoices, shipments and actually no data related with old sales!

I bought a test product and I can see only 1 this order, no more.

What's wrong with that? (My custom modules/templates are currently off).


texts: Magento 2.2.3 - Customizable Product Options Display in Cart But Not on Sales Order

texts: When ordering a product and selecting its customizable product options, these product options appear in the cart/checkout. After placing the order, the customizable product options do not appear on the sales order nor the sales order email sent to the customer. If anyone has faced this issue or can give me insight on how to fix this issue that would be awesome. Thank you.


texts: Magento-2 : How to access specific categories and its all products URL for specific customer after logged in

texts:
I am working on a custom module, I implement functionality if the customer is logged in then he/she only access allowed categories and its products.

I have categories data as per specific customer. currently, the customer only accesses its categories menu but if access directly from URL, I am not able to put the restriction for it.

If he/she directly access other categories and its products using URL then he/she redirect to 404 page or can't access categories and its products URL.


texts: Magento fatal error in frondend and admin both?

texts:
PHP Fatal error:

Class 'Eecom_CustomerGroupsPrice_Model_Mysql4_Setup' not found in /html/includes/src/Mage_Core_Model_Resource_Setup.php on line 234

Frontned and  Admin both are not working. How can I overcome this issue.


texts:
How to add Exchange price for product. If someone want to Exchange their product, we want to provide him different price.

How to solve this issue.

Is any extension for this?

Please help!


texts: Magento - Unable to set order of collection

texts:
This doesn't seem to be ordered correctly, anything I'm doing wrong?  Suggestions?

$componentQuantityCollection = Mage::getModel('catalog/product')->getCollection();
$componentQuantityCollection->joinField('qty',
    'cataloginventory/stock_item',
    'qty',
    'product_id=entity_id',
    '{{table}}.stock_id=1',
    'left');
$componentQuantityCollection->addAttributeToFilter('sku', array('in' => $componentSkus))->setOrder('sku','ASC');

Another collection that doesn't seem to be sorted which is different than the first:

$kitCollection = Mage::getModel('kitinventory/kitinventory')->getCollection()->addFieldToFilter('kit_sku', $sku)->setOrder('related_sku', 'DESC');


texts: Magento Custom URL rewrite doesn't work if request path includes uppercase letters

texts:
I was just facing the issue in Magento. If we use uppercase letters as request path.

Ex.

Request path: en-US/store-locator
Target path: stores/usa

Now if i try to open url as http://MY_SITE_BASE_URLS/en-US/store-locator/
then it doesn't redirect to Target URL.

But if i change uppercase to lowercase in request path

Ex.

Request path: en-us/store-locator
Target path: stores/usa

Now it works.

I have thousands of URL with uppercase in request path.

Any suggestion??


texts:
First of all: I'm new to Linux and web dev. I was a Dynamics NAV dev, so this whole things is totally new to me. I've been thrown to the deep end, so I'm trying to learn as much as

I installed Magento2 using Composer, and I can run bin/magento.

But, I can't run Magento on my browser. Running localhost just gives me white page. I can create a HelloWorld.php on the same folder and run it no problem though. I have setup the .htaccess and the config in apache2 folder.

I changed the permission to the whole /var/www/html folder to www-data and now I can see Magento setup page. But now I can't run bin/magento, because the permission is now on www-data.

Question:

Who is supposed to be the owner for the /var/www/html folder? I'm
supposed it's www-data?
What's the correct setup here? Should I just put myself as part of the www-data?


texts:
I migrate one of my client's website from Magento 1.7 to Magento 2.1.
All products work properly but when I open configurable product from admin it will not open and give this kind of message.

And also in system log "[2016-09-15 07:43:56] main.CRITICAL: Requested product doesn't exist [] []" this message appear.

Any suggestions? Thanks in advance.


texts: Magento 2.2.4 The value specified in the URL Key field would generate a URL that already exists

texts:
when I have the category in product assign and saving category below error showing

  The value specified in the URL Key field would generate a URL that
  already exists.  To resolve this conflict, you can either change the
  value of the URL Key field (located in the Search Engine Optimization
  section) to a unique value or change the Request Path fields in all
  locations listed below:

and my exception.log error log is


texts: event sales_order_invoice_save_commit_after is not being dispatch over REST API

texts:
May I know how can I dispatch event sales_order_invoice_save_commit_after when I create invoice via REST api?

I noticed there are quite a number of extensions is observing this particular event but this event is not being dispatched when the invoice is created over REST api.

Is this function depreciated? I understand that this event works well in the web but there is dispatching in REST api.


texts: uploading favicon results in error on Magento2.3?

texts:
When I try to upload a new icon, it fails with this error.  Same with uploading logo image.  How do I debug this further?

A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

[update]
This is bug in magento 2.3 please check this question answer I’m sure it will help you Magento 2.3.0 "A technical problem with the server created an error." When uploading the logo image


texts: load method vs getCollection method which is better and faster

texts:
Let assume we have 1 record in database and id is 1

we can get record using 2 method load by id and getCollection.

$model = Mage::getModel('stackexchange/questions')
             ->getCollection()
             ->addFieldToFilter('id',1);
foreach($model as $mod) {
    echo $mod->getName();
}

OR

$model = Mage::getModel('stackexchange/questions')
             ->getCollection()
             ->getFirstItem();
echo $model->getName();

and we can get single records using load();

$model = Mage::getModel('stackexchange/questions')->load(1);
echo $model->getName();

Here is my question.
Which method is faster and better to use and why ?

If none of then which is the fastest way to access data ?


texts: Multiselect attribute The value of Admin must be unique

texts:
I upgraded magento2 to 2.1.6
When I try add option to multiselect attribute i see message: The value of Admin must be unique.
How can I fix it?


texts:
We want to display the shipping and billing address and payment method details on the review page of the one page checkout. We use persistent checkout for this. I just want to show a summery of details what the user's selected or entered.

We currently have this:

Billing address:

<address><?php echo $this->getQuote()->getBillingAddress()->format('html') ?></address>

Shipping address:

<?php if(!$this->getQuote()->isVirtual()): ?>
<address><?php echo $this->getQuote()->getShippingAddress()->format('html') ?></address>

But this does only work if you refresh the page. The details do not load directly the first time. And I do not know how to display the payment method.

I'm also looking for the code to display the payment method.

Can anyone help me to display this instant on the review page?


texts: Product collection filter by Product attribute set id in admin grid(programmatically)

texts:
I want to override product collection in Magento product grid in admin side.

Please let me know which file I need to override for collection filter


texts: How to add .5 rating for products magento?

texts:
Currently, we are having ratings with 5 stars options. But I would like to have 5 stars with 10 options incrementing by .5.

Actual options

1,2,3,4,5

Expected options

0.5, 1, 1.5, 2 ,2.5 ,3 ,3.5 ,4 ,4.5 ,5

Example: For 3.5 rating we would like to have option like this


texts: How to echo/print attribute set name on frontend catalog page

texts:
Magento CE 1.9.0.1

I'm interested in echoing out the product attribute set name on the catalog/category pages. This sounds like a strange thing to do but we use Magento's attribute set in a unique way for classifying products.

I was attempting to pull it from the Mage::getModel('catalog/category') feature in my page template but was unsuccessful.

I also tried to pull the name with the following code:

$attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$attributeSetModel->load($product->getAttributeSetId());
$attributeSetName  = $attributeSetModel->getAttributeSetName();
echo "<p>" . $attributeSetName "</p>";

Is there a way to get the name to display with their products on the frontend catalog pages? Thanks in advance.


texts: Why is the collect-phrases cli command not working at all?

texts:
According to the Magento documentation, I should be able to create a translation csv file by calling bin/magento i18n:collect-phrases command. I have tried all variations of the following

bin/magento i18n:collect-phrases -o "path/to/my/file.csv" -m
bin/magento i18n:collect-phrases -o "path/to/my/file.csv" path/to/my/module
bin/magento i18n:collect-phrases --output="path/to/my/file.csv" "path/to/my/module"
bin/magento i18n:collect-phrases --output="path/to/my/file.csv" --magento

But I always get the same error

[InvalidArgumentException]
Directory path is needed when --magento flag is not set.

i18n:collect-phrases [-o|--output="..."] [-m|--magento] [directory]

I feel like the documentation is totally wrong, or the command is broken.


texts: How to migrate Magento 2.0.x from one server to another?

texts: We have a local environment for development. We need to do a migration from local to a Dev server for integration. Is there any detailed migration guide about how to migrate Magento from one server to another? How to handle the database records and user generated content?


texts: Magento 2 : Make 'Apply Coupon Code' Required Field in Admin Order Creation

texts:
I have Magento 2.1.6.

I need to make 'Apply Coupon Code' a required field in admin (only) order creation for specific customer group.

Top marks if anyone can work this out as I am stumped.


texts: Magento Direct SQL New vs Existing Customers

texts:
I want to run an SQL query to show orders by new customers and existing customers and group them by month.

EDIT:

I now have this script however it only compares the dates if they are exact to the minute, I now need to compare the dates by just the date rather than date and time.

SELECT *
FROM (

SELECT e.grand_total, e.created_at, COUNT( e.increment_id ) AS grand_total1, o.entity_id, o.created_at AS  `last_order_date`
FROM  `mg_sales_flat_order` AS  `e`
LEFT JOIN  `mg_customer_entity` AS  `o` ON e.customer_id = o.entity_id
WHERE e.created_at = o.created_at
GROUP BY YEAR( e.created_at ) , MONTH( e.created_at )
ORDER BY e.created_at DESC
)sub_query

Edit: to clarify I want a table to display:
Month - #New Customer Orders - #Existing Customer Orders - Total Customer Orders

A new customer would be a customer who came onto the site placed there first order in month x if they then came back and ordered in month a,b and c then those orders would be classed as existing customer orders

I have come across this script on this site but I'm not sure how that would help.

$LastOrder=Mage::getModel('sales/order')->load($orderId);
$LastOrdertime= $LastOrder->getCreatedAt();

$OrderCollection=Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_email',$LastOrder->getData('customer_email'))
        ->setOrder('created_at','asc');
$fstoredetime= $OrderCollection->getFirstItem()->getCreatedAt();

if($fstoredetime==$LastOrdertime):
// new customer
else:
//old customer
endif;

I can get number of transactions by month with this code but I want to split it out into new and existing customers

<?php
            $result = mysqli_query($con,"SELECT count(*), created_at FROM sales_flat_order WHERE status NOT LIKE 'canceled' AND store_id BETWEEN 1 AND 2 GROUP BY YEAR(created_at), MONTH(created_at) ORDER BY created_at DESC");

            while($row = mysqli_fetch_array($result)) {

            $num = $row[0];

              echo "
";

              echo "";

              echo date("m/Y", strtotime($row['created_at']));

              echo "	";

              echo "";

              echo $num;

              echo "	";

              echo "
";
            }

            mysqli_close($con);
        ?>

I have also tried comparing created_at in both customer and order tables, has anyone done this before?

SOLUTION:

SELECT *
FROM (
SELECT e.grand_total, e.created_at, COUNT( e.increment_id ) AS grand_total1, o.entity_id, o.created_at AS  `last_order_date`
FROM  `mg_sales_flat_order` AS  `e`
LEFT JOIN  `mg_customer_entity` AS  `o` ON e.customer_id = o.entity_id
WHERE DATE(e.created_at) = DATE(o.created_at)
GROUP BY YEAR( e.created_at ) , MONTH( e.created_at )
ORDER BY created_at DESC
)sub_query

I also found more information here http://www.webamondo.co.uk/blog/magento-sql-repeat-customers-vs-new-customers/


texts: Get post value in controller empty array

texts:
I am getting empty array in post in admin form.

$this->getRequest()->getPost()

It was working fine before I have updated 3 more fields to this form field like below:

$fieldset->addField("meta_title", "text", array(
                        "label" => Mage::helper("modulename")->__("Meta Title"),
                        "name" => "meta_title",
                        ));

                        $fieldset->addField("meta_description", "textarea", array(
                        "label" => Mage::helper("modulename")->__("Meta Description"),
                        "name" => "meta_description",
                        ));

                        $fieldset->addField("meta_keyword", "text", array(
                        "label" => Mage::helper("modulename")->__("Meta Keyword"),
                        "name" => "meta_keyword",
                        ));


texts: SEO URL not properly Multiwebsite magento2

texts: We have created  a multiwebsites. But the product url is not formatting correct seo-urls. I have tried to added the URL Rewrite in admin section, but its not working. The product url showing as  "www.example.com/catalog/product/view/id/3/s/demo/" But  need to display like www.example.com/categorykey/productkey.


texts:
Taking this page as a reference:

http://ultimo.infortis-themes.com/demo/eighth/phone5.html

I would like to add a custom CMS block under 'Add to wishlist'/'Add to Compare'/'Share'.

I can't find the right reference for this part in the XML files of Magento.


texts: Problem with installing Grunt on Magento2

texts:
I followed this tutorial on installing Grunt on Magento 2. I am running Magento 2.0.7, hosted with one-click app from digitalocean. I only have 'root' user (heard that may cause some problems).

After installing Grunt, the grunt:clean, grunt:exec commands work, but it gives error when trying to grunt:less. Error is:

Loading Gruntfile.js tasks...ERROR

  Error: Cannot find module './jit-grunt'
  Warning: Task "less:raultheme" not found. Use --force to continue.

And after using grunt:exec I cant enter my page anymore, not even backend. It throws this error:

exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory /var/www/html/magento/var/generation/Magento/Framework/App/Response/Http/.' in /var/www/html/magento/vendor/magento/framework/Code/Generator.php:103 Stack trace: #0 /var/www/html/magento/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Framewo...') #2 [internal function]: spl_autoload_call('Magento\Framewo...') #3 /var/www/html/magento/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...') #4 /var/www/html/magento/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #5 /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo...') #6 /var/www/html/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...') #7 /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...') #8 /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'response', 'Magento\Framewo...') #9 /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array) #10 /var/www/html/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array) #11 /var/www/html/magento/vendor/magento/framework/App/Bootstrap.php(233): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewo...', Array) #12 /var/www/html/magento/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\Framewo...') #13 {main}

Magento is on developer mode. I have no clue anymore what might be wrong...


texts:
I'm trying to reindex Elastic Search but I'm running into an error I don't know how to fix.
The reindexing runs fine on 2 other machines.
I've deleted all indices with the "curl -X DELETE http://0.0.0.0:9200/_all" command which returned {"acknowledged":true}, however, the issue still persists.


texts: Community Edition 1.9 Order Fullfillment

texts:
The inventory on the Magento site will be held in a warehouse for a third party who will ship the order.  Is there a way to configure Magento CE make the orders automated so when one is placed the third-party receives this order by email or by sending data to their web service?

Right now when an order is placed by a user, you have to look into the admin site and get the order details and forward to the fulfillment warehouse manually.


texts: Magento checking order updated_at using Magento date and time

texts:
we are trying to filter out orders that were created longer than 60 minutes ago with status pending. We are having some problems with the date/time functions

We tried:
 - date('Y-m-d H:m:s') and subtracting hours
 - and Mage::getModel('core/date')

But both are not giving me the correct date/time as I see is being used for the column updated_at.

Question: What date/time function or method should I use to find a date-time that corresponds to the date-time that is used for the updated_at column in orders? (so when I have the correct date-time I can subtract and select orders)

$date = $this->get_offset_hours();
$orders = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('state', 'new')
    ->addFieldToFilter('status', 'pending')
    ->addFieldToFilter('updated_at', array('lt' => $date));


texts: Allowing two base URLs (same instance, same store)

texts:
Is there any way to allow Magento to accept two base URLs?
The reason being our security team requested to disallow admin URL from being accessed from the internet so we are planning to use two URLs for internet vs intranet respectively. The admin URL will be blocked if accessed via the internet base URL and will only be allowed from the intranet base URL.
Since we are using Kubernetes with layers of Citrix loadbalancer, HAProxy and NGINX Ingress Controller in front, whitelisting based on IP pattern is not feasible without harassing the teams that manage all those layers. The only choice is to use Ingress to redirect the /admin/ path of the internet URL to some forbidden error page.
I have tried messing around with web/unsecure/base_url and web/secure/base_url but seems like those are for HTTP vs HTTPS only. Both our internet vs intranet URLs are using HTTPS due to security policy so we can't use those.


texts: Magento 2: How to remove zoom on hover on product image in view page?

texts:
How do I remove the zoom feature on hover on the image in product view page.

This is a standard magento function apparently.


texts: Magento 2 : Add Hero Image Upload Field on CMS page

texts:
How to add image upload field to a CMS page and show this on top of my CMS page as Hero image like shown below?

Maybe there are simple solutions/tutorials, but I can't find right one.


texts: Magento 2: Add to cart button issue on phtml file (Ajax base add to cart Prodcut )

texts:
I have added the code for add to cart button but i don't want to refresh the page when i click on button. How to achieve this?

I need the functionality as like default add to cart button(product detail page).

Here is my code:

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

  $listBlock = $objectManager->get('\Magento\Catalog\Block\Product\ListProduct');

  $addToCartUrl =  $listBlock->getAddToCartUrl($product); ?>

  <form data-role="tocart-form" action="<?php echo $addToCartUrl; ?>" method="post">

    <?php echo $block->getBlockHtml('formkey')?>

     <button type="submit" title="Add to Cart" class="action tocart primary">

       Add to Cart
     </button>
 </form>

Any idea?

Thanks


texts:
I'm trying to change all uses of the word 'Excl. Tax' to 'Excl. VAT' as I'm building a UK site.
I found 3 examples of how to do this but which is the right way?

  Change every use of 'Tax' to 'Vat' in  /vendor/magento/module-tax/view/frontend/layout/{checkout_cart_index.xml}
  & {checkout_index_index.xml}.
  Add a translation to a en_GB file / not too sure on how to do this
  Install a language pack - composer require cubewebsites/magento2-language-en-gb:*


texts:
I installed a module for Free shipping,

But as soon as installing module, when I try to update my cart on cart page, I got this error

I am not able to trace the error as there is no bug in the module

The code of the module,  where the error above is pointing to is this,

Freeshipment.php

<?php
class Ameex_Freeship_Model_Carrier_Freeshipment extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
{
        protected $_code = 'ameex_freeship';
        public function collectRates(Mage_Shipping_Model_Rate_Request $request) {
             if (!$this->getConfigFlag('active')) {
                return false;
            }
                $result = Mage::getModel('shipping/rate_result');
                    if(Mage::getSingleton('customer/session')->isLoggedIn()){
                    $groupid=Mage::getSingleton('customer/session')->getCustomerGroupId();
                    }else{
                    $groupid='0';
                    }
                $customergroupconfigdata=$this->getConfigData('customergroup');
                $grouparray=explode(',',$customergroupconfigdata);
                    if (($request->getBaseSubtotalInclTax() >= $this->getConfigData('ameex_free_shipping_subtotal') && in_array($groupid,$grouparray))
                ) {
                   $method = Mage::getModel('shipping/rate_result_method');

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

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

                    $method->setPrice('0.00');
                    $method->setCost('0.00');
                $result->append($method);
                }
        return $result;
        }
    public function getAllowedMethods()
    {
        return array('ameex_freeship' => $this->getConfigData('name'));
    }

}


texts: How to load customer by attribute in magento2?

texts:
What is the best way to load Customer by custom attribute?
I create custom module. What should I overwrite?

Model/Customer
Model/ResourceModel/Customer
Model/ResourceModel/CustomerRepository

What is the best way?


texts: Magento 2: Uncaught TypeError: Cannot read property '*' of undefined in (section-config.js:33)

texts:
It's duplicate question but I am facing the same issue while adding the product & removing items from the cart page.

I have spent almost a day to resolve but no luck hope someone could help me with this.

Error Message in the console:

  Uncaught TypeError: Cannot read property '*' of undefined in (section-config.js:33)

Edit: I have run the deploy & deleted all the cache still issue persist.


texts: Customer registration form - subscription checkbox

texts:
So on my customer account registration form: domain.com/customer/account/create/ I would like to set the newsletter subscription checkbox, so it is already checked.

So I have looked in the register.phtml code app/design/frontend/base/default/template/customer/form/register.phtml and at lines 60 to 76 it has this code:

Added code to make registration box have the tick box automatically ticked

<?php
$checked = true;
if($this->getFormData()->getEmail()) {
if(!$this->getFormData()->getIsSubscribed()) {
    $checked = true;
    }
}
?>

and

   /* added with the additional code above */
   <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed" checked="checked" class="checkbox" />
...

It looks as though this should do what I want but on my live site, it isn't working. I even took out the /* text */ as I thought this may have an effect but it had no effect.

Any suggestions are most welcome. Thank you.


texts: is this the correct xml layout in magento 2

texts:
can you please confirm if layout xml of magento2 is correct.

This is layout xml of Magento1x

<?xml version="1.0"?>
 <layout version="0.1.0">
 <catalogsearch_result_index>
    <reference name="catalogsearch.leftnav">
        <action method="setTemplate">
            <setTemplate>tagalys_search/filter.phtml</setTemplate>
        </action>
    </reference>

This is the corresponding layout xml of 2x

    <?xml version="1.0"?>
   <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<body>
    <referenceBlock name="catalogsearch.leftnav">
        <action method="setTemplate">
            <argument name="setTemplate" xsi:type="string">Tagalys_Tglssearch::tagalys_search/filter.phtml</argument>
        </action>
    </referenceBlock>
    <referenceContainer name="content">
        <referenceBlock type="catalogsearch/result" name="search.result">
            <referenceBlock name="search_result_list">
                <referenceBlock name="product_searchlist_toolbar">
                    <action method="setTemplate">
                        <argument name="template" xsi:type="string">Tagalys_Tglssearch::tagalys_toolbar/toolbar.phtml</argument>
                    </action>
                </referenceBlock>
            </referenceBlock>
        </referenceBlock>
    </referenceContainer>
</body>


texts: How to edit the final "Finish order"-Button in Mage2?

texts:
We want to add a Google Analytics Code to the "Finish Order"-Button in the Magento2 Checkout. So far I've not been able to get the HTML structure for the corresponding buttons.

How can I add custom HTML code to the checkout buttons?


texts: How to get SQL query for product insert in Magento 2?

texts:
How to get SQL query for product insert in Magento 2 ?
I have multiple products around 10 Lakhs so i want to insert it using SQL query.
But how will i get the insert query of the product ?
Any Help is Appreciated.


texts: 404 and non SEO-friendly URLs in HTML docs despite having core_url_rewrite entries

texts:
About three months ago, I was migrating a Magento 1.9 app to a new server and truncated the core_url_rewrite table due to an error while indexing.
Everything's been fine, though I recently found out that a large number of hrefs in my HTMLs, which previously followed the format example.com/something-seo-friendly.html, have been turned into something like the following, which is considerably less SEO-friendly.
example.com/catalog/product/view/id/<INT>

I started digging a bit and realized for a lot of those cases, there actually is an entry in core_url_rewrite, where

request_path = something-seo-friendly.html
target_path = catalog/product/view/id/<INT>.

However, not only do the HTML docs contain a lot of those not so SEO-friendly URLs, but also I am getting a 404 page when trying example.com/something-seo-friendly.html.
I was hoping to resolve the issue by adding some missing request paths using a backup from before migration, but dont know what to do next as the relevant entry exists.
P.s. the only difference between the old and the new entry is the primary key, i.e. url_rewrite_id. There is also a cron job reindexing every few times a day.


texts: How to sort simple products inside configurable

texts: I have configurable product where i showed the simple products in table formate.Now i want to arrange them in order (Size and Color) like 2-8 and Alphabitcally like A or B will comeup first and so one .I try from admin but nothing found there to set the order.How can i set it from front side.I can code but dont know from i change it.I am adding my product detail page


texts:
I want add 2 lines code into  but I want do this from my Extension
How can I do this job ?

Don't want to add code to core file and then insert it into local folder

Is this possible add directly into my extension ?

I want add 2 lines below into

  /code/core/Mage/Checkout/controllers/CartController.php

in the public function estimatePostAction()

under the $region = (string) $this->getRequest()->getParam('region');

Code is :

$cityDiff = $this->getRequest()->getParam('city');
Mage::getSingleton('core/session')->setEstimatedCity($cityDiff);


texts:
I tested my site speed on Gtmetrix and it showed fonts rendering through

https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700 .

And it is called in theme layout as -css src="https://fonts.googleapis.com/css?family=Montserrat:400,600,700|Roboto:400,400i,700" src_type="url"  .
I  want to download and store the fonts locally and render them .
How to do this ?


texts: magento2 - custom catalogsearch controller not getting called

texts:
Why does my search engine not navigate or call my custom controller when i have overriden my default Magento search engine.

When i search for a product keyword, it redirects to core

localhost:1338/magento2x_2/catalogsearch/result/?q=keyword

But i want it as:

localhost:1338/magento2x_2/tglssearch/result/?q=keyword

I have overridden Catalogsearch in etc di as:

 <preference for="Magento\CatalogSearch\Controller\Result\Index" type="Company\Module\Controller\Result\Index" />

My frontend routes:

<?xml version="1.0"?>
  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
    <route id="tglssearch" frontName="tglssearch">
        <module name="Vendor_Module"/>
    </route>
</router>
 </config>


texts: Theme files gone after extension installed

texts:
I am really not familiar with Magento 2 - a colleague has built one mainly using a pre-purchased theme but I haven't been involved until today.

This morning I manually installed an extension which seemed to be just a matter of uploading a folder and its contents into the public_html/app folder.

Then used PuTTY to enable, update, compile, clean the cache. The dashboard seems fine and the extension was installed fine.

However on the front end, a whole pile of files in public_html/pub/static have disappeared and the site is broken. Any idea how this could have happened? Was it during the update/compile? I believe we have a backup but just wondering for future reference...


texts: How to override Magento directory module /etc XML file

texts:
I am trying to override the ZIP code validation xml file in Magento's Directory module. I'm doing this because I want to enforce a space in UK postcodes. The path of the file I'm attempting to override is:

/vendor/magento/module-directory/etc/zip_codes.xml

I'm attempting to override this by creating a file in my theme with the same name:

/app/design/frontend/[Company]/[Theme]/Magento_Directory/etc/zip_codes.xml

This hasn't had the desired effect, I presume I'm missing a key step but I've not been able to figure out what else is required. Any help would be greatly appreciated.


texts: Create Admin grid from join table collection

texts:
I'm new to magento 2, I have a query to join multiple table, only 1 custom table I've made and the rest is from Magento 2, the query looks like this:

SELECT
    marketplace_orders.entity_id as id,
    marketplace_orders.product_ids as product_ids,
    sales_order.entity_id as order_id,
    sales_order.status as order_status,
    sales_order.state as order_state,
    customer_entity.entity_id as seller_id,
    CONCAT(customer_entity.firstname," ",customer_entity.lastname) as seller_name,
    sales_order_address.telephone as seller_telephone,
    customer_entity.email as seller_email
FROM marketplace_orders
INNER JOIN sales_order
    ON sales_order.entity_id = marketplace_orders.order_id
       AND sales_order.status IN ("pending","processing")
LEFT JOIN customer_entity
    ON customer_entity.entity_id = marketplace_orders.seller_id
LEFT JOIN sales_order_address
    ON sales_order_address.parent_id = sales_order.entity_id

marketplace_orders structure:

order_id => foreign key from sales_order
seller_id => foreign key from customer_entity
product_ids => order item ids

This query will join the sales_order_item with the other table, and I need to show it in Magento 2 Admin grid, is there a way to produce the grid with that join table query?


texts: How to edit the attributes of the  tag in topmenu $_menu

texts:
In topmenu.phtml, it calls the links from the $_menu block. I found you can edit this in Navigation.php, but I don't know how to add extra attributes to the <a> tag.

What I need is to set the target for all the links in $_menu to "target='_top'".

Any idea of how I can do this?


texts: How to Set Default Dropdown value in magento1 custome form at admin side

texts:
$fieldset->addField(
        'attribute_magento',
        'select',
        array(
            'name'   => 'attribute_magento0',
            'container_id' => 'attribute-magento0',
            'values' => $values,
            'value' => 'vw',
    ));

i was try but it has not work
any one have idea why?


texts:
I have been receiving this exception message constantly. I am not sure what is causing this.

For me it looks like it is somehow related to catalog listing. But not sure which file exactly am I looking to track it down.

2016-06-28T07:35:02+00:00 ERR (3):
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation:
1064 You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1'
in /lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `catalog...', Array)
#5 /lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `catalog...', Array)
#6 /lib/Zend/Db/Adapter/Abstract.php(753): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#7 /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(380): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
#8 /app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Core_Model_Resource_Db_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
#9 /app/code/core/Mage/Catalog/Block/Product/List.php(80): Mage_Core_Model_Abstract->load(Object(Mage_Catalog_Model_Category))
#10 /app/code/core/Mage/Catalog/Block/Product/List.php(142): Mage_Catalog_Block_Product_List->_getProductCollection()
#11 /app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Catalog_Block_Product_List->_beforeToHtml()
#12 /app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#13 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#14 /app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#15 /app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#16 /app/design/frontend/enterprise/helloshopper/template/page/2columns-left.phtml(57): Mage_Core_Block_Abstract->getChildHtml('content')
#17 /app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#18 /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/enterp...')
#19 /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#20 /app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#21 /app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#22 /app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#23 /app/code/core/Mage/Catalog/Helper/Product/View.php(147): Mage_Core_Controller_Varien_Action->renderLayout()
#24 /app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(3354, Object(Mage_Catalog_ProductController), Object(Varien_Object))
#25 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_ProductController->viewAction()
#26 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#27 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#28 /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#29 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#30 /index.php(88): Mage::run('', 'store')
#31 {main}


texts: No products are showing after upgrade Magento 2.1.7 (but visible by search)

texts:
I have upgraded to Magento 2.1.7 and suddenly no products appear on the website, only visible by the search. I upgrade by command line:
http://devdocs.magento.com/guides/v2.0/comp-mgr/cli/cli-upgrade.html

I am working for years with Magento now and I know all the steps that should be verified (indexing / cacheflush / opcache flush / stock / visible in / bound to the right category / selected the right website for the product...

But this time I just can't get it back to work. I also tried:
php bin/magento indexer:reset
and reindex again, but doesn't work either.

I don't see any errors in var/log/system.log

So no idea what I should do now. Does anyone have an idea?
Thanks in advance.


texts: Applying Security patches on Magento 2.3

texts:
We are running Magento ver. 2.3.2-p2
Due to multiple custom modules, there are no plans to upgrade upto 2.4 for the moment but I would like to have the latest security patches applied as far as feasible.
will running command
composer require magento/product-community-edition=2.3.3-p1 --no-update

be safe for us giving us just the security updates minus the actual upgrade to 2.3.3


texts: how to change email:- owner@example.com in home page in my localhost.?

texts:
how to change this in email address in file header_left_links.php .:-

<?php
    $general_email = Mage::getStoreConfig('trans_email/ident_general/email');
?>

<a href="mailto:<?php echo $general_email;?>"> <?php echo $general_email;?>