texts: Magento 2.4 - Getting error on admin grid page for custom module

texts:
I am creating a custom module in magento 2.4 for admin grid.
Tried everything but on grid page getting below error -
    Type Error occurred when creating object:
 Vendor\Module\Model\ResourceModel\Grid\Collection\Interceptor, Argument 5 passed to
Vendor\Module\Model\ResourceModel\Grid\Collection\Interceptor::__construct() must implement interface
Magento\Framework\DB\Adapter\AdapterInterface or be null, string given, called in
/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

My Collection.php is as below -
<?php
namespace Vendor\Module\Model\ResourceModel\Grid;

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{

    protected function _construct() {
        $this->_init('Vendor\Module\Model\Grid', 'Vendor\Module\Model\ResourceModel\Grid');
    }

    /**
     * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory
     * @param \Psr\Log\LoggerInterface $logger
     * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
     * @param \Magento\Framework\Event\ManagerInterface $eventManager
     * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
     * @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
     */
    public function __construct(
        \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
        \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection);

    }
}

What should I change in Collection.php?


texts: Check if free shipping method is active programmatically in Magento 2

texts:
In my custom module I've created model/carrier.php to add custom shipping method, one of my custom shipping method will show up if magento free shipping method is not active, is there a way to do this?

Model/carrier.php

public function collectRates(RateRequest $request)
{
   $method = $this->_rateMethodFactory->create();
   if($free_shipping_method != 'Active'){ //???
      $method->setCarrier('test');
      $method->setCarrierTitle('test');
      /* Use method name */
      $method->setMethod('test');
      $method->setMethodTitle('England is My City');
      $method->setCost('30');
      $method->setPrice('30');
   }
}


texts: Magento 2 - display custom product attribute instead of the price in minicart

texts:
I try to display a custom product attribute instead of the price in minicart.

I saw that the html file that I have to override is price.html from module_checkout. price.html :

     custom attribute product value here

And I already override this html in a requirejs-config.js :

var config = {
//override price.html file
  map: {
    '*' : {
      'Magento_Checkout/template/minicart/item/price.html' : 'Vendor_Module/template/minicart/item/price.html'
    }
  }
};

I tried to put in that file a knockoutjs code if and ifnot, but I don't know how to retrieve my own product value in this html file. If someone know ?

Thanks in advance !


texts: Save all products through php/shell script

texts:
I'm in the process of cleaning up my existing magento install by moving the DB and using a new install so I can do away with all the unnecessary extensions taking up space.

Everything seems to have been setup fine, however some product attributes are not showing up in the admin, but doing a save brings the values back. However I have over 7000 products and cant save them individually. All the products are simple products.

So I've used this script from this article.

<?php
require 'app/Mage.php';
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
foreach ($products as $product) {
    $product->load();
    echo 'Product: ' . $product->getId() . ' - ' . $product->getName() . "\xA";

    $product->setShortDescription('N/A');
    $product->save();
}
?>

But I need to run this script via the browser and if the internet cuts out, I have to start again going over the ones that were already saved.

Instead, how can I convert this to a shell script and run if via SSH?
Also I have one store that doesn't have the same values as the default (all store views) how/where do I specify that the script run for only that store?

Thanks in advance.


texts:
I am having an issue where I continually get the error:

Base table or view not found: 1146

I have created a script in the SQL directory of the module. Here is the script.

<?php

$installer = $this;

$installer = $startSetup();

$table = $installer->getConnection()
    ->newTable($installer->getTable('hwcustomer/messages'))
    ->addColumn('message_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'unsigned'  => true,
        'nullable'  => false,
        'primary'   => true,
        ), 'Id')
    ->addColumn('subject', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        'nullable'  => false,
        ), 'Subject')
    ->addColumn('message', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        'nullable'  => false,
        ), 'Message')
    ->addColumn('reply', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        'nullable'  => false,
        ), 'Reply')
    ->addColumn('status', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        'nullable'  => false,
        ), 'Status')
    ->addColumn('original_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null,array(
        'identity'  => true,
        'unsigned'  => true,
        'nullable'  => false,
        'primary'   => true,
        ), 'Id');

$installer->getConnection()->createTable($table);

$installer->endSetup();

?>

I have set the version of the module back to the previous version in the core_resource table so when I refresh the page, it will create this table. But it still get this error after the version number is updated in the core_resource table.

Why am I getting this error?


texts: When I install Magento2.4,gettting error like "Could not validate a connection to elasticsearch". I used XAMPP for windows in my localhost. Please help!


texts: mageplaza magento-2-social-login: social login don't ppear in the sign up popup

texts: I installed  mageplaza magento-2-social-login and i configured both API facebook and API linkdin but when i click in sign in i just got a popup with email and password what is the problem. any help please]1


texts: Issues with some products when I try to duplicate

texts:
I'm having problems in duplicating of 4 products. I don't have problem with the other products in the catalog, curiously belongs to the "mug" category.
I checked the functions, the database and their relations and constraints, but I don't understand the reason.


texts: How do you control ordering of upgrade/setup scripts in Magento 2?

texts:
I've been exploring the code base for Magento 2 and I've been trying to figure how you can control the order in which upgrade setup classes would run between setup versions. Yet, i'm stuck. As far as my digging has taken me I haven't been able to find a way to control the order of schema/data upgrades within my module.

To give a little context, let's say I release a module. Overtime we release updates. Let's say I have the following file structure:

Setup/InstallPostSchema.php
Setup/CreateAuthorsTableSchema.php
Setup/AddAuthorIdColumnToPostSchema.php

In this case I'd want Setup/CreateAuthorsTableSchema.php to run before Setup/AddAuthorIdColumnToPostSchema.php.

My question is, how do/should we deal with that?

In Magento 1.x the file naming convention handled this for us: upgrade-1.0.0-1.1.0.php for example.

Frameworks like Laravel, or Rails (and others i'm sure) use a timestamp approach. However, they also have a migrations table which would tell you each migration that has run so far. Also allowing for easy rollback.

Update

I have found an example of managing versioning yourself within the Magento/Customer module:

public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

    if (version_compare($context->getVersion(), '2.0.0.1') < 0) {
        // Changes here.
    }

    if (version_compare($context->getVersion(), '2.0.1', '<')) {
        // Changes here
    }

    $setup->endSetup();
}


texts:
I just created a CMS Block but I want to remove this programatically. So whenever I run bin/magento setup:upgrade it will delete the block first. Then after that recreate. I decided to do it this way to fix a problem of Block identifier already exist error

Below is my code

$cmsBlockData = [
        'title' => "Your CMS Static Block",
        'identifier' => "your-cms-static-block",
        'content' => "
Write your custom cms static block content here
",
        'is_active' => 1,
        'stores' => [0],
        'sort_order' => 0
    ];
    $this->blockFactory->create()->setData($cmsBlockData)->save();

I want to know how to remove if the installation is like this what is the code for removing it?


texts: magento whitelisted blocks are not displaying at fronend

texts:
I have applied patch 6788 to magento EE 1.13 and also added block to white list but blocks are not displaying on home page

Please help


texts: Adding Labels in the Products Listing Page For Pricing

texts:
my store is in magento1.9 and I want to

add Lables/static text for various prices.
wrap text so complete product name appears, rather than ending with ....

As of now I have got the image , product name, $$$, Sale Price
I want to add RRP: tag before price,
"Our Price" before the sale price
and if Possible "You Save %"
How and where can I do that?
Found these files but not sure what to do
app/design/frontend/base/default/template/catalog/product/list.phtml
app/design/frontend/base/default/template/catalog/product/listing.phtml

Can see the following code. Not sure what to add and also I dont see any place holder for the Special / discounted price
                        $info['name'] = ''
                            . ' escapeUrl($_product->getProductUrl()) . '" title="'
                            . $block->stripTags($_product->getName(), null, true) . '">'
                            . $_helper->productAttribute($_product, $_product->getName(), 'name')
                            . '';
                        $info['price'] = $block->getProductPrice($_product);
                        $info['review'] = $block->getReviewsSummaryHtml($_product, $templateType);


texts: Disable minicart dropdown on mobile devices

texts: When on mobile devices, I want to display the cart icon on the navbar but on clicking, it should go directly to the cart page.


texts: How to get configurable product's custom attribute's values or value by attribute id in Magento 2?

texts: I tried to get it but i just getting label and options but not get selected value.


texts: Escape initial percentage on Product Search Criteria REST API

texts:
I'm running the following request to search products by SKU using the Magento 2 REST API:

curl -X GET "http://localhost/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=sku&searchCriteria[filterGroups][0][filters][0][value]=%24-MB01%&searchCriteria[filterGroups][0][filters][0][conditionType]=like"

Summary: look for products with sku that contain the string "24-MB01"

Disregarding auth and content params, the issue is that the value %24-MB01% is misinterpreted as $-MB01% by the API as you can see:

{
   "total_count" : 0,
   "search_criteria" : {
      "filter_groups" : [
         {
            "filters" : [
               {
                  "condition_type" : "like",
                  "value" : "$-MB01%",
                  "field" : "sku"
               }
            ]
         }
      ]
   },
   "items" : []
}

How can I escape it?


texts: How to hide custom product description tab based on product attribute value?

texts:
I've made global product description tab as well as global attribute with yes/no values. Attribute default settings is set to "no". I want to show this additional tab only for products whose attribute value is set to yes.
How can I achieve this?


texts: Magento 1: New server / There has been an error processing your request

texts:
I've moved a magento installation to a new server and thought i'd covered everything:

http://www.gep.co.uk/store/

But i'm getting the error. I think the report in var/report is:

a:4:{i:0;s:56:"Mage registry key "_resource_helper/core" already exists";i:1;s:1774:"#0 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/Mage.php(563): Mage::register('_resource_helpe...', false)
#2 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(534): Mage::getResourceHelper('core')
#3 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(520): Mage_Core_Model_Resource_Db_Collection_Abstract->_prepareSelect(Object(Varien_Db_Select))
#4 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/lib/Varien/Data/Collection/Db.php(572): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#5 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/code/core/Mage/Core/Model/Resource/Website/Collection.php(137): Varien_Data_Collection_Db->load(false, false)
#6 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/lib/Varien/Data/Collection.php(729): Mage_Core_Model_Resource_Website_Collection->load()
#7 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/code/core/Mage/Core/Model/App.php(634): Varien_Data_Collection->getItemById('0')
#8 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#9 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#10 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#11 /var/www/vhosts/localhost.localdomain/httpdocs/gep/store/index.php(87): Mage::run('', 'store')
#12 {main}";s:3:"url";s:56:"/store/index.php/cd-s/southern-empire/images/favicon.ico";s:11:"script_name";s:16:"/store/index.php";}


texts: Magento Community Edition ver 1.9.2.0 download source

texts:
To download Magento Community Edition ver 1.9.2.0, you need to login to magentocommerce.com.

I can't login, because I don't know my password, and I can't retrieve my password, because the password reset email never reaches my Gmail account (not in spam either). When I ask Magento support for help, they say there is no such account corresponding to my email, but when I try to register, it says my email is already registered. I haven't heard from them for about 10 days.

Long story short, is this https://github.com/OpenMage/magento-mirror a reliable copy of Magento 1.9.2?


texts: How to create image using Base64EncodedData in magento 2

texts: I want to create images using Base64EncodedData in Magento 2.


texts: Magento 2: How to set up VAT (taxes) in Magento 2 so it charges it to the UK/EU only but not to ROW?

texts:
I need to set up VAT (tax) rates in Magento 2 and I don't know where to start as tax options are all over the place.

Catalogue prices are shown inc. VAT at 20%. This needs to be charged to customers in the UK and the EU, but not to the rest of the world, including the Channel Islands of the UK (Jersey and Guernsey).

Shipping rates to the UK and the EU are shown inc. VAT, but as there's no VAT on international postal services, postage rates to ROW are shown and calculated ex-VAT.

Where do I start? How do I do it?


texts: Product image upload issue on magento 1.9.3.10

texts:
I have upgraded the site from 1.9.2.2 to 1.9.3.10

There is an issue with catalog product page in admin.

When uploading the image, it shows complete but thumbnail is not displayed.
Images are uploaded to tmp/catalog/product.

I have tried all the solution, still no luck.

Can anyone help me please?


texts: Create a Required Multiselect UI Component Without the first option being selected

texts:
I need to have a multi-select UI Component which is required, but does not select the first option be default? I have this set up but the first time is always selected by default. How can I do this?

$fieldsetSetup->addField('delivery_method', 'multiselect',
            ['name' => 'delivery_method', 'label' => __('Delivery Method'), 'title' => __('Delivery Method'), 'required' => 'true',
            'values' => array(
                array("value" => "", "label" => "Select"),
                array("value" => "option_1", "label" => "Option 1"),
                array("value" => "option_2", "label" => "Option 2"))
            ]);


texts: I am new to magento , I have a French store, In my checkout page , I have some text , How I translate into French , as of now it was displayed in English and I am using magento 1.9


texts: Trigger newsletter success subscription message without refresh

texts:
I'm using Magento 1.9.1.0

I have two types of Newsletter Subscription. One is the default, wherein after a user subscribes, the page will reload and the message will be displayed at the top. Another one is AJAX in a Modal, wherein after subscribing, the page won't reload but the message will not appear. It does subscribe the user because I can see it on Newsletter -> Newsletter Subscribers at the admin panel.

I want it to appear inside the modal without refreshing the page, and it won't appear again at the top like the default ones when a user refreshes the page.

Is this possible? Thank you!


texts:
I Install Magento 2, It works Fine but Under the app/design/Frontend/Magento/ Getting Null. Unable to find Default Theme Structure. So Anyone can Help me what was the problem?
Any Kind of help Appreciated.


texts: How to show Additional Shipping Fee of per product on checkout page by an attribute

texts:
I have added an attribute for use on the product page:

Now I would like it show on cart page like this:

If the quantity of a product in the cart is increased, I would like the additional shipping fee to add and increase the GrandTotal


texts:
The store is selling gold products that has dynamic pricing, the pricing will change based on the international gold price.

The base price is dynamic but recently we added tier pricing and how can we make the tier price update using cron? Initially I used this cron to reindex but it has no effect on updating the tier price.

php -f /var/www/shell/indexer.php reindexall

The other method is to just saving the products so that the tier price will be updated but the stores has so many products!

I'd like to explore the available options or insights from the board regarding this issue.


texts: Layered navigation showing child brands with bundles

texts:
Using Magento 1.9.1 and have a problem with Layered navigation and bundle product brands.

I have many simple products that can be part of any bundle product. All of them can be with different manufacturer (brand). If they are part of a bundle, they are marked as "Not visible individually".

I make a new Bundle product, and set some of the simple products as part of the bundle. I also set manufacturer for the bundle product that is different from the children.

In my layered navigation i can see the manufacturer for the bundle product, but also all children. And I would only want to show manufacturer of the bundle.

Only if a simple product is marked as visible in Catalogue, it would show up in the layered navigation.

How do I filter children manufacturer from layered navigation if the child is marked as "not visible individually"?


texts: Is there a way to make the wishlist items stay there? So when the customer adds it to the cart they still remain in the wishlist.  I also want it to be saved with the login and not by a local cookie.


texts: Deploying my magento site on new Elastic Beanstalk environment

texts:
We have a t1.micro ec2 server right now. It has magento installed on it, which has been customized w various plugins and other custom development

I’ve successfully set up an elastic beanstalk LAMP environment and connected it to RDS.

I’d like to install our magento site on our elastic beanstalk environment and use it as our production environment, but am not sure how.

I know that deploys are handled on elastic beanstalk by uploading a zip file, but I have been unsuccessful so far at deploying working software.  I am not sure exactly what needs to be zipped, and I am not sure if I am missing/copying config files unnecessarily.

To this point I have:
Replicated the database from the t1.micro server into the RDS database.  Based on a few queries and browsing the tables, it seems like I did this successfully.

Zipping everything in our t1.micro /var/www/html folder (changing params in local.xml to RDS db host,user,pw), and uploading that folder, but am getting a stack trace:

Also - I originally had installed the sample elastic beanstalk test software successfully, so I know that there are no security group issues between my servers and RDS.

Ultimately, I would love some help on how to deploy customized magento to elastic beanstalk - what files & directories need to be included in the zip, and guidance on what files need to be changed. Any help for a n00b would be greatly appreciated!


texts:
I'm trying to translate some text in the checkout page:

  "Provided Zip/Postal Code seems to be invalid."

However, when I add the following to frontend/..theme../Magento_Checkout/i18n/en_US.csv and re-deploy, the translation isn't there:

  "Provided Zip/Postal Code seems to be invalid.","Test."

I cleared cache as well. What am I doing wrong?


texts: Attributes showing values instead of their labels. Exporting in customers grid: Magento 2.3.5

texts:
I Have two custom attributes in my customer grid, named old_customer (1=>Yes,0=>No) and zone (1=>India, 2=>UK, 3=>Others ) , both attributes  is_used_in_grid is true . but while I'm exporting in to the customer gird exporting option I'll get the result like below

Actual Result:

Expected Result :

Can someone please help me on this. Thanks in advance!!


texts: Get option label associated with admin store in Magento 2

texts:
I want to go through all options of attributes configured for filtering and output the label of the Admin Store View. I only managed to get the Default Store View (store_id 1) label with the following code:

$coll = $this->_objectManager->create(\Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class);
$coll->addIsFilterableFilter();
$layeredNavAttributes = $coll->load()->getItems();

foreach ($layeredNavAttributes AS $attr) {
    $options = $attr->getSource()->getAllOptions();
    foreach ($options AS $option) {
      echo $option['label'];
    }
}

How can I get the labels of the Admin Store View (store_id 0) instead?


texts: How to check if attribute value exists in Magento2?

texts: How to check if attribute value exists in magento2...


texts: Ajax on admin side goes to 404 ( Not Found ) in Magento 2?

texts:
I have created a button and want to save some data using Ajax but it goes to 404 not found.
My URL is http://127.0.0.1/magento/AdminSample/datasave/index/?isAjax=true
My controller file path is ( app/code/Tym17/AdminSample/Controller/Adminhtml/Datasave/Index.php )
<?php
namespace Tym17\AdminSample\Controller\Adminhtml\Datasave;

use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\App\Config\ScopeConfigInterface; // Needed to retrieve config values

class Index extends \Magento\Backend\App\Action
{
/**
 * @var PageFactory
 */
 protected $resultPageFactory;
/**
 * @var scopeConfig
 * Needed to retrieve config values
 */
protected $scopeConfig;

/**
 * @param Context $context
 * @param PageFactory $resultPageFactory
 */
public function __construct(
    Context $context,
    PageFactory $resultPageFactory,
    ScopeConfigInterface $scopeConfig // Needed to retrieve config values
) {
    parent::__construct($context);
    $this->resultPageFactory = $resultPageFactory;
    $this->scopeConfig = $scopeConfig; // Needed to retrieve config values
}

/**
* Index Action*
* @return void
*/
public function execute()
{
    /*$post = (array) $this->getRequest()->getPost();
    var_dump($post);*/
    die('a');
}
}

My JS file path is ( app/code/Tym17/AdminSample/view/adminhtml/web/js/adminscript.js )
My routes.xml file path ( app/code/Tym17/AdminSample/etc/adminhtml/routes.xml )
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
    <route id="AdminSample" frontName="AdminSample">
        <module name="Tym17_AdminSample" before="Magento_Adminhtml" />
    </route>
</router>
</config>

My JS file is ( app/code/Tym17/AdminSample/view/adminhtml/web/js/adminscript.js )
require(["jquery","mage/url"],function($,url) {
$(document).ready(function() {
    console.log('123');
    url.setBaseUrl(BASE_URL);
    var BaseUrl = url.build('');
    jQuery( ".product" ).on( 'click', '.save',function() {
        console.log('click');
        let customurl = "http://127.0.0.1/magento/AdminSample/Datasave/index/";
        let dataid = jQuery(this).parent().parent().find('.dataid').text();
        $.ajax({
            url: customurl,
            type: 'POST',
            dataType: 'json',
            data: {
                dataid:dataid
            },
            complete: function(response) {
                console.log('aaaaa');
            },
        });
    });
});
});

On clicking on button if i use console it shows the result but AJAX goes to 404.
What's the issue i didn't get this.Any Help is appreciated.


texts: Magento 2.3.1 smtp on abstract.php setup

texts:
In the previous topic :
Magento 2 smtp could not open socket

1: Magento 2 smtp could not open socket by akshay billore

I encounter the same issue ,and i tried to do the same solution provided by Dhiren Vasoya.

which is adding code to magento 's abstract.php.but i issue did not resolve and it gives me

(Could not open socket: stream_socket_client(): unable to connect to tcp://email-smtp.us-east-1.amazonaws.com:587 (Connection timed out)
)

I also tried on gmail smtp using ssl socket as configuration,doesnt work.

Would it be magento version? because i m using 2.3.1,or something else is missing? like openssl configuration?

My openssl:


texts: Magento 2 - Varnish cache + Categories Menu (magento c:f vs -X PURGE)

texts:
Introduction
Previously when Varnish cache is partially setup (but not working) the Categories navigation menu disappears.  The menu shows properly now, but I have been testing Varnish configuration the last few weeks but are not 100% sure everything works as it should.  Below output of files / varnishlog content to assist please.
The categories menu does not correctly clear on -X PURGE
Info
I see the page_cache/block/esi/blocks/*catalog.topnav* referenced inside varnishlog.    Investigating the source Magento 2 code base,
For reference:
/var/www/html/vendor/magento/module-theme/view/frontend/layout/default.xml

<block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" ttl="3600" before="-"/>

Now the theme I use:
/var/www/html/app/design/frontend/Sm/market/Magento_Theme/layout/default.xml

<block class="Magento\Theme\Block\Html\Topmenu" name="horizontal-css"  html/horizontal-css.phtml" ttl="3600"  before="-"/>

bin/magento cache:flush clears the cache of the homepage correctly (including updates to categories menu).
varnishlog -g request -i berequrl -I BerespHeader:X-Magento-Tags -q "ReqUrl eq '/'"
*   << Request  >> 360962

*   << Request  >> 164441
**  << BeReq    >> 164442
--  BereqURL       /
--  BerespHeader   X-Magento-Tags: store,cms_b,cms_p_109,cms_b_id-7-block-1,cms_b_id-7-block-2,cms_b_id-7-block-3,cms_b_id-7-block-4,mfb_p_1
**  << Request  >> 164443
*** << BeReq    >> 164444
--- BereqURL       /page_cache/block/esi/blocks/%5B%22catalog.topnav%22%5D/handles/WyJkZWZhdWx0IiwiY21zX2luZGV4X2luZGV4IiwiY21zX3BhZ2VfdmlldyJd/
--- BerespHeader   X-Magento-Tags: cat_c,cat_c_3,cat_c_4,cat_c_55,cat_c_5,cat_c_7,cat_c_160

However,
curl -k -I -H "X-Magento-Tags-Pattern: .*" -X PURGE https://nginx-proxy/ does not clear the categories navigation menu.
curl -k -I -H "X-Magento-Tags-Pattern: .*" -X PURGE https://nginx-proxy/

*   << Request  >> 33479
**  << BeReq    >> 33480
--  BereqURL       /
--  BerespHeader   X-Magento-Tags: store,cms_b,cms_p_109,cms_b_id-7-block-1,cms_b_id-7-block-2,cms_b_id-7-block-3,cms_b_id-7-block-4,mfb_p_1
**  << Request  >> 33481
*** << BeReq    >> 33482
--- BereqURL       /page_cache/block/esi/blocks/%5B%22catalog.topnav%22%5D/handles/WyJkZWZhdWx0IiwiY21zX2luZGV4X2luZGV4IiwiY21zX3BhZ2VfdmlldyJd/
--- BerespHeader   X-Magento-Tags: cat_c,cat_c_3,cat_c_4,cat_c_55,cat_c_5,cat_c_7,cat_c_160

*   << Request  >> 33484
**  << Request  >> 33485

*So using bin/magento cache:flush clears the content of the menu (and on refresh I can see updated time/date), but not with -X PURGE, even though the entries are 95% the same (3 missing blocks in -X PURGE) - but they aren't related to the menu.
I have tried the default blank theme as well.  Basically I edited the /vendor/magento/module-theme/..../topmenu.phtml file and added a date to it (to see if caching is still applied or not)
Questions
They are all very related to each other, asking from different angles:

Pretty much want to understand what bin/magento cache:flush clears extra in order for the categories menu to be purged, whereas -X PURGE does not.
What is the TTL used for?  Is this only specific to built-in cache?  Is this the problem why Varnish can't clear it, and if so how do I fix it.
What is /page_cache/block/esi/blocks/%5B%22catalog.topnav specifically? Both default blank and custom theme does have the entries for 'catalog.topnav'.  Default blank uses this block as I edited the template to test - unless the reference has been renamed 'somewhere'?
Is this actually correct or not?
Finally, since you may have noticed the theme template gives it a name horizontal-css also with TTL=3600, the question is how do I actually add this as part of X-Magento-Tags-Pattern if this is actually required.

Thanks for the help!


texts:
In order to fix the following issue temporarily:

Magento 2.3.3 blank email with html attachment

I want to override /vendor/zendframework/zend-mail/src/Headers.php file. I have tried preferences (using di.xml) and composer way (described here), but could not make it working.

Can anyone help me to override the functionality of this class without hampering upgrade possibilities.

Thanks in advance


texts: data install/upgrade not creating category attribute

texts:
i'm trying to add an attribute to the categories, but my setup doesn't add anything
the input is visible in the categories, but you even on save the input value stays empty
and i can't find any reference to my attribute in database (plus i would like it to be an integer)
here my code
UpgradeData.php
<?php
namespace Cursol\CategoryAttribute\Setup;

use Magento\Framework\Setup\{
    ModuleContextInterface,
    ModuleDataSetupInterface,
    InstallDataInterface,
UpgradeDataInterface
};

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;

class UpgradeData implements UpgradeDataInterface
{

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

    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'origine_attribute_id', [
            'type'     => 'text',
            'label'    => 'Origin Attribute Id',
            'input'    => 'text',
            'visible'  => true,
            'default'  => '0',
            'required' => false,
            'global'   => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'group'    => 'Display Settings',
        ]);
        }

}

category_form.xml
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="display_settings">
        <field name="origine_attribute_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="required" xsi:type="boolean">false</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                    </item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">Origin Attribute Id</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>


texts:
In the below code, where I am trying to update a custom attribute called branding. The for loop is running only for one iteration and stopping. It is updating only the first product in the list and not looping any further.

Can anyone kindly let me know why this is happening?

<?php
set_time_limit(0);

// require magento core
require_once 'app/Mage.php';

// execute on admin store
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')->getCollection();

foreach($products as $product){
     echo $product->getSku();
     $product->setData('branding', 'kib');
     $product->save();
}

Thanks.


texts: Magento 1 : All my emails go to spam in Magento

texts:
I have a magento website and my emails go to spam I checked the SPF, DKIM, and DNS all are pass, I used the default transaction email templates but still go to spam!!

Can you please help us in this problem? What do you think I need to check for this problem. I found another thing our logo image in the emails has

https://ci4.googleusercontent.com/proxy/9_AMRUJtmC5VTVhHJZabJ0BgPBA7cMw-bO-MmcT437uZG2Q8_MgQJ-80bDDIGQNOHpk-rfvdv4NxwrScZFUcvWE8rwgFKjCsspGQXm4=s0-d-e1-ft#

before the image source is this may affect it??

Thanks


texts: How to clear sessions of all users in Magento 2

texts:
In magento 1 I used to clear session deleting var/session dir.

But how to make it in Magento 2?

env.php fragment:

'session' =>
    array (
        'save' => 'files',
    )

Any help will be much appreciated!


texts: update a table field without losing previous data

texts:
I have a situation in which I need to fill a field of my custom table with new data without losing the existing data. Currently when I submitting data, data exist in this field will get overwritten by new data. Which is the best method to do it?

Below I am providing the necessary details:

my custom module model : banner/banner
table name : banner
field that I need to update : images


texts: Changing options tag in view.phtml for configurable

texts:
what I need is to change the "select" and "option" tag to simple div or better to "ul" and "li".

This has to be in the view.phtml for configurable as already specified in the subject.
I know the file to edit are the js/varien/configurable.js, or better just the  template/catalog/product/view/type/options/configurable.phtml in my styled them,

but can´t achieve it anyhow.
Any guess?

Thanks


texts:
My website is www.caviarofswitzerlandshop.com Magento 1.9.2.1

The problem is in administration panel, whatever change I make, it takes a long time to save the changes and sometimes it doesn't save the changes.

In frontend, the cart isn't working because when I add products they don't get added appart from the first one, and when I try to remove/edit product quantity nothing happens.

I have no cache extension installed, I refreshed and flashed all caches, I have replaced .htaccess with new one, I have reindexed the whole website.

Server is shared server. The Website is very small only 4 products on it and around 1000 visitors a month.

It says server load 0.07 (32 cpus)
Memory used 24.05%

3rd part modules

fs_DisableCompare 0.0.1 (beta)
Aoe_Scheduler 0.3.2 (stable),
Raveinfosys_Deleteorder   1.0.8 (stable),
Apptrian_Image_Optimizer  1.2.1 (stable),
Apptrian_Minify_HTML_CSS_JS

Update: All 3rd party extensions are now removed but problem is still there.


texts: How to update shipping methods on change of custom dropdown on cart page

texts:
I have created a custom dropdown above country dropdown on cart page. Now I want to update shipping methods list.

I followed Devdocs to show custom field on address form (cart page). All in all I want to bind custom dropdown (dropdown have options as all shipping addresses of customer) so that it works same as country, region and postcode and update shipping method list as per selected address from dropdown.

Thanks


texts: How to add custom total row in Invoice PDF

texts:
I added pdf.xml in custom modules etc folder. But it is not reflecting in Invoice PDF.
I have debug and found that in the class \Magento\Sales\Model\Order\Pdf\AbstractPdf, on line no. 676 I get custom row values but those row values gets omitted after the statement $total->setOrder($order)->setSource($source);

protected function insertTotals($page, $source)
    {
        $order = $source->getOrder();
        $totals = $this->_getTotalsList();
        $lineBlock = ['lines' => [], 'height' => 15];
        foreach ($totals as $total) {
            echo "<pre>";print_r($total->getData());// I get custom row values here
            $total->setOrder($order)->setSource($source);//But those get lost here

This is a protected function so I cannot add plugin also.

EDIT

Pdf.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd">
    <totals>
        <total name="custfee">
            <title translate="true">Custom Fee</title>
            <font_size>7</font_size>
            <display_zero>true</display_zero>
            <sort_order>100</sort_order>
        </total>
    </totals>
</config>


texts: how to display product with category name on cms page in magento

texts:
I have a one cms page with name stock list and i want to show here all the product with the corresponding category name above it. like this

category 1

product1 product2 proudct3

category2
proudct1 product2 product3

I tried

{{block type="catalog/product_list" category_id="8" template="catalog/product/featured.phtml"}}

but this will only show the product from a specific category not does not print the name of the category

I have around 50 category so it is not a good practice for me to do this type of coding again and again to show product from all the category.

so I think that one solution for this is to call the view.phtml file which is used to show product on category page. but i don't know the code how to call that file on cms page. so can any one help me in this or give me the better idea for this problem


texts: Magento 2 Custom Tab Pass Variable Value To The Title

texts:
I created a custom tab and set it up by using layout instruction

<referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View" name="custom.prod.tab2" template="MyComp_Mymod::customtab2.phtml" group="detailed_info" >
            <arguments>
                <argument translate="true" name="title" xsi:type="string">More Info</argument>
            </arguments>
        </block>
</referenceBlock>

The title of the tab needs to be value of a dropdown in the backend (dropdown attribute with multiple options) e.g. on product A the tab title could be ABC and on product B it could be XYZ whatever is selected in the backend.

Is there a way to pass on the selected dropdown value in the configuration here either through XML or via a variable through PHTML template ?


texts: Clone Magento 2 respository from git causing installing new project not loading existing

texts:
I cloned my magento 2 project from git to a new folder and install and configure the latest database from server, but when i open the magento 2 page in browser it's showing the first step of installing new Magento 2 repository not loading the existing Magento 2, here's my .gitignore :

/.buildpath
/.cache
/.metadata
/.project
/.settings
atlassian*
/nbproject
/sitemap
/sitemap.xml
/.idea
/.gitattributes
/app/config_sandbox
/app/etc/config.php
/app/etc/env.php
/app/code/Magento/TestModule*
/lib/internal/flex/uploader/.actionScriptProperties
/lib/internal/flex/uploader/.flexProperties
/lib/internal/flex/uploader/.project
/lib/internal/flex/uploader/.settings
/lib/internal/flex/varien/.actionScriptProperties
/lib/internal/flex/varien/.flexLibProperties
/lib/internal/flex/varien/.project
/lib/internal/flex/varien/.settings
/.grunt

/pub/media/*.*
!/pub/media/.htaccess
/pub/media/catalog/*
!/pub/media/catalog/.htaccess
/pub/media/customer/*
!/pub/media/customer/.htaccess
/pub/media/downloadable/*
!/pub/media/downloadable/.htaccess
/pub/media/import/*
!/pub/media/import/.htaccess
/pub/media/theme/*
/pub/media/theme_customization/*
!/pub/media/theme_customization/.htaccess
/pub/media/wysiwyg/*
!/pub/media/wysiwyg/.htaccess
/pub/media/tmp/*
!/pub/media/tmp/.htaccess
/pub/media/captcha/*
/pub/static/*
!/pub/static/.htaccess

/var/*
!/var/.htaccess
/vendor/*
!/vendor/.htaccess


texts: Magento 2 - New store Not being created (create store something went wrong)

texts:
i have try to create multi store but when i create new store (spanish store) some error are showing and then store has been created. i have tried to all third party installed modules has been disabled, but my issue has not solved. i have no idea how to solved this error. i have added error screenshot.
please help me.
thanks in advance.


texts:
I'm currently working on a tool that will be used to add some parts to the checkout page.

I have been looking at the core files but so far I haven't found anything about how to actually pre-set fields to the checkout (shipping details section).

I have no problem adding products, etc.

EDIT:
This script is beeing used for a customer to reorder the same products again. By code I can add the products to the cart. This question is regarding the customer details such as firstname, lastname, address, phone, email and have them added to the cart.


texts: Billing address does not have customer_id

texts:
Yesterday a customer called us regarding she could not place an order, but actually, the order has been placed and she was directed to the Review Order page with an error message

  "We can't place the order".

I checked the log file and found it is due to her billing address record in qoute_address does not have "customer_id" value so it could not pass the validate function in QuoteAddressValidator.php.

However, she did place the order as a registered customer and her shipping address record has customer_id.

When I checked the similar cases, I only found one happened last Oct. So it rarely happens and I even cannot repeat it.

Does anyone was faced with the same issue before or know where is the problem?

Thanks


texts: Magento2: Re-direct to custom URL from observer

texts:
My requirement is that if a customer visits website from country India they should be redirected to indian website www.example.com/in/ . In all other cases it should be default website only.

I'm using geoip PHP library. I've used frontend event controller_action_predispatch and here is my observer code:

namespace Amit\Geoip\Observer;
require_once 'lib/geoip.inc';
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Controller\ResultFactory;
use Magento\Store\Model\StoreManager;

class ControllerActionPredispatch implements  ObserverInterface {

    protected $resultRedirectFactory;

    public function __construct(
        ResultFactory $resultFactory,
        StoreManager $storeManager
    )  {
        $this->resultFactory = $resultFactory;
        $this->storeManager = $storeManager;
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $baseUrl = $this->storeManager->getStore()->getBaseUrl();
        $gi = geoip_open(getcwd()."/app/code/Amit/Geoip/Observer/lib/GeoIP.dat",GEOIP_STANDARD);
        $ip = $_SERVER['REMOTE_ADDR'];

        $country_code = geoip_country_code_by_addr($gi, $ip);

        if((strtoupper($country_code) == "IN")){
            $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
            $resultRedirect->setUrl($baseUrl . '/in/' . $_SERVER['REQUEST_URI']);
        }
    }
}

Problems:

My observer function is being executed and I'm getting customers
country from their IP but it is not re-directing to website
www.example.com/in/*. What is the proper way to re-direct to my
custom url?
I think event controller_action_predispatch will call observer
function on every page customer visits. Which event I should use so
that it will be executed only for the first time customer visits the
website?
I see one of the possible options is setting cookie for it but I'm
not sure where I should set cookie in my module (events? which
event?) and which process I should follow to re-direct them.


texts: Uncaught ReferenceError: define is not defined in extension custom js

texts:
i created the custom js for backend extension module like this:

custom.js:

define([
    'jquery',
    'underscore',
    'mage/url',
    'jquery/ui'
    ], function ($, _,urlBuilder) {
    'use strict';
    $(function() {
       console.log('test');
    });
});

default.xml :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Namespace_Module::custom.js"/>
    </head>
    <body/>
</page>

but i got the following error like this :

Uncaught ReferenceError: define is not defined
    at custom.js:1

the problem might caused by require.js is loaded just before my custom.js


texts:
Below function is not working in M2. This works in M1.

$quote=$observer->getEvent()->getQuote();
$taxes_for_items = $quote->getTaxesForItems();

Any alternate solution is available? I need quote item tax details.


texts:
Is there any clean way to add custom field to all product attributes in Magento?
Catalog -> Attributes -> Manage Attributes -> (Add new/Edit) Attribute page.

Something like it can be done for catalog category:

$setup = new Mage_Eav_Model_Entity_Setup("core_setup");
// below code will add text attribute
$setup->addAttribute("catalog_category", "attribute_code", array(
"group"         => "General",
"input"         => "text",
"type"          => "varchar",
"label"         => "Attribute label",
"backend"       => "",
"visible"       => 1,
"required"      => 0,
"user_defined" => 1,
"global"        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

There is no record in eav_entity_type table for attributes, so i can not use this method.
Is there any suggestion on the best way for adding this custom field for attributes.


texts: Adroll Conversion Tracking Enterprise 1.9

texts:
These are the instructions.  I have put the code in the success file but its not passing any order values back to Adroll.

  Confirm that your AdRoll SmartPixel is placed in the Miscellaneous
  HTML section in your Magento Admin Panel. In the folder that contains
  your Magento files, find the file with the path
  /app/design/frontend/default/yourskinname/template/checkout/success.phtml.
  There are several success.phtml files within the root folder, so
  make sure to find the appropriate one. Open up the file in a text
  editor and add the following php and javascript code in a place that
  does not interfere with the code that already lives in the file:

  Please click on the link below to show the proper code

<script type = "text/javascript">
adroll_conversion_value_in_dollars = <?php echo $total ?>;
adroll_custom_data = {"ORDER_ID": "<?php echo $this->__($this->escapeHtml($this->getOrderId())) ?>"};
</script>

https://help.adroll.com/hc/en-us/articles/201974620-Enhanced-Conversion-Tracking-for-Magento

Any ideas?


texts: Magento2 How to add plain text or label in Submenu links as a heading

texts:
Magento2 How can I add a plain text or label in Submenu links as a heading?
For e.g. In Submenu I want to Show as below
Shoes (This is top nav menu)
Following are submenu of Shoes
Sports Shoes (This is heading without any link)
Reebok (This is a link which will redirect to list page)
Addidas (This is a link which will redirect to list page)
In this how can I add Sports Shoes?


texts: Magento 2 How to convert checkout "radio" shipping methods into "dropdown" shipping method?

texts:
Magento 2 Checkout page -
How to convert checkout "radio" shipping methods into "dropdown" shipping method ?


texts: When should I consider a system backup over a normal database backup?

texts: I want to patch my site, but I don't know what kind of backup I should create. Is a simple database backup enough?


texts: How to create "buy now" button which should redirects to onepage checkout

texts:
I am new to magento, using Magento 1.9. with custom theme. I succesfully created buy now button on addtocart.phtml by the following codes:

<button type="button" title="Buy Now" class="button btn-cart" onclick="setcheckoutLocation('<?php echo $this->getAddToCartUrl($_product) ?>')">
    Buy Now
</button>
<?php echo $this->getChildHtml('', true, true) ?>

But am confused in where to paste below javascripts on my view.phtml? can any one say exactly next to which function or step number, I should paste these scripts?

I planned to have 2 buttons,without disturbing eachothers:When someone clicks:

Buynow button which should redirect to checkout/onepage
Add to cart button should do its default checkout/cart

Thanks in advance. Any suggestions are very welcome! :)


texts: Products not showing up when disabled on All Store Views and enabled on Specific Store View

texts:
I've setup a Multistore in Magento 2.1.x
I've placed some products in the stores.

When I create a product I will set enabled to "No".
(This is because there are products that only apply to 1 language, and in the future there will be like 10 languages. So it's easier to enable on specific store views than disable them on specific store views.)

After I save the product, I click it once again so I can select a specific store view.
When I've selected the specific store view I will enable the product.

After re-indexation the product won't show up. (I've cache disabled)
The product shows when I set enabled to yes on "All Store Views", so the configuration of the product is ok.

Am I doing something wrong?


texts:
Using the Table Rate dispatch all the weights of the products are added together and the result is calculated based on the table.

For a specific ecommerce project, where every single product is individually packaged, I would need the shipment to be calculated individually on each product and the added cost (not the added weight)

It's possible? do you need an external module? tips?
thank you!


texts: Magento 2: Errors displaying on setting devolper mode

texts:
On setting developer mode this error is displaying want to find the files which are causing this error what should I do remove this error.

  [2019-02-14 12:58:34] main.INFO: Cache file with merged layout:
  LAYOUT_frontend_STORE1_4e8c25a3874faeb17115e71caadc75f22 and handles
  default, catalog_category_view, catalog_category_view_type_layered,
  catalog_category_view_type_layered_without_children,
  catalog_category_view_id_462: Please correct the XML data and try
  again. Element 'arguments': Missing child element(s). Expected is (
  argument ). Line: 852

Also this error

  Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'move': This element is not expected. Line: 64


texts: Adding external css with attributes in layout?

texts:
I want to add the following css to magento 2 at layout.xml in my theme of header blocks

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">

But how to add "integrity" and "crossorigin" also?

<?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">
    <head>
        <css src="css/style.css"/>
        <css src="https://use.fontawesome.com/releases/v5.1.0/css/all.css" src_type="url"/>
    </head>


texts: Payment Method's name is not displaying in Magento 1.9

texts:
In checkout process when one of payment method is clicked the calculation and everything working fine but in the progress bar the method name is absent(ex. Pay on Delivery, Pay on Card).

It's absent in everywhere including adminhtml's sales section under Payment Information block the output is

  Order was placed using BDT

After debugging what I've understood is

> {{var payment_html}}, getChildHtml('order_payment'), $this->getPaymentHtml()

these fields return empty value!! can anyone help?


texts: Magento 2 : Hide product from product page programmatically

texts:
I want to hide product from product page programmatically as like I want to hide some product image when change dropdown from product page without page load. checkbox checked in admin side.

How to do it?

Thanks in advance.


texts: Order not being created on first submit, but it on second

texts:
I have a strange issue and am looking for advice on how to debug it. Certain orders are not being created on the first submit, but are being created if you hit submit again and it's capturing payment twice. It also removes inventory after the first time, even though no order is created, often resulting in items saying they are out of stock.

Any advice on how to troubleshoot orders not being created after payment has been processed?


texts: Retrieve Compare Items Collection returning zero Items Magento 2

texts:
While I am trying to return compare items in custom module phtml file, it is returning zero items but in database table catalog_compare_item showing all the added items to compare.

Class Used : Magento\Catalog\Model\Product\Compare\ListCompare;

Block File:

     public function __construct(
    ....
    ....
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Catalog\Model\Product\Compare\ListCompare $listCompare,
    array $data = []
    ....
    ) {
    ...
    parent::__construct($context, $data);
    $this->listCompare = $listCompare;
    ...
    }

   public function getObj() {
     return $this->listCompare;
   }

phtml File:

$block->getObj()->getItemCollection();

Returning(1000 items where I have added only two products to compare):

array(1000) {
  [0]=>
  array(11) {
    ["row_id"]=>
    string(1) "1"
    ["entity_id"]=>
    string(1) "1"
    ["created_in"]=>
    string(1) "1"
    ["updated_in"]=>
    string(10) "2147483647"
    ["attribute_set_id"]=>
    string(1) "4"
    ["type_id"]=>
    string(6) "simple"
    ["sku"]=>
    string(17) "product_dynamic_1"
    ["has_options"]=>
    string(1) "0"
    ["required_options"]=>
    string(1) "0"
    ["created_at"]=>
    string(19) "2018-03-11 07:45:25"
    ["updated_at"]=>
    string(19) "2018-03-11 07:45:25"
  }

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Also, I have tried with class \Magento\Catalog\CustomerData\CompareProducts

Using the method below mention method..
$ClassObj->getSectionData();

Returning:

array(4) {
  ["count"]=>
  int(0)
  ["countCaption"]=>
  object(Magento\Framework\Phrase)#1858 (2) {
    ["text":"Magento\Framework\Phrase":private]=>
    string(8) "%1 items"
    ["arguments":"Magento\Framework\Phrase":private]=>
    array(1) {
      [0]=>
      int(0)
    }
  }
  ["listUrl"]=>
  string(100) "http://127.0.0.1/m217ee/catalog/product_compare/index/uenc/aHR0cDovLzEyNy4wLjAuMS9tMjE3ZWUvbGVhcm4,/"
  ["items"]=>
  array(0) {
  }
}


texts:
I am generating an excel report which takes around 10-25mins based on user selection. Page is served to admins only.

When user presses export button after selecting filters, I am trying to call action method using CURL and timeout curl call to make this process asynchronous. At the end of process an email is generated to let user know that file is exported.No response from script needed.

However, I am unable to call action method using below code. CURL is working for other sites (tested with google). Error returned is 403, although I can directly access the URL from browser and it works.

This code is present inside a controller action which is triggered by export button, same controller contains "exportorders".

    $url = $this->getUrl('*/*/exportorders’);
    $c = curl_init();
    curl_setopt($c, CURLOPT_URL, $url);
    curl_setopt($c, CURLOPT_POST, 1);
    curl_setopt($c, CURLOPT_RETURNTRANSFER, true);  // Return from curl_exec rather than echoing
    curl_setopt($c, CURLOPT_FRESH_CONNECT, true);   // Always ensure the connection is fresh

    // Timeout super fast once connected, so it goes into async.
    curl_setopt( $c, CURLOPT_TIMEOUT, 1 );

    curl_exec( $c );
    $curlInfo = curl_getinfo($c);
    curl_close($c);

    if($curlInfo['http_code'] == 200){
      $success = ‘Process successfully running’;
    }

    $this->_redirectReferer();


texts: Append My shipping address country in my order Id as prefix

texts:
I want to append the shipping address country code as a prefix in my Order Id. For example, my order Id is 20191107 and My shipping country is the United state. So, my order id will be US20191107.
I am totally new to Magento 2. Can you let me know how can I achieve this feature with a detail explanation?

Thanks


texts: Hackathon Magento Honey Spam , on a custom form?

texts:
I have been having the problem with spam bots constantly filling "ask a question about the product" form on our product page (this send us an email of the question).  Most as recommend "Hackathon Magento Honey Spam" which I installed, but when I went to test it, the guide says:

  After the Installation you should be able to find an input field with the id="url" in the Customer Register and in the Product Review Form, which should be hidden with our JS.

But I can't find any "url" in the form, so does not seem to be working right (but the options for the honeypot are showing in the back end.  Can this be used for other forms other than contact and newsletter?

Update: Found this on Github closed issues

  Add something like this to your layout XML so that the HoneySpam template is loaded in your form_fields_before section. Then, you may have to implement something like this if your contact form does not use the default contacts/index/post route.

https://github.com/magento-hackathon/HoneySpam/issues/26


texts: Change Form "pending_payment" to "processing"

texts:
With PayPal-Payment Magento works with a "pending_payment".
This is the state the order gets if the customer is placed the order but is not ready with the payment;

Most times PayPal-Payment succeeds, so the "pending_payment" goes with IPN (Instant Payment Notification) to "processing". In some times the PayPal-Payment is been interrupted (customer bank account run out of money). This orders will be canceled.

In few times PayPal succeeds but the IPN is not working, so we find a Payment in PayPal account, but the order stucks to "pending_payment".
HOW CAN WE CHANGE THE STATE MANUALLY (backend or php).

Thanks


texts:
$collection = $observer->getOrderGridCollection();

//get the attribute id of our custom eav
$attributeId = Mage::getResourceModel('eav/entity_attribute')
    ->getIdByCode('catalog_product', 'custom_attribute');

$select = $collection->getSelect();
//join eav value to order grid
$select->join('catalog_product_entity_int', '`catalog_product_entity_int`.entity_id=`main_table`.entity_id AND `catalog_product_entity_int`.attribute_id = ' . $attributeId,
    array('custom' => 'value'));

I want to add a yes/no column to sales order grid,

base on whether the order contains product that has custom attribute > certain number value

I currently have above observer for salesOrderGridCollectionLoadBefore, but it only display custom attribute value of first product,

how do I accomplish what I want?


texts: How to get product_has_weight field value in frontend with product object?

texts: How can i get below product attribute value in frontend ?


texts: Does Magento have a default category ID for all "New" products regardless of main category?

texts: I would like to have a "New" products carousel on my home page.  I've got them for other items in specific categories but I would like one that lists all items that are new regardless of category.


texts: How to place order with custom payment gateway module using JS / Ajax?

texts:
I am integrating a custom payment gateway module in Magento 2.
How can I use  JS/ajax on the checkout page on click of place order trigger some js event?

As I need to pop-up a modal on click of place order and prevent the submission from creating the order and check for payment response with js and then submit the checkout form with payment response.

Any Idea how this is possible ?


texts: Added a product as configurable but is is showing as simple? Can I change it?

texts: Using Magento 2. Definitely not an expert but I added a product and selected add configurable, however, once I clicked saved, it was listed as a simple product?


texts: Magento 2: Get custom attribute into order confirmation email

texts:
I have added the following code

<?= /* @escapeNotVerified */  __('MSG') ?>: <?= $status_new = $_item->getProduct()->getAttributeText('extra_info') ?>

Into
  \app\design\frontend\Master\version1\Magento_Sales\templates\email\items\order\default.phtml

After SKU in an order confirmation email to make it visible after each item in the order confirmation email. But for some reason data is not visible, do I have to add some code or something elsewhere to fetch custom attribute into order confirmation email >


texts: How to change advanced search result page layout?

texts:
My advanced search result page have 2 page columns but have an empty column on the right side. I wanna change on local.xml but I don't know how to. Can you help me?

<catalogsearch_advanced_index>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference> </catalogsearch_advanced_index>


texts: update product programmatically magento 2

texts:
Whats wrong in my following code ? I am using a script to insert and update product details using csv. Products are inserting / updating without any issues. But only after updated a product...

I changed the status to Enabled. When I change it, The status changed and I am able to see the changes on edit page. But in the product grid, still It says, Disabled. Also the product is not displaying on front-end.

I cleared the cache and reindexed it. Here is my code.

$product_name = 'test product';
$sku = 'abc-123';
// if existing product update it, else insert the product
if ($productModel->getIdBySku($sku)) {
    $product = $productRepository->get($sku);
    array_push($arrUpdatedProducts, $sku);
    $product->setData('is_new_product', 5);
} else {
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
    $product = $objectManager->create('\Magento\Catalog\Model\Product');
    $product->setSku($sku); // Set your sku here
    $product->setName($product_name); // Name of Product
    $product->setAttributeSetId(4); // Attribute set id
    //$product->setStatus(1); // Status on product enabled/ disabled 1/0
    $product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED);
    $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE);
    $product->setVisibility(4); //Catalog, Search // visibilty of product (catalog / search / catalog, search / Not visible individually)
    $product->setTaxClassId(0); // Tax class id
    $product->setTypeId('simple'); // type of product (simple/virtual/downloadable/configurable)
    $product->setPrice(0);
    $product->setWebsiteIds(array(1));
    $product->setData('is_new_product', 4); // Yes
    $product->setStockData(
        array(
            'use_config_manage_stock' => 0,
            'manage_stock' => 1,
            'is_in_stock' => 1,
            'qty' => 11
        )
    );
}
$product->save();

$indexer = $this->indexerFactory->create();
$indexerCollection = $this->indexerCollectionFactory->create();
$ids = $indexerCollection->getAllIds();
foreach ($ids as $id){
    $idx = $indexer->load($id);
    if ($idx->getStatus() != 'valid'){
        $idx->reindexRow($id);
    }
}


texts: Create order progamatically with all parameter in magento 2?

texts:
I am working on data migration from Oracle DB  database to Magento 2 database so I need to create CSV template for getting data in our format.

while creating order, how we can cover all these things such as: store,customer, csvproduct,shipping and payment methods.
I want to create CSV template/single insert query so how I can create order programmatically.


texts:
I have installed Magento 2.4 community version, and here I went to the admin panel and tried to log in and its show like this.

Any help will be appreciated!


texts: Magento 1.9 - Transactional Email Issues

texts:
Issues with transactional emails:

I have completed several test scenarios around this, but in summary, I am having some serious issues with transactional emails!

The seem to be coming through on outlook, but when my phone synced it deletes any email that has come from the website, be it my test orders, order confirmation emails and even contact us forms.

I have removed all email accounts from my S7 phone and tried reinstating one of them to test this and when the phone synced it deleted the email and also removed it from outlook too - still having ongoing issues.

Can someone provide some expertise around issues like this??
I rely on getting email notifications to my phone.


texts: Unable to sort Customer address collection

texts:
I have an attribute in eav_attribute "group_id" for customer/address, I am trying to sort my collection by this attribute.What I am doing is.

$customer = Mage::getSingleton('customer/session')->getCustomer();
$addresses = $customer->getAddressesCollection();
$addresses->addAttributeToSort('group_id', 'DESC');

I have also tried following, but nothing is working.

$addresses->getSelect()->order('group_id', 'DESC');

And

$addresses->setOrder('group_id', 'DESC');


texts: Magento Performance: How to use several subdomains (static1-3) for static assets?

texts:
is there an easy way to add subdomains to the URLs of my static assets (JS, CSS, images) in Magento? What I am looking for is a way to change an url like this

http://store.com/js/script.js

to this

http://static1.store.com/js/script.js

The number behind 'static' should be rand(1,3).

The reason I want that is of course performance. By spreading assets over several domains browsers load them faster since they are restricted to load not more than 2 files from one domain at a time.

I know there exists a plugin for Wordpress and I would like to do it for Magento.

This whole thing has to happen server side, so before any html is generated.

Thank you for your input!


texts: Place order button not working with stripe stored credit cards Magento 2

texts:
I've integrated stripe as payment method in onepagecheckout magento 2
But seems something wrong as "Place order" button is not working with the "Stored stripe cc cards"
https://prnt.sc/rp70pl
"Place order" button is clickable , although it sends request to payment-information api
but order does'nt get placed.
Any thoughts on this ?


texts: Magento 2.3 Checkout success page 302 not found

texts:
I am running Magento 2.3 and at the last stages of testing before going live. I have a problem with checking out, i add items into the cart, press check out, fill in the information, select payment method and hit place order
this should go to the success page but it redirects back to the cart with no order in admin.

I've tried the usual commands as per forums but nothing's worked.


texts:
I am trying to replace the customer.login.container on the login page, which can be done through customer_account_login.xml by adding something like:

<referenceContainer name="customer.login.container" remove="true" />

However, I need to set a config condition (similar to ifconfig for blocks), where I will remove this container if a certain config is true, and replace it with another container/blocks. If the config is false, the original page should remain untouched.

I have tried overriding the toHtml method in the login class, but get strange results and it's probably not the best way to do this. Is it possible to do this through the XML files alone? If not, what's the most harmless way to intervene here without removing existing Magento functionality or creating an observer / any kind of action that waits for the original container to load and only then makes changes?


texts:
Google AMP is a massive failure. I have seen my engagement and click rates all go down atleast 30% across all my sites, and one site is down 50% from when I installed AMP. I have it now for 7 months and no improvement.

I am using the Plumrocket extension with Magento 2.3. My plan is to disable the Plumrocket extension, and then use HTACESS to redirect all the AMP pages to my pages.

Which htaccess code should I use:

Option 1:

# Redirect from AMP to non-AMP page
RewriteRule ^(.*)\/amp$ $1 [R=301,L]

Options 2:

// Redirect AMP to non-AMP
RewriteEngine On
RewriteCond %{REQUEST_URI} (.+)/amp(.*)$
RewriteRule ^ %1/ [R=301,L]


texts: How to display all the attribute values of product attribute?

texts:
I'm new to Magento and I'm developing E-commerce site in Magento 2.

I have created an attribute "Power Type" (MultiSelect) and gave 4 options to it and assigned it to "default" Attribute set.

I created a product with "default" attribute selected and selected 3 options from the 4 options given in "Power Type" attribute.
Now when I show these options on Product view,

I want to show all of them with the option that is not selected to be grayed out.

Right now I'm using following code in my phtml file to retrieve the attribute values

$_powertypes = $_product->getAttributeText("power_types");

Above code gives me value of that attribute that is for a product selected. I want all the four options that were made during the creation of attribute.

Thanks in advance.


texts: Rest Api. How to control attribute in api2.xml with attribute rules when attribute contains the attributes array of object in other table

texts:
My JSON string like this:

{
  "id": "74",
  "created_at": "2015-07-22 09:36:57",
  "created_by": "1",
  "updated_at": "2015-07-22 09:36:57",
  "updated_by": "1",
  "store": {
    "group_id": "1",
    "website_id": "1",
    "name": "Main Website Store",
    "root_category_id": "2",
    "default_store_id": "1",
    "group": [
      {
        "id": "4",
        "name": "group 4 - store web 2",
        "description": null,
        "level": "1",
        "product": [
          {
            "id": "1",
            "created_at": "2015-07-20 07:54:07",
            "created_by": "1",
            "updated_at": "2015-07-20 07:54:07",
            "updated_by": "1"
          },
      }
    ]
  }
}

it's mean in House have one "store", in "store" have many "group" and in "group" have many "product".
I tried adding the attributes as group, product to file api2.xml to manage in the Edit attribute rules but it does not work when I unchecked.
"group", "product" are on the table different database.

My api2.xml:

<config>
    <api2>
        <resource_groups>
            <house translate="title" module="Hihi_House">
                <title>House API Call</title>
                <sort_order>20</sort_order>
            </house>
        </resource_groups>
        <resources>
            <house translate="title" module="Hihi_House">
                <group>house</group>
                <model>hihi_house/api2_house</model>
                <title>House API</title>
                <sort_order>10</sort_order>
                <privileges>
                    <customer>
                        <retrieve>1</retrieve>
                    </customer>
                </privileges>
                <attributes>
                    <id>Id</id>
                    <name>Name</name>
                    <store>Store</store>
                    <group>Group</group>
                    <product>Product</product>
                    <created_at>Created At</created_at>
                    <created_by>Created By</created_by>
                    <updated_at>Updated At</updated_at>
                    <updated_by>Updated By</updated_by>
                </attributes>
                <routes>
                    <route_entity>
                        <route>/house</route>
                        <action_type>entity</action_type>
                    </route_entity>
                    <route_collection>
                        <route>/house/list</route>
                        <action_type>collection</action_type>
                    </route_collection>
                </routes>
                <versions>1</versions>
            </house>
        </resources>
    </api2>
</config>

Thanks!


texts: onepage checkout order successful page is blank no errors


texts: Getting all subcategories and their products

texts:
I tried to get on my parent categories all the subcategories and products for each subcategories.
This is my products.phtml

<?php
$subcats = $this->getCategoryList();
?>

    <?php
    foreach ($subcats as $subcat) {
        if ($subcat->getIsActive()) {

            $subcat_url = $subcat->getUrl();
            $subcat_img = "";
            $placeholder_img = "/media/placeholder.png";

            ?>

                <a href="<?php echo $subcat_url; ?>">
                    <img src="<?php echo $subcat->getImageUrl() ? $subcat_img : $placeholder_img; ?>">

<?php echo $subcat->getName(); ?>

            <?php
            $allcategoryproduct = $this->getProducts($subcat);
            foreach ($allcategoryproduct as $product){
                ?>

                <a href="<?php echo $subcat_url; ?>">
                    <img src="<?php echo $product>getImageUrl() ? $subcat_img : $placeholder_img; ?>">

<?php echo $product>getName(); ?>

                <?php

            } ?>
            <?php
        }
    } ?>

and here is my block view.php

<?php
namespace Name\Categorylist\Block\Category;

use Magento\Framework\View\Element\Template;

class View extends \Magento\Catalog\Block\Category\View
{
    protected $_coreRegistry = null;

    public function __construct(
        Template\Context $context,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver,
        \Magento\Framework\Registry $registry,
        \Magento\Catalog\Helper\Image $image,
        \Magento\Catalog\Helper\Category $categoryHelper,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Catalog\Model\CategoryFactory  $categoryFactory,
        array $data = array())
    {
        parent::__construct($context, $layerResolver, $registry, $categoryHelper,$data);
        $this->_categoryFactory = $categoryFactory;
        $this->_productCollectionFactory = $productCollectionFactory;
        $this->image = $image;
     }

    public function getCategoryList()
    {
      $_category  = $this->getCurrentCategory();
      $collection = $this->_categoryFactory->create()->getCollection()->addAttributeToSelect('*')
              ->addAttributeToFilter('is_active', 1)
              ->setOrder('position', 'ASC')
              ->addIdFilter($_category->getChildren());
      return $collection;

    }
    public function getCategoryThumbImage($imageName) {
    $mediaDirectory = $this->_storeManager->getStore()->getBaseUrl(
                \Magento\Framework\UrlInterface::URL_TYPE_MEDIA
            );
        return  $mediaDirectory.'catalog/category/'.$imageName;

    }

    public function getPlaceholderImage(){
        return $this->image->getPlaceholder('image');
    }

    public function getProducts($category)
    {
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addCategoryFilter($category);
        $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        return $collection;
    }
}

The result show me the subcategories, but I can't get the products.
The only way I have found to get an echo of the product is with

  $allcategoryproduct->getData();

but then it show only few informations and can't get the name / price etc...
I think I miss something to echo a collection but can't find what.

Thank you.


texts: Magento: Can't insert image using WYSIWYG editor in Mozilla

texts:
I have implemented editor on content in Admin panel and it is working fine on both frontend and backend in chrome browser, also for insert image. But insert an image in content using editor is not working in Mozilla browser. I have also provided 777 permission recursively to media folder.

Please check my below code.

Edit/Tab/Form.php
            protected function _prepareLayout()
            {
                    parent::_prepareLayout();

                    $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);

            }

           protected function _prepareForm()
           {
             $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('add_variables' => false, 'add_widgets' =>          false,'files_browser_window_url'=>$this->getBaseUrl().'admin/cms_wysiwyg_images/index/'));

                $fieldset->addField('contents', 'editor', array(
                    'name' => 'contents',
                    'label' => $this->__('Content'),
                    'title' => $this->__('Content'),
                    'style' => 'width:700px; height:300px;',
                    'config' => $wysiwygConfig,
                    'required' => true,
                    'wysiwyg' => true
                ));
        }

In layout xml:
    <default>
                <reference name="head">
                <action method="setCanLoadExtJs"><flag>1</flag></action>
                <action method="setCanLoadTinyMce"><flag>1</flag></action>
                <action method="addJs"><script>mage/adminhtml/variables.js</script></action>
                <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
                <action method="addJs"><script>lib/flex.js</script></action>
                <action method="addJs"><script>lib/FABridge.js</script></action>
                <action method="addJs"><script>mage/adminhtml/flexuploader.js</script></action>
                <action method="addJs"><script>mage/adminhtml/browser.js</script></action>
            [![enter image description here][1]][1]    <action method="addJs"><script>prototype/window.js</script></action>
                <action method="addJs"><script>prototype/prototype.js</script></action>
                <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
                <action method="addItem"><type>skin_css</type><file>lib/prototype/windows/themes/magento.css</file></action>
                </reference>
        </default>

Please help me to resolve this issue.


texts: How to store product data in magento store?

texts:
I'm getting product data through an api call and now i want to store this data in my magento store? can anyone help me out to store without duplication

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://magento.com/component/controller.php",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "appid: 9",
    "appkey: 0325615546",
    "cache-control: no-cache",
    "data: {   \"1474614118_1\": [ \"147461411870027\",\"147461411870027\"]    }",
"functionname: get_products_by_ids",
"postman-token: fd83165f-51e2-4e26-c15f-df5aba3250d7"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Respose:

"data": {
    "get_products_by_ids": [
      {
        "product_id": 0,
        "name": "Fresco 2 pc",
        "description": "Light Weight  Cotton Blend Fabric 2 Pc. White color kameez with round neck, full sleeves, embroidery on the front paired with shalwar.",
        "meta_title": "Fresco 2 pc",
        "meta_description": "",
        "meta_keyword": "",
        "tag": "1474614118",
        "model": "E02516-WHT",
        "sku": "1474614118E02516-WHT",
        "upc": "1474614118",
        "ean": "1474614118",
        "jan": "1474614118",
        "isbn": "",
        "mpn": "1474614118",
        "location": "",
        "quantity": "0",
        "stock_status": "Out Of Stock",
        "image": "http://www.wearego.com/image/catalog/eid2/E02516-WHT.JPG",
        "manufacturer_id": null,
        "manufacturer": null,
        "price": "3950.0000",
        "special": "1580.0000",
        "reward": null,
        "points": "0",
        "tax_class_id": "14746141180",
        "date_available": "2016-09-08",
        "weight": "0.50000000",
        "weight_class_id": "14746141181",
        "length": "0.00000000",
        "width": "0.00000000",
        "height": "0.00000000",
        "length_class_id": "14746141181",
        "subtract": "1",
        "rating": 0,
        "reviews": 0,
        "minimum": "1",
        "sort_order": "1",
        "status": "1",
        "date_added": "2016-09-08 23:03:57",
        "date_modified": "2016-09-08 23:03:57",
        "viewed": "3899",
        "vendor_id": "1474614118",
        "addtionalimages": [
            {
                "product_image_id": "14746141184247",
                "product_id": "147461411870027",
                "image": "http://www.wearego.com/image/catalog/eid2/E02516-WHT-01.JPG"
            },
            {
                "product_image_id": "14746141184248",
                "product_id": "147461411870027",
                "image": "http://www.wearego.com/image/catalog/eid2/E02516-WHT-02.JPG"
            }
        ],
        "options": [],
        "categories": []
      }
]

}


texts:
I have installed a extension for news blog from https://www.magentocommerce.com/magento-connect/news-by-commercelab.html
After installing this extension the admin menus are not working now .
Please tell me any solution .
Thank you


texts:
I am trying to add opengraph on my website manually. I found the tutorial and it works like a charm... but only for Facebook. You can view the tutorial here: http://naileditdesign.com/facebook-open-graph-meta-tags-in-magento/. I want it to work on Pinterest as well, but it is missing some key aspect, such as Price & Currency tag. Do you know what lines of code I can add so it also works on the pinterest, rather than only on facebook.

<?php /* Open Graph Protocol for Facebook and SEO START */ ?>
<?php if(Mage::registry('current_product')): ?>
 <?php $product = Mage::registry('current_product'); ?>
 <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
 <meta property="og:type" content="product" />
 <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
 <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
 <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
 <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
<?php elseif(Mage::registry('current_category')): ?>
 <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
 <meta property="og:type" content="product.group" />
 <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
 <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
 <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
<?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
 Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
 <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
 <meta property="og:type" content="website" />
 <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
 <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
 <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
<?php else: ?>
 <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
 <meta property="og:type" content="article" />
 <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
 <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
 <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
<?php endif; ?>
<?php /* Open Graph Protocol for Facebook and SEO END */ ?>

I know I am only missing couple of lines: Price and currency code, If some body can help me out, that would be great.
Thanks.


texts: Magento 2 showing notification again and again even after page refresh

texts:
Magento2
Notification is showing again and again even after page refresh while should show only one time and should hide on page refresh.
Please anybody can help to fix this.


texts: Where are class constructor parameters defined in Magento2?

texts:
If you see AbstractExpress class for PayPal payment method, you could see:

/**
 * @param \Magento\Framework\App\Action\Context $context
 * @param \Magento\Customer\Model\Session $customerSession
 * @param \Magento\Checkout\Model\Session $checkoutSession
 * @param \Magento\Sales\Model\OrderFactory $orderFactory
 * @param \Magento\Paypal\Model\Express\Checkout\Factory $checkoutFactory
 * @param \Magento\Framework\Session\Generic $paypalSession
 * @param \Magento\Framework\Url\Helper\Data $urlHelper
 * @param \Magento\Customer\Model\Url $customerUrl
 */
public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Customer\Model\Session $customerSession,
    \Magento\Checkout\Model\Session $checkoutSession,
    \Magento\Sales\Model\OrderFactory $orderFactory,
    \Magento\Paypal\Model\Express\Checkout\Factory $checkoutFactory,
    \Magento\Framework\Session\Generic $paypalSession,
    \Magento\Framework\Url\Helper\Data $urlHelper,
    \Magento\Customer\Model\Url $customerUrl
) {
    $this->_customerSession = $customerSession;
    $this->_checkoutSession = $checkoutSession;
    $this->_orderFactory = $orderFactory;
    $this->_checkoutFactory = $checkoutFactory;
    $this->_paypalSession = $paypalSession;
    $this->_urlHelper = $urlHelper;
    $this->_customerUrl = $customerUrl;
    parent::__construct($context);
    $parameters = ['params' => [$this->_configMethod]];
    $this->_config = $this->_objectManager->create($this->_configType, $parameters);
}

The question is: how does the system know which parameters to pass to constructor and of what type?  I think they are defined somewhere, but I have looked at di.xml files of this module but I have only find this:

<type name="Magento\Paypal\Controller\Express\AbstractExpress">
    <arguments>
        <argument name="paypalSession" xsi:type="object">Magento\Paypal\Model\Session</argument>
    </arguments>
</type>

Only payPal Session appears (although of different type).


texts: Poblem with filtering price in custom report grid in magento

texts:
every time I filter for that subtotal column, it turns into admin homepage

public function __construct()
{
    parent::__construct();
    $this->setId('icube_reportendorsement_grid');
    $this->setDefaultSort('invoice_id');
    $this->setDefaultDir('DESC');
    $this->setUseAjax(true);
    $this->setFilterVisibility(true);
}

protected function _prepareCollection()
{
    $collection = Mage::getModel('sales/order_invoice')->getCollection();
    $orderTable = Mage::getSingleton('core/resource')->getTableName('sales_flat_order');
    $customerTable = Mage::getSingleton('core/resource')->getTableName('customer_entity');

    $collection->addFieldToFilter('order.customer_id', array('neq' => NULL));
    $collection->addFieldToFilter('main_table.entity_id', array('neq' => NULL));
    $collection->addFieldToFilter('customer.group_id', 4);

    $collection->getSelect()->joinLeft(
                array('order' => $orderTable), 'order.entity_id = main_table.order_id',
                array('customer_firstname' => 'order.customer_firstname',
                        'customer_lastname' => 'order.customer_lastname',
                        'total_qty_ordered' => 'total_qty_ordered'))
                        ->joinLeft(
                array('customer' => $customerTable), 'order.customer_id = customer.entity_id',
                array('customer_email' => 'customer.email'));

    $this->setCollection($collection);
    parent::_prepareCollection();
    return $this;

}

protected function _prepareColumns()
{
    $currency = (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE);

    $this->addColumn('customer_firstname', array(
        'header'    => Mage::helper('icube_report')->__('First Name'),
        'index'     => 'customer_firstname',
        'sortable'  => 'true'
    ));

    $this->addColumn('customer_lastname', array(
        'header'    => Mage::helper('icube_report')->__('Last Name'),
        'index'     => 'customer_lastname',
        'sortable'  => 'true'
    ));

    $this->addColumn('customer_email', array(
        'header'    => Mage::helper('icube_report')->__('Email'),
        'index'     => 'customer_email',
        'sortable'  => 'true'
    ));

    $this->addColumn('invoice_id', array(
        'header'    => Mage::helper('icube_report')->__('No. of Invoice'),
        'index'     => 'entity_id',
        'sortable'  => 'true'
    ));

    $this->addColumn('subtotal', array(
        'header' => Mage::helper('icube_report')->__('Subtotal'),
        'index'  => 'subtotal',
        'type'      => 'currency',
        'currency' => $currency,
        'filter_condition_callback' => 'filter_subtotal',
    ));

    $this->addColumn('total_qty_ordered', array(
        'header'    => Mage::helper('icube_report')->__('Total Qty (pcs)'),
        'index'     => 'total_qty_ordered',
        'sortable'  => 'true'
    ));

    $this->addExportType('*/*/exportReportendorsementCsv', Mage::helper('icube_report')->__('CSV'));

    return parent::_prepareColumns();

}

public function getGridUrl()
{
    return $this->getUrl('*/*/grid', array('_current'=>true));
}


texts: Getting conversion values from the new Facebook Pixel

texts:
I'm looking at running some Facebook Ad Campaigns and wanted to install the new Facebook Pixel onto my Magento website.

I'm in Marketing so my coding skills are limited, I normally setup tags in Google Tag Manager for scripts such as this, however from what I can tell, it looks as though to capture events such as (Add to Cart, Successful Sales) I'd have to add in some custom code to the Pixel script and possibly in my Magento code.

Before I get into doing this I just wondered if there are any extensions or easier/ non coding ways to pull in the ecommerce conversion data (Transaction amounts)?


texts: change product detail based on configurable product dropdown

texts:
In both the above images, the size

  (Twin XL,Twin, Full, etc)

is selected and the above size of the product changes dynamically as (39x80x12),(54x75x12).

I tried to make changes in the configurable.php, wrapper.phtml, renderer.phtml and also in the configurable.js but I couldn't get a solution for this.
Is theres a way to make it possible to display the size dynamically based on the drop down of size?


texts: Magento Additional Information Attributes icon instead text

texts:
I think that my question yesterday was a bit confusing, so today I'm asking again. In my magento shop I wan't to display icons instead text for product attributes. Attributes that we found under additional information, as you can see below. Code that generates attributes with corresponding values is below:

<?php foreach ($_additional as $_data): ?>

    <?php echo $this->htmlEscape($this->__($_data['label'])) ?>
    <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

Thanks for any suggestions.


texts: Deploying a Magento Store from a live server to XAMPP/WAMP

texts:
Hi so I need to make some drastic changes to my live site and it looks like I'll have to take it local to make these changes using XAMPP or WAMP.

So far I have taken all of the files from my server and got myself a database backup via the Magento admin.

I have now put all the files into a folder within my htdocs and i'm not sure what I do from here?

I am having trouble understanding the database, because I obviously need to add it to XAMPP to get all of my store running how it should however I have no idea how I assign the folder that contains my store the database.

Also what other steps are there?

I have taken a look around Google and I cant seem to find a way of taking a live site and making it local.

Could someone possibly describe the steps of doing this using XAMPP or WAMP?


texts: What does "catalog_category_view_type_default_without_children.xml" do exactly?

texts:
What does the layout file "catalog_category_view_type_default_without_children.xml" do exactly?

From the name of the file it sounds like it's purpose is to allow you to customize the layout of categories that have no child categories of their own. I'm looking to accomplish just that, but I can't get this file to do anything.

I've placed it within my child theme folder, /app/design/frontend/my-vendor/my-theme/Magento_Catalog/layout/catalog_category_view_type_default_without_children.xml

The I tried adding a container to the layout by editing the file and adding:

    <referenceContainer name="main">
        <container name="childtest" htmlTag="div" htmlClass="test">
          <block class="Magento\Framework\View\Element\Template" name="test.block" template="Magento_Theme::test.phtml"/>
        </container>
    </referenceContainer>

But it doesn't work, it makes no changes to my pages that use my custom catalog_category_view.xml

I also tried removing reference blocks and that had no effect. Does "catalog_category_view_type_default_without_children.xml" not have any effect on "catalog_category_view.xml"?


texts: Creating credit memo does not change order grand total?

texts:
I have added extra fee in the checkout page and save it to the database but when I go to credit memos the extra fee is shown in Credit memo totals but the grand total is not updated

This is my config.xml file

 <blocks>
      <adminhtml>
         <rewrite>
            <sales_order_creditmemo_totals>My_Module_Block_Adminhtml_Sales_Order_Creditmemo_Totals</sales_order_creditmemo_totals>
         </rewrite>
      </adminhtml>
    </blocks>


texts: Magento 1.9 product page show 404 error not found

texts: i removed categories URL from product URL now when i access product which is assign to multiple categories generate 404 error but products which assign to only category working fine any help ?