texts:
I am trying to access an admin routed url from a frontend routed URL using curl.  I do the following:

            $ch = curl_init();
            curl_setopt ($ch, CURLOPT_URL, 'http://site.com/index.php/admin/mycache/verify/');
            curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
            curl_setopt ($ch, CURLOPT_COOKIE, $_COOKIE['adminhtml']);
            $Verify = curl_exec($ch);
            curl_close($ch);
            echo "V: $Verify";

The idea here is that I want that url to return a 1 if the user is logged into the admin part of my site, and anything else otherwise.  When I do the above though, even though the adminhtml cookie is set, curl never gets the data from that URL.  Can someone explain why and/or how to fix that?


texts: Where does $product->getData('salable') come from?

texts:
I have a problem with one of the products. For some reason it doesn't display a buy button. I dig into the core and I figured it out that the problem with this value.
Inside function isSalable() It returns at the step

if ($this->hasData('salable')) {
    return $this->getData('salable');
}

And it returns 'false', but I don't know why. Other methods like isAvailable() or isInStock() or getStatus() return true. Anyone can help me with this?

Thanks.


texts: Magento 2 system variable for "Order Created at" for email templates

texts:
What is the email template system variable for "Order Created at" for Magento ver. 2.2.6?

Using the variable name: {{var order.getCreatedAtFormated('long')}} doesn't work for me. This is a variable applied using the Magento UI:

I looked into the devdocs and the is no variable for this: https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/templates/template-email.html

In addition, why are the varibale names different from when you using Magento UI and when looking at the devdocs? E.g:

Getting billing address:

Using UI: {{var order.getBillingAddress().format('html')}}
Devdocs: {{var formattedBillingAddress|raw}}

NOTE: I had to use the devdocs variable names for it to work properly.


texts: How to disable caching of custom block on product view page?

texts: I have customBlock in product_view. How do  disable cache for this?


texts:
I have installed Magento 2.0 CE from archive. When I try to update the Magento system from 2.0.2 to 2.0.3 I log in as administrator and try to go to

System -> Web Setup Wizard

as instructed on the Magento official website. When I hit the link though, it takes me to a 404 Not Found page. This is how the setup wizard link looks like.

Web Setup Wizard

What is the problem ? Even more strange, I found some ways to update from command line and when I run composer update I can see that it is downloading module/magento-base v 2.0.3 but after update is finished and I go to admin it still states v 2.0.2.  How should I upgrade the system ?


texts:
I'm trying to receive all children categories from a root categorie. I have flat categories enabled.

The problem is that this categorie is not my store root category. I have a main menu (store root category) and a sidebar (another root category). For the sidebar I want to receive the child categories.

What I did so far:

$category = $this->_categoryFactory->create();
$storeCategories = $category->getCategories($this->getSelectedRootCategory(), $recursionLevel = 1, $sorted, $asCollection, $toLoad);

This does fetch all categories, but these are the categories from the store root category.

If I take a look at the getCategories function (in Magento\Catalog\Model\ResourceModel\Category\Flat) I know why:
getCategories calls the function getNodes:

public function getNodes($parentId, $recursionLevel = 0, $storeId = 0)
{
    if (!$this->_loaded) {
        $selectParent = $this->getConnection()->select()->from(
            $this->getMainStoreTable($storeId)
        )->where(
            'entity_id = ?',
            $parentId
        );
        if ($parentNode = $this->getConnection()->fetchRow($selectParent)) {
            $parentNode['id'] = $parentNode['entity_id'];
            $parentNode = $this->_categoryFactory->create()->setData($parentNode);
            $this->_nodes[$parentNode->getId()] = $parentNode;
            $nodes = $this->_loadNodes($parentNode, $recursionLevel, $storeId);
            $childrenItems = [];
            foreach ($nodes as $node) {
                $pathToParent = explode('/', $node->getPath());
                array_pop($pathToParent);
                $pathToParent = implode('/', $pathToParent);
                $childrenItems[$pathToParent][] = $node;
            }
            $this->addChildNodes($childrenItems, $parentNode->getPath(), $parentNode);
            $childrenNodes = $this->_nodes[$parentNode->getId()];
            if ($childrenNodes->getChildrenNodes()) {
                $this->_nodes = $childrenNodes->getChildrenNodes();
            } else {
                $this->_nodes = [];
            }
            $this->_loaded = true;
        }
    }
    return $this->_nodes;
}

This function has a check $this->_loaded. If my Sidebar block calls the getCategories function it returns the categories from the root category because these are already loaded.

What is the best way to retrieve my categories? I can reset the _loaded var from a plugin, but I don't think it's the right way to handle this.

Update

The function getNodes starts with

$selectParent = $this->getConnection()->select()->from(
            $this->getMainStoreTable($storeId)
        )->where(
            'entity_id = ?',
            $parentId
        );

that uses $this->getMainStoreTable($storeId).

This returns the flat category table. Because my other category is not the store's root category it's not present in this table. That's why my category is not found. How can I prevent this?


texts: Why Magento 2 developers create ASCII art in their code?

texts:
I wonder why nobody refactored this abomination

Magento\Framework\ObjectManager\Factory\AbstractFactory

/**
 * Create object
 *
 * @param string $type
 * @param array $args
 *
 * @return object
 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
 *
 */
protected function createObject($type, $args)
{
    switch (count($args)) {
        case 1:
            return new $type($args[0]);
        case 2:
            return new $type($args[0], $args[1]);
        case 3:
            return new $type($args[0], $args[1], $args[2]);
        case 4:
            return new $type($args[0], $args[1], $args[2], $args[3]);
        case 5:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4]);
        case 6:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
        case 7:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6]);
        case 8:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7]);
        case 9:
            return new $type(
                $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8]
            );
        case 10:
            return new $type(
                $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9]
            );
        case 11:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10]
            );
        case 12:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11]
            );
        case 13:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11],
                $args[12]
            );
        case 14:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11],
                $args[12],
                $args[13]
            );
        case 15:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11],
                $args[12],
                $args[13],
                $args[14]
            );
        default:
            $reflection = new \ReflectionClass($type);
            return $reflection->newInstanceArgs($args);
    }
}


texts:
I have two files .txt and .bat files. txt file has barcode printing program and batch file has command to send it to TSC printer.
txt file with below code:
SIZE 97.5 mm, 37 mm
DIRECTION 0,0
REFERENCE 0,0
OFFSET 0 mm
SET PEEL OFF
SET CUTTER OFF
SET PARTIAL_CUTTER OFF
SET TEAR ON
CLS
CODEPAGE 1252
TEXT 752,261,"0",180,6,8,""
TEXT 520,241,"0",180,16,20,""
TEXT 704,212,"0",180,9,11,""
BARCODE 752,159,"128M",70,0,180,2,4,"!104OR01234"
TEXT 708,83,"ROMAN.TTF",180,1,12,"OR01234"
TEXT 486,45,"0",180,8,9,""
PRINT 1,1

bat file with below code:
COPY <path_of_file> <TSC printer path>
del  <path_of_file>
EXIT

I have been using this to run batch file to print through TSC machine but it fails many times. When I restart TSC machine, then batch file works and prints the barcode. I have to each time switch-off / on the machine to make batch file printing method work.
Please advise on where am I missing anything.
Thanks in advance.


texts: Magento2 Installation Parse error unexpected T_OBJECT_OPERATOR

texts:
I tried installing Magento2 today to try it out.

I ftp'd the zipped codebase from github to my server and unpacked it, but when I try to run the installer I get the below error.

  Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /public_html/magento2/app/bootstrap.php on line 64

Lines 59 down are:

/**
 * Require necessary files
 */
require_once BP . '/app/functions.php';
require_once __DIR__ . '/autoload.php';
(new \Magento\Framework\Autoload\IncludePath())->addIncludePath(array(BP . '/app/code', BP . '/lib/internal'));
$classMapPath = BP . '/var/classmap.ser';
if (file_exists($classMapPath)) {
    require_once BP . '/lib/internal/Magento/Framework/Autoload/ClassMap.php';
    $classMap = new \Magento\Framework\Autoload\ClassMap(BP);
    $classMap->addMap(unserialize(file_get_contents($classMapPath)));
    spl_autoload_register(array($classMap, 'load'), true, true);
}

if (!defined('BARE_BOOTSTRAP')) {
    $maintenanceFlag = BP . '/' . \Magento\Framework\App\State\MaintenanceMode::FLAG_DIR . '/'
        . \Magento\Framework\App\State\MaintenanceMode::FLAG_FILENAME;
    if (file_exists($maintenanceFlag)) {
        if (!in_array($_SERVER['REMOTE_ADDR'], explode(",", file_get_contents($maintenanceFlag)))) {
            if (PHP_SAPI == 'cli') {
                echo 'Service temporarily unavailable due to maintenance downtime.';
            } else {
                include_once BP . '/pub/errors/503.php';
            }
            exit;
        }
    }

    if (!empty($_SERVER['MAGE_PROFILER'])) {
        \Magento\Framework\Profiler::applyConfig(
            $_SERVER['MAGE_PROFILER'],
            dirname(__DIR__),
            !empty($_REQUEST['isAjax'])
        );
    }
}
date_default_timezone_set(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::DEFAULT_TIMEZONE);

Any ideas what could be causing this issue?


texts: Hide Attribute labels with only one value & value should be "v1"

texts:
short :

Attribute have many dropdown values - v1,v2,v3,v4

IF all Products are assigned to value "v1" of an attribute , means no products are assigned to "v2,v3.v4" than that Attribute label should not visible under Layered Navigation....

Long :

we wanted to hide one attribute value in layered navigation.

many attribute codes have same attribute value.

ex: "attribute codes "a1", "a2", "a3", "a4" have attribute value "v1"

we are using following code to hide the attribute value "v1" in layered navigation.

but Attribute Label is still displaying in layered navigation.

if for attribute code : "a1" , attribute label is "L1" , values are "v1", "v2","v3"

if all products are assigned to "v1", than along with "v1" , I want to hide "L1" in layered navigation.

<?php if($this->canShowBlock()): ?>

        <?php echo $this->__('Browse') ?>

        <?php echo $this->getStateHtml() ?>
        <?php if ($this->getLayer()->getState()->getFilters()): ?>

<a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?>

        <?php endif; ?>
        <?php if($this->canShowOptions()): ?>

                <?php $_filters = $this->getFilters() ?>
                <?php foreach ($_filters as $_filter): ?>
                <?php if($_filter->getItemsCount()): ?>

            <?php if($this->__($_filter->getName())=='L1'&& $_filter->getItemsCount()<=1) continue;?>

<?php echo $this->__($_filter->getName()) ?>

<?php echo $_filter->getHtml() ?>

                <?php endif; ?>
                <?php endforeach; ?>

        <?php endif; ?>

<?php endif; ?>

when we use following code , it hided only L1 attribute label , but we have to hide multiple attribute labels like this.

<?php if($this->__($_filter->getName())=='L1'&& $_filter->getItemsCount()<=1) continue;?>


texts: If product doesn't belong to this category do this

texts:
So I'm trying to display some content only if the product doesn't belong to a certain category.
I know how to do this if the product DOES belong to the category, so I would do this:

<?php
if(in_array(354, $_product->getCategoryIds())){
    echo "<span>" . $_product->getDescription() . "</span>";
}
?>

But not sure how to do this so to display the description only if the product DOESN'T belong to this category?


texts: 404 not found page for SMD colorswatch in catalog dropdown

texts:
I have successfully installed SMD colorswatch extension on magento. Settings of secure and unsecure Url are correct

other pages are working fine, also colorswatch on frontend working fine.

I updated magento version to 1.9.2, after updation of magento version I am receiving 404 not found page error in admin.

Please let me know about what I am missing for this

Thanks


texts:
I have access to an array from catalog/product that contains a bunch of information.  For instance:

$product = mage::getSingleton('catalog/products')->load(12345);
mage::log($product->getData()); //shows me what this model contains

Say I want to look up the color of my product, my problem is that color is giving me a number like 1205, instead of the actual name of the color.  Do I need to be looking into  joins of different table to access the value of 1205? Thanks in advance.

Here it is in code

mage::log($product->color); // prints 1205


texts: How to edit or modify already created shipment?

texts:
I am using Magento 1.9.3

I have created shipment against an order. Is there any way to update my created order shipment.

For example : Lets say I have created a shipment with 5 items. Now instead of delivery 5 items I want to deliver only 3 item. Remain items will be delivered in different shipment.

Here I need to edit my shipment, how I can do that?


texts: Add options to Sub-category attribute in Magento 1

texts:
I want to add additional option to the subcategory attribute but I cannot locate where to update its content within the Magento Admin Panel.

See this link for full image - https://drive.google.com/open?id=16sFqr_i_9jRyAs4yDTwAVPeDIkfAz0Il

Currently, I have no access to the backend/module files, so I am not sure if its hardcoded or can be edited within the admin panel.

Please help. I am very new to Magento.

Thank you


texts:
I am using $_item->getData("attribute_code") to fetch the attribute code in the related products on the product page, but it does not seem to work with multiselect attributes.
Is there a variation on the code that would accomplish this?


texts: i want to add slides multiselect drop down in banner form in admin through coding in magento 2

texts:
I want to load the slide section in a banner form and want to select the slides from the multi-select drop-down banner form and should save it in the database. I want to create this functionality as mentioned in the image. Anyone can help me.
Thanks!


texts: Magento 2 does not allow linking Modules using symlinks

texts:
I've added a local development module (separate git repo) to Magento 2 using symbolic links and it was working fine until I hit the PHTML templates. After heavy debugging I found out that the Magento 2 filesystem class (Magento\Framework\Filesystem\Directory\Read) uses an isExists() method combined with an getAbsolutePath() call to see whether the PHTML template exists. However, the getAbsolutePath() method checks whether the relative path exists within the Magento 2 filesystem and if not, it prepends the Magento 2 root to. it. In my case, the module lives in a separate repo /git/A while Magento lives in /site/B and this behaviour checks for the existence of a PHTML template in /site/B/git/A.

In short: PHTML templates that live outside of the Magento 2 root filesystem are not picked up, regardless of the System Configuration setting "Allow Symlinks" being turned on. It seems that setting is working, but only if the source of the symlink is still within the Magento 2 filesystem.

Has anybody else encountered this? What would be the best way to handle  development in an external git repo?


texts: Error: Unable to apply data patch when running setup:upgrade after magento version upgrade to 2.3.5-p2

texts:
I am getting this error when i run bin/magento setup:upgrade command
Unable to apply data patch Magento\Sales\Setup\Patch\Data\ConvertSerializedDataToJson for module Magento_Sales. Original exception message: Notice: Undefined index: option_type in /chroot/home/a0a91d92/int.parriscues.com/vendor/magento/module-sales/Setup/SerializedDataConverter.php on line 33
When i remove data from sales_order_item table then it works fine.
I upgraded from magento 2.1 to 2.3.5-p2.
In sales_order_item table product_options column is showing data like this
a:2:{s:15:"info_buyRequest";a:6:{s:4:"uenc";s:0:"";s:7:"product";s:3:"103";s:28:"selected_configurable_option";s:0:"";s:15:"related_product";s:0:"";s:7:"options";a:0:{}s:3:"qty";i:1;}s:7:"options";a:0:{}}

and i think the issue is in this format.


texts: Magento 2 Gift Card Message Text area want maximum 220 characters only?

texts:
I enable gift option from magento 2 admin end. Now i want to make gift card message text area need to allow maximum 220 characters only.

How do we achieve this?

Thanks


texts: How to edit a page in cms that isn't there?

texts:
I just uploaded a quick start magento+theme on my server and now I have this list of pages and none of them corresponds to the home page.

The home page in question is full of content, But when I browse through content-> pages all of them in "content" have nothing but a div with "page-content" "display:none"

what am I missing?


texts: Magento Backend horribly slow Nginx + PHP-FPM + MariaDB + Redis

texts:
Backend goes horribly slow. Page loads of 10+ seconds.

We have a large Magento site with over 56k orders, 1.9k products and 2 store views.

Tried enabling PHP slowlog, and I couldn't find any relevant slow queries. Same goes for slow queries on the DB server.

Using Chrome developer tools I got a clue on what's going on:

After enabling the Magento native Varien Profiler I got some interesting insights:

Taking a deep look at the webserver and database performance, I can't see anything wrong with CPU/Memory/Disk usage.

Site setup:

Magento Community Edition 1.9
We have a Load Balancer with a thin layer of caching for static
objects.
One webserver running Nginx + Php-fpm + Redis, on a Cloud
Server with 8 CPUs + 30GB RAM + 300 GB SSD storage.
One database server running MariaDB , on a Cloud Server with 8 CPUs + 8GB RAM + 160 GB SSD storage.

Caching setup:

Database caching is enabled.
Nginx is configured to send cache headers for static objects.
PHP version 5.4 is configured to use Zend OpCache.
Magento is using default native cache + Amasty Full Page Cache.
Magento backend is set to use Redis for session management..
Load Balancer does cache static content.

The frontend goes lightning fast, and the second page load (serving static content from user browser cache) is even faster.

SOLUTION

BL Custom Grid module was slowing the order and product grids to 10-19 seconds. Disabling the module solved the issue.

Thank you to everyone who helped!


texts: how to solve http 500 error after installation of extension in magento?

texts:
working on magento 1.9 website.

i am trying to develop a website, but after installing a extension am getting http 500 error can anyone please guide how to i resolve the same ?

is it a extension conflict or due to any else issue.


texts: CSV export in product grid not exporting all the records

texts:
I have overridden Mage_Adminhtml_Block_Catalog_Product_Grid and added the export functionality like below :

protected function _prepareColumns()
{
    $this->addExportType('*/*/exportCsv', Mage::helper('customer')->__('CSV'));
    $this->addExportType('*/*/exportXml', Mage::helper('customer')->__('XML'));
    parent::_prepareColumns();
}

and also overridden Mage_Adminhtml_Catalog_ProductController and added the exportCsv and   exportXml actions :

/**
     * Export product grid to CSV format.
     */
    public function exportCsvAction()
    {
        $fileName   = 'products.csv';
        $content    = $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')
            ->getCsv();

        $this->_sendUploadResponse($fileName, $content);
    }

    /**
     * Export product grid to XML format.
     */
    public function exportXmlAction()
    {
        $fileName   = 'products.xml';
        $content    = $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')
            ->getXml();

        $this->_sendUploadResponse($fileName, $content);
    }

    protected function _sendUploadResponse($fileName, $content, $contentType = 'application/octet-stream')
    {
        $response = $this->getResponse();
        $response->setHeader('HTTP/1.1 200 OK', '');

        $response->setHeader('Pragma', 'public', true);
        $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);

        $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
        $response->setHeader('Last-Modified', date('r'));
        $response->setHeader('Accept-Ranges', 'bytes');
        $response->setHeader('Content-Length', strlen($content));
        $response->setHeader('Content-type', $contentType);
        $response->setBody($content);
        $response->sendResponse();
    }

The csv is generated fine. But the issue is there are only 20 records in the csv that is exported. I want all the products to be exported. Can anyone suggest what is the issue ?
Thanks in Advance.


texts: Magento 2 - Changing the packing slip pdf print out layout

texts:
I am trying to edit the template of packing slip pdf print file.

Basically the part that I am interested is the height of product description area.

I traced back the parts that create font size or box height, but I am not sure how I should edit it. Obviously I am not looking for editing them on Magento core and I am trying to edit the parts in a custom module.

https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php#L88

for example on this line the $this->y & $this->y - 15 are the rectangle height for the pdf print out in products area.

I tried to create an Invoice.php file in my custom module under

  MY_MODULE\Model\Order\Pdf

and copy/paste the content of git repo file there and did the edit, but it did't work. I know how to change the xml layouts but technically I am not sure how I should edit this type of files.
Anyone can help?


texts: How do I add a template into the header panel? Magento-2.1.7 Porto Template

texts:
I created the modified default.xml and created headerContent.phtml to add new content to the header panel to be position on the opposite side of the login and welcome msg.  However, after uploading, modifying and clearing all caches, my new content isn't showing up on the page at all.

  Vendor/Theme_name/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="header.panel">
            <block class="Magento\Framework\View\Element\Template" name="header.content" template="Magento_Theme::headerContent.phtml" before="header.links" />
        </referenceContainer>
    </body>
</page>

  Vendor/Theme_name/Magento_Theme/templates/headerContent.phtml

Hello World!

What am i doing wrong? did i use the wrong location or a typo somewhere?


texts: M2  issue. Unsure if it's a bug I should log

texts:
We're developing 10-12 internal M2 extension for a big corporate client.  These all load via Composer.  Developers had this  node in three of the extensions.

<sequence>
    <module name="Magento_Backend"/>
</sequence>

This caused our /app/etc/config.php array to be out of order with the primary effect being that Magento_Customer loaded before Magento_Theme and broke widget positioning  (I'm sure there were other issues but I didn't need to look any further).  Similar to this

https://mage2.pro/t/topic/2214/2

After digging around for a day, I discovered a workaround was to remove

<module name="Magento_Backend"/>

from

<sequence>

in just one of the extensions.

I'm guessing we created a circular dependency and I've read that Magento will give up using the  positions if it discovers a circular dependency in bin/magento setup:upgrade but not sure why removing it from one of three made a difference.

In developer mode, I would've expected an entry in the logs but there wasn't anything.

I'd like to report it as a bug but not sure if it actually is one.

Has anyone else experienced their /app/etc/config.php being strangely out of order?

Thanks, Wilson


texts: get increment_id from sales_shipment table

texts:
I want to create a method (in helper) that get increment_id value by order_id as parameter. So it will look like:

public function getIncrementId($orderId)
{
    $sql = "SELECT increment_id FROM ".$tableName." WHERE order_id = '$orderId'";
    return increment_id;
}

In this case maybe $tableName will be sales_order table. Or maybe there is a resource model that can i use?


texts: Magento Partial Payment / Invoice / Refund

texts:
I need to know what kind of partial things are possible in Magento ?

Like we say Partial Payment / Partial Invoice / Partial Refund

If any of the above is possible then how can I implement it ?

Thanks !!!


texts: Catalog Price Rule (with SKU) not working

texts:
Trying to make a catalog price rule for SKU's, but it doesn't work.

Try it with the whole categorie and than it works fine.

Someone can help me out?

edit:
see image for config


texts: Magento 2: Orders created without shipping address

texts:
So this is bit of a weird one. There were a couple of orders created in the shop I run, but there was no shipping address in them. When I tried to reorder from the backend, the shipping address section was greyed out, and

  "You don't have to select a shipping address."

was being shown.

Even in the shipping method section,

  "You don't have to select a shipping method."

This has never happened before, and googling it returned nothing except some translation CSVs.

Help!


texts: Magento - Show custom data on Order Information page (Customer Account)

texts:
I need to display points earned by customer on Order Information page under customer account.

module.xml

<sales_order_view>
    <reference name="order_items">
        <action method="addItemRender" ifconfig="mymodule/general/active"><type>default</type>
            <block>sales/order_item_renderer_default</block>
            <template>namespace/mymodule/sales/order/items/renderer/default.phtml</template>
        </action>
    </reference>
</sales_order_view>

Copied file from core - sales/order/items/renderer/default.phtml to namespace/mymodule/sales/order/items/renderer/default.phtml and along with default code, I added mine

<?php $finalPointsEarned = ($_item->getCustomerProductPoints() * $_item->getQtyOrdered()); ?>

    <?php echo $this->__('Points Earned:'); ?>
        <?php echo $finalPointsEarned ?>

As shown in below image, this is how points earned are shown

Is this the correct approach/method to show custom data on Order
Information page ?
If not, how do I override Sales/Order/Item/Rendered/Default block to show the same without copying core file
in my extension and then adding my code ?

Will it be same for below mentioned files too ?

sales/order/invoice/items/renderer/
sales/order/shipment/items/renderer/
sales/order/creditmemo/items/renderer/

Also, I am showing the same information in admin section by copying files in my extension

adminhtml\default\default\template\namespace\modulename\sales\order\total.phtml

P.S. The files belongs to community extension

EDIT AS PER CUSTOM BLOCK CREATION

config.xml

<global>
    <blocks>
        <productpoint>
            <class>Namespace_Modulename_Block</class>
        </productpoint>
        <sales>
            <rewrite>
                <order_item_renderer_default>Namespace_Modulename_Block_Sales_Order_Item_Renderer_Default</order_item_renderer_default>
            </rewrite>
        </sales>
    </blocks>
</global>

points.xml

<sales_order_invoice>
    <reference name="invoice_items">
        <block type="core/text_list" name="invoice.productpoints.info" translate="label">
            Additional Points Info
        </block>
    </reference>
</sales_order_invoice>

Sales/Order/Item/Renderer/Default.php

<?php

class Namespace_Modulename_Block_Sales_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
{
    public function getInvoiceProductPoints()
    {
        parent::getItem();
        $_item = $this->getItem();
        $finalPointsEarned = ($_item->getCustomerProductPoints() * $_item->getQty());
        return $finalPointsEarned;
    }
}

sales/order/items/renderer/default.phtml

<?php $addInfoBlock = $this->getInvoiceProductPoints(); ?>
<?php if ($addInfoBlock): ?>
    <?php echo $addInfoBlock ?>
<?php endif;?>


texts:
Looking at some of the Resource Models in Magento 2, you will find the following class definitions

namespace Magento\Catalog\Model\ResourceModel;

abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity
{
   ...
}

namespace Magento\Customer\Model\ResourceModel;

class Customer extends \Magento\Eav\Model\Entity\VersionControl\AbstractEntity
{
    ...
}

class Group extends \Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb
{
    ...
}

class Visitor extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
    ...
}

As you can see, there are VersionControl abstract classes and regular ones.

\Magento\Eav\Model\Entity\AbstractEntity
\Magento\Eav\Model\Entity\VersionControl\AbstractEntity
\Magento\Framework\Model\ResourceModel\Db\AbstractDb
\Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb

What is the difference between the two? When you create your own entities, should your Resource Models extend from the VersionControl class or the regular one?


texts:
I have used Magento 2 with 2 store view and My default store is English and set Category Link in Mega Menu but when i change my Store view from English to french that category link goes to 404 page.

As the category shows in Menu too.


texts: Can't override Mage_Review_Block_Product_View class

texts:
I'm trying to extend Mage_Review_Block_Product_View but my new class is not called... I think it could be a typo, but I can't find it.

It is not a issue related to the code inside my class, but to the calling of class rewrite. If I make an override placing the modified class in app/code/local/Mage/Review/Block/Product/View.php it does it job.

If I try to integrate the rewrite in a module it is not called. Here me code:

module config.xml:

[...]
<global>
  <blocks>
    [...]
    <review>
      <rewrite>
        <form>Bbox_ExtendReview_Block_Review_Form</form>
        <product_view>Bbox_ExtendReview_Block_Review_Product_View</product_view>
      </rewrite>
    </review>
    [...]
  </blocks>
  [...]
</global>

Than in app/code/local/Bbox/ExtendReview/Block/Review I have:

Form.php that is correctly called
Product/View.php that is not called

The View.php contain the class extension:

<?php

class Bbox_ExtendReview_Block_Review_Product_View extends Mage_Review_Block_Product_View
{

public function getReviewsCollection()
{
    //some code...
}

Everything looks fine to me.. and the rewrite in Form.php is correctly working, so I don't understand way the Product/View.php is not...

I'll really appreciate any advice.


texts: Magento add-to-cart buttons on homepage don't update cart

texts:
Problem relates to Internet Explorer 11 and Google Chrome (but sometimes it works in Google chrome and sometimes not).

The add-to-cart buttons on the product list on the homepage of Magento 1.8 does not update the "total cart sum" and there's no green box pop-up with the "product-x added to cart!" confirmation text.

But after clicking on a category the green box suddenly turn up with confirmations on all products added on the homepage, and the "total cart sum" is correct.

Add-to-cart buttons in category products lists works fine as well as add-to-cart buttons on product pages.

Current html for the add-to-cart buttons on the product list on the homepage:

<button type="button" title="Buy" class="button btn-cart" onclick="setLocation('http://mydomain.nu/index.php/checkout/cart/add/uenc/aHR0cDovL3N1bmRhcmUubnUvaW5kZXgucGhwLw,,/product/13/form_key/8Epibh9PEQSDwzRy/')">
Buy</button>

Current html for the add-to-cart buttons in the product list on categories:

<button type="button" title="Buy" class="button btn-cart" onclick="setLocation('http://mydomain.nu/index.php/checkout/cart/add/uenc/aHR0cDovL3N1bmRhcmUubnUvaW5kZXgucGhwL21pbmVyYWxzLmh0bWw,/product/134/form_key/8Epibh9PEQSDwzRy/')">
Buy</button>


texts: Magento 1.9 - Where is Sales Email option

texts:
I have created a custom email template for Order Confirmation email.
Now I want to select that template in the admin so it can be the template/design which will be send to customers who place orders.
What I know is I have to select that template from Sales > Sales Emails ...
But I didn't find 'Sales Emails' option under System > Configuration > Sales.

Please guide me the correct path where I can apply my new custom template.

Thanks.


texts: Show coupon code in newsletter subscription success message

texts:
I need to show dynamically generated coupon code into my newsletter subscription success message in frontend:

I installed an extension of popup newsletter subscription module in Magento version 1.9.1.0. It's working well and sending the dynamic coupon code in mail, but I need to show a dynamically generated coupon code in my newsletter subscription success message in frontend. How can I do that?


texts: How can I submit a shipment via javascript console?

texts:
I started off thinking I could make a little bookmarklet to check the "Notify customer by email" box and then submit a shipment. It should have taken seconds. I've been banging my head against a brick wall for hours! Now it's personal.

Here's what I know:

Checking the "notify customer checkbox is easy enough: $("#send_email").prop('checked',1);

The button tag has this attribute onclick="submitShipment(this)" so I should either be able to trigger the button's click event or call the function directly, passing the button element as the argument. The button can be selected like so: $("button[title='Submit Shipment']")

I've tried all of the following:

$("button[title='Submit Shipment']").click();
$("button[title='Submit Shipment']").trigger("click");
$("button[title='Submit Shipment']")[0].click();
$("button[title='Submit Shipment']").onclick();
Event.fire($("button[title='Submit Shipment']"),'click');
this:

var evt = document.createEvent("HTMLEvents");
evt.initEvent('click', true, true );
$("button[title='Submit Shipment']").dispatchEvent(evt);

and even this:

$.ajax({
  url:'https://raw.githubusercontent.com/eduardolundgren/jquery-simulate/master/jquery.simulate.js',
    dataType: "script",
    success: function(data, textStatus, jqxhr){
    eval(data);
    $("button[title='Submit Shipment']").simulate("click");
   }
});

I'm all out of ideas! Can anyone help out?


texts:
I have been working on a custom extension and I need a function to send the generated CSV file. Can you please let me know what might be the possible error in it.

protected function _sendCSV($filename, $subject, $last_update, $now) {
    $template_id = "svm_export_email";
    $email_template =  Mage::getModel('core/email_template')->loadDefault($template_id)->setSubject($subject." [".$now."]");
    $template_variables = array(
        'file_name' => $filename,
        'last_update' => $last_update,
        'now' =>$now,
        );
    $email_template->getProcessedTemplate($template_variables);

    $sender = array('My Team' => Mage::getStoreConfig('trans_email/ident_general/email'));
    $email_template->setFrom($sender);

    $file = Mage::getBaseDir('var') . DS .'SVM'. DS .date('Y'). DS .date('m'). DS .$filename;
    $attachment = $email_template->getMail()->createAttachment(file_get_contents($file));
    $attachment->filename = $filename;

    try {
        $email_template->send('thecoderin@gmail.com','My Gmail');
    } catch (Exception $e) {
        Mage::log($e->getMessage(), NULL, self::LOG);
        return false;
    }
    Mage::log($filename." File sent through mail", NULL, self::LOG);
    return true;
}

I am getting the following error on invoking the function:

exception 'Exception' with message 'This letter cannot be sent.' in /my/magento/root/app/code/core/Mage/Core/Model/Email/Template.php:398

Thanks!


texts: Set Login page has store home page in Magento 2

texts: In Magento 2, I need to redirect the store to login page when user enters the store address instead of homepage.


texts:
As suggest the title; what I want to do is to set url in my email template different depending on locale language.

What I tried to do:

  config path='web/unsecure/base_url'}}{{config
  path='general/locale/code'}}/generic-url-key

to get something like mysite.net/en/generic-url-key or mysite.net/fr/generic-url-key

The problem is that the variable:

  {{configpath='general/locale/code'}}

return something like en_EN, fr_FR and I can't this value in my url

Is possible to set my own variable in database that return me something like "en", "fr"? How does magento will return me the value depending on locale lang?

Thanks.


texts: Override do not apply in a custom module

texts:
I try to override the mini cart but by changes are not getting applied. I have the following in my di.xml inside custom module

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\CustomerData\Cart" type="Vendor\Custom\CustomerData\Cart" />
    <preference for="Magento\Tax\CustomerData\CheckoutTotalsJsLayoutDataProvider" type="Vendor\Custom\CustomerData\CheckoutTotalsJsLayoutDataProvider" />
</config>

and I override for example

public function getSectionData()
    { var_dump('test'); die;}

the structure what I was building is the same what I was created here How to override magento-checkout CustomerData/Cart.php?

but never gets executed!


texts: Placeholder image not resized in Backend in magento 2

texts:
I have uploaded place holder images in backend, while I am trying to edit the configurable product in backend.  Under configuration section It displays the place holder image at larger size for each child products. It has failed to resize the place holder image as thumbnail image.

1)In what size should i upload a place holder image

Please provide me a solution .


texts: Magento 2 + How to add first name and country field in newsletter subscription form?

texts:
I have Magento 2.3.4 I want to show the "first name" and "country" field in the newsletter subscription form. Also, it would be for guests and customers as well. Both fields should be shown in the admin grid and that will be sent in emails as well.
How can I achieve this functionality?


texts:
Does magento 2 send email automatically when order has been paid (and invoice is created) ?

Mine doesnt. Can't understand how or where.


texts:
I'm trying to order products by position in category
public function __getProductCollection($category_id_array) {

    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*');
    $collection->addCategoriesFilter(['in' => $category_id_array]);
    $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
    $collection->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
    //$collection->addAttributeToSort('position');
    $collection->setOrder('position','ASC');

    return $collection;
}

I got this error
 Unknown column 'cat_index_position' in 'order clause'

I tried also
$collection->setOrder('cat_index_position','ASC');

$collection->setOrder('cat_index.position','ASC');

But the ordering is not working
PS: i'm using Magento 2.2.4


texts:
I have product named "Basic Plan" and "Premium Plan", which have a fixed but different price.

However, I would like to add one more, which allows customer to UPGRADE to Premium Plan, when he has purchased Basic Plan already.

The price will be dynamic, depends on how many days left of the basic plan.

Does Magento support this? or anyone got an idea how to achieve it?


texts: How to add a parameter to 'request' when redirecting a page?

texts:
My code in Rooter.php:

$this->_response->setRedirect('customer/account/create');
$request->setDispatched(true);
$request->setParam('nickname', $request->getPathInfo());
return $this->actionFactory->create(\Magento\Framework\App\Action\Redirect::class);

My code in register.phtml:

$sponsor = $block->getRequest()->getParam('nickname');

$sponsor returns null because params: array(0)


texts:
I want to create new a new attribute group for customer and then I want to add new attributes for that group. Can any one help me.
I am able to add custom attributes for customers, customer address. But I want to add my new group custom group against customer and then want to add my custom attribute1 ,attribute2 for that group. Can any one help.


texts: Crud Operation for Frontend and Admin. How Frontend form data save into database in Magento2 and show in Admin grid?


texts: any idea about or any extension available for the products subscription in magento. for example if a customer if a customer subscribe for some specific product he can get that product from the store with regular intervals in the year ?


texts: Magento 2 - connection between REST API and Magneto Frontend

texts:
It is possible to restore cart for guest by cartId created in REST api?

first i want to create cart in rest api, then add products to cart
then by cartId i want to restore this cart e.g. /checkout/cart/?cartId=xxxx

It is possible to login customer in frontend using REST api customer token?


texts: How to remove or reduce cart item qty via AJAX

texts:
I have to add two button minus and plus in list product page like this site: https://www.goodeggs.com/sfbay/produce .

Each time an user click on minus button, the number of this product in cart will be change.
I can't find any solution to do this. Who can help me ?.

Here is my remove function :

public function removeAction() {
    $this->getResponse()->setHeader('Content-type', 'application/json');
    $_params = $this->getRequest()->getParams();
    $_product = Mage::getModel('catalog/product')->load($_params['id']);
    $_cart = Mage::getSingleton('checkout/cart');
    $a = $_cart->getItemsQty();
    $a = $a - 1;
    $_cart->setQty($a);
    $_cart->save();
    return $this->getResponse()->setBody(json_encode($_response));
  }


texts: Add to compare link is not working on different browers

texts:
Somehow the link doesn't submit anything...same as the add to cart button
<a class="product-actions product-compare" href="<?php echo $_compareUrl ?>')" title="<?php echo $this->__('Add to Compare') ?>">

Site demo
EDIT:
I found the answer,  it is because the new "form_key" parameter added to POST requests in Magento to prevent XSS attacks.
The topic here, you can find the fix at the bottom of the page


texts: Admin "manage categories" error after remove "size chart"extension

texts:
i'm still having problem. please help!

I recently installed "size chart" extension and removed, and after that,

in my admin page, "Manage Categories" is not working.  But all other page seems to work fine.

I research other peoples question, but still couldn't figured it out.

i'm getting this error below.

Source model "maattabel/categorie" not found for attribute "maattabel_categorie"


texts: How to overwrite magento Catalog search Result controller?

texts:
Here is my config.xml file configurations.

<global><rewrite>
            <secondarysearch>
                <from><![CDATA[#^/catalogsearch/result/#]]></from>
                <to>/secondarysearch/result/</to>
            </secondarysearch>
        </rewrite>
    </global>

    <frontend>
        <routers>
            <secondarysearch>
                <use>standard</use>
                <args>
                    <module>EF_Secondarysearch</module>
                    <frontName>secondarysearch</frontName>
                </args>
            </secondarysearch>
        </routers>
    </frontend>

It's going to page not found when i'm searching.Anyone can help me ?


texts: Imported products don't show on frontend

texts:
I'm trying to merge two installations. I recreated the websites and stores, plus categories and attributes from installation A in B. In a test environement I changed the apache vhost, and the sites work. I imported the products, and checked product settings like category, websites to see if they were imported correctly. Categories and websites are set to active, like the products. I emptied cache and reindexed. Product stocks are the same as in the original database.

The homepage stays empty. Going to a product details page on the (still working) production site, I copied the url and opened this page in the test environment: page not found. This is the same for all imported sites. The original sites and products in this installation work correctly.

I'm probably missing something basic, but I can't figure out what. Any ideas what it could be?

Update

It turned out to be a problem with the templates. For three templates, files were missing in app/code/local that were essential for the templates to work properly, and that were obviously not copied when copying the templates.


texts: Move "Add to Wishlist" Button after "Add to Cart" in Product View

texts:
How to move "Add to wishlist" button after "Add to cart"?

I try using move but it's just working on the configurable products. I want it to work too on the simple products.

Check my catalog_product_view.xml :

...
  <move element="product.addto.wishlist" destination="product.info.addtocart.additional" />
...
  <container name="product.addto.wishlist" as="product_addto_wishlist" htmlClass="product wishlist" htmlTag="div">
      <block class="Magento\Catalog\Block\Product\View" name="product.info.addto" as="addto" template="Magento_Catalog::product/view/addto.phtml"/>
  </container>
...

Add to Wishlist button is not showing on simple products.

Configurable Products :

Thanks.


texts: How to fix customer register bug on install of SUPPEE-5994 Patch in magento

texts:
I have installed SUPPEE-5994 patch in magento 1.9.1.0 and facing customer registration problem.
Initially I discovered that form key is missing, that I fixed. But my problem was not solved.

I debugged the code app/code/core/Mage/Customer/controller/AccountController.php createpostAction function and it was going into catch and giving error "Cannot save the customer."


texts:
I am new in Magento and Odoo. yesterday  I have installed Magento and odoo in Windows 7 on localhost (XAMPP). For frontend I want to use Magento and for backend just odoo. So i found this installation on google but it is not for Windows environment. Please somebody can tell me how can i use them both ?

More info :

Magento  Latest version 2.1.0
Odoo     v8.0
xampp    v3.2.2
Php      v7.x.


texts: How to add "read more" to category description in product listing page in Magento 2.2.4?

texts: I don't know how to implement this task. I have used in smart wave and Porto theme. I want to add read more in the category description. Can you please help me?


texts: Display wishlist sidebar on all catalog pages

texts: I am trying to have the wishlist sidebar on my site display on all catalog pages, as the cart sidebar does. As of now the only way it displays is if you add a product to the wishlist.


texts: Why are my product results inconsistent?

texts:
Synopsis

I have created a Helper class which is used to collect all associated products (Simple) for a Grouped Product.  To clarify the purpose of this helper, my intention is once I have the children products I will build a different array to return for my view.

I have discovered an inconsistency with the results. In the Admin I have created a Grouped Product, I associated three Simple products.

Example #1:

$children = $this->getAssociatedProducts();
Zend_Debug::dump( count($children) ); // Output: int(1)

Evidently I am missing two products by this result, coincidentally the only product output is the last associated product in the control panel.  However I then queried the database and found conflicting results as expected.

Example #2:

$children = $read->fetchAll($select);
Zend_Debug::dump( count($children) ); // Output: int(3)

Furthermore I continued to run through the Magento Core line by line to understand the underlying functionality, as usual I found nothing more than over-complicated processing.

I was hoping someone could enlighten me about how getAssociatedProducts works, more so to understand why I don't receive all of my expected results.

Snippet/Examples

File: app/code/local/Myvendor/MyModule/Helper/View/Product/Grid.php

<?php

class Myvendor_Mymodule_Helper_View_Product_Grid extends Mage_Core_Helper_Abstract
{
    public function getProducts(Mage_Catalog_Model_Product $product)
    {
        // Get a blank instance of the type model for validation.
        $modelType = $product->getTypeInstance(true);
        if (! $modelType instanceof Mage_Catalog_Model_Product_Type_Grouped) {
            Mage::throwException(sprintf(
                'Argument #1 expects type %s, %s given.',
                'Mage_Catalog_Model_Product_Type_Grouped',
                get_class($modelType)
            ));
        }

        // XXX - When Magento ORM doesn't work as intended or expected - use Zend query builder!

        $adapter        = Mage::getSingleton('core/resource');

        $tableProducts  = $adapter->getTableName('catalog/product');
        $tableRelations = $adapter->getTableName('catalog/product_relation');
        $read           = $adapter->getConnection('read');

        $select = $read->select()
            ->from(['main_table' => $tableRelations], [
                'product.*',
            ])
            ->joinLeft(['product' => $tableProducts], '(main_table.child_id = product.entity_id)', null)
            ->where('main_table.parent_id = ?', (int) $product->getId());

        $children = $read->fetchAll($select);

        Zend_Debug::dump((string) $select);
        Zend_Debug::dump(count($children));
        die;

        return array();
    }
}


texts:
I'm trying to add a few url rewrites into the config.xml file in the "app/etc/" folder.

I am not using the url rewrite function in magento itself because in need to be able to use regex.

I tried the following:

<global>
    <rewrite>
        <custom_url1>
            <from><![CDATA[/veelgestelde-vragen/(.*)/]]></from>
            <to><![CDATA[/faq/$1/]]></to>
            <complete>1</complete>
        </custom_url1>
    </rewrite>
    <rewrite>
        <custom_url2>
            <from><![CDATA[/account/bestelling/(.*)/]]></from>
            <to><![CDATA[/sales/order/view/order_id/$1/]]></to>
            <complete>1</complete>
        </custom_url2>
    </rewrite>
</global>

Somehow the custom_url1 rewrite on it self does work, but when i add the custom_url2 rewrite it breaks the first one, and custom_url2 doesn't work as well. custom_url2 on itself doesn't work either.

What am i doing wrong here?


texts: Adding a the block on checkout_cart_index

texts:
i tried add a new block in checkout cart of magento 2 is possible from of my module in this moment I have this.

<my_module>
->view
-->frotend
--->layout
----->checkout_cart_index.xml

In the file

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <block class="Magento\Framework\View\Element\Template" template="CARLOS_Cart::form/js.phtml" name="form.js"/>
</body>

thanks for your help


texts: Join stock information problems with flat products

texts:
I have this solution to filter out of stock products by joining a field from cataloginventory/stock_item (the is_in_stock field) from my product collection and this works as intended with non-flat-products. But with flat products enabled it breaks, it shows products which have inventory but have the status of "out of stock". Presumably because the fields aren't available when using flat products, but I'm not sure which other fields I should use then. Here is my code:

if (!Mage::getStoreConfig('cataloginventory/options/show_out_of_stock')) {
        $collection->joinField('is_in_stock', 'cataloginventory/stock_item', 'is_in_stock', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');
        $collection->addAttributeToFilter('is_in_stock', array('eq' => 1));
    }

I tried looking at core code and saw that they use cataloginventory/stock_status for their join, and then filter on the field stock_status. I tried to do this, but this doesn't work. How can I filter out of stock products when using flat products?


texts: Magento 2.1 add a new section on my account page

texts:
I need to add a custom tab at bottom of left menu on my account page 'link 1' and add a corresponding template file so that I can display my custom forms and dynamic custom content for that user.

I have tried the following:

This one doesn't works:
http://www.emiprotechnologies.com/technical_notes/magento-technical-notes-60/post/add-custom-tab-on-customer-account-section-in-magento-2-317

This one works but the links are not having template files:
https://magento.stackexchange.com/a/100096/39707

On customer page:

You can see my blog is displaying

After you click on 'My Blog': It takes to 404

Following is the complete module code:

Namespace/Support/view/frontend/layout/customer_account.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-suppport-ticket-link" after="-">
                <arguments>
                    <argument name="path" xsi:type="string">support/customer/index</argument>
                    <argument name="label" xsi:type="string">Support Ticket</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

Namespace/Support/view/frontend/layout/support_customer_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <head>
        <title>Support Ticket</title>
        <css src="Namespace_Support::css/styles.css"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Namespace\Support\Block\TicketList" name="ticketViewList" template="Namespace_Support::list.phtml" />
        </referenceContainer>
    </body>
</page>

Namespace/Support/view/frontend/templates/list.phtml

<?php echo 'hello' ;?>

Namespace/Support/etc/module.xml

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

Namespace/Support/Controller/Customer/index.php

<?php
namespace Namespace\Support\Controller\Customer;

use Magento\Framework\App\Action;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\Controller\ResultFactory;

class Index extends \Namespace\Support\Controller\Index
{
    /**
     * Show customer tickets
     *
     * @return \Magento\Framework\View\Result\Page
     * @throws NotFoundException
     */
    public function execute()
    {
        /** @var \Magento\Framework\View\Result\Page resultPage */
        $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        return $resultPage;
    }
}

Namespace/Support/Block/TicketList/index.php

<?php

namespace Namespace\Support\Block\TicketList;

class TicketList extends \Magento\Framework\View\Element\Template {

    public function __construct(\Magento\Catalog\Block\Product\Context $context, array $data = []) {

        parent::__construct($context, $data);

    }

    protected function _prepareLayout()
    {
        return parent::_prepareLayout();
    }

}

Namespace/Support/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Namespace_Support',
    __DIR__
);

Please guide me to achieve my task.


texts:
Decided to check out Magento, so I downloaded the sample data and Magento CE. I installed the sample data and CE locally using WAMP.

Everything went smoothly, but when I go to view the frontend, it seems the main images are missing(see below). Also any links I click on, I get a Not Found message:

Not Found Error looks like this :

  The requested URL /magento/accessories/eyewear.html was not found on this server.

Anyone else have a similar problem in the past? I'm perplexed as to how to correct this?

I tried reinstalling but got same result.

Thank you for your time. George


texts: M2: Referencing a container vs referencing a block

texts:
I'm trying to add some text (label) to product page. Following works for me:

        <referenceContainer name="product.info.main">
        <block class="Magento\Framework\View\Element\Text" name="my.custom.label" after="-">
            <arguments>
                <argument translate="true" name="text" xsi:type="string">My Custom Text</argument>
            </arguments>
                </block>
    </referenceContainer>

and given below doesn't:

 <referenceBlock name="product.info.review">
        <block class="Magento\Framework\View\Element\Text" name="my.custom.label" after="-">
            <arguments>
                <argument translate="true" name="text" xsi:type="string">My Custom Text</argument>
            </arguments>
                </block>
    </referenceBlock>

Any explanation why?!


texts: Magento 2 equivalent event of checkout_onepage_controller_success_action

texts:
I am working In Magento 2 Module, I've to do some customization on Magento Onepage checkout, for that I plan to use the checkout_onepage_controller_success_action, but In my project, We're installed some third-party modules, which are already used this event.

So, I believe if I again use the same event It won't work, an observer doesn't have an order to execute.

I want the equivalent event of checkout_onepage_controller_success_action. Is there have anything in Magento 2 Kindly let me know it.


texts: Magento2: Redirecting to Cart page from Checkout page after Place Order

texts:
I added products to cart. Then did proceed to checkout. I have tried Cash on Delivery and Check / Money Order as Payment method. Everything is fine until the order review section. And then when I click the Place Order button then it gets redirected to Shopping Cart page instead of going to Order Success page. The cart items are still there.
How to solve it ?


texts: Does Magento have the feature to change the color swatch on selecting a different color thumbnail?

texts:
I was checking if Magento 1.9.2 can change the color swatch on clicking over an image thumbnail of a different color.
Is this feature configurable?


texts: Text swatch value for multi store view showing wrong on frontend [ Magento 2.3.3 Enterprise Edition]

texts:
Have a look at below. Did anyone get the solution for this?

Why product text swatch display admin swatch value instead of specific store value?

Magento EE [2.3.3]

Steps to reproduce:

Create 2 websites with 1 store view each or just 2 store views
Create configurable select attribute (eg size) with different store
view value and label.
Now go to frontend, default store (GB) and load any category page with
configurable products with size as one of the attributes.

Now switch to a different website/ store view (US)

Expected result:

Once we switch to the website/store view(US), we should see the size's value to show according to the value set for that specific store view in the attribute edit section.

Actual result:

When we switch from the default website/store view(GB) to the US store view, it still shows the GB store view attribute option values instead of the US store values.


texts:
We have the following two attributes that are used in our transactional emails:

{{supplier_qty}}
{{qty}}

We would like to output the result of: {{supplier_qty * qty}}

For example, 5 * 1 = 5 (so 5 should be the resulting output).

How can we do this in Magento variables?


texts:
I currently use the following code to display some date inside my Magento store:

setlocale(LC_TIME, 'nl_NL');
$today = new Zend_Date($_product->getData('delivery_eta'), 'MM-dd-yyyy');
$date = Mage::helper('core')->formatDate($today, Mage_Core_Model_Locale::FORMAT_TYPE_FULL, false);
echo $date;

But when a for example Google Chrome visitor with a specific language goes to the website, this is translated to their language. I want to disable this and display the date always in Dutch.

How can I fix this?

I already tried to add the line setlocale(LC_TIME, 'nl_NL'); and setlocale(LC_ALL, 'nl_NL'); but that does not work. It is still translated. How can I fix this?


texts: Magento 2: Delete images of deleted products

texts:
I wanna know how delete the images + cache images from deleted products.
I tried:
https://magecomp.com/magento-2-image-clean.html
https://github.com/hungersoft/magento2-image-clean
https://github.com/sivaschenko/magento2-clean-media

And no solution, they doesn't delete the images

Any suggestion?
I used it in the 1.9.X but the code doesn't work.

https://www.devproblems.com/magento-remove-images-of-deleted-products/

Alfredo


texts: Magento 1.9 How to find the physical file location from $this->geturl

texts:
In Magento, I often see this code from different modules.
for example

 'url' = $this->geturl('*/path/to/file',array('_forced_secure' => $this->getRequest()->isSecure()))

But how can I find out which file on the server is being called from geturl? the path given in the code is not the physical path to the file.


texts: Show out of stock products at the end of product search results page

texts: I want to show out of stock products at the end of product search results page. I have tried to do that by using some free extension/code but none of code didn't worked for search results page. please suggest me how can I do that.


texts: how add custom field in "Order Summary" checkout?

texts: How I can add custom field with custom value in Order Summary? ty for answer


texts: Translating Magento categories in 1.9.0.1 -> Missing checkbox in store view for translation

texts:
I am setting up a second language store. We use the same root category. What I do is the following: I open the store view of the second language and want to start translating.

The weirdest thing: the checkbox in store view to "Use Default Value" (and thus override defaults) is completely missing. Now I would not know how to translate ...

question: is there a setting? or soemthing I need to do to enable the translation per store view in categories again?

Or has anyone seen this before?

many thanks

Examples

What I would expect to see

What we are currently seeing - notice the missing checkbox


texts: Need to list the mail template in my custom module config in Magento 2?

texts:
I have create one module for my custom use. now i want to list the mail template in store config in magento 2. i have try some code but its not working for me.

 <field id="pickup_template" translate="label comment" type="select" sortOrder="3" showInDefault="2" showInWebsite="0" showInStore="0">
    <label>mail template</label>
    <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment>
    <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
 </field>

With above code i have no luck to display mail template in store config.


texts:
I've created a new text swatch "size2" with a three sizes (A, B and C), then I added a new configurable product to my catalog with the three variations, as you can see on the screenshot below.

But only the title "size2" is showing up, without the newly configured sizes, as you can see on the picture below.

What's wrong in my configuration ?

I'm using Magento 2.1.3.


texts: Magento 2 - Generate all cache in a subdomain of the same server

texts:
I just changed the url base to retrieve the media resources from the following address:
https://subdomain.magento2.com/pub/media/

Images such as the logo and icons of the template work and are seen correctly. While the product images are not seen. The changed path is correct but Magento 2 does not generate the cache with the new path.
Is it a permission problem?
How can I have the Magento 2 cache generated by my subdomain?
Thanks!


texts: Cannot add fields before name widget - magento 2

texts:
I'm trying to add a field in the "new customer" form, so i would like to put something into customer_account_create.xml layout, precisely in the block

<block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="form/register.phtml">

so, after

<container name="customer.form.register.fields.before" as="form_fields_before" label="Form Fields Before" htmlTag="div" htmlClass="customer-form-before"/>

but before the "name widget" created runtime as a block in register.phtml

<legend class="legend"><?php /* @escapeNotVerified */ echo __('Personal Information') ?></legend>

<?php echo $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($block->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>

but i can't manage to do it

i tried on my custom customer_account_create.xml, under my modules view/frontend/layout directory, putting

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock name="customer_form_register">
            <block class="Magento\Framework\View\Element\Template" name="smtn-be4-name"  as="before-name" template="Vendor_Module::customTemplate.phtml" after="form_fields_before"/>
        </referenceBlock>

</page>

but it doesnt appear (lets say i created customTemplate.phtml under my module's view/frontend/templates directory, which prints something)

any ideas/help?
thanks in advance


texts: Display dynamic text color to specific category

texts: How can I display the dynamic color (fetched from admin configurations) and display it as a text color of a specific category item in the navigation menu.


texts: I have a large number of attributes in magento 1.9 won't save

texts:
I am trying to change the position of my attributes. There are a lot of attributes it says it saves the position, but nothing happens. No position is changed.

I am a bit lost how to solve this.


texts: Batching database schema changes during upgrades

texts:
Some background

When rehearsing a production deployment to EE 1.11 from 1.10, we encountered an issue where the SQL upgrade routines were adding columns to report, log, sales, customer tables for the Enterprise_RMA module.

The log tables on this particular install had ~10M rows, had not been maintained in quite some time. Adding columns proved to take a very, very long process. The rehearsal upgrade was performed on an AWS 4XL, and still took ~4 hours to complete.

Upon analysis, and reproduction of the issue, we found that columns were being added one at a time, SHOW PROCESSLIST reveals 30-45s for copy to tmp table for each column. There are dozens of columns to add in some of these tables.

Our (workable, but not my favorite) solution:

Our workaround was to truncate log/report tables, and take the hit on the sales_flat_order tables. We could have run the archiver to move some of the data out (~600k records or so) - but custom reports that demanded the presence of the sales_flat_order table precluded our ability to do that.

Our final, actual, production deployment still hit up in the 1.5 hour range for the full database upgrade.

Finally, the question:

How can we speed up database migrations from the application layer? Can we batch or roll up all ALTER statements into a handful of executions or is this just the nature of the beast? How do you handle this for your huge EE customers? Upgrade offline, swap in place?

Any and all feedback welcomed. Thanks in advance.


texts: Magento admin login redirect to frontend

texts:
When I try to login in magento admin and when I enter correct login detail I get redirected to the frontend.

I am using xampp

http://localhost/venkys/admin/index.php/admin/dashboard/index/key/e2c5440e3f8d569e3de19229617cba58/

This is the url in address bar.

And I am getting 404 page.

But when I try to change address bar to

http://localhost/venkys/admin/dashboard/index/key/e2c5440e3f8d569e3de19229617cba58/

Its working totally fine

Any help


texts: I want to change Magento add to cart to buy now and also I want to redirect the page. How to made that changes??


texts: after upgarde getting this error  Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (au.#sql-40d4_c, CONSTRAINT SALES_ORDER_CUSTOMER_ID_CUSTOMER_ENTITY_


texts: Magento 2: Custom validation for system.xml

texts:
Is it possible to create a custom validation for fields in configuration? (Stores > Settings > configuration)

I created a system.xml file but the default values for the validate tag are not enough for my needs and I would like to create my own rules.

I found an other question about this but it doesn't say how and where I should put/declare the validation method.

Is this possible or is the only solution to create a backend model with a beforeSave function?


texts: sending information from one controller to another

texts:
I am hoping to link together some controller actions if a certain quote option is selected.  More specifically, when a coupon code is activated and the user wishes to use their gift card I want to resend the coupon code information back to the coupon controller.

Is it possible to link together controllers in such a manner?  If so, how?  Both of these controller actions normally response to ajax requests.


texts: Disable entering new address in billing information

texts:
How can I disable entering new address in billing information in checkout?
Is this a setting somewhee?

I want that customer can only have the address he entered before or changed it in customer area. In checkout the customer shouldn't be allowed to change the address.

Thank you very much.


texts: US flag doesn't appear while changing the currency switcher to USD

texts: I have tried to update the currency switcher with respective flags. However during one of the session, i have uploaded the India flag as png file in the folder. Now when i change it to USD, the flag remains the same.


texts: Magento Hide shipping method for specific product

texts:
Hide Shipping Information and Shipping Method steps at checkout page for specific products.

Products may be of any type(Simple, Configurable, ...).

There will be a checkbox on the product page in the admin section for hiding shipping steps on the checkout page.


texts:
I'm using Magento ver. 1.9.0.1

In the store I manage, many products are differentiated by fractional sizes.  We sell 1/2", 5/8", 3/4", etc.

When customers search these terms in the search bar, the searches are processed in ASCII.  What ultimately happens is that we get a lot of searches for half inch items that come in as...

1%2F2
1&#472
1%2F2&#34
1&#472&#34

And so on.

What are some Magento best practices on this?
How can I better optimize the store to deliver more relevant search results?

Many thanks.


texts: I am stuck with this error while creating custom select attribute in product in magento 2

texts:
I am stuck with the following error while creating custom dropdown in magento 2.3.5.
Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Model\ResourceModel\Product\Collection::addIsSaleableAttributeToFilter() must be of the type array or null, int given, called in /opt/lampp/htdocs/M_3/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 1582 and defined in /opt/lampp/htdocs/M_3/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:2477 Stack trace: #0 /opt/lampp/htdocs/M_3/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php(1582): Magento\Catalog\Model\ResourceModel\Product\Collection->addIsSaleableAttributeToFilter(1) #1 /opt/lampp/htdocs/M_3/generated/code/Magento/Catalog/Model/ResourceModel/Product/Collection/Interceptor.php(518): Magento\Catalog\Model\ResourceModel\Product\Collection->addAttributeToFilter('is_saleable', 1, 'left') #2 /opt/lampp/htdocs/M_3/app/code/Smartwave/Filterproducts/Block/FeaturedList.php(53): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->addAttributeToFilter('is_saleabl in /opt/lampp/htdocs/M_3/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php on line 2477
Please help me to solve this error.


texts: Troubles with applying patches to Magento 1.9.2.0

texts:
I'm having troubles patching Magento 1.9.2.0.
Applying patch supee-7045 failed and I searched for a solution, and I have put the .htaccess and .htaccess.sample from a clean install into my Magento folder. I've also tried to install other previous patches. Just like suggested in this article (I had the same error): SUPEE 7405 Hunk #1 failed at 171
Patches supee-5344 en supee-5994 according to applied.patches.lists are installed. So I started with installing supee-6482, since from this patch there is a 1.9.2.0 patch is available. However trying to install this results in this error:

sh PATCH_SUPEE-6482_CE_1.9.2.0_v1-2015-08-03-06-51-10.sh
PATCH_SUPEE-6482_CE_1.9.2.0_v1-2015-08-03-06-51-10.sh: 14:
PATCH_SUPEE-6482_CE_1.9.2.0_v1-2015-08-03-06-51-10.sh: 127: not found
PATCH_SUPEE-6482_CE_1.9.2.0_v1-2015-08-03-06-51-10.sh: 14:
PATCH_SUPEE-6482_CE_1.9.2.0_v1-2015-08-03-06-51-10.sh: 127: not found
PATCH_SUPEE-6482_CE_1.9.2.0_v1-2015-08-03-06-51-10.sh: 25:
PATCH_SUPEE-6482_CE_1.9.2.0_v1-2015-08-03-06-51-10.sh: 0: not found
Checking if patch can be applied/reverted successfully...
-e ERROR: Patch can't be applied/reverted successfully.
checking file app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]  Skipping patch. 1 out of 1 hunk ignored checking
file app/code/core/Mage/Catalog/Model/Product/Api/V2.php


texts: Magento 1.9 How to remove index in the url when login from checkout

texts:
How to remove index in the url when login from checkout

checkout/onepage/index/


texts: How limit magento 2 shipping addresses in checkout

texts:
I want to show one shipping address per login customer in checkout shipping sections. How can I do  it in magento 2.

thanks.


texts: Which is the popular continous integration server for the latest Magento Enterprise edition?

texts: Both Jenkins and Hudson are popular continous integration server in Java and i have worked with both. I am interested in knowing the popular CI tool for Magento. I also have the requirement to integrate source control (TFS) and testing tools (Selenium) . It would be great if the developers or architects part of this community can share the popular and  commonly used one among these or can suggest any new tool too.


texts: update custom layout does not show custom style

texts:
I have an extra link for a custom style which is a logo that I should show only in one specific category, category id is 1262 so I did this:

<CATEGORY_1262>
    <reference name="head">
    <block type="core/text" name="mybuyscsscode">
        <action method="setText"><text><![CDATA[<link href="https://customlink.com/BreastCancer.css" rel="stylesheet" type="text/css" id="stylecustom">]]></text></action>
    </block>
</reference>
</CATEGORY_1262>

when I go to the page source I don't see the css in the page. also I did this:

<CATEGORY_1262>
    <reference name="head">
        <action method="setText"><text><![CDATA[<link href="https://customlink.com/BreastCancer.css" rel="stylesheet" type="text/css" id="mybuysstyles">]]></text></action>
    </reference>
</CATEGORY_1262>

none of them work, I do not have access to the code today so I have to do it by xml update, do I have any options to do it right?


texts: PWA venia theme URL not working in browser

texts:
I am trying to install a new instance of pwa with Magento 2.3.1
I am using Magento's cloud setup URL provided by default in my .env file. I get my build successful and the URLs are generated correctly but could not open the link in browser. It hangs at "Loading Homepage content..." text.
I could see below error repeatedly thrown in my browser console.

  react-dom.development.js?e595:506 Warning: Encountered two children
  with the same key, 'ReferenceError13H'. Keys should be unique so that
  components maintain their identity across updates. Non-unique keys may
  cause children to be duplicated and/or omitted — the behavior is
  unsupported and could change in a future version.

I have checked with multiple install of Magento as well as pwa-studio with no success.


texts: Magento-2 : How to set product custom price after add to cart

texts:
I have used checkout_cart_product_add_after event, for change product price.

Used observer code like below

$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);

Above code is not working while multi-currency, On cart page, if I added the product with price 100$ it is showing $100.

When I am changing currency from the switcher to INR, It was showing  ₹100.

If I disabled event and add to cart same product, it's working properly in both currencies.


texts: I'm trying to determine the mode programatically. What is the Magento 2 equivalent to Mage::getIsDeveloperMode() ? Or, how do I get MAGE_MODE from env.php?


texts: M2.3 : Trying to access array offset on value of type bool running on PHP 7.4

texts:
While opening the admin page, getting below exception running on Magento 2.3.5-p2.
1 exception(s):
Exception #0 (Exception): Notice: Trying to access array offset on value of type bool in /var/www/html/mage235/vendor/magento/module-logging/Model/Processor.php on line 221

Exception #0 (Exception): Notice: Trying to access array offset on value of type bool in /var/www/html/mage235/vendor/magento/module-logging/Model/Processor.php on line 221
<pre>#1 Magento\Logging\Model\Processor->initAction() called at [vendor/magento/module-logging/App/Action/Plugin/Log.php:66]
#2 Magento\Logging\App\Action\Plugin\Log->beforeDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:121]

Refereed this one but its custom code so it un-related.


texts:
I am about to create an admin grid, which shows the report like
>

  take every single order from the beginning of the site
  for every month we want to know how many total orders that were in
  the following values:

and I assume the report like


texts:
I need to display two currencies simultaneously, but only for appearance, not function.

It should look like this 100euro/80USD or similar. I would like them to show side by side.


texts:
I tried,

Test\Cart\view\frontend\web\template\default.

                    <input data-bind="attr: {
                           id: 'cart-item-'+item_id+'-qty',
                           'data-cart-item': item_id,
                           'data-item-qty': qty,
                           'data-cart-item-id': product_sku
                           }, value: qty"
                           type="number"
                           size="4"
                           class="item-qty cart-item-qty"
                           maxlength="12"/>


texts: Making Magento Admin Changes 'Future-proof'

texts:
Hi I am wanting to make some layout changes to the Magento admin panel including removing the Sales modules from the dashboard, example: http://puu.sh/kpUkL/3398735630.png

I would also like to make some internal changes to the way that users add products to the admin. For example I will be adding an automatic product specification system that will fill in some fields depending on the SKU that is entered.

I am confident on making these changes however I do question what might happen if I where to upgrade Magento in the future? Would I have to go back and make these changes all over again or can you code these changes for future updates?

Thanks


texts: MySQL Query of catalog_product_super_link filtered by attribute_set_id

texts:
I want to export all fields from the catalog_product_super_link table, but filtered to exclude any products that have have a certain attribute_set (31 in this case).
This post (MySQL Query filtered by attribute_set_id) gets me part of the way there, but unfortunately I'm a novice with MySQL and could do with any help you can provide!


texts: Price format count in upto 4 decimal points but display 2 decimal points in frontend

texts:
I want to display price in two decimal points.

If I enter 38.3445 in special price than I want output in frontend as 38.35 or 38.00 . But Magento display as 38.34 . Magento counts upto 3 decimal points. But I want to make it count upto 4.

Same as I enter 38.4945 than I want output as 38.50 or 39.00 But magento display as 38.49.

I make following changes in 4 files to set 4 decimal points:-

1 File : m229/vendor/magento/zendframework1/library/Zend/Currency.php:
Line no 74 set this  : 'precision' => 4,

2 file : m229/vendor/magento/framework/Pricing/PriceCurrencyInterface.php  : line no 19 : const DEFAULT_PRECISION = 4;

3 file : m229/vendor/magento/module-directory/Model/Currency.php : line no 280 : return $this->formatPrecision($price, 4, $options, $includeContainer, $addBrackets);

4 file : m229/vendor/magento/module-sales/Model/Order.php : line no 1711 : replace this function :

public function formatPrice($price, $addBrackets = false)
    {
        return $this->formatPricePrecision($price, 4, $addBrackets);
    }

Does anyone know how to do it? Thank you in advance...


texts: Magento2 - Success page redirecting to cart after checkout

texts:
I'm having an issue where an Order is placed, it is created but the user is redirected to the cart page, with an empty cart and an error message saying "There was a error when showing the success page.".
I'm not getting any errors in var/log, also not in my php or nginx/error log. I'm using onepagecheckout with Klarna (KCO) and Magento 2.3.5.
I've noticed that if I comment out

$session->clearQuote();

on Success.php
The success page renders properly.
Why is the

$session->clearQuote();

used in Success.php,
Can I just extend Success.php and remove the

$session->clearQuote();

? Or will that break something else?


texts: Magento 2.1 : customer login not working

texts:
I have installed magento 2.1 but when i try to login from front end it redirecting to the same page with this url
customer/account/login/referer/aHR0cDovL2xvY2FsaG9zdC9tYWdlbnRvMjEzYi9jdXN0b21lci9hY2NvdW50L2luZGV4Lw,,/

i have updated robots.txt with Disallow: /customer/account/login/referer/.


texts: Possible to have two different checkout processes (and payment processors)?

texts:
I've been tasked with creating a checkout process for a country other than the one we normally do business in.  This other country has a completely different process for CC payments, so I'm going to have to build a completely custom checkout process for the country.

Is it possible to have a unique checkout process per Magento website? Or do I need to create a whole new Magento installation and make the other country's site there?

I've looked around and couldn't find anything concrete. This Magento answer doesn't apply since what I'm asking is different than the linked question.  I've also thought that I could make the other country's checkout in a new module, and have that module enabled or disabled on a per-website basis, but the only place I've seen someone try it was here and the comments mention that turning on caching breaks this hack.

Any insights would be appreciated.  Thanks!


texts:
I have this display

in my module. I have the title but not the content.
My php is :

in app/code/Gelorna/Intelligentimporter/Controller/Adminhtml/Concurrents/Index.php (it works because a can play with the title external catalogs):

namespace Gelorna\Intelligentimporter\Controller\Adminhtml\Concurrents;

class Index extends \Magento\Backend\App\Action
{
    protected $ADMIN_RESOURCE = 'Gelorna_Intelligentimporter::concurrents';

    protected $resultPageFactory;

    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    //présentation de la iframe
    public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->setActiveMenu($this->ADMIN_RESOURCE);
        $resultPage->getConfig()->getTitle()->prepend(__('External catalogs'));

        return $resultPage;
    }

in app/code/Gelorna/Intelligentimporter/view/adminhtml/layout/intelligentimporter_concurrents_index.xml :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="content">
            <block class="Gelorna\Intelligentimporter\Block\Concurrents" name="intelligentimporter_concurrents" template="Gelorna_Intelligentimporter::concurrents.phtml">
                <arguments>
                    <argument name="block_id" xsi:type="string">example</argument>
                </arguments>
            </block>

        </referenceContainer>

</page>

in app/code/Gelorna/Intelligentimporter/view/adminhtml/templates/concurrents.phtml:

aaa

As you can see the text "aaa" is not displayed and I do not understand why.
Can you help me ?

app/code/Gelorna/Intelligentimporter/Block/Concurrents.php :

<?php

namespace Gelorna\Intelligentimporter\Block;

class Concurrents extends \Magento\Framework\View\Element\Template
{
    public function __construct(\Magento\Framework\View\Element\Template\Context $context)
    {
        parent::__construct($context);
    }

    public function getTitle()
    {
        return __('Manage external catalogs');
    }

    public function _toHtml()
    {
        return 'Today\'s date is ' . date('Y-m-d');
    }
}


texts: Magneto 2 Unable add category to cart price rule by clicking on checkbox

texts:
Steps to reproduce (*)

Marketing > Cart Price Rules > Add New Rule
Click on Action section.
Add conditions to Actions: choose "category", click on the ellipsis, see the input field, click "Open chooser", see the category tree
Try to add category by clicking checkbox

Expected result (*)

Category ID will appear in the input

Actual result (*)
Uncaught TypeError: Cannot read property 'updateElement' of undefined
at Ext.tree.TreePanel.Enhanced.<anonymous> (category-checkbox-tree.js:249)
at Ext.util.Event.fire (ext-tree.js:29)
at Ext.tree.TreePanel.Enhanced.fireEvent (ext-tree.js:29)
at Ext.tree.CheckboxNodeUI.check (ext-tree-checkbox.js:193)
at ext-tree.js:9
at Ext.tree.TreeNode.expand (ext-tree.js:201)
at Ext.tree.CheckboxNodeUI.check (ext-tree-checkbox.js:162)
at El.Flyweight.<anonymous> (ext-tree.js:9)
at HTMLInputElement.h (ext-tree.js:33)
at HTMLInputElement.M (legacy-build.min.js:8)


texts: Magento 1.9.2 Add layer navigation to advance search

texts:
I have followed following 3 steps for advanced search layer navigation, but it is not working. Any idea/suggestion OR How to implement layer navigation in advanced search?

1) In our local.xml under catalogsearch_advanced_result tag add.

<reference name="left">
      <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
 </reference>

2) Override prepareProductCollection function of catalogsearch/model/Layer.php with

public function prepareProductCollection($collection){

    if(Mage::helper('catalogsearch')->getQuery()->getQueryText())//for normal search we get the value from query string q=searchtext
        return parent::prepareProductCollection($collection);
    else{

        $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes());
        /**
         * make sure you cross check the $_REQUEST with $attributes
         */
        $attributes = Mage::getSingleton('catalog/product')->getAttributes();

        Mage::log(print_r($_REQUEST,1));
        foreach($attributes as $attribute){
            $attribute_code = $attribute->getAttributeCode();
            //Mage::log("--->>". $attribute_code);
            if($attribute_code == "price")//since i am not using price attribute
                continue;

            if (empty($_REQUEST[$attribute_code])){
                //Mage::log("nothing found--> $attribute_code");
                continue;
            }
            if(!empty($_REQUEST[$attribute_code]) && is_array($_REQUEST[$attribute_code]))
                $collection->addAttributeToFilter($attribute_code, array('in' => $_REQUEST[$attribute_code]));
            else
            if(!empty($_REQUEST[$attribute_code]))
                $collection->addAttributeToFilter($attribute_code, array('like' => "%" . $_REQUEST[$attribute_code] . "%"));
        }

        $collection->setStore(Mage::app()->getStore())
        ->addMinimalPrice()
        ->addFinalPrice()
        ->addTaxPercents()
        ->addStoreFilter()
        ->addUrlRewrite();

        //Mage::log($collection->getSelect()->__toString());

        Mage::getSingleton('catalogsearch/advanced')->prepareProductCollection($collection);
        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
    }

    return $this;
}

3) Override getProductCollection, getSearchCriterias function of catalogsearch/model/Advanced.php with

public function getProductCollection(){

    if (is_null($this->_productCollection)) {
        $this->_productCollection = Mage::getResourceModel('catalogsearch/advanced_collection')
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addMinimalPrice()
            ->addStoreFilter();
            Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($this->_productCollection);
            Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($this->_productCollection);

        if(isset($_GET['cat']) && is_numeric($_GET['cat']))
            $this->_productCollection->addCategoryFilter(Mage::getModel('catalog/category')->load($_GET['cat']),true);
    }
    return $this->_productCollection;
}

public function getSearchCriterias()
{
    $search = parent::getSearchCriterias();
    /* display category filtering criteria */
    if(isset($_GET['cat']) && is_numeric($_GET['cat'])) {
        $category = Mage::getModel('catalog/category')->load($_GET['cat']);
        $search[] = array('name'=>'Category','value'=>$category->getName());
    }
    return $search;
}


texts: how to add quantity increment and decreament (+ and - button) in cart summary magento 2?

texts: I want to add increment decrement  functionality in the checkout page how to achieve this


texts: Is there a list of command line tools to enter for changing modes? I went from developer mode to production and back again and now my css is all 404s.It doesn't feel like it should be this hard.


texts: Magento 2 : Failed to Update Magento_CatalogUrlRewrite Schema when Upgrade

texts:
I am trying to upgrade m2epro extension with php bin/magento setup:upgrade, exception occur when command is executed.

I found, exception seems not from m2epro extension because when I disable m2epro, exception is still there.
Does anyone has ideas how to fix it ?

Actually our current catalog_url_rewrite_product_category does not have that problem fk.


texts: Get custom catalog attribute in custom page

texts:
Hi in my custom page template i need display attribute catalog, I programmatically create attribute:

<?php require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute_second    = array(
    'group'         => 'Brands',
    'input'         => 'textarea',
    'type'          => 'varchar',
    'label'         => 'Brands',
    'backend'       => '',
    'visible'       => true,
    'required'      => false,
    'visible_on_front' => true,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
);

$installer->addAttribute('catalog_category', 'brand_text_value', $attribute_second);
$installer->endSetup();?>

and then in catalog added tab Brands with textarea field, now need get value in custom page template, can you help, how i can get value in custom page.

Thanks


texts: How do you verify that the "CRON JOB" is functioning correctly for a site?

texts:
We are using Magento 1.9.0 and catalog prices rules are disappearing on products list page sometimes.

I suspect that the cronjob is not working on the site.

This is cron.php in root of the site : cron.php = http://pastebin.com/DP3uG3q0

What do I have to do to verify that the "cron job" is working correctly?