texts: Adding custom attribute programatically no entry in eav_attribute table

texts:
\Custom\Attribute\etc\module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Custom_Attribute" setup_version="2.2.0">
    <sequence>
        <module name="Magento_Catalog"/>
    </sequence>
</module>
</config>

\Custom\Attribute\registration.php

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

Custom\Attribute\Setup\InstallData.php

<?php
namespace Custom\Attribute\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
private $eavSetupFactory;

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

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'sample_attribute',
        [
            'type' => 'int',
            'backend' => '',
            'frontend' => '',
            'label' => 'Sample Atrribute',
            'input' => '',
            'class' => '',
            'source' => '',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => true,
            'user_defined' => false,
            'default' => '',
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]
     );
  }
}

Cleared var/gen

Ran setup upgrade.

No logs.

No entry in eav_attribute.


texts: Apply new exception theme for I-Pad portrait mode

texts:
I have a requirement where my client gives me different design for I-Pad portrait mode And tell me that no need to change design for landscape mode.

So I need to know what is the user agent matched expression for I-Pad portrait mode


texts: set custom limit for pagination magento2

texts:
how can i set the custom limit for pager. this is adding the limit in page and page is showing but the dropdown on limit is not showing on page how to dropdown of limit on Custom Collection.

->setAvailableLimit(array(1=>1,2=>2,3=>3))

i tried this but not working

public function getAvailableLimit()
    {
        return array(1=>1,2=>2,3=>3);
    }


texts: How do i remove the free shipping showing on my home page

texts: How do i remove the free shipping showing on the top of my home page.  I want to remove this


texts:
I found 2 website references for creating a custom grid.

https://ranasohel.me/2014/04/20/creating-magento2-adminhtml-grid/

http://www.mage-world.com/blog/grid-and-form-in-magento-2-admin-panel-part-1.html

The first link tutorial grid created like sales > order and the second link website tutorial of the grid is like report > order total grid in magento2.
what is the difference between their tutorials to create a custom grid?
Any limitation or benefit of the tutorials to create a grid?


texts:
I have installed the plugin Youtube Video Gallery from magentocommerce.com. There seems to be a problem, I can acces the gallery page only from a store with the deafult package, but not from the one I have created. Also I enabled the Template Path Hints from admin, and I there isn't the plugin template file listed on the page. What could be the problem?

If needed any file listings just say...


texts: How to change the list mode in a block call

texts:
Is there a way to change the default list mode directly in a block call as shown bellow:

{{block
  type="catalog/product_list"
  name="home.catalog.product.list"
  alias="products_homepage"
  category_id="15"
  mode="list"
  template="catalog/product/featuredHome.phtml"
}}

The code above has a attribute mode="list" that I've found referenced in a few posts, but it doesn't seem to work in the current version CE1.9.

Any alternative to this?

Thanks.


texts: display uploaded image in custom page in admin grid

texts:
I want to display an uploaded image in a custom page in admin grid at is shown in 1 picture and want to display in 2 picture

<field name="customization_attachment">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">file</item>
                <item name="label" translate="true" xsi:type="string">Attachment</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">Product</item>
                <item name="disabled" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">70</item>
                <item name="dataScope" xsi:type="string">customization_attachment</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">false</item>
                </item>
            </item>
        </argument>
    </field>

through this code image name is coming as shown in photo i want to display image


texts: Magento 2: Global variable doesn't work with RequireJS

texts:
I'd create a HTML document with a script tag and add this URL

<script src ="https://assets.pagar.me/pagarme-js/3.0/pagarme.min.js"></script>

so, call the global variable pagarme in console browser.

I got this response:

{client: {…}, postback: {…}, company: {…}, validate: ƒ, search: ƒ, …}

But in Magento 2, I always receive error messages.

Below some files with my configuration:

requirejs-config.js

var config = {
    map: {
        '*': {
            pagarmeJs: 'https://assets.pagar.me/pagarme-js/3.0/pagarme.min.js'
        }
    },
    shim: {
        "pagarmeJs": {
            exports: "pagarme"
        }
    }
};

jsFileWithTheCallingCode.js - first try

define(
    ['pagarmeJs'],function (pagarme) {...})

jsFileWithTheCallingCode.js - second try

define(
    ['pagarmeJs'],function () {...})

As mentioned above, if I try to insert the pagarme variable on the console or use inside the require function I always get error messages.

Can anyone help me?


texts:
For some reason the template path hints are not displayed.

I went to the admin panel and turned them off and on again, then cleared the cache. But they are still not displaying.

How can I debug/solve it?


texts: How can i add two Manageable Banner section for Advertisement in front-end

texts: How can i add two  Manageable Banner section for Advertisement in below the slider and above the new products


texts: Wrong URL returned by WYSIWYG editor for images

texts:
I've noticed a weird behavior from the WYSIWYG editor in the product description. Whenever I insert an image it will output

while in another context, such as static blocks editing, it would output

This results in displaying

which is obviously not what I want.

I've searched on different topics, and no one seems to have that specific problem. Did anyone come across this, does anyone have a fix?


texts: Where do you go in your files to change the default text size?

texts: I am working on going through the products and making all of the descriptions look the same, and I have been using the wysiwyg editor to change the text size. I was wondering if there was somewhere in the files I could go to change the font size each time I write a new description.


texts: How to edit and change checkout field labels in Magento 2?

texts:
Is there a way that I can edit or change the State/Province and Zip/Postal Labels to County and Postcode as I am working on UK based website.

I searched a lot in vendor/magento/module-checkout/ files and folders but I couldn't get anything where I can edit or change the labels.

I also tried to change the labels after moving vendor/magento/module-checkout/i18n/en_US.csv file to app/code/Magento/module-checkout/i18n/en_US.csv and then Clearing the var/cache and var/page_cache folder, but no success.

Can someone just guide me how to do that?


texts: Is there a instagram module for magento to fetch images from either hastag or userid with filtering option

texts:
The business requirement on my case is to filter from the feed. If it won't be the case i could have use instafeed.js to fetch post and show. But i couldn't find anything relevent to filtering from the backend before appearing on frontend ?

What i am looking for is, a module that will fetch images suppose all images with #graduation hastagged, and on backend, the admin will select which to show. Because people can tag anything inappropriate with the same tag then it will appear on frontend.

So before those feeds being posted on homepage, those which the admin will select will only appear.


texts: Add condition rule to collection product in Magento 2

texts:
I want to add condition rule in the collection product. How to do that. Hope someone help me.[![

public function getLoadedProductCollection()
{
        $this->_limit = (int) $this->getWidgetCfg('limit');
        $type = $this->getTypeFilter();
        $fn = 'get' . ucfirst($type) . 'Products';
        $collection = $this->{$fn}();

        if ($this->_stockConfig->isShowOutOfStock() != 1) {
            $this->_stockFilter->addInStockFilterToCollection($collection);

        }
        $this->_eventManager->dispatch(
            'catalog_block_product_list_collection',
            ['collection' => $collection]
        );

    $conditions = $this->getConditions();
    $conditions->collectValidatedAttributes($collection);
    $this->sqlBuilder->attachConditionToCollection($collection,
    $conditions);

    return $collection;
}

]2]2
[]3


texts: Give customer the ability to save credit card using a credit card (saved) payment method

texts:
I have a Magento store and a client used a credit card (saved) Magento's default payment method. Now the client wants the customer to have the ability to save their credit card details on the check-out step (using checkbox) for the next order. How can I save that detail and also use for next time when customer at the check-out step.

Magento version: 1. 9.0.1.


texts: Magento 2: Set backorder status programmatically

texts:
In my case I want to set backorder status to 1 (turn it on).
I'm playing around in module-catalog/Controller/Adminhtml/Product/Save.php in the execute() function.

I can modify array $data with all new settings before the product will be saved. And for example if I change name it will take effect. But if I change ['stock_data']['backorders'] it will not.

So my question is how to set backorder status programmatically on product save? (simple product)

Here's short example of the array:

Array
(
    [product] => Array
        (
            [status] => 1
            [name] => Somedress-4
            [sku] => skudress-4
            [price] => 575.00
            ....
            [stock_data] => Array
                (
                    [item_id] => 87
                    [product_id] => 87
                    [stock_id] => 1
                    [qty] => 5
                    [min_qty] => 0
                    [use_config_min_qty] => 1
                    [is_qty_decimal] => 0
                    [backorders] => 1
                    [use_config_backorders] => 0


texts: Magento not showing proper version in admin

texts:
I am tring to upgrade Magento Store Magento 1.9.3.0 to Magento 1.9.3.2.
Its work properly and app/Mage.php also showing proper version but Admin Footer not showing proper version.

I tried following way to upgrade.

1) Using Replace all Core files

2) Using Magento Connect From Backend

3) Using ./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force

But still not getting proper version

I tried to get magento version in SHELL it showing proper using php -r "include 'app/Mage.php'; echo 'Magento version is: ', Mage::getVersion(); "

But tried to upload following php file in root its show wrong version

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

try
{
    echo 'Magento version is: '.Mage::getVersion();
}
catch(Exception $e)
{
    echo 'Message: ' .$e->getMessage();
}
?>

How can I resolve this problem ?


texts: What I am trying to achieve is that, I have SALE on an item I've managed to display the Regular Price and the Special Price But let's say I have a product which has regular price of 319.00 I would like to apply 20% discount on this product which results in a price 255.20. What I want is to round the end number. If the value is below .50 to go to the lower number and if the value is above .50 to go to the bigger number. Is this possible without buying an expensive module. Thanks.


texts: Products on homepage: get more than 12 products

texts:
Im trying to show a few products on my homepage

I got pretty far using this code:

{{block type="catalog/product_list" name="product_list" category_id="74" column_count="5" num_products="24" mode="grid" template="catalog/product/list.phtml"}}

I also added a display: none; to the css to remove the option and filter thing from the product vieuw block. to let it look more natrual on the homepage

But my problem is: i can't get more products on it as my average 12.

I already tried:

1>> I tried to let the catolog page use an diffrent "show amount" so instead of 12 i changed it to use 36 with the custom xml bellow. this worked on the catolog path (wich is now offline) but does not work with my block on the homepage (also tried to add this custom xml to the homepage)

<reference name="product_list_toolbar">
 <action method="setDefaultGridPerPage">
<limit>36</limit></action></reference>

2>> I tried alot of extra block options but none of them seems to take effect. few of them are bellow: (there are a few more as this but i cant find them anymore, aslo tried it on amount 36)

products_per_page="50" products_count="50" count="9" limit="9" num_products="24"

3>> edit also tried the following blocks

{{block type="catalog/product_list" name="product_list" category_id="74" column_count="5" count="24" limit="24" mode="grid" template="catalog/product/list.phtml"}}

{{block type="catalog/product_list" name="product_list" category_id="74" column_count="6" count="6" limit="4" mode="grid" template="catalog/product/list.phtml"}}

{{block type="catalog/product_list" name="product_list" alias="products_homepage" category_id="74" template="catalog/product/list.phtml"}}

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="74" column_count="6" products_per_page="50" products_count="50" count="9" limit="9" num_products="24" template="catalog/product/list.phtml"}}

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="9" template="catalog/product/list.phtml"}}

4>> edit Tried the following custom xml code:

<reference name="content">

    <block type="catalog/product_list" template="catalog/product/list.phtml">
      <action method="setLimit">36</action>
 </block>

5>> edit Products per page on grid allowed values.
I got 12,24,36 because i need column=3 on my product page with 4 bellow each other.

question: Does anyone knows how to get more as 12 products with this block? or get around it on a different way.


texts:
How to change block's template in layout XML? I tried the solution proposed in this thread:

<referenceBlock name="copyright">
    <arguments>
        <argument name="template" xsi:type="string">Vendor_Module::new.phtml</argument>
    </arguments>
</referenceBlock>

but I can't get it to work. I'm not sure if I'm doing it wrong.

If I change it to action method="setTemplate" (just like in other popular answer for this question, e.g. here):

<referenceBlock name="copyright">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Vendor_Module::new.phtml</argument>
    </action>
</referenceBlock>

all works fine and the template file is correctly changed.

So what is wrong in the first example? I'd like to avoid using action since it is marked as deprecated.


texts: Internal Error I am getting this error in magento 2 payment page and unable to make payments


texts: Magento2 Transform Multi Select Attribute Filter into Swatch Filter

texts:
is there a way in Magento 2 to transform a product multi select attribute, which is used as a filter into a color swatch on frontend?

We need this attribute in backend as multi select but have to transform it in frontend to a color swatch  (as keys we have add the hex values of the color ).

Any ideas?


texts:
I'm trying to learn magento but I have to finish the project that I'm working on as fast as I  can. So I'm stuck in somewhere. Then I decided to use pure sql. (I know it's really messy)

So is anynone know how can I get all products with sql? I researched database but can't find.

I need product name, thumbnail, price, rating, reviews count and attributes.


texts: is Magento2 supports the multiple coupons from same rule?

texts:
I'm using the 3rd party extension for multiple coupons extension. it working as differnt rules apply but I need same rule different coupons need to apply in the cart.

this is work in magento2?

my requirement is multiple coupons from the same rule to be applied on the cart
is this possible?


texts:
I want to export all categories using the script and save in the CSV file.

categories will be in the tree structure like below:

Root Category, sub1, subsub1, subsubsub1
Root Category, sub1, subsub1, subsubsub2
Root Category, sub1, subsub2, subsubsub1
Root Category, sub1, subsub2, subsubsub2


texts: When adding a product to cart on Chrome and Firefox - it adds the quantity of 1 but on IE 11 and Safari 5.1.7 it adds quantity of 2

texts:
Magento 1.9.1.0
Porto Theme

I just came across something really interesting. When I go through the order process in Chrome or Firefox - everything works the way I would expect --) products get added with quantity of 1. If I use IE 11 or Safari (5.1.7) - it adds all products twice (with the quantity of 2). Any ideas why this is happening and how to fix that?


texts: Magento 2 : Product list only shows one product in one of the category, the rest works fine

texts: Product list only shows one product in one of the category, the rest works fine. That category has more products, if you search for a product, you can access its product view and in related products the rest of products are showed.


texts: Magento 2.4.1 Custom Content Security Policy (CSP) whitelist for connect-src not Working

texts:
I created a whitelist for content-src CSP like this:
   <policy id="connect-src">
        <values>
            <value id="cloudflare" type="host">*.cloudflare.com</value>
            <value id="freshrelevance" type="host">*.freshrelevance.com</value>
            <value id="ga" type="host">*.google-analytics.com</value>
        </values>
    </policy>

but the console log always shows this error:

[Report Only] Refused to connect to 'wss://am.freshrelevance.com/'
because it violates the following Content Security Policy directive:
"connect-src geostag.cardinalcommerce.com geo.cardinalcommerce.com
1eafstag.cardinalcommerce.com 1eaf.cardinalcommerce.com
centinelapistag.cardinalcommerce.com centinelapi.cardinalcommerce.com
*.amazon.com *.amazon.co.uk *.amazon.co.jp *.amazon.jp *.amazon.it *.amazon.fr *.amazon.es *.amazonpay.com *.amazonpay.co.uk *.amazonpay.co.jp *.amazonpay.jp *.amazonpay.it *.amazonpay.fr *.amazonpay.es mws.amazonservices.com mws.amazonservices.co.uk mws.amazonservices.co.jp mws.amazonservices.jp mws.amazonservices.it
mws.amazonservices.fr mws.amazonservices.es *.trackedlink.net
*.trackedweb.net *.dotdigital-pages.com api.comapi.com webchat.dotdigital.com *.cloudflare.com *.freshrelevance.com
*.google-analytics.com 'self' 'unsafe-inline'".

the others whitelisted just fine


texts: Edit the default Magento2 cookie message

texts:
I would like to change the text and button value of the Mage2's default cookie policy popup.

See how it looks now: https://imgur.com/a/qvqAGXb

I would like it to read some different text and have a different button text.

How would I do this?

Thanks!


texts:
I have got Magento version 1.9.2.0 I would like to install the new security patch 8788 v2. I have not installed the 8788v1 yet.
I know the installation process states, Revert SUPEE-8788 if you have already installed it, Revert SUPEE-1533 if you have already installed it, Deploy SUPEE-3941 if it hasn’t already been installed.
My issue is I can not find out if SUPEE-1533 and SUPEE-3941 is installed because it is not in my app-etc-applied.patches.list and when I check on www.magereport.com, it does not indicate these patches.
I need advise on how to install this new patch successfully please.


texts:
I am Testing Order Place API with Swagger.
Its successfully Working fine with Purchase Order and Check money.
now, I am checking with Payflow Pro than its giving an error.
message: "Invalid account number"
here is my request which I have passed in swagger
{
  "email":"ketan@yahoo.com",
   "paymentMethod":{
   "po_number":"string",
  "method":"payflowpro",
  "additional_data":{
        "user" : "****",
        "vendor" : "****",
        "partner" : "paypal",
        "pwd" : "****",
        "verbosity" : "HIGH",
        "BUTTONSOURCE" : "Magento_Cart_Community",
        "tender" : "C",
        "trxtype" : "A",
        "createsecuretoken" : "Y",
        "CUSTIP":"Local IP",
        "securetokenid" : "4a2dd2d5f4cabb9fdd8a590f2ce0bc5a",
        "silenttran" : "TRUE",
        "firstname" : "fname",
        "lastname" : "lname",
        "street" : "address",
        "city" : "Greer",
        "state" : "SC",
        "zip" : "29650",
        "country" : "US",
        "shiptofirstname" : "sname",
        "shiptolastname" : "slname",
        "shiptostreet" : "address",
        "shiptocity" : "Greer",
        "shiptostate" : "SC",
        "shiptozip" : "29650",
        "shiptocountry" : "US"
  },
  "extension_attributes":{
     "agreement_ids":[
        "string"
        ]
      }
   }
}

and here is the response
'result' =>
   array (
    'result' => '23',
    'pnref' => 'A1X0AC170F0A',
   'respmsg' => 'Invalid account number',
   'result_code' => '23',
  )

If anyone knows which parameter we have to pass for a guest please let us know?


texts: I am trying to download file from amazon s3 but getting error

texts:
I am trying to download file from amazon s3 but getting following error

SignatureDoesNotMatch
<Message>
The request signature we calculated does not match the signature you provided. Check your key and signing method.
</Message>

Following code we use

<?php
$accessKey = 'xxxxxxxxxxxxxxxxxxxxxxxxx';
$secretKey = 'xxxxxxxxxxxxxxxxxxxxxxxxx';

$datestamp = new DateTime( "now" );
$longdate = $datestamp->format( "Ymd\\THisZ");
$shortdate = $datestamp->format( "Ymd" );
$date = date('Ymd',time());
$timestamp = date('Ymd',time()).'T'.date('His',time()).'Z';
$shortdate =  date('Ymd',time());
$region = 'ap-south-1';
$service = 's3';
$request    = 'aws4_request';
$ksecret = 'AWS4' . $secretKey;
$kdate = hash_hmac( 'sha256', $shortdate, $ksecret );
$kregion = hash_hmac( 'sha256', $region, $kdate );
$kservice = hash_hmac( 'sha256', $service, $kregion );
$ksigning = hash_hmac( 'sha256', $request, $kservice );
$canonicalRequest = "GET\n";
$canonicalRequest .= "/\n";
$canonicalRequest .= "\n";
$canonicalRequest .= "host:bucketname.s3.amazonaws.com\n";
$canonicalRequest .= "x-amz-date:". $timestamp ."\n";
$canonicalRequest .= "\n";
$canonicalRequest .= "host;x-amz-date\n";
$canonicalRequest .= hash( 'sha256', '{}' );
$canonicalRequest = hash( 'sha256', $canonicalRequest );
$stringToSign = "AWS4-HMAC-SHA256\n";
$stringToSign .= $longdate . "\n";
$stringToSign .= $shortdate . "/". $region ."/". $service ."/". $request ."\n";
$stringToSign .= $canonicalRequest;
echo $stringToSign;
echo "
";
echo $ksigning;
echo "
";
$signature = hash_hmac( 'sha256', $stringToSign, base64_encode($ksigning) );
$params = [
    'X-Amz-Algorithm' => 'AWS4-HMAC-SHA256',
    'X-Amz-Credential' => $accessKey . '/'. $shortdate .'/'. $region .'/'. $service .'/' . $request,
    'X-Amz-Date'    => $timestamp,
    'X-Amz-Expires' => 86400,
    'X-Amz-SignedHeaders'   => 'host;x-amz-date',
    'X-Amz-Signature'   => trim($signature)
];
$url = 'https://bucketname.s3.amazonaws.com/1.jpg';
$count = 0;
foreach($params AS $key => $value)
{
    $count++;
    $url .= ($count == 1 ? '?' : '&') . $key .= '=' . $value;
}
echo $url . "
";


texts: What is the best way change the label of fields in Shipping Address during checkout?

texts:
In Magento 2.2.6 Checkout where First Name, Last Name and Street Address is prompted.

I wanted them to displayed as Volunteer First Name, Volunteer Last Name and Centre Address. What is the best to way to change the label of the Address Field.

In short:

First Name -> Volunteer First Name
Last Name -> Volunteer Last Name
Street Address -> Centre Address


texts: Get attibute label option for current store

texts:
I have a 'size' attribute with lot of option. For each option, I have translation for each my stores :

I want to get the translation label for a product and for a given store.

So :

I load my product

$prod = Mage::getModel('catalog/product')->setStoreId(1)->load($productId);

Then I try to get label :

$label = $prod->getResource()->getAttribute('size')->getFrontend()->getValue($prod);

But I always get the default value : here "TU" (store 0) instead of "Taille Unique" (store 1).

If I try to get the label with this code :

$label = $prod->getAttributeText('size');

Now, I get "One Size" (store 2) instead of "Taille unique" (store 1) and it's really weird, isn't it ?

What is wrong in my code ?


texts: cms page with customer navigation and add link in customer navigation

texts:
Is there any way to make a cms page and then add customer navigation to that page.

I dont want to make module for a single page for customer navigation.


texts: magento showing server error instead of 404 page

texts:
I am facing a strange kind of issue, which i never came across before.

I have seen an increased number of server errors in my webmaster tool, when investigating I found this issue.

the URL which is giving this error is a simply brand filtered URL. which should be ok, but when going on this URL it gives a server error.

  https://www.smartteck.co.uk/pc-components/other?manufacturer=4664

after investigating this in more details found out that manufacturer 4664 is simply deleted from our list as it isnt available for sale any more.
you can see the error on that url. summry here:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.min_price' in 'field list', query was: SELECT FLOOR((ROUND(((e.min_price +(e.min_price*CASE e.tax_class_id WHEN 2 THEN       0.2000  ELSE 0 END))) * 1, 2)) / 1) + 1 AS `range`, COUNT(*) AS `count` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '36'
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 INNER JOIN `catalog_product_index_eav` AS `manufacturer_idx` ON manufacturer_idx.entity_id = e.entity_id AND manufacturer_idx.attribute_id = '81' AND manufacturer_idx.store_id = 1 AND manufacturer_idx.value = '4664' GROUP BY FLOOR((ROUND(((e.min_price +(e.min_price*CASE e.tax_class_id WHEN 2 THEN       0.2000  ELSE 0 END))) * 1, 2)) / 1) + 1 ORDER BY FLOOR((ROUND(((e.min_price +(e.min_price*CASE e.tax_class_id WHEN 2 THEN       0.2000  ELSE 0 END))) * 1, 2)) / 1) + 1 ASC

I have 2 concerns,

showing the error log on front end, doesn't that put our site security on risk?
and if our site can not found this URL or brand, why it isn't showing simple 404 page?

rest site is working fine and 404 page is working fine as well.

any help would be appreciated


texts: Magento 1: Display three products per row in magento

texts: how to display three products per row in Magento, after a certain count the products are repeating itself. Please help


texts: How can i get store_id in Magento2 REST API and by passing store_id i want to show different store views in application using REST API.


texts: escapehtml won't manage "&" in mail subject

texts:
I'm trying to figure out why a value like ramdom&text, passed as a variable in  :

{{htmlescape var=$product.customvariable}}

will appear as random&text(what I want) inside the mail, and actually everywhere, even outside the body...

and as &amp ;text  in its title when it's declared that way :

< !--@subject blabla {{htmlescape var=$product.customvariable}}@-->

Any solution will be greatly appreciated :)

Thanks


texts: How to call model in UpgradeData Magento 2

texts:
i have a model that i can be called via controller like this

    protected $_sync;
    public function __construct(\Magento\Framework\App\Action\Context $context, \Lime\Hello\Model\SyncFactory $sync)
    {
        $this->_sync = $sync;
        parent::__construct($context);
    }

but when i try to call it in upgrade data it gives me an error like this :

  Upgrading data.. PHP Fatal error:  Uncaught Error: Call to undefined method Lime\Courier\Model\SyncFactory::syncAll()

here's my upgrade data:

namespace Lime\Courier\Setup;

use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class UpgradeData implements UpgradeDataInterface
{
      protected $_sync;
      public function __construct(\Lime\Courier\Model\SyncFactory $sync)
      {
          $this->_sync = $sync;
      }
    /**
     * {@inheritdoc}
     */
    public function upgrade(
        ModuleDataSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $setup->startSetup();
        if (version_compare($context->getVersion(), "1.0.0", "<")) {

        }
        if (version_compare($context->getVersion(), '1.0.1') < 0) {
            //code to upgrade to 1.0.1
            $run = $this->_sync;
            $run->syncAll();
        }

        $setup->endSetup();
    }
}

this is the function in the model

public function syncAll(){
    $this->setProvinces();
    $this->setCities();
    $this->setCouriers();
    $this->setCourierservices();
  }


texts:
How can I import a products csv with images as well?

Importing products without images works fine. I have inserted the image on:

/media/import/test-2.jpg

And on the csv _media_image column:

/media/import/test-2.jpg

What am I missing?


texts:
We have a site where sometimes when an order is made, it isn't pushed to google analytics (we're using the google api and the store id etc is correct as some orders get pushed)

The only thing I notice is that the orders that aren't pushed to analytics also have no order email sent but I have absolutely no idea what would cause this.

I've looked at:

payment method

store view used

time of day (maybe cron?)

status

customer group,

customer sign up date

guest or customer (can't be the issue as we don't allow guest checkout).

The issue happens on a variation of all of these parameters - there isn't anything connecting the orders that aren't pushed into analytics, apart from the fact the order emails aren't sent and I can't understand why they wouldn't be sent, I've put in test orders and used non existent emails, emails that are spelt wrong (that couldn't exist) etc etc and for ME the order email is ALWAYS sent.

Is there any reason some order emails won't send and would this affect analytics?


texts:
I got this error when this morning when i came to check my website and got this error

  SQLSTATE[HY000]: General error: 1030 Got error -1 from storage engine,
  query was: INSERT INTO log_visitor (session_id, first_visit_at,
  last_visit_at, last_url_id, store_id) VALUES (?, ?, ?, ?, ?)

I really need assistance in this.


texts: Magento 1 - Stop Spam Accounts from being created

texts: Every day I am having 3 or 4 new spam accounts being created on my store. I have put one of the new Google Recaptchas on the create an account page but it has made no difference. How do I stop this?


texts: Load category collection by category id in Magento2

texts:
I have get the overall category collection by calling this sample code in xml file.

<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">

This will return the overall category collection but i want to get the specific category collection by category id .I don't want to use object manager or want to create a custom module


texts:
My Magento 2.3.3 is not sending any emails from the solution.

As far as I can see, the cron job is running, the mail settings looks fine and are enabled.

I think I have tried it all, but no luck, it keeps saying "The order confirmation email is not sent".

I have tested if I can send a mail from a PHP file, and that works just fine.

Do anyone, have an idea?


texts: Changing category ID's / Resetting Magento ID Count

texts:
I'm trying to change the category ID's for my Magento store. Or figure out a way to 'reset' the Magento ID count, as I'm fairly sure that it adds on to the ID count whenever I import categories.

EG. The category should be :81 (as it is on the live site), but it's actually :20046 (after importing categories).

Hence when I import products, it does not go to the correct Category folder.

FYI: I'm creating a prototype backup site from a live site.

Thank you.


texts:
I need to import everyday a csv file product. I already have this file.

I want to automate this process with cron.

How i can make this without magmi?

Thanks
Alessandro


texts: add submenu in customer dashboard left navigation

texts:
I want to extend the customer account dashboard menu with a new section shown in the picture below.
What is the best practice to do this?


texts: Magento2 : Show category name on product detail page

texts:
I need to show category name on product detail page just before product name.

Currently product name display as page title but i need to display additionally product name with class new class name. category name will also display with class name just before product name.

How i can complete the task.


texts: we need to get the customer address on register page. Where to set the "ShowAddressFields" value?


texts: Static Content deploy parallel jobs is not working in Docker

texts:
When using --jobs=4 or -j=4 with setup:static-content:deploy command its working on my local machine and it build the assets in parallel

but when using this command inside a docker container with php:7.1-fpm Official docker image - its only build a single task at the same time.

Any idea?


texts: Magento shopping cart price rule & alert for nearest subtotal

texts:
I want to build the rule which fulfill below rule.

Free shipping if over $100 or if they reach nearer $90 then give them option that buy $10 more for free delivery.

I set the first rule for free delivery Subtotal equals or greater than 100, but how i can display message or alert to get customer know that if their subtotal is $10 more. they are eligible for free delivery.


texts: Magento All Product Export dataflow error

texts:
I am trying to export products in Magento 1.9.1 using dataflow profiles, but it stops at "Warning: Please do not close the window during importing/exporting data".

This is the error I get:

  Fatal error: Call to undefined method
  Mage_Adminhtml_Model_System_Config_Source_Yesno::setAttribute() in
  app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php
  on line 389


texts: RWD theme how to change related product orientation?

texts: Right now it is vertical, whats the best way to change the products to a horizontal view?


texts: Magento 2 - Do I need to enable maintenance mode during deployment?

texts:
In the documentation it says

Magento uses maintenance mode to disable bootstrapping. Disabling
bootstrapping is helpful while you are maintaining, upgrading, or
reconfiguring your site.

What do they mean with bootstrapping?
Do I really need to enable maintenance mode during each deployment?
I tried it without and it works too, so why do we need it?


texts: How i can get Image/file Extension from uploaded image using _fileUploaderFactory in Magento 2

texts:
I am Working on custom Module In Magento 2 I m trying to upload image to database using fileUploaderFactory.

try {
        $uploader = $this->_fileUploaderFactory->create(['fileId' => 'image']);
        $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
        $uploader->setFilesDispersion(false);
        $uploader->setAllowRenameFiles(true);
        $path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('backgroundimage/');
        $filename=$data['title'].$data['date_from'];
        $filename = str_replace(' ', '_', $filename);
        $uploader->save($path,$filename);

    } catch (Exception $e) {
        $this->messageManager->addError(__($e->getMessage()));
    }

File is Upload in database but i m not getting File extension that is why file is not showing in my GRID list

Anyone please Guide


texts: How to disable validation as required field Billing Period Unit in magento 1.8

texts: hi guys when i edit any product from admin panel of magento there is require field Billing Period Unit.i want to keep no any such type of validation kindly help me


texts: Is it possible to add an event (hook) to a core action without overriding it?

texts:
I'd like to add a hook to a Magento core action (in this specific case Mage_Adminhtml_Sales_Order_CreateController::saveAction() but I hope there's a general solution).

Just a hunch, but it seems to me that there should be a way to add a hook to an action using Magento's XML, without having to override a class just to add a one-line Mage::dispatchEvent(). Perhaps this is wishful thinking.

Is there any way to do this using XML? Or no? If so, how?


texts:
My newsletter box doesn't work any more, it doesn't send emails to the backend.
here's the block i'm using: {{block type="core/template" template="newsletter/subscribe.phtml"}}

How can i make it work again ?


texts: get store level configuration data instead of default

texts:
I want to get string from store level configuration (for each store differntly), but its taking from default

CONST SMS_FOR_ORDER_SHIPPED = 'sendsms/sms_templates/order_shipped';
.
.
.
.
.
Mage::getStoreConfig(self::SMS_FOR_ORDER_SHIPPED)

i have also tried

Mage::getStoreConfig(SMS_FOR_ORDER_SHIPPED, $order_id->getData('store_id'))

I also tried

Mage::getStoreConfig('sendsms/sms_templates/order_shipped', $order_id->getData('store_id'))

But not working


texts: Magento products pictures are not sercure, any solution?

texts:
We don't want competitors to be able to download high resolution images from Magento. The front-end URL is:

leatherjacketgear.com/media/catalog/product/cache/1/thumbnail/70x80/9df78eab33525d08d6e5fb8d27136e95/a/r/armani-quilted-leather_2.jpg

But you can remove this part of the URL

/cache/1/thumbnail/70x80/9df78eab33525d08d6e5fb8d27136e95

and find the original image here:

leatherjacketgear.com/media/catalog/product/a/r/armani-quilted-leather_2.jpg

:( The original image is returned.

This is not okay with our customer for whom we've done website designing in Magento. They want to protect their images because some companies with in-house developers steals images.


texts: Magento\Framework\Search\Dynamic\Algorithm _lowerLimit canot be zero

texts:
vendor/magento/framework/Search/Dynamic/Algorithm.php
/**
 * Set lower and upper limit for algorithm
 *
 * @param null|float $lowerLimit
 * @param null|float $upperLimit
 * @return \Magento\Framework\Search\Dynamic\Algorithm
 */
public function setLimits($lowerLimit = null, $upperLimit = null)
{
    $this->_lowerLimit = empty($lowerLimit) ? null : (double)$lowerLimit;
    $this->_upperLimit = empty($upperLimit) ? null : (double)$upperLimit;

    return $this;
}

once $lowerLimit is 0 ,the $this->_lowerLimit will be null,
but in our platform $lowerLimit really can be float 0, the it will cause a bug "canot be null "
$lower canot be null
vendor/magento/module-elasticsearch/Elasticsearch5/SearchAdapter/Aggregation/Interval.php
/**
 * @inheritdoc
 */
public function loadPrevious($data, $index, $lower = null)
{
    if ($lower) {
        $from = ['gte' => $lower - self::DELTA];
    }
    if ($data) {
        $to = ['lt' => $data - self::DELTA];
    }

    $requestQuery = $this->prepareBaseRequestQuery($from, $to);
    $requestQuery = array_merge_recursive(
        $requestQuery,
        ['size' => 0]
    );

    $queryResult = $this->connectionManager->getConnection()
        ->query($requestQuery);

    $offset = $queryResult['hits']['total'];
    if (!$offset) {
        return false;
    }

    if (is_array($offset)) {
        $offset = $offset['value'];
    }

    return $this->load($index - $offset + 1, $offset - 1, $lower);
}

so tell me why is it?


texts:
I'm very new to Magento. I have created a page, and I want to insert a link.

I have this page:

When clicking on "Order Detail", It's will move to another page. I tried to research but I can't find a solution.
Can anyone help??? Thanks


texts:
how to get a full length  serialized condition in  'salesrule' table in  magento 2

  Table: salesrule

  code

 public function getRule()
    {
        $ruleModel = $this->_ruleFactory->create()->load(10);
        $conditionSerialized =$ruleModel->getConditionsSerialized();
        return $conditionSerialized;
    }

  output

  unserialized condition also does not appear full condition

return unserialize($conditionSerialized);


texts:
//$place_longitude = 106.63156128
//$place_latitude = 10.85593987

I have tried this way but still does not work

$collection = Mage::getModel('hihi_place/place')
                ->getCollection()
//                ->addFieldToFilter(
//                    array('longitude', 'latitude'),
//                    array(
//                        array('eq'=>doubleval($place_longitude)),
//                        array('eq'=>doubleval($place_latitude))
//                    )
//                );
                ->addFieldToFilter('latitude',$place_latitude)
                ->addFieldToFilter('longitude',$place_longitude);

If I use the word "like" it works fine, but I just wanted to get the exact value that I entered.
Thanks.


texts: For what there is the sales.xml file? In the documentation, I can not find anything about this file.


texts: Hide Configurable product images from details page when color swatch is selected

texts:
I want to hide the configurable product images when a configurable swatch is clicked.

So by default configurable shows Green, red and blue.

And when I select Blue swatch of my simple product only Blue products images should show.


texts:
how to add a custom customer attributes under shipping address in checkout  page in Magento2?

i m using this extension for customer attributes.

In customer registration page

In Shipping Page


texts: How to call getItem() & getOptionList()in an Observer.php

texts:
I have an observer and would like to get the selected custom options array.

I have found the two elements I require in: app/design/frontend/MY-THEME/default/template/checkout/cart/item/default.phtml

Which are:

$_item = $this->getItem();
$_options = $this->getOptionList();

I just don't know how to get them in an observer i.e. what else I have to call.


texts:
I have products which have options that include their associated part#'s and model#'s in text as shown here http://greengaskets.com/index.php/manufacturer/bally-gasket-profile-10130.html

However I am unable produce results when searching text published in product options. How can I include product options in the search function?


texts:
I have this config settings in magento 2
<field id="do_something" translate="label" type="select" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Agree terms and conditions?</label>
    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>

I want to validate this select input so that user cannot save it if they don't agree the terms and conditions. In other words, they must choose 'TRUE' to save it. How can I do it in magento 2?


texts:
I want to create the invoice for cancel order. How can it possible?

OR

Any way to Change the order item status?


texts: magento 2.2.3 HOW CAN I DO THIS SITUATION? When referee signs up, referrer receives 200points, referee receives 100 points

texts: Magento 2.2.3 HOW CAN I DO THIS SITUATION? When referee signs up, referrer receives 200points, referee receives 100 points .


texts: Using Magento 2 custom cache in custom module

texts:
@Rakesh explains how to add custom cache in Magento 2 here.

My question is how to actually work with my custom cache in Magento 2?

In Magento 1 you would do something like:

$cacheId = 'example_id';
$cacheTag = 'block_html';
//check if our example_id cache contains any data - load() method will return false if cache is empty
if (($data_to_be_cached = Mage::app()->getCache()->load($cacheId))) {
    //if cache was found then unserialize it and assign to our variable
    $data_to_be_cached = unserialize($data_to_be_cached);
} else {
    //if not then normally assign data to the variable
    $data_to_be_cached = $exampleObject->exampleMethod();
    //then serialize and save it
    Mage::app()->getCache()->save(serialize($data_to_be_cached), $cacheId, array($cacheTag));
}

as explained here.

How can one handle checking, saving and loading cache inside a custom module in Magento 2?


texts: Adding Custom CSS to Luma theme magento 2.3.0

texts:
in Magento 2.3.0 I have followed the above solution but still not loading my css, I have search ran all the commands but still nothing. Please any mistake on my implentation below, I am trying to add custom.css to the luma theme.

  app/design/frontend/Magento/Luma/Magento_Theme/layout/default_head_blocks.xml

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

  app/design/frontend/Magento/Luma/web/css/custom.css

or

  app/design/frontend/Magento/Luma/Magento_Theme/web/css/custom.css


texts: Structure project using Vue Storefront and Magento 2

texts:
Right now I have a Magento 2 installation which is run through a customized vagrant box, and I would like to use VS for the frontend, but I’m a little confused on how to best handle deployment to different environments and
how to structure the git repository in this case?
I’m thinking about creating two separate repositories one for Vue Storefront and one for Magento and then run the VS part directly from my local computer, while the Magento 2 application will be run from the vagrant box.
I am using the composer to install the Magento 2 part. Does this seem to be a valid setup or is there a better and more standard approach?
One other thing that is confusing is the fact that the recommendation for VS is not to run Elastic search and Redis through docker containers in a production environment but instead install everything locally on the server. It seems like it could be hard to create a valid deployment for local/stage and production machines.

I would be glad for any help/tips on how to best handle this kind of setup.


texts: Problem with loading a add to cart button into silder

texts:
I have a problem with adding the add to cart button. Whenever I add the add to cart button the all of the sliders disapear from page. This is the example where I use the add to cart button .

Compilations

    <?php
    $categoryId = 2; // this is the category holding your products
      $products = Mage::getModel('catalog/product')->getCollection();
     $products->addAttributeToSelect(array(
                        'image',
                           'name',
                           'short_description',
                           'sku',
                           'asin'
           ))
           ->addFieldToFilter('visibility', array(
                           Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                       Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
           ));

//$products->load();
foreach ($products as $product)  : ?>

<img src="<?php echo $localHelper->getImageUrl($product); ?>" alt="img"      />
 <?php if (!$product->getTypeInstance(true)->hasRequiredOptions($product)):?>
 <button type="button" title="<?php echo $this__('Add to Cart') ?>"
class="button btn-cart" onclick="setLocation('<?php echo $this->helper('checkout/cart')->getAddUrl($product); ?>')">
<?php echo $this->__('Add to Cart') ?></button>


texts: How to manage catalog inventory/product quantity in website level in Magento 2 (admin )

texts:
I created a multi store website in magento 2,but I want to manage each product on the website level.

For example, I have one product sku is sku200, and my websites are "India" and "England" I want make product qty for India "1000" and for England "500",means I want to handle each and every product separately for India and England at website level.


texts: Which is better way in magento2 for social login?

texts:
I have used inchoo module extension for social login in magento1

Now i want to migrate my project into magento2

There are not available inchoo module for social login in magento2

So i have tried mageplaza social login module but both database system(data storing system) is very different

So how can i migrate my magento1 data into magento2

Have anyone tried before it?


texts: Every store have their own media folder?

texts:
I have a code in Magento that I want to overwrite. Code can be found in /app/code/core/Mage/Core/Model/Config/Options.php:

The code goes something like this :

protected function _construct()
{
    ...
    $this->_data['media_dir']   = $root.DS.'default_media';
    ...
}

I need to change default media, that every store have its own media directory. So i made a function:

public function getMediaFromStore()
{
    $fullMediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
    $baseUrl = Mage::getBaseUrl();
    echo substr(Mage::getBaseUrl($fullMediaUrl, strlen($baseUrl));
}

And then, instead of

$this->_data['media_dir']   = $root.DS.'default_media';

i put

$this->_data['media_dir']   = $root.DS.$this->getMediaFromStore();

and i got freaking error, that goes like this...

  Fatal error: Call to a member function getOptions() on a non-object in
  /home/cofamedia/www/magento/app/Mage.php on line 328

And I'm stuck. Does any of you have some explanation how to go over this error. And do for every store their own media folder in Magento. Thank you.


texts: Hiding base price from Wholesale customers on product list page

texts:
I am having some trouble tweaking my template the way I want it. I am editing price.phtml and this base/regular/retail(WHATEVER) price is driving me nuts. When we have an item that has custom options it still shows the retail price. See below.

What I have done so far is, if you are logged in as wholesale, make everything either say Starting at: or Wholesale Each Price.
I have turned off the retail price for other product types but this one is tied to other things. It is used for simple product with no wholesale pricing and it is used by a lot of things if you are not logged in.

What I would like to see is just the Starting at: Price. How can I hide this price on this product type from wholesale customers.


texts: Limited number of columns in Custom Report (1.9)

texts:
I've successfully managed to create a custom report module in Magento following the (sort of) guide here Creating new completely custom reports

I have tried to add 6 columns to the report but it seems to be limited somewhere to only display 4 (both on the front end and csv export). If I remove some columns, the other ones show so they have been created corretly. Here's my grid;

class Juicy_Taxreport_Block_Adminhtml_Taxreport_Grid extends Mage_Adminhtml_Block_Report_Grid
{

    public function __construct() {
        parent::__construct();
        $this->setId('taxreportGrid');
        $this->setDefaultSort('created_at');
        $this->setDefaultDir('ASC');
        $this->setSaveParametersInSession(true);
        $this->setSubReportSize(false);
    }

    protected function _prepareCollection() {
        parent::_prepareCollection();
        $this->getCollection()->initReport('taxreport/taxreport');
        return $this;
    }

    protected function _prepareColumns() {
        $this->addColumn('ordered_qty', array(
            'header'    =>Mage::helper('reports')->__('Quantity Ordered'),
            'align'     =>'right',
            'index'     =>'qty_ordered'
        ));
        $this->addColumn('item_id', array(
            'header' => Mage::helper('taxreport')->__('Item ID'),
            'align' => 'right',
            'index' => 'item_id'
        ));
        $this->addColumn('store_id', array(
            'header' => Mage::helper('taxreport')->__('Price'),
            'align' => 'right',
            'index' => 'base_original_price'
        ));
        $this->addColumn('store_id', array(
            'header' => Mage::helper('taxreport')->__('Tax Percent'),
            'align' => 'right',
            'index' => 'base_original_price'
        ));
        $this->addColumn('store_id', array(
            'header' => Mage::helper('taxreport')->__('Tax Amount'),
            'align' => 'right',
            'index' => 'tax_amount'
        ));
        $this->addColumn('store_id', array(
            'header' => Mage::helper('taxreport')->__('Tax Amount'),
            'align' => 'right',
            'index' => 'tax_amount'
        ));
        $this->addExportType('*/*/exportCsv', Mage::helper('taxreport')->__('CSV'));
        $this->addExportType('*/*/exportXml', Mage::helper('taxreport')->__('XML'));
        return parent::_prepareColumns();
    }

    public function getRowUrl($row) {
        return false;
    }

    public function getReport($from, $to) {
        if ($from == '') {
            $from = $this->getFilter('report_from');
        }
        if ($to == '') {
            $to = $this->getFilter('report_to');
        }

        return $this->getCollection()->getReport($from, $to);
    }
}

In the example above, I can only see one of the tax related columns. If I remove, for example, the quantity column then I see two tax related columns. I have tried sifting through the extended classes but I can't seem to find anything there.


texts: Magento 2 : How Can I get Selected Payment Details on Next Step

texts:
Using knockout js, I have created a custom step, which I have place after payment method. I need to show which payment method was selected by the user.

I am creating a custom step as summary step. I want to display shipping address, shipping method and payment method.


texts: Magento 2 how to override theme-adminhtml-backend view.xml in custom module?

texts:
By default Magento 2 creates more than 20 duplicates of each product image..! (why???)
I have got this down to 5 using view.xml in my theme, but there is one extra set of image sizes I need to change, these are set in
/vendor/magento/theme-adminhtml-backend/etc/view.xml.
They are: product_listing_thumbnail, product_listing_thumbnail_preview, product_thumbnail_image.

I want to update it using my custom module. I have it at this path
app/code/Vendor/Module/view/adminhtml/etc/view.xml.
But this is wrong. Is there a correct path that will work? (If creating an admin theme is the only way then I guess I could do that, but seems overkill for just one small change).
(Have spent ages looking online and through docs but can only find info for frontend view.xml, which I am already using, and putting the image names in this file does not work).
Many Thanks!


texts: Load all products from category and filter by selected multi-select attribute in Magento

texts:
I have two multi-select attributes in my Magento 1.9 install (with their respective options) like this:

make

Manufacturer A
Manufacturer B
Manufacturer C

model

Type A
Type B
Type C

I have some products that will have more than one "make" and "model".

How do you load all products from a specific category and filter by products having a specific selected multi-select attribute option in Magento?

I am trying to load products where a scenario like this exists:

make = [Manufacturer A] and [Manufacturer C]
model = [Type A] and [Type B]

This is what I have tried so far:

// Mini-config
$make_attribute_code = 'make';
$model_attribute_code = 'model';
$filter_by_make = 'Manufacturer A';
$filter_by_model = 'Type A';
$load_from_category = 10117;

// Parse attribute option id of "Make"
$make_option_id = null;
$makeAttributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', $make_attribute_code);
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($makeAttributeId);
$attributeOptions = $attribute ->getSource()->getAllOptions();
foreach ($attributeOptions as $attributeOption) {
    if (trim($attributeOption['label']) == $filter_by_make) {
        $make_option_id = (int)trim($attributeOption['value']);
        break;
    }
}

// Parse attribute option id of "Model"
$model_option_id = null;
$modelAttributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', $model_attribute_code);
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($modelAttributeId);
$attributeOptions = $attribute ->getSource()->getAllOptions();
foreach ($attributeOptions as $attributeOption) {
    if (trim($attributeOption['label']) == $filter_by_model) {
        $model_option_id = (int)trim($attributeOption['value']);
        break;
    }
}

// Load category products having selected "Make" & "Model"
$products = Mage::getModel('catalog/category')
    ->load($load_from_category)
    ->getProductCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter(array(array('attribute' => $make_attribute_code, 'eq' => $make_option_id)))
    ->addAttributeToFilter(array(array('attribute' => $model_attribute_code, 'eq' => $model_option_id)))
    ->joinField(
        'qty',
        'cataloginventory/stock_item',
        'qty',
        'product_id=entity_id',
        '{{table}}.stock_id=1',
        'left'
    );

If the product has only one "make" and "model" option selected, it appears to be showing. Any ideas?


texts: "Unable to unserialize value" error on GraphQL query 2.3-develop branch

texts:
I'm trying out the GraphQL API on the 2.3-develop branch. On a clean Magento install, all queries return:

 "errors": [
        {
            "debugMessage": "Unable to unserialize value.",
            "message": "Internal server error",
            "category": "internal",
            "trace": [
                {
                    "file": "/magento/app/code/Magento/GraphQl/Controller/GraphQl.php",
                    "line": 102,
                    "call": "Magento\\Framework\\Serialize\\Serializer\\Json::unserialize('{\n    products(search: \" \"){\n        total_count\n\t}\n}')"
                },
            {

I'm sending a HTTP POST request to http://magento-shop-host/graphql

With the headers:

Accept: application/json
Content-Type: application/json


texts: Why there is $address->hasCouponCode() in qoute's _validateCouponCode() function?

texts:
I'm just courius why there is check for $address->hasCouponCode()
in _validateCouponCode (Mage_Sales_Model_Quote).

I think that there is no such data in model nor in database like coupon code for address.

I'm asking because our developers are overriding this method, and they are checking this condition but always $address->hasCouponCode() returns nothing.


texts: I am brand new with Magento 2 and I've been thinking about version control (git specifically) in M2. We know that installing modules is a critical thing in Magento. So, I would like to know if there is pattern of version control for Magento 2. If not, I would like to know about your workflow. Thanks!


texts: LayoutProcessor form field validation not working in magento 2

texts:
I am new in Magento 2. I am using the Order Delivery Date extension and now I want to make the date field require.

It is using a LayoutProcessorPlugin and code as:

$dateField = [
                'component' => 'Magento_Ui/js/form/element/abstract',
                'config' => [
                    'customScope' => 'shippingAddress',
                    'template' => 'ui/form/field',
                    'elementTmpl' => 'ui/form/element/date',
                    'id' => 'custom-date',
                    'class' => 'test'

                ],
                'dataScope' => 'shippingAddress.custom_date',
                'label' => 'Custom Date',
                'provider' => 'checkoutProvider',
                'visible' => true,
                'validation' => [],
                'sortOrder' => 200,

            ];

I have tried

'validation' => true,

and

'validation' => ['required-entry' => true,],

but both not working.Please suggest.


texts: Custom module block file function is not called

texts:
config.xml :

<config>
        <modules>
            <Ndot_Helloworld>
                <version>0.1.0</version>
            </Ndot_Helloworld>
        </modules>
        <global>
            <blocks>
                <helloworld>
                    <class>Ndot_Helloworld_Block</class>
                </helloworld>
            </blocks>

        </global>
        <frontend>
            <routers>
                <helloworld>
                    <use>standard</use>
                    <args>
                        <module>Ndot_Helloworld</module>
                        <frontName>helloworld</frontName>
                    </args>
                </helloworld>
            </routers>
            <layout>
                <updates>
                    <helloworld module="helloworld">
                        <file>ndot/helloworld.xml</file>
                    </helloworld>
                </updates>
            </layout>
        </frontend>
<config>

helloworld.xml
--------------
<layout version="1.0">
    <helloworld_index_index>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="ndot/helloworld" name="helloworld.custom" template="ndot/helloworld/helloworld.phtml">
            </block>
        </reference>
    </helloworld_index_index>
</layout>

indexControllers:
----------------
class Ndot_Helloworld_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

Helloworld.php
-------------
class Ndot_Helloworld_Block_Helloworld extends Mage_Core_Block_Template {

    public function myMessage() {
        echo '=================='; exit;
        return 'I am Iyngaran, This is my module.';
    }

}

When i call the myMessage() from the helloworld.phtml but the result is not showing.


texts: Magento 2: How to create a grid in the admin using existing sales order data

texts:
I'm looking to create a completely separate admin grid using Sales Order data.

Unfortunately, every tutorial I've seen is to modify the existing sales_order_grid with new columns, etc. But haven't quite figured out how to recreate a separate admin grid using sales_order data.

Just for an example, I need to create a separate admin grid displaying orders with specific order status.

Edit, here's the current state of my module:

Vendor/Module/etc/adminhtml/menu.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
  <menu>
    <add id="Vendor_Module::po_report" title="Purchase Orders" translate="title" module="Vendor_Module" sortOrder="85" parent="Magento_Reports::report_salesroot" action="purchaseorder/report" resource="Vendor_Module::po_report"/>
  </menu>
</config>

Vendor/Module/etc/adminhtml/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
  <router id="admin">
    <route id="purchaseorder" frontName="purchaseorder">
      <module name="Vendor_Module"/>
    </route>
  </router>
</config>

Vendor/Module/Controller/Adminhtml/Report/Index.php

<?php
namespace Vendor\Module\Controller\Adminhtml\Report;

class Index extends \Magento\Framework\App\Action\Action
{
  protected $_pageFactory;
  public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $pageFactory)
    {
      $this->_pageFactory = $pageFactory;
      return parent::__construct($context);
    }

    public function execute()
    {
      return $this->_pageFactory->create();
    }
  }

Vendor/Module/view/adminhtml/layout/purchaseorder_report_index.xml

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

From here, I'm stuck on how exactly to replicate the sales_order grid using uicomponent while also using my own filters on the order collection. (ie: A grid only containing orders with a status of pending_payment)


texts: How to create and use REST API for mobile app?

texts:
Am totally new to the magento and API's. I have gone through the Magento Rest Api Documentation.

I have created roles and users for rest api but in the documentation it is like http://magentohost/api/rest/. I have changed my domain in the place of magentohost and given but it is showing like:

  Request does not match any route

Whether any code have to add to the link? How to do this.

Can anyone give me the clear idea?


texts: magento 1.9 Standalone php file on root folder not working

texts:
I looked on internet and found the below code is the way to create a standalone file on magento root folder.

<?php
     require_once('app/Mage.php');
     ini_set('display_errors', 1);
     Mage::app('admin');
?>

But When I run the file on browser it gives the following error. https://prnt.sc/hxjulx
I looked in system.log folder and exception.log folder, but no error related to it is shown.
I thought it may be due to server problem but my website is working fine.
I could not find what is wrong with this file. Any one can tell me where I could look for the error or what could be wrong.


texts: How do I replace the standard language switcher with flags? Magento 2.1.0

texts:
I am migrating my Magento 1.9 store to Magento 2.1.

I am still quite new in Magento 2.1 and I can't seem to find some things.

Any guidelines on how to replace the textual store switcher with flags?


texts: WooCommerce product&category import to Magento

texts:
I want migrate all product and category data from WooCoomerce to Magento. I have an woocommerce .csv export file, which contains all of necessary data.

How can I convert this csv file to magento import file?
Here an google docs file which contains magento and woocommerce field names:

https://docs.google.com/spreadsheets/d/1JKSUXPttdu4bXUC5SidhBA29vDayW54HkX4yEIlmF6A/edit#gid=0

Thanks!


texts: Customer account navigation link | Where to find referenceBlock names

texts:
I want to remove some links in the customer account side navigation section on my Magento ver. 2.1.8 store.

So, I have created a path in my custom theme:

app/design/frontend/[Namespace]/[Theme]/Magento_Customer/layout/customer_account.xml

My customer_account.xml file:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <!-- Removing the link -->
        <referenceBlock name="block-name" remove="true"/>
    </body>
</page>

I found few threads and tutorials online such as: How to add/remove links on my account navigation magento2?

However, I don't think all the links are included in those tutorials. How can I find out what is the name of this referenceBlock so I can remove it?

This i my customer account navigation section:

I need to remove:

My Downloadable products
Stored payment methods
Billing agreements
My Saved cards
My Recurring profiles

I am sure the downloadable products, billing agreement and my saved cards can be deleted using:

<referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/>
<referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>
<referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>

But how do I delete the Stored Payment Methods and My Recurring profiles links?


texts: Format Cart Totals HTML from JSON Response

texts:
My Controller File

public function myAction() {

        $response = array();
        $response['myresponse'] = $this->myAjax();
        $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
        return $this->getResponse()->setBody(json_encode($response));
    }

    protected function myAjax()
    {

        $layout = $this->getLayout();
        $totalsBlock = $layout->createBlock('checkout/cart_totals')->setTemplate('checkout/cart/totals.phtml');
        return $totalsBlock->toHtml();
    }

My JSON Response

{"myresponse":"
\n        <col \/>\n        <col width=\"1\" \/>\n
\n
\n    \n        Grand Total<\/strong>\n    <\/td>\n    \n        $90.56<\/span><\/strong>\n    <\/td>\n<\/tr>\n        <\/tfoot>\n
\n
\n    \n        Subtotal    <\/td>\n    \n        $820.56<\/span>    <\/td>\n<\/tr>\n
\n    \n        Shipping &amp; Handling (Flat Rate - Fixed)    <\/td>\n    \n        $90.00<\/span>    <\/td>\n<\/tr>\n
\n   <\/tr>\n        <\/tbody>\n    <\/table>\n"}

My Oncomplete function

new Ajax.Request("<?php echo $formAction;?>", {
           method: 'post',
           postBody: "mypostdata="+$('my_value').value,
           onComplete: function(data) {
                var mydata = data.responseText.evalJSON(true);
                $('shopping-cart-totals-table').update(mydata);
            }
    });

The cart totals block is being updated but with incorrect HTML format. How could I make it in formatted data and show proper HTML in cart totals block ?

Please Help.

Thanks.


texts: Magento2 - Custom Adminhtml Customer Form Fields not Posted with Request

texts: I experienced a situation were I added additional fields in the backend customer form and these were not posted with the request. The fields were neither available in the observer using the $observer->getRequest()->getPostValue() methods neither they were showing as sent along with the request when debugging the request using Chrome Developer Tools under the network tab. All data except these custom fields was sent as it should. It seemed like the javascript class responsible for submitting the form data was ignoring any custom fields.


texts: Cannot add styles to M2 theme via _theme.less

texts:
We're using a 3rd party OTS theme (Alothemes/Savio). We want to make a couple of minor style adjustments, which are simpler to do/manage in the theme rather than creating/managing a new child theme. I just can't get them to take.

Site is currently in default mode, meaning stylesheets should be generated on-the-fly. We're using the Savio3 theme with an inheritance of: Altothemes/savio3 < Alothemes/default < Magento/blank

I want to add a new style rule that's not defined in any of the inheritance (on .opc-payment). According to the docs and guides, best way to do this is in _theme.less. So I added to Alothemes/default/web/css/source/_theme.less. This file was present but empty.

I cleared cache, cleared Javascript/CSS cache and for good measure, deleted generated styles-m.css and styles-l.css files from the savio3 pub/static/frontend/ theme folder. There is no pub/static/frontend for the default or blank themes.

However, styles-m was regenerated but does not include my added style rule (nor styles-l). So I copied _theme.less to the savio3 theme web/css/source folder and repeated. Stylesheets regenerated but still nothing.

What am I doing wrong?


texts: Quote Item, Configurable Product, Info_BuyRequest contains "uenc"

texts:
While trying to load the simple product "child" of a configurable product in the order email item detail, I ran this code:

if ($_item->getProductType() == 'configurable') {
    $options = $_item->getProductOptionByCode('info_buyRequest');

    /** @var Mage_Catalog_Model_Product $_simpleProduct */
    $_simpleProduct = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes($options['super_attribute'], $_product);
} else {
    /** @var Mage_Catalog_Model_Product $_simpleProduct */
    $_simpleProduct &= $_product;
}

...and got this error:

PHP Fatal error:  Call to a member function getBackend() on a non-object in [...]\app\code\core\Mage\Eav\Model\Entity\Abstract.php on line 816

It looks like that line tries to load an attribute, and can't find it, and then errors. The attribute code that it's trying to load is uenc which I can't find anywhere in eav_attribute. It turns out that uenc is a key in the array returned by $options = $_item->getProductOptionByCode('info_buyRequest'); and I don't know why.

After some searching of the codebase, all I can find are various third party modules that all unset this array key as if it's consistently problematic, and a note about the value of this key being a base64 encoded product URL for the purchased product. (It looks like the constant PARAM_NAME_URL_ENCODED is actually used when this data is being added.)

Does anyone know what this is here for, and why it breaks getProductByAttributes()? It seems like I'm not the first developer to run into this issue.


texts: How to use Git with Magento 2 for development and deployment

texts:
Hello beautiful people

I started developing an ecommerce page locally and I would love to use Git in order to add another stage to the development process and be able to make changes to the page from one place and push them to the server.

Currently the server where the development is done is running Magento 2.2 CE, on Windows server with PHP 7.1.13 and the whole thing is served using xampp.

But since the server is in another floor, I am using remote desktop for making changes to magento files. So I want to develop on my machine and push whatever changes I made to the server. And when someday we go live, I would love to deploy to the production server using the setup from our current server.

How could this be approached? I am using xampp in the two local stages, but eventually the production server will be a Linux VPS.


texts: How to load current product in Magento 2 without using deprecated functionality?

texts:
The core uses two deprecated classes to load the current product within the block class on the front end:

\Magento\Catalog\Block\Product\AbstractProduct
\Magento\Framework\Registry

See: \Magento\Catalog\Block\Product\AbstractProduct::getProduct() and \Magento\Catalog\Block\Product\View\AbstractView::getProduct(). One of many classes that uses these deprecated objects is: Magento\Catalog\Block\Product\View\Type\Simple (declared as product.info.simple in layout XML).

I would like to load a product in a ViewModel without using deprecated tools. How can I do this?


texts: Why error message added via the `$quote->addErrorInfo()` don't show up in the shopping cart?

texts:
Why error message added via

$quote->addErrorInfo($type, $origin, $code, $message)

don't show up in the shopping cart even though it adds the message to Mage::getSingleton('core/message')->error($message);,

however, error message added via

Mage::getSingleton('checkout/session')->addNotice($message)

do show up in the shopping cart?

Is there a difference between the two ?


texts: Magento 2 - How to make a custom category attribute of text type (string)?

texts: I have to make a custom attribute for categories of type string (text). I only saw how to make yes/no, email and other types, but there is no simple type of this attribute like string? How can I make it?


texts: I have tried to upload SVG logo in Magento 2.3.2 but its shows error "We don't recognize or support this file extension type"


texts: Magento 1.9 mobile menu not working properly

texts:
I had a problem with scrolling on the mobile menu for my iacado.ro website.
I managed to make it to scroll (the people that made the website didn't do it).

The problem is that although now it's scrolling, you can't "touch" anything on the screen even if the menu is closed.
Let me know if you need any other info:


texts: Magento 2 - remove sidebar from checkout

texts:
I'd like to remove the sidebar from the onepage checkout in magento 2 as defined in checkout_index_index

<item name="sidebar" xsi:type="array">
    <item name="sortOrder" xsi:type="string">50</item>
    <item name="component" xsi:type="string">Magento_Checkout/js/view/sidebar</item>
    <item name="displayArea" xsi:type="string">sidebar</item>
    <item name="config" xsi:type="array">
        <item name="template" xsi:type="string">Magento_Checkout/sidebar</item>
        <item name="deps" xsi:type="array">
            <item name="0" xsi:type="string">checkout.steps</item>
        </item>
    </item>
   <item name="children" xsi:type="array">
......

I thought it would just be a case of deleting the xml but if I do that I get PHP errors telling me the sidebar index is undefined.  Does anyone know of a way I can get rid of this without just hiding it with CSS/templates? or will it be a case of completely re-writing the checkout module? Thank you in advance.


texts: how to update the products in magento 2?

texts: I am using Magento 2.2.7 we are developing one selling medicines website so I have first imported the 300 medicines now I want to add the 1000 medicines how to update the medicines my dought is deleting the 300 medicines after import the 1000 medicines? or updating the medicines how to do that?


texts: Magento - How to convert data before rendered into admin edit form multiselect?

texts:
I have a customer attribute in my database which is a json format such as [1,2,3]
I want to convert it into 1,2,3 before render it into admin edit page, so that the auto checked function displayed correctly.
I am using this as a example to build the multiselect function.


texts: How to create new theme in magento 2 without parent theme delcartion?

texts: What if i don't declare parent theme in theme.xml while creating new theme in magento 2? will the new theme work properly?


texts:
I created an order attribute using quoteSetupFactory or eavSetupFactory which yields in creation of a row in the eav_attribute table with entity_type_id of 5.

$quoteInstaller = $this->quoteSetupFactory->create(['resourceName' => 'quote_setup', 'setup' => $setup]);
$quoteInstaller->addAttribute(
        'order',
        'me_attrib',
        ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER]
    );

when I try to set the value for that attribute using orderResource an sql error complains that the column doesn't exist.

$order->setData("me_attrib","1");
$this->orderResource->saveAttribute($order, ['me_attrib']);

**error**  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'me_attrib' in 'field list', query was: UPDATE `sales_order` SET ` `me_attrib` = ? WHERE (entity_id= 2)

So apparently I have to create a new column on sales_order table in order to store the new attribute.

I was wondering if there is any way to use the eav_attribute instead of creating a new column?


texts: How to set dynamic width for the ul by postitioning it properly?

texts:
In magento1.9.2.4 I want to display the menu like this:

My styles for this menu is below:

    .nav-primary {
    position: absolute;
    display: block;
    margin-top: -85px;
}
.nav-primary li.level0, .nav-primary a.level0 {
    display: inline-block;
}
.nav-primary li {
    position: relative;
}
.nav-primary li.level0 > a {
    color: #70583a;
    margin-top: -5px;
    padding-top: 5px;
    font-family: trebuchet MS;
    font-size: 15px;
}
.nav-primary a {
    position: relative;
    display: block;
    line-height: 30px;
}
.nav-primary li.level0 ul {
    position: absolute;
    display: none;
}
.nav-primary li.level1 {
    padding: 10px;
    float: left;
    font-size: 15px;
    border-right: 1px solid #eae4da;
}
.nav-primary li.level0 li.parent > a {
    position: relative;
}
.nav-primary li.level1 ul {
    display: block;
    position: relative;
}
.nav-primary li.level0 ul {
    position: absolute;
    left: 0;
    z-index: 10;
    display: none;
}
.nav-primary li.level0 li.parent > a {
    position: relative;
}
.nav-primary .menu-active > ul.level0 {
    width: 655px;
    max-width: 740px;
}
.nav-primary .menu-active > ul.level0, .nav-primary li.level0 li.sub-menu-active > ul {
    display: block;
}

Here I have fixed the width like

.nav-primary .menu-active > ul.level0{
    width:655px;
    max-width:740px;

}

When I remove the width for this element the menu is like this:

I want to have dynamic width which will adjust according to the menu added instead of fixing it manually.I think there is a problem with positioning. Help me to resolve this issue please.


texts: How to move apply coupon to Tab in Magento 2 in Checkout?

texts:
I want to move apply coupon to Custom created Tab in Magento 2 in Checkout.
I want to add " apply coupon " on Summery Page.
I have added this code in my checkout_index_index.xml
<item name="children" xsi:type="array">
  <item name="summary" xsi:type="array">
    <item name="children" xsi:type="array">
      <item name="discount" xsi:type="array">
         <item name="component"
xsi:type="string">Magento_SalesRule/js/view/payment/discount</item>
         <item name="children" xsi:type="array">
         <item name="errors" xsi:type="array">
         <item name="sortOrder" xsi:type="string">0</item>
         <item name="component"
xsi:type="string">Magento_SalesRule/js/view/payment/discount-messages</item>
         <item name="displayArea" xsi:type="string">messages</item>
        </item>
       </item>
      </item>
     </item>
   </item>
</item>

As, you can see discount code is  in between Summary code but it doesn't show me the coupon code.
Is there I am missing something?


texts: What is the cron job that cancels the expired orders? Magento 1.9

texts: I know that magento has cron jobs by default for specific tasks, I need the cron job to cancel unprocessed orders that have a time greater than 48 hours. Please help me


texts: In magento2,How to inject helper in collection

texts:
I have created a custom grid, in this grid collection I have to inject helper .while injecting helper in the collection it throws error like this
Type Error occurred when creating object:

My collection:

namespace vendor\module\Model\ResourceModel\Post;

use \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

    class Collection extends AbstractCollection
    {
        /**
         * Define model & resource model
         */
        const YOUR_TABLE = 'xxx';

        protected $helper;
        public function __construct(
            \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
            \Psr\Log\LoggerInterface $logger,
            \vendor\magento\Helper\Userdata $helper,
            \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
            \Magento\Framework\Event\ManagerInterface $eventManager,
            \Magento\Store\Model\StoreManagerInterface $storeManager,
            \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
            \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
        ) {
            $this->_init(
                ' vendor\module\Model\Post', ' vendor\module\Model\ResourceModel\Post'
            );
            parent::__construct(
                $entityFactory, $logger, $fetchStrategy, $eventManager, $connection,$resource,$helper
            );
            $this->storeManager = $storeManager;

        }
        protected function _initSelect()
        {
            parent::_initSelect();

            $this->getSelect()->where("main_table.user_id = 2";
        }


texts: Magento 2.1: How to add product custom attribute to order confirmation email?

texts: How can we add product custom attribute in new order email ? For example custom product attribute my_sku


texts:
I am running  magento 1.7.0.2 and I have 2 sites that both have this error message, there was a problem with this index processing.

I am not sure what effect it has on the site but I would like it fixed to be sure. When I refresh the entire group in index management the Product flat data function is the only one that will not reindex. I have tried flushing all the cache choices but I do not know what to do to fix this, can anybody please help?  I am not a computer programmer so I need help in simple terms if that is possible.

Thank you for your help, however, I did what you suggested and deleted the files in the var/locks/ folder.

However, it did not help with the error message.  I get this one now Can not initialize the indexer process

This is just for the "Product Flat Data" line.   What else can I try to fix this?
Also, is this problem causing any trouble with my website, does it matter?

Thanks again.

Steven

  Fatal error: Uncaught exception 'PDOException' with message
  'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
  update a child row: a foreign key constraint fails
  (db524651933.,
  CONSTRAINT FK_CAT_PRD_FLAT_1_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN
  KEY (entity_id) REFERENCES catalog_product_entity )' in
  /homepages/16/d479755148/htdocs/ssjewels.com/lib/Zend/Db/Statement/Pdo.php:228

  Stack trace: #0
  /homepages/16/d479755148/htdocs/ssjewels.com/lib/Zend/Db/Statement/Pdo.php(228):

  PDOStatement->execute(Array) #1
  /homepages/16/d479755148/htdocs/ssjewels.com/lib/Varien/Db/Statement/Pdo/Mysql.php(110):

  Zend_Db_Statement_Pdo->_execute(Array) #2
  /homepages/16/d479755148/htdocs/ssjewels.com/app/code/core/Zend/Db/Statement.php(291):

  Varien_Db_Statement_Pdo_Mysql->_execute(Array) #3
  /homepages/16/d479755148/htdocs/ssjewels.com/lib/Zend/Db/Adapter/Abstract.php(479):

  Zend_Db_Statement->execute(Array) #4
  /homepages/16/d479755148/htdocs/ssjewels.com/lib/Zend/Db/Adap in
  /homepages/16/d479755148/htdocs/ssjewels.com/lib/Zend/Db/Statement/Pdo.php
  on line 228

Here is the result of the runindex.php file I created. I do know what it means, and I am sorry I do not know how to create a Cron job.

Thank you for your help.


texts:
Currently i have developed Magento 2.2 with Angular js 4. i create rest api in magento and angular will get response from magento api. for in future my client want to use Magento 2.2 as a backend with serve MySQL database in between they want to use mongodb and front-end will angular js.

so the architecture will magento will create api and post to mongodb and mongodb will sent the data to angular.

is it possible to do that?
 for more details please find image for architecture


texts: Voucher generated code giving store credit/userpoints

texts:
I am looking into how to integrate vouchers and give specific users store credit, for each voucher code they type in.

The steps/logic would be

Voucher generated
Customer at checkout inputs voucher generated code
Specific user tied to that voucher gets x% store credit/userpoints on their account.

Is there any way to do this easily in Magento, or knows about an extension that gets this job done ?


texts: Getting all available category, subcategory list in magento 2

texts:
I want the replacement of the following code or similar to this code to get all category and subcategory in Magento 2.

$categories = Mage::getModel('catalog/category')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addIsActiveFilter();

any help will be appreciated

Thanks.


texts: where is function to remove all messages (add or error)? I want to remove message one by one, now magento deletes all at once.


texts: Problem with overriding the Account controller

texts:
I'm trying to override the loginactions, but i'm not to get this working. Removed all the cache and stuff, but its looking i'm missing a step. Mine files are like the following:

app/code/etc/Something_Customlogin.xml

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

app/code/local/Something/Customlogin/etc/config.xml

    <?xml version="1.0"?>
    <config>
        <modules>
            <Something_Customlogin>
                <version>1.0.1</version>
            </Something_Customlogin>
        </modules>
        <frontend>
            <routers>
                <customer>
                    <args>
                        <modules>
                            <Something_Customlogin before="Mage_Customer">Something_Customlogin
                            </Something_Customlogin>
                        </modules>
                    </args>
                </customer>
            </routers>
        </frontend>
    </config>

app/code/local/Something/Customlogin/controllers/AccountController.php

<?php
//Controllers are not autoloaded so we will have to do it manually:
require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';
class Something_Customlogin_AccountController extends Mage_Customer_AccountController {
    //Overloaded loginPostAction
    public function loginPostAction() {
        //Just to make sure
        echo "YES YES YES WE surely CAN!!";
        die;
    }

    /**
     * Customer login form page
     */
    public function loginAction() {
        echo "YES YES YES WE CAN!!";
        die;
    }
}

BUT I'm not getting the printed text on the login page?! I have the feeling that im missing something.

Any help appreciated!


texts: Magento 2: Unable to run setup:di:compile

texts:
Ran into this error when running setup:di:compile after composer install

 [RuntimeException]
  Source class "\Zend\Mvc\Controller\LazyControllerAbstract" for "Zend\Mvc\Controller\LazyControllerAbstractFactory" generation does not exist.

Any ideas how to fix or debug this? Thanks!


texts: Magento2 - Layout block do not work with cache enabled

texts:
I created my custom Block (php class), I add this Block inside two different containers on different blocks in xml file, each block also has a different .phtml

My php block is customizable by arguments passed via xml.

If I disable the cache, my blocks works fine. While with the cache enabled, I get twice the first block.

Here my code:

In <vendor>/<module>/view/frontend/layout/cms_index_index.xml:

<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="content">
        <referenceContainer name="evidenza">
            <block class="<Vendor>\<Module>\Block\ProductsList" name="product-evidenza" template="<Vendor>_<Module>::grid.phtml">
                <arguments>
                    <argument name="title_1" xsi:type="string">IN</argument>
                    <argument name="title_2" xsi:type="string">EVIDENZA</argument>
                    <argument name="title_span_class" xsi:type="string">red-satur-text</argument>
                    <argument name="products_count" xsi:type="string">4</argument>
                    <argument name="type_grid" xsi:type="string">evidenza</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="ispirazioni">
            <block class="<Vendor>\<Module>\Block\ProductsList" name="product-ispirazioni" template="<Vendor>_<Module>::ispirazioni.phtml">
                <arguments>
                    <argument name="title_1" xsi:type="string">ISPIRAZIONI</argument>
                    <argument name="products_count" xsi:type="string">2</argument>
                    <argument name="type_grid" xsi:type="string">ispirazioni</argument>
                </arguments>
            </block>
        </referenceContainer>
    </referenceContainer>
</body></page>

My php Block is used only to get the collection of the products in different ways according to the xml arguments.


texts: How to add modal popup when someone clicks on add to cart in product's page?

texts:
I have a Magento CE-1.9.2.4 installation and I am trying to add a modal popup when someone clicks on Add To Cart in product's page.

I edited the /app/design/frontend/mytheme/template/catalog/product/view.phtml file by adding

// Get the modal
var modal = document.getElementById('ordersAugust');

// Get the button that opens the modal
var btn = document.getElementById("btnOrdersAugust");

// Get the  element that closes the modal
var span = document.getElementsByClassName("close")[0];

// When the user clicks on the button, open the modal
btn.onclick = function() {
    modal.style.display = "block";
}

// When the user clicks on  (x), close the modal
span.onclick = function() {
    modal.style.display = "none";
}

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}

between

if (this.validator.validate()) {
...
  }
}.bind(productAddToCartForm);

and

      ×

HEADER

Thank you!

Footer

just outside the script tag of

var productAddToCartForm = new VarienForm('product_addtocart_form');
productAddToCartForm.submit = function(button, url) {

the javascript code is taken from http://www.w3schools.com/howto/howto_css_modals.asp

I have also edited the file /app/design/frontend/mytheme/template/catalog/product/view/addtocart.phtml by adding id="btnOrdersAugust" in

<button type="button" title="<?php echo $buttonTitle ?>" id="btnOrdersAugust" class="button btn-cart" onclick="productAddToCartForm.submit(this)">

        <?php echo $buttonTitle ?>

</button>

The javascript code is completely ignored and the product is added in cart (no javascript errors in console).

What I want is when clicking on Add To Cart, open a popup modal with info and when closing the modal to continue by adding the product to cart.


texts: magento 1.9, export data from grid to csv file

texts:
I am trying to export data to from my module to CSV file
in my grid.php file i have this code in  _prepareColumns()
$this->addExportType('*/*/groupDataExportToCsv',
            Mage::helper('purchasewizard')->__('CSV'));

        return parent::_prepareColumns();

in controller groupDataExportToCsvAction()
public function groupDataExportToCsvAction()
    {

        $fileName   = 'pw_groupdata.csv';
        $content    = $this->getLayout()->createBlock('purchasewizard/adminhtml_groupdata_grid')
            ->getCsvFile();
        $this->_prepareDownloadResponse($fileName, $content);

but in my CSV i have this
Id,Favorite,"Brand Template",Model,"Spec 1","Spec 2","Spec 3","Spec 4","Priority Index",Price,Stock,Sold,"On The Way","Last Price Update","Last Sold",Comment,Externals,"Item Type"
"24287",No,Fujitsu,"MODEL1 QEWJJWQEK 312","MODEL1 QEWJJWQEK 312","MODEL1 QEWJJWQEK 312","MODEL1 QEWJJWQEK 312","MODEL1 QEWJJWQEK 312",0,,0,0,"

            0
            &#9998;

        <input class=""edit_field"" type=""text"" name=""on_the_way"" value=""0"">
        &#10004;
        &#10006;

",,,,No,"Hard Drives"
"24286",No,Fujitsu,tested1,tested2,tested3,tested4,tested5,0,,0,0,"

how correctly export data to CSV file?


texts: What time zone should I set Magento for?

texts:
I live in KY US (Eastern Time UTC-05:00).

My customers are mostly from the US.

My server is in Phoenix AZ (Mountain Time UTC-07:00).

If I want to try to equal out the time as best as possible for US customers, would setting the Locale setting in Magento to something like Chicago be best or to my KY time or the server time?


texts: How can i have one image with multiple products?

texts: I'm developing a website for jewelry, so basically in one image a model is showing 3 products (earnings, a ring and a neckless). When a client clicks on the image, it basically has to show the list of 3 products and its prices. How can i do it?