texts: Magento 2 WYSIWYG field in custom admin form

texts:
I'm trying to add some fiels dynamically with Ui interface in a custom admin form.

in order_ticket_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
---
    <fieldset name="message" class="Bileamara\SalesOrderGrid\Ui\Component\Form\Fieldset\Ticket\Message">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Add Message in Every Language</item>
                <item name="sortOrder" xsi:type="number">20</item>
            </item>
        </argument>
    </fieldset>
</form>

and Bileamara\SalesOrderGrid\Ui\Component\Form\Fieldset\Ticket\Message

<?php
namespace Bileamara\SalesOrderGrid\Ui\Component\Form\Fieldset\Ticket;

use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentInterface;
use Magento\Ui\Component\Form\FieldFactory;
use Magento\Ui\Component\Form\Fieldset as BaseFieldset;
use Magento\Store\Model\System\Store as SystemStore;
use Magento\Cms\Model\Wysiwyg\Config as WysiwygConfig;

class Message extends BaseFieldset
{
    /**
     * @var FieldFactory
     */
    private $fieldFactory;

    protected $systemStore;

    public function __construct(
        WysiwygConfig $wysiwygConfig,
        SystemStore $systemStore,
        ContextInterface $context,
        array $components = [],
        array $data = [],
        FieldFactory $fieldFactory)
    {
        parent::__construct($context, $components, $data);
        $this->_wysiwygConfig = $wysiwygConfig;
        $this->systemStore = $systemStore;
        $this->fieldFactory = $fieldFactory;
    }

    /**
     * Get components
     *
     * @return UiComponentInterface[]
     */
    public function getChildComponents()
    {
        $wysiwygConfig = $this->_wysiwygConfig->getConfig([
                                                        'hidden' => 0
                                                        ]);

        $storeCollection = $this->systemStore->getStoreCollection();
        foreach ($storeCollection as $store) {
            $fields['message_'.$store->getCode()] = [
            'formElement' => 'wysiwyg',
            'label' => $store->getName(),
            'wysiwyg' => true,
            'required' => true,
            'config' => $wysiwygConfig,
            ];
        }
        foreach ($fields as $name => $fieldConfig) {
            $fieldInstance = $this->fieldFactory->create();
            $fieldInstance->setData(
                [
                    'config' => $fieldConfig,
                    'name' => $name,
                ]
            );

            $fieldInstance->prepare();
            $this->addComponent($name, $fieldInstance);
        }

        return parent::getChildComponents();
    }
}

Now I got the fields

but:

editor is hidden and should be visible
label is missing
there is no space betwin fields

I need to set field id different from name, somting like

id => message_en
name => message[en]

because i need message result in an array.

Any help?


texts: When overriding cards_list.phtml the data is not showing up

texts:
I am trying to override cards_list.phtml and here is what I did.

I added a custom module
I added
app/code/Vendor\Module/view/frontend/layout/vault_cards_listaction.xml
the first block
I added and changed the file app/code/Vendor\Module/view/frontend/templates/customer_account/cards_list.phtml

I see the changes I made however, the card details are missing.
It seems that $this->getChildNames() here is empty
What am I doing wrong?


texts: Place order button not working in Magento 2 - Cybersource

texts: I am using cybersource payment gateway in my Magento 2 webstore. When I reach the payment page and press back button in the browser, place order button is not working. Please help me in resolving the issue as we are receiving complaints from the customers.


texts: I have magento installed on host gator everything was working fine.But suddenly they said my magento CPU usage  is very high so they are suspending my account and recommended to me either buy dedicated server or resolve the magento cpu usage  issue. Can any body tell me how to find out which part of my magento web site is taking so much cpu usage.


texts:
I know this is common problem, I tried many solutions but things did not work.
I tried changing the url for admin from dashboard. Now dashboard redirects me to
store home page. I tried deleting cache files and session files. Also
set admin/url/use_custom to 0, admin/url/use_custom_path to 0 in database.
The login page opens as bare html with no css or js files working. when i login it redirects me to store homepage.
Any help would be great! thanks.

Update: Also tried changing the local.xml. Now the /index.php/admin gives 404 error and the new admin name "backend" (/index.php/backend) redirects to homepage.


texts: How can I add CMS Pages to the Main Menu?


texts: Magento2 : How to call Newsletter in PWA

texts: How can I add Newsletter in PWA Magento2 ?


texts: How to change default language to French

texts:
I am working with Magento 2.1.7 and I want to set up a website that will completely display in French.

I did install the community version, 2.1.7 of it and it works well.

But I am trying to change the default language to French and it's a bit hard to do (Two weeks later, It is still not done).

I did change the language to French in Store configuration > General :

Country Options
Locale Options
Site Information

But everything is still in English.

I found a lot of tutorials on that issue. But they all talk about previous versions of Magento 2.x. This one (the 2.1.7) seems a bit different.

Can anybody help me find out How to Change The Default Language To French or another language?


texts: Problem with magento 2.0.2 CE after upgrading to php7.0

texts:
I had a perfectly good and running magento 2.0.2 CE but after I updated the php version from php5.6 to php7.0  everything stopped working and i get the fallowing output in the var/report/errornumberfile:

a:4:{i:0;s:168:"Notice: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' in /magento_server_dir/vendor/magento/framework/Encryption/Encryptor.php on line 397";i:1;s:3415:"#0 /magento_server_dir/vendor/magento/framework/Encryption/Encryptor.php(397): Magento\Framework\App\ErrorHandler->handler(8, 'Use of undefine...', '/var/www/html/m...', 397, Array)
#1 /magento_server_dir/vendor/magento/framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('ee4e3ea10ae0cdd...', 0, false)
#2 /magento_server_dir/vendor/magento/module-config/Model/Config/Backend/Encrypted.php(107): Magento\Framework\Encryption\Encryptor->decrypt('PayPal')
#3 /magento_server_dir/vendor/magento/framework/App/Config/MetadataProcessor.php(86): Magento\Config\Model\Config\Backend\Encrypted->processValue('PayPal')
#4 /magento_server_dir/vendor/magento/framework/App/Config/Data.php(32): Magento\Framework\App\Config\MetadataProcessor->process(Array)
#5 /magento_server_dir/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(99): Magento\Framework\App\Config\Data->__construct(Object(Magento\Framework\App\Config\MetadataProcessor), Array)
#6 /magento_server_dir/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#7 /magento_server_dir/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#8 /magento_server_dir/vendor/magento/framework/App/Config/DataFactory.php(46): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#9 /magento_server_dir/vendor/magento/framework/App/Config/ScopePool.php(90): Magento\Framework\App\Config\DataFactory->create(Array)
#10 /magento_server_dir/vendor/magento/module-backend/App/Config.php(41): Magento\Framework\App\Config\ScopePool->getScope('default', NULL)
#11 /magento_server_dir/vendor/magento/module-backend/App/Area/FrontNameResolver.php(82): Magento\Backend\App\Config->getValue('admin/url/use_c...')
#12 /magento_server_dir/vendor/magento/module-backend/Helper/Data.php(206): Magento\Backend\App\Area\FrontNameResolver->getFrontName(false)
#13 /magento_server_dir/vendor/magento/module-backend/App/Request/PathInfoProcessor.php(46): Magento\Backend\Helper\Data->getAreaFrontName()
#14 /magento_server_dir/var/generation/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php(95): Magento\Backend\App\Request\PathInfoProcessor->process(Object(Magento\Framework\App\Request\Http), '/index.login.ac...')
#15 /magento_server_dir/vendor/magento/framework/App/Request/Http.php(161): Magento\Backend\App\Request\PathInfoProcessor\Proxy->process(Object(Magento\Framework\App\Request\Http), '/index.login.ac...')
#16 /magento_server_dir/vendor/magento/framework/HTTP/PhpEnvironment/Request.php(194): Magento\Framework\App\Request\Http->setPathInfo()
#17 /magento_server_dir/vendor/magento/framework/App/Request/Http.php(204): Magento\Framework\HTTP\PhpEnvironment\Request->getPathInfo()
#18 /magento_server_dir/vendor/magento/framework/App/Http.php(110): Magento\Framework\App\Request\Http->getFrontName()
#19 /magento_server_dir/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#20 /magento_server_dir/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#21 {main}";s:3:"url";s:19:"/index.login.action";s:11:"script_name";s:10:"/index.php";}

Does someone knows the solution to this problem ? Any help is appreciated. Thank you!!


texts: magento 2 Add to cart popup is not working after load the product using infinite ajax scroll

texts:
I have used infinite ajax scrolling on product listing page.Its working but there are one issue.

Add to cart popup is not working after load product using infinite ajax scrolling.

Please check bellow URL:

https://magento.minidisc.com.au/headphones/open-headphones

Thanks


texts: Magento 2 - How to change the less variables based on admin configurations?

texts:
I'm working with Magento 2 - beta. I want to set the colors and other less variables in the extension's block, controller, or module, eg: @primary__color.

Anyone know how to do this?

I want to set the values of the less variables dynamically based on admin color configurations.


texts:
I recently discovered my product stock alert e-mails aren't being sent. When I checked the cron_schedule table in my DB, I see the following:

Which basically tells me there hasn't been any execution of this job since november 2014. Since this is a (fairly large) live site, I'd like to double check a few things. Would it be safe for me to change the following:

from config.xml in this path: app\code\core\Mage\ProductAlert\etc

<jobs>
   <catalog_product_alert>
      <run>
     <model>productalert/observer::process</model>
  </run>
  </catalog_product_alert>
</jobs>

to

<jobs>
   <catalog_product_alert>
         <schedule>
     <cron_expr>* * * * *</cron_expr>
         </schedule>
     <run>
     <model>productalert/observer::process</model>
  </run>
  </catalog_product_alert>

Since there have been thousands of product stock alert subscribers since that date.. I'm not quite sure if it is safe to do so.

EDIT:  As for right now I'm starting to wonder if this is in fact the problem. I've checked the product_alert_stock table and it tells me the last e-mail was sent on june 7th, which is also not correct but maybe this particular cron catalog_product_alert is no longer used for this execution. Does anybody know wether this is true or not?


texts: Problem importing products with multiple categories from XML files into magento 1.9

texts:
I have a php script that extracts the products from the XML file and imports them in magento 1.9 assigning products to the parent category and to all child categories. The problem arises when I want to assign the product also to a secondary category that is not part of the tree.
Example:

Product --Main Category ---> Subcategory1 ---> Subcategory 2
Product ---> Secondary Category

Step 1 works, while step 2 doesn't.
Below is the part of php code that extracts the data from the XML file and the part of the XML file relating to the categories.
PART OF XML FILE
<MainCategory>835</MainCategory><MainProdCategory>835</MainProdCategory>
<ProdCategories>
<ProdCategory>
<Id>835</Id>
<Name>EARRINGS</Name><Name lang="it-IT">EARRINGS</Name>
<FullPathName>JEWELS/ EARRINGS / BIJOUX</FullPathName></ProdCategory>
<ProdCategory><Id>843</Id><Name>CHRISTMAS OFFERS</Name>
<Name lang="it-IT">CHRISTMAS OFFERS</Name><FullPathName>CHRISTMAS OFFERS</FullPathName>
</ProdCategory>
</ProdCategories>

PART OF PHP SCRIPT
$category_xml = $prod->ProdCategories[0]->ProdCategory[0]->FullPathName[0];
        $cat_split = explode('/',$category_xml);

        foreach ($cat_split as $cat){

            $cat = trim($cat);
            $category = Mage::getResourceModel('catalog/category_collection')
                ->addFieldToFilter('name', $cat)
                ->getFirstItem();

            $cat_ids[] = intval($category->getId());

        }

Currently in magento the product is assigned only to the JEWELS categories and its sub-categories, EARRINGS and BIJOUX, but it is not assigned to the CHRISTMAS OFFERS category.
Can anyone give me advice on how to modify the script to allow the product to be assigned to secondary categories as well? Thank you so much!


texts: Shipping charges are not saving in Database if we added Product to cart through Android App

texts:
we are using 2 shipping methods in our site.

Table rate shipping method
Custom shipping method  [ extension]

we are doing Android app for our magento site.

when we use default shipping methods [ example :  "Table rate shipping method " ,code : "tablerate_bestway" ] shipping charges are working fine in site and in andriod app.

when we use custom shipping method [ example : "custom shipping method 1" , code "ship_ship" ] shipping charges are working fine in site  but we are getting "0" as shipping charges in android app Because in APP, shipping charges are not saving in "sales_flat_quote_shipping_rate " table It showing "0" in that table.

this is the problem. what we need to do so that shipping charges should work in andriod app when we use custom shipping method.


texts: Magento 2: Set attribute dropdown option programmatically

texts: How to set product's attribute dropdown option programmatically?


texts: While Saving a Product I get this error A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.  Out of 145 Products with the same AttributeSet, I have 5 that display this error.  I have search Magento and there are many incidents reported but none when saving a product.  I have tried flushing cache, reindexing, installed an extension that should detect conflicts and nothing works.  My last resort is to ask the questions with the hopes that someone who has solved this problem sees this post. Running Magento 2.3.4 on Centos 7.7 WHM 86.0.17 PHP 7.2.29


texts: Magento 2 SOAP API getList not returning correct content-type

texts:
getList method for SOAP API XML response has data but returning incorrect content type:
Content-Type: application/json; charset=UTF-8
I can see all the data fine if I print $searchResults on return Error: Parse Error: Expected HTTP after investigating I can see Content-Type: application/json; charset=UTF-8. It seem that is set content-type wrong not sure how to set content type for XML application/soap+xml; charset=utf-8 or magento does automatically ?
Same call for rest it's ok but need to change the return type for xml!
Thanks.


texts: anyone know where is the value came from?

texts:
Anyone know where this value came from?
I have no idea why it is showing...

Please help


texts: How to convert Adobe XD design to Magento 2 Custom Theme?

texts:
I have Adobe XD Design, how to apply as a custom theme, my parent theme Default, how to apply the files. I am using Magento Enterprise Edition.
Note: Any basic docs welcome


texts:
I am new to Magento and few days ago my website is hacked by spammers.
Now I want to rebuilt my droplet. Can someone please tell me step by step process.
I can install LAMP and Magento template, only concern I have about is my Database. I don't want to re-upload all my products and also don't want to loose customers account. I just want to know is it possible to import only users account and products table? If yes please let me know how.

Thanks


texts: Simple text translation depending on store view

texts: I am creating a simple module that displays a date. I need the days (Monday, Tuesday, etc.) to be translated in the store view language.   I've gotten lost in all the different ways that this could be done:1) Where should I create the .csv file? (preferably in my module, if that's at all possible) 2) How would I tell Magento which words to translate? I'm currently using the indexcontroller.php to display the date (In case that changes something). Can someone guide me through this or suggest a tutorial that I might have missed?


texts:
I am starting populating few items for test.

My subcategories list are only displaying one product if I go to subcategory url key. But the products count show the right total number on category or subcategory.

I have checked the items below

the mysql config_data has {{unsecure_base_url}} and {{secure_base_url}}
Removed the .html from Product URL Suffix and Category URL Suffix
Category and Subcategry is enabled and show in navigation
Use Categories Path for Product URLs and Create Permanent Redirect for URLs if URL Key Changed selected YES
Use Canonical Link Meta Tag For Products and Use Canonical Link Meta Tag For Categories selected YES
Maximal Depth 0
I checked var/report and var/error nothing when I go to subcategory url key
index.php is set to 1 to display errors and uncomment
Target path gives me save error of display one product
I have cleared cache of var/cache and refresh on admin
Reindexed data
Create Permanent Redirect for old URL checked

If I clicked root categories it shows all products from subcategories.
If I navigated through layered navigation Categories then Subcategories it shows all products.

But if I go to subcategory url key it only show 1 product.

What I am doing wrong? How can I fix it or see the error?


texts: How to use jQuery function on onKeyPress input event? (Magento 2)

texts:
I have this field (postcode or zipcode)

<input class="input-text col s12 zipcode" type="text" data-bind="
value: value,
valueUpdate: 'keyup',
hasFocus: focused,
attr: {
    name: inputName,
    placeholder: placeholder,
    'aria-describedby': getDescriptionId(),
    'aria-required': required,
    'aria-invalid': error() ? true : 'false',
    id: uid,
    disabled: disabled
}" name="postcode" aria-required="true" aria-invalid="false" id="zipcode" onKeyPress="MascaraCep(co-shipping-form.zipcode)">

CEP

wich has onKeyPress="MascaraCep(co-shipping-form.zipcode) event

and my masks.js:

/**
    Application
    */

require(['jquery'], function($) {

    console.log("Masks is loaded (mage2/m2materialize/web/js/masks.js)");

    /* Start */

    $(document).ready(function(){

        /* Start */

        //adiciona mascara de cep
        function MascaraCep(cep){
                        if(mascaraInteiro(cep)==false){
                        event.returnValue = false;
                }
                return formataCampo(cep, '00.000-000', event);
        }

        //valida numero inteiro com mascara
        function mascaraInteiro(){
                if (event.keyCode < 48 || event.keyCode > 57){
                        event.returnValue = false;
                        return false;
                }
                return true;
        }

        //formata de forma generica os campos
        function formataCampo(campo, Mascara, evento) {
                var boleanoMascara;

                var Digitato = evento.keyCode;
                exp = /\:|\-|\.|\/|\(|\)| /g
                campoSoNumeros = campo.value.toString().replace( exp, "" );

                var posicaoCampo = 0;
                var NovoValorCampo="";
                var TamanhoMascara = campoSoNumeros.length;;

                if (Digitato != 8) { // backspace
                        for(i=0; i<= TamanhoMascara; i++) {
                                boleanoMascara  = ((Mascara.charAt(i) == ":") || (Mascara.charAt(i) == "-") || (Mascara.charAt(i) == ".") || (Mascara.charAt(i) == "/"))
                                boleanoMascara  = boleanoMascara || ((Mascara.charAt(i) == "(")
                                                                        || (Mascara.charAt(i) == ")") || (Mascara.charAt(i) == " "))
                                if (boleanoMascara) {
                                        NovoValorCampo += Mascara.charAt(i);
                                          TamanhoMascara++;
                                }else {
                                        NovoValorCampo += campoSoNumeros.charAt(posicaoCampo);
                                        posicaoCampo++;
                                  }
                          }
                        campo.value = NovoValorCampo;
                          return true;
                }else {
                        return true;
                }
        }

    });

});

but my console display:

Masks is loaded (mage2/m2materialize/web/js/masks.js)
Uncaught ReferenceError: MascaraCep is not defined


texts: Mageto 2.3.4: What causes only a few category pages on the development site to redirect to the live?

texts: We have a dev site which we use for testing any feature before it is deployed on the live server. A couple of category pages are found to redirect to the category pages on the live site. What causes only a few category pages on the development site to redirect to the live? Any suggestions or solutions that I can try out?


texts: I have the following issue and i am not sure how to add it. I have a shop with a tax rate of 24% in all of my products and all customers because i just sell in one country. The problem is that i have to add an extra tax in just a few products of my shop (recycling tax).


texts:
In magento 2 how i can add product into cart using quantity box increament button(+) automatically?
I want to add product automatically in to cart  when i click on qty box plus buttom and auto remove product from cart when i click on qty box minus button


texts: Some admin users can not see all the products

texts:
We have come across a strange issue.
We are 3 people with admin privileges in our Magento admin site.
When we search for a specific SKU in filter, 2 of us get the same result and 1 get a totally different result.
2 of us get 2600 records and we can go to the next page etc, but the last one he only gets 1 record found but is showing 999 records but are not able to go to next page. When i uses the tick boxes on the left side to tick 1 box then all the boxes gets ticked.
We have made sure that we are using the same filters etc.
Anyone that had the same issue knows how to fix this?
thanks.


texts: Magneto2 : Add color swatch attribute option with colorcode value programmatically

texts:
I am working on Magento 2 and want to add custom color in color swatch attribute option programmatically. I have gone through this post but unable to add options

Can anyone helps me to add custom attribute option with color = Black , color code = #000000 programmatically

Thanks in advance. Any help would be appreciated.


texts:
Magento 2.1.2
PHP Version: 5.6.17
MySQL Version: 5.6.33

The store is completely set up, designed and in production mode. Braintree payment method is set up. Categories and products are created. Everything seems to work fine; except "Add to Cart" or checkout.

When I navigate to storefront as a guest and click "Add to Cart" to add the product to cart, it doesn't work-- It redirects to a blank page with the error below...

"The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete".

Additional information

I have tried it in all browsers and got the same error result

NOTE: It's a Magento multistore

Any had this issue before? And what could be causing this?

Thanks in advance!


texts: Can't login to Magento Connect Manager - 1.7.0.2

texts:
I've been banging my head against my keyboard with this problem! A couple days ago it worked just fine, however now I cannot login to my Magento Connect Manager. It redirects me to the 404 page of my root folder (magento is in a subfolder).

A little bit about my setup...
I have magento installed in a subfolder (public_html/magento)
I have Opencart installed in my root folder (that is currently my live site
I am testing magento in the subfolder and preparing to launch soon).
When I try to login to Magento Connect it redirects me to the 404 page of my opencart site in my root folder.

Some things I have ALREADY tried...
Changing permissions of "downloader" folder and it's index.php to 0777, 0755, 0644, etc. Multiple combinations.
Re-installing magento
Double checked base_url rewrites in my backend config (as well as in the database)
Changing my admin password
Deleting the last extension I had installed before I noticed it stopped working

I'm hoping someone can help me! I have gone through everything I can find on google and unfortunately nothing is working. Any help is greatly appreciated :)


texts: 1.9 CMS Static blocks different style from CMS Pages

texts:
Viewing a cms page, It uses skin/frontend/rwd/default/css/styles.css when I copy and paste the same CMS page content in a static block for category view, the styles are rendered differently from the CMS page style.css that i wanted

I checked
 app/code/core/Mage/Cms/Block/block.php
 app/code/core/Mage/Cms/Block/page.php
Both are 100% identical

I also checked
 app/design/frontend/rwd/default/layout/page.xml
 app/design/frontend/rwd/default/template/page/1column.phtml

Static block - Incorrect style format https://eliteshoppercentral.com/about.html

CMS Page - Correct style format https://eliteshoppercentral.com/about-us/

Styles.css doesn't apply to static blocks like it does with pages.
I have 260ms load time, other methods sacrifice performance or add redundant pages to my cache.
What can be done to have static blocks display clean like the CMS page?


texts: Catalog Price Rules - product prices are being reset automatically at midnight

texts:
I am using Magento CE 1.8.1.0.
I set a few catalog price rules with not date range.
After clicking "save & apply" rules are applied correctly.
But each night at about midnight all prices become regular again.

I commented  the catalogrule_apply_all job in the etc.xml file as I thought it's processing reset the prices, but prices were still reset.

Any idea which automatic process might reset the prices?

Thanks


texts:
I'm trying to migrate the code of my magento 1.9 store to 2.1, after a successfull data migration.

To this end, i'm using the code migration tool (https://github.com/magento/code-migration).

On the convertPhpcode step, i get a lot of warnings like the following :

←[0;33m[2016-08-22 15:20:33][WARNING]: Could not map alias checkout of type helper←[0m
←[0;33m[2016-08-22 15:20:33][WARNING]: Class not found for alias "checkout"←[0m
←[0;33m[2016-08-22 15:20:33][WARNING]: Can not map helper class: 'checkout/cart'←[0m
←[0;33m[2016-08-22 15:20:33][WARNING]: Could not map alias catalog of type model←[0m
←[0;33m[2016-08-22 15:20:33][WARNING]: Class not found for alias "catalog"←[0m

That is for this block of code :

        $cartHelper = Mage::helper('checkout/cart');
        $cartItems = $cartHelper->getCart()->getItems();
        foreach ($cartItems as $cartItem) {
          $attrDuration = Mage::getModel('catalog/product')->load($cartItem->getProduct()->getId())
            ->getDuration();
        if (isset ($attrDuration)) {
            $duration -= $attrDuration;
        }
    }

Now i understand that their is some missing mapping for the checkout/cart helper to be converted, but i'm not able to figure where i should add the mapping, and on what i should map, and my research didn't bring up anything to help me understand.

Do you have any idea, link, or tutorial that could be helpfull ? Thanks in advance !


texts: Proper way to upgrade from Magento 1.9.0.1 to 1.9.3 WITHOUT using Magento Connect Update

texts:
There have been a lot of threads, but I think my question differs a little.

We plan to migrate from 1.9.0.1 to 1.9.3. By doing so we want to utilize bash.

Our problems:

earlier developer has changed core files
we have two folders of Magento (m-v1 [= 1.9.0.1], m-v2 [= 1.9.3])

So the file structure looks like this:

- m-v1
- - app
- - ..

- m-v2
- - app
- - ..

We now want to copy ALL custom files from m-v1 to m-v2 with rsync.

For that we use the following code:

OLDDIR="~/html/m-v1"
NEWDIR="~/html/m-v2"
MEDIADIR="$OLDDIR/media/"
echo "$MEDIADIR" >> log.txt

rsync -au "$OLDDIR/media/" "$NEWDIR/media"
rsync -au "$OLDDIR/app/code/community/" "$NEWDIR/app/code/community"
rsync -au "$OLDDIR/app/code/local/" "$NEWDIR/app/code/local"
rsync -au "$OLDDIR/app/design/" "$NEWDIR/app/design"
rsync -au "$OLDDIR/app/etc/modules/" "$NEWDIR/app/etc/modules"
rsync -au "$OLDDIR/app/locale/" "$NEWDIR/app/locale"
rsync -au "$OLDDIR/js/" "$NEWDIR/js"
rsync -au "$OLDDIR/skin/" "$NEWDIR/skin"

Now we come to the question itself:

Beside the local.xml, that has yet to be copied, what else is missing here in order to keep Magento working? It seems that I'm missing something, but I cant figure it out. Is my script sufficient? Are there any better ways to upgrade?

About the core changes: I'm trying to point changed files out and move changed content to modules respective files, in order to make this installation upgrade-able again.


texts: How to deal with site configuration when building new site

texts:
What is the best way to deal with site configurations when building a site?

I am currently religiously using upgrade and install scripts for everything, meaning a zero configuration state when moving a site betweene environments etc.

However, some things in Magento just dont lend themselves to upgrade scripts and it is starting to become a little bit messy.

An example, is i am using the webshopapps matrix rate module and am writing an install script for my site that creates the required entries in the webshopapps shipping rate table.

However, in order to get that to work, i need to make my sites local module depend on the webshopapps module.

Really what I am asking here is what are the best practices for developing like this?


texts:
Datatable version 1.10.15

requirejs-config.js

var config = {
    paths:{
        'dataTables': 'df_Comercial/js/datatables.min',
    },
    map: {
        '*': {
            'dataTables': 'df_Comercial/js/datatables.min',
        }
    },
};

template.phtml

require(['jquery', 'dataTables'],function($){
            $('#commercial-customers-list-table').DataTable();
        });

But i keep getting several errors, sometime this:

require.js:166 Uncaught Error: Mismatched anonymous define() module: function (l){return c(l,window,document)}
http://requirejs.org/docs/errors.html#mismatch
    at makeError (require.js:166)
    at intakeDefines (require.js:1221)
    at require.js:1408

sometimes this other one:

datatables.min.js:206 Uncaught TypeError: Cannot read property 'responsive' of undefined
    at j (datatables.min.js:206)
    at responsive.js:14
    at Object.execCb (require.js:1650)
    at Module.check (require.js:866)
    at Module.<anonymous> (require.js:1113)
    at require.js:132
    at require.js:1156
    at each (require.js:57)
    at Module.emit (require.js:1155)
    at Module.check (require.js:917)

And then sometimes it just works without errors. The datatables plugin modifies the table always, i can search, sort, etc no matter what error displays but, i guessing, that because an error occurs it breaks the knockoutjs which does not add classes to the main navigation menu divs and then the css style is just gone

When the error appears the ul tag get stuck with

data-mage-init="{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}

Magento is in development mode, all caches disabled


texts:
I want to customize cart page. I want to move the position of side blocks(discount coupon, shipping and tax and grand total) just below the cart items table.

I tried using "before" and "after" by editing catalog.xml but there was no change in their positions.


texts: How to call a product attributes in magento left column of product page?

texts:
I want to display product attribute in product page left column, when I try this code :

echo $_product->getAttributeText('your_attribute_code');

It is returning fatal error. Can you guide me how to solve this?


texts:
$model=Mage::getModel("test_hello/hello");

Here I load model like above. My module is in local code pool. Magento gives me warning message like below,

`include(Mage/Test/Hello/Model/Hello.php): failed to open stream: No such file or directory`

My config xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Test_Hello>
            <version>1.0.0.0</version>
        </Test_Hello>
    </modules>
    <globel>
        <models>
            <hello>
                <class>Test_Hello_Model</class>
                 <resourceModel>news_resource</resourceModel>
            </hello>
             <news_resource>
                <class>Test_Hello_Model_Resource</class>
                <entities>
                    <hello>

test_hello

                    </hello>
                </entities>
            </news_resource>
        </models>
        <helpers>
            <hello>
                <class>Test_Hello_Helper</class>
            </hello>
        </helpers>
        <resources>
            <hello_setup>
                 <setup>
                    <module>Test_Hello</module>
                </setup>
            </hello_setup>
        </resources>
        <blocks>
            <hello>
                <class>Test_Hello_Block</class>
            </hello>
        </blocks>
    </globel>
    <frontend>
        <routers>
            <hello>
                <use>standard</use>
                <args>
                    <module>Test_Hello</module>
                    <frontName>helloda</frontName>
                </args>
            </hello>
        </routers>
        <layout>
            <updates>
                <hello>
                    <file>hello.xml</file>
                </hello>
            </updates>
        </layout>
    </frontend>

</config>


texts: M1.x Is Magento updated_at changed on Credit Memo / Refund when using Mage::getModel('sales/order')->getCollection()?

texts:
Is Magento updated_at changed on Credit Memo / Refund when using
  Mage::getModel('sales/order')->getCollection()?

We use

  Mage::getModel('sales/order')->getCollection()

to find orders that have recently been placed.

Only after an order was shipped it can be returned and credit memoed/refunded.

With the below query would we then also include the credit memo's because updated_at is touched when issuing the credit memo or i this not the case -- and do we need some more magic to inlcude the credit memo orders?

thx

$collection = Mage::getModel('sales/order')->getCollection()
->addAttributeToSelect('customer_id', $customer_id)
->addFieldToFilter('status', array('eq' => 'complete'))
->addFieldToFilter('updated_at', array('from' => $dateStart, 'to' => $dateEnd));


texts:
I am getting an error

Call to a member function append()....Mage/Adminhtml/Controller/Action.php on line 122
.  I have worked out it is down to my indexAction in the controller

public function indexAction()
{
    $this->_addContent($this->getLayout()->createBlock('prefs/adminhtml_forms'));
    $this->renderLayout();
}

So I have taken a look at the origin of the error

protected function _addContent(Mage_Core_Block_Abstract $block)
{
    $this->getLayout()->getBlock('content')->append($block);
    return $this;
}

I see it requires a block that has to be Mage_Core_Block_Abstract and the block I am calling is Mage_Adminhtml_block_Widget_Grid_Container, however digging down I find Mage_Core_Block_Abstract is the being extended.

So I'm now left with the question, what have I done wrong and how do I resolve it?

class Ps_Prefs_Block_Adminhtml_Forms
extends Mage_Adminhtml_block_Widget_Grid_Container
{
public function _construct()
{
    $this->_controller = 'adminhtml_forms';//path to block
    $this->_blockGroup = 'prefs';//module name
    $this->_headerText = $this->__( 'Form Fields' );
    $this->_addButtonLabel = $this->__( 'New Field' );
    parent::_construct();
}

protected function _prepareLayout()
{
    $this->setChild( 'grid',
            $this->getLayout()->createBlock( $this->_blockGroup . '/' . $this->_controller . '_grid',
            $this->_controller . '.grid' )->setSaveParametersInSession( TRUE ) );
    return parent::_prepareLayout();
}
}


texts: Shipping Price Based On Manufacturer Attribute

texts:
I have a unique requirement from client for setting shipping charges from them. The requirement is as follows.

1) They are having products from different parts of the world.
2) They need to set shipping price based on brands of that product.
3) It is same like Brands Vs Destination table rates.

What they need is this

Here the shipping cost is for 1 product. its something like Brand VS No Of Items Vs Destination.

Can anyone help me in this. Also please let me know if there are any extensions available for it.


texts: Magento 2: get customer id of logged in user with cache enabled

texts:
I need to get the customer id of the user that is logged in. Using the following code it works fine for blocks where cache is disabled. But when there's a cached block on the page, it's null. Even if the customer is logged in. It is intended behavior for the customersession to be cleared when caching is active on a page but I need the customer id to show customer specific prices (B2B).

$customerSession = $objectManager->get('Magento\Customer\Model\Session');
if(!$customerSession->isLoggedIn()) {
    $customerId = $customerSession->getCustomer()->getId();
}

I need to be able to get the customer id on all pages where prices are displayed for products. So, for example, the category list/grid page and the product details page.

I have read countless of bug reports on github but they all get closed by Magento as if it's no issue.


texts: Magento 2 override Pricing\Price\ConfigurablePriceResolver how to solve?

texts:
Hi I'm using Magento 2.

I'm trying to override Pricing\Price\ConfigurablePriceResolver by adding a plugin or preference in the app/code folder but I can't make it work.

I need to replace the function resolvePrice() in

  Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver

with my custom code so it won't have any bug.


texts:
This is my ajax request:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $(".emailfocusout").focusout(function(){
            $.ajax({
                url: '/checkout/Email/Email',
                type: 'POST',
                data: {'email': 'che607@yahoo.com'},
                contentType: 'application/json',
                success: function(data) {
                    console.log('SUCCESS: ', data);
                },
                error: function(data) {
                    console.log('ERROR: ', data);
                },
            });
        });
    });
</script>

This is my controller:

public function EmailAction()
{
    // TODO: Implement me!  Here are some hints ;-)

    $email = $this->getRequest()->getParam('email');
    var_dump($email);
    echo $email;
}

I can't save - data: {'email': 'che607@yahoo.com'} - to -  $email = $this->getRequest()->getParam('email');

What am I doing wrong?

* UPDATE - SOLVED *
I took data out of the ajax request.  And in URL I put:

url: '/checkout/Email/Email/email/me@example.com',

I worked like that.


texts: Magento 2 - How was the static block added above contact-us form in magento sample data?

texts:
I just installed a fresh magento 2.4.1 with sample data. I noticed that the contact us site shows a static block contact-us-info above the form.
But I could not figure out how that block was added.


texts: How to customized advanced search in Magento 2?

texts:
I want to customized the advanced search in Magento 2.

When I want to go to the advanced search URL, below steps will appear:

1) An input field to enter the name of the user, then "Go to Started."
Button.

2) 1st question will appear to select an answer, then click "Next
Button".

3) 2nd question will appear to select an answer, then click "Next
Button".

4) 3rd question will appear to select an answer, then click "Next
Button".

5) finally, search button will appear and product will be searched on
click the search button.

Also, the "Previous button" will appear with each question.

I have created each question as the product attribute and add
their values.

Please suggest customized advanced search like this.


texts: In what order are theme files processed?

texts:
Please note this question is about the yet-to-be-released Magento 2, which I'm still trying to get to grips with.

Each module contributes to each layout handle separately.  For example, the default handle is made up of these files:

app/code/Magento/Catalog/view/base/layout/default.xml

app/code/Magento/Bundle/view/frontend/layout/default.xml
app/code/Magento/CatalogSearch/view/frontend/layout/default.xml
app/code/Magento/Catalog/view/frontend/layout/default.xml
app/code/Magento/Checkout/view/frontend/layout/default.xml
app/code/Magento/Cms/view/frontend/layout/default.xml
app/code/Magento/Contact/view/frontend/layout/default.xml
app/code/Magento/Customer/view/frontend/layout/default.xml
app/code/Magento/Directory/view/frontend/layout/default.xml
app/code/Magento/GoogleAnalytics/view/frontend/layout/default.xml
app/code/Magento/Newsletter/view/frontend/layout/default.xml
app/code/Magento/PageCache/view/frontend/layout/default.xml
app/code/Magento/Reports/view/frontend/layout/default.xml
app/code/Magento/Rss/view/frontend/layout/default.xml
app/code/Magento/Sales/view/frontend/layout/default.xml
app/code/Magento/Theme/view/frontend/layout/default.xml
app/code/Magento/Weee/view/frontend/layout/default.xml
app/code/Magento/Widget/view/frontend/layout/default.xml
app/code/Magento/Wishlist/view/frontend/layout/default.xml

The base files come first followed by frontend files, followed by a number of themes.  I would like to know which order those in frontend are used.  I think Magento/Theme/... must be first because many others make references to it's blocks, be it adding, moving or removing.

I considered they might be following dependency order but that isn't adequate because there are many circular dependencies.  For example, Magento_Customer depends on Magento_Theme as you would expect, but Magento_Theme also depends on Magento_Customer.  If the wrong order is followed then important customer blocks would not be shown.

By setting breakpoints I've worked out the files are not loaded in any particular order, they are just dumped into a merged DOM to be dealt with later.  But I cannot tell what happens to the merged data afterwards, is it some kind of magic?


texts:
How to add custom footer template for product view page in magento2.

How to do that.
Thanks.

Update:

 1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Theme::html/footer/trustworthy.phtml' in module: '' block's name: 'trust.shy'

In default.xml:

<referenceContainer name="footer-container">
 <block class="Magento\Framework\View\Element\Template" name="trust.shy" template="Magento_Theme::html/footer/trustworthy.phtml" after="subscribe.container"/>
</referenceContainer>

Added template in following path /var/www/html/magento/app/design/frontend/OX/shy/Magento_Theme/templates/html/footer/trustworthy.phtml


texts: Upgraded to 2.4.1 now "out of Memory" on admin Order Grid

texts:
I upgraded to 2.4.1 from 2.3.6 and now cannot load the admin orders grid
Everything else seems OK, including things that are far more memory intensive, as far as I know, than the orders grid.
Currently running on php7.3.23 and the php memory limit is 2G
This is not a big site and I had done some test runs, but of course the test runs were done after taking personal information and orders out, for data protection reasons. So 10 test orders instead of 2500 live orders. But 2500 orders is not a massive amount either!
I don't even know where to start on this, hoping someone's seen this before?
I exported and imported the orders to one of the clone test sites, and there it instantly shows, no issues. I don't know where to look, there's nearly no difference in modules and they are on the same server, same environment etc.
The out of memory seems to be a bit random but mostly happens on Zend/Db/Adapter/Pdo/Abstract.php
[06-Nov-2020 08:10:38 UTC] PHP Fatal error:  Out of memory in vendor/colinmollenhour/cache-backend-file/File.php on line 202

[06-Nov-2020 08:35:14 UTC] PHP Fatal error:  Out of memory  in vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.
php on line 295

[06-Nov-2020 09:19:23 UTC] PHP Fatal error:  Out of memory  in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php
on line 121

[06-Nov-2020 10:14:12 UTC] PHP Fatal error:  Out of memory in vendor/magento/framework/Interception/PluginList/PluginList.php on
line 190


texts: Building javascript "Order by for same day shipping" countdown timer

texts:
I've got an online store in Magento and I want to add a countdown timer so that if a customer orders by 5pm Eastern Standard time their product will ship the same day. I need it to be freely usable in the CMS and individual product descriptions. I need it only in Javascript. I have a working solution below. I just need it to only countdown against Eastern Standard Time. We are based in EST but have customers in different timezones.

Here is the code so far:

if (document.getElementById('countdownTimer')) {
  pad = function(n, len) { // leading 0's
    var s = n.toString();
    return (new Array( (len - s.length + 1) ).join('0')) + s;
  };

  var timerRunning = setInterval(
    function countDown() {
      var now = new Date();
      if ( (now.getDay() >= 1) && (now.getDay() <= 5) ) { // Monday to Friday only
        var target = 17; // 15:00hrs is the cut-off point
        if (now.getHours() < target) { // don't do anything if we're past the cut-off point
          var hrs = (target - 1) - now.getHours();
          if (hrs < 0) hrs = 0;
          var mins = 59 - now.getMinutes();
          if (mins < 0) mins = 0;
          var secs = 59 - now.getSeconds();
          if (secs < 0) secs = 0;
          var str = pad(hrs, 2) + ':' + pad(mins, 2) + '.<small>' + pad(secs, 2) + '</small>';
          document.getElementById('countdownTimer').innerHTML = str;

        }
      }
    }, 1000
  );
}


texts: Magento 2 Access shipping code from Payment Moule

texts: How can we get the shipping method code from the Payment Module to, activate/deactivate payment method based on selected shipping method?


texts: Magento 2 : Call Function From app/code to app/design

texts:
Is there any way to call function defined in the app/code/Custom/Module/helpers/HelperClass.php inside the app/design/frontend/Custom/Theme/Magento_Theme/template/html/View.phtml in Magento 2?

I'm fairly new with magento 2, so I have no idea on how to achieve this.


texts: How to Log user activity in frontend and admin

texts:
Is there any way to using tools log activity?

Any one have any suggestion how to do this ?

Any tools that helps me to log out for frontend and admin.


texts: In Magento 2, what determines the path used for requirejs?

texts:
I have two installations of the same code looking at the same database, and when I deploy the static code I get different files created by each:

1) creates pub/static/_requirejs/adminhtml/Magento/backend/en_GB/requirejs-config.js

2) creates pub/static/_requirejs/adminhtml/Magento/backend/en_GB/secure/requirejs-config.js

I'm guessing this is to do with the secure URLs, but they have identical app/etc/env.php files. What determines which is created?


texts: Magento 2 custom routing error. stuck in loop?

texts:
I'm having some trouble with Router.php.

I'm guessing it's the line(s) where I check the URL and return false?

  Exception #0 (LogicException): Front controller reached 100 router
  match iterations

My module is: /Vendor/Realproduct/

I want to allow users to do:
/realproducts/123-test-test1

And have it use:
/realproduct/?year=123&make=test&model=test1

<?php
namespace Vendor\Realproduct\Controller;

class Router implements \Magento\Framework\App\RouterInterface
{
    /**
     * @var \Magento\Framework\App\ActionFactory
     */
    protected $actionFactory;

    /**
     * Router constructor.
     *
     * @param \Magento\Framework\App\ActionFactory $actionFactory
     */
    public function __construct(
        \Magento\Framework\App\ActionFactory $actionFactory
    ) {
        $this->actionFactory = $actionFactory;
    }

    /**
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @return bool
     */
    public function match(\Magento\Framework\App\RequestInterface $request)
    {
        $identifier = trim($request->getPathInfo(), '/');
        $d = explode('/', $identifier, 3);

        if(isset($d[0]) && ($d[0] != 'Realproducts')) {
          return false;
        }

        $paramStr = '';
        if(isset($d[1])) {
          $paramStr = $d[1];
        }

        $params = [];

        if($paramStr) {
          $params = explode('-', $paramStr);
        }

        $params = ['year' => $params[0], 'make' => $params[1], 'model' => $params[2]];

        //print_r($params);
        //exit;

        $request->setModuleName('Realproduct')->setControllerName('index')->setActionName('index');
        if(count($params)) {
          $request->setParams($params);
        }

        $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, $identifier);
        //print_r($request);
        //exit;
        return $this->actionFactory->create(
            'Magento\Framework\App\Action\Forward',
            ['request' => $request]
        );
    }
}


texts: Magento2 - How to save customer address attribute value in database and show on edit of reorder/new order?

texts:
How to save customers address attribute value in the database and show on the edit page when we reorder/new order?

Screenshot: https://prnt.sc/r7w5d5.

It's working when I update an already placed order(Value update).

Click on order then open order details and then click on billing/shipping address and update that custom field then it's work.

But then I click on REorder/ new order of that then value not showing in the newly created order that field is blanked.

Please help.

Thank you.


texts: Dowonloadable Product with MSI(Multi Source Inventory)

texts:
I've Magento 2.3 with MSI setup.

Please find below screenshot for sources setup.

Please find below screenshot for stocks:

I'm stuck where If i create downloadable product without assign sources I'm getting error like below:

How can I create downloadable product along with simple and configurable product ?

If I leave blank than getting error and If i assign sources to product than checkout displays shipping step and shipping method can't load due to its virtual/downloadable product. Cant able to complete payment.

Any ideas ? I ain't sure It is bug or I'm missing something ? Any help would be appreciated.


texts:
i try to show the business terms on a simple page but my block isn't rendering.

The page which calls the block:

{{block type="cms/block" block_id="business_terms"}}

The block itself with the settings:

  identifier: business_terms

  status: enabled

  content: test

Nothing special here but the output I get is the page title with empty content.

My Magento Version is 1.9.2.4

My guess: the problem belongs to the permission changes which comes up in 1.9.2.2(?). So i try to set the permission for the block in CMS -> Permissions -> Blocks with

  Block name: business_terms

  is allowed: yes

But no luck. Could you give me some advice, how to fix it?


texts:
We are planning to integrate Magento(1.9) with POS machine at our physical store.
We need to implement the following features

  When an order is placed online the Magento will share the order
  details and customer details with the POS machine to print the bills.
  The POS machine will share the daily price changes and
  inventory/stock details with Magento. With this details, the price listing
  on the online store will change.

Is it possible to achieve this? please share your views on this. I am looking more insights into the second requirement. Hope someone can help me.


texts: How to know whether DHL Shipping is working

texts:
I recently added a DHL module on my site. I configured everything. from the admin. But I am not able to understand where should I see the module option on the frontend.

This is my admin option for DHL.

This is the image while checkout. No sign of DHL shipping. Is there any setting to enable on admin after enabling the DHL module? Please help me solving this.


texts: Button not showing on Order view details page

texts:
Im trying to add a button to the order view page on the admin, next on the credit memo for example or something similiar, but is not showing the button, and i have no idea how to test it to find the problem.

Here is my code, maybe someone can notice any problem.

config.xml

<config>
    <modules>
        <Cloud_Magni>
            <version>0.1.0</version>
        </Cloud_Magni>
    </modules>
    <global>
        <models>
            <magni>
                <class>Cloud_Magni_Model</class>
            </magni>
        </models>

        <resources>

            <invoicedocs_setup>
                <setup>
                    <module>Cloud_Magni</module>
                    <class>Cloud_Magni_Model_Resource_Mysql4_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </invoicedocs_setup>

            <invoicedocs_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </invoicedocs_write>
            <invoicedocs_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </invoicedocs_read>
        </resources>

        <blocks>
            <magnifi>
                <class>Cloud_Magni_Block</class>
            </magnifi>

        <adminhtml>
            <rewrite>
                <sales_order_view>Cloud_Magni_Block_Adminhtml_Sales_Order_View</sales_order_view>
            </rewrite>
        </adminhtml>
        </blocks>

        <helpers>
            <magnifi>
                <class>Cloud_Magni_Helper</class>
            </magnifi>
        </helpers>
        <events>

            <sales_order_invoice_pay>
                <observers>
                    <magni>
                        <type>model</type>
                        <class>magni/observer</class>
                        <method>createInvoice</method>
                    </magni>
                </observers>
            </sales_order_invoice_pay>

            <sales_order_creditmemo_save_after>
                <observers>
                    <magni>
                        <type>model</type>
                        <class>magni/observer</class>
                        <method>createCredit</method>
                    </magni>
                </observers>
            </sales_order_creditmemo_save_after>
        </events>
    </global>
</config>

View.php:

class Cloud_Magni_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
    public function  __construct() {

        parent::__construct();

        $this->_addButton('magni', array(
            $message = "are you sure?",
            'label'     => Mage::helper('Sales')->__('Segunda Fatura'),
            'onclick'   => "confirmSetLocation('{$message}','{$this->getUrl('Cloud_Magni')}')"
        ));
    }
}


texts: isCustomerLogged() vs checking checkout customer ID

texts:
Is there a difference between using:

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCustomerId();

versus:

Mage::getSingleton('customer/session')->isCustomerLogged()

for the purpose of checking if a customer is logged in or not?


texts:
how can I show catalog products based on customer custom field ?

I've done di.xml

I've done this but is doesn't filter . This is what I have in ListProduct.php (used in di.xml)

protected function _getProductCollection()
{
    $field = $this->customerSession->getCustomer()->getData("field");

    if ($this->_productCollection === null) {
        $this->_productCollection = $this->initializeProductCollection();
        try {
            $this->_productCollection->addAttributeToSelect("field")->addAttributeToFilter("field", array('eq' => $field));
        } catch (LocalizedException $e) {
            echo $e;
        }
    }

    return $this->_productCollection;
}


texts: Magento 2 get product id from admin product edit page but i am not able to get

texts:
I am want to get product SKU in my constructor through my block even I try product repository  still null value is coming

use Magento\Framework\App\RequestInterface;
use Magento\Ui\DataProvider\AbstractDataProvider;
use Valuecoders\RpmInventory\Model\ResourceModel\Rmpinventorysynchistory\CollectionFactory;
use Valuecoders\RpmInventory\Model\ResourceModel\Rmpinventorysynchistory\Collection;
use Valuecoders\RpmInventory\Model\Rmpinventorysynchistory;
use Valuecoders\RpmInventory\Block\Adminhtml\Catalog\Product\Edit\Tab\Demo;

class CustomDataProvider extends AbstractDataProvider
{
/**
 * @var CollectionFactory
 */
protected $collectionFactory;

/**
 * @var RequestInterface
 */
protected $request;
protected $block;
private $productRepository;

/**
 * @param string $name
 * @param string $primaryFieldName
 * @param string $requestFieldName
 * @param CollectionFactory $collectionFactory
 * @param RequestInterface $request
 * @param array $meta
 * @param array $data
 */
public function __construct(
    $name,
    $primaryFieldName,
    $requestFieldName,
    CollectionFactory $collectionFactory,
    RequestInterface $request,
    \Magento\Framework\App\Request\Http $request1,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,

    Demo $currentProduct,
    array $meta = [],
    array $data = []
) {
    parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
    $this->collectionFactory = $collectionFactory;
    $this->collection = $this->collectionFactory->create();
    $this->request = $request;
    $this->block = $currentProduct;
    $this->request = $request1;
    $this->productRepository = $productRepository;
}

/**
 * {@inheritdoc}

 */

public function getData()
{
      var_dump($this->productRepository->getSku();
//$this->block->getSku();
}

But still, always show Null Value please help me to shootout this problem


texts: Products not updating after Magento e-commerce update

texts:
I keep getting this error after upgrades,

  Fatal error: Undefined class constant 'XML_NODE_PRODUCT_MAX_DIMENSION'
  in
  app\design\adminhtml\default\default\template\catalog\product\helper\gallery.phtml
  on line 111

I have searched for solutions, but not working.


texts: Magento table showing size 58 MB while table contain 0 rows

texts:
In my Magento database catalog_category_product_index_idx table has no data (0 rows) but it is showing 58.1 MB size.
As shown in below figure :

Why data showing 32.6 MB?
Is there any magento logic behind this?

How to decrease its space usage?


texts:
I followed this tutorial to add a new field to checkout:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html

Problem is: as long as it is a <input type="text" /> everything works. But if I change my input field to a <textarea> it won't save.

I highly suspect Magento guys just don't know about textareas...

Well on a serious note, I found code handling textareas but couldn't find code that handles textareas in checkout. Also I didn't find any implementation of a textarea in magento.

Has anyone figured how to do it? (or if it is possible at all)


texts: How to change attribute status disabled="false" in product edit in admin in Magento2

texts:
When I'm going to edit the product I'm not able to fill price and quantity in the product in admin of Magento 2.
You can see in below image attribute is disabled.
Can anyone tell me why attribute is disabled?


texts: how to Setup alert emails for wish list availability in magento. Assuming the product is in out of stock when customer wanted to purchase it and he added to wish list.so When product is available customer get notified.


texts:
If anyone could help me.

My curent value that I get is '0' in my controller:

   foreach($productCollection  as $product)
   {
        $_helper_views =$this->helper_views->getProductCount($id);
   }

and in my helper:

    public function getProductCount($id)
    {

    // @var \Magento\Catalog\Model\Product\Interceptor $product

    $prodData = $this->_prodCollection->addViewsCount()->getData();

    if (count($prodData) > 0)
    {
        foreach ($prodData as $product)
        {
            if ($product['entity_id'] == $id)
            {
                 return (int) $product['views'];
            }
        }
    }
    return 0;
}

and Yes this product have views. I checked in report_viewed_product_aggregated_monthly and report_viewed_product_aggregated_weekly tables.

When I change return to:

return $prodData;

I get full array of data.


texts: How to save input value to database magento2

texts:
I am absolutely new in magento. I have made new input called 'name' under email input in

  app/design/frontend/NewVendor/NewTheme/Magento_Newsletter/templates/subscribe.phtml

<?= $block->escapeHtml(__('Newsletter')) ?>

    <form class="form subscribe"
        novalidate
        action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>"
        method="post"
        data-mage-init='{"validation": {"errorClass": "mage-error"}}'
        id="newsletter-validate-detail">

            <?= $block->escapeHtml(__('Sign Up for Our Newsletter:')) ?>

                <input name="email" type="email" id="newsletter"
                       placeholder="<?= $block->escapeHtml(__('Enter your email address')) ?>"
                       data-mage-init='{"mage/trim-input":{}}'
                       data-validate="{required:true, 'validate-email':true}"/>
                <input name="name" placeholder="Name"/>

            <button class="action subscribe primary" title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>" type="submit">
                <?= $block->escapeHtml(__('Subscribe')) ?>
            </button>

    </form>

I have made a new column in newsletter_subscriber table in

  app/code/Mag/Newsletter/Setup/UpgradeSchema.php

class UpgradeSchema implements UpgradeSchemaInterface

{

public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();
    if (version_compare($context->getVersion(), '0.0.2', '<')) {
        $setup->getConnection()->addColumn(
            $setup->getTable('newsletter_subscriber'),
            'name',
            [
                'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                'length' => 50,
                'nullable' => false,
                'default' => '',
                'comment' => 'Name'
            ]
        );
    }
    $setup->endSetup();
}

}

And this is my controller in

  app/code/Mag/Newsletter/Controller/Subscriber/NewAction.php

<?php
namespace Magebit\Newsletter\Controller\Subscriber;

class NewAction extends
\Magento\Newsletter\Controller\Subscriber\NewAction
{
    public function execute() {
        $name = $this->getRequest()->getPost();
        var_dump($name);exit;
    }
}

For now controller var_dump's input value.

What I want to achieve is to save input value into "name" column in 'newsletter_subscriber' table.

Can't get it right.
What should I do next?


texts: Find products (eav_attribute table) Magento

texts:
I know that MAGENTO has an entity called catalog_product

When a new attribute is created there will be an entry in eav_attribute and if you check this entry there will be a column as entity_type_id

eav_attribute table also has a column known as attribute_code which is nothing but a value of Attribute Code entered while making a new attribute from admin.

I dont know which tables i need to "join" in order to obtain what i want. Query?

I am using MAGENTO 1.9 and MYSQL

Database diagram:

Thanks!


texts:
I understand that the home page content is defined in block home-page-block, and I can edit that and see changes appear in the browser.

However, what I don't understand is:

What bit of theme/template/code invokes home-page-block in the first place. (I am searching everything I can think of, and nothing...)
The relationship, if any, to Content > Pages > Home Page, which is blank. And furthermore, I can edit Home Page, it does not show up as the home page, but does show up at [mysite.com]/home/.

What am I missing?

Edit: Partial understanding

Based on reading docs and source code, the diagram shows some of the contributors to the construction of the Luma home page.

Among mysteries solved:

in the Content > Widget configuration page, the list of pages offered as targets comes from Magento consolidating all the page_types.xml files from all modules.
On that same admin page, the list of target Containers appears to come from module-theme/view/frontend/layout/default.xml. (Not sure if it changes when different target page is selected.)

Nagging Questions

How are some of the things in the above diagram specified, based on the requested route '/'?

A. Routing: '/'   Route matching patterns are normally specified in routes.xml files for each module. But where is the routes.xml for '/'? And how does module-cms get invoked (whose page_types.xml shows it handles "CMS Home Page"/cms_index_index). How does routing result in a requested page type of cms_index_index?

B1. The seemingly corresponding layout, /vendor/magento/module-cms/view/frontend/layout/cms_index_index.xml shows an empty body. How does that relate?

B2. Instead, the delivered page appears to have the structure of  /vendor/magento/module-theme/view/frontend/layout/default.xml.  (Deduced from it being the only file with a container called "Main Content Area", as targeted by Widget "Home Page") What precipitates invocation of default.xml?

C. Why is the Luma home page implemented with a Widget and a Block and not simply a Page?

Edit 2

I pursued part of this question here: How does home page routing work?


texts: Security Patch SUPEE-8167 - possible problems?

texts:
I noticed a security message on my magento admin panel. I have proceeded to apply the patch but Is there anyone who can tell what are the possible areas need to test after applying this patch?

It's obvious that I need to check if paypal payment method is working or not. Apart from that, any tweaks I need to do?


texts: where the file confirm.js is called in magento 2

texts: i have made some changes on the file who is responsible for displaying the popup  this is the file web/vendor/magento/module-ui/view/base/web/js/modal/confirm.js , so my question is where this file is implemented because i want to see all popup of the website if they are take the changes or not, in other sens i want to see where can i call the popup to see if the changes had taken or not, for like when you "remove item from card " the popup showing up


texts:
I'm using the following to add  tags to my  :
  <referenceBlock name="head.additional">
       <block  class="Magento\Framework\View\Element\Template" name="head.font" template="Magento_Theme::html/head_font.phtml" />
</referenceBlock>

The issue is I want them to load first, not last. Is there a way to position block at the top of  ?


texts: Adding a shipping disclaimer to checkout

texts:
Very new to Magento (currently switching over from Opencart).
The business I work for typically posts items over $50 for free to most destinations within Australia, but we currently have a disclaimer stating that for large or particularly bulky items, as well as for remote destinations, freight may be charged on these and the customer will be contacted within two business days specifying as much.
We are a musical instrument store and so shipping a piano or drum kit for free to the middle of the Australian desert (for example) could easily see us lose any profit and even lose money on the sale if we don't have such a disclaimer in place.
Perhaps I have missed something as I have been setting up the new cart, but I can't see an easy way to include this in the checkout procedure.
Any help would be greatly appreciated.
Thank you

Scott


texts: Adding product to website 3 always adds website 1 too

texts:
I am in the midst of writing an integration between our ERP system and a new Magento 2 (version 2.2.5) website.

I have never used Magento before, and the setup of the site etc has been managed by a third party.

We have 3 websites, each with one store and one store view; NZ, AU, UK.

I am trying to create a product against our AU website, which is website ID 3.

To do so, I am sending the below request:

{
    "product": {
        "sku": "API_TEST-AU",
        "name": "Api Test AU",
        "price": 1337.00,
        "weight": 4.8,
        "visibility": 4,
        "type_id": "simple",
        "attribute_set_id": 4,
        "status": 1,
        "extension_attributes": {
            "website_ids": [
                3
            ],
            "stock_item": {
                "qty": 5,
                "is_in_stock": true
            }
        }
    }
}

However, when I send the request, the response shows that it has also been associated with website ID 1:

Why does this happen and how do I prevent this from happening? I only want the product to be associated with the website IDs I have specified.


texts: How to change the font for a specific store view

texts:
I have two store-views which are English and Persian(RTL) and would like to change the font of the Persian store-view for all front-end contents.

Magento ver 1.9.2.4


texts:
Hi there I am adding an image to order emails. So far I have managed to get the image inserted:

<?php $_item = $this->getItem() ?>
<?php
$_product = Mage::getModel('catalog/product')
                ->setStoreId($_item->getOrder()->getStoreId())
                ->load($_item->getProductId());
?>
<?php $_order = $this->getItem()->getOrder() ?>

        <img src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getThumbnail()); ?>"
 alt="<?php echo $_item->getName() ?>" />

But this produces a large image how can I get the thumbnail image or resize it to fit? I know I can resize it using the  tag but I'd rather call the smaller image first then resize.


texts: how to add products to shopping cart using soap v2 api then checkout the products in shopping cart

texts:
When I add products to shopping cart using soap api v2 method i.e.
created cart using shoppingCartCreate and then adding products using shoppingCartProductAdd.
and then assigning this cart to customer using shoppingCartCustomerSet.
In response I get successfully added products to the cart but when i check it after logging into web view I found there is no product in the cart.

What's the reason for this?


texts:
Why no products  displayed  on my web after adding categories and products?
I have added  categories and products  on the backend of magento.

Is the url wrong?


texts: How to add product grid in custom module's tab?

texts:
I want to add a product grid in my module's tab.

How can I achieve this?

Please help me.

I tried this. But I am getting a blank page.


texts: How can I remove a icon which hovers on all my website pages

texts: I need to remove a icon which is conneted to a link and it hover in all the pages, as you scroll down.


texts:
Magento 2 How to Upgrades schema

<?php

namespace Namespace\Banner\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\DB\Adapter\AdapterInterface;

class InstallSchema implements InstallSchemaInterface
{
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;

        $installer->startSetup();

        if (version_compare($context->getVersion(), '1.0.0') < 0){

        $installer->run('create table ud_banner(banner_id int not null auto_increment, name varchar(100), url varchar(100), image varchar(100), status varchar(100), primary key(banner_id))');

        //demo
//$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
//$scopeConfig = $objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface');
//demo

        }

        $installer->endSetup();

    }
}


texts:
I have tried to order from Magento 2,

When I click on 'Go to checkout' button, it goes to the checkout page but the Checkout page is a blank page.
It displays the menu bar, header, footer, and everything but doesn't display the content of the checkout page.

What is the issue?
What can be the issue and how to fix it?


texts:
We had a website that was built with a minimum checkout quantity. It currently does not allow you to checkout without ordering 16 units. We now want get rid of this rule, and go to a standard $ qty which is easy to find in admin......

Any ideas where we may find this setup and cancel it (the 16 unit minimum that is).

Regards


texts: How To Change the Style or Design of Layered Navigation Search Filter?

texts:
Can you please help me how to change the style or design of filter search.
I attached my current filter image and amazon filter image.
Please help me how to change this design?
I want my filter exact as amazon.

Thanks for answer in advance.


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

texts:
actually i am trying to add  quantity increment and decreament (+ and
  - button) in minicart magento 2.3.
  If anyone have any idea please guide me.


texts:
I'm trying to edit our shop page to include two banner images. I have edited the file in app/design/frontend/default/hellowired/layout/catalog.xml:

 <reference name="left">
        <block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
            <action method="setImgSrc"><src>images/media/Need-To-Store-Large-Items.pngap</src></action>
            <action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action>
            <action method="setLinkUrl"><url>checkout/cart</url></action>
        </block>
    </reference>

This is not updating the left sidebar though. It's still blank. See picture.


texts:
I'm manually running a cron task (RocketWeb Subscriptions) through the Magento admin Scheduler section. Everything runs fine except it keeps failing when trying to save the transaction. I keep getting the error:

Next exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:3306' (1)' in /{ROOT}/lib/Zend/Db/Adapter/Pdo/Abstract.php:144

even though everything else in Magento seems to work just fine. I'm able to view and use my store, and get into the admin section to work. I'm running this on a Vagrant box with a private IP; I tried changing the DB settings in local.xml to point to that private IP, even tried 127.0.0.1 but it comes back with the same result. Any ideas why this behavior would occur?


texts: how to put filtration in first order in left column magento

texts:
I want to change the magento left column block. I have

Compare products
Community poll
filtration
My Cart

i want to change the order's to

Filtration
Compare products
my cart
community poll

My working website : http://m.machinetoolsemart.com/welding-machine/tig-welder.html

Can you guide me to solve this?


texts:
magmi : I need to import (and assign) 7000+ attribute_code Values through csv.
My issue is that the format of magmi csv is Attribute names should be horizontaly column wise(7000+ cols) and values should be under.

I need to do it same like pivot or Is there is a better solution?.

Note: my data is originally stored in MS-SQL db


texts: Is there a Magento event for deducting stock? For pack creation

texts:
is there a Magento event for deducting stock?

We are creating a pack of products (say 1 pack of 6 bottles). Product title and image show 6 bottles. So customer would select 1 prtoduct qty from the dropdown on the product page when ordering. Also in the cart one would expect to see: 1 pack (of 6 bottles)

But when we reserve and deduct the stock we need the qty to be 6 bottles. I mean: that is the real wty being sold. 1 pack of 6 bottles.

Now editing QTY value is not the best solution because it would show as qty = 6 in cart (and customer expects 1 pack, so 1 as a number). Also the pricing is multiplied when we multiple QTY value by 6.

So my question is: is there an event or method we could attach to that allows us to show QTY = 1 everywhere .... but when stock is decreased and the sale is made that the QTY = 6?

I hope this is clear

Help appreciated


texts: How to display Product by city, Need to display all products and ask user to select city and display result based on selected city?

texts:
I am working on a florist website, the products are tied to multiple cities based on availibility of product in that city.

I want to provide an option for users to select the city when they select any product.
Once they have selected city i want to display available products in that city.
User can modify delivery city at any point of time.
I dont want user to select the city in payment page as user will be annoyed if the delivery city is not available of his choice.

Is this possible?


texts:
Having problem with Amazon Pay, not able to use amazon details to checkout and complete order whilst being a Guest user.

BUT

Can use amazon details to complete order whilst logged into the actual site with an account.

// EDIT //

this error also appears when trying to check out with amazon details


texts: Get the Email response after send an email using php

texts:
Can anyone help me how to get the sent email response of shared content.

$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: yoursite.com';
$to = 'contact@yoursite.com';

$subject = 'Customer Inquiry';

$body = "From:" .$name."\r\n E-Mail:" .$email."\r\n Message:\r\n" .$message;

if (isset($_POST['submit']))
{
    if (mail ($to, $subject, $body, $from))
    {
        echo '
Your message has been sent!
';
    }
    else
    {
        echo '
Something went wrong, go back and try again!
';
    }
}

i will add email share button on product page, if that product is shared via email, i will give reward points to customer.

Help me great.

Thanks


texts:
How to do indexing in Magento2.0?

I cant find any option there? I tried both Update by schedule and Update on Save. But no luck


texts:
I am using magento 1.9.1.0.. I have scheduled cron jobs for cron.php but i am getting emails as Status:

500 Internal Server Error Content-type: text/html cron error ..

My cron is not running ,how to fix this issue


texts: How to disable cache for perticular template file in magento 1.9?

texts:
We have used full page cache but some particular part of section not reflected.
for example, we have a select city in the dropdown but not reflected.
check my site- https://vidyutbazar.com/
A different way to disable it but not work for me.check below code.

  Path =
  frontend/YOURTHEME/default/template/catalogsearch/form.mini.phtml
  Block = Mage_Core_Block_Tem

<reference name="Mage_Core_Block_Tem">
  <action method="setCacheLifetime"><s>null</s></action>
  </reference>

<reference name="top.search">
  <action method="setCacheLifetime"><s>null</s></action>
  </reference>

<reference name="top.bar">
  <block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml">
    <action method="unsCacheLifetime"></action>
  </block>
  </reference>

I need to disable cache for this block.so i use above code in this layout but it is not work for me.Please help me how to disable it?


texts:
How to use 2 models in layout folder in xml that should show in inside view show.phtml file. Please tell how the controller is linked with block.
And how a  layout file is linked with the controller file.


texts: How to set products in multiple websites using magmi?

texts:
I have all my products in "main" website. I have another website and code is "new". I want to add all my products in "new" website too. But when i try to do so, products remove from "main" website and add in "new" website. I want my products in both websites. How to achieve that task?
my csv is..

  sku websites

  123 new


texts:
In my Magento website it does not show the currency symbol next to the price, but this only happens when I click on a product to see the details of it. Otherwise it shows.

Magento ver 1.9

link to the product


texts: Product image missing from backend after updating to magento 1.9.2.3

texts:
I recently updated several sites running Magento CE 1.9.2.2 to 1.9.2.3. I noticed that product images (when uploaded now) are no longer visible in the backend - though they are visible on the frontend.

It seems like this is related to the new security patch.

Edit:

Is there a way I can resolve this? Changing the permissions on the file from 640 to 644 / 777 makes them visible.


texts: Magento 2 Rest API response "There is no mediagalleryentryconverter for given type". How fix it?

texts:
I need to get All Products using Magento 2 Rest API, but on some products I get response: "There is no mediagalleryentryconverter for given type".
How can I fix it? I use POSTMAN for testing.
My request string:  GET /rest/default/V1/products?searchCriteria[pageSize]=100
My Header:
Authorization : Bearer
Content-Type : application/xml;
Accept : application/xml
Maybe I need to use some additional parameter in the hader????


texts: How to fix 404 error in Magento 2 without coding

texts:
I've deleted some old/discontinued products off the site, and this obviously gives rise to some 404s. How do I redirect these to a category page from the back end of Magento 2. Not a coder so can only do it via the admin panel. Is this possible?
Thanks


texts: Column Customer_id in table report_viewed_product_index *always* NULL

texts:
we have seen recently that the "Online customers" report is always empty + also the column customer_id in table report_viewed_product_index is always NULL

I know because on our DEV server the column customer_id is always a number (never NULL) ....

What setting in Magento can influence this behavior? Has anyone seen this before?


texts: Is there a bug in default customer group for registered customers?

texts:
In my Magento website, guest checkout is disabled.
The customer should either register or login using existing account.

By default, the registered customers will be put under "General" customer group is a known fact.

But in our site, the registered customers are shown as "NOT LOGGED IN" customers.
Under Customers-> Manage Customers in the admin panel.

I know this is impossible by default, but it is happening.

Is there any known bug, which is causing this.

There are no custom modules which alter this behavior, in our site (Magento EE 1.12.0.0).

Can anybody help me with this?


texts:
I have a cron file like Col.php. I want to get products collection in my cron file.

code in my file:

public function execute()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $collection = $objectManager->create(
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::class
    )->create();

    //Enable status check
    $collection->addAttributeToFilter(
        'status', array('eq' => \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
    );

    //Stock filter
    $collection->joinField(
        'qty', 'cataloginventory_stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left'
    );

    //Visibility check
    $visibility = $objectManager->create('\Magento\Catalog\Model\Product\Visibility');
    $collection->setVisibility($visibility->getVisibleInSiteIds());

    $this->logger->debug($collection->getSize());
}

After executing my cronjob through shell

php bin/magento cron:run --group=mygroup_cron_group

I am getting error in exception log file:

Base table or view not found: 1146 Table 'my_db.catalog_category_product_index_store0' doesn't exist, query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`row_id` = `e`.`row_id`) AND (`at_status`.`attribute_id` = '97') AND (`at_status`.`store_id` = 0)
 INNER JOIN `catalog_category_product_index_store0` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=0 AND cat_index.visibility IN(3, 2, 4) AND cat_index.category_id='0' WHERE ((at_status.value = 1)) AND (e.created_in <= 1) AND (e.updated_in > 1) {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'my_db.catalog_category_product_index_store0' doesn't exist, query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`row_id` = `e`.`row_id`) AND (`at_status`.`attribute_id` = '97') AND (`at_status`.`store_id` = 0)
 INNER JOIN `catalog_category_product_index_store0` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=0 AND cat_index.visibility IN(3, 2, 4) AND cat_index.category_id='0' WHERE ((at_status.value = 1)) AND (e.created_in <= 1) AND (e.updated_in > 1)

Why it is trying to fetch products from store 0 how can I get products collection?


texts: Why is overriding a block function causing template errors?

texts:
Simply put, I'm trying to load order information on the Onepage Checkout Success page. I have a module set up, these files are under app/code/Tainted/Checkout:

registration.php (standard)

etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Block\Onepage\Success" type="Tainted\Checkout\Block\Onepage\Success" />
</config>

etc/module.xml

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

Finally, Block/Onepage/Success.php:

<?php
namespace Tainted\Checkout\Block\Onepage;

class Success extends \Magento\Checkout\Block\Onepage\Success
{
    /**
     * Prepares block data
     *
     * @return void
     */
    protected function prepareBlockData()
    {
        $order = $this->_checkoutSession->getLastRealOrder();

        $this->addData(
            [
                'is_order_visible' => $this->isVisible($order),
                'view_order_url' => $this->getUrl(
                    'sales/order/view/',
                    ['order_id' => $order->getEntityId()]
                ),
                'print_url' => $this->getUrl(
                    'sales/order/print',
                    ['order_id' => $order->getEntityId()]
                ),
                'can_print_order' => $this->isVisible($order),
                'can_view_order'  => $this->canViewOrder($order),
                'order_id'  => $order->getIncrementId(),
                'grand_total' => $order->getGrandTotal(),
                'delivery_method' => $order->getAddressShippingMethod(),
                'items' => $order->getAllItems()
            ]
        );
    }
}

The prepareBlockData function is copied from the original class and I've added a few extra lines to it to pass more data to the frontend template. E.g. grand total.

However, when I checkout the success page is missing the success.phtml template and the only errors I can find appear in the system.log as follows:

[2017-04-27 16:17:41] main.CRITICAL: Invalid template file: 'button.phtml' in module: 'Tainted_Checkout' block's name: 'checkout.success.print.button' [] []
[2017-04-27 16:17:41] main.CRITICAL: Invalid template file: 'success.phtml' in module: 'Tainted_Checkout' block's name: 'checkout.success' [] []

I haven't touched those templates yet but that error reads as though they're missing, not broken anyway. I've tried copying them in to app/design/frontend/Tainted/theme/Magento_Checkout/templates and I've copied the checkout_onepage_success.xml file in to the layout folder but that hasn't helped either.

It feels like I'm trying to do something very simple (in Magento 2 terms) but I can't see where I've gone wrong. Any help would be greatly appreciated.


texts: How to create Enquiry popup form in magento?

texts:
As per my requirement I need to include enquiry popup form in my project so far I tried this.

Placed this basic HTML form in one of my .phtml page.

<form action="#" id="form" method="post" name="form">

Contact Us

Name<input name="name" type="text">
Phone Number<input name="phno" type="text">
Email<input name="email" type="text">
Enquiry<textarea name="message"></textarea>
Submit
</form>

Click Button To Popup Form Using Javascript

<button id="popup" onclick="div_show()">Popup</button>

and this is the js file included using page.xml

// Validating Empty Field
function check_empty() {
if (document.getElementById('name').value == "" || document.getElementById('email').value == "" || document.getElementById('msg').value == "") {
alert("Fill All Fields !");
} else {
document.getElementById('form').submit();
alert("Form Submitted Successfully...");
}
}
//Function To Display Popup
function div_show() {
document.getElementById('abc').style.display = "block";
}
//Function to Hide Popup
function div_hide(){
document.getElementById('abc').style.display = "none";
}

and a .css file also included using page.xml

but doing this crashed my page.Please help me in solving this thanks in advance.


texts: Magento seems to have upper limits for stores

texts:
I have forked another project to create a CLI build script for adding thousands of Magento stores to a single instance of Magento. Here is the build script: https://gist.github.com/jadissa/1812cdf8f14b29670ec9#file-index-php

Here's the wrapper for calling it which can receives a number parameter for how many stores to create: https://gist.github.com/jadissa/1812cdf8f14b29670ec9#file-benchtest-php

The script creates the store group and then creates three views (english, french and spanish) for the each group. I noticed that once I went past around 100 records, Magento no longer loads.

We have attempted to clear the cache: rm -rf var/cache/*
We've restarted Apache.
We have added 4 cores to this machine and have added 6.144 GB of RAM to this Ubuntu system we have on the cloud.

PHP dies with the error:

  PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/lib/Varien/Simplexml/Element.php on line 417

We bumped the max_execution time up and set PHP's memory at 2GB. It can now load... 200 stores. We want at least 2k stores though.

What's slowing things down so badly?


texts: Value not getting inserted into db in EaDesgin/Magento2-City-Dropdown extension

texts:
https://github.com/EaDesgin/Magento2-City-Dropdown/

Hi, I am using this extension EaDesgin/Magento2-City-Dropdown and when I upload the city file and import cities than the values get inserted but the region id column shows blank. The region id values are not getting inserted. Anyone have faced the same issue with this extension?

PS - I am asking this question here because I have seen there are already some questions about this extension.


texts: How to setup a subdomain for admin panel in magento 2

texts:
Today i had tried to use the sub domain like admin.domain.com for admin panel  by setting the custom url for admin panel in system -> config -> Advanced -> admin -> admin base url -> Custom Admin URL

After changing the url with sub domain. Unable to login admin panel by sub domain.
I'm getting too many redirect error. sometimes it going to base domain like www.domain.com.  Even after clearing the cache problem still not solved. Anyone help me Regarding this issue, that will be highly appreciated.

Note: I had already tried the solutions on the similar post but nothing will work. And i'm using magento 2.2.6


texts: Magento 1 - Can Custom Variables be translated?

texts:
I got a question about Custom Variables.

Our store uses them to have Print Specifications for different products. Is it possible to translate those Custom Variables?

I have tried putting:

<?php echo $this->__($myvalue); ?>

But inline translation for this does not work.

What is working right now is the labels:

<?php echo $this->__($this->htmlEscape('Print Specifications')) ?>

Any ideas?

Thanks!

UPDATE:

here is how I get the Custom Variable:

<?php $myvalue = Mage::getModel('core/variable')->loadByCode($_helper->productAttribute($this->getProduct(), $_product->getPrintSpecifications(), "print_specifications"))->getValue('html'); ?>


texts:
I hooked up in checkout a credit card.
But i encountered such a problem that the payment does not work, and does not even give any error.

Just worth the wait animation and no more. How can I fix this?
The console also has no errors.


texts: Magento 2 reindex gives error Duplicate entry

texts:
I am experiencing an issue which not sure why when I try to reindex it gives the error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'4458-142-1-1293-4458' for key 'PRIMARY', query was: INSERT INTO
`catalog_product_index_eav_temp`
(`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`) VALUES (?,
?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?,
?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?,
?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?).....

Now the problem is I don't see a table in the Database called catalog_product_index_eav_temp otherwise I would delete the duplicate entry and problem would be solved.

The line that is failing is with EAV:

php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:07

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'4458-142-1-1293-4458' for key 'PRIMARY', query was: INSERT INTO
`catalog_product_index_eav_temp`
(`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`) VALUES (?,
?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?,
?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?,
?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?).....

Stock index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:01
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00

Does anyone know what could be wrong and how to fix! txs.


texts:
I'm on Magento 2.2.4 with php7. I have a cron job already set that  reindexes it all twice a day.

I usually also reindex manually and when i see a suspended index I reset it.
But, when I do reindex:status I notice that the "Product Categories" index has always the Schedule status "suspended", even when i reset it and reindex it succefully it never changes.

Any idea why, please?

system log shows this:

[2018-10-04 17:25:56] main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or decrease batch size value (which decreases memory usages for the temporary table). Current batch size: 1000; Allocated memory size: 50000000 bytes; InnoDB buffer pool size: 134217728 bytes. [] []

debug log shows this:

[2018-10-04 17:27:50] main.DEBUG: cache_invalidate:  {"method":"GET","url":"https://www.example.com/en-ca/catalogsearch/result/index/?cat=23&material_color=114&q=custom&rs_width=150","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []


texts: set Error message content from the static blocks magento2

texts:
I am setting error message using below code.

$this->_messageManager->addError(__('you must login to continue.'));

Is it possible to load the message from the static block content.

for example i created static block with some html content. that content i need to show in error message. Is that can be done?


texts: is Magento 2 Certified Professional Developer exam is no longer available?

texts: Can anyone please let me know is Magento 2 Certified Professional Developer exam is available, I can see there is no exam at https://u.Magento.com/certification


texts: Magento 2 How to interchange positions of block-search and minicart

texts: Magento 2 How to interchange positions of block-search and mini-cart in front-end.