texts: Magento2: How to call custom block in phtml file

texts:
I have created a custom block page. I want to call custom block to another phtml file.

When I called custom block in xml file is working.

But when I called custom block in phtml file is not working.

<?php echo $block->getLayout()
    ->createBlock('Codism\Csr\Block\Index\TopMenu')
    ->setBlockId('Codism_Csr::menu.phtml')
    ->toHtml();
?>


texts:
my phtml file does not display after applying action method="setTemplate"

<?xml version="1.0"?>
  <layout version="0.1.0">
    <default>
      <reference name="content">
        <action method="setTemplate">
           <template>sidesupport/sidesupport.phtml</template>
        </action>
      </reference>
    </default>
  </layout>


texts: in magento 2.4.1 and 2.4.2 customer custom image type attribute not save in frontend

texts: I create Custom Image type Customer Attribute for save image but while create customer from backend save attribute but i will not work in frontend, image attribute not save from frontside so please help for how to solve it


texts: Magento 2.1: How to reference/replace template of an existing child block/alias?

texts:
I am trying to change de default product stock availability text to my own by using a custom phtml file. I want to overwrite "module-catalog/view/frontend/templates/product/view/type/default.phtml" therefore I created a custom module with catalog_product_view.xml with the following contents:

<?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="product.info.type">
        <block class="Magento\Catalog\Block\Product\View\Type\Simple" name="product.info.description" as="product_type_data" template="Sixways_Estdelivery::displayStockStatus.phtml">
        <argument name="cacheable" xsi:type="boolean">false</argument>
        </block>
    </referenceContainer>
</body>

This works great but the exception.log file is filling up with this error:

  main.CRITICAL: Magento\Framework\Exception\LocalizedException: The
  element 'product.info.type' already has a child with alias
  'product_type_data' in
  /staging/vendor/magento/framework/Data/Structure.php:611

I tried leaving product_type_data away but that makes the original and the custom phtml appear instead of only the custom one.

What is the correct way of overwriting name="product.info.simple" as="product_type_data" in referenceContainer name="product.info.type"?


texts:
I have configured 2 sites.
Have attribute named 'label'.

How to remove it on second site and leave it on default (first) site?


texts: tax_class_name in product import won't change to none

texts:
I tried to import product by CSV file from backend. I fill the tax_class_name column to 0 but it won't make the product tax to None but Taxable Goods. And when i check at the database in tax_class, there's only Taxable Goods and Retail Customer.

So, how can i made uploaded product to none tax class?


texts:
I have this code

$collection = Mage::getModel("news/views");
->addFieldToSelect('post_id', array('eq' =>  $this->getRequest()->getParam("id")));

And when i'm trying to save my post i get en error:

  Invalid method Iv_News_Model_Views::addFieldToSelect(Array ( [0] =>
  post_id [1] => Array ( [eq] => 13 ) ) )


texts: How to Ignore Catalog Pricing Rule when applying Shopping Cart Price Rule?

texts:
I have an ongoing 50% Off Catalog Pricing Rule currently active across my store. A few days back I have also distributed coupon codes on a Radio show with 25% Off. Now i have a situation where customers with these codes are applying the code and receiving a double discount. My $10 product is selling for $3.75 (50% + 25%).

I want a functionality where when the customer applies the coupon code, the code does apply but ONLY on the original price of $10. Thereby selling the product at $7.5. It should overlook the catalog rule. So the customer can choose to either go with the Catalog discount or Coupon discount but not both. Is this possible?


texts: Quantity as filter like price in layered navigation in magento2

texts:
I want to display quantity like 0-10(2) 10-20(5) 20-30(3) in layered navigation.

0-10(2)
10-20(5)
20-30(3)

But currently in Magento 2 Quantity is showing like Quantity In stock(50).

How can I achieve this with override file?
Is anyone knows how to do this?
Thanks


texts:
Is there a way to get all pages with certain layout?

What I want to achieve is to print all pages that have layout named "page with left sidebar" for example.

I'm new in Magento (in php also :D) so any help would be greatly appreciated.


texts: How can I get Customer Group Id on Orders View Page?

texts:
I am unable to get the correct Customer Group ID from the Order View page. This is part of a helper, which calls

Mage::getSingleton('adminhtml/sales_order_create')->getQuote()->getCustomerGroupId();

and it works fine if it is during the "Create Order" process, but I can't determine how to load the Customer Group on the Order View page after order creation.

What can I load to get the customer's group id from the order after the order is already created?


texts: Magento promotions setup: How to give a free product with an online order?

texts:
How to set up the Magento promotion to be able to give away a free product that is different than the one purchased. in other words, the promotion is not type BOGO FREE. It's the following:
Purchase a product A with 20% off and receive bonus: free deluxe sample of product D.

Thanks.


texts: Orders where credit card payments fail are not showing up in orders list

texts:
My question is, if a credit card payment fails with Authorize.net (for instance)... does it not show in the dashboard under Sales > Orders because it failed? In other words, does the orders section only show orders that were authorized and/or captured successfully?

With my old cart, the orders list would show all orders including orders that failed. I could then access the order in the dashboard and see why it failed (address bad, zip bad, etc).

I noticed today that my admin only shows orders that are good.
I would like to see failed attempts, to possibly safe sales.

Unless Magento puts these details somewhere else?


texts: Magento site showing white page before load content

texts:
I have magento version 1.9.2.1, When I load any page(cms, search, product page) in frontend then it display blank white page for 5-10 seconds after that it start loading content.

I checked in network section (in browser developer mode), TTFB showing there 5-10 seconds for all page (even a simple cms page which has only static content).

I have also installed Lesti-FPC plugin and all cache are enabled from admin section. And Compilation mode also enabled.

I have two question :

First : How to improve TTFB.

Seconds : How to start to load content, so that no white page display to customer while loading content.


texts:
I have a link about Acana. Link is listing all Acana branded products. Here it is; https://www.solempet.com/acana

I want to change it to acana.solempet.com for seo reasons.

How can i do this? I couldn't find any guides for it.


texts: Module uninstallation does not remove configuration

texts:
I have my own module installed via composer and I can uninstall it with

php bin/magento module:uninstall XXX_XXX

But when I reinstall the module the configuration (values in system.xml) is still the same as it was setup while it was installed before. Do I have to remove the configurations manually? How?

EDIT:
My current Uninstall class:

<?php

namespace XXXX\XXXXX\Setup;

use Magento\Framework\Setup\UninstallInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;

    class Uninstall implements UninstallInterface
    {
        public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context) {
            $setup->startSetup();

            $connection = $setup->getConnection();
            $connection->dropTable($connection->getTableName('mytable_data'));

            $setup->endSetup();
        }
    }


texts: Different Template for Configurable Products

texts:
Totally stuck here. I'm working with a very customized template and the configurable products are just showing up in the bottom of the product page. I would like to change this and other things (remove a couple of attributes that are being shown for Simple products that I Do not want to show up if it is a configurable product and vice versa).

How do I go about to doing this? I tried searching in google and maybe I'm wording it incorrectly but.. no solutions yet. Is the a php code that I can use?

Thank you!


texts: Magento 2 modify table value in admin form by uiComponent

texts:
I have created a custom admin form by UI component that has a field which looks like this:

<field name="column_name">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Field Name</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">source_name</item>
                    <item name="sortOrder" xsi:type="number">80</item>
                    <item name="dataScope" xsi:type="string">column_name</item>
                </item>
            </argument>
        </field>

DB Table contains value like this: some-file-name.pdf

I want this to be shown as an anchor downloadable link in the admin form field like:

FIle Name"


texts:
This is My File Uploader in .phtml file :

<input type="file" id="imageUploader"  name="imageUploader">

This my PHP file code where form post.

<?php
namespace VendorName\ExtensionName\Service;
use Magento\Catalog\Model\Product;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem\Io\File;

class ImportImageService
{
protected $directoryList;
protected $file;

    public function __construct(
        DirectoryList $directoryList,
        File $file
    ) {
        $this->directoryList = $directoryList;
        $this->file = $file;
    }

    public function execute()
    {
    $tmpDir = $this->getMediaDirTmpDir();
        /** create folder if it is not exists */
    $this->file->checkAndCreateFolder($tmpDir);
        /** @var string $newFileName */
    //$imageUrl='file:///home/chakko/Downloads/mywatch.jpg';
    $imageUrl=$_FILES['imageUploader']['name'];

    $newFileName = $tmpDir . baseName($imageUrl);
        /** read file from URL and copy it to the new destination */
    $result = $this->file->read($imageUrl, $newFileName);
    if ($result) {
            /** add saved file to the $product gallery */
            $product->addImageToMediaGallery($newFileName, $imageType, true, $visible);
     }
       return $result;
    }
    /**
     * Media directory name for the temporary file storage
     * pub/media/tmp
     *
     * @return string
     */
    protected function getMediaDirTmpDir()
    {
        return $this->directoryList->getPath(DirectoryList::MEDIA) . DIRECTORY_SEPARATOR . 'tmp';
    }
}

The Problem is when I give manually path of the image like         $imageUrl='file:///home/chakko/Downloads/mywatch.jpg';
 is work good.

But when use fileuploader like this         $imageUrl=$_FILES['imageUploader']['name'];
it will not read the file .

Can any will help me i will be appriciate him

Ref:  https://www.atwix.com/magento-2/import-product-image-from-url/


texts: how to solve order creating before payment method success in magento 2

texts:
hi i am using ccacvenue payment gateway and pay money for my site.

when customer selected the any payment method (any method online payment) and place order before the payment successfully completed
it will create order (admin) and email in Magento 2.

my questions

1)how i can get order in admin panel after payment successfully completed.
2)and only get order email for customer after he completed (payment via online).


texts: Show Number of Color Options in Product Category Listings

texts:
On the category listing pages, I need to show the number of color options for each product in the list. How can I output that count?

I am using configurable products with the color options as simple products. The attribute ID of "color" is 80. The code would go inside this loop:
<?php foreach ($_productCollection as $_product): ?>


texts: Getting 404 - Page Not Found after upgrading to 1.9.3.7

texts:
I have to upgrade Magento from 1.9.3.3 to 1.9.3.7 and in that case I cloned the live system to an sub-domain of the live Domain. I always fixed the multi conflict with issue and getting upgraded I thought, but I dont know if it realy worked. Because when I hit the refresh Button after upgraden via Magento connect Manager I got an blank page and when I try to went back to the backend I got an 404 Error and also at the frontend. Every Site is gone into the Magento 404 Page.

I spend hours of time to fix it and try the solves of this threads:

http://www.codesolutions.de/magento-404-error-auf-unterseiten-z-b-nach-serverumzug-loesung/
404 page not found issue on all pages after upgrading Magento ver. 1.7.0.2 to 1.9.2

But nothing works for me.

Do anybody knows a fix that I dont try until yet?


texts: Magento 2 REST API: Empty cart or delete multiple items from the cart

texts:
I am working on a headless magento solution, but I am facing a bit of a problem.
As the official magento 2 docs suggest, cart items can be deleted using these:

DELETE  /V1/guest-carts/:cartId/items/:itemId ->  For Guest Users
DELETE /V1/carts/mine/items/:itemId  -> For Signed-in users

Is there a way to delete multiple items without using the same API multiple times, or more conveniently empty the cart?


texts: Difference between static content deploy & grunt exec

texts:
What's the difference between following commands (Magento 2)

bin/magento setup:static-content:deploy and grunt exec

When should you use which command?


texts: Magento2 : Call custom Js before body closing tag on every page

texts:
I have used the below code to call example js file which is located in Magento_Theme folder of the theme.

<referenceContainer name="before.body.end">
    <block class="Magento\Framework\View\Element\Text" name="exampleScript">
        <arguments>
            <argument name="text" xsi:type="string"><![CDATA[<script type="text/javascript" src="Magento_Theme::js/example.js"></script>]]></argument>
        </arguments>
    </block>
</referenceContainer>

But this gives 404-Error as it goes to find from URL from where

  /pub/static/version1564550212/frontend/Themevendor/Themename/nl_NL/Magento_Theme/js

path is missing.


texts: Is it possible to filter products in the admin catalog by Category in Magento 2?

texts:
Is it possible to filter products by category in Magento 2 under Catalog?

So when I go in the admin to catalog, can I filter the product list according to the category / categories the products are assigned to?


texts: Display header and footer in controller method

texts:
In my controller method I am printing one simple message.
public function indexAction()
    {
        echo "Hello,, Welcome to IndexController...";
    }

But, that message is displaying on a blank page. I want to add header and footer to that page and my message should be displayed in between.

Can anyone help me? Which steps should I follow to achieve this?

Following is the code I have added in local.xml:
<emq_mymodule1_index_index> <!-- frontendname_controllername_actionname -->
        <reference name="content">
            <block type="core/template" name="abc" template="abcd/demo.phtml" />
        </reference>
</emq_mymodule1_index_index>


texts: Magento 2 error - Product with Sku: prodotto not found in the catalog. - and the product exists

texts:
I have only one product in the catalog with sku "prodotto". The product is in the default category, it is also visible on frontend (I can see it and browse to it on frontend), it is in stock, it has positive quantity. It is set to be visible and set to display in Catalog, Search, and it is enabled. I can see it in the table catalog_product_entity. However, when I try to check for this product by its sku ("prodotto"), I am getting the message:

Product with Sku: prodotto not found in the catalog.

This is my code:

$connection = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER) -> getObjectManager() -> get("\Magento\Framework\App\ResourceConnection") -> getConnection();

$sql = "SELECT COUNT(*) AS count_no FROM " . _getTableName('catalog_product_entity') . " WHERE sku = ?";

try {
    $count = $connection -> fetchAll($sql, array('prodotto'));
} catch (PDOException $pdoe) {
    echo $pdoe;
} catch (Exception $e) {
    echo $e;
}

Why is this hapenning?


texts: How to get Magento 2 events in the order of execution for debugging?

texts:
By the way, I hope you won't judge the roughness of this answer, just something quick I wanted to get out there :)

How would I be able to log all events magento dispatches in the order of execution?


texts: Creating a new entity that can log into Magento (authenticate with a password and create a session)

texts:
I want to add another party to the site, that can log in and do some stuff but I want it to be a separate entity (not a customer) because I don't want it to be able to make purchases and such. It would get its own "My Account" and "Dashboard" pages inside Magento, and can be managed from the backend as well.

I want this person to be able to sign in to the site and be redirected to its own account system. What is the correct approach here? Can I use Magento sessions and authentication and encryption to add this functionality or will I have to extend Customer? I would like to avoid the latter, because there's a bunch of stuff a customer has that I don't need and blocking them would be (I think) less practical than creating something new from scratch.

It occurs to me that I could also extend users in the admin panel? But I don't want to give them access to the backend, even if the role permissions are heavily restricted.


texts: Blank Magento 2 Zend_Db_Adapter_Pdo_Mysql fatal error

texts:
I'm getting the following error on a new blank Magento 2 installation:

a:4:{i:0;s:48:"SQLSTATE[HY000] [2002] No such file or directory";i:1;s:7106:"#0 /home/signboxc/public_html_devshop/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/signboxc/public_html_devshop/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(340): Zend_Db_Adapter_Pdo_Mysql->_connect()

I'm running PHP 5.6 compiled with the PDO extension and the MySQL credentials in app/etc/env.php are definitely correct.

I can link the full error from the reports if necessary.

I also can't seem to find additional suggestions as to why this might be happening at the moment. Any insight is appreciated. Thanks.


texts: lock product qty increase while adding to cart

texts:
I found a problem using a custom "gift" extension for magento.
It let the user choose a gift product in the checkout cart page. So the user will find under the cart a product grid and can select max 1 product to get as gift and then add it to cart.

My problem is that after the user add product he's still able to edit the qty. So he can order 10 items of product as gift.

I need to force user to don't edit the product quantity for the "gift" products in cart.

The products listed as "Gifts" can be also purchased as regular products so that rule has to be applied on the "Gift" situation.

Actually the function "add cart" of the extension is this one:

public function addAction()
{
    if ($this->getRequest()->isGet()) {
        $gift_id = $this->getRequest()->getParam('gift', 0);
        if($gift_id){
            if(!Mage::helper('gifts')->isGiftUsed() && in_array($gift_id, Mage::helper('gifts')->getGiftsIds())){
                $quote = Mage::getSingleton('checkout/session')->getQuote();
                $cart = Mage::getModel('checkout/cart');
                $product = new Mage_Catalog_Model_Product();
                $product->load($gift_id);

                $cart->addProduct($product, 1);
                $cart->save();

                foreach ($quote->getAllItems() as $item) {

                    if ($item->getProductId() == $gift_id) {
                        $item->setCustomPrice(0);
                        $item->setOriginalCustomPrice(0);
                        //$item->setOption('inventory_max_sale_qty',1);
                    }
                }

                $cart->init();
                $cart->save();

                Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
            }
        }
    }
    $this->_redirect('checkout/cart');
}

thank you


texts: Magento 2 - Page title prefix and suffix not rendering

texts:
I am using Magento version 2.1.4

I added page title prefix and suffix (both just for test) in Admin Panel -> Content -> Configuration -> HTML Head input fields but none of them are actually renderen in pages. I di:compiles, deployed static files after changes, cleared the cache, reindexed, refreshed, everything but still no success.

I am writing my own theme but I have not overwritten title nor in layout xml files, nor phtml files.

The only head title that is showing in pages is the page/category/product title and that is all. No prefix, no suffix.

Is this a Magento version bug or I just have forgotten to enable/change something?

Update:
I updated Magento to 2.1.5 version but the problem did not solve.


texts: How to retrieve product add to cart url in phtml file

texts:
I'm looking to add 5 products add to cart buttons to a CMS page in Magento 2, the code example I found online is:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$listBlock = $objectManager->get('\Magento\Catalog\Block\Product\ListProduct');
$addToCartUrl =  $listBlock->getAddToCartUrl($product);

Where $product is an ID passed to the phtml file from my CMS page, however the above code seems to just gives a white screen and I don't get anything logged in my system or exception files that indicates what's happening.

How would I retrieve the product's add to cart URL in a phtml file from the product ID?


texts: Magento 2: I can't display the value of a custom product attribute in product page

texts:
I want to show two product custom attributes in product view page side by side the price with the same format (font size).
The attributes are PP and PR witch I created in Magento Admin and assign to the product.

Next I tried to put the code in list.phtml to display the attributes:

I used
<?php echo 'PP ' . $_product->getData('pp') . ' PR ' . $_product->getData('pr'); ?>

But unfortunately I just can't retrieved the value of the attributes and it shows blank.

Could someone help me on this issue?


texts: Travis-CI and Magento 2 setup:di:compile

texts:
I've tried setting up Travis CI on a new empty Magento 2 Github repo (https://github.com/Tjitse-E/TravisTest).

Part of my Travis configuration file:

install:
   - echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json
   - composer install --no-interaction --prefer-dist
   - mysql -e 'DROP DATABASE IF EXISTS magentotravis'
   - mysql -e 'CREATE DATABASE IF NOT EXISTS magentotravis;'
   - php bin/magento setup:install --base-url=http://magebuild.integrations.p1-test.de/build/
     --db-host=localhost --db-name=test --db-user=root --admin-firstname=test
     --admin-lastname=Demo --admin-email=test@test--admin-user=test
     --admin-password=72q980hdfq2378ga9w87dg6 --language=de_DE --currency=EUR --timezone=Europe/Berlin
   - php bin/magento setup:upgrade
   - php bin/magento setup:di:compile
   - php bin/magento cache:clean
   - php bin/magento index:reindex

I've intentionally installed a module that triggers an error/warning with the command php bin/magento setup:di:compile. I want Travis CI to recognize the error and then stop the build. Would this be possible?

Travis output:

41.78s$ php bin/magento setup:di:compile
Compilation was started.
%message% 0/7 [>---------------------------]   0% 1 sec 46.0 MiB%message% 0/7 [>---------------------------]   0% 1 sec 46.0 MiBProxies code generation... 0/7 [>---------------------------]   0% 1 sec 46.0 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% 1 sec 52.0 MiB
Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 52.0 MiB
Repositories code generation... 2/7 [========>-------------------]  28% 5 secs 154.0 MiB
Service data attributes generation... 2/7 [========>-------------------]  28% 5 secs 154.0 MiB
Service data attributes generation... 3/7 [============>---------------]  42% 5 secs 154.0 MiB
Application code generator... 3/7 [============>---------------]  42% 5 secs 154.0 MiB
Application code generator... 4/7 [================>-----------]  57% 13 secs 174.0 MiB
Interceptors generation... 4/7 [================>-----------]  57% 13 secs 174.0 MiB
Interceptors generation... 5/7 [====================>-------]  71% 23 secs 192.0 MiB
Area configuration aggregation... 5/7 [====================>-------]  71% 23 secs 192.0 MiB
Area configuration aggregation... 6/7 [========================>---]  85% 33 secs 268.0 MiB
Interception cache generation... 6/7 [========================>---]  85% 33 secs 268.0 MiBErrors during compilation:
    Travis\Block\TestClass\TestClass
        Incorrect dependency in class Travis\Block\TestClass\TestClass in /home/travis/build/Tjitse-E/TravisTest/app/code/Travis/Sample/Block/TestClass.php
\Magento\Framework\App\Config\ScopeConfigInterface already exists in context object
Total Errors Count: 1
Errors during compilation:
    Travis\Block\TestClass\TestClass
        Incorrect dependency in class Travis\Block\TestClass\TestClass in /home/travis/build/Tjitse-E/TravisTest/app/code/Travis/Sample/Block/TestClass.php
\Magento\Framework\App\Config\ScopeConfigInterface already exists in context object
Total Errors Count: 1
Errors during compilation:
    Travis\Block\TestClass\TestClass
        Incorrect dependency in class Travis\Block\TestClass\TestClass in /home/travis/build/Tjitse-E/TravisTest/app/code/Travis/Sample/Block/TestClass.php
\Magento\Framework\App\Config\ScopeConfigInterface already exists in context object
Total Errors Count: 1
Interception cache generation... 7/7 [============================] 100% 40 secs 268.0 MiB
Generated code and dependency injection configuration successfully.

The purpose is to automatically test the DI of upgraded third party modules, because they sometimes contain errors in the constructor.


texts: How to remove or edit "Grand Total to be Charged" in order email in magento 2

texts:
As I mentioned in the headline I need to alter the Grand Total to be Charged section in the order email. My store is running in LKR as Base currency and AUD as another currency.
If I place an order in AUD, I am getting the order email like below. Which is showing the  Grand Total to be Charged in LKR.

I used an override the Magento\Sales\Block\Order\Totals.php like below.
My di.xml file is like this.
<?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\Sales\Block\Order\Totals" type="Ayakil\AudDevelopment\Rewrite\Magento\Sales\Block\Order\Totals"/>
</config>

My Totals.php in the ( Ayakil\AudDevelopment\Rewrite\Magento\Sales\Block\Order ) is like below.
protected function _initTotals()
{
if ($this->getOrder()->isCurrencyDifferent()) {
        $this->_totals['base_grandtotal'] = new \Magento\Framework\DataObject(
            [
                'code' => 'base_grandtotal',
                'value' => $source->getGrandTotal(),
                'label' => __('My custom text'), // changed
                'is_formated' => true,
            ]
        );
    }
}

And tried to remove the base_grandtotal too like this. I am getting the email like below after this modification.

$this->removeTotal('base_grandtotal');


texts:
In magento 2.3.5-p2 cloud version i am facing an issue. If I trigger my custom email once then the email is going twice.
$transport = $this->transportBuilder->setTemplateIdentifier('admin_notify')
                ->setTemplateOptions(['area' => 'frontend', 'store' => $store])
                ->setTemplateVars(
                    [
                        'title' => $title,
                        'typeId' => $typeId,
                        'type' => $type,
                        'messageSeverity' => $messageSeverity,
                        'failedCount' => $failedCount,
                        'failedReason' => $failedReason,
                        'description' => $description,
                        'messageId' => $messageId
                    ]
                )
                ->setFromByScope('general',$store)
                ->addTo($emails)
                ->getTransport();

This is my code can I know why my custom email is going twice.


texts: Payment method wont show me form in backoffice order

texts:
I've installed a new payment method from nps in magento 1.9.3.6 .
The problem is that I need to use it for backend orders. But when i select it, it doesn't show the payment form.
Here's an image.

I don't know if there's any display that is set to false or something similar in the code.
PD: In the frontend of the page NPS works ok.
This is the link of the module: NPS MAGENTO


texts: Magento2: captcha not showing on contact page

texts:
After enabling captcha for the contact form the captcha is not shown on the form. If submitted an "Incorrect CAPTCHA" error is displayed. Tried in production and development modes. No Javascript errors in the console.

Preconditions

Magento 2.1.6

PHP 7.0.12

MYSQLl 15.1 10.0.27-MariaDB

Varnish 4.1.3

Redis 3.2.3

Steps to reproduce

Select stores->Configuration->Customers->Customer Configuration->Captch->Forms->Contact us and save

captcha

Refresh caches

Clear varnish cache


texts: Configurable Product create/update "No data to save" with too many options

texts: I have a strange issue with Magento 2.0.7 - 2.1.0 versions in my vps. When I try to create multiple options (more than 30 variations of color and sizes), it gives me "No data to save" error while trying to save the product. If I create a product with only around 10 child products for a configurable product, it does not give me any error. Attached are the error screenshot and my server's php.ini settings. This vps has 8gb of ram and enough ssd space. Please hint me something I am missing. I tried to increase several php configuration settings max_input_vars, opcache.max_accelerated_files etc. Nothing helped. It seems something related to session. But not sure what it is.


texts: Installing Magento2 Data-Migration-Tool manual without composer

texts:
How can I install the magento2 data-migration-tool manual without composer?

Already I copied the complete "data-migration-tool"-folder in vendor/magento. When I try to use migrate commands (ex. "migrate:settings"...) in magento root folder, I get the error:

[InvalidArgumentException]
There are no commands defined in the "migrate" namespace.

I forgot something?

For the question why I want to install without composer.
See here: Installing Data-Migration-Tool with Composer: git not found error


texts: Fetch website specific category URL based on store id in custom module

texts:
I am working on fetching category URL for stores which are part of two different websites on a multiwebsite setup i.e abc.com and abc.co.uk, Issue happens when I fetch URL for abc.co.uk it returns me the URL of abc.com only. I have tried fetching with below solutions but none of them has worked:

1) Here in collection factory class I used is as below and latter is the code

  \Magento\Catalog\Model\Category

$collection = $this->_categoryCollectionFactory->getCollection()->setStoreId($storeId)->addAttributeToSelect('*')->addIsActiveFilter();

2) I looped through all the categories and tried fetching it from repository

$this->categoryRepository->get($category->getEntityId(), $storeId);

3) Another solution tried with looping the categories fetched based on store id, looping it and generating URL as below, Although below URL provides me with a solution for correct website URL but still the category URL path is incorrect.

$this->storeManager->getStore($storeId)->getBaseUrl().$category->getUrlPath().$category->getUrlKey().$categoryUrlSuffix;

Any help or guidance on this would be much appreciated.


texts: Magento Product url from id in an extension

texts:
my problem is, that i want to get a productUrl from productid (seems simple) BUT i need that productUrl in a file which is called by an ajax post.
Ill show u some files to get an overview.

My test.phtml file which contains the link u can click and the ajaxpost which is calling my php file.

<?php
     $product_id = Mage::registry('current_product')->getId();
     $product = Mage::getModel('catalog/product')->load($product_id);
?>

<?php if(Mage::helper('core')->isModuleOutputEnabled('XXXXX_Productpdf')): ?>
<?php $displayFrontend = Mage::getStoreConfig('datasheet/general/dropdown'); ?>
<?php if($displayFrontend == 1): ?>

     <?php echo $product->getName();?> Datasheet Generating Datasheet
    <input id="datasheetProductId" type="hidden" value="<?php echo $product_id?>">

<?php endif ?>
<?php endif ?>

So as u can see this phtml contians a link which call my createDatasheet.php.
In this file i need to get the product url all i got is the product id.
createDatasheet.php:

<?php
    require_once("../../../../../Mage.php");
    umask(0);
    Mage::app();
    $productid = $_POST["productid"];
    $product = Mage::getModel('catalog/product')->load($productid);
    $productName = $product->getName();
?>

If i echo the $productName there comes the name of my product so this part works so what i need now is:

$productUrl = ?

what i have tried:

    Mage::getUrl().$product->getUrlPath();
    Mage::getUrl().$product->getUrlPath();
    $product->getUrlInStore();
    $product->getProductUrl();
    Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'attribute_code', $storeId);

What it should return

http://magento2.dev/index.php/categoryName/productName.html

What it actually return

http://magento2.dev/createDatasheet.php/productName.html?SID=s8v4n82sotc3tv7dpot8dq6df6

If i call the $product->getProductUrl(); in my test.phtml file i get the url i need.


texts: Magento2 with Nginx and PHP7: cannot access the admin

texts:
We have installed a fresh Magento 2.0.2 with PHP 7.0.4 and Nginx.
The frontend works correctly, and we can create customer accounts.
But, the problem is we cannot access the admin. it gives an error: "The page you are looking for is temporarily unavailable. Please try again later."

And Debug logs show this line:

  [2016-03-15 18:47:46] main.DEBUG: cache_invalidate:
  {"method":"POST","url":"http:://example.com/index.php/admin/admin/index/index/key/a12f6c236de96a369096230294c30b32cfc3fe784788bfc44a3ec44009b0ed06/","invalidateInfo":{"tags":["BACKEND_MAINMENU"],"mode":"matchingAnyTag"},"is_exception":false}
  []

Nginx logs:

  2016/03/15 19:11:12 [error] 6819#0: *5791 recv() failed (104:
  Connection reset by peer) while reading response header from upstream,
  client: 217.125.83.47, server: example.com, request: "POST
  /index.php/admin/admin/index/index/key/9d1adcd6bb29c1491a34613a8b639c78618d0837ebcf36fbfdbabf2b7943b5a5/
  HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host:
  "example.com", referrer:
  "http:://example.com/index.php/admin/admin/index/index/key/9d1adcd6bb29c1491a34613a8b639c78618d0837ebcf36fbfdbabf2b7943b5a5/"

PD: http::// == http://

Our configuration files is:

NGINX:

server {

listen *:80;
root /var/www/example.com/web; #Use you mangeto2 location
index index.php index.html index.htm;
server_name example.com;

location /setup {
       try_files $uri $uri/ @setuphandler;}

# Rewrite Setup’s Internal Requests
   location @setuphandler {
       rewrite /setup /setup/index.php; }

# Rewrite Internal Requests
location / {

        index index.php index.html;

#we have tested the 3 ways:
       try_files $uri $uri/ @handler;
#      try_files $uri $uri/ /index.php?_url=$uri&$args;
#      try_files $uri $uri/ /index.php?$args;
   }

    location @handler {

       rewrite / /index.php;
    }

     location /pub/static {

         try_files $uri $uri/ @static;

    }

     location @static {

          rewrite ^/pub/static/(.*)$ /pub/static.php?resource=$1? last;

    }

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;}

#pass the PHP scripts to f stcgi socket
location ~ \.php$ {
               try_files $uri =404;
               fastcgi_pass 127.0.0.1:9002;
               fastcgi_index index.php;
               fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
               include fastcgi_params;
               fastcgi_read_timeout 900s;
#Magento 2 Developer Mode
#      fastcgi_param MAGE_MODE "developer";
  }
}

PHP7:

[web2]

listen = 127.0.0.1:9002
listen.owner = web2
listen.group = client1
listen.mode = 0660

user = web2
group = client1

pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 0

chdir = /

php_admin_value[open_basedir] = /var/www/clients/client1/web2/web:/var/www/clients/client1/web2/private:/var/www/clients/client1/web2/tmp:/var/www/example/web:/srv/www/example.com/web:/usr/local/php7/lib/php/extensions/:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
php_admin_value[session.save_path] = /var/www/clients/client1/web2/tmp
php_admin_value[upload_tmp_dir] = /var/www/clients/client1/web2/tmp
php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -fwebmaster@example.com"

We have tried several configurations Nginx, and reinstall the Magento,

Please can someone help us.
Thank you,


texts: I am trying to install magento 2 in a sub folder of already installed magento 2, when I try to access sub folder, it takes me to 404 page for the root magento 2.


texts: After including a JS file in my Magento 2 custom widget, i m getting $. is undefined

texts:
I have created a custom widget that requires jQuery code.

I have included the js file but when I'm trying to view the changes in the frontend, I'm getting jquery error.

I tried including the file in the footer.

Still, getting jquery error. $. is undefined.

I'm using default luma theme


texts: Magento 2: I just need to add custom font in email template

texts:
I just need to add Lucida Grande font in my email template. I have already added into _typography.less,_variables.less.

and its also showing in email-fonts.css. but it will not working in email template

is there any other way to apply this font in email.
please share if any idea.

I have use Luma theme,
also _variables.less file,

@font-family-name__base: 'Open Sans';
@font-family-name__lucida: 'Lucida Grande';
@font-family-name__lato: 'Lato';
@font-family__base: @font-family-name__lucida, @font-family-name__lato, @font-family-name__base, @font-family__sans-serif;

in _typography.less file i edit

.lib-font-face(
        @family-name: @font-family-name__lucida,
        @font-path: '@{baseDir}fonts/Lucida-Grande',
        @font-weight: 400,
        @font-style: normal
    );

Font family file path locate :

app/design/frontend/Vendor/theme/web/fonts/


texts:
I'm new to magento and am writing a plugin to allow customisable products be added to cart through an offsite API.

The guts of it are:

1) There is only one product needed in Magento.

2) However each product is unique because it is customized off site. A thumbnail of the customized product is returned for display in cart.

3) Each customized product should appear as a separate item in the cart so the user can differentiate between different customized products

4) All sub-product sales should appear as accumulative for the single product in the backend.

I'm thinking of using Configurable Products and programmatically adding a unique sub-product to add to the cart. Once it's paid for that sub-product can be removed.

Am I on the right track?
Is there an easier way?


texts:
I am trying to set width of page-bottom to be 100% but unfortunately I am still unable to make it 100%.

what I really want to have is:

Here is my default.xml

<referenceContainer name="page.bottom.container">
    <block class="Senheng\Def\Block\Html\Subscribe"
        name="senheng.page.buttom"
        template="Senheng_Default::html/subscribe.phtml"/>
</referenceContainer>

My subscribe.phtml

    <img src="<?php echo $block->getViewFileUrl('images/send.png');?>" style="float:left" />

Be the first to find about exclusive offers & get 10% off your first purchase

What can I do to make that element width (page-bottom) become 100%.

Any help would be appreciated.


texts: Vantiv Payment Method Not working in magento 2 admin panel

texts:
I am using vantiv payment gateway for my magento 2 site, it's working fine in magento front end with out any issue. and i also have success log message in log file, but it not working  in my magento admin back end. i have below error message in my log file.

2018-12-12T10:07:36+00:00 INFO (6): <litleOnlineResponse version="9.14" xmlns="http://www.litle.com/schema"
    response="1" message="Error validating xml data against the schema on line 27&#xa;Content of element &quot;expDate&quot; is incomplete"/>


texts: With multi currency feature, In admin panel (Sales->order) shows two currency in magento 2

texts:
I have used multi currency for my website. The default currency is KWD and the other allowed currency is US and Rupees.
After placing order with US currency, in admin panel the order details shows the price with KWD as well as US in bracket.
https://prnt.sc/wh9wm3
I dont want to show the default base currency at all in order details when other order is placed using other currency.
How can we do this? Please help


texts:
When I tried to open my website, I am getting the error that There has been an error processing your request

Then I checked in system.log.

The error is Disk quota exceeded

The no.of files count make doubled to the original files count when i deploy the content.

Note: I have a single Magento installed website only.

Why that much of files existed in Magento?


texts:
I have created a module to change the prices of a product when added to cart, but the module doesn't get to the method.

The observer.php file and the class Zain_ProductLabelPricing_Model is running but the method 'modifyPrice' is not. Can someone guide me how to fix this?

Config.xml

<?xml version="1.0"?>
<config>
    ...
    <global>
        <models>
            <chdispatcher>
                <class>Zain_ProductLabelPricing_Model</class>
            </chdispatcher>
        </models>
    </global>

    <frontend>
        <events>
            <checkout_cart_product_add_after>
                <observers>
                    <modify_to_custom_price>
                        <class>chdispatcher/observer</class>
                        <method>modifyPrice</method>
                    </modify_to_custom_price>
                </observers>
            </checkout_cart_product_add_after>
        </events>
    </frontend>
    ...
</config>

Observer.php

<?php
// die(); this is working
class Zain_ProductLabelPricing_Model {
    public function modifyPrice(Varien_Event_Observer $obs) {
        //die(); this is not working
        Mage::log('This worked');
    }
}


texts: How to style th and td tag in data table additional-attributes

texts:
I need to style the th and td tag in the 'additional-attributes' table (under the More information tab), with the css class: data table additional-attributes. See screenshot.

Where (which less file) do I find the styling for the th and td tag? I need to adjust the padding.

.product.info.detailed .additional-attributes > thead > tr > td,.product.info.detailed .additional-attributes > tbody > tr > td,.product.info.detailed .additional-attributes > tfoot > tr > td {
    padding: 4px 5px 10px 5px
}

.product.info.detailed .additional-attributes > thead > tr > th,.product.info.detailed .additional-attributes > tbody > tr > th,.product.info.detailed .additional-attributes > tfoot > tr > th {
    padding: 4px 30px 10px 0
}


texts:
I'm new to Magento, previously used osCommerce. I'm trying to use Magento with Bootstrap. Followed all the instructions, i'm testing the local.xml file. Following is the code i'm using in local.xml to test website:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
   <default module="page" translate="label">
      <reference name="head">
         <!-- Adding Javascripts -->
         <action method="addItem">
            <type>skin_js</type>
            <name>js/jquery.min.js</name>
         </action>
         <action method="addItem">
            <type>skin_js</type>
            <name>js/bootstrap.min.js</name>
         </action>
         <action method="addItem">
            <type>skin_js</type>
            <name>js/jquery.scripts.js</name>
         </action>
         <action method="addItem">
            <type>skin_js</type>
            <name>js/html5shiv.js</name>
            <params />
            <if>lt IE 9</if>
         </action>
         <action method="addItem">
            <type>skin_js</type>
            <name>js/respond.min.js</name>
            <params />
            <if>lt IE 9</if>
         </action>
         <!-- Removing the styles.css -->
         <action method="removeItem">
            <type>skin_css</type>
            <name>css/styles.css</name>
         </action>
         <!-- Adding Bootstrap Css -->
         <action method="addCss">
            <stylesheet>css/bootstrap.min.css</stylesheet>
         </action>
         <!-- Adding the styles.css -->
         <action method="addItem">
            <type>skin_css</type>
            <stylesheet>css/styles.css</stylesheet>
         </action>
      </reference>
      <!-- // Default -->
      <reference name="root">
         <action method="setTemplate">
            <template>page/2columns-left.phtml</template>
         </action>
      </reference>
      <!-- Left Sidebar -->
      <reference name="left">
         <!-- remove the default newsletter block from the sidebar -->
         <remove name="left.newsletter" />
      </reference>
      <!-- // Left Sidebar -->
   </default>
</layout>

When I refresh website nothing happens, the default Madison Island appears with no alteration. Is there something missing or something needs to be done on my part to see changes. Will be grateful for all help.


texts: Custom zip folder dont give option for save or open in browser

texts:
I have created a zip file programmatically. Zip is created on destination folder with specific files. But after creating that zip file why I am not getting an option to download (save) or open that zip file in browser ?

Please look in my code.

function cretezipAction()
{
   if(extension_loaded('zip'))
  {
      $destinationDir = Mage::getBaseDir('var').DS.'productzip'. DS . 'tempZipDir';
      if(!is_dir($destinationDir))
      {
         @mkdir($destinationDir);
      }
     $zip = new ZipArchive();
     $zipFileName = 'productsheets';
     $destinationDir = $destinationDir . DS . $zipFileName . '.zip';

     if(!$zip->open($destinationDir, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE))
     {
        return false;
     }
     $source = Mage::getBaseDir('var').DS.'productfile'.DS.'pdf';
      $someFilePathArray = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);

        foreach($someFilePathArray as $filePath)
        {
            $localname = substr($filePath,strrpos($filePath,'/') + 1);
            $zip->addFile($filePath, $localname);
        }
        $zip->close();
        $downloadContent = file_get_contents($destinationDir);

        $this->_prepareDownloadResponse($zipFileName.'.zip', $downloadContent);
}

--------------- Update ---------------------

//$downloadContent = file_get_contents($destinationDir);
$this->_prepareDownloadResponse($zipFileName.'.zip', array( 'value' => $destinationDir, 'type' => 'filename' ));

Even after writing code "prepareDownloadResponse", I am not getting option for save or open zip file.

Thank you in advance.


texts: Create new user using CLI in magento 2 enterprise version

texts:
below command is working in magento 2 enterprise version ?

sudo php bin/magento admin:user:create --admin-user="pearlbells" --admin-password="pear122l**all" --admin-email="pearl@gmail.com" --admin-firstname="Admin" --admin-lastname="Admin"


texts: How to filter product collection with configurable product attributes

texts:
Now I'm trying to filter product collections with my configurable product attribute i.e size

$collection = Mage::getModel('catalog/product')
              ->getCollection()
              ->addAttributeToSelect('*')
              ->addAttributeToFilter('visibility','4')
              ->addAttributeToFilter('size','3');

Above code doesn't works. Apart from attribute size i can able to filter this collection with any attributes like name, sku, created_date etc.

Did anyone know where i'm doing wrong ?


texts:
In Magento 2 we are using dependency injection in replace of old style getModel, getHelper etc

I have a particular class that i find i am injecting in a lot of places which holds some general configuration values i need across lots of classes.

I want to know how to make this a singleton like in Magento 1 we did getSingleton.


texts: Magento 1.9 - CMS page products list error

texts:
Display Bestsellers for Specific Magento Categories in CMS page.

Following tutorial,

https://mercytapscott.com/display-bestsellers-for-specific-magento-categories/

Added following line into cms content

  {{block type="catalog/product_bestseller"
  template="catalog/product/bestseller.phtml" category_id="5"}}

Getting error.

My code :

app/code/local/Mage/Catalog/Block/Product/Bestseller.php
app/design/frontend/default/theme/template/catalog/product/bestseller.phtml

If any configuration error or anything else?

error message :

Fatal error: Call to a member function productAttribute() on null in /home/abc/public_html/app/design/frontend/default/theme/template/catalog/product/bestseller.phtml on line 6


texts: How to get requested Shipping country in cart item page

texts: How to get requested shipping country id of checkout/cart/shipping.phtml on cart item list page code/core/Mage/CatalogInventory/Model/Stock/item.php?


texts: I want to fix my header for my magento site. Please get me some solutions so that I will be helpful


texts:
How to get the best selling products in a category and sort them from best selling to least selling?
I try get best selling collection like:
use Magento\Store\Model\StoreManagerInterface;
use Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;

public function getMyBestSellers() {
        $storeId = $this->storeManager->getStore()->getId();
        $bestSellers = $this->bestsellersCollectionFactory->create()
            ->addStoreFilter($storeId)
            ->setPeriod('daily')
            ->setDateRange(null, null)
            ->setOrder('qty_ordered', 'DESC');

        $productIds = [];
        foreach ($bestSellers as $bestSeller) {
            $productIds[] = $bestSeller->getProductId();
        }

        return $this->productCollectionFactory->create()
            ->addCategoriesFilter(['in' => $categoryId])
            ->addIdFilter($productIds)
            ->addStoreFilter($storeId)
            ->addAttributeToSelect('*');
}

But as a result, my products are not sorted by the number of sales made. Please help solve this problem.


texts: Magento 2: How to change scope of 'visibility' attribute programmatically?

texts:
When i edit the visibility attribute from admin and press save, It gets stuck in ajax loader and does not save that attribute. I simply wants to change the scope from store view to global. Is there any way to achieve this programmatically or by using some modification in db directly?

Thanks


texts: Magento 1.9.2.4 How to remove Link Rel Stylesheet from head section on custom theme

texts:
So we have a site and when i view source there is a Link Rel="stylesheet" line entry which fetches a stylesheet. When i click this link in view source it leads to empty page as in not found, so i want to remove this Link Rel entry from my head section.

I have checked the head.phtml for the theme and couldnt find the entry. I have also checked the local.xml file and there is no such entry. I have also checked the head.phtml for the base/default/ dir and no love.

How can i remove this link from my head section when the file it is trying to call and the directory it thinks it is in does not actually exist at all.


texts:
I've encountered a weird issue with my Magento 2 URL Rewrites function.

It seems like my 3rd party plugin (Yotpo) is pulling an /admin with the ProductURL function.

So for example this is what is showing for the URL: https://www.aimn.com/admin/catalog/product/view/_store/2/id/1029/s/green-tribe-shorts-16010401-020/key/6657455bb042e8570e7aa9b5e7b7c20c4912c6ff0197ca486b8e4d2bf990e509/

And for a normal one:
https://www.aimn.com/black-aim-high-singlet-16010717-010

Any idea why this could be? We are using a multistore and this issue seems to happen only for the Global store.

For example, on our SE it shows:
https://www.aimn.com/se/catalog/product/view/_store/2/id/702/s/rio-logo-bra-16010317-019/

Any help would be appreciated.


texts:
Context:

I have a client who came to me because their website has been hacked to hell in a handbasket. It's beyond salvageable. Server is rooted, core files changed, they are in the database, and so on.

I've decided to move them to a new host
Magento is installed and working.

I'm now trying to move all their products and customers over.

Playing with community addition here.
Their old Magento version is: 1.7.0.2
The new one is: 1.9.0.1

I'm running into brick walls because the migration path seems to be fragmented.

I need all the products.
I need all the customers.
I need to preserve the theme.

Hacked code aside, moving the products is killing me.

Question:

What process do I follow to get all products moved over? All data, images included.
What process do I follow to move all the attributes this previous install had.
What are the risks with just copying the database (outside of hacked code in the database.)

I figured this might be bad idea since the versions are changing...

Appreciate any advice, I've been reading documentation on these issues for a while now and it's brick wall after brick wall.


texts: How I can change payment method order after placing order in Magento 2?

texts: how do I let customers change their payment method after placing order? Magento 2.3.3


texts: downloadable product link price display on home page

texts:
I want to add downloadable link price for various files, for example epub, kindle, but the downloadable link price should display on home page as I kept product price as zero.

Is it possible in magento?


texts:
I'm trying to add modules and themes to my Magento 2 project.

It supposes that after adding modules and themes, the website will have a specific design but it doesn't. I can't even see categories or products

what are the causes


texts: saving new product problem in magento 1.8.1

texts:
i get this error when im saving a new product:

a:5:{i:0;s:139:"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '484-1' for key 'UNQ_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID'";i:1;s:3403:"#0 /home/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/mysite/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#4 /home/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#5 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(574): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...', Array)
#6 /home/mysite/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(453): Zend_Db_Adapter_Abstract->insert('cataloginventor...', Array)
#7 /home/mysite/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_CatalogInventory_Model_Stock_Item))
#8 /home/mysite/public_html/app/code/core/Mage/CatalogInventory/Model/Observer.php(159): Mage_Core_Model_Abstract->save()
#9 /home/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_CatalogInventory_Model_Observer->saveInventoryData(Object(Varien_Event_Observer))
#10 /home/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogInventory_Model_Observer), 'saveInventoryDa...', Object(Varien_Event_Observer))
#11 /home/mysite/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#12 /home/mysite/public_html/app/code/core/Mage/Core/Model/Abstract.php(466): Mage::dispatchEvent('catalog_product...', Array)
#13 /home/mysite/public_html/app/code/core/Mage/Catalog/Model/Product.php(549): Mage_Core_Model_Abstract->_afterSave()
#14 /home/mysite/public_html/app/code/core/Mage/Core/Model/Abstract.php(319): Mage_Catalog_Model_Product->_afterSave()
#15 /home/mysite/public_html/app/code/community/Manu/Saleproducts/controllers/Catalog/ProductController.php(330): Mage_Core_Model_Abstract->save()
#16 /home/mysite/public_html/app/code/community/Manu/Saleproducts/controllers/Catalog/ProductController.php(238): Manu_Saleproducts_Catalog_ProductController->_autosale_add_category(Object(Mage_Catalog_Model_Product), '86')
#17 /home/mysite/public_html/app/code/community/Manu/Saleproducts/controllers/Catalog/ProductController.php(180): Manu_Saleproducts_Catalog_ProductController->autoSaleCategory(Object(Mage_Catalog_Model_Product))
#18 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Manu_Saleproducts_Catalog_ProductController->saveAction()
#19 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save')
#20 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 /home/mysite/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#22 /home/mysite/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#23 /home/mysite/public_html/index.php(87): Mage::run('', 'store')
#24 {main}";s:3:"url";s:93:"/index.php/moh3n/catalog_product/save/set/4/type/simple/key/015d93a4004a1a37e257bf575762e5e9/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}


texts: Get Shipping Rates/Carriers from an existing Order

texts:
Is it possible to retrieve all shipping carrier/rates starting from an Order instead of using a quote ?

UPDATE

With the following code I'm converting the order to a quote and the address.
There is still some issue:
Mage_Sales_Model_Quote_Address::requestShippingRates() is returning false (this is called by collectTotals())

$converter = mage::getModel('sales/convert_order');
$quote = $converter->toQuote($this->getOrder());
$quoteAddress = $converter->toQuoteShippingAddress($this->getOrder());

foreach ($this->getOrder()->getAllItems() as $item) {
//            $itemW = $item->getWeight();
//            $itemQty = $item->getWeight();
//            $itemTotalWeight = $itemW * $itemQty;

                $quoteItem = $converter->itemToQuoteItem($item);
                $quoteItem->setQuote($quote);
                $quoteItem->setQty($item->getQtyOrdered());
                $quoteItem->setWeight($item->getWeight());
                $quote->addItem($quoteItem);

                $quoteAddress->addItem($quoteItem);
            }
$quoteAddress->setQuote($quote);
$quoteAddress->setCollectShippingRates(true);
$quoteAddress->collectTotals();


texts: Magento 2 - How does getShippingMethodTitle know the method title in module-tax/view/frontend/web/js/view/checkout/cart/totals/shipping.js

texts:
I try to understand knockoutjs and requirejs more but I fail to understand the following case.
In checkout the shipping method title is showing in the summary

This is the template:
vendor/magento/module-tax/view/frontend/web/template/checkout/summary/shipping.html
...

...

The method getShippingMethodTitle() seems to be defined here:
vendor/magento/module-tax/view/frontend/web/js/view/checkout/cart/totals/shipping.js (Script A)
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @api
 */

define([
    'Magento_Tax/js/view/checkout/summary/shipping',
    'Magento_Checkout/js/model/quote'
], function (Component, quote) {
    'use strict';

    return Component.extend({
        /**
         * @override
         */
        isCalculated: function () {
            return !!quote.shippingMethod();
        },

        /**
         * @override
         */
        getShippingMethodTitle: function () {
            return '(' + this._super() + ')';
        }
    });
});

It just returns this._super() so it means it tries to access the parent method _super,
but where is the parent? I think Component is the parent, but there is no method called _super in 'Magento_Tax/js/view/checkout/summary/shipping'
So how does it know the method name?


texts: Magento 2 404 error admin panel after update

texts:
I can't get access to the admin panel after upgrading Magento 2 to 2.1.7.

I get a 404 error on admin URL. I have a CentOS 7 VPS with nginx installed.

I hope someone can help me with this error.


texts: How to show "Only 1 Product available" also on Configurable Product?

texts:
Im wondering how I can "activate" the "Only X left Threshold" also for configurable products?
On Normal Products it works and shows for example "only 1 left", but on products where you can choose different colors or sizes, it doesnt work and nothings shows even if there are only 2 items left.

Thanks for the help!


texts: Error 404 after update to 1.9.2.0 - during registration

texts:
After update to 1.9.2.0 I have added the form-key to my registration template.

I can see the form-key value using firebug on the registration page, but when I submit the form, I get a 404 error:

http://dev.pickone.com.br/customer/account/createpost/ ---- 404 Not Found

I am using nginx/1.2.1. Also using onepagecheckout.


texts: How can I add the Slaask script to Magento 2?

texts:
I would like to add this script to my header-

 <script>
!function(){var x=document.createElement("script");x.src="https://cdn.slaask.com/chat.js",x.type="text/javascript",x.async="true",x.onload=x.onreadystatechange=function(){var x=this.readyState;if(!x||"complete"==x||"loaded"==x)try{

_slaask.identify({
  email: "john@company.com",
  utm_source: "user utm source data",
  utm_medium: "user utm medium data",
  utm_campaign: "user utm campaign data",
  utm_term: "user utm term data",
  utm_content: "user utm content data",
  kind: "user kind data"
});

_slaask.init('4942661a612935c280f5')

}catch(x){}};var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(x,t)}();
</script>

I have tried adding it through Google Tag Manager or through the backend in the header section. No matter what I do I get Require.js errors. Is there an easy way to add this without using Require.js? If the only way to add it is with Require.js how can I do that? Everything in my current requirejs-config.js looks like a link to js and not script itself.


texts:
I just took over a new site and I'm seeing some weird files in source control. In the downloader folder, there's a folder 'includes/src' that has all the controllers for all the modules on the system, including Magento modules.

I understand that if you enable compilation mode, the includes/src folder will contain files. Compilation mode is off for the site.

I'm about 95% sure that removing the folder (at least from source control) will be fine, but does anyone know what this could be about?


texts:
I want to create attributes which can be used as filter.

eg: there are three attributes model-number, width, aspect ratio.

When I choose a particular option from model-number, the width and aspect ratio of that model-number should be available to select from the width and aspect ratio attribute's dropdown.

Site for reference is : this site


texts:
I want to set Cash On Delivery Payment method storewise so how can it be done?

Is it okay to change in system.xml

<show_in_default> to make visible in Default Config Mode.

<show_in_website> to make visible in Website Mode.

<show_in_store> to make visible in Store View Mode.


texts: Magento - Advanced search and layered navigation (Hybrid)

texts:
We have built an application using advanced search (with Multi select for all attributes) on Product listing page. The problem is that we are having all the attribute Values shown on all the categories, irrespective of whether that is applicable to particular category or not.

Any way where we can pull only applicable attribute values to be shown in advanced search options? Something like in layered navigation?

An example hierarchy is shown below.

CATEGORIES         ATTRIBUTES       VALUES USED

Category 1  --->   Manufacturer
                       |
                        ----------->  Sony
                       |
                        ----------->  Samsung
Category 2  --->   Manufacturer
                       |
                        ----------->  BMW
                       |
                        ----------->  Toyota

Now in Category 1 listing page, in advanced search, under Manufacturer, I can see all options: - Sony, Samsung, BMW and Toyota, where BMW and Toyota are not applicable at all.

I wish to have only relevant options.


texts: Unable to find *all* Magento 1 extension screenshots, reviews in Magento 2 Marketplace. Any alternative archive to search/discover/save?

texts:
Tried searching Magento 1.x extension screenshots in Magento Connect and was redirected to Magento 2 Marketplace. Tried searching some of the magento 1.x extension screenshots, reviews in the marketplace but was unable to find the extension screenshots. Any solutions?

The old https://www.magentocommerce.com/magento-connect/ is redirecting to https://marketplace.magento.com/

Anybody else encountered above error?  How to access specific extensions and extension descriptions not available on the new marketplace?

Update 1: By extension, we are referring to both the code and its associated manual, readme, screenshots, reviews, descriptions, developer contacts i.e the entire Magento connect archive information.

Update 2: This question is different from the linked question because this is not about updating specific extensions. It is about all extensions. It is still unanswered how to retrieve screenshots, reviews, popularity index and that is outside the scope of the other questions mentioned by sv3n.


texts: How to join a table with a Magento 2 repository

texts:
I am trying to extend inventory stock items by joining my own table with added information. When the product page is loaded it gets the stock item via StockItemRepository::getList($criteria). So I need to somehow join on my own table here.

My confusion is that with the new Magento 2 repositories rather than M1-style collections, there seems to be no option to join tables on.

To give a specific example, here is the contents of that getList method:

public function getList(\Magento\CatalogInventory\Api\StockItemCriteriaInterface $criteria)
{
    $queryBuilder = $this->queryBuilderFactory->create();
    $queryBuilder->setCriteria($criteria);
    $queryBuilder->setResource($this->resource);
    $query = $queryBuilder->create();
    $collection = $this->stockItemCollectionFactory->create(['query' => $query]);
    return $collection;
}

The queryBuilder is a simple class that just creates the select statement from the criteria, and the collection is de-coupled from the database query entirely. Although I can add fields and filters to the criteria much like a M1 collection, I cannot see where I would add a join here.

Am I barking up the wrong tree entirely, or have I missed where I would add a join?


texts: How to remove the summary from the Shopping Cart (Magento2)

texts:
As the title says, how can I remove the summary to the right of the shopping cart in Magento 2?

I was hoping for a solution using XML Layout, but any solution will do (other than hiding it once its got to the client with CSS or Javascript).


texts: How to set string value in dropdown attribute programmatically in magento 2.2.X?

texts:
I want to set one string value to sizes attribute in drop-down ?

           //get sage dimension value
           $dimension = $value->Dimensions;

            //set value
            $product->setStoreIds(array(0,1));
            $product->setWebsiteIds(array(1));
            $inStock = 1;
            $product->setSku($product_sku);
            $product->setName($finalpname);
            $product->setAttributeSetId(4);
            $product->setTypeId('simple');
            $product->setStockData(
                array(
                    'use_config_manage_stock' => 0,
                    'manage_stock' => 1,
                    'is_in_stock' => $inStock,
                    'qty' => $minqty
                )
            );

             //set dimension value to sizes dropdown attribute
            $product->setSizes($dimension);

            $product->save();

Below attribute not set in drop-down.

  $product->setSizes($dimension);

Any idea, how can I set dimension value in sizes attribute?

output:-

Actual Output:-


texts: How to change the default catalog ordering direction Date Added on the frontend product lists from ascending to descending?

texts:
I am having trouble changing the default arrow from ascending to descending. I have 'Set Product as New to Date' Set as Default, which is what I want. However, I want newer products showing first so I want arrow to be set default as descending when clicking on category links. Want arrow to be pointing down.

I tried following this answer but it is still not working for me.
Magento2: Default to sort by price descending not ascending
In my Theme File app/design/frontend/Smartwave/porto/Magento_Catelog/layout/catalog_category_view.xml. I tried changing the file to this code to below. But it is not working.
<?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="content">
            <block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
                <action method="setDefaultDirection">
                    <argument name="dir" xsi:type="string">desc</argument>
                </action>
                <container name="category.product.list.additional" as="additional" />
                <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
                    <!--<block class="Magento\Framework\View\Element\Template" as="default"/>-->
                </block>
                <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="category.product.addto" as="addto">
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                           name="category.product.addto.compare" as="compare"
                           template="Magento_Catalog::product/list/addto/compare.phtml"/>
                </block>
                <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
                    <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
                </block>
                <action method="setToolbarBlockName">
                    <argument name="name" xsi:type="string">product_list_toolbar</argument>
                </action>
            </block>
        </referenceContainer>
        <move element="category.products.list" as="product_list" destination="category.products"/>
        <referenceContainer name="sidebar.main">
            <block class="Smartwave\Porto\Block\Template" name="category_view_custom_block" after="-" template="Magento_Catalog::category/custom_block.phtml"/>
        </referenceContainer>
    </body>
</page>

Any help would be much appreciated. I want the arrow to point down into descending order.


texts: How can I show base currency price & display currency price at the same time in magento2?

texts:
I would like to show product price in both base currency & display currency.

I have already enable display currency in frontend - that is i can see "USD / YEN" in header dropdown menu.

For display price with format price, i used this code to handle:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of Object Manager
$priceHelper = $objectManager->create('Magento\Framework\Pricing\Helper\Data'); // Instance of Pricing Helper
$price =  1000; //Your Price
$formattedPrice = $priceHelper->currency($price, true, false);

If i want to show 2 price, one in base currency, one in display currency at the same time, what should be the correct way?


texts: Add google tag manager code inside head and body

texts:
I have a question regarding magento. I would like to know where the head and body are located. I want to do this because i would like to add a Google tag manager code inside it. I can somehow not seem to find where it is located.

Thanks in advance.


texts: Magento 2 admin URL not working - Need SSH commands

texts: I cannot access Magento 2 admin after making URL settings change in the admin panel.  I set the Base Link URL setting to my domain name, but left the Base URL setting in xxx.xx.xxx.xx format.  Now the admin URL is not working, either using the domain or the xxx.xx.xxx.xx format.  Can someone provide me with the step by step instructions for getting this resolved using SSH?  Currently on Magento 2.1.7


texts: Magento 2.0.7 to 2.1 - Error in Review Order Page - "We cant place the order"

texts:
Steps to reproduce

Install Magento 2.1
Add any product to cart
Hit Go TO Checkout Select Checkout with Paypal Option Login and Hit PayNow
Expected result

After Hitting PayPal Pay Now button - success page should display (Skip Review Page is Enabled in PayPal Website Payment Method")
There should be option to CREATE an account on success page

Actual result

Takes to Review Page - with "We can't place the order." in RED
Surprisingly - The Order will already been placed by now "Before you hit - Place Order at bottom of Rewiew Page. You can basically do nothing on this page as the order is already placed, and "we cant place the order continues"
With Magento 2.1, the PayPal checkout does not provide option to create account - unsure if it would have provided this option if I could go beyond the Review Page -----to success page


texts: How is Row Total in order view calculated?

texts:
Fairly simple question. When viewing an order, ordered items are displayed under the Items Ordered section. How exactly is the Row Total calculated here for each item? Can anyone point me to a line where I can find the calculation/code for that specific number to show up? Doing some custom stuff and I want to use the same calculation for getting that specific number.

(Regardless of tax settings etc I want the same number that is shown under Row Total!)


texts: How do I add an attribute in admin Catalog -> Manage Products

texts: I added an attribute to use with a shipping restriction (I marked the attribute to be used with Promo rules for this) and the attribute behaves as it should, but I have no way of manually editing the attribute.  Under the admin Catalog -> Manage Products I'd like to add a selection box to be able to set the attribute.  How would I go about doing this in Magento CE 1.6.2.0?


texts: Magento 2: When/Why to do customer:hash:upgrade?

texts:
When I run below command, it gives below output.

$ php bin/magento customer:hash:upgrade
.
Finished

What actually this command do?
When I have to run this command?
What changes it will do?
Will it increase more security?

I think it deals with the following class: magento\vendor\magento\framework\Encryption\Encryptor.php

/**
 * Key of md5 algorithm
 */
const HASH_VERSION_MD5 = 0;

/**
 * Key of sha256 algorithm
 */
const HASH_VERSION_SHA256 = 1;


texts:
bin/magento command broken after 2.4.1. upgrade because of missing Magento\MediaGallerySynchronizationApi\Model\ImportFilesInterface
we are not excluding or replacing anthing related to MediaGallerySynchronizationApi in composer
Why can this be happening? and how to solve it?
Fatal error: Uncaught Error: Cannot instantiate interface Magento\MediaGallerySynchronizationApi\Model\ImportFilesInterface in /home/sohbv/public_html/m2_dev/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /home/sohbv/public_html/m2_dev/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create()
#1 /home/sohbv/public_html/m2_dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get()
#2 /home/sohbv/public_html/m2_dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument()
#3 /home/sohbv/public_html/m2_dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument()
#4 /home/sohbv/public_html/m2_dev/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php in /home/sohbv/public_html/m2_dev/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50


texts:
I am new with Magento. And trying to create my own model.
So I start with a small test
The model folder structure as the following:

FirstStore/Demo/block
FirstStore/Demo/etc/config.xml
FirstStore/Demo/controller
FirstStore/Demo/Model/Product.php
FirstStore/Demo/Helper
FirstStore/Demo/sql

the etc/config.xml code:

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

and the  Model/Product.php code:

class FirstStore_Demo_Model_Product
{
public function sayhello(){
    echo 'Hello , World with Magento';
}
}

and the  app/etc/modules/FirstStore_Demo.xml code:

<?xml version="1.0"?>
<config>
<modules>
    <FirstStore_Demo>
        <active>true</active>
        <codePool>local</codePool>
    </FirstStore_Demo>
</modules>
</config>

finally I am running this code under test.php page at the magento root dir
the  test.php code:

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

$product = new FirstStore_Demo_Model_Product;
$product->sayhello();

the error at localhost/magento/test.php is:

  Fatal error: Class 'FirstStore_Demo_Model_Product' not found in C:\xampp\htdocs\php\magento\test.php


texts: Dataprofiles fields mapping how to set base, thumbnail, small image via CSV file

texts:
I am trying to import and assign images i.e base image, small, thumbnailbut i am getting errors and my images are not assigning to the products.

any help??


texts:
What is the difference between out of stock and 0 of stock?

I have an extension that automatically displays products from the same category as related products, however it displays products that are out of stock as well.

I checked in system configurations/inventory/stock options
Display Out of Stock Products NO

In it's code it does not check for quantity left, it checks for stock value. So do I need to set up a stock value for every product? If so how do I do it?

I found this in the code of the extension

            $products->getSelect()->order(new Zend_Db_Expr('RAND()'));
            Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($products);

            $this->setData('related_products', $products);


texts: Coupon code that changes the pricing to group pricing

texts:
I got interesting task. The website has normal pricing and wholesale pricing (group pricing). Wholesale pricing is per product (not all products have them).

Is anyone aware of any way to create a coupon code in Magento, that when entered on checkout, would select wholesale pricing (group pricing) rather than normal price? (obviously without custom module which could always be made)


texts: PCI Compliance: Insecure configuration of Cookie attributes

texts:
The PCI compliance checking found this issue on our site: "Insecure configuration of Cookie
attributes". Magento Version: 2.3.5-p1
Here are the Default Cookie Settings:

The Base URL and Secure Base URL are already using https.
How will we be able to set the secure flag on all cookies to true?


texts: Shopping cart price rule : product price percent discount

texts:
I want to create rule to apply 25% of product price but maximum discount amount is 1000 .

So how can I do this?


texts: Why would cron be sending MANY Emails from root@server to user@server?

texts:
Magento ver. 1.9.3.7
Porto theme

We were (Email) blacklisted so I started digging around and on one of our Magento accounts, there are many Emails (1460 every day) which are being sent like this:

From:
root@something.ourhostingserver.com (Cron Daemon)

To: ouraccount@something.ourhostingserver.com

Subject: Cron  php /home/ouruser/public_html/cron.php
Auto-Submitted:
auto-generated
Content-Type:
text/plain; charset=UTF-8

Delivered-To:
ouraccount@something.ourhostingserver.com

Delivery-date:
Wed, 10 Jun 2020 21:46:01 +0000

Envelope-to:
ouraccount@something.ourhostingserver.com

Message-Id:

Received:
from something.ourhostingserver.com
 by something.ourhostingserver.com with LMTP
 id cLk2MZlU4V4nXwAAkcJoQg
 (envelope-from )
 for ; Wed, 10 Jun 2020 21:46:01 +0000

Received:

from ouraccount by something.ourhostingserver.com with local (Exim 4.93)
 (envelope-from )
 id 1jj8Xp-0003Rq-PA
 for ouraccount@something.ourhostingserver.com; Wed, 10 Jun 2020 21:46:01 +0000
Return-Path:

Return-path:

X-Cron-Env:

X-Cron-Env:

X-Cron-Env:

X-Cron-Env:

X-Cron-Env:

X-Cron-Env:

X-Powered-By: PHP/5.6.40
Content-type: text/html; charset=UTF-8

Why is this happening and where can one turn this off?

I just looked in the root Email account (user@domain) and it has 32 160 Emails in there! All:

From: root@something.ourhostingserver.com
To: ouraccount@something.ourhostingserver.com
Subject: Cron  php /home/ouruser/public_html/cron.php
Body of Email: X-Powered-By: PHP/5.6.40
Content-type: text/html; charset=UTF-8

I must have turned some notifications on maybe?


texts:
We have a coupon-less discount for customers placing their first order. For various reasons these customers fail the checkout from time to time and we need to put their failed order through for them, in the admin.

We have a discount with coupon code that we can put in for them, however, there is the risk that this discount code gets widely known for some reason or other. Therefore we would like this particular coupon code to work for admin orders only.

Currently, I don't have any ideas or workarounds on how to make a coupon 'admin only'. Any ideas?


texts: Cannot whitelist htaccess blocked admin URL

texts:
Trying to whitelist the blocked admin URL for the outside world from htaccess but not working.
The below code worked in Magento 1. I have added this in my root_directory/pub/.httaccess.
RewriteCond %{REMOTE_ADDR} !^101.11.121.111
RewriteRule ^(index.php/?)?(admin|rss|downloader) - [L,R=403]

This is blocking the URL but not whitelisting to my office IP. Any suggestions?


texts:
Seems a standard use case but I didn't find a working solution, so I post it here.

In base/default/layout/catalog.xml I see:

<catalog_product_view translate="label">
    <reference name="content">
        <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
            ....
        </block>
    </reference>
</catalog_product_view>

I need to add a block within the product.info block, so in my local.xml I tried:

<catalog_product_view>
    <reference name="product.info">
        <block type="core/product_view" name="sticazzi" as="sticazzi" template="catalog/product/view/sticazzi.phtml"/>
    </reference>
</catalog_product_view>

and in my view.phtml I put:

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

This does not work, what's wrong? Thanks


texts: "Fixed amount discount for whole cart" not working

texts:
I would like to set a simple rule:
If two specific items are found in the cart, apply the fixed amount discount for the whole cart.
I have been trying to set this up with SKUs:

If an item is FOUND  in the cart with ALL  of these conditions true:

SKU is XY

SKU is XX

Action:    Apply - Fixed amount discount for whole cart

Discount amount: 100

I've tried setting Stop Further Rule Processing to No and Yes and it has no impact.

It works perfectly if  there is only one product in conditions, but if I set two, there is no discount at all.

I'm on Magento Enterprise 1.14.1.

Can anyone advise how to set this to make it work? Thank you.


texts: Magento Backend pages not showing content properly after upgrade

texts:
We've just performed a manual upgrade from 1.8.1 to 1.9.2 and thought everything had gone alright.  The frontend seems properly with pages and products and loading fine.

But, the backend is messed up.  The pages aren't loading properly.  I can see the header and footers, but didn't find the content in between.

I have already flushed the caches but didn't change.

Find the following images for what I mean.

As you can see there is no content showing.  The dashboard page shows correctly and the configuration page loads too, but pages like products, orders cache, index etc don't show properly.


texts: Magento2 : How to get active payment methods list store wise

texts:
I want to get all active payment method list store wise.

I have two store

-- store indstore

-- store usstore

And i have set payment methods for only indstore
and if i try to get all active methods ,it returns from default store settings
and from default settings payment methods are disable.

if i enable from default settings than i got all payment methods.

Does anyone know how i can get methods store wise?

  app\code\Vendor\Extension\Model\System\Methods.php

<?php

namespace Vendor\Extension\Model\System;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Payment\Model\Config;
class Methods implements \Magento\Framework\Option\ArrayInterface
{
    protected $scopeConfig;
    protected $paymentmodelconfig;

    public function __construct(Config $paymentmodelconfig, ScopeConfigInterface $scopeConfig)
    {
        $this->paymentmodelconfig = $paymentmodelconfig;
        $this->scopeConfig = $scopeConfig;
    }

    public function toOptionArray()
    {
        $payments = $this->paymentmodelconfig->getActiveMethods();

        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);

        $methodList = $this->scopeConfig->getValue('payment',\Magento\Store\Model\ScopeInterface::SCOPE_STORE,1);

            foreach ($methodList as $code => $_method) {
                $active_status = "";
                $title = "";
                if (isset($_method['active']))
                {
                    if ($_method['active'] == 1)
                    {
                        if (isset($_method['title']))
                        {
                            $title = $_method['title'];
                            $logger->info($title);
                        }
                    }
                }
                 $methods = array();
                 return $methods;
        }
    }
}

    Output IN Log File

2019-12-24T05:55:20+00:00 INFO (6): Check / Money order

  Paypal is also active but i am getting only check/money order


texts:
Suppose I want to go back to the code state where only M2 core modules are active.

question: How do I disable all non-core modules in Magento 2? (in 1 step)


texts:
What is the difference between below two pieces of code?

Code 1

$block = $this->getLayout()->createBlock('CLASS_GROUP_NAME/PATH_TO_BLOCK_FILE')->toHtml();
$this->getResponse()->setBody($block);

Code 2

$block = $this->getLayout()->createBlock('core/template')->setTemplate('PATH/RELATIVE/TO/TEMPLATE/*.phtml')->toHtml();
$this->getResponse()->setBody($block);


texts: Magento2 admin panel sidebar menu doesn't work

texts:
I just install magento and open my admin panel. But non of sidebar menu are working. I got this answer and change following code from

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

to

Magento\Framework\App\View\Asset\MaterializationStrategy\copy

But noting works.


texts: Negative price filter in layered navigation

texts:
I'm experiencing a strange issue here where the price navigation filter (layered navigation) somehow came up with negative price ranges.

If I flush the price tables it seems to solve the problem, until next time prices get re-indexed. Then the negative price ranges re-appear.

Another issue is that the price ranges are not even accurate. It would show the following: CA$0.00 - CA$9.99 (2) - as if there are 2 items within this price range. But we do not have any items priced within this price range...

Help please!!


texts: How to make choice a between 2.3.7 and 2.4, current 2.3.3?

texts: We are planning to upgrade our store, the current version is 2.3.3, but which version should we choose, 2.4.* or 2.3.7? Is there an LTS version?


texts: how to deploy multiple websites and each with app folder magento2?

texts:
i develop magento2 modules, and "common practice" for module development is to install new magento2 everytime for new module. This is tedious and space consuming.

I'm trying to use the multiple website facility in Magento2 to achieve something that'll allow me to have one main installation and multiple sub-folders according to the module I'm developing and each that sub-folder would supposedly have it's own app directory and the back-end for each sub-folder will list the module in that directory only (in sub-folder/app/code/).

What I've tried so far is, created a website and default store/view and created new folder inside (website2), I copied index.php .htaccess app, pub, var, bin folder in that directory. (No luck yet)

Is this possible or is there a better way?
If possible, how can it be done? to have multiple instances, each with app dir, of one main installation.


texts:
Our url is omitting the first '/', like so: ourdomain.comindex.php when it should be ourdomain.com/index.php.

I've looked everywhere in the config, and haven't found a reason why it should be doing that. The base url is ourdomain.com/ in the database, but whenever it is used that trailing backslash is omitted and this causes CSS, JavaScript, basically everything to break.

I've noticed in the config panel, when I switch from 'Default Config' to 'Main Website', this is what the base URL is listed as, instead of the base URL in my 'Default Config' here.

Also, the 'Save Config' button does not seem to be working either, and this whole issue is making me think a re-install is needed.


texts: Magento 2 : Use Customer Data Model in transactional e-mail templates

texts:
I'm trying to send a transactional mail and I want to use the customer data model in my e-mail template. Note: Customer Data Model (\Magento\Customer\Model\Data\Customer). Not Customer Model (\Magento\Customer\Model\Customer).
This is my transport builder:
// Build message:
$transport = $this->transportBuilder
    ->setTemplateIdentifier('reseller_notification_mail')
    ->setTemplateVars([
        'subject'     => __('New Reseller subscription from %1.',
            $this->configHelper->get('general/store_information/name')),
        'customer'    => $customer,
        'reseller_id' => $customer->getCustomAttribute(CustomerHelper::ATTRIBUTE_RESELLER_ID)->getValue()
    ])
    ->setTemplateOptions([
        'area'  => 'frontend',
        'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
    ])
    ->setFrom($identity)
    ->addTo($this->configHelper->get("trans_email/ident_{$identity}/email"))
    ->getTransport();

// Send message:
$transport->sendMessage();

And this is my e-mail template:

{{template config_path="design/email/header_template"}}

There has been a new reseller subscription on the website:

        {{trans "Name"}}

            {{var customer.getFirstName()}} {{var customer.getLastName()}}

        {{trans "E-Mail Address"}}
        {{var customer.getEmail()}}

        {{trans "Reseller ID"}}
        {{var reseller_id}}

{{template config_path="design/email/footer_template"}}

However, in the e-mail I keep getting the following error:
Error filtering template:
Warning: htmlspecialchars() expects parameter 1 to be string, object given in
/var/www/public/vendor/magento/module-email/Model/Template/Filter.php on line 691

I know the problem has to be in the way I'm trying to read the name and e-mail address of my customer. Because if I remove those lines from the template, there is no error message and the rest of the mail is parsed accordingly.
I've already tried a couple of things:

Wrap the customer inside a data object
Prepend customer in my template with a dollar sign ($customer.getFirstName())
Provide an array with customer data and just use them as a string ({{var data.customer.first_name}}), but then the error is 'expects string, an array is given '.

Does anyone know what I'm doing wrong here? I know it must be something small I'm overseeing here but I can't figure it out. I'm using Magento 2.1.3.


texts: Magento2 Checkout page adding buttton after phone number

texts:
We have a requirement like:

add a verify OTP Button after phone number in magento2 checkout page shipping address section.

Can anyone help me how to add This.

Thanks


texts: Automatically continue shopping when product is added to cart

texts:
I'm using the default 1.9 theme and I want customers to automatically continue shopping when they add a product to the cart.

The default setting is that once a product is added to the cart, they get redirected to the shopping cart and have two major options, either "Continue shopping" or "Proceed to checkout".

How do I make sure the customer only get's redirected to the shopping cart when they want so?


texts: Latest Magento 1.9.3.6 and Magento Security Scan Tool , not patched?

texts:
I have the latest vetsion of Magento x1 version, which is 1.9.3.6.
It says it

Includes patches: SUPEE-5344, SUPEE-5994, SUPEE-6237, SUPEE-6285, SUPEE-6482, SUPEE-6788, SUPEE-7616, SUPEE-7405, SUPEE-7405 v1.1, SUPEE-8788, SUPEE-9652, SUPEE-8167, SUPEE-9767v2, SUPEE-10266

However, when I run Magento Security Scan Tool, it says

  SUPEE-9767 - Failed. Outdated JQuery library found (APPSEC-1622), got
  '302'.

Should I do something?


texts: Redirect to external url after order creation

texts:
I am making a payment gateway and I need to redirect from the invoice page to an external url.
Basically when an order is created at Magento I create an order in a 3rd party app with curl, then I get unique ID from that order which is used to redirect to an external invoice page.

The question is how do i make that external redirect? Most logical solution seems to override the checkout controller and in that controller I would call my model, model returns that unique ID and I make redirect to the invoice page.

Problem is I can't understand how to override the checkout controller.


texts: Magento 1.9 Where to get a full list of all magento functions / methods and their explanations

texts: where to find a complete list of all Magento functions and methods and the explanation of them?


texts:
LiteMage Error(Admin): Your installation of LiteSpeed Web Server does
  not have LiteMage Cache enabled. Please make sure your LiteSpeed
  license includes the LiteMage cache module, and LiteMage is turned on
  in the .htaccess file in the root directory of your Magento
  installation.

Magento Version: 1.9.4

I talked to the place where I bought the server service, they said they made the settings related to Litespeed

does not work even though I do the settings on the website

<IfModule Litespeed>
 LiteMage on
 </IfModule>

I added the above code

Photos Admin: http://prntscr.com/n706pl


texts: M2 Catalog Search: Getting ERR_TOO_MANY_REDIRECTS when trying to access a 'search term' assigned to an URL

texts:
I am trying to fine tune my catalog search. From the backend I've assigned, for example, to the following search term 'iphone camera' the following URL: https://example.com/catalogsearch/result/index/?brand=48&mobile_camera_type=260%2C261&q=iphone+camera

Now when I am entering the search term in the frontend, I am unable to access the aforementioned assigned page, and instead have been getting 'ERR_TOO_MANY_REDIRECTS' error.


texts: Why doesn't Magento setHeader('application/json') when appropriate in OnePageCheckout?

texts:
I have a Magento environment that is tunneled through Apache via mod_proxy. During the one-page checkout process, Apache is erroneously wrapping JSON responses in HTML because the response header says "text/html" for "content-type", which it clearly isn't.

I'm pretty much planning on adding..

$this->getResponse()->setHeader('Content-type', 'application/json');

... before every instance of ...

$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

...within the methods of Mage_Checkout_OnepageController. But that's a core hack and I have to wonder about the side-effects of such a thing.

Magento DOES put a proper application/json header before every JSON response in Mage_Checkout_CartController, why isn't that the case for Mage_Checkout_OnepageController?