texts:
In my project, I have a url like this localhost/oldedge/catalog/category/view/id/37 which I am trying to pass as ajax request. So, to do this, I overrided the viewAction() in CategoryController file from my new module.

Can someone suggest me what to write in the new viewAction method so that I can get the response as just the list of products related to that passed id's category? (i.e 37, if I understand correctly)

I am not good in both ajax and PHP.

old "viewAction() method"

public function viewAction()
{
    if ($category = $this->_initCatagory()) {
        $design = Mage::getSingleton('catalog/design');
        $settings = $design->getDesignSettings($category);

        // apply custom design
        if ($settings->getCustomDesign()) {
            $design->applyCustomDesign($settings->getCustomDesign());
        }

        Mage::getSingleton('catalog/session')->setLastViewedCategoryId($category->getId());

        $update = $this->getLayout()->getUpdate();
        $update->addHandle('default');

        if (!$category->hasChildren()) {
            $update->addHandle('catalog_category_layered_nochildren');
        }

        $this->addActionLayoutHandles();
        $update->addHandle($category->getLayoutUpdateHandle());
        $update->addHandle('CATEGORY_' . $category->getId());
        $this->loadLayoutUpdates();

        // apply custom layout update once layout is loaded
        if ($layoutUpdates = $settings->getLayoutUpdates()) {
            if (is_array($layoutUpdates)) {
                foreach($layoutUpdates as $layoutUpdate) {
                    $update->addUpdate($layoutUpdate);
                }
            }
        }

        $this->generateLayoutXml()->generateLayoutBlocks();
        // apply custom layout (page) template once the blocks are generated
        if ($settings->getPageLayout()) {
            $this->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());
        }

        if ($root = $this->getLayout()->getBlock('root')) {
            $root->addBodyClass('categorypath-' . $category->getUrlPath())
                ->addBodyClass('category-' . $category->getUrlKey());
        }

        $this->_initLayoutMessages('catalog/session');
        $this->_initLayoutMessages('checkout/session');
        $this->renderLayout();
    }
    elseif (!$this->getResponse()->isRedirect()) {
        $this->_forward('noRoute');
    }
}

New "viewAction() method"

public function viewAction()
{
    if ($category = $this->_initCatagory()) {
       //Here I am trying to send response as only the list of products related to that category.
    }
}

Right now, what I am trying to show is a alert box with the response from php.

main.js

jQuery(function(){
    jQuery('#nav a').on('click',function(){
        var url = jQuery(this).attr('data-href');
        alert(url);
        //ajax call here
        jQuery.ajax({
            url: url,
            success: function(response) {
                result = response;
                alert(response);
            }
        });
    });
});

The above jquery code is showing response as complete html page if I try the old "viewAction" method from CategoryController.php.


texts: Magento2 - Change "LINKS" CSS class in footer

texts:
I would like to change the div class "links" to something like "footerlinks", so if I change the css only the footer links are affected and not all divs with "links" as a class.

Below you can see which div class I mean.

Info: I want to change the class so I can have the linksblock in the footer side by side. Currently it is side by side because i changed style of ".links", but all the other CSS blocks with the class "links" are screwed up now..


texts: Using Enterprise core modules in Community Edition

texts:
I have been working with Magento for quite a while now. This is not a question related to coding.

I was just wondering, if one copies a module from EE to CE, will it work?

For example, the customerbalance module used for store credit in EE. If I just extract the module files from EE and paste it into CE, will it work? At least, theoretically?

I am aware some modules may extend classes from other Enterprise modules. But if it doesn't will this work?

PS: I researched on Google, and surprisingly I couldn't find any post related to this.


texts: Paypal's Address Saved As Default Address

texts: A new customer who makes a virtual product purchase through paypal has their billing address passed to Magento.  The address is attached to the order but is not attached to the customer.  What would be the best way to attach this to the customer and also set it as the default billing address on their account?


texts: Increase session time of Magento 2 admin panel

texts: How to increase admin panel's session time ?


texts: Generate options category list with PHP instead of xml

texts:
I have a list of options grouped by category

I did it with xml

   <field name="categorie_id">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magento\Catalog\Ui\Component\Product\Form\Categories\Options</item>
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Category</item>
                <item name="componentType" xsi:type="string">field</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                <item name="dataScope" xsi:type="string">categorie_id</item>
                <item name="filterOptions" xsi:type="boolean">false</item>
                <item name="showCheckbox" xsi:type="boolean">true</item>
                <item name="chipsEnabled" xsi:type="boolean">true</item>
                <item name="disableLabel" xsi:type="boolean">true</item>
                <item name="levelsVisibility" xsi:type="number">1</item>
                <item name="multiple" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">20</item>
                <item name="listens" xsi:type="array">
                    <item name="newOption" xsi:type="string">toggleOptionSelected</item>
                </item>
                <item name="required" xsi:type="boolean">true</item>
                <item name="source" xsi:type="string">conditions</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>

Now I want to do the same thing with PHP

$fieldset->addField


texts: Magento 2 - Sales Orders afterSave plugin not working

texts:
I have created a plugin so that I can process the order and send to a 3rd party after it has been placed. I have hooked into the afterSave functionality and my plugin code looks like this

di.xml

<type name="Magento\Sales\Api\OrderRepositoryInterface">
    <plugin name="Module_OrderAfterSave" type="Vendor\Module\Plugin\OrderAfterSave" sortOrder="10" disabled="false" />
</type>

OrderAfterSave.php

namespace Vendor\Module\Plugin;

use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Framework\ObjectManagerInterface;

class OrderAfterSave
{
    protected $objectManager;
    protected $orderRepositoryInterface;

    public function __construct(
        ObjectManagerInterface $objectManager,
        OrderRepositoryInterface $orderRepositoryInterface
    ) {
        $this->objectManager = $objectManager;
        $this->orderRepositoryInterface = $orderRepositoryInterface;
    }

    public function afterSave($order)
    {
        //Insert into database
        $ordersModel = $this->objectManager->create('Vendor\Module\Model\Orders');
        $ordersModel->setSentTo3rdParty(1);
        $ordersModel->save();

        return $order;
    }
}

The issue I have is that when the customer places an order they are redirected back to the basket page instead of a success page.

When I check in the admin I can see the order has gone through and when I check the custom database table I can see its been updated.

There are no errors in any of the logs so not really sure why customers never see the order success page. Could anyone advise?


texts: How to optimize my indexes cron execution?

texts:
I'm checking how to optimize my cron execution in the reindex action, and I saw the option to run the index job in a separated process.

How does it work? can it be helpful to optimize the execution?


texts: Magento 2.1 Web setup wizard missing in backend

texts:
Running Ubuntu 16,04, Nginx, Mariadb, phpmyadmin, redis and Magento 2.1 GA

Why am I missing web setup wizard in backend?


texts:
I want to use MailChimp on Magento 2 . for use in the footer for a subscriber and in a popup. So there are two ways on internet  1 is using through GitHub and 2nd installing from admin side . which is better?

  https://github.com/mailchimp/mc-magento2

or

  https://marketplace.magento.com/mailchimp-mc-magento2.html

And how I will connect it to footer and popup?


texts:
I need a add to cart URL for add the product to cart by open this URL in any browser.
I get the add to cart URL by this:

Mage::helper('checkout/cart')->getAddUrl($simple_product)

output of above line is: :

http://192.168.0.78/pooja/testmagento/index.php/checkout/cart/add/uenc/aHR0cDovLzE5Mi4xNjguMC43OC9wb29qYS90ZXN0bWFnZW50by9pbmRleC5waHAvYWRtaW4vc3lzdGVtX2NvbmZpZy9lZGl0L3NlY3Rpb24vd2VvX3Byb2R1Y3RsaXN0L2tleS80YmI4NDEyZTg0ZWZjOTFhMmU1NWY4ZTkwNmIxOGY4OC8,/product/2/form_key/rnDRYdCccnTmYsRN/

When i hit the above URL, product is not add to cart. Empty cart page is appeared.

Any idea, how to solve it?


texts: Fatal error: Uncaught Error: Class 'Cm_Cache_Backend_File' not found

texts:
Going through an upgrade from 2.2.6 to 2.3.1 and i have this populating on the frontend.

Additionally, on command line if i try to run an upgrade or pretty much anything even php bin/magento list i throw this error:

Fatal error: Uncaught Error: Class 'Zend\ModuleManager\Listener\ListenerOptions' not found in /srv/public_html/vendor/zendframework/zend-mvc/src/Service/ModuleManagerFactory.php:41
Stack trace:
#0 /srv/public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(747): Zend\Mvc\Service\ModuleManagerFactory->__invoke(Object(Zend\ServiceManager\ServiceManager), 'ModuleManager', NULL)
#1 /srv/public_html/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(195): Zend\ServiceManager\ServiceManager->doCreate('ModuleManager')
#2 /srv/public_html/setup/src/Magento/Setup/Application.php(35): Zend\ServiceManager\ServiceManager->get('ModuleManager')
#3 /srv/public_html/vendor/magento/framework/Console/Cli.php(71): Magento\Setup\Application->bootstrap(Array)
#4 /srv/public_html/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#5 {main}
  thrown in /srv/public_html/vendor/zendframework/zend-mvc/src/Service/ModuleManagerFactory.php on line 41

I'm desperate here, i feel like i've tried about everything.


texts: Custom field to be set as default filter while opening a sales order grid page in magento 2

texts: Can't get the data collection for sales order grid, I have to add filter and show the sales order grid in admin grid page in magento-2


texts:
I am using below code for newsletter subscription.

$email = 'test@email.com';
$subscriberFactory = $objectManager- >get('\Magento\Newsletter\Model\SubscriberFactory');
$subscriberFactory->create()->subscribe($email);

It is working fine, how can i add first name and last name as well as type also? Is it possible that way?


texts:
Magento 2 website speed very slow as per https://developers.google.com/speed/pagespeed/insights/

Result of site:-

Reduce server response times (TTFB) - 1.68 s
JavaScript execution time - 2.9 s

Almost 250 request sends to server. So, google page speed gives 4/100 for mobile and 46/100 for desktop.

We already enabled minify js, merge js, minify css and merge css from backend.
Also, HTTP2 protocol used to send all request. We use built in cache in production mode.

We do not use Bundling because its create almost 7.5 MB file so takes more time to load resources.

Please help me to improve page speed around 85/100 for desktop at-least.


texts: How to open a 600x400 pop up window, and show a static .html file, from a theme .phtml file?

texts:
I'm using Magento 1.9 with the latest version of Ultimo Theme.

We used to use FancyBox to show some static .html files, from template .phtml files. But that does not work anymore, after upgrading to latest version of Ultimo Theme.

Is there any other way to show a simple static .html file, in a 600x400 popup window in Magento 1.9, using the Ultimo Theme?

Thanks,


texts: How to create a secondary buttons list on Order Admin Grid Magento 2?

texts:
I need to add some group filters to Order Admin grid, so I want to create a secondary buttons list on it.

How can I achieve that?


texts: Magento2: Requested product doesn't exist

texts: When I click on add to cart button product not added and redirect to product view page. Got the error message Requested product doesn't exist


texts: How to add custom column as link in sales order grid in magento 2

texts:
I wish to add a column as link in sales order grid. While clicking the link, I wish to perform some logic,

I have reffered the below link for magento 1 which is based on layout grid
add button inside custom column in sales order grid page

I need the same solution for magento 2

Many blogs are available to add custom column in sales order grid, but no luck

Thanks in advance


texts: Magento2 - How to apply new field without page refresh in checkout summary page?

texts: I have added one field for extra charges, depends on radio button selection in checkout page, its working with page refresh, but I want it to get data without page refresh.


texts: Magento attribute backend type changed varchar - tekst. No layered navigation anymore

texts:
I had to change my multiselect attribute backend type from varchar to text because I needed to select over 100 items. On varchar it would only save about 50 selections.

Now this works great, and I can save as many selections as needed. The problem now is when I activate the attribute for layered navigation it won't display on frontend. Can anyone help me fix this?


texts:
I am new to Magento 1.9. I have my own custom API which read last modified Product stock and do some updates. I need to make this API run every five minutes .
Please help.


texts: Admin create order view selected configuration options on item list

texts:
On the admin create order screen after selecting a product with configuration options, I want to show those options, at the moment it will only show the product title and sku.

The top part of the below image shows how it currently displays and the button half is how I would like it to display. With the size and colour changing depending on the option chosen. I have looked, but I am unable to see the size/colour in the html code of that page.

When the Configure button is clicked order.showQuoteItemConfiguration(100) that code fires and shows the different configuration options. I am unsure how that function gets the information or how to just pull the name of the option chosen.


texts: Product Carousel Extension Recommendation

texts:
I'm looking for a recommendation for a product carousel extension (not banner carousel - specifically for products!). I'm looking for something similar to the carousel which handles the 'Customers who bought this also bought' feature on www.dx.com.
Here's an example (near bottom of the page):
560N2 300Mbps 802.11b/g/n Wi-Fi AP / Repeater Adapter w/ 3dBi Antenna - White + Black (EU Plug)

It would be ideal if the carousel could be created in the backend and implemented via block/cms page by a non-developer.


texts: How to add an input to the admin customer account info form in Magento 1?

texts:
In Magento 1.9 there's this form in the magento admin:

What's the best way to add an additional checkbox input to this form? I need this new checkbox/flag to be saved to the database.


texts: Magento Navigation How To Keep on One Line

texts:
This seems like something simple, but just not working for me. I'm trying to change my styles.css to have the navigation stay on one line. Here is the code I think is relevant.

/********** < Navigation */
.nav-container {clear: both; width:70%; float: left; margin: 10px 0px 10px  }
#nav { margin:0 auto; padding:0; font-size:13px; }

/* All Levels */ /* Style consistent throughout all nav levels */
#nav li { position:relative; text-align:left; }
#nav li.over { z-index:998; }
#nav a,
#nav a:hover { display:block; line-height:1.3em; text-decoration:none; }
#nav span { display:block; cursor:pointer; white-space:nowrap; }
#nav li ul span {white-space:normal; }
#nav ul li.parent a {}
#nav ul li.parent li a { background-image:none; }
#nav a.category span { background: url(../images/nav-category.gif) no-repeat center right; padding-right: 20px; }

/* 0 Level */
#nav li { float:left; }
#nav li.active a { color:#2882ce; }
#nav a { font-size: 115%; float:left; padding:5px 50px 5px 0px; color:#303030; }
#nav li.last a { padding-right: 0px !important;}
#nav li.over a,
#nav a:hover { color:#2882ce; }

/* 1st Level */
#nav ul li,
#nav ul li.active { float:none; margin:0; padding-bottom:1px; background:#ecf3f6; }
#nav ul li.last { background:#ecf3f6; padding-bottom:0; }

#nav ul a,
#nav ul a:hover { float:none; padding:0; background:none; }
#nav ul li a { font-size: 100% !important; font-weight:normal !important; }

/* 2nd Level */
#nav ul,
#nav div { position:absolute; width:15em; top:27px; left:-10000px; border:1px solid #899ba5; }
#nav div ul { position:static; width:auto; border:none; }

/* 3rd+ Level */
#nav ul ul,
#nav ul div { top:5px; }

#nav ul li a { background:#ecf3f6; }
#nav ul li a:hover { background:#d5e4eb; }
#nav ul li a,
#nav ul li a:hover { color:#2f2f2f !important; }
#nav ul span,
#nav ul li.last li span { padding:3px 15px 4px 15px; }

/* Show menu */
#nav li ul.shown-sub,
#nav li div.shown-sub { left:0; z-index:999; }
#nav li .shown-sub ul.shown-sub,
#nav li .shown-sub li div.shown-sub { left:100px; }
/********** Navigation > */


texts: Add column to customer_grid_flat from customer_entity.update_at

texts: I would like to ask how to create a new column in customer_grid_flat that will be named updated_at and will get the values from customer_entity.update_at. Tried indexer but it does not add any columns in the customer_grid_flat table. Need help! Thanks!


texts: Magento 2.4.1 Uncaught TypeError: Cannot read property 'imageTemplate' of undefined

texts:
My Magento store was working fine before updating to the latest version of Magento then I started getting this error and now none of the images load and the checkout doesn't work anymore.
Uncaught TypeError: Cannot read property 'imageTemplate' of undefined
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

define([
    'uiComponent'
], function (Component) {
    'use strict';

    return Component.extend({
        /** @inheritdoc */
        initialize: function () {
            this._super();

            this.template = window.checkout.imageTemplate || this.template;
        }
    });
});


texts: Magento 1.9.3.1 email template for set password by admin not existing in transaction mails?

texts:
I got a strange problem with email template for this case and can't find the correct template.

How to reproduce:

admin user => Admin -> customers -> manage customer ->... -> change password
Now the user get's a mail. But which template?

It seems like it is not possible to manage this template in admin section in transaction emails?

I thought it would be this but it does not work

-> System -> Setting  -> Customers -> customer configuration - > change Account Data => changed Email or Password email template

I tried

-> create new template + load default template of "changed Email or Password email template"
=> this has only effect on the case if a user itsel changes the password via Frontend / Client Dashboard

Solution?

After long search i spoted this template:

\app\locale\de_DE\template\email\password_new.html

\app\locale\[language]\template\email\password_new.html

If i do changes in this template it shows the done changes. But this can't be the correct way to handle it?

I got 5? languages in the store. Do I realy need to modify it on filesystem for each language? and all other templates via admin.

Would be great if someone could share his experience with this specific template.


texts: Import CSV updates inventory quantity unexpectedly

texts:
When we import the following CSV file using the standard Magento import method (not Dataflow Profiles), the inventory quantity (qty) field is unexpectedly being updated to a value of 4 for the SKU's listed below:

sku,dropship_cost
90352,5.5
90386,5.5

I have tested this repeatedly and it continues to update the qty field in addition to the fields above. As I understand it, only the fields in the CSV should be updated.

Does anyone know why this is happening or indeed how to prevent it from happening?

We are running Magento CE 1.7.0.2.


texts:
I have an EC2 instance in AWS, running NGINX, php-fpm and 3 small magento stores. Each store has its corresponding RDS.

In one of the shops did the integration with S3 service, quietly.

However, in the other, the integration is done but the images are downloaded instead of displayed.

The store in question does not have the DNS propagated yet, I'm aecssando by inserting the field in the hosts file. Already the shop where the S3 is working is accessed directly via static IP assigned to instance.

Could anyone help me?


texts: Changing the Default Descriptions on Product Pages

texts:
On our store our Short Descriptions and Descriptions all have basically the same template when it comes to html but when we create new products the fields are all blank.  Just wondering if there is a way that I could plug in some html default text so when I create new SKU's the HTML can already exist and then I can either remove or add what I need?

i.e.
Short Descriptions are blank by default but being able to have
this Bullet List be the Default when I create a new product.

Manufacturer Warranty: Lifetime Workmanship Guarantee
Manufacturer Item Number:

same goes for the Description

content

Features:

Manufacturer Warranty: Lifetime Workmanship Guarantee
Manufacturer Item Number:

I can just make a sku and duplicate everything based on that single sku, was just wondering if I could make the changes myself without hassling our developers.

Thanks!


texts: Magento 2 Is it OK to create a database table directly via MySQL Management tool?

texts: Is it OK to create a new database table directly via MySQL Managentment tool instead of using intallData.php for Magento 2? I know it's technically possible, but is it OK to do it this way, and it won't break anything?


texts: Item (Magento\Catalog\Model\Product\Interceptor) with the same ID already exists

texts:
Magento 2.3.2

Item (Magento\Catalog\Model\Product\Interceptor) with the same ID "48" already exists.

I've checked all the advice where people have had this issue and nothing helps. There do not appear to be any duplicates in the database, not in urls, not in stock, no multiple website IDs, nothing.

I can fix it by removing the affected products from all categories.
Weirdly if I go into the category and remove the product this does not help, only if you go into the product and remove it from all categories.

I've reverted to the blank theme and disabled custom extensions.


texts: Magento 2 How can I hide Product Price in limit e.g From $61.00 To $77.00

texts: Actually I hide the Prices of all the products n I was expecting that the Limit Product price will be also hide but it was not hidden. I'm going to upload Image for you guys clearance. Thanks in Advance


texts: Magento 2 - get list of all manufacturers in a category

texts:
I am trying to get a list of all manufactures (brands) in my block for the current category. (Essentially the "Brands" filter in the layered navigation). This is my current code:

<?php
namespace Sulman\Brands\Block;

class Collection extends \Magento\Framework\View\Element\Template
{
    protected $_categoryFactory;
    protected $_registry;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\CategoryFactory $categoryFactory,
        \Magento\Framework\Registry $registry,
        array $data = [])
    {
        $this->_registry = $registry;
        $this->_categoryFactory = $categoryFactory;
        parent::__construct($context, $data);
    }

    public function getBrands()
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $categoryId = 3;

        $resource = $objectManager->get(\Magento\Framework\App\ResourceConnection::class);
        $connection = $resource->getConnection();

        $select = $connection->select()->from(['ea' => $connection->getTableName('eav_attribute')], 'ea.attribute_id')
            ->join(['eea' => $connection->getTableName('eav_entity_attribute')], 'ea.attribute_id = eea.attribute_id')
            ->join(['cea' => $connection->getTableName('catalog_eav_attribute')], 'ea.attribute_id = cea.attribute_id')
            ->join(['cpe' => $connection->getTableName('catalog_product_entity')], 'eea.attribute_set_id = cpe.attribute_set_id')
            ->join(['ccp' => $connection->getTableName('catalog_category_product')], 'cpe.entity_id = ccp.product_id')
            ->where('cea.is_filterable = ?', 1)
            ->where('ccp.category_id = ?', $categoryId)
            ->group('ea.attribute_id');

        $attributeIds = $connection->fetchCol($select);
        // attributeIds is empty.
        foreach ($attributeIds as $filter){
            echo "x";
        }
    }
}

I took this code from here: http://www.sivaschenko.com/magento2-category-layered-navigation-filterable-attributes/

Nothing is returned.


texts: How do I programmatically load a specified sales rule in Magento 2?

texts:
In Magento 1 EE, I was able to get sales rule information from product list page with the following:

$rule = Mage::getModel('salesrule/rule')->load($ruleId);
$isActive = $rule->getIsActive();
$fromDate = $rule->getFromDate();
$toDate = $rule->getToDate();
$label = $rule->getStoreLabel();

How can I accomplish the same thing in Magento 2?


texts: Magento2.3 Multiwebsite Single domain in subdirectories

texts:
We are trying to set up a new Magento 2.3 instance to have multiple websites under a single domain.

I have read most of the posts based on this situation, but most either talk about multiple domain or using apache and therefore .htaccess.

We are using nginx and the default .conf that is given by Magento base install.

Our client has multiple locations based on countries e.g. UK, NY, Chengdu and each location has multiple languages. For this reason we would like to set up the locations as websites and the URL structure to be:

https://example.com/uk/

https://example.com/ny/

https://example.com/chengdu/en

https://example.com/chendgu/cn

We have set up the websites with the correct store views.

We have set the based URL's on a website level to the same as above.

I have tried to created directories in /pub for the locations and copied in the index.php.

I have tried setting the MAGE_RUN_* codes in nginx.

But the closest I have got to getting this working is every page under a website (/uk) 404'ing.

What I am asking for is if someone could point me in the right direction to the correct nginx configuration to make websites work like this without 404ing?

The structure has to be like this and not under different domains or subdomains.

Thanks


texts: phpcs Use ::class notation instead warning on attribute source field

texts:
I've created a setup script to load from a source model

$eavSetup->addAttribute(
    \Magento\Catalog\Model\Category::ENTITY,
    'location_reference',
    [
        'type' => 'varchar',
        'label' => 'Location Reference',
        'input' => 'select',
        'sort_order' => 500,
        'source' => 'Xigen\Data\Model\Category\Attribute\Source\LocationReference',
        'global' => 1,
        'visible' => true,
        'required' => false,
        'user_defined' => false,
        'default' => null,
        'group' => 'General Information',
        'backend' => '',
    ]
);

Works great.  However using the official https://github.com/magento/magento-coding-standard ruleset it showed the following warning.

Use ::class notation instead

And sure enough checking a file in vendor at random

Magento\Catalog\Setup\UpgradeData

$categorySetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY,
    'custom_layout',
    [
        'type' => 'varchar',
        'label' => 'New Layout',
        'input' => 'select',
        'source' => \Magento\Catalog\Model\Product\Attribute\Source\Layout::class,
        'required' => false,
        'sort_order' => 50,
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
        'group' => 'Schedule Design Update',
        'is_used_in_grid' => true,
        'is_visible_in_grid' => false,
        'is_filterable_in_grid' => false
    ]
);

Can someone explain more in detail why this syntax is used? Why it is recommended?


texts: Migrating to Magento 2 "crypt_key" option is not defined the configuration

texts:
When Running the transfer tool I get the error "crypt_key" option has not defined the configuration.

This is from local.xml on the old site

<crypt>
        <key><![CDATA[adfabde1a4e1533ec61eae16e58abb66]]></key>
    </crypt>

Here is the xml.config

<options>

<crypt_key>adfabde1a4e1533ec61eae16e58abb66</crypt_key>

Anyone have an idea what is wrong?


texts: How to add custom block after store select page in admin order create flow and get it working

texts:
I am trying to add a custom block to appear after store select page, which is having a dropdown selection (same like store select page) in admin order create flow. This needs customer id to populate data but I am not able to access that. How I can get this working and get this selected value saved with order in Magento 2?
Appreciate any help in implementing this.


texts: Change Additional product Images based on the selection of color (custom option) Magento 2

texts:
I want to change the additional images based on the selected color on the product page.

There are many custom options on the product page. My requirement is that, change the additional gallery images based on the selected color.

Please see attached image for further information.

Note: This is the simple product having custom options.

Please guide me how i can do this functionality?
Your help would be appreciated.


texts: Need to check if a product has a tier price

texts:
I have a problem i cant figure out (mainly because of my lack of experience) When i search for an product which is a grouped product it shows the lowest price which is what i need. However some of these product have tiered prices as well (buy 5 for £3) so i want the tiered price to be displayed on the search and product list pages. I have found the code which displays the lowest price, but i dont know how to check if the product has a tiered price and if so to diplay that price instead of the lowest. I assume you would need an IF statement to check where there is a tiered price on any of the products and if true then display it but i do not know how to code this.

This is the code which is being using to display the lowest price:

<?php else: /* if (!$_product->isGrouped()): */ ?>

    <?php
    $showMinPrice = $this->getDisplayMinimalPrice();
    if ($showMinPrice && $_minimalPriceValue) {
        $_exclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue);
        $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, true);
        $price = $showMinPrice ? $_minimalPriceValue : 0;
    } else {
        $price = $_convertedFinalPrice;
        $_exclTax = $_taxHelper->getPrice($_product, $price);
        $_inclTax = $_taxHelper->getPrice($_product, $price, true);
    }
    ?>
    <?php if ($price): ?>

            <p<?php if ($showMinPrice): ?> class="minimal-price"<?php endif ?>>
                <?php if ($showMinPrice): ?>
                    <?php echo $this->__('As low as') ?>
                <?php endif ?>
                <?php if ($_taxHelper->displayBothPrices()): ?>

                        <?php echo $this->helper('tax')->__('Excl. VAT') ?>
                        <span class="price"
                              id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                            <?php echo $_coreHelper->formatPrice($_exclTax, false) ?>

                <?php else: ?>
                    <?php
                    $_showPrice = $_inclTax;
                    if (!$_taxHelper->displayPriceIncludingTax()) {
                        $_showPrice = $_exclTax;
                    }
                    ?>
                    <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                    <?php echo $_coreHelper->formatPrice($_showPrice, false) ?>

                <?php endif; ?>

    <?php endif; /* if ($this->getDisplayMinimalPrice() && $_minimalPrice): */ ?>
<?php endif; /* if (!$_product->isGrouped()): */ ?>

I assume the If statement would off like this:

if ( $_product->getTierPrice()): ?>

<?php endif; ?>

My main issue is I am not sure what to put inside the statement or where to put it.

If anyone could help that would be great. Also if i have not been to clear or you need more information just let me know.

Thank you


texts: In Admin (WYSIWYG) How do I change the name (through code) of my custom widget to something else than "magento widget"? Is it possible to change the icon for it as well?


texts: Product import : SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row

texts:
I am trying to import a CSV file for products. When clicked on "check data" button, it says "File is valid! To start import process press 'Import' button "

but when I click on the import button, I get the following error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row

Here is the LINK to my csv file.


texts: If you're running Magento 2 in a cluster, it is recommended to identify a master node that is responsible for the cronjob(see devdocs). Is there some best practice to determine the master node or is it smarter to add another node handling the crons and nothing else? Like a worker instance.


texts: Import existing Magento1.9.0.1 DB to the new Magento 1.9.2.4

texts:
we have a Magento 1.9.0.1 single store application,also we have customer, category and product in this version, my client like to develop the with Magento 1.9.2.4 with new theme,also he wants to use the same Database to this new version, so I export the existing magento1.9.0.1 DB, and used that DB for my new version of Magento 1.9.2.4

but unfortunately, the product count is a mismatch, as well as the product details also not same.

I manually compare the product related information to the both version its mismatching.

I don't know where is the problem occurs, do you have any idea regarding this kindly let me know


texts: How apply Filter on the basis of Custom Attribute in Order Grid Programatically

texts:
I have save custom_attribute(current_seller_id) in sales_order and sales_order_grid and same values in both table's columns.For save value in sales_order code is given below .I have use event sales_model_service_quote_submit_before that dispatch order and quote

public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getData('order');
        $quote = $observer->getData('quote');
        $quoteItems = $quote->getItems();
        foreach ($quoteItems as $quoteItem){
            if ($quoteItem->getCurrentSellerId() != ""){
                $items[]=$quoteItem->getCurrentSellerId();
            }
        }
        $seller_ids=implode(',',$items);
        $order->setCurrentSellerId($seller_ids);
        return $this;
    }

Now i want to apply condition(Filter) on the basis of own custom_attribute(current_seller_id).For example if the seller that has current_seller_id is 2 then just show those record in order grid which has value 2. I will get current admin id via "\Magento\Backend\Model\Auth\Session $authSession"


texts: Display products based on zipcode without installing any extension

texts:
How to display products in home page based on zipcode.

only particular products  will be available for delivery in that particular area(zipcode).How should i do that in magento2?


texts: Login button only working after clicking several times

texts:
I downloaded an extension for my store, in order to force the customers to login before using the website. The extension is named 'Ask to login' (https://www.magentocommerce.com/magento-connect/ask-to-login.html). It seems to be working fine, but the login button only will perform the action after clicking several times (like 4 or 5 at least). After doing so, it works fine.

My store uses Magento 1.7, and I have it installed on localhost over WAMP server.

Any ideas on why this is happening? The piece of code where the button is defined is:

    <form id="asktologin-login-form" method="POST" action="<?php echo $this->getLoginPostActionUrl();?>">

                <input type="text" name="asktologin_username" placeholder = "<?php echo $this->__('Email Address') ?>" style="color:#1a0000" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text" title="<?php echo $this->__("Email Address") ?>" />

                <input type="password" name="asktologin_password" placeholder = "<?php echo $this->__('Password') ?>" style="color:#1a0000" class="input-text" id="pass" title="<?php echo $this->__('Password') ?>" />

<a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?>

            <button id="login-button" type="button"><?php echo $this->__('Login'); ?></button>

    </form>

Any comment will be much appreciated :-)

EDIT: I found out that it's not after clicking several times that it works, but some seconds after the first click. Still I don't know why this happens; I mean Magento is slow, at least on my store, but there's no apparent reason for that.


texts: Magento Unicommerce Integration internal server error

texts:
I am trying to use unicommerce with a magento site for stock and order managment i have built for a client the orders are moving to unicommerce without any issues but when unicommerce tries to update the order on magento there is an internal server error that is occurring below is the error information i received from unicommerce. havent been able to resolve this issue for a while I am getting the proper response on

http://store.statusquo.in/index.php/api/v2_soap?wsdl=1

but unicommerce is unwilling to update the request url to this. They are insisting that the below url which they are using is working fine with other installations.

store.statusquo.in/index.php/api/v2_soap/index

I am in a fix and need a resolution for this.

[URL=store.statusquo.in//index.php/api/v2_soap/index, METHOD=POST, HEADERS=null, BODY=<soapenv:Envelope xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/XMLSchema" xmlns:soapenv="schemas.xmlsoap.org/soap/envelope" xmlns:urn="urn:Magento" xmlns:soapenc="schemas.xmlsoap.org/soap/encoding">
<soapenv:Header/>
<soapenv:Body>
<urn:salesOrderShipmentCreate soapenv:encodingStyle="schemas.xmlsoap.org/soap/encoding">
<sessionId xsi:type="xsd:string">bba7d1f7d5ea759c798835a3d8630644</sessionId>
<orderIncrementId xsi:type="xsd:string">100000274</orderIncrementId>
<itemsQty xsi:type="urn:orderItemIdQtyArray" soapenc:arrayType="urn:orderItemIdQty[]"><orderItemIdQty><order_item_id>721</order_item_id><qty>1</qty></orderItemIdQty></itemsQty>
<comment xsi:type="xsd:string">STAT30782</comment><email xsi:type="xsd:int">1</email></urn:salesOrderShipmentCreate>
</soapenv:Body>
</soapenv:Envelope>]

And response we are getting as

[RESULT=The page cannot be displayed because an internal server error has occurred.


texts: Seperating review and description from eachother

texts:
I want to separate the description tab and the review tab from eachother on my website. Where can I do this and how do I do this? Cannot figure out which code to edit.

https://www.thefixedgearshop.com/fietsen/state-bicycle-fixie-fiets-core-line-beorn.html


texts: Magento 1.9 Save recently viewed products in cookie

texts:
I need to save the recently viewed products in a cookie. The way that if there's no recently viewed products in session it reads it from the cookie. But I can't find where to find this exactly.

I'm overriding the file app/code/core/Mage/Reports/Block/Product/Viewed.php in my local, where I added the method getItemsCollection() from Mage_Reports_Block_Product_Abstract, but my code doesn't work.

It saves the ids in a cookie, but I can't load them later.

public function getItemsCollection()
{
    if (is_null($this->_collection)) {
        $attributes = Mage::getSingleton('catalog/config')->getProductAttributes();

        $this->_collection = $this->_getModel()
            ->getCollection()
            ->addAttributeToSelect($attributes);

        if ($this->getCustomerId()) {
            $this->_collection->setCustomerId($this->getCustomerId());
        }

        $this->_collection->excludeProductIds($this->_getModel()->getExcludeProductIds())
            ->addUrlRewrite()
            ->setPageSize($this->getPageSize())
            ->setCurPage(1);

            $recent_viewed_product_ids = $this->_collection->getAllIds();

            $cookie = Mage::getSingleton('core/cookie');
            if ($cookie->get('recent_products')) {
                $cookie_ids = unserialize($cookie->get('recent_products'));
                $recent_viewed_product_ids = array_unique(array_merge($recent_viewed_product_ids,$cookie_ids), SORT_REGULAR);
            }

            if (!empty($recent_viewed_product_ids)) {
                $cookie = Mage::getSingleton('core/cookie');
                $cookie->set('recent_products', serialize($recent_viewed_product_ids), strtotime('2030-31-12 23:59:59 GMT'), '/');

                $this->_collection = $this->_getModel()
                                          ->getCollection()
                                          ->addAttributeToSelect($attributes)
                                          ->addAttributeToFilter('entity_id', array('in' => $recent_viewed_product_ids));

                if ($this->getCustomerId()) {
                    $this->_collection->setCustomerId($this->getCustomerId());
                }

                $this->_collection
                    ->setPageSize($this->getPageSize())
                    ->setCurPage(1);
            }

        /* Price data is added to consider item stock status using price index */
        $this->_collection->addPriceData();

        $ids = $this->getProductIds();
        if (empty($ids)) {
            $this->_collection->addIndexFilter();
        } else {
            $this->_collection->addFilterByIds($ids);
        }
        $this->_collection->setAddedAtOrder();
        if ($this->_useProductIdsOrder && is_array($ids)) {
            $this->_collection->setSortIds($ids);
        }

        Mage::getSingleton('catalog/product_visibility')
            ->addVisibleInSiteFilterToCollection($this->_collection);
    }

    return $this->_collection;
}


texts: Saving properties of external platform in custom admin page in magento2

texts:
I've added a tab to the admin menu with our company's page, which enables the user to insert and define his own properties of our widget (input fields of secret and key). Now I would like magento's server to save these values upon clicking the page's 'save' button, and show them next time the user loads the page.
previously we did that inside system.xml:

 field id="key" translate="label" type="text" showInDefault="1"  showInStore="1">
 field id="secret" translate="label" type="text" showInDefault="1"  showInStore="1">

I tried to translate this to .phtml (simple html input text) but not sure magento2 supports other formats except her attributes in xml files.

Ideas?


texts: Magento(1.9.2.2) static block disappeared

texts:
I need some help about this. I've spent allready 5 hours and have no idea what happened. Problem:
I created a static block (as described here) with a simple content, a picture with a link to a product - our christmas product advertising. I placed it as described in a category. This worked as it should. Then We updated magento from 1.9.2.1 to 1.9.2.2, suddenly the static block isnt shown any more. I have no idea what happened and how to bring it back.

there are nop errors in system.log, the block just "disappeared".

We'd be glad for any help, thank you in advance!


texts: Magento 2 : Permission denied with colinmollenhour module cache

texts:
I regularly get this error message:

  1 exception(s): Exception #0 (Exception): Warning:
  file_put_contents(/var/www/html/magento/var/cache//mage-tags/mage---365_COMPILED_CONFIG):
  failed to open stream: Permission denied in
  /var/www/html/magento/vendor/colinmollenhour/cache-backend-file/File.php
  on line 663

To fix it, I remove the cache :

rm -rf var/cache/* var/di/* var/generation/* var/page_cache/* var/view_preprocessed/* pub/static/frontend/*

But it always comes back regularly, although I've set the permissions for two users in development mode :

find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
sudo chown -R :www-data .
chmod u+x bin/magento

Even after cleaning the cache this way :

rm -rf var/cache/* var/di/* var/generation/* var/page_cache/* var/view_preprocessed/* pub/static/frontend/*
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile

Is it a bug with Magento 2.2 or did I miss something ?


texts: how to change functionality using correct way "you save 58%" and Rent "Rs.85" look below screenshot

texts:
It is possible to get using Custom option in simple product.
I tried

<?php // Display Discount percents start ?>
<?php if($_finalPrice < $_price): ?>
<?php $_savingPercent = 100 - round(($_finalPrice / $_price)*100); ?>

        <?php echo $this->__('Your Saving:') ?>

            <?php echo $_savingPercent; ?>%

<?php endif; ?>
<?php // Display Discount percent end ?>

This code is showing only the $_finalPrice, $_price percentage.

I want to dynamically generate by selecting option like 30days, 90days...etc.

which is easy way to get the perfect value and also need this value in cart,order-details.


texts:
I have multiple Magento stores setup and have a custom theme for each store.

For the additional sub-store, the contact page is sending the email, but it is redirecting back to the main store instead on submit.

http://store1.com/store2/contacts

It sends email and then redirects to the other store

http://store1.com/index.php/contacts/index

Are there any fixes for this without editing the core contacts IndexController.php?

From contacts/form.phtml:

<form action="http://store1.com/store2/contacts/index/post/" id="contactForm" method="post">


texts: is any Observer In magento After Payment method is Selected..before order place

texts:
I need to know observer after payment method select in magento.
Basically I need to check some attribute value in added cart product after payment method is selected.
Basically I need to know observer after payment method selected.
If my selected method is Cash On Delivery... then I want to validate some attribute in added cart product....and if that true then ...place the order if false then want to redirect cart page with error Message....
Basically Any observer which can be fire after payment method is selected in magento.


texts: Magento 2 - Display out of stock product for only one category while hiding them in all other category

texts: How to display out of stock products only in one category with "Display Out Of Stock" option "No" in the admin?


texts:
I created a contact form with cms -> page , some html code and adding the this at the end :

{{block type='core/template' name='contactForm' form_action='/contacts/index/post' template='contacts/form.phtml'}}

The contact form site will open normally but when im actually sending the message I got a 404 error "The requested URL was not found on the server" How can I fix this problem ?


texts:
Is there a clean way to make a difference code wise between EE and CE?
The problem.
I'm updating an extension so it will work nicely on ce-1.9.
The extension is not for EE, but it seams to work on that also.
For the update I need to create an upgrade script that should be executed only if installed on CE-1.9 (or EE 1.14).
I cannot simply check

version_compare(Mage::getVersion, '1.9', '>=');

because this will be triggered in EE 1.9+ and I don't want that.

Right now I'm using this:

$isEE = Mage::helper('core')->isModuleEnabled('Enterprise_Enterprise');

but it seams kind of ugly.

Any other ways to check?


texts: I have a site on Magento CE 1.7.0.2 with 4 websites. 3 of them are 'legacy' sites which aren't really being used however it could be used in the future sometime. How much of a performance gain will I see by removing the 3 sites... 10 percent? Negligible?


texts:
I would like to have a single category tree in my Magento store, used by different store views: English, French and German.

Is it possible to have the category data translated instead of creating different category trees for each store?

If so how do you do this?


texts: How to add custom attribute in product collection

texts:
I want to add a custom attribute in product collection

protected function _getProductCollection()
    {
       parent::__construct();

        $products = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToSort("entity_id","DESC")
            ->addAttributeToSelect('*')
            ->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds())
            ->setPageSize($this->get_prod_count())
            ->addAttributeToSort($this->get_order(), $this->get_order_dir())
            ->setCurPage($this->get_cur_page());

        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
        Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);

        $this->_productCollection = $products;

        return $this->_productCollection;
    }

In this collection will display all new product. But i want to restrict if newproduct_display_homepage = yes then only display. how to add this filter into that


texts: Show a custom message if terms and condition checkbox is not checked

texts: I am using the one-step checkout and Paypal payment method. On clicking the PayPal button on the checkout page, I want to show a custom message if the terms and conditions checkbox is not checked to notify the customer to check the terms and conditions checkbox. How can I do this? I could not find the click event for the Paypal button.


texts: Get current product name in static web template html file on product view page

texts:
I want to get the current product name in static html file which is called in product view page like below file

  app/design/frontend/Vendorname/themename/Aheadworks_AdvancedReviews/web/template/product/view/review/summary/container.html


texts: how to delete category when there is no delete option?

texts: I have a root category and under this, 7 subcategories are there. I wanted to delete some subcategories.So I took the help of delete option from top right corner and delete that category.However one subcategory doesn't have "delete" option. Now I wonder how can I delete that. I have no use of that subcategory now. So can anybody tell how to do that ? Thanks...


texts:
I have a little problem with my condition and action in the promotion in Magento.

In my cart, i can add differents product like 1kg, 2kg .. 10kg.

I can have more than 2 kg product like : 2kg items x2

If I have a 2kg item, a free things is add in my cart. This part is ok, but how can i add another free things if i add new 2kg item. For the moment it only add 1 even i add a same product after.


texts: Well I have created a block in my XML file with a type as one of my PHP class file and I also gave the template, name and as parameters, but unfortunately I am unable to get that block on my page. I have called that block from my PHTML file using getChildHtml('Name_Of_The_Block'); But it seems there is some problem in my code. Can I know what may be the possible reasons for this error?


texts:
I am dealing with a product that is totally dynamic in nature and am using a completely custom controller/page to handle things.

There are a bunch of various custom entities I've built to handle the various business models that handle product logic. On my custom page, I assemble all these options into a form that allow a user to add this unique configuration to the cart.

Seeing as each customer's combination of values is likely to be rare (with millions of possible combinations), it is not practical to create a new catalog product each time someone adds to cart. Additionally, the product's image will be unique for each item, which makes it problematic to have one "generic" instance of my product in the catalog and use that every time it's added to cart.

I've thought a lot about various product types in Magento, and am not really seeing a good fit. Each composite type of product (bundle, configurable, etc) will require many customizations to make it work, so I've been developing based on Simple Products (I add all configured options as additional_options and set the price in observer during add-to-cart), but I can't help but think this is a good candidate for a custom product type (even if there is only one product in that list).

Given a product type that needs to be configured with a various amount of dimensions, colors, styles, etc, how would you handle this at the product model level?

(I have tried to be clear while at the same time honoring my client's NDA, if my question comes off as too generic, I am happy to clarify).

edit ---
For reference, imagine a web site that sells model doll house bits. Each of those bits is it's own product for sale (ie. 4 pack of little model trees, little itty bitty wallpaper, etc) but there is also a feature where a user can build a completely custom doll house, including custom dimensions for the number of floors, area in each room, etc. What product type would you make the "build a custom dollhouse?"


texts: Dynamically calculated prices save before add to cart

texts:
I have a script that dynamically calculates price on the product detail page and then I need to save the price so that it is correct in the user's cart when checking out. I have the following in my ajax request but as you probably know it saves in the system as the configurable product price. Due to the possibility of many users adding the same product to cart at the same time, I need a better way to save this price. Any suggestions? Preferably save as per item price then calculate with quantity.

Or even BETTER idea... since the prices are based off vendors and tier prices, I could dynamically create a shopping cart discount and apply it.

<?php
//error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
require_once('/var/www/Staging/public_html/app/Mage.php');
umask(0);
Mage::app();

//ensure that the value is legitimate
if($_POST && is_numeric($_POST['value'])){
    $price = $_POST['price'];
}

//pass this in your ajax call for the add button
if($_POST && is_numeric($_POST['product_id'])){
    $product_id = $_POST['product_id'];
}

$helper = Mage::helper('core'); //for translation

$block = new Mage_Catalog_Block_Product_View(); // not best practice, but neither are standalones
$product =  Mage::getModel('catalog/product')->load($product_id); // no need to use the _ here, it's not protected/private;

$product->setPrice($price);

//var_dump($product->debug());
//echo ('success');
?>


texts: how do sort custom list in product view?

texts:
I have custom module in product_view.
in customBlock so i want sort list by helpfulless or date.
how do it?

  Note:  i used ajax post to Customblock.php when change sortby. if
  refresh cache before change select it post value to Customblock.php.
  if don't  refresh cache and change select it not run Customblock.php.

So any suggestion to i can sort custom list? thanks so muck.


texts: How to track product creation / manufacturing status?

texts:
I am running Magento Community Edition 1.9.x. This is a new build with no extensions installed and no customer development... yet.

We print products on demand. A customer orders a poster off of our website and we print it to order. We also frame and produce other gift products in house. Is there a way to track a products production status in Magento? This status must be at the product level, not the order level. The most basic need is the ability to see each item in the order to a custom (tag, label, etc), whatever you want to call it.

Customer orders a photo poster. I want the option to change a custom value for that product to options like: Not Printed, Not Framed, Matted, Framed, Completed, etc. That's all it needs to do.

Thanks!


texts: How to add the new mass action in magento sales order grid to update my custom status.


texts: Magento 2 catalog_product_save_after when is triggered?

texts:
In Magento 2 the event catalog_product_save_after is triggered during import of products from csv file?

Thanks in advanced for any response.


texts: M2: Can't save customer because created_at date gets malformed by Magento

texts:
This is a followup to my previous question. Previously, I had an issue where the customer created_at attribute was incorrectly assigned a datetime input filter when it should have been date.

However, I still cannot save a customer because of the way Magento is parsing the date.

vendor/magento/framework/Data/Form/Filter/Date.php

public function inputFilter($value)
{
    $filterInput = new \Zend_Filter_LocalizedToNormalized(
        ['date_format' => $this->_dateFormat, 'locale' => $this->localeResolver->getLocale()]
    );
    $filterInternal = new \Zend_Filter_NormalizedToLocalized(
        ['date_format' => DateTime::DATE_INTERNAL_FORMAT, 'locale' => $this->localeResolver->getLocale()]
    );

    $value = $filterInput->filter($value);
    print_r($value) // 2013-07-18 04:00:00
                    // ^ Date is OK!
    $value = $filterInternal->filter($value);
    print_r($value) // 013,-07,-18, 04,:00,:00
                    // ^ Woah, what happened?!
    return $value;
}

So, why does Zend_Filter_NormalizedToLocalized completely destroy my date format and prevent me from saving Customers?


texts: How to use the rest api without body data

texts:
I have rest API URL but how to run the in rest API.

    $service_url='http://testing.com/data/rest/Masters/CheckPartnerId?Key=121&Type=CREATE&PartnerId=13&BrandId=67&StoreId=main_website_store&ValidateId=Mpnid&UserName=anurag.111@gmail.com';

 try {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $service_url);
            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_HEADER, 0);
           // curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
            curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            $response = curl_exec($ch);

            $response1 = json_decode($response, true);
            echo '<pre>'; print_r($response1); exit;
        } catch (Exception $e) {
            echo $e->getMessage();
            //$debugshipData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
        }

Can you please help me


texts:
Impossible reindex magento 2.1.11

In terminal I run:

php bin/magento indexer:reindex

The first 3 indexes reindex in a few seconds. Reindex stops on the 4th index and this is the end. I waited all night and stood still.

Reindex stops at:

Indexed category / product associations

I try  reset all indexex
also I try fix issue with deadlock:

https://www.tigren.com/fix-deadlock-error-reindexing-magento-2/

any other solution?

@update
I found one solution:

Reset indexes: bin/magento indexer:reset
Make sure that no database processes regarding indexing is running
Open your database administration client like PHPMyAdmin
Run query: SHOW PROCESSLIST;
Run query: KILL QUERY xxxxx (where xxxxx is the ID
of processes you want to kill)
bin/magento setup:upgrade Clear cache
bin/magento setup:static-content:deploy -j 1
bin/magento indexer:reindex
Disable maintenance mode bin/magento maintenance:disable

But can anyone confirm that I need kill this both process?

https://prnt.sc/nvbr2e


texts:
I have multiple numeric attributes.  What I need to be able to do is show each attribute with the appropriate number of digitals after dot.

Some are ######0, some are #####0.00, #####0.000, #####0.0000, etc.  Is this possible?


texts:
What is the equivalent function in magento 2.

  public function execute()   //method name changed to execute() as per core
{
   //echo 'result controller';die;
    //Custom Change
     $params = $this->getRequest()->getParams();
    $response = array();
    //Custom Change End

    //$query = Mage::helper('catalogsearch')->getQuery();
    $this->_objectManager->get('Magento\CatalogSearch\Helper\Data')->checkNotes();

    $this->layerResolver->create(Resolver::CATALOG_LAYER_SEARCH);
    $query = $this->_queryFactory->get();

    /* @var $query Mage_CatalogSearch_Model_Query */

    //$query->setStoreId(Mage::app()->getStore()->getId());
    $query->setStoreId($this->_storeManager->getStore()->getId());

    if ($query->getQueryText() != '')
    {
        //if (Mage::helper('catalogsearch')->isMinQueryLength()) {
        if ($this->_objectManager->get('Magento\Search\Helper\Data')->isMinQueryLength())
        {
              $query->setId(0)
                ->setIsActive(1)
                ->setIsProcessed(1);
        }
        else {
            if ($query->getId()) {
                $query->setPopularity($query->getPopularity()+1);
            }
            else {
                $query->setPopularity(1);
            }

            if ($query->getRedirect()){
                $query->save();
                $this->getResponse()->setRedirect($query->getRedirect());
                return;
            }
            else {
                $query->prepare();
            }
        }

        //Mage::helper('catalogsearch')->checkNotes();
        $this->_objectManager->get('Magento\Search\Helper\Data')->checkNotes();

        //$this->loadLayout();
        $this->_view->loadLayout();
        $this->_view->renderLayout();
        //Custom change

        if(false && $this->getRequest()->isXmlHttpRequest())
        {   //Check if it was an AJAX request
            $viewpanel = $this->getLayout()->getBlock('catalogsearch.leftnav')->toHtml();  //Get the new Layered Menu
            $productlist = $this->getLayout()->getBlock('product_searchlist_toolbar')->toHtml(); //New product List
            $response['status'] = 'SUCCESS'; //Send Success
            $response['viewpanel']=$viewpanel;
            $response['productlist'] = $productlist;
            $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
            return;
        }//End custom search
        //$this->_initLayoutMessages('catalog/session');
        //$this->_initLayoutMessages('checkout/session');
        //$this->renderLayout();

        /* if (!Mage::helper('catalogsearch')->isMinQueryLength()) {
            $query->save();
        } */
        if (!$this->_objectManager->get('Magento\Search\Helper\Data')->isMinQueryLength()) {
            $query->save();
        }
    }
    else {
        //$this->_redirectReferer();
       $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
    }
}

Like for eg: there is no getQuery() in magento 2 catalog search helper.
i want the equivalent functions for the same in  magento2


texts:
I am curious about how the popularity score of the Magento Marketplace works. If you hover over it, it says referals to site/downloads.

But consider this screenshot:

All 4 extensions more or less do the same, 3 of them are free, 1 costs $20. How can I interpret these popularity scores? I can't imagine that everybody buys the extension for $20 if you could get the same for free. There is even one free extension which does more than the $20 one. Why does it have 23k?


texts:
I am creating a module that adds an attribute to a product.

If the product has the attribute,  on the category page I want to display 'has attribute' below the price and above 'Add to Cart'.

I'm concerned about overriding the template and want to know how best to proceed?


texts: Magento 2 plan - zip code preselect - time slots - hiding products for location

texts:
I need help with a customized magento 2 webshop. We have custom plan, and I don't know which is the good way.

note: We're developers, so custom module development is not a problem

So my plan is (workflow of the user)

User can preselect Zip code or city in cart, or with a popup - but without login (so we need to store in in session I think - custom module I think)
If user is located, we can hide several products which is not available in the user's location (here is a question - should we set store views, or customer groups, or shipping method or custom module or something other based on session)
User put some products in the cart, and goes to checkout.
On checkout user can select delivery time slots (our plan is to use amasty's delivery plugin)
Time slots should depend on location (amasty plugin supports only different time slots per store views, but customer group or shipping method can be solved as well)

I think that's all. :)

I've googled a lot, but I can't find any plan or plugin for this, I think it's a custom idea, but I don't want to work twice, so I have to plan it thoroughly.

Thanks for you help, I hope we can find the perfect solution :)

Bye
Adam


texts: How to get all the values stored in the new add category attribute in magento 2

texts: I followed some instructions to do "Add new Image attribute for category in magento 2" and I was successful.and now I want to output all newly added images printed out in the same place on all pages can someone help me to solve this problem. Thank for all


texts: Magento 2 - After imported products - Can not show in frontend

texts: I have problem: After imported products - all imported products did not show in frontend. Anyone know me step by step.


texts: which file contatin this $template = Mage::getStoreConfig('newsletter/subscription/success_email_template'); in magento?

texts:
I am just wondering where can I find this file

$template = Mage::getStoreConfig('newsletter/subscription/success_email_template');

in Magento?

I need to add another line but I could not find the file
$template = Mage::getStoreConfig('newsletter/subscription/another_success_email_template');

Appreciate your answer.....


texts:
I've used the following function to retrieve the products to display products on a widget filtered by catalog rules. The products listed in view page shows that rules are applied.

But the function getMatchingProductIds() retrieves all product IDs other than applied products

$catalog_rule = Mage::getModel('catalogrule/rule')->load(2);
$skus = $catalog_rule->getMatchingProductIds();

print_r($skus);

How to retrieve the products on which the rule is applied?


texts:
I'm trying to make a php files, to apply coupon code to shipping cart. I explain. We have a mobile-commerce application, and wanna add coupon code. Creating them on magento, adding rules, date, products, there is no problem here, but when customer have choose products, they enter the coupon code in a text field. My php files take the code they enter, and the shopping card Id (if there is one ? ) with a GET method, check if the coupon can be apply (rules, date, products, obviously ask magento "Can he does it ?"), and if magento says "yes", return the final price, or reduction (return like '5%' or '543$'), or return "error" if the coupon is not validate.

I try to look some code here :
http://inchoo.net/ecommerce/magento/programming-magento/programmatically-create-apply-and-delete-shopping-cart-price-rule-in-magento/
also look at the magento's documentation, but not abble to finally find what I wanna do.

I don't really know where to start, every helps are welcome =)

EDIT: I'm actually here :

$couponCode = $_GET['couponCode'];
$shoppingCartId = $_GET['shoppingCartId'];

$result = $proxy->call($session, "cart_coupon.add", array($shoppingCartId, $couponCode));

but I don't know what to do with my result, (what can I return).


texts:
I have little Confused about page_types.xml.  Why we need  this? and How this Useful for us? I researched about page_types.xml in this document Still not get exact answer.

I saw some page_types in magento Calalog_module:

<page_types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_types.xsd">
    <type id="catalog_category_view" label="Catalog Category"/>
    <type id="catalog_product_compare_index" label="Catalog Product Compare List"/>
    <type id="catalog_product_gallery" label="Catalog Product Image Gallery Popup"/>
    <type id="catalog_product_view" label="Catalog Product View (Any)"/>
</page_types>

I dont know, where to use this types.

Suggest me Why we need this? and How to Usefull for us?


texts: Problems configuring Magento the Catalog Price Scope

texts:
I very confused by this setting in System > Configuration > Catalog > Catalog > Price : Catalog Price Scope.

First, I am not sure what it means and what it is for.

Second, when I did some research on Magento's website I found this page: http://www.magentocommerce.com/knowledge-base/entry/configuration-catalog-price

But it does not make sense. Because in my Magento configuration I am getting these two options : Global, and Website. But inside of the documentation of Magento I get these options :

Website - Prices will be shared across all stores.
Store - Prices may differ between store views, but still be shared across store views within the same store.
Store View - Prices are unique to the specific store view.

Here are some details about my Magento setup:

Stores = Countries
Views = Languages

My website is selling downloadable products so we want anyone with a PayPal account to be able to buy.

Knowing this what is the best option and why is it not listing Store, and Store view?


texts: How to get customer session id in magento 2?

texts:
I want to get the session-trail in a custom module.  Without the session-related code, it is working fine, but it breaks the module when I add it

namespace Scaledesk\Trails\Block;

use \Magento\Framework\View\Element\Template;
use \Magento\Framework\View\Element\Template\Context;
use \Scaledesk\Trails\Model\ResourceModel\Post\Collection as PostCollection;
use \Scaledesk\Trails\Model\ResourceModel\Post\CollectionFactory as PostCollectionFactory;
use \Scaledesk\Trails\Model\Post;

class Users extends Template
{
    /**
     * CollectionFactory
     * @var null|CollectionFactory
     */
    protected $_postCollectionFactory = null;

    protected $customerSession;

    /**
     * Constructor
     *
     * @param Context $context
     * @param PostCollectionFactory $postCollectionFactory
     * @param \Magento\Customer\Model\Session $customerSession
     * @param array $data
     */
    public function __construct(
        Context $context,
        PostCollectionFactory $postCollectionFactory,
        \Magento\Customer\Model\Session $customerSession,
        array $data = []
    ) {
        $this->customerSession = $customerSession;
        $this->_postCollectionFactory = $postCollectionFactory;
        parent::__construct($context, $data);
    }

    /**
     * @return Post[]
     */
    public function getPost()
    {
        /** @var PostCollection $postCollection */

        $customerId=$this->customerSession->getCustomer()->getId();

        $sort=1;
        $postCollection = $this->_postCollectionFactory->create();
        $postCollection->addFieldToSelect('*');
        $postCollection->addFieldToFilter('main_table.entity_id',$customerId);
        $postCollection->getSelect()->join( array('customer_entity'=> $postCollection->getTable('customer_entity')), 'customer_entity.entity_id = main_table.entity_id');
        $postCollection->setOrder('trails_id', ($sort==1 ? 'asc':'desc'));
        $postCollection->load();
//        var_dump($postCollection->getSelect()->__toString());
//        die();
//        var_dump($postCollection->getItems()); die();
        return $postCollection->getItems();

    }

    /**
     * For a given post, returns its url
     * @param Post $post
     * @return string
     */
    public function getPostUrl(
        Post $post
    ) {
        return $this->getUrl().'trails/post/view/id/'. $post->getId();
    }

}

$postCollection->addFieldToFilter('main_table.entity_id',$customerId);
 how to get session  customerSession->getCustomer()->getId()


texts: Put cart totals below the cart products in Magento 2.1

texts:
I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank.

On the cart page, the cart totals are the above the cart products:

I want the "totals" to go below the products table, inside the cart form:

Question:

Would doing this affect the checkout process?
Can I achieve this by copying the contents of totals.html inside form.phtml? The path:

  app/design/frontend/Vendor/Theme/Magento_Checkout/templates/cart/form.phtml

The checkout_cart_index.xml in the theme is:

  app/design/frontend/Vendor/Theme/Magento_Checkout/layout/checkout_cart_index.xml

The full code of checkout_cart_index.xml is in this Pastebin.


texts: Something went wrong while saving the category Magento 2

texts:
There are many threads with almost the same title, but i could not find a solution for it

I have a following structure in magento 2 for categories

Among them i can save all the categories apart from the selected Home Decor or it's parent Products. Both of these categories give me "Something went wrong while saving this category" error

I checked my expection.log in "var/log/" magento folder and i get the following message

One thing i have noticed is, if for these particular categories, if i switch "Anchor" (under Display Settings) option on, i get the issue, and if i switch them off i get the success message.

This led me to believe the issue is in URL rewrites, but i cannot truncate that table as we have written a lot of custom redirects within it.

Can anyone suggest a solution for this?


texts: How do you set up Shipping Profiles like Etsy has

texts:
I need the ability to set up shipping profiles in magento.  I can't understand how to do this, I can't find extensions to do this because I seem to get irrelevent results on magento connect.

I need to be able to charge $2.99 for the first product and $.25 for each additional product.  The buyer must be able to select different items, I was only able to figure out how to apply it to the same item which is ridiculously limiting. I must be doing something wrong.  This must also apply only to domestic shipping.

I then need an international profile which would charge $5.99 for the first product and $.99 for each additional product.  This must also be applied to all products, not just the same product.

I would also like to display the shipping costs on the item description page so it's not just a suprise when they go through the hassle of the checkout just to say "That's too much"

Is there a way to set this up?  Or is there an extension I could use?  (Free or paid)


texts: Wrong way to Add Product to Cart with Custom Price

texts:
I am adding product to cart with custom price but It doesn't work with multiple currency on store.

Currency symbol is changed but currency not converting in selected currency on cart, checkout, minicart.

//script to add product to cart with custom price
$item = $observer->getEvent()->getData('quote_item');
$item = ( $item->getParentItem() ? $item->getParentItem() : $item );
$price = 100; //set your price here
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);

Not work in magento 1 and magento 2.

Here is reply from Magento community:
"custom price is using only in Admin area when we reorder or edit an order. In that case we can change price item and set a custom price. The currency would not be changed and stayed as it was when the order had been placed." and said that the way I am following to add product with custom price is wrong.

So Is there any correct way to add product in cart with custom price in fly?


texts: How to keep lable choosed on select option after refresh page

texts:
I wand keep lable choosed on select option after refresh page. Please help me !

Ex : I choosed "Architekten"

My select dropdown

I want after refresh page, it keep "Architekten" like this

My select code

<select name="branche" id="branche">
<option id="select" value="select" disabled="" selected="">Please Select</option>
<option id="wk_sl_search_select" value="49">Alternativ &amp; Ganzheitliche Medizin</option>
<option id="wk_sl_search_select" value="50">Ambulatorien</option>
<option id="wk_sl_search_select" value="51">Apotheken</option>
<option id="wk_sl_search_select" value="52">Architekten</option>
<option id="wk_sl_search_select" value="53">Ärzte</option>
<option id="wk_sl_search_select" value="54">Astrologen</option>
<option id="wk_sl_search_select" value="55">Baumärkte</option>
<option id="wk_sl_search_select" value="56">Beisel &amp; Kneipen</option>
<option id="wk_sl_search_select" value="57">Bestatter</option>
<option id="wk_sl_search_select" value="58">Bijouteriewaren</option>
<option id="wk_sl_search_select" value="59">Blumenhandel &amp; Floristik</option>
</select>

My jquery

<script>
document.getElementById('branche').onchange = function() {
    localStorage.setItem('selectedtem', document.getElementById('branche').value);
};

if (localStorage.getItem('selectedtem')) {
    document.getElementById('branche').options[localStorage.getItem('selectedtem')].selected = true;
}
</script>


texts: How to get the CategoryId using the name in Magento 1.9?

texts:
Looking to find the category ID using the Name attribute programmatically. My script returns a 1 when it should be a 19. Here is my code:

$collection = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToFilter('is_active', 1)
    ->addAttributeToFilter('parent_id', $currentCategoryId)
    ->addAttributeToFilter('name', $categoryName);

which should return the category right? Then the script utilizes $catid = $collection->getFirstItem()->getId(); to get the ID, however it is returning the wrong ID. Any ideas?


texts: Magento 2 new customer account form not working

texts:
Guests are not able to create new account.

After they filling the form and pressing on create an account nothing is happening, no account created and no error is showing.


texts:
I tried to put my website into Production mode.

For this, I used the following command on SSH but it get stuck.

php bin/magento deploy:mode:set production

Please refer to the following screenshot.


texts: How to create custom XML file for new .phtml template page in Magento 2.1?

texts:
I can't find a clear guide as to how to link a custom XML file to a custom PHTML template file in Magento 2.1.

I created a test.phtml in

app/code/Custom/Module/view/frontend/templates/

and also test_index_index.xml in

app/code/Custom/Module/view/frontend/layout/

The purpose is to create a new page that will be linked to from the top.links header links menu section.

My first questions is, what PATH will be correct to link to this page from the menu?

In my

app/design/frontend/Custom/theme/Magento_Customer/layout/default.xml

I added the link like this:

<block class="Magento\Framework\View\Element\Html\Link" name="test" after="register-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">Test Page</argument>
                <argument name="path" xsi:type="string" translate="true">**What is the correct path to use here?**</argument>
            </arguments>
        </block>

I couldn't get it to work. This is the best way I'd like to link to the new page.

Then, in order to link to test.phtml from the menu link I created a new cms page from

  Magento Admin >> Content >> Pages >> Add New Page.

Then, in Content > WYSIWYG editor in code mode I called the template file like this:

{{block class="Magento\Framework\View\Element\Template" name="test"
template="Custom_Module::test.phtml"}}

And used the cms page url-key as path in

  <argument name="path" xsi:type="string" translate="true">test</argument>

This successfully links to the new page. However, now with the page being a CMS page using 1column.xml I'd like to make modifications to it's appearance via XML layout. For a start, I'd like to remove the breadcrumbs from the page. However, the XML file I created for the page does not have effect.

My test_index_index.xml:

<?xml version="1.0" encoding="utf-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <head>
<title>My First New Mage Custom Page</title>
 </head>
 <body>
 <referenceContainer name="content">
  <block class="Custom\Module\View\Element\Template" name="test" template="Custom_Module::test.phtml">
  </block>
  </referenceContainer>
  <referenceBlock name="breadcrumbs" remove="true"/> <!--this will work if success-->
  </body>
  </page>

My second question is how to link the above mentioned XML layout to my PHTML template file?

I tried naming the file cms_test.xml , cms_test_index.xml --> no effect. The XML file does not link to the phtml file. How can I achieve that?


texts: Can't change dropdown attribute to visual swatch on Magento 2

texts:
I tried to change a dropdown attribute, for color, to a visual swatch on a test magento2 environment but cannot get it working, does anyone have some advice?

When I changed the color attribute to a visual swatch, it broke the relationship for all configurable products in the store with their child products.

They were no longer displayed on the product edit page for the parent
configurable product.
And on the storefront, the configurable product
still showed the size dropdown but just an empty field where the
color options should be.

After clearing the cache and re-indexing, the issue still remains.

I tried creating the child variation products again, and this time they displayed correctly on the backend and the storefront, but empty fields also appeared on the storefront.


texts: how i can hide products from catalog listing only but keep showing them in search result page using css like display: none;, is there a way to create a customer ID for the specific products that i want to hide and control the visibility via css?


texts: how to add image Placeholder if image not found on frontend Magento 2

texts:
how i can add image place holder on front-end page when image is not uploaded or not found in both cases.

actually, i am working on custom module, in which i have to fill the form front-end in which i have the option of image uploading a photo. i want that if someone does not upload the image, then there is a default image in it.


texts: How can I manually assembly a category-level product collection?

texts:
I'm trying to display a category within a CMS page. (I know that a workaround would be to include a static block on a Category, but in this instance that is not an option for me). So I have this code in my CMS page:

{{block type="core/template" template="catalog/product/my_template.phtml"}}

Which is working correctly. Within that template file (my_template.phtml), I have a very similar setup to app/design/frontend/core/default/template/catalog/product/list.phtml.

But because this is being called from a CMS page, I'm not within the correct scope to use $this:

<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
?>
<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>

How can I manually set up the $_productCollection without access to $this->getLoadedProductCollection(); - for instance, if I have an array of $product_ids, or a $category_id.

I've tried this approach:

$layer = Mage::getSingleton('catalog/layer');
$category = Mage::getModel('catalog/category')->load($category_id);
$layer->setCurrentCategory($category);
$_productCollection = $layer->getProductCollection();

But that is not able to call:

$_product->getRatingSummary() (when looping through $_productCollection as $_product)
$this->getReviewsSummaryHtml($_product, 'short'), or
$this->getPriceHtml($_product, true)

Any pointers?


texts: Hide a shipping method frontend and still show in backend

texts:
I want hide a shipping method in frontend and that only show in backend. Is possible enable pickup store only in backend? I make with payment methods very easy

  protected $_canUseInternal = true;
  protected $_canUseCheckout = false;

but with shipping is impossible for me. Could your help me please? Thanks in advance


texts: unable to disable Compiler in Magento 1.9

texts:
Okay, it's a long story, so sit tight.

First, I cannot disable compiler for some reason.  I click disable and it refreshes, saying Enabled still.  So I used the command line and disabled it, and got the return prompt of

php compiler.php -- state
Compiler Status:          Disabled

But, if I refresh the back-end, it still reads as Enabled

None of my changes are taking effect due to this, and I am at a loss as to where to go from here

I have even tried recompiling from the command line, it says it runs, but same issue, my changes don't actually show in the front-end of the site

Compiler Status:          Enabled
Compilation State:        Compiled
Collected Files Count:    7416
Compiled Scopes Count:    4

If I attempt to recompile from the back-end, it locks up the site and both front and back ends are unable to be accessed

--Edit--

People have claimed this is a duplicate of the "compiler always disabled" thread found here, but my config file does not seem to be the issue

contents of /includes/config.php here:

#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');

Even with the 2 lines commented out, compiler still stays Enabled, and disabling it just adds another hash to the line for compiler_include_path (I had 3 hashes before deleting them and trying again.), and if there aren't lines commented, it will properly add a hash to the line in question, but still stay Enabled. So again, the problem does not seem to be with Magento updating this line of code.

--Edit 2--

Came in today and saw that the compiler was disabled, unsure why, not upset about it, but it came with an error in the code I was updating, and now the changes in the code won't take... it is like the server is taking a few days to respond to file changes for some reason


texts: visible and invisible products are not showing in magento 2

texts:
Inspired by answer mentioned in the link. I wrote following code but it is not returning invisible products.

$productCollection = $this->categoryFactory->create()->load($this->_storeManager->getStore()->getRootCategoryId())
                ->getProductCollection()
                ->setVisibility(null)
                ->addAttributeToSelect('sku')


texts: Uncaught Error: Cannot instantiate interface Magento\TwoFactorAuth\Api\UserConfigManagerInterface while running Integration Tests

texts:
Trying to Run all integration tests using ../../../vendor/bin/phpunit command.
Getting an error -

PHP Fatal error:  Uncaught Error: Cannot instantiate interface
Magento\TwoFactorAuth\Api\UserConfigManagerInterface

[Progress: 1276 / 1762]
Module 'Magento_TwoFactorAuth':
PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\TwoFactorAuth\Api\UserConfigManagerInterface in /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Stack trace:
#0 /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#1 /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#2 /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#3 /var/www/html/ce241/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create()
#4 /var/www/html/ce241/vendor/magento/framework/Setup/Patch/PatchApplier.php(149): Magento\Framework\ObjectManager\ObjectManager->create()
#5 /var/www/html/ce241/setup/src/Magento/Setup/Model/Installer.php(1081): Magento\F in /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

I have disabled Magento_TwoFactorAuth module from main app/etc/config.php.
No other additional modules installed.
Already checked permissions and ownership's of the respective directories.


texts: Order Confirmation email intermittent totals alignment issue

texts:
Recently our order confirmation emails have started to have an issue. Intermittently we will have an email where the Subtotal, Shipping, Discount and Grand Total will align left instead of right. I can't figure out what could be causing this to happen as there is nothing to indicate any kind of consistency with the problem.
Has anyone else experienced this? Any help would be appreciated!

Below are two separate orders that contain the exact same order items, but the second shows the random totals alignment issue.


texts: Shipping price and Grand Total Excl Tax confusion

texts:
Our shipping and tax & grand total (excl. tax) calculation are wrong. We have set shipping & handling fees to include tax via settings, but shipping still gets added to Grand Total (Excl. Tax).

See the following example (VAT here is 24%).

Subtotal                €141.05
Shipping & Handling     €7.90
Grand Total (Excl.Tax)  €148.95     (141.05+7.90 = 148.95)
Total Tax               €33.85      (141.05*0.24 = 33.85)
Grand Total (Incl.Tax)  €182.80

As you can see, shipping gets added to grand total excluding tax, but total tax is only calculated from the subtotal. What we want is to clearly display Grand Total (Excl. tax) + Total Tax + Shipping = Grand Total (Incl. Tax). How should we handle it?

Magento 2.3.2


texts: How do i manually re-aggregate reviews summary for single product?

texts: I've got 8 review with different ratings, but summary is based on 1 of 8 reviews rating. I need to trigger summary count for all reviews in this product.


texts: Get simple product id from configurable product selection

texts:
Assuming I have a configurable product on the frontend with two dropdowns:

Size

Color

How can I get the final simple product id once the user has made their selections.

In other words: once I know the selections from all the super attributes how can I use this to get the simple product.


texts: Unable to login to magento admin in google chrom

texts:
i am using magento 1.9.2.1 , but i am unable to login to admin using google chrome browser where as login works fine in firefox browser ,

Please guide me how to fix ,

1: in chrome when i enter wrong password i get error but for correct login details now error just admin login page reloads

2: please tell what to do to fix it

3: i have cleared cache many time and issue is on server only

in chrom after login url is like below

abc.ocm/index.php/admin/index/index/key/we1**************************/


texts: Calling ReferenceContainer or ReferenceBlock into phtml file

texts:
I am trying to call Template into list.phtml, this file is categories list file, here is the ReferenceBlock and ReferenceContainer code in xml file.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="before.body.end">
        <block class="Devops\DropInCargo\Block\Product\View" name="drop.in.cargo.addtocart.popup" template="Devops_DropInCargo::product/view/addtocart/popup.phtml">
            <block class="Magento\Framework\View\Element\Template" name="pickup.in.cargo.addtocart.popup.areas" template="Devops_DropInCargo::product/view/addtocart/popup/areas.phtml" />
            <block class="Magento\Framework\View\Element\Template" name="pickup.in.store.addtocart.popup.stores.list" template="Convert_PickupInStore::product/view/addtocart/popup/areas-list.phtml" />
        </block>

        <block class="Devops\DropInCargo\Block\Product\View" name="drop.in.cargo.addtocart.cart" template="Devops_DropInCargo::product/view/addtocart/cart.phtml" />
    </referenceContainer>
</body>
</page>

This is available in

 Vendor\Devops\module-DropInCargo\view\frontend\layout\catalog_product_view.xml

This shows the source in product page of magento 2 at the end before body ends. Now same code i want to show into list.phtml

 app\design\frontend\Devops\giga\design\Magento_Catalog\templates\product\list.phtml


texts: I am running Magento 2.2 and the Web Setup Wizard is missing.  When I use the url: admin/admin/backendapp/redirect/app/etc on the backend.  It leads me to /setup/index.php/session/unlogin not /setup/#/home.  So I have no way to use the component to install 3rd party extension.  Please help!!


texts: Get parent category in home page with .phtml temaple

texts:
I am trying to get only parent categories of a category id 4 but right now instead of parent category it is listing all child categories. Below is the code that I currently have in .phtml template file. Is there something wrong in the code? How could I achieve it?

<?php $_helper = Mage::helper('catalog/category') ?>
<?php $_categories = Mage::getModel('catalog/category')->getCategories(4); ?>
<?php $currentCategory = Mage::registry('current_category') ?>
<?php if (count($_categories) > 0): ?>
    <?php foreach($_categories as $_category): ?>
        <?php
            //arrange by Letter
            foreach($_category->getChildren() as $_sub){
                $letter = substr(strtolower($_sub->getName()),0,1);
                $subCategories[$letter][0]['name'] = $letter; //0 index is the letter
                $i = 1;
                while(isset($subCategories[$letter][$i])){
                    $i++;
                }
                $subCategories[$letter][$i]['name'] = $_sub->getName();
                $subCategories[$letter][$i]['url'] = $_helper->getCategoryUrl($_sub);
            }

        ?>
    <?php endforeach ?>
    <?php
        $i = 0;
        $x = 0;
        $d = 0;
        $splits = 1;
        foreach($subCategories as $sub){
            $d += count($sub); //split it into 3rds
        }
        $d = round($d / 5);
        //get a count of all elements for splitting
        ksort($subCategories);
        foreach($subCategories as $sub){
            $i = 0;
            //$d = round(count($sub) / 3); //split it into 3rds

            echo '
';
            asort($sub);
            $displayHead = TRUE;
            while(isset($sub[$i])){
                if($x % $d == 0 && $x != 0 && $splits != 5){
                    $splits++;
                    echo '

';
                    if($i != 0){
                        echo '
'.$sub[0]['name'].'
';
                    }
                }
                if($i == 0){
                    echo '
'.$sub[0]['name'].'
';
                } else if($i != 0){
                    echo '' . $sub[$i]['name'] . '
';
                }
                $i++;
                $x++;
            }
            echo '
';
        }
    ?>
<?php endif; ?>

Update:
I did try adding <?php $subCategories = array(); ?> before <?php if (count($_categories) > 0): ?> as suggested but it is not helping at all so anyone with the suggestion and solutions?


texts:
I am trying to run the following command -

composer require ebizmarts/mailchimp-lib

But I am getting following error on command line -

[UnexpectedValueException]
  RecursiveDirectoryIterator::__construct(extension/mageworx_downloadsmeta): failed to open dir: No such file or directory

I have uploaded the Mailchimp extension via FTP but when trying to load dependencies getting the errors


texts: Replace  of page with  comes from $.ajax response

texts:
Problem is written inside the success section.
$.ajax({
    url : 'path to file',
    dataType : 'json',
    type : 'POST',
    data: data,
    success : function(res)
    {
            // here I want to recive <div> in response.
            // then replacing the received <div> with existing one.
            // I don't know how I could send <div> in response.
            // How would I receive <div>,
            // and How to replace it with the existing one.

    },
    error : function()
    {
            alert("failed");
    }
});


texts: How to change the total price at checkout onepage in controller?

texts:
I added a discount function at payment step, and there is a button to call Ajax to controller.

The button is in the payment step.

The problem is how to change the total price after I click the button? For example, when I click this button, the total price will reduce $100.

I have created a custom gift card module and the card code will be auto generation when customer bought it. If I use the shopping price rules, how can it automatic make the card code to be the coupon code?

Also, is it any information to use multiple coupon codes at the same product?

But there is a different. There is a balance in gift card but coupon isn't. Also, the gift card can be reuse until its balance is $0.

Thank you!