texts: Magento 2: How to quickly import the color swatches?

texts: I've more than 50k attributes to apply the color swatches, I'd like to know if there are different method more easy or fast than the manual process?


texts:
I'm trying to insert the current store country name through a CMS Page/Block by following this article.

I've created a Block file countryname.php in

  app/code/Vendor/Countryname/Block

with the following

<?php
namespace Vendor\Countryname\Block;
class Countryname extends \Magento\Directory\Model\CountryFactory

{
    public function __construct(
            \Magento\Directory\Model\CountryFactory $countryFactory
        ) {
            $this->_countryFactory = $countryFactory;
        }

    public function getCountryname($countryCode){
        $country = $this->_countryFactory->create()->loadByCode($countryCode);
        echo $country->getName();
    }
    ?>

Then created a countryname.phtml in

  app/code/Vendor/Countryname/view/frontend/templates

with the following

<?php
echo $block->getCountryname($countryCode);
?>

and have used this to call the block from CMS Page/Static Block

  {{block class="Vendor\Countryname\Block\Countryname"
  template="Vendor_Countryname::countryname.phtml" }}

However I get this error on the frontend

  Error filtering template: Invalid block type:
  Vendor\Countryname\Block\Countryname

and this is error in the exception log

  main.CRITICAL: Invalid block type:
  Vendor\Countryname\Block\Countryname {"exception":"[object]
  (Magento\Framework\Exception\LocalizedException(code: 0): Invalid
  block type: Vendor\Countryname\Block\Countryname at
  /home/xyz/m230.xyz.com/vendor/magento/framework/View/Layout/Generator/Block.php:275,
  ReflectionException(code: -1): Class
  Vendor\Countryname\Block\Countryname does not exist at
  /home/xyz/m230.xyz.com/vendor/magento/framework/Code/Reader/ClassReader.php:19)"}
  []

UPDATE

Thanks to magefms this is a partial solution he provided.

In the countryname.php

<?php

namespace Koshmart\Countryname\Block;

class Countryname extends \Magento\Framework\View\Element\Template
{
protected $_countryFactory;

public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Directory\Model\CountryFactory $countryFactory,
array $data = []
){
parent::__construct($context, $data);
$this->_countryFactory = $countryFactory;

}

public function getCountryname($countryCode){

$country = $this->_countryFactory->create()->loadByCode($countryCode);
echo $country->getName();
}
}
?>

in the countryname.phtml

<?php
echo $block->getCountryname('us');
?>

and use this in CMS page/static block to get the country name

  {{block name="koshmart_countryname"
  class="Koshmart\Countryname\Block\Countryname"
  template="countryname.phtml"}}

However the country ID "us" etc has to be manually entered in the phtml file. It does not dynamically get the country ID and then get the country name on the CMS Page/static block.


texts: Magento2: Unable to post 2D Array from REST Api

texts:
I am unable to post multi dimensional array from REST API (POST Method).
posting the data in below format.

RAW DATA

{"customerData":{"name":"Mujassam", "no":"7760"}, "services":[{"product":"mobile", "id": "1"}, {"product":"day", "id":"2"}]}

Here Services is 2D Array

Interface is as below:

/**
     * return placed order status
     * @api
     * @param string[] $customerData
     * @param string[] $services
     * @return array
     */
    public function createOrder($customerData, $services);

May be I am not defining 2D array properly($services)..

It gives me below error

Notice: Array to string conversion in /var/www/html/mabel/vendor/magento/framework/Reflection/TypeProcessor.php on line 496

Note: I have no problem passing the 1D array..

Hoping some body to help me..


texts:
Is it possible to move the page title on cms pages to the left column of a 2 column left layout?

But, purely using local.xml and not editing the templates?


texts:
I am trying to reindex product prices but it shows me an error "There was a problem with reindexing process". I have already tried database recovery tool but it did not work for me.
Thank You

Exception log:

2014-11-18T12:40:11+00:00 DEBUG (7): Exception message: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1
Trace:
0 C:\xampp\htdocs\magento\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)

1 C:\xampp\htdocs\magento\app\code\core\Zend\Db\Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)

2 C:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)

3 C:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)

4 C:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)

5 C:\xampp\htdocs\magento\app\code\core\Mage\Catalog\Model\Resource\Product\Indexer\Price.php(455): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')

6 C:\xampp\htdocs\magento\app\code\core\Mage\Catalog\Model\Resource\Product\Indexer\Price.php(379): Mage_Catalog_Model_Resource_Product_Indexer_Price->_prepareTierPriceIndex()

7 C:\xampp\htdocs\magento\app\code\core\Mage\Index\Model\Indexer\Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()

8 C:\xampp\htdocs\magento\app\code\core\Mage\Index\Model\Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll()

9 C:\xampp\htdocs\magento\app\code\core\Mage\Index\Model\Process.php(258): Mage_Index_Model_Process->reindexAll()

10 C:\xampp\htdocs\magento\app\code\core\Mage\Index\controllers\Adminhtml\ProcessController.php(127): Mage_Index_Model_Process->reindexEverything()

11 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()

12 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')

13 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))

14 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()

15 C:\xampp\htdocs\magento\app\Mage.php(684): Mage_Core_Model_App->run(Array)

16 C:\xampp\htdocs\magento\index.php(87): Mage::run('', 'store')

17 {main}


texts: Open PDF after creating it programmaticaly

texts:
i have my function that generate my PDF, this works fine (the function is in my block).

After that, i want to show the window with this (this is in my controller)

ob_start();
header("Content-Length: " . filesize ( $fullUrl ) );
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=".basename($fullUrl));
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
ob_clean();
flush();
readfile($fullUrl);

but readfile doesn't do anything. Why ?


texts: Magento 1.9 custom module observer is not getting called

texts:
This is my config code of custom module :

<controller_action_predispatch_cms_index_index>
          <observers>
              <mage_homepage_model_observer>
                  <model>mage_homepage/observer</model>
                  <method>homepage</method>
              </mage_homepage_model_observer>
          </observers>
  </controller_action_predispatch_cms_index_index>

& this is my observer in model folder :

<?php
class Mage_Homepage_Model_Observer
{

  public function homepage()
  {//mycode
  }
}

but it does not come in this function. What's wrong?


texts: region field remains empty in Magento2 customer registration

texts:
I am having problems with register.phtml template. When dropdownbox appears for region_id, select one of them and then save the customer, it throws an exception telling that region is a required filed.

I guess that it is because the hidden input box, whose id is "region" remains empty.

How can I solve it?


texts: deleted coupon code keeps showing up as exisiting

texts:
im trying to add a new rule and create a coupon code named "Discount", and have used the same name in the past. the problem is: I've deleted that particular coupon a while back, but magento keeps telling me that the coupon code exists!
I don't see it anywhere in the list of rules which are currently active. How can i fix this?


texts:
How to add tracking number column to order grid?

I tried with this code but doesn't work

$this->addColumn('tracking', array(
            'header' => Mage::helper('sales')->__('tracking'),
            'index' => 'tracking',
            'type'  => 'number',
            'width' => '70px',
            'options' => Mage::getModel('sales/order_shipment')->getTrackingNumbers(),
        ));

Any ideas please..

Update:

By the way i edit on sales grid.php to add this code

$collection->getSelect()
        ->from(
            array(),
            array(
                'track_number' => new Zend_Db_Expr('(
                    SELECT GROUP_CONCAT(`t`.`track_number` SEPARATOR ",")
                    FROM `bg8_sales_flat_shipment_track` as `t`
                    WHERE `main_table`.`entity_id` = `t`.`order_id`
                )'),
            )
        );

Its working fine but the filter not working i tried to add public & protected function and its freezing when i add value to search on it.


texts: Insert Custom Block in Payment Method Page

texts:
I want to include my custom HTML block in One Page Checkout.

The block will display some additional details about the payment methods and it will be showed under Payment Information tab. Just like info.phtml, I want to include my phtml file too.

In my mymodule.xml, I've tried including like below but no luck.

<checkout_onepage_index>
        <reference name="checkout.onepage.payment">
            <block type="core/template" name="customer_mymodule_checkout" as="mymodule_checkout" after="methods" template="mymodule/checkout/onepage/payment/mymodule.phtml" />
        </reference>
    </checkout_onepage_index>

How can I achieve this ?

Thanks.


texts: Promotion: Automatically add certain product to cart for free

texts:
Is it (and if so, how is it) possible to create the following promotion in Magento?

If a certain product item is added to the cart, another certain product shall be added to cart automatically and the price of this second product shall be set to 0.

Thanks a lot for helping!


texts: Get collection with filters - getName is null

texts:
I can get the collection, but something is wrong. First, I created a Module to load a product collection:

app/code/{Name}/RandProducts/Block/Randproductlist.php
<?php

namespace {Name}\RandProducts\Block;

use Magento\Framework\View\Element\Template;

class Randproductlist extends Template
{
    private $_productCollectionFactory;
    protected $_logger;

    public function __construct(
       Template\Context $context,
       \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
       \Psr\Log\LoggerInterface $logger,
       array $data = array()
    ){
       parent::__construct($context, $data);
       $this->_productCollectionFactory = $productCollectionFactory;
       $this->_logger = $logger;
    }

    public function getRandomProducts($categoryId) {

        $collection = $this->_productCollectionFactory->create()->load();
        $collection->addAttributeToSelect(*);

        return $collection;
    }
}

At this point if i go to my phtml in my theme and do:

Random Products

<?php
    $productList = $block->getRandomProducts();

    foreach ($productList as $product) {
        var_dump($product->getName());
        var_dump($product->getSku());
        var_dump($product->getId());
    }
?>

I can see the sku, and the id but the name is null (and in the backend if i look for the product filter by sku it have name).

But i want to add filters,and, if it's possible, get only 5 random products, so i add in getRandomProducts, before return:

$collection->addAttributeToSelect(['name', 'subtitle', 'image', 'url'])
        ->addAttributeToFilter('status', 1)
        ->addFieldToFilter('is_saleable', '1')
        ->getSelect()->orderRand();

and... nothing works


texts: How can I set a url request like this? 'baseurl/frontname/index.php?/param'

texts:
I need to make an action method that will receive a parameter in the url, perform a search and return an array. Anyway, that's not the problem. My problem is that I want a url like 'baseurl/frontname/param'. I don't know how to do this. I've already seem a Magento site performimg same operation with a url like 'baseurl/frontname/index.php?/param'. It's good for me too.

Can someone help me to realize it?


texts: Adding Custom Attribute in Configurable product

texts:
This might be a very easy question for you, but its what I am wandering for hours..

MY issue is, I have a configurable product 'PRODUCT-1' with custom attribute SIZE..now I want to add an other custom attribute COLOR in my product..

One way I know is, go from scratch, delete the preivous product and add new product with 2 attributes...This will not serve me better in my case..

Is there a way, I can add one more custom attribute to an existing configurable product ??


texts: paypal checkout.min.js slowing down site

texts:
this is my situation with checkout.min.js loaded from the PayPal servers.
It loads in 4 secs.

My site is loading in 8 secs (https://gtmetrix.com/), any ideas in how i can reduce this loading time?

Thank You


texts: In XML layout files, what's the difference between "remove=true" and "display=false"?

texts:
I'm in the process of setting up a theme and have hidden several default elements (breadcrumbs, for example).

Some guides recommend:

<referenceBlock name="breadcrumbs" remove="true" />

whereas others go with:

<referenceBlock name="breadcrumbs" display="false" />

As far as I can tell these do the exact same thing. Does anyone know if there's a difference?


texts:
How can I sort products in the wishlist page by price asc and desc. I have found a piece of code but it is not working any help please.

public function getWishlistCollection(Mage_Customer_Model_Customer $customer = null){
    if($customer):
        $wishlists = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer, true);
        if($wishlists->getItemCollection()->getSize()):
            $wishlists = $this->favorites->getItemCollection();
            $wishlists->addWishListSortOrder('added_at', 'DESC');
            $wishlists->getSelect()->limit(10, 0);
            return $wishlists;
        endif;
        return;
    endif;
    return;
}

this code can be found.


texts: Is it safe to delete diretly from the newsletter_subscriber's table?

texts:
I recently turned on email address confirmation for visitors signing up for the newsletter. I'd now like to delete all the newsletter subscriptions made prior to this.

Whilst the database table newsletter_subscriber does have a date column change_status_at, this column is not displayed in the admin, so I can't filter and delete just the old subscriptions.

Ideally I'd like to just run a simple query against the database, which will delete just what I want. However, I'm really cautious about running any queries directly against the Magento database as I'm worried about unexpected interactions.

I have searched the database schema for forign key references to columns in the newsletter_subscriber table, and can't find any.

Is there anyway to be sure that this is a standalone table and safe to delete from?


texts:
I am creating Add to cart API and is working fine with logged-in customer but I have following query:

Query:- Suppose as a guest I have added product to cart and now I am login then how to convert guest quote to customer quote.


texts: Get browser version & operating system version of client after order is placed

texts: Can any body suggest me a module in magento 1.9 which can help me to detect client's browser version & operating system version of client after order is placed?


texts: 500 internal server error on plugin creation - Magento 2

texts:
I'm using Magento 2.1 I'm trying to hide the shipping method based on product attribute. I followed the solution found here Hiding Shipping Method for current Logged in/Guest user if a condition method

But as in the comment provided both the shipping methods are disappearing and "Sorry, no quotes are available for this order at this time" are displaying under shipping Methods.

I found the following error in console

  {"messages":{"error":[{"code":500,"message":"Fatal Error: 'Uncaught TypeError: Argument 1 passed to Magento\OfflineShipping\Model\Carrier\Flatrate::collectRates() must be an instance of Magento\Quote\Model\Quote\Address\RateRequest,none given in /home/my_server/public_html/vendor/magento/module-offline-shipping/Model/Carrier/Flatrate.php:64\

My Plugin file Flatrate.php is as follows

<?php

namespace MyVendor\Module\Plugin;
use Magento\Quote\Model\Quote\Address\RateCollectorInterface;
use Magento\Quote\Model\Quote\Address\RateRequest;
use Magento\Shipping\Model\Rate\Result;

class Flatrate
{
    public function aroundCollectRates(
    \Magento\OfflineShipping\Model\Carrier\Flatrate $subject,
    \Closure $proceed,
    \Magento\Quote\Model\Quote\Address\RateRequest $request
    ) {
        $items = $request->getAllItems();
        foreach ($items as $item) {
            if ($item->getProduct()->getAttributeCode()=='ups') {
                 //if your attribute value is true don't show this method
                 return false;
            }
        }
        return $proceed();
    }
}

Please help.


texts:
I got this error when creating account:

  Fatal error: Uncaught Error: Call to a member function getRedirectCookie() on null in Custom_Module/Controller/AccountCreatePost.php

What is possible causes for this error?


texts: SchemaUpdate is not executed after running setup script

texts:
I am trying to run some Setup\UpgradeSchema.php lines. I run:

php bin/magento setup:upgrade

And my module code is not executed. My Setup\UpgradeSchema.php looks more or less like this:

    if (version_compare($version, '100.0.24', '<')) {
        $this->makeLatLngFieldsDouble($setup);
    }

My module.xmllooks like this:

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

My setup_module table looks like this:

Module      | schema_version | data_version
------      | ------         | -----
My_Module   | 100.0.23       | 100.0.23

When I run this on my local machine it works fine, however in my server it does not. The first time I executed it it gave me an error but now it is not, so I suspect of a caching problem. I have flushed the cache, and run:

rm -rf var/cache var/generation/ var/page_cache/ var/di/ var/tmp/ var/view_preprocessed/;

Any ideas why this might be happening? I am using Magento 2.1.7 by the way


texts:
Facing Login and Registration 500 internal server Error

System log - in /chroot/home/campusma/campusmall.in/html/lib/Varien/Simplexml/Config.php on line 510


texts: Hide specific attribute filters for each category

texts: i want to hide specific attribute filters for each one of my categories. Is that possible from category ->  custom design -> Custom Layout Update ?


texts: Inject phtml block into customer_address_edit

texts:
Is it possible to inject a phtml block into the customer_address_edit view only?

In my module layout xml config i'm trying:

<customer_address_edit>
   <reference name="before_body_end">
      <block type="core/template" name="customer_mymodule_edit" template="mymodule/customer/mystuff.phtml"/>
    </reference>
</customer_address_edit>

This isn't working. If I change <customer_address_edit> to <customer_address_form> the block appears in the new address page and the edit page. I need it only in the edit page.

Thank you!


texts: How to show visual swatch color on product listing page magento2

texts:
Hi i am trying to show the color on product listing page which is configure in the color attribute as visual swatch.

Please find the screenshot below.


texts: Magento 1 custom url rewrite gives 404 issue

texts:
From the layer navigation, i have a couple of attributes.
After i click my url looks like:
brand/brandValue.html?productAttribute=productAttribute1

What i want to achieve is to have that url look like
brand/brandValue/productAttribute1.html

With a custom url rewrite, where the:
requested path : brand/brandValue.html?productAttribute=productAttribute1
and the
target path: brand/brandValue/productAttribute1.html

I got my redirect, with the permanent(301) but it redirects you to 404 . How can i achieve this goal ? Thnx


texts: Magento 1 sample data files to validate Magento 2 Data Migration Tool?

texts:
Does anyone know of a repo that contains a downloadable links to the various sample data archives for M1 ? I can find a link for magento-sample-data-1.9.1.0.tgz , but no others.
I'm trying to test using the Magento 2 Data Migration Tool using a known and reproduceable set of data. I've been using a clean install of v1.9.2.2 with the 1.9.1.0 sample data installed, and trying to import to v2.3.5p2 using the v2.3.5 Data Migration tool. And it's chock full of errors and unmapped attributes when I attempt to migrate data. Which seems odd as I would imagine that would be an obvious test case for the M2 tool.
So I'm wondering if the M2 data migration tool is actually functional, if there's a specific issue with that version of M1 or the sample data version,  or just my plain incompetence. Other versions of more recent sample data would help me validate the same issue occurs with more recent v1.9.x versions.
Complete ass-hat move by Adobe removing all references to M1 from their website...


texts: Need direct url/access to images for newsletter

texts:
I am facing one problem in my magento website.

I have a email newsletter which have some images to show.

My problem is to access the images outside the website. For example, when i typed the url/path of images paced in website, it shows 404 error, because magento think this is a some page name(which is not actually).

I just want to access those images. For example example.com/newsletter_images/offer.jpg

Guys, please help. I am stucked in this.

Thanks in advance

-Amrinder


texts: Custom product not able to save after m2 upgrade

texts:
I have upgrade magento version from 2.1.5 to 2.1.14.
I have create custom module to create custom option with the reference of this "https://meetanshi.com/blog/create-custom-options-programmatically-in-magento-2/" page.

After magento upgrade when i trying to create custom option after few minutes browser gives 503 error and not getting any error in log files.

I have try to debug and found some issue with this  $option->save(); method.


texts: Where do I find the SYSTEM VALUE defaults? magento 2.1

texts:
I want to change the url rewrite area a bit - and I thought I would ask this question that has been bugging me for a bit:

Where are the defaults set? For example for url rewrites, I have to uncheck "Use system value" to change the behaviour. Where can I change this "SYSTEM VALUE"?

Use Categories Path for Product URLs                    Yes/No  [x] Use system value
Create Permanent Redirect for URLs if URL Key Changed   Yes/No  [x] Use system value


texts: Explanation of Magento 1.9.3 __call Change

texts:
The changelog for Magento 1.9.3 mentions the following backwards-incompatible change:

  Mage_Uploader_Model_Config_Abstract: Overrides the magic method __call and its behavior can be inconsistent.

Can somebody explain what this means? The example cited in the changelog is not clear either. Is it saying the behavior was changed to be inconsistent or it was changed to no longer be inconsistent?


texts: Adding product label on product view page?

texts:
I could add product label (New, Sale tec) following this tutorial.
https://www.ubertheme.com/docs/add-product-labels/

I don't use their theme, so I used the section 3 method to manually achieve this. The code suggested was

<?php   $_product = Mage::getModel('catalog/product')->load($_product->getId());
  $attribute = $_product->getResource()->getAttribute('label');
      if(is_object($attribute)) {
        $attdefaultvalue = $attribute->getDefaultValue();
        $attributeValue = Mage::getModel('catalog/product')->load($_product->getId())->getlabel();
        $attributeValueName = Mage::getModel('catalog/product')->load($_product->getId())->getAttributeText('label');
        if(strlen($attributeValue) &&  ($attdefaultvalue !== $attributeValue)) {
           $labeltype = $attributeValueName;
        }
        else {
        $labeltype = "";
        }
    } ?>
    <?php if ($labeltype): ?>
    <span class="<?php echo $labeltype; ?>-label"><?php echo $labeltype; ?>
<?php endif; ?>

Now I am wondering if it is possible to show product label on product view page (= view.phtml).


texts: Magento. Extremely low First Byte and load time

texts:
I am not a specialist, and even after scouring the web for answers and optimization tips, I couldn't really find a solution to my issue. Before Hiring a specialist, I would like to ask for some help first in this excellent community.

We installed a month ago our magento website: www.skinfactory.com.ar
We used to run an old version of magento in the past with no issues at all.

The thing is that since we installed the new version (and a new template too) performance is unacceptable. speed test results are really, but really poor (Load time 26s and First Byte 17s ) -yes seconds!-

We are hosting at siteground with 17 x 3.0 GHz CPU Cores, CentOS, 12GB RAM, 20GB SSD, which I think that is more than enough.

We have 2000 visits per day and 3000 products installed, which I also think is moderate comparing to bigger sites.

Hosting tech team says the server is overloaded most of the time consuming excessive resources. The also say that there are some queries on the database slowering all the process.

Our products (cell phone skins) are offered for around 200 different cell phones and we achieve that with simple products Mageworx Options Template. (We create the options and assign them to products).

Anyone on the community could help us? We have already tried some classic optimisation tricks for the images and merged java but nothing gives the site a better performance.

*update. I dont know if it helps, but I got this results from webpagetest.org

TTP/1.1 200 OK
Date: Sun, 29 Mar 2015 19:12:00 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d67ee194d0f1f1a2b77ddb6c49f4a94d61427656287; expires=Mon, 28-Mar-16 19:11:27 GMT; path=/; domain=.skinfactory.com.ar; HttpOnly
X-Powered-By: PHP/5.4.33
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
Set-Cookie: frontend=9dfb6b90506edb49ba536438ba152dbe; expires=Sun, 29-Mar-2015 20:11:30 GMT; path=/; domain=www.skinfactory.com.ar; HttpOnly
X-Mod-Pagespeed: 1.7.30.5-3847
Vary: Accept-Encoding,User-Agent
Host-Header: 192fc2e7e50945beb8231a492d6a8024
Cache-Control: max-age=0, no-cache
Server: cloudflare-nginx

CF-RAY: 1cede177eb97188e-EWR
Content-Encoding: gzip


texts: How to load custom collection with addfieldfilter and also get the total number of records?

texts:
I have custom collection in page. I need to get the total count and also need to set the query according to pagesize. How to return the total count and results of collection.

$custom_collection = $this->modelfactory->create()->getCollection()->addFieldToFilter('adf',array('eq'=>$%vendo))->setpagsize($pagelimit)->load();


texts: Magento 2 PWA Venia enable Maintenance mode for Storefront

texts:
I have Magento 2 backend with PWA venia storefront.
I need to enable maintenance mode for storefront or display sitedown page on storefront.
How to do it? When I run bin/magento maintenance:enable storefront still working with "Fetch data errors".


texts: Create custom template for just one category

texts:
I would like to map one specific category to a different phtml file in my theme. Hoping to do this without creating a sub-theme for just one file.

ALMOST have it... but need some help:

I put the following into Category > Custom Design > Custom Layout Update

<reference name="content">
     <block type="catalog/category_view" name="category.products" template="catalog/category/view_madeby.phtml" />
</reference>

This works, but it's outputting the contents of view_madeby.phtml twice when I view the category. Do you know why this is happening?


texts: http://127.0.0.1/CavendishOnline/catalogsearch/result/?q=Sift+Stone+Graphite I want to remove Plus mark in end of the URL String How to do this in Magento 2.3 community Version


texts: How to create button on payment step to clear the shopping cart?

texts:
I need to make a button on payment step, when clicking on which shopping cart will be completely empty.
I don't how to realise removing items from shopping cart and how to put the function on button.


texts: Add pagination in custom data collection magento 1.x

texts:
I want to add pagination in custom data collection Magento 1.x. I found it and tried but it not working.

My table

My collection

public function getProductReturn(){
         $collection = Mage::getModel('catalog/product')->getCollection()
          ->addAttributeToSelect('sku');
          $collection->addFieldToFilter(array(
                    array('attribute'=>'return_item','eq'=>'1')
                ));
                $collection->setPage(2, 6);
          return $collection;
   }


texts: How to implement Sovos TaxCalculation Extension in Magento 2.2.6

texts: I am implementing Sovos TaxCalculation extension in Magento2.2.6, according to the documentation I have to use this URL core_adapter/api/magento, which is not actually working for me, because I really don't know what should I do with this ( core_adapter/api/magento ) path, I don't have any path like that in my whole system. Let suppose if I create that path, then what are the files or code I need to put here.


texts: Which event should i use, to get edit order action

texts:
I need to trigger my logic only if somebody will edit order in magento admin panel.
Event sales_order_save_after work also when my order is created normal way.
So this is not suitable to my task.

Is there any special event?  Or should i create some condition to check out if order was edited.


texts: I have created custom table and added some columns and data.I need to export the custom table data in csv format in magento 2.How to do this, can anyone help me to do this?


texts: magento 2.3 after enabling system logs unable to run any command

texts:
I have enabled system logs in magento 2.3.1 using command  bin/magento setup:config:set --enable-debug-logging=true
 But, after enabling it, I am unable to run any command in terminal and getting message -  Magento supports PHP 7.1.3 or later. Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html..

I want to disable the system logs, no command is working in terminal.
Please provide a solution to disable it either through admin or database.

Thanks


texts: how to fetch configurable product from quote table and store it to database custom table?

texts:
I'm trying to create a custom extension to store saved cart items.

For that I need to fetch configurable item from quote table and store them in a custom database table.

how to do that?

please help me..


texts: Magento 2 Paypal Express Checkout order on hold

texts:
I've set up a Magento 2.3.0 shop, and as a payment method, I'm also using Paypal express checkout.
The "Payment Action" is set to "Authorization", and I have received an order a few days ago, the amount is shown in the paypal account on hold, saying "Authorization".
Is there anything else I should do in order to actually receive the amount?


texts:
I tried (without success) to show 3 different menus: - Menu1: for the home page having the subcategories : Home SubMenu1, Home SubMenu2 and Home SubMenu3 - Menu2: for the online Shop having Cat1 SubMenu1, Cat1 SubMenu2 and Cat1 SubMenu3 visible - And Menu3; visible only in the CMS pages and having the 3 sub-elements visible : Cat2 SubMenu1, Cat2 SubMenu2 and Cat2 SubMenu3

The structure of my categories is like this:

Default Category
    |– Home Menu    (Is Active : No)
    |   |– Home SubMenu1    (Is Active : Yes)
    |   |– Home SubMenu2    (Is Active : Yes)
    |   |– Home SubMenu3    (Is Active : Yes)
    |
    |– Cat1 (Is Active : No)
    |   |– Cat1 SubMenu1    (Is Active : Yes)
    |   |– Cat1 SubMenu2    (Is Active : Yes)
    |   |– Cat1 SubMenu3    (Is Active : Yes)
    |
    |– Cat2 (Is Active : No)
    |   |– Cat2 SubMenu1    (Is Active : Yes)
    |   |– Cat2 SubMenu2    (Is Active : Yes)
    |   |– Cat2 SubMenu3    (Is Active : Yes)

Any help?

Many thanks in advance!


texts: Error 1146 table doesn't exist and I cannot delete the table

texts:
In phpmyadmin there's a list of tables in my database which show up on the left hand side but they don't all show up on the right hand side.

When I click spme of these tables on the left hand side I get

"error 1146 table doesn't exist"

I cannot delete the table as it doesn't show up in the right hand side for me to delete it.

Please help me get the tables back or delete it?


texts: After migrating some tables from magento 1.7 to 2.1.8 now unable to register new customer account

texts:
I used this tutorial to migrate website  https://www.pinpointdesigns.co.uk/migrating-data-from-magento-1-to-magento-2-using-the-data-migration-tool/

and now after doing this when I try to register new user I got a error

Please enter user email and id

anyone have idea whats going on ?

I have to include something for customers etc ?


texts:
Previous question title: same 'Migration Meta Information' is displaying for all product edit page in magento 2.3

Edited question title: 'Migration Meta Information' is not updating when I edit product title/name in magento 2.3

I have some products which are already added in my store. I have edited some of them, & I found that the 'Migration Meta Information' is the same for all these products.

When I add new product it seems fine. MEta title, Meta keywords, Meta Description are generated correctly for that product.

But when I edit any random product, 'Migration Meta Information' for the field MEta title, Meta keywords, Meta Description.
If I added new product and then edit, it works fine

Is this an issue in 2.3 version of Magento or am I missing anything?

Please check the attached image
Here my product name is "WIDE DOMED 2-TONE CUFF BRACELET" but meta information is different.


texts: Magento 2 - How to get state code in footer email template

texts:
Using {{config path="general/store_information/region_id"}} in [Vendor]/[Theme]/Magento_Email/email/footer.html, I am getting region id. I would want region code to be displayed in footer of all the outgoing emails.
UPDATE
This code is added to footer.html to print the store information.

             {{config path="general/store_information/street_line1"}}
             {{config path="general/store_information/street_line2"}},
             {{config path="general/store_information/city"}},
             {{config path="general/store_information/region_id"}}
             {{config path="general/store_information/postcode"}}

            |  {{config path="general/store_information/phone"}}

This prints 97 for MA(Massachusetts). I want MA to be printed instead of 97


texts: Magento2 PayPal Recaptcha module not working for multi website

texts:
Due to the recent carding activity of PayPal Payflow Pro, I'm working on getting the magento recommended PayPal Recaptcha module installed and configured per this article (https://support.magento.com/hc/en-us/articles/360025515991-PayPal-Payflow-Pro-active-carding-activity).

I've got it installed and configured. However, I can only get the captcha to display when I have the keys placed at the default config scope. This magento instance is a multi website setup with separate domains. When I place the domain specific keys in the specific website scopes, the captcha goes away and won't display.

I'm using reCaptcha V2. I've tested this on an instance of Magento 2.2.8 and Magento 2.1.3 with the same results. I've also had the same results using the test reCaptcha V2 keys that Google provides. Has anyone had this issue on a multi store setup?


texts: Retaining payment information on admin order form

texts:
We use admin order form for phone orders.  One thing that can be a pain is that if the customer makes changes to the order, after we enter the payment information, we must ask them for their payment information and enter it again.

Is there any way to allow the payment information to be retained by the form while we are still editing the order (shipping choices, add/remove product, etc.) ?

I'm not looking to store the card information with the customer, I just want to avoid reentering the information if customer changes mind before I click "Submit Order."


texts: Magento 1.9 - HTTP ERROR 500 and PHP Fatal error:

texts:
We recently moved to a new hosting company and they set our Magento 1.9.1 website as parked on top of the main account's domain. It worked fine for about a week. We haven't made any changes and now we are getting the following Error when trying to access the website:

This page isn’t working `www.ourwebsite.com` is currently unable to handle this request.
HTTP ERROR 500

PHP Fatal error: Uncaught Error: Function name must be a string in /home/account/mydomain.com/includes/src/__default.php:28278

Stack trace:
    #0 /home/account/mydomain.com/includes/src/__default.php(14070): Mage_Core_Model_Layout->getOutput()
    #1 /home/account/mydomain.com/app/code/local/Smartwave/Ajaxcatalog/controllers/Catalog/CategoryController.php(111): Mage_Core_Controller_Varien_Action->renderLayout()
    #2 /home/account/mydomain.com/includes/src/__default.php(14098): Smartwave_Ajaxcatalog_Catalog_CategoryController->viewAction()
    #3 /home/account/mydomain.com/includes/src/__default.php(18482): Mage_Core_Controller_Varien_Action->dispatch('view')
    #4 /home/account/mydomain.com/includes/src/__default.php(18016): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
    #5 /home/account/mydomain.com/includes/src/__default.php(20808): Mage_Core_Controller_Varien_Front->dispatch()
    #6 /home/account/mydomain.com/app/Mage.php(683): Mage_Core_Model_App->run(Array)
    #7 / in /home/account/mydomain.com/includes/src/__default.php on line 28278

The interesting part of this is that the main website which runs Magento 1.9.4 is up and running with no problems. It's the 2 parked domains/websites that run Magento 1.9.1 that have this issue.


texts:
I am using Magento 1.8. and custom theme.
I have added the button called BUY NOW for each product, and url of that button is
echo Mage::helper('checkout/url')->getCheckoutUrl($_product);
It redirects to checkout but Its unable to add that product to cart.

How it is possible to add product to cart and redirect to checkout page by on click of BUY NOW button.

Thanks.


texts: Magento how to add product to cart programmatically based on customer id

texts:
I am trying to add an item to cart programmatically based on customer id, am trying this below code

    $storeId = Mage::app()->getStore()->getStoreId();
    $product = Mage::getModel('catalog/product')->load(403);
    $customerId = '39';
    $quote = Mage::getModel('sales/quote')->loadByCustomer($customerId);
    $quote->addProduct($product, 1);
    $quote->setIsActive(1);
    $quote->collectTotals()->save();

But here the customer id not exist in the Collection, then am't able to add the product to cart

$quote = Mage::getModel('sales/quote')->loadByCustomer($customerId);


texts: custom attribute yes/no add to sort by in product list

texts:
i have one attribute called most popular with defatul Yes/no configuration by magento i followed

1) To add using Magento Backend you need to follow below steps

a) Goto Catalog->Attributes->Manage Attributes

b) Select the attribute you want to add in Sort By option. Suppose you need to add a Sort By popular Option.

c) Goto Brand Attribute and check for "Used for Sorting in Product Listing".

d) Make it YES

but still i didn't get it work.

i have trace magento's collection with this sort but its not adding any order in collection as below for popular sort,

SELECT `e`.*, `search_result`.`relevance`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e` INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id AND search_result.query_id='2' INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2' LIMIT 12

Price sorting is correct as below

SELECT `e`.*, `search_result`.`relevance`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e` INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id AND search_result.query_id='2' INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2' ORDER BY `price_index`.`min_price` asc LIMIT 12

is there any solution to make this work ?

your help will be very appreciated.


texts: how to get customer session id in html page magento 2

texts:
I am using one custom payment module and i want to do code in html file. Path is

app/code/Custom/Payment/view/frontend/web/template/payment/custompayment.html

and my code is

$om = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $om->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()){
  -----------code ---------
}

js file which i trying to do but not working

define(
[
    'jquery',
    'Magento_Customer/js/customer-data',
    'Magento_Checkout/js/view/payment/default'
],
function (Component) {
    'use strict';

    var getCustomerInfo = function () {
        var customer = customerData.get('customer');

        return customer();
    };

    var isLoggedIn = function (customerInfo) {
        customerInfo = customerInfo || getCustomerInfo();

        return customerInfo && customerInfo.firstname;
    };

    return Component.extend({
        defaults: {
            template: 'XJ_Payment/payment/custompayment'
        },

        /** Returns send check to info */
        getMailingAddress: function() {
            return window.checkoutConfig.payment.checkmo.mailingAddress;
        },

    });
}
);

but i am not able to get result. i know this code is perfect work if i put on controller or model file. but still i am facing the issue which is output is after -> on second line all the code are print on frontend. i can't understand what's going on.

Can you please suggest me how to resolve the issue ?


texts:
I'm quite new to html coding and particularly Magento, so please be gentle.

My question is: is it ok to edit header.phtml

(location - public_html/app/design/frontend/xyz/default/template/page/html)

with cPanel Code Editor? I mean .. it is a “live” action and I’m afraid of not ruining something or the website itself...

All I want to do is to edit a phone number from the header, which is not available anymore.
I have looked for the header in the administration/control panel of the site, but I found everything, except for this tiny section with the phone number.

Thanks in advance!


texts:
I got some weird problem. I am trying to get "special_to_date" and "special_from_date" of a product but it is returning me a null value.
I tried these two methods to obtain values. But they return null values.

var_dump($_product["special_to_date"]);
var_dump($_product->getSpecialTODate());

When i do this var_dump($_product);. Then i get all values including special dates.
What is wrong?


texts: Is it possible to set individual options out of stock ?

texts:
Is it possible to set individual options out of stock (or disable in some way, we are not using inventory) ?

My client has different colours of their products and if one colour is out of stock there seems to be no way to set that out of stock other than actually deleting the option and putting it in afterwards.


texts: Error Integrity constraint violation after upgrade 2.3.2 -> 2.3.5-p-2

texts:
After upgrading from 2.3.2 to 2.3.5-p-2 i get this error when i run bin/magento setup:upgrade
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`test`.`#sql-6df_320f`, CONSTRAINT `SALES_ORDER_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE SET NULL), query was: ALTER TABLE `sales_order` MODIFY COLUMN `entity_id` int(10) UNSIGNED NOT NULL  AUTO_INCREMENT COMMENT "Entity ID", MODIFY COLUMN `store_id` smallint(5) UNSIGNED NULL   COMMENT "Store ID", MODIFY COLUMN `customer_id` int(10) UNSIGNED NULL   COMMENT "Customer ID", MODIFY COLUMN `billing_address_id` int(11)  NULL   COMMENT "Billing Address ID", MODIFY COLUMN `quote_address_id` int(11)  NULL   COMMENT "Quote Address ID", MODIFY COLUMN `quote_id` int(11)  NULL   COMMENT "Quote ID", MODIFY COLUMN `shipping_address_id` int(11)  NULL   COMMENT "Shipping Address ID", MODIFY COLUMN `increment_id` varchar(32) NULL  COMMENT "Increment ID", MODIFY COLUMN `ext_customer_id` varchar(32) NULL  COMMENT "Ext Customer ID", MODIFY COLUMN `ext_order_id` varchar(32) NULL  COMMENT "Ext Order ID", MODIFY COLUMN `original_increment_id` varchar(32) NULL  COMMENT "Original Increment ID", MODIFY COLUMN `relation_child_id` varchar(32) NULL  COMMENT "Relation Child ID", MODIFY COLUMN `relation_child_real_id` varchar(32) NULL  COMMENT "Relation Child Real ID", MODIFY COLUMN `relation_parent_id` varchar(32) NULL  COMMENT "Relation Parent ID", MODIFY COLUMN `relation_parent_real_id` varchar(32) NULL  COMMENT "Relation Parent Real ID", MODIFY COLUMN `store_name` varchar(255) NULL  COMMENT "Store Name", MODIFY COLUMN `gift_message_id` int(11)  NULL   COMMENT "Gift Message ID", ADD CONSTRAINT `SALES_ORDER_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`)  ON DELETE SET NULL, ADD CONSTRAINT `SALES_ORDER_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`)  ON DELETE SET NULL

Kinda stuck here...


texts: Magento 1.9 - Price suffix using an attribute, i.e £9.99 / Roll

texts:
I'm trying to get our product prices to display a unit suffix using an attribute, which I called 'matric'.

So for example we sell wallpaper by the roll, so I want the price to display £9.99 / Roll

I downloaded the file:

public_html/app/design/frontend/base/default/template/catalog/product/price.phtml

and uploaded it to:

public_html/app/design/frontend/smartwave/porto/template/catalog/product/price.phtml

So I could make changes to it without changing core files.

In this file I added the line:

<?php echo $_product->getAttributeText('metric') ?>

to line 214

This has worked perfectly on the product view pages but it has not worked for the list page (Category).

I've used the developer option on the back end and both pages are calling the code from the same file and when I inspect the item using chrome the div seems to be exactly the same and so does the css.

So not sure what I've missed, any ideas?


texts: Invoices are marked paid for bank transfer payment automatically

texts:
I have stackoverflowed, googled etc but couldn't find the answer. I want to understand the logic behind the bank transfer payment method and invoice.

When we create invoices for orders that have payment method as Bank Transfer, invoice goes to PAID status by default.

Problem

In most cases, customer has yet not made full payment but have to send them invoice to ask for payment, which is why it must not marked as PAID in my case.

The function $this->canCapture() returning false for bank transfer orders.

Question

I would like to know how invoices are handled for bank transfer payment and is there a way to create invoice without marking it as PAID?


texts: While installing DATA MIGRATION TOOL, this error shows

texts:
[Composer\Downloader\TransportException]

 The "https://packagist.org/packages.json" file could not be downloaded: all
  ow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in th
  e server configuration by allow_url_fopen=0
  failed to open stream: no suitable wrapper could be found) 'enter code here'

Can anyone please suggest.


texts: Magento 2 : Alter core observer functionality

texts:
I am trying to add a new value "merchant_id" in

\module-reports\Observer\CatalogProductViewObserver.php

How i can override save by add new data to save to it

  public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $productId = $observer->getEvent()->getProduct()->getId();

        $viewData['product_id'] = $productId;
        $viewData['store_id']   = $this->_storeManager->getStore()->getId();
        if ($this->_customerSession->isLoggedIn()) {
            $viewData['customer_id'] = $this->_customerSession->getCustomerId();
        } else {
            $viewData['visitor_id'] = $this->_customerVisitor->getId();
        }

        $this->_productIndxFactory->create()->setData($viewData)->save()->calculate();

        $this->eventSaver->save(\Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, $productId);
    }

I Need to add $viewData['merchant_id'] and assign value to it .


texts: How to add dynamic dropdown in admin form in Magento 2?

texts:
Hello I want to add Dynamic dropdown in admin form , I mean to say I want to fetch data from database and show them in dropdown in admin form in Magento 2?  I already try it but I got following issue.
<?php

namespace Vendro\AdminTheme\Module\Observer;

use Magento\Framework\Event\ObserverInterface;
use Vendor\AdminTheme\Module\Model\ColorFactory;

class EditStatusFormBeforeHtml implements ObserverInterface
{

protected $request;

protected $helper;

protected $_collection;

public function __construct(
    \Magento\Framework\App\RequestInterface $request,
    \Vendor\AdminTheme\Module\Helper\Data $helper,
    ColorFactory $collection
)
{
    $this->request = $request;
    $this->helper = $helper;
    $this->_collection = $collection;
}

public function execute(\Magento\Framework\Event\Observer $observer)
{
     $block =  $observer->getEvent()->getBlock();
     if($block->getId() == 'new_order_status') {

         $form = $block->getForm();
         $fieldset = $form->addFieldset('base_fieldset_color', ['legend' => __('Customize')]);

         $status = $this->request->getParam('status');

         $fieldset->addField(
             'color',
             'select',
             [
                 'name' => 'color',
                 'label' => __('Color'),
                 'required' => false,
                 'value'   => $this->getAlldata()
             ]
         );
     }
}

public function getAlldata()
{
    $collection=$this->_collection->create()->getCollection();
    $result = [];

    foreach ($collection as $index => $value) {
        $result[] = [$value->getColorLabel() => $value->getColorId()];
    }
    return $result;
}
}

The error is

Please help me to fix this


texts:
I'm trying to setup a server for Magento 2.
I'm following through the official documentation, but it's patchy at best.
For example, as of writing there is no direct method of installing PHP7.02 on Centos other than following their non officially recommended method of using the IUS repository.

Is there a recommended server setup for Magento 2 that we could follow along and easily spin up servers?

The answer I'm looking for would include

Which OS is better (CentOS, Ubuntu, Debian)
Which web server is better (Apache 2.2 or 2.4, nginx 1.8 or later)
Which Database is better (MySQL 5.6, MariaDB or Percona)
What PHP version (5.5, 5.6, 7.02, 7.06)
PHP libraries (would include the ones listed by Magento)
Additional PHP components and settings, like PHP OPcache and memory_limit
Mail server (Magento mentions MTA or an SMTP server)
Anything else like Redis, Varnish, Memcached etc

Ideally, once I figure out all of the above, I can then write a bash script to easily spin up Magento2 instances.

I am not looking for an out of the box one line command to install Magento2, rather I'm looking for a recommended stack starting with the OS and down.


texts: How to list all disabled products with sql?

texts:
I need to list all disabled products by using a MySQL query.

I have too many products in my database to be using something like this (creating a collection, loading it and looping over it): http://www.srikanth.me/get-all-disabled-products-on-magento/


texts: create custom attribute for root category in admin

texts:
I need to create category custom attribute in admin for root category only not to subcategories.I searched but not getting solution for that.I can only create catgory custom attributes for both Root and Subcategories.

Anyone know suggest solution.
I have created category attribute using below code.

$this->addAttribute('catalog_category', 'productservice_category', array(
        'group'         => 'General Information',
        'input'         => 'select',
        'option'     => array (
                'values' => array(
                        0 => 'Product',
                        1 => 'Service'
                )
        ),
        'type'          => 'text',
        'label'         => 'Product/Service Category',
        'backend'       => 'eav/entity_attribute_backend_array',
        'visible'       => true,
        'required'      => true,
        'visible_on_front' => true,
        'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

I need to hide or set to editable to false for that attribute while adding Subcategories.But in admin both root categories and subcategories that attributes showing.I need to hide or not to edit while adding subcategories.This is my requirement.


texts: How to display static banner on top of Product page in Magento 1.9

texts:
Here is the image of what I am trying to achieve

How this can be done?


texts:
I am getting an error like this in the site. How can I resolve it? I am using Memcache for session storage. My Magento version is 2.1.15

  Warning: SessionHandler::read(): Unable to clear session lock record
  in /var/www/vendor/magento/framework/Session/SaveHandler/Native.php on
  line 22

Anyhelp thanks...


texts:
In my Magento store, the URL of the selected page is getting concatenated with the existing URL that is for example if I am in the URL http://electric.com/ninja and select another option in the menu as switches.

Instead of getting redirected to the URL http://electric.com/switches.html it is getting redirected to the URL http://electric.com/ninja/switches.html by concatenating itself to the previous URL as a result, I am getting the 404 error as the page doesn't exist.

Kindly let me know Why is this happening and how can I resolve this.


texts: how to increase downloadable product size in magento?

texts:
I need to add downloadable product whose size may vary from 10-90MB
but while uploading the file for downloadable product it doesn't allow me to upload the file greater than 32MB.

Where can i change this upload size limit?


texts:
Im trying to run an import into magento and getting the following error.

SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'field list', query was: INSERT INTO catalog_product_entity (sku, entity_type_id, attribute_set_id, type_id, created_at, updated_at, 0) VALUES (?, ?, ?, ?, ?, ?, ?)

Any advice / suggestions are much appreciated.


texts: when I update the stock and price of a product in what tables are updated?


texts: How to troubleshoot AJAX 404 error on saving simple product in magento 2

texts:
How do I investigate why when saving this simple product with this ID the ajax call fails with a 404 not found?
Below is an example of the URL the same URL with id 183 works please help !!
https://xxx.//catalog/product/validate/id/182/type/simple/store/0/set/9/?isAjax=true


texts: Handling file uploads behind a load balancer

texts:
When your website is behind a load balancer how can you ensure that file uploads (e.g., custom option) goes to the correct server? I think having multiple servers is pretty common but I can't seem to find an answer to this.

Right now when users upload an image for a custom order, the file is created under pub/media/custom_options/quote/. Because I have two servers behind a load balancer, which server the file is created on is random. In my case, I have two servers, let's call them master and slave. If the file is uploaded to master, it propagates to slave using lsync. In the case of the opposite, the file is deleted by lsync after a short period of time.

My solution right now is a shell script running on a cron job on slave that looks for new files coming into the custom_options directory, checks that it does not exist on master, and if not uses rsync to copy the file. It seems sloppy to do it this way but so far this has not failed me.

Aside from how I'm already handling this, a few ideas come to mind on how I can do this more efficiently:

Make an apache rule that forces multipart/form-data requests only go to master. My hosting provider advised against this saying it would be extremely inefficient.
Alter my add to cart form's action to point to a subdomain that goes directly to master. I figured out how to change the action, but this doesn't work because Magento 2 automatically redirects the subdomain to the store's URL and breaks the add to cart button. This was the solution recommended to me.
Ignore the pub/media/custom_options directory in lsync and find another way to sync these directories. Perhaps this in combination with what I'm doing would be best.
Set up amazon s3 or equivalent to host files, then use a module such as this to store the files. I'm not possitive if this would solve my problem but I have see some hints that this is somewhat standard. I'd rather not pay for more servers and the files are only accessed once or twice after an order, I think it would be overkill.

What is the ideal way to handle this situation?

Magento Open Source 2.1.9


texts: How can I load popup widget unload or on ready?

texts:
I am trying to load popup widget , admin specifies it will be unload on ready . Where can I specify it must pop unload or on ready  ?

define([
'jquery',
'Magento_Ui/js/modal/modal',
'mage/cookies'
], function ($, modal) {
'use strict';

$.widget('devall.popupManager', {
    /**
     * creating popup
     */
    _create: function () {
        var self = this,
        popupOptions = {
            responsive: true,
            title: this.options.popupTitle,
            buttons: false,
            modalClass: 'popup-devnewsletter',
            autoOpen: true,

            /**
             * setting a cookie
             */
            closed: function () {
                self._setCookie();
            }
        };

        if (!$.cookie('popup_cookie')) {
            modal(popupOptions, this.element);
        }

        this.element.find('form').submit(function (e) {
            e.preventDefault();

            if ($(this).validation('isValid')) {
                $.ajax({
                    url: $(this).attr('action'),
                    data: $(this).serialize(),
                    dataType: 'json',
                    type: 'POST',
                    showLoader: true,

                    /**
                     * Just a function
                     */
                    success: function () {
                        self.element.modal('closeModal');
                        self._setCookie();
                    }
                });
            }
        });
    },

    /**
     * cookie function
     */
    _setCookie: function () {
        var expDate = new Date();

        expDate.setTime(expDate.getTime() + 3650000 * 60 * 1000);
        $.cookie('popup_cookie', 1, {
            expires: expDate
        });
    }
});

return $.devall.popupManager;
});


texts: How to send 2 newsletter success emails at the same time with magento

texts: I managed to add the 2nd emails select field but am wondering how to send 2 different emails to the newsletter subscriber.


texts:
Is there any way to update country via a dropdown (same as currency in the header)

So that when the customer goes to the basket, that the correct country is already selected?


texts:
I met this case sometimes on Homepage.
The menu was cached when I return Homepage from another category page.

Does anybody here have idea and solution for that?

Thanks


texts: Magento 1.8: How to insert the customer’s email into the email templates

texts:
How can I insert the customer’s email into the email templates for both guest and registered customers?

I came across this answer but it seems a bit too old now as I am using Magento 1.8. The code looks different now.

The code from the answer for app/code/core/Mage/Sales/Model/Order.php,

foreach ($sendTo as $recipient) {
$mailTemplate-&gt;setDesignConfig(array('area'=&gt;'frontend', 'store'=&gt;$this-&gt;getStoreId()))
-&gt;sendTransactional(
$template,
Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $this-&gt;getStoreId()),
$recipient['email'],
$recipient['name'],
array(
'order'         =&gt; $this,
'billing'       =&gt; $this-&gt;getBillingAddress(),
'payment_html'  =&gt; $paymentBlock-&gt;toHtml(),
'guestemailvalue' =&gt; $recipient['email']
)
);
}

the code from the 1.8 for app/code/core/Mage/Sales/Model/Order.php,

    // Set all required params and send emails
    $mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
    $mailer->setStoreId($storeId);
    $mailer->setTemplateId($templateId);
    $mailer->setTemplateParams(array(
            'order'        => $this,
            'billing'      => $this->getBillingAddress(),
            'payment_html' => $paymentBlockHtml
        )
    );
    $mailer->send();

Any ideas?


texts: Magento CE 1.7.02 - MySQL getting inundated with the same request over and over

texts:
We have a dedicated server with an extension called M2ePro installed.We have approx 20,000 ebay listings and 10,000 Amazon listings.

We have 2500 products in our catalog.

The problem we are having is MySql.It is getting inundated with the same request over and over again which never gets completed.

| 11686 | t******b_magento | localhost | t******b_magento | Query | 984 | Sending data | SELECT `e`.`entity_id`, `ur`.`request_path` AS `url` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_website` AS `w` ON e.entity_id=w.product_id
LEFT JOIN `core_url_rewrite` AS `ur` ON e.entity_id=ur.product_id AND ur.category_id IS NULL AND ur.store_id='1' AND ur.is_system=1
INNER JOIN `catalog_product_entity_int` AS `t1_visibility` ON e.entity_id=t1_visibility.entity_id AND t1_visibility.store_id=0
LEFT JOIN `catalog_product_entity_int` AS `t2_visibility` ON t1_visibility.entity_id = t2_visibility.entity_id AND t1_visibility.attribute_id = t2_visibility.attribute_id AND t2_visibility.store_id=''
INNER JOIN `catalog_product_entity_int` AS `t1_status` ON e.entity_id=t1_status.entity_id AND t1_status.store_id=0
LEFT JOIN `catalog_product_entity_int` AS `t2_status` ON t1_status.entity_id = t2_status.entity_id AND t1_status.attribute_id = t2_status.attribute_id AND t2_status.store_id='' WHERE (w.website_id='1') AND (t1_visibility.attribute_id='95') AND ((IF(t2_visibility.value_id > 0, t2_visibility.value, t1_visibility.value)) IN(3, 2, 4)) AND (t1_status.attribute_id='89') AND ((IF(t2_status.value_id > 0, t2_status.value, t1_status.value)) IN(1)) |

I am not sure is this a M2epro issue or Magento.Our frontend of our website does not show up because of this MySQL overload

Any Suggestions would be helpful.


texts:
I'm trying to add a product using an upgrade script inside my module, but I have this error:

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

Here is my code:

$installer = $this;
$installer->startSetup();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
try {
    $product = Mage::getModel('catalog/product');
    $product->setSku("credit10");
    $product->setName("12€ Credit");
    $product->setDescription("12€ credito");
    $product->setShortDescription("12€ credito");
    $product->setPrice(10.00);
    $product->setTypeId('virtual');
    $product->setAttributeSetId(4); // need to look this up
    $product->setCategoryIds("2"); // need to look these up
    $product->setWeight(1.0);
    $product->setTaxClassId(2); // taxable goods
    $product->setVisibility(4); // catalog, search
    $product->setStatus(1); // enabled
// assign product to the default website
    $product->setWebsiteIds(array(1));
    $product->setStoreId(1);
    $product->save();
}catch(Exception $e) {
    Mage::log($e->getMessage());
}
$installer->endSetup();

What I'm wrong?
thanks


texts: Magento 2 change ui grid search fulltext to like

texts: I want to change full-text search by keyword in the admin UI grid to like. In which files I will found query related to this?


texts:
I'm attempting to clone a Magento 2 barebones install, simply by compressing the site, exporting the db, extracting to another location, editing env.php for new db credentials, dumped old DB into new DB. All attempts to reach the install yield a 403 forbidden page.

I could force a reinstall, but it would kill all my extensions I've loaded.  There are no products/orders, I've just setup the base install I need for many sites.

Has anyone cloned Mage 2 successfully?


texts: Split Credit Card Payments for Single Order

texts:
Does anyone know of a pre-made module that can take the total cost of an order and split it in the checkout process between multiple credit cards being processed by the same payment method?

If not any ideas of how to split the payment with a custom module without splitting up products?


texts: Magento 2 Set $_POST to an empty Array()

texts:
I can't seem to find a way to set $_POST to an empty array.

I have a form in phtml action to self I can get $_POST values the following ways:

$this->getRequest()->getPostValue('form_key');

$this->getRequest()->getParam('form_key');

The Above will give Array ( [form_key] => FThdknnc_347djcncKey_)

Now I've tried to reset by doing:

$this->getRequest()->setPostValue('form_key');

But it gives me:

Array ([form_key] =>)

That ain't right browser still popping up saying that it will resend data from form: It should return Array () But the form_key key is still in the $_POST Array. one can do in php:

$_POST = Array(); and that would be enough but it doesn't work with magento.

Anyone any idea?


texts: Magento 2.3.3: Widget layout - Is it possible to add a widget to products by attribute?

texts: I know Magento allows for widgets to be placed on specific products but I need to take it further. I need the option to allow me to filter by product attribute and apply widget to products with those attribute. Thanks.


texts: invoice order items file path in magento?

texts: in magento invoice order items i want to show product price, qty and subtotal. I changed the order items in the below file path /app/design/frontend/base/default/template/email/order/invoice/items.php But no change. Anyone help me where and how to change the order items?


texts: Custom Module load JS when all content is loaded in Checkout

texts:
I created a custom module to show suggested addresses when customer type in the address fill. However, the requirejs load before the content of checkout page load, even though I have put "domReady!".

How can I make the script to load after everything is loaded.

checkout.phtml

<?php
$client_id = $block->getClientID();
$client_secret = $block->getClientSecret();
?>
<?php if ($block->isEnabled()): ?>
<script type="text/x-magento-init" order="100">
{
    "*": {
        "addressfinder": {
            "client_id": "<?php echo $client_id; ?>"
        }
    }
}
</script>
<?php endif ?>

addressfinder.js

define([
'jquery',
'domReady!',
'./checkout_mapping'], function($, domReady, data) {
"use strict";
return function(config) {
//my code
}
});


texts: How can I add custom less file and in a particular theme compile less file in Magento 2 ?


texts: Dynamically add products to configurable product

texts:
I'm programmatically adding products to Magento. I also have a dynamic array (for example: $skuForConfig = array(123, 124))

I use this to add them:

$productData = array();
foreach($skusForConfig as $skuForConfig){
    $productDataTemp = array(
         $skuForConfig => array('0' => array('attribute_id' => '1016', 'label' => 'Size','value_index' => '28563', 'is_percent' => 0, 'pricing_value' => ''))
    );
    array_push($productData, $productDataTemp);
}
$product->setConfigurableProductsData($productData);

So this is the 'dynamic' form for:

    $productData = array(
         '123' => array('0' => array('attribute_id' => '1016', 'label' => 'Size','value_index' => '28563', 'is_percent' => 0, 'pricing_value' => '')),
         '124' => array('0' => array('attribute_id' => '1016', 'label' => 'Size','value_index' => '28563', 'is_percent' => 0, 'pricing_value' => ''))
    );
$product->setConfigurableProductsData($productData);

But... it doesn't work :-(


texts:
we are using marketplace extension so seller can able to generate invoice their Dashboard

so we are using this code for generate invoice

 $shipment->getOrder()->setIsInProcess(true);
                        $transactionSave = Mage::getModel('core/resource_transaction')
                                    ->addObject($shipment)->addObject($shipment->getOrder())->save();

But after that it automatically order status Complete. So that i change in this way

$shipment->getOrder()->setState('invoice');

                        $transactionSave = Mage::getModel('core/resource_transaction')
                                    ->addObject($shipment)->addObject($shipment->getOrder())->save();

After that i add some custom order status like Shipement when i click it automatically change complete instaed of shipement

Shipment controller

public function shipementorderAction(){
                $id = $this->getRequest()->getParam('id');

                $order = Mage::getModel('sales/order')->load($id);
                $order->setData('state', 'shipement');
                $order->setStatus('shipement');
                $history = $order->addStatusHistoryComment('', false);
                $history->setIsCustomerNotified(false);
                $order->save();

                $order->sendOrderUpdateEmail(true, null);

                $this->_getSession()->addSuccess(
                    $this->__('The order state has been changed.')
                );
                //$this->_redirect('mpshippingmanager/shipping/index');
                Mage::getSingleton('core/session') ->addSuccess('Order Updated Successfully'); $this->_redirectReferer();

                }

i don't know what is the problem?


texts:
I'm trying to display a message just on a certain category page in magento?

I know how to do this on a product page so like:

<?php
if (in_array(415, $_product->getCategoryIds())) {?>
    Text
<?php } ?>

But not sure how to do this on a category page?


texts: adding configurable product to cart from wishlist while keeping that item within the wishlist

texts:
I have a configurable item in the wishlist.  I hope to add this product to the cart. default functionality takes this item out of the wishlist using something like $item->unset.  How can I add this item to the cart without unsetting it from the wishlist itself?  Dumping some info about the object reveals this structure here:

 Array
(
    [info_buyRequest] => Mage_Wishlist_Model_Item_Option Object
        (
            [_item:protected] => Mage_Wishlist_Model_Item Object
                (
                    [_customOptionDownloadUrl:protected] => wishlist/index/downloadCustomOption
                    [_eventPrefix:protected] => wishlist_item
                    [_eventObject:protected] => item
                    [_options:protected] => Array
                        (
                            [0] => Mage_Wishlist_Model_Item_Option Object
 *RECURSION*
                            [1] => Mage_Wishlist_Model_Item_Option Object
                                (
                                    [_item:protected] => Mage_Wishlist_Model_Item Object
 *RECURSION*
                                    [_product:protected] =>
                                    [_eventPrefix:protected] => core_abstract
                                    [_eventObject:protected] => object
                                    [_resourceName:protected] => wishlist/item_option
                                    [_resource:protected] =>
                                    [_resourceCollectionName:protected] => wishlist/item_option_collection
                                    [_cacheTag:protected] =>
                                    [_dataSaveAllowed:protected] => 1
                                    [_isObjectNew:protected] =>
                                    [_data:protected] => Array
                                        (
                                            [option_id] => 123
                                            [wishlist_item_id] => 123
                                            [product_id] => 123123
                                            [code] => attributes
                                            [value] => a:1:{i:123;s:4:"123123";}
                                        )

How do I go about accessing these attribute values?  Is there a better way?

The above information is found by using $item->getProduct()->getCustomOptions() on the configurable wishlist item.


texts: Magento 2 : Data binding in Payment Method Selection

texts:
I want to display a custom field in "cash on delivery" payment method. I have created a custom module for this. But the field displays in all payment methods. Here is my code
html

                <input type="text" id="referencepo-code" name="referencepo-code" value="" maxlength="16" />

JS file

define(
    [
        'jquery',
        'uiComponent',
        'knockout',
        'Magento_Checkout/js/model/quote'
    ],
    function ($, Component, ko,quote) {
        'use strict';

        return Component.extend({
            defaults: {
                template: 'NameSpace_Module/checkout/order-rpo-block'
            },
            initialize: function() {
                this._super();
                var self = this;
                self.rpoVisible = ko.observable(false);

                quote.paymentMethod.subscribe(function(method){
                     if(method.method == 'cashondelivery'){
                        self.rpoVisible = true;
                        console.log(method.method);
                    }else{
                        self.rpoVisible = false;
                    }
                }, null, 'change');

            },

        });
    }
);

Using this I got the payment method selection. But it is visibile in all payment methods. Please help me to resolve the issues.

Reference: Magento 2 : Event Observer For Payment Method Selection


texts:
I have a javascript file like this:

jQuery(document).ready(function($){
    var mainWindown = top.document;
    test = {
        teesping_vesrion : '1.0.0',
        mainStuff : function(){
            var vars = {};
            this.doStuff();
            //refesh mini cart here
        },
        doStuff : function(){
         ......
        }
    )
})

i want to reload the minicart in  my mainStuff function, but i dont know how to integrate the below code to my javascript file, which is to reload minicart:

<script>
  require([
    'Magento_Customer/js/customer-data'
  ], function (customerData) {
    var sections = ['cart'];
    customerData.invalidate(sections);
  });
</script>


texts: I am having this issue the the admin panel is not loading properly. I don't know what the problem is.


texts: Magento 2 add custom css to custom theme file

texts:
I created a custom less file in

\app\design\frontend\Vendor\theme\web\css\source

I don't know how to compile it and how to imports this file in style-l.css

please give your suggestions


texts: Magento 2.3.3 - How to solve Unable to load theme by specified key

texts:
Front End :

Note : theme 327k is my magento 1.9 theme

Back End :

How to solve the theme error after migrate m1 to m2


texts: Changing a custom attribute's sort order in Default Product Listing Sort By in Display Settings

texts:
I have a custom attribute called Select Photographer which appears in the category display settings area like so:

This then allows users to use the Sort By to Group Photographers By Name A-Z or Group Photographers By Name Z-A in the front end.

Unfortunately, when selected as the default, it seems to auto sort by DSC. I'm not sure why this is the case, as this was put in by some freelancers who I have since parted ways with.

I have searched endlessly to try and find the responsible code for this, but can't find it anywhere. I'm thus wondering the best way to make this attribute default sort in the other direction ? Perhaps I should put an If statement in app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php which says if the attribute is this, default sort by ASC?

public function setDefaultDirection($dir)
{
if (in_array(strtolower($dir), array('asc', 'desc'))) {
$this->_direction = strtolower($dir);
}
return $this;

The problem is, I don't want to affect the Sort By Group By Photographer options on the front end, only when this attribute is set via the back end. I also only want the change in sort order to occur for this attribute.

I have also tried simply making Group by Photographer A-Z option selected via the HTML, but that doesn't work either. Though, if there was a way to disable Magento's default sort by, it could be a viable work around.

Any help is much appreciated! Thanks


texts: How to Manage two instances from One instance

texts:
The scenario is we have 5 websites under the global website in one instance[M1], the challenge is one website needs to be deployed in a different region.
The solution we have till now is to deploy a separate instance[M2] for that region, in this scenario is there a possibility that we can still manage this instance[M2] from the instance[M1] where our global and rest of the site is deployed?
Or any other way around for this problem.


texts: How could I get all the abandoned carts with customer's email (programatically)? What does Magento consider as being abandoned? Not updated in the last day?


texts: 1.9.3.4 Different shipping address stuck

texts:
I upgraded to 1.9.3.4 from 1.9.3.3.

When I go through checkout and select ship to a different address other than billing no form keys seem to be present in the header. (saveShipping)

When you go through checkout and select ship to this address form keys are used (saveShipping method)

I have reverted from my template back to rwd which is default.

I have been through all of the onecart and multishipping files in base and rwd folders, and all appear to be correct based on other peoples issues previously.

If I switch form keys off it all works, and I can get to payment section.

Does anyone have any thoughts or areas where to look?

Thanks


texts:
I want to add a custom attribute to customer using the following piece of code.
The file is located at vendor/module/Setup/InstallData.php. I run magento setup:upgrade successfully. But the new attribute does not show in admin. What's wrong with it?

<?php

namespace vendor\module\Setup
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Config;

class InstallData implements InstallDataInterface {

    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory, Config $eavConfig) {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig = $eavConfig;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
                \Magento\Customer\Model\Customer::ENTITY, 'sample_attribute', [
            'type' => 'int',
            'label' => 'Sample Attribute',
            'input' => 'select',
            'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
            'required' => true,
            'default' => '0',
            'sort_order' => 100,
            'system' => false,
            'position' => 100
                ]
        );
        $sampleAttribute = $this->eavConfig->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'sample_attribute');
        $sampleAttribute->setData(
                'used_in_forms', ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address']
        );
        $sampleAttribute->save();
    }

}


texts: Fatal error: Uncaught Error: Call to a member function getBackendModel() on null in magento 2.1

texts:
I am trying to import customers via CSV but getting error Fatal error: Uncaught Error: Call to a member function getBackendModel() on null in via CSV file. I am uploading 5000 customers but getting error.
when I upload 10 customers than getting this error "General system exception happened". both error getting on these conductions.


texts: magento1.9: Index page showing blank in admin panal

texts:
Index page showing blank in admin panel.as shown below image:

No error found anywhere. How can I solve this? Please help.

I have tried this link : https://stackoverflow.com/questions/23285181/magento-index-management-page-just-shows-blank. But no result.


texts:
I am facing some wired issue after importing my database file.
After importing when I try to access my admin login page(http://example.com/admin) its redirection to 404 error and url is changing (https://example.com.com/index.php/index.php/admin).

I checked all the answer related admin url redirecting 404 issue but I am not able solve this one.

Am I missing any data after importing database? because I checked this link may I need to add those mysql code in my sql file before importing.

Please help me guys? I am lost.:(

Update:
output of query: select * from core_config_data where path like 'web%secure/base_url';

+-----------+----------+----------+-----------------------+------------------+
| config_id | scope    | scope_id | path                  | value            |
+-----------+----------+----------+-----------------------+------------------+
|         8 | default  |        0 | web/unsecure/base_url | {{base_url}}     |
|        13 | default  |        0 | web/secure/base_url   | {{base_url}}     |
|      1511 | websites |        1 | web/secure/base_url   | http://example.com/  |
|      1513 | websites |        1 | web/unsecure/base_url | http://example.com/  |
|      1518 | stores   |       17 | web/unsecure/base_url | https://example.com/ |
|      1519 | stores   |       17 | web/secure/base_url   | https://example.com/ |
|      1520 | stores   |        1 | web/unsecure/base_url | https://example.com/ |
|      1521 | stores   |        1 | web/secure/base_url   | https://example.com/ |
+-----------+----------+----------+-----------------------+------------------+


texts:
I am trying to understand the fields present in rating_option_vote table.
Every review has one rating_option_vote associated with it.

As per my understanding, rating_option_vote contains the value of the rating given for the review along with other fields of course.

But, what's the use of percent field in rating_option_vote table?


texts: Problem with my observer when customer is Logout

texts:
i create my observer for change price at cart page

My config.xml is

      <events>
          <checkout_cart_product_add_after>
              <observers>
                 <brain_priceedit_model_observer>
                    <type>singleton</type>
                    <class>Brain_Priceedit_Model_Observer</class>
                    <method>updatePrice</method>
                 </brain_priceedit_model_observer>
             </observers>
          </checkout_cart_product_add_after>
      </events>

and my Observer.php is

public function updatePrice( Varien_Event_Observer $obs )
 {
    $quote = $obs->getEvent()->getQuote();
        $item = $obs->getQuoteItem();
        $product_id=$item->getProduct_id();
        $_product=Mage::getModel('catalog/product')->load($product_id);
        $newprice=$_product->getPrice();
        echo$price=$newprice*10;
        $item->setCustomPrice($price);
        $item->setOriginalCustomPrice($price);
        $item->getProduct()->setIsSuperMode(true);
  }

this observer working when customer is log in but when customer not log in it's show error like this


texts:
I am trying to display the label for my attribute (i.e. 'color:'). I have added the following code to my 'media.phtml' file:

<div class="color-option">
<?php echo $_product->getAttributeText("color"); ?>
</div>

Which displays the value. But how do I get it to also show the label?


texts: products gallery not export in magento 1.9.1.0

texts:
I have exported all products from Import/Export >> Dataflow profiles.

but products gallery images are not exported in csv file.

Is there any setting in magento?


texts: i want to show alert if not select any of two options in magento 2 under specfic shipping mathod


texts:
I am facing a long lasting issue on this command

  bin/magento setup:upgrade

I have made an extension hello world on magento2 stable version, which will simply print hello world on screen.

The thing is when I ran that....it gave me setup version, not specified error (though I have specified)...then I searched & ran this command -

  bin/magento setup:upgrade

When I ran above command then I met with another error....pdo_mysql is not installed....

Then I solved that error with the following commands:
sudo apt-get install php5-mysql
sudo apt-get install pdo-mysql

then by doing php -m I could see the pdo_mysql in extensions list :)

But then as ran that command (bin/magento setup:upgrade) again....I got another error (very frustrated). Please check the attachment.

For solving that error I referred this one.... https://stackoverflow.com/questions/11990708/error-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysq

I typed this: sudo find / -type s
so I got the list in that one of the line is like this......
/opt/lampp/var/mysql/mysql.sock

now in that article, it says......"Once you find where the socket is being opened, add or edit the line to your /etc/my.cnf file with the path to the socket file".........so I opened /etc/my.cnf but....I found that the line is already there.....socket = /opt/lampp/var/mysql/mysql.sock

Then it says to run this : kill -9 4969 or pkill -9 mysqld but I did not run...I am afraid it can cause damage to xampp...

Then it says....."After you do this you might want to look for a pid file in /var/run/mysqld/ and delete it" but the thing is I can not find mysqld folder inside var/run/ so I am confused what to do now....

Many times I restarted xampp by first stopping apache like this:
sudo /etc/init.d/apache2 stop

But could not resolve the issue...

Can anyone please give the correct solution?

Magento 2 becomes a big problem running in Ubuntu for me :)


texts: Shipping rates based on product type and quantity?

texts:
I have a requirement where I have to calculate shipping rates based on many conditions, below will impact the rates:

Summer or Winter
Different Containers (4 containers)
Different types of products (6 types)
Combinations of products in cart (qty based)

So let's see an example,
If below products have been added to cart,

(2 qty) Product Type 1 - Container 1 - Type 1 - Summer
(1 qty) Product Type 2 - Container 2 - Type 1 - Summer

then rates will come based on that combination.

It's hard to explain, but I want to know how to startoff with such type of product-based shipping calculations.

Thanks


texts: Magento 2 : Static blocks with products on category landing page

texts:
I am stuck in a situation here, In Magento 2 Category settings and I wants approaches from you guys.

In Magento 2 I have created a category with Static blocks with products to show settings on the landing page. The category landing page is coming with static block and products with pagination.There is also layered navigation section on the left sidebar.

What I want?

When the user clicks on any filter attribute or pagination link then It should show only filter product list. But it is showing filter product list with the static block.

So, What approach should I follow?


texts: Pull variables from sucess page for Google trusted store

texts:
i want to pull variables from the order confirmation/sucess page and pass these variables to Google trusted store script. Trusted store script is of this format

  MERCHANT_ORDER_ID
  DOMAIN
  CUSTOMER_EMAIL
  CUSTOMER_COUNTRY

    ITEM_NAME
    ITEM_PRICE

Has someone implemented Google Trusted Store for Magento? Any kind of help would be appreciated.
Thanks


texts: Remove zoom from product image on product details page

texts:
I want to remove zoom functionality from product image on product view page, but I am not sure how to do so.
It will be a great help if anyone can guide me to achieve this.

I have tried below code in app/design/frontend/Custom/theme/etc/view.xml

<vars module="Magento_Catalog">
        <var name="magnifier">
            <var name="enabled">false</var> <!-- Turn on/off magnifier (true/false) -->
        </var>
    </vars>

But it is not working.


texts:
This question has been asked multiple times, but none of them have a clear solution and those few cases who should work (according to authors) are definitely not working properly in the current version of Magento, at least for us.

I have setup the following code based on various snippets from overflow and magento stackexchange:

require_once('app/Mage.php');

Mage::app('default');
Mage::app ()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('image', array('neq' => 'no_selection'));

$i = 0;
foreach($products as $product)
{
    echo  $i++.": ".$product->getSku() . " has no image \n
\n";
}

When I run this on Magento CE 1.9 on a large shop with thousands of configurable products, I get way more products than it should. The code presents me with a list of way over 1k products, a lot of them with working products with images (products without images should be less than half that figure).
Plus, I picked some random products from which I knew that they had no images and searched for their SKU in the result list from above's code: I couldn't find any of them.

tl/dr: this list is some product listing, but there is no easily discernable connection between the list and "products without images".

I am quite new to all this collection business and Magento in general.

What is the definite indicator of a product which clearly says: "I have no image"?

How would one need to change the code above to properly work with current iterations of Magento CE?

--- UPDATE ---

The following code provides me with a readable list of all products without images, but I can't use this code on the page to hide products without images. How can I translate this into an extended filter?

$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('type_id',array('eq'=>'configurable'));

$i = 1;
foreach($products as $product)
{
    if ($product->getImage() == NULL) {
        echo $i++.": ".$product->getSKU(). " - ".$product->getName()." has no image!
";
        echo "
";
    }
}

A filter including all of this should probably look something like this:
However, this does not work. This simply generates me a list of all configurable products WITH images. I tried inversing the image-attribute related filters, but to no avail. The list does not change. What did I miss regarding the filters?

$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter(array(
    array (
        'attribute' => 'type_id',
        'eq' => 'configurable'
    ),
    array (
        'attribute' => 'image', // null fields
        'null' => true
    ),
    array (
        'attribute' => 'image', // empty, but not null
        'eq' => ''
    ),
    array (
        'attribute' => 'image',
        'like' => 'no_selection'
    )
));


texts: How Magento(Community Edidtion) checks if customer/user is logged in?

texts:
This problem is more theoretical than practical. Im writing cms security work for my studies. I managed to find how Magento deals with XSS, CSRF, SQL injection, etc. But I cant find how and where Magento checks if admin user and customer is logged in, how Magento controls access to its parts.

Can someone, please, explain where in the code Magento Community Edition checks if user is logged in or if session exists? And give some examples or at least files or directories where to look in?


texts:
I am using Magento 2.1.7 and want to programatically load a specific store view on my multi-site based on what country a user is in when they arrive on our website. However in Magento 2 I am not sure how to do this. I tried doing the below. However it does not seem to work?? Any suggestions?

I have the below code

//lets redirect user to a country specific store based on where they are from
$myipaddressis = $_SERVER['REMOTE_ADDR'];
$mycountryis = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);

if($mycountryis =='DE')
  {
    //$this->_objectManager->get('Magento\Store\Model\StoreManagerInterface')->setCurrentStore(1);
  }
if($mycountryis =='GB')
  {
    //$this->_objectManager->get('Magento\Store\Model\StoreManagerInterface')->setCurrentStore(2);
  }


texts: I have added a js files in pub/media/custom.js is not updating on frontend in magento 2

texts:
I have added JS file in pub/media folder and put permission of 777. and given link in content->design->configuration-website

<script type="text/javascript" src="https://#/pub/media/custom.js"></script>

After doing this i am getting file and also first time code in browser. but when i am updating this file it's not updating on browser.


texts: Magento 2: Setup version for module is not specified

texts:
I was working on the Magento 2 CE, in which Data Migration Tool was already installed. I cleared the root folder and installed fresh Magento 2 EE in that folder. I also truncated the database of CE and import the fresh database of EE.

So at this point, everything is new and fresh. There is no third party module in it. But when I run the site, I get this weird error:

  Setup version for module 'Magento_DataMigrationTool' is not specified

I don't know what's wrong with it. Why is system thinking that I had installed Data Migration Tool? (Same-store is working fine in my local system.)

I then tried to place Data Migration Tool explicitly in vendor/magento/ and inserted an entry in setup_module and config.php but I am still getting the same error.

(I am running Magento on nginx)


texts: Magento 2 how to remove “SKU field” via Layout Update XML?

texts:
I'm stuck on this:

I need to remove the SKU field from product page only for few products, I'm sure that I can do it with "layout update XML" tab but all my attempts have failed.. any help? :)


texts:
Got this two error

  Warning: include_once(Mage.php): failed to open stream: No such file
  or directory in
  /home/XXXX/public_html/downloader/lib/Mage/Autoload/Simple.php on line
  49 Warning: include_once(): Failed opening 'Mage.php' for inclusion
  (include_path='.:/usr/lib/php:/usr/local/lib/php') in
  /home/XXXX/public_html/downloader/lib/Mage/Autoload/Simple.php on line
  49

I don't know what to do. I've tried to search online but it doesn't help. Please help. I'm new in Magento. Your help will be appreciated. Thanks..