texts: Hide shipping method name and title from frontend

texts:
In front end on checkout page in shipment section shipping methods and name appears in bracket along with shipping and handling.

Now it looks like
Shipping & Handling (title - method name): 5$

I want look like
Shipping & Handling: 5$

Kindly help..


texts: Magento add custom attribute to transaction email items

texts:
I want to change the default SKU field inside the transactional email item field, to a custom attribute.

Therefore I need to edit the following file:

/app/design/frontend/theme/theme/template/email/order/items/order/default.phtml

I want to change the following value:

<?php echo $this->escapeHtml($this->getSku($_item)) ?>

My custom attribute value is "dpn" and it is named "DPN".

How can I change this?

I tried the following but that does not work:

<?php echo $this->escapeHtml($this->getDpn($_item)) ?>


texts: Magento 2- How to store payment method other than credit card?

texts:
In magento 2 you can store the credit card payment method, like described here.
Can you only store credit card payment method into the vault or can you also store custom payment methods which are not about credit cards?


texts: Why "Use Parent Category Path for Category URLs" option is not available in Magento 2?

texts:
We have a Seo Options to modify the URL visibility in Magento 1.x

Reference :

Go to the Magento Admin Panel -> System -> Configuration -> Catalog -> Seo Options.
Select yes or no from "Use Parent Category Path for Category URLs".
Refresh category url index.

Option YES => http://www.example.com/category/subcategory.html

Option NO => http://www.example.com/subcategory.html

But I unable to find the option or equivalent settings in Magento 2.x.

Still we have a answer to change URL visibility.

But my question is, is there any specific reason for not providing this option in Magento 2.x or else i missed something?


texts: Bundle Options Price Dispayed wong in the cart after Observer Event

texts:
We used event checkout_cart_product_add_after for update group price in cart page.

we get proper group price in event but, after event go to the cart page at that time Bundle Option price displayed wrong (Not displayed Group price ).

public function changePrice($observer) {

        $event = $observer->getEvent();
        $item = $event->getQuoteItem();

        $product = Mage::getModel('catalog/product')->load($item->getProductId());

        $selectedCustomerEmail = Mage::getSingleton('core/session')->getMySessionVariable();

        $customer = Mage::getModel("customer/customer");
                    $customer->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
                    $customer->loadByEmail($selectedCustomerEmail);

        $customerGroupId = $customer->getGroupId();

        $grp_price = $product->getData('group_price');

        $group_price = $grp_price[$customerGroupId]['price'];

        $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
        $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();

        $priceTwo = Mage::helper('directory')->currencyConvert($group_price, $baseCurrencyCode, $currentCurrencyCode);

        $finalPrice = $priceTwo;

        if($finalPrice > 0){
            $item->setCustomPrice($finalPrice);
            $item->setOriginalCustomPrice($finalPrice);
            $item->getProduct()->setIsSuperMode(true);
            $item->save();
        }

        //Mage::getSingleton('core/session')->addSuccess($finalPrice);
    }


texts: Multiple currency not working with custom price quote - Magento 2

texts:
I created quote with custom price from Magento admin, it works fine but it does not work multiple currency.

e.g) I created quote to customer with custom price $10 (USD currency), when customer checks it displays the amount $10 in cart page when the customer switch currency it displays $10 without currency conversion.

I have reproduced the scenario in default vanilla setup as well.

is there anyway to achieve custom price works with multiple currency?


texts: Magento2: Class 'MongoDB\Driver\Manager' not found

texts:
On running di:compile command I am getting the following error:
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in /var/www/html/monotaro/vendor/mongodb/mongodb/src/Client.php:116
Stack trace:
#0 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Client/ClientFactory.php(37): MongoDB\Client->__construct('mongodb://mage_...', Array, Array)
#1 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Db.php(66): MonotaROGlobal\MongoCore\Model\Client\ClientFactory->create(Object(MonotaROGlobal\MongoCore\Model\Client\FactoryOptions))
#2 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Db.php(76): MonotaROGlobal\MongoCore\Model\Db->getConnection()
#3 /var/www/html/monotaro/vendor/monotaro-global/mongo/module-mongo-core/Model/Adapter/Adapter.php(25): MonotaROGlobal\MongoCore\Model\Db->getDb()
#4 /var/www/html/monotaro/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): MonotaROGlobal\MongoCore\Model\Adapter\Adapter->__construct(Object(MonotaROGlobal\MongoCore\Model\Db))
#5 /var/w in /var/www/html/monotaro/vendor/mongodb/mongodb/src/Client.php on line 116

MongoDB driver is already installed and running on my local system


texts: How to resize the font size in sidebar navigation menu for Magento 2.3.4 (Luma theme)

texts:
I am doing a migration from 1.9.3 to magento 2.3.4 and i somehow managed to move the top navigation menu to the sidebar with a mod that was posted on this site for magento 2.3.4 However each menu line spills over to two lines in my navigation sidebar.

Should i change the font size or may be i can change the width of the side bar

How can i do this ?? Please help

Thank you


texts: How can you have multiple dependences for a single parameter in a widget.xml file?

texts:
Like many things with Magento widgets, this should be simple but clearly isn't.
How can I use the same depends logic but for multiple parameter values?
so
<depends>
    <parameter name="FAQAmount" value="1"/>
</depends>

Would be like this:
<depends>
    <parameter name="FAQAmount" value="1,2"/>
</depends>

Or this:
<depends>
    <parameter name="FAQAmount" value="1"/>
    <parameter name="FAQAmount" value="2"/>
    <parameter name="FAQAmount" value="3"/>
</depends>

This would be extremely useful but neither methods work, please help.


texts:
This is coming in an email to the client after the transaction:

  Payment transaction failed.
  Reason
  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction


texts: Magento connect issue when trying to load ANY extentions

texts:
I was wondering if anyone else was having the same issue:
community/Locale_Mage_community_fr_FR: Unknown cipher in list: TLSv1

Was trying to load the French language extention as well as other one's but ufortunately came up with the above error. We had no changes on the server or anything else, other versions are working fine.

The only thing we had done different was URL re-writes (which after deletion did not change anything) as well as different URL assigned to store views (DE,FR,PL, etc have their own URL's).

We uploaded it to test the new Magento but it seems to cause problems.

Anyone has a clue on how to approach this issue?


texts: How to create an extension for Magento 2

texts: I want to create an extension to Magento 2, but I cannot find any information. I need to create an extension that can be installed in Magento 2 by downloading from the store or following the link. Please share information.


texts: Mage::getSingleton('admin/session')->getUser() is returning null

texts:
I have a custom module in my magento (version 1.5) and it's meant to load the currently logged in admin username like this in one of my controller:

$current_user = Mage::getSingleton('admin/session')->getUser();
if ($current_user) {
    $this->current_user = $current_user->getUsername();
} else {
    $this->current_user = '';
}

When the code runs, $this->current_user is empty, so I did a var_dump($current_user); exit(); and it appears to be null akways (even if I am logged in).

Any ideas why this might be?


texts: setup upgrade not list the language package extension - Magento 2.0.1

texts:
I am trying to create new language store view. after creating language extension, then I have cleared cache

1) When I run setup:upgrade it is not listed my language extension lang_lg_lg

2) In config.php also not contain my lang extension as active (1).

3) when I run this bin/magento info:language:list it will not list my language.

4) php bin/magento setup:static-content:deploy  lg_LG not succeed

===============================================================

Short Description of what I have done

tree folder structure of language extension

composer.json

{
    "name": "lang/lg"
    ,"type": "magento2-language"
    ,"description": "Tamil language"
    ,"authors": [{
    "name": "Bilal Usean",
    "email": "yyyyy@yyy.yyy",
    "role": "Developer"
    }]
    ,"extra": {"map": [["*", "lang/lg_lg"]]}
}

language.xml

<?xml version='1.0'?>
<language xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework:App/Language/package.xsd'>
    lg_LG
    <vendor>lang</vendor>
    <package>lg_lg</package>
</language>

registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
   \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
   'lang_lg_lg',
   __DIR__
);

lg_LG.csv (copy all values from dictionary.csv then edit the one row of second coloumn) (that row in gedit it seems like)

"We found other products you might like!","நீங்கள் விரும்பக்கூடிய மற்ற பொருட்கள் காணப்படும் !",module,Magento_Catalog

dictionary.csv contains 8000+ rows of phrases for sample I have take one

"We found other products you might like!","We found other products you might like!",module,Magento_Catalog

note: I am using libre office to edit csv

if anyone point out what did I wrong?


texts: Magento 1.9 - Modify CMS pages that are available in one store and aren't available in another

texts:
I'm looking for for a way to modify CMS pages that are available in one store and aren't available in another store.
First problem is that I cannot filter cms pages the usual way:

$collection = Mage::getModel('cms/page')->getCollection()
   ->addStoreFilter($oneStore)
   ->addFilter('store', array('nin' => $anotherStore->getId()), 'public');

Collection matches pages available for all store views ignoring 'not in' filter.

Edit: Following code gets stores that have relation with $oneStore but still it doesn't check if they have relation with $anotherStore:

$collection = Mage::getModel('cms/page')->getCollection()
   ->addStoreFilter($oneStore, false);
$collection->load();


texts: Proceed to checkout redirecting to home page in magento 1.9

texts: Error: When i click proceed to checkout button from cart page then i redirect to home page.


texts: The requested Payment Method is not available on custome module

texts:
I am shortening the one page checkout page as my store will not have payment option and shipping selection option. I am following below blog

http://excellencemagentoblog.com/blog/2011/10/17/magento-onestep-checkout-remove-payment-method-step/

Everything works fine till place order after the review section. Upon clicking on the place order button I am getting below error

  The requested Payment Method is not available.

My controller section to set payment mode is as below

$quote = Mage::getSingleton('checkout/session')->getQuote();
                        $methodCode = 'free';

                        if ($quote->isVirtual()) {
                            $quote->getBillingAddress()->setPaymentMethod($methodCode);
                        } else {
                            $quote->getShippingAddress()->setPaymentMethod($methodCode);
                        }
                        $quote->save();

And the free shipping mode enabled also.

I referred below question posted before:

The requested Payment Method is not available

It is not solving my issue. No system.lo captured also.


texts: overwriting product.phtml and onepage.phtml

texts:
A I have to overwrite two files product.html and onepage.html loccated in the folder

  app/code/stupidvendor/stupidmodule/view/frontend/templates/

I have copied the files and add my changes in the folder.

  app/code/mevendor/memodule/view/frontend/templates/

However after doing all the usual steps cache, static-content, upgrade etc my files are not pulling through. Do i need to add a preference in the di.xml?


texts: Not able to login to admin after SSL setup

texts:
I have an issue with login to my admin panel after installing an SSL certificate.

I get the error message :

  You did not sign in correctly or your account is temporarily disabled.

I tried to set web/secure/use_in_frontend and web/secure/use_in_adminhtml` to 0 but didnt work
I also tried :

php bin/magento admin:user:unlock <username>

Nothing worked

Any help?


texts: multistore sitemap rewrite /sitemaps/domainname.com/sitemap.xml

texts:
is there an easy way to rewrite our sitemap to Magento sitemap directory?

So:

example.com/sitemap.xml
www.example.com/sitemap.xml
anotherexample.com/sitemap.xml
www.anotherexample.com/sitemap.xml

get redirected to

example.com/sitemaps/example.com/sitemap.xml
example.com/sitemaps/example.com/sitemap.xml
anotherexample.com/sitemaps/anotherexample.com/sitemap.xml
anotherexample.com/sitemaps/anotherexample.com/sitemap.xml

I was looking at this, but just not the same: multi store view sitemap.xml url rewrite

Many thanks


texts: How to solve Add to cart not working in Magento 2?

texts:
Our "add to cart" button are not working...
When we click on the button, the page refresh then nothing.
Any ideas?

https://stage.shopunder.com


texts: how to view record row from grid in magento

texts:
I have successfully created grid in magento admin panel. I can see all records from database successfully but now whenever I will click on any row I get error. I want to display that particular details after clicking. like label and the data from database. how to do that. Here are my grid.php file

class Demo_Feedback_Block_Adminhtml_Feedback_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
    public function __construct()
    {
        parent::__construct();
        $this->setId('id');
        $this->setDefaultSort('id');
        $this->setDefaultDir('ASC');
        $this->setSaveParametersInSession(true);
    }

    public function _prepareCollection()
    {
        $collection=Mage::getModel("feedback/feedback")->getCollection();
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    public function _prepareColumns()
    {
        $this->addColumn('id',
                array(
                        'header'=>$this->__('ID'),
                        'align' =>'right',
                        'width' => '30px',
                        'index' => 'id'
                ));
        $this->addColumn('name',
                array(
                        'header'=>$this->__('NAME'),
                        'index' => 'name'
                ));
        $this->addColumn('guestfeedback',
                array(
                'header'=>$this->__('GUEST FEEDBACK'),
                'index' => 'guestfeedback',
        ));
        return parent::_prepareColumns();
    }

    public function getRowUrl($row)
    {
        return $this->getUrl('*/*/edit', array('id' => $row->getId()));
    }
}


texts: Unable to create account in magento 2.2.10

texts: Unable to create account. It refresh the register form without any response


texts: Restrict the role permission to read only

texts:
I have built my Magento store with the Magento - 1.9.X.X

I am trying to create a role with just read-only permissions to all the modules in the admin end. The user should be able to view all the modules, but not be able to edit them. Is this possible? If yes, can someone kindly tell me how to do that?


texts: In Magento2, how to get checked checkboxes values in uicomponent grid in frontend?

texts:
I have added grid using uicomponent in Magento 2 frontend, to list related products. grid is showing fine but now i want to get checked checkboxes values (in any hidden input if possible) to send that with form data.
Screenshot below:


texts: How to display custom action on the order page?

texts:
I am developing a module that will provide a personalized printing option in the mass actions of the order page, but I just wanted to show this option if the configuration is enabled in the module settings.
It is possible?


texts: Re-save entire catalog's related products field via SSH php script?

texts:
I'm trying to re-save the "related products" field for each item in the catalog via SSH. I've seen other answers do something similar so I've attempted to replicate it with what little understanding I have, but still can't manage to get the script working.

Any advice appreciated.

require_once 'abstract.php';
class Resave_Products extends Mage_Shell_Abstract
{
    public function run()
    {
    $collection = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect('id');

    foreach ($collection as $product) {
        $product = Mage::getModel('catalog/product')->load($product->getId())
        $link = $product->getLinkInstance();
        $link->getResource()->saveProductLinks($product, $data, $link::LINK_TYPE_RELATED);
        $product->save();
    }
}


texts: Fatal error: Call to a member function toCurrency()

texts:
After login in the backend, sometimes (not always) I've this error appearing in the dashboard screen.

It's very strange and I really don't know where to look. I tried to disable all plugins, clear the cache etc.. but nothing changes


texts: Magento 2 | Checkout: Change type of field (telephone)

texts:
I want to change the input for the telephone field in the checkout from text to number.

I looked into it 2 years ago and created this topic on the Magento community forum: https://community.magento.com/t5/Magento-2-x-Programming/Change-telephone-input-field-to-number/td-p/93660 There were some answers there but none worked. Now two years later another of our customers asks for this but I still can't seem to find a fix. Does anyone have a clue?

Thanks in advance


texts:
I'm new to Magento I try to call category level using Magento SOAP API with parent category id. I use following code.

<?php
$proxy = new SoapClient('http://domain/index.php/api/soap/?wsdl');
$session = $proxy->login('user', 'password');
$result = $proxy->call($session,'catalog_category.level');
echo json_encode($result);
?>

Here for the above code, "Default Category" details are coming. now I try to call some other category by using following codes.

$result = $proxy->call($session,'catalog_category.level',12);

That is not working

$arguments = array( 'parentCategory' => 12);
$result = $proxy->call($session,'catalog_category.level',$arguments);

This is also not working.

Then I try to call category tree using following code.

 <?php
$proxy = new SoapClient('http://domain/index.php/api/soap/?wsdl');
$session = $proxy->login('user', 'password');
$result = $proxy->call($session,'catalog_category.tree');
echo json_encode($result);
?>

it showing all the category tree. it means API is working but whenever I try to pass an argument it showing server not found an error.

Can any one please tell me how to pass arguments with the request.


texts: How to deal with multiple extensions overriding the same template file?

texts:
I have two extensions which load their own template for the block with name customer_form_register in customer_account_create

The first extensions overrides the template to add a new field to the form and the second extension overrides the template to add the google recaptcha.

So there is a conflict and the extension which is loaded last wins and only its template is loaded.

So there is only a new field added to the form but no google recaptcha.

How should I deal with this? Do I have to edit both extensions so that no one of them is trying to load their template and just manually merge both templates and then put it into my design? Or is there a better way?


texts:
I have not been able to find any reference to something even similar to this so I figured I would post here for some ideas.

I have a sample pack product that allows customers to choose up to 5 flavors, and another option called strength.

Right now, the flavors are chosen by checkbox and the strength chosen by dropdown like this:

Flavor Checkboxes
     Flavor1
     Flavor2
     Flavor3
     Flavor4
     Flavor5
Strength Dropdown
     Str1
     Str2
     Str3
     Str4

There is a high demand from my customers to be able to choose a different strength for each flavor.

To prevent overall ugliness what I would like to do is create multiple tiers within custom options like this:

Flavor Checkboxes
    Flavor1
       Strength Dropdown
             Str1
             Str2
             Str3
             Str4
    Flavor2
       Strength Dropdown
             Str1
             Str2
             Str3
             Str4
    Flavor3
       Strength Dropdown
             Str1
             Str2
             Str3
             Str4
    Flavor4
       Strength Dropdown
             Str1
             Str2
             Str3
             Str4
    Flavor5
       Strength Dropdown
             Str1
             Str2
             Str3
             Str4

Any ideas or solutions would be greatly appreciated. If this has been done before or is available in an extension that would be awesome, if not I am open to ideas on how to add this feature in myself.

Version: CE-1.7.0.2, Custom Theme


texts: How to add a google fonts to Magento's index page?

texts: I tried to add it via its css files or via admin panel, with javascript or link href or @import, nothing works! Please help :S


texts:
My site is in magento1. When i test my site in google's mobile compatibility testing tool it gives below error.

Page cannot be reached
This could be because the page is unavailable or blocked by robots.txt

I am also not able to edit robots.txt


texts: Magento 2 site upgrade pending or patches

texts:
I have a magento2 website on which i need to check if there is any upgrade pending or patches ,
how would i know about it , or how can i check it ?

It has also fishpig wp module to connect wp
so i to check available upgrade for wp as well , how one can do it ?


texts:
I wrote a module with help of a this link and I don't know what to do if I want to show options for a shipping method,I mean I have one shipping(one carrier title) but different method names

is it related to creating other model? if so should I change my config.xml? or other file? I cvould not solve my problem I searched through internet a lot

            $method = Mage::getModel('shipping/rate_result_method');
            $method->setCarrier($this->_code);
            $method->setMethod($this->_code);
            $method->setCarrierTitle($this->getConfigData('title'));
            $method->setMethodTitle($this->getConfigData('name'));
            $method->setPrice($price);
            $method->setCost($price);
            $result->append($method);


texts: Magento 1.9 admin grid linkable to custom .phtml file

texts:
I made a grid in admin for viewing all the applications received. I want to make a link in one column so when the admin clicks this link a new page will be opened. In this page I will pass the id and will fetch some data via collections.
Further I have made front end form and all tables have collections. Please advice weather it is good idea to use collection queries to fetch data from db tables in the phtml file or there is some alternative to this. Remember this is not single query this contains some joins etc also.

Thanks in advance.


texts:
My store is from Chile

I'll set timezone America/Santiago from the backend.
When I place the order, it gets the wrong time.
I created one script and write below code.

  <?php require 'app/Mage.php';
    Mage::app();
    echo Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s');
?>

Tt returns 2018-09-07 11:30:43
but the current time in Chile is 2018-09-07 10:30:43
Can anyone have a solution for this?


texts: After install SSL some Problem with Magento 1.9.3.0

texts:
after i have install SSL in webshop i get this errors

1  a user tries to login with SSL (https: //www.mydomain.com/customer/account/login/), he returns to the login page (the same) and it doesn't go on... Come back always!

If I change the base url SECURE from https to http, it works! All that with all browsers

2
- if customer click in catalog product list tries to  add to card or quick view  pop up open somewhere else

hope you can help


texts: getVisitorData() returns NULL on Category Page only in magento-1.9.2.2

texts:
On my Porto theme with Magento 1.9.2.2, Currency Switcher is not working on category_list page and product_view page. On both of these pages, switching the currency always returns Base Currency.
Using the URL like this

  http://example.com/catalog/category/view/id/82  (working well)

works fine i.e., the currency changed. Also getting the visitor's information using following method returns the array with information.

  Mage::getSingleton('core/session')->getVisitorData();

But with the URL with URL key doesn't work. and getVisitorData() returns NULL value on the links with URL-key like following.

  http://example.com/category.html   (doesn't work)

Please help me to figure this out.
Thanks in advance :)


texts: i had newly installed the magento 2 and this problem is occuring with elasticsearch please help


texts: How to create a custom tab in product details page?

texts:
In magento 1.9.2.4 Product details page, I want to keep a tab to switch between contents like below:

But already In details page there is default tab (I inherited rwd theme) Like this:

In app/design/frontend/<package>/<theme>/template/catalog/product/view.phtml

coding for this tab was like this:

    <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>

            <?php foreach ($detailedInfoGroup as $alias => $html):?>

<?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?>

<?php echo $html ?>

            <?php endforeach;?>

    <?php endif; ?>

And in app/design/frontend/<package>/<theme>/layout/catalog.xml
 it was like this:

<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
     <action method="addToParentGroup"><group>detailed_info</group></action>
     <action method="setTitle" translate="value"><value>Description</value></action>
</block>

so In order to keep like this tab I added this code in phtml file:

    <?php if ($miniDetailedInfoGroup = $this->getChildGroup('detail_info', 'getChildHtml')):?>

            <?php foreach ($miniDetailedInfoGroup as $alias => $html):?>

<?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?>

<?php echo $html ?>

            <?php endforeach;?>

    <?php endif; ?>

and added in xml file like this:

<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
     <action method="addToParentGroup"><group>detail_info</group></action>
     <action method="setTitle" translate="value"><value>Description</value></action>
</block>

But nothing displayed. Someone please help.


texts: How to set admin menu inside different module?

texts: I want to set admin multiple module menu in one custom menu. for ex. in below image i want to set Banner slider inside the Blog menu. when i open the blog menu i can show here Banner slider menu.


texts: 1 Domain - 2 Stores - both of them in English and German - How to get Language Tag in URL?

texts:
Stores:
 - automobile
 - truck

Languages:
 - German
 - English

StoreViews Codes:
 - automobile German: auto
 - automobile English: car
 - truck German: laster
 - truck English: truck

Desired urls:
 - automobile German: example.com/de/auto
 - automobile English: example.com/en/car
 - truck German: example.com/de/laster
 - truck English: example.com/en/truck

Problem
I am able to get the store view code in the url but I am not able to get the language tag in the url. How can I build the aforementioned urls in Magento 2?

Edit:
From my point of view, this is not a duplicate since I don't want to have multiple websites. I want one website and multiple stores with store codes in the url AND the language tag in the url.


texts: Magento custom language file not being used

texts:
I have created a custom language file for a feature that I have built into our Magento website. The language variables work fine on my local machine (of course), however on our staging environment it doesn't. My local machine is Windows and staging server is Linux, so obvious answer would be an issue with filename casing, but imho these are right.

I have my own block that overwrites the Mage_Catalog, called Feno_Catalog which works fine. To that config.xml file I've appended some code to load the Feno_Catalog.csv;

/local/Feno/Catalog/etc/config.xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<config>
    <modules>
        <Feno_Catalog>
            <version>0.1.0</version>
        </Feno_Catalog>
    </modules>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <class>Feno_Catalog_Block</class>
                </rewrite>
            </catalog>
        </blocks>
        <helpers>
            <catalog>
                <rewrite>
                    <class>Feno_Catalog_Helper</class>
                </rewrite>
            </catalog>
        </helpers>
    </global>
    <frontend>
        <translate>
            <modules>
                <Feno_Catalog>
                    <files>
                        <default>Feno_Catalog.csv</default>
                    </files>
                </Feno_Catalog>
            </modules>
        </translate>
    </frontend>
    <adminhtml>
        <translate>
            <modules>
                <Feno_Catalog>
                    <files>
                        <default>Feno_Catalog.csv</default>
                    </files>
                </Feno_Catalog>
            </modules>
        </translate>
    </adminhtml>
</config>

The CSV file has been put into 2 folders: /app/locale/[de_DE|en_US]/ with matching casing.

As I mentioned it works fine on my local machine, but not on the staging server. What could cause this? I've searched for quite a bit and cleared cache (although cache is turned off), switched languages (both languages don't work - The language keys are like "poll_question_a1").

When I move the translations to Mage_Catalog.csv everything also works fine (but of course that is not what I want).

So how to fix? Is there any way to find the cause of this?


texts: How to auto get Module A when install Module B in magento2?

texts:
For example I have two modules, Demo and Base. I want that when Module Demo gets installed, module Base is automatically fetched from Github and installed.

I think it is related to composer.

Edited
i trying to put code file composer.json of module A

{
    "name": "namespace/modulea",
    "description": "N/a",
    "require": {
        "php": "~5.6.0|7.0.2|~7.0.6",
        "magento/module-store": "100.1.*",
        "magento/module-backend": "100.1.*",
        "magento/framework": "100.1.*",
        "namespace/moduleb": "101.0.1"
    },
    "type": "magento2-module",
    "version": "101.1.3",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Namspace\\ModuleA\\": ""
        }
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/xxx/moduleb.git"
        }
    ]
}

it true?


texts: Magento 2: Hide other shipping methods when free shipping is available

texts: I charge my customers flat rate for shipping and I also offer free shipping for orders that are above certain amount. At the moment, customers who qualify for free shipping will also have paid shipping option shown, which may confuse some customers. Does anyone know if there's a way to hide other shipping methods when free shipping method is available?


texts: Magento - replacing all external css and javascript path in head

texts:
I am trying to replace all external CSS and JS files path in Magento. What is the best way to do it? Using any observer?

For example, http://magentotest.localhost/skin/frontend/rwd/default/css/styles.css would become http://magentotest.localhost/min/?f=skin/frontend/rwd/default/css/styles.css

Just trying the Minify library.


texts: How can remove"?___from_store=example" from my URL?

texts:
I want to remove this string "?___from_store=example" from my URL and i dont know how. I have two stories with different language and when I press a diferent Store my url converts to https://website.com/example1/?___from_store=example2

So "/example1/" its the store where i am actually and "=example2" it was the store where i was before.

How can remove this part from URL? https://website.com/example1/?___from_store=example2

My URL Options are:

Add Store Code to URLs -> Yes
Auto-redirect to Base URL -> Yes(302)

Search Engine Optimization:

Use Web Server Rewrites -> Yes

If i set Add store Code to URLs as No When you change the store the URL is different -> https://example.com/?___store=example2&___from_store=example1

The string from URL https://website.com/example1/?___from_store=example2
dissapear..


texts: Magento 2: Access Denied Error generated in report while the browser page is loading

texts:
[2017-10-06 04:20:22] main.CRITICAL: exception 'PDOException' with
  message 'SQLSTATE[28000] [1045] Access denied for user 'xxx'@'xxx'
  (using password: YES)' in
  /home/xx-xx/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:129

I have Changed Folder/Files permission to 755/644 respectively


texts: Magento Training needed for Version 1.9 to Create a Theme

texts:
I am looking for accelerated online training to be able to create a theme /package in version 1.9.

I already have a responsive HTML design, and I can develop in quite a few different languages - but I am not overly familiar with the Magento framework ( I have done bits and pieces with version 1.3 - and I know the basic structure. )

I looked at U Magento - but I find it a bit confusing and more focused on version 2 ( and not sure which ones to take exactly).

I definitely need Magento v.1.x as I have quite a few extensions that have a lifetime upgrade for version 1 and payment gateways etc are not available for v. 2.

I would prefer video-based, although a concise step by step guide to get a theme up and running would be really great.

thanks for your time, your help is greatly appreciated.


texts: Magento 2 products are added through admin panel,but its not showing in the frontsite?

texts: I have created the categories and subcategories after that I have added the products and assigned each product under some categories, but it is not showing on the front website when clicking the categories link?


texts: Magento : Error in payment redirect page

texts:
When I Click on Place Order button I get this error message on console:

.prototype.js:828 Uncaught TypeError: Cannot set property 'href' of undefined

and Order was not placed.


texts: Creating bundle products with fixed items in the bundle

texts:
I am trying to create a product bundle which contains 6 child products. 3 of these child products are fixed and must be included in the bundle. Each of the other 3 child products has different models and customer can choose which model he wants.

Is this possible with Magento?

Why I can not use bundle products

It is not possible to add fixed products. In addition user can change the qty (the qty of each item is fixed, only model can be chosen)

Why I can not use configurable products

If each of 3 child products has 2 models, I need to define 8 products. But I actually have 6 products. this causes problem in managing stock.

Is it possible to create such products in Magento?
Thank you


texts: Show or hide elements for specific storefront in Magento 2

texts:
I am running a Magento 2 multistore installation. I added a new storefront, which is almost the same as the main store (same layout/theme, but different logo, colors etc).
However, on the product detail pages I want to hide some elements/variables  (for example the product description) in this new storefront or only display them when a specific translation for this storefront is set. Both storefronts are using the same layout xml files.

What is the best way to implement these little exceptions?

And, when using product attribute values in phtml files, can I also get check if this value is storeview-specific or not? For example:

$product->getData('product_attribute_name')

This returns a value, but I don't know if it's the 'main' value for this attribute, or if it's storeview specific. I would like to do something like this, so it only returns a value when a storeview specific value is set:

$product->getData('product_attribute_name', $storeviewCode)


texts: set subtotal value at multiple addresses checkout

texts: In the multiple address review checkout, there is sub total for each item, like in the picture below. How can I get the subtotal value for each item and change it?


texts: Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory .Magento 1.9 indexing error

texts:
I have installed Magento 1.9 but when I am trying to run indexer command
I am getting following errors.

PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory in /opt/lampp/htdocs/magento1/lib/Zend/Db/Adapter/Pdo/Abstract.php:128
Stack trace:
#0 /opt/lampp/htdocs/magento1/lib/Zend/Db/Adapter/Pdo/Abstract.php(128): PDO->__construct('mysql:host=loca...', 'mag1', 'mag1@123', Array)
#1 /opt/lampp/htdocs/magento1/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#2 /opt/lampp/htdocs/magento1/lib/Varien/Db/Adapter/Pdo/Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#3 /opt/lampp/htdocs/magento1/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#4 /opt/lampp/htdocs/magento1/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#5 /opt/lampp/htdocs/magento1/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#6 /opt/lampp/htdocs/magento1/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#7 / in /opt/lampp/htdocs/magento1/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 144

I am running

php shell/indexer.php

is it correct or anything else I have to run indexer command
Thanks in advance :)


texts:
Creating a user role to access only the VIEW action under sales order, does not deny the user from editing the billing and shipping address in the order information page.

Is there a way to fix it?


texts: Remove trailing slash in canonical url for Magento home page

texts: For some reason my canonical url for the home page has a trailing slash. Why has Magento added this and how can I remove it?


texts:
M1 How do I change a magento product attribute to type static (barcode)?

I am trying to change the product attribute barcode (EAN) from a normal attribute value to a static type so it is in catalog_product_entity.

Maybe 2 questions

How can I change the type easily to static? (or create it as new varchar 13)
And do it so that I loose no data? (move it from old eav tables to static table in catalog_product_entity)

Tips, hints are welcome.


texts: Magento 2 change logic in layout if logged in

texts: I have a block in a layout xml but I only want it to be displayed if the customer is not logged in. Is this possible?


texts: I am trying to override core interface in Vendor\magento\sales\Api\Data\OrderItemInterface.php

texts:
My di.xml code is here, is there any alternative way to override an interface for core file.

<preference for="Magento\Sales\Api\Data\OrderItemInterface"
type="Vendor\Name\Api\Data\OrderItemInterface" />


texts: how to add phtml file in magento 1 homepage?

texts:
Which is the quickiest way to add/call a phtml file in homepage (only)
in magento 1 (custom theme) ?
I am not sure about magento 1, so any thoughts would be appreciated.


texts: Magento 2.3 - Storefront and Admin urls at localhost:8081 show 404 / not found

texts:
After successfully installing Magento (environment below), url's to access storefront and admin show a 404/Not Found errors. What am i missing?

Environment:

macOS Mojave 10.14.2
Apache 2.4.37
PHP 7.2.9
MySQL 8.0

While installing:

Apache is running on port 8081
I chose the store name to be magento instead of magento2

Tried these:

Copied .htaccess from /htdocs/magento2/app/pub to /htdocs/magento2/
Updated httpd.conf file to Listen 8081 , ServerName localhost:8081 and enabled LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so

Screenshots:


texts: Logged-in Customer Cannot Add Products to Cart

texts:
We're currently on an instance of Magento 2.2.7 (most products and customers have been migrated from Magento 1).

We have a strange issue where a small number of our customers are trying to order some stuff but once they login to their account they are experiencing problems.

If they're not logged in products can be added to the cart but when they try to check out and login with "My Account" the products disappear.

Furthermore if they try to add any products while logged in they cannot get them added to the cart.

They claim that they can still checkout as guests.

I cannot replicate the error myself and as this is only happening to a small number of customers I'm not sure what could be causing it or even how to test for it.

I wondered if anyone else has encountered this problem and if they found a cause or solution.


texts: Magento 2 Set Array Data in Controller and call in PHTML

texts:
Controller

public function execute()
    {

        $bags_result = array(   'height'=>$height,
                                'weight'=>$weight
                            );

        $result = $this->resultJsonFactory->create();
        $resultPage = $this->resultPageFactory->create();

        $block = $resultPage->getLayout()
                ->createBlock('Vendor\Module\Block\Index')
                ->setTemplate('Vendor_Module::calculation.phtml')
                ->setData('bags_result',$bags_result)
                ->toHtml();

        $result->setData(['output' => $block]);
        return $result;
    }

Block File function

public function getBagsResultData()
    {
        return $this->getBagsResult();
    }

calculations.phtml

<?php echo __('Height')?><?php echo $this->getBagsResultData('height')?>
<?php echo __('Weight')?><?php echo $this->getBagsResultData('weight')?>

Even if I change and use $block->getBagsResultData(); it gives the below error.

  Error: 1 exception(s): Exception #0 (Exception): Notice: Array to
  string conversion

How do I fetch and display array data set in controller using block or directly in phtml ?


texts: Magento 2: I need to change template for different categories

texts:
I need to change the template for subcategories(like able to assign any category) and list.phtml is fine. But need to change template for random categories.

Any one have solution for this?


texts: Can I safely remove code in an extending theme file that redefines block from the original core files?

texts:
this is related to several qestions that I have found on Stackexchange, including one I posted myself, as well as what I have read in the Magento 2.1 docs.  But I'm a bit worried about consequences.

I have employed the use of a theme in my Magento 2.1.2 store.  The Magento_Catalog module in the theme extends the catalog_product_view.xml file from the base Magento theme.  There are snippets of code in the extending file that are the exact pieces of code from the Magento core files, and are causing my site to throw exceptions over and over and over.  Below the is the code:

Magento Core:

<block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
    <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
</block>

Theme code:

<block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
    <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
</block>

There are other snippets of code that are the exact same as well, but this block is the only area that is throwing the exception.  Exception is:

[2017-02-07 22:17:38] main.CRITICAL: Magento\Framework\Exception\LocalizedException: The element 'product.info.options' already has a child with alias 'file' in /home/{username}/public_html/vendor/magento/framework/Data/Structure.php:611

...with exceptions for each of the alias (as="") names "default", "text", "file", "select", "date".  The other alias names in the extending file code are not throwing exceptions for some reason.

Why are these alias names ("default", "text", "file", "select", "date") throwing exceptions, but the others alias names that are also in the core code do not?
Can I remove this code from the extending file safely?  I tried changing the alias names, but I was worried that it may be called somewhere that I don't know and mess up the storefront.

I have found a few questions regarding alias name and some say that the alias name can be "anything" but IF it is called somewhere by getChildHtml then won't there be a problem?

I have also read the Docs about extending and I have a feeling the theme code writer is not correct in re-writing the same block code (but, why did they do it?)

Thanks in advance


texts: How to Get Related Products in custom module admin grid?

texts:
I am working on Magento custom module admin grid I want to show product id and related product id and other product information.

Please help me to do this.


texts: I need to remove page title of home page in magento 2

texts: I have tried to change homepage title from admin and xml but nothing take effect.Can i change it from Database or any other way to change.


texts: Magento 2.3.0 WYSIWYG editor's image not loading on frontend

texts:
we have created some category's custom attribute of WYSIWYG editor type. While we are adding image in these custom attribute's editor, they are showing/loading fine in admin section but while we are fetching these attributes data on frontend, images are not loading.

Magento making image url on frontend like -  <img src="{{media url=&quot;handmade-thumb.jpg&quot;}}" alt="" />

Its picking image url as text.

Please help me to solve this issue.


texts: Search by SKU not working in magento 2.3

texts:
I am facing some problems while searching with SKU in the catalog search.

I have already turned on "Use in Search" and "Visible in Advanced Search" fields for SKU product attribute. However, when I search using SKU it's not showing any results.

I have tried the advanced search and an extension both of them are returning no results.

Does anyone know what to do, please help.


texts: Disable Full Page Cache from category Pages

texts:
For some reason I want to disable Full Page Cache for category pages.
I have created my custom module for this but some reason it is not working.

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Custom_HeaderFix>
            <version>1.0.0</version>
        </Custom_HeaderFix>
    </modules>
    <global>
        <models>
            <headerFix>
                <class>Custom_HeaderFix_Model</class>
            </headerFix>
        </models>
    </global>
    <frontend>
        <events>
            <controller_action_predispatch>
                <observers>
                    <headerCache>
                        <type>singleton</type>
                        <class>headerFix/observer</class>
                        <method>processPreDispatch</method>
                    </headerCache>
                </observers>
            </controller_action_predispatch>
        </events>
    </frontend>
</config>

Observer.php

<?php

class Custom_HeaderFix_Model_Observer {

    public function processPreDispatch(Varien_Event_Observer $observer) {
        $action = $observer->getEvent()->getControllerAction();

        if ($action instanceof Mage_Catalog_CategoryController) {
        $cache = Mage::app()->getCacheInstance();

        // Tell Magento to 'ban' the use of FPC for this request
        $cache->banUse('full_page');
        }
    }

}

I have used similar code for disabling FPC from home page and that worked.


texts: Changing add to cart button depending on category Id

texts:
I have a category of products that can't be bought online directly but that I want to give the functionality of going to a distributors page.

For that, I need to retrieve the category id of the current product and if it's equal to 13 display a different content for the add to cart button.

So far, the code that I have is:

<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>

<?php $categoryId = Mage::getModel('catalog/layer')->getCurrentCategory()->getId(); ?>
<?php if ($categoryId == 13) {?>

        <button type="button" title="<?php echo $this->__('Find your nearest retailer') ?>" id="product-addtocart-button" class="button btn-cart v-center" onclick="setLocation('<?php echo $this->getUrl('distributors') ?>')"><?php echo $this->__('Find your nearest retailer') ?></button>

<?php }
    elseif ($_product->isSaleable()) { ?>

        <button type="button" title="<?php echo $buttonTitle ?>" id="product-addtocart-button" class="button btn-cart v-center" onclick="productAddToCartForm.submit(this)"><?php echo $buttonTitle ?></button>
        <?php if(!$_product->isGrouped()){ ?>

                <?php echo $this->__('Qty:') ?>
                <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />

        <?php } ?>

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

<?php } ?>

Could you guys help me with getting this to work?

Thanks.


texts: Price is not updating in all store views even though scope is set to global

texts:
We have multiple store views but we want prices to be universal across all stores views. We have the scope set to global but when I update prices either via upload through Magmi or manually it doesn't always update in all store views. I need to be able to update in admin or default store and it should change in all stores.

Can anyone please help me because I am getting one price in the product page and another price in the shopping cart on the front end. It seems like the product page gets the price from default store view and the shopping cart is taking from the admin values. I need them all to be in sync.

Thank you


texts: How to add 2 wysiwyg field in same form in back office

texts:
I need to insert two wysiwyg fields with tinymce in my backend module in the same form.

It's working when I insert only one with this code in the edit tab form:

$fieldset->addField('mother', 'editor', array(
    'name'      => 'mother',
    'label'     => Mage::helper('cms')->__('Mother content'),
    'title'     => Mage::helper('cms')->__('Mother content'),
    'style'     => 'height:12em;width:30em',
    'required'  => true,
    'wisiwyg'   => false,
    'config'      => Mage::getSingleton('cms/wysiwyg_config')->getConfig()
));

and this one in the editAction in the controllers

$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
    $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
}

But when I try to insert a second one, chrome doesn't load tinymce and crashes (unable to close the tab in chrome, I need to use windows task management to cancel the chrome process). Maybe a JS conflict? I can't even access the console in chrome...

[EDIT after comment] And below the maybe problematic code for the second wysiwyg field

$fieldset->addField('content', 'editor', array(
    'name'      => 'content',
    'label'     => Mage::helper('cms')->__('Main content'),
    'title'     => Mage::helper('cms')->__('Main content'),
    //'style'     => 'height:36em;width:30em',
    'required'  => true,
    'wisiwyg'   => true,
    'config'      => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
));


texts: Magento2 - Add custom javascript to 'My Account' page

texts:
I've been trying to find questions, articles, or documentation covering this, but haven't been able to find what I need or haven't understood it yet.

I have a custom module that a colleague wrote (who has since left) that adds some functionality via an API endpoint that we consume in a different application.

I now need to add some javascript to the /customer/account/ page.

I've read this answer and understand that I need to put something like the below into a config file:

<?xml version="1.0"?>

<layout version="0.1.0">
    <customer_account_view>
         <reference name="head">
                <action method="addJs"><script>{my script}.js</script></action>
            </reference>
    </customer_account_view>
</layout>

Where does {my script}.js need to live inside my module directory, and which config file do I need to put the above block (if it is correct) inside my etc directory?

The current module directory looks like this:

UPDATE

The namespace for my module is James and the module is called AddToCart (i.e app/code/James/AddToCart.
Following the advice inside solution 2 by @xanka, I first created the customer_account_index.xml file at the following location app/code/James/AddToCart/view/frontend/layout/customer_account_index.xml with the following contents:

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

I then created the script inside the app/code/James/AddToCart/view/frontend/web/js/postMessage.js file:

console.log('test');

I then ran the following commands, unsure if necessary:

php bin/magento maintenance:enable
php bin/magento setup:upgrade
php -d memory_limit=2G bin/magento setup:di:compile
php -d memory_limit=8G -d max_execution_time=18000 bin/magento setup:static-content:deploy -f
php bin/magento maintenance:disable
php bin/magento cache:clean
php bin/magento cache:flush
redis-cli -p 6379 flushall

Everything ran successfully, however I cannot see 'test' in my dev console when I log in and visit /customer/account and when I view source, I cannot see that my script is included in the head. Where have I gone wrong?


texts: Magento 1: Error 500 after installing attribute

texts:
For some reason Magento stopped working after i tried installing a attribute. It doesn't show up in var/log, setting init_set to 1 simply gives me a blank page with no error and changing htacess memory limit doesn't work. Disabling the module gives me another error (Invalid backend model specified: 1). What is causing all this?

Config file:

<timer_setup>
            <setup>
                <module>Apptha_Timer</module>
                <class>Apptha_Timer_Model_Resource_Eav_Mysql4_Setup</class>
            </setup>

            <connection>
                <use>core_setup</use>
            </connection>
        </timer_setup>

mysql4-upgrade-0.1.4-1.0.0.php:

$installer = $this;

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();

$setup->addAttribute('catalog_product', 'countdown', array(
    'group'                 => 'Prices',
    'label'                 => 'Ativar Cronometro Regressivo',
    'type'                  => 'int',
    'input'                 => 'boolean',
    'default_value_yesno'   => 1,
    'class'                 => '',
    'backend'               => '',
    'frontend'              => '',
    'global'                => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'               => true,
    'required'              => false,
    'user_defined'          => true,
    'searchable'            => false,
    'filterable'            => false,
    'comparable'            => false,
    'visible_on_front'              => true,
    'visible_in_advanced_search'    => false,
    'unique'                => false
));
$installer->endSetup();

Setup.php:

class Apptha_Timer_Model_Resource_Eav_Mysql4_Setup extends Mage_Core_Model_Resource_Setup
{

}


texts: How do I get date time stamp of a file since last it was modified in Magento 2?

texts:
I have requirement to read the last modified time of a log file in the Magento 2  like Apr 10, 2017, 6:47:17 AM

The log file will be present under var/log directory of Magento. How can implement it? Is there a method in core Magento for this?


texts: multiple of specific Number condition operator

texts:
in magneto 2 we have condition operators such as
$operators = [
            '>=' => __('equals or greater than'),
            '<=' => __('equals or less than'),
            '>' => __('greater than'),
            '<' => __('less than'),
        ];

is there any operator for "multiple of specific number"
e.g:
multiple of 2 is 4,6,8,10
multiple of 3 is 6,9,12,15
kindly advise.
Thanks


texts: In production mode the site does not load

texts:
I'm having problems with Magento 2.2.6
I deploy and when I go to the site it does not load
Here's how I deploy:

php bin/magento deploy:mode:show
Current application mode: production. (Note: Environment variables may override this value.)

rm -rf /var/www/html/magento2/var/view_preprocessed/*
rm -rf /var/www/html/magento2/var/page_cache/*
rm -rf /var/www/html/magento2/pub/static/*

php bin/magento cache:flush
php bin/magento cache:clean

php bin/magento setup:static-content:deploy -f pt_BR en_US

cd /var/www/html/magento2
chown www-data:www-data -R *
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod 777 ./generated

systemctl restart apache2
systemctl restart varnish
systemctl restart redis-server
systemctl restart mysql

Follows magento settings:
catalog/frontend/flat_catalog_category - 1
catalog/frontend/flat_catalog_product - 1
dev/template/minify_html - 1
dev/js/merge_files - 1
dev/js/enable_js_bundling - 1
dev/js/minify_files - 1
dev/css/merge_css_files - 1
dev/css/minify_files - 1
dev/grid/async_indexing - 1
dev/static/sign - 0

Access the site and error 500 in attachment (error.png)

I modify the /var/www/html/magento2/.htaccess file and add
SetEnv MAGE_MODE developer
The site returns to work correctly without any errors (site.png).
When I comment this line back does not work

I can not find where the error is.
I want to leave the site in production mode but ERROR 500 occurs

I would like your help if possible.

error.png

site.png


texts: Mini cart product and cart page product order sequences does NOT match in Magento 2

texts:
I tried,

in catalog_category_view.xml file

  <referenceBlock class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list">
            <action method="setDefaultDirection">
                <argument name="dir" xsi:type="string">desc</argument>
            </action>
  </referenceBlock>


texts:
I am facing the below problem when requesting the customer list:
Critical: Report ID: webapi-600ad6e880167; Message: Item (Magento\Customer\Model\Customer\Interceptor) with the same ID "6827" already exists.
Request URI: /index.php/rest/V1/customers/search?searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=updated_at&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=2021-01-01%2009:23:26&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bcondition_type%5D=gt&searchCriteria%5Bsort_orders%5D%5B0%5D%5Bfield%5D=updated_at&searchCriteria%5Bsort_orders%5D%5B0%5D%5Bdirection%5D=ASC&searchCriteria%5Bpage_size%5D=101&searchCriteria%5Bcurrent_page%5D=1
[2021-01-22 15:18:23] main.CRITICAL: Report ID: webapi-600aecbf05b0d; Message: Item (Magento\Customer\Model\Customer\Interceptor) with the same ID "6827" already exists. {"exception":"[object] (Exception(code: 0): Report ID: webapi-600aecbf05b0d; Message: Item (Magento\Customer\Model\Customer\Interceptor) with the same ID "6827" already exists. at /var/www/vhosts/domain.com/httpdocs/vendor/magento/framework/Webapi/ErrorProcessor.php:208, Exception(code: 0): Item (Magento\Customer\Model\Customer\Interceptor) with the same ID "6827" already exists. at /var/www/vhosts/domain.com/httpdocs/vendor/magento/framework/Data/Collection.php:408)"} []
I have no clue how to fix this? The customer indeed exists when looking up the ID in the backend, but I cant seem to find any duplicate IDs. Can I somehow debug it further to know in which table I need to look?
Thanks!


texts: How to increase Magento site speed in Godaddy shared hosting?

texts:
I m using a Godaddy shared hosting server for my magento store. It takes a too long response from the server. I optimized the magento site with the default options like,

Enable cache in back end
Enable compiler
Merging Css/Js
Leverage browser cache
Image optimization etc.

But there is no improve my site performance. My website url is http://fleafashions.com

I need to optimize anything in my site or it is an issue from godaddy?


texts: How to change an extension and be safe in case of updates?

texts:
I use the extension "FME Extension" to add additional fields to my onepage checkout - the plugin ads the * after the label and I want to change it, so that the span starts before the label - as this is how the other fields of the form are displayed.

I can now navigate to:

app/local/FME/Fieldsmanager/Model/Fieldsmanager.php

and change the code as follows:

$html .='
';
if($NewFieldData['is_required']){ $html .="*";}
$html .= '<label for="fm_'.$NewFieldData['attribute_code'] . '"';

Now the , that highlights the required fields, will be displayed before the label, but what happens if the extension gets updated? Is there any other way to change the code of local extensions but be safe in case the extension gets an update?

Thanks!


texts: Magento 2 how to change customers group based on order status with cron jobs

texts:
If customer order status is pending and more than 30 days, how to change customer group to wholesale in CRONs?

CRONs should run at every one minute.

This is my code

public function execute()
{
     $today          = date("Y-m-d h:i:s");
     $to             = strtotime('-02 min', strtotime($today));
     $to             = date('Y-m-d h:i:s', $to);

    $filterGroupDate      = $this->filterGroup;
    $filterGroupStatus    = clone($filterGroupDate);

     $filterDate      = $this->filterBuilder
         ->setField('updated_at')
         ->setConditionType('to')
         ->setValue($to)
         ->create();
    $filterStatus    = $this->filterBuilder
        ->setField('status')
        ->setConditionType('eq')
        ->setValue('pending_payment')
        ->create();

    $filterGroupDate->setFilters([$filterDate]);
    $filterGroupStatus->setFilters([$filterStatus]);

    $searchCriteria = $this->searchCriteriaBuilder->setFilterGroups(
        [$filterGroupStatus]
    );
    $searchResults  = $this->orderRepository->getList($searchCriteria->create());

    $selectedgroup=3;

    /** @var Order $order */
    foreach ($searchResults->getItems() as $order) {
        $this->orderManagement->cancel($order->getId());
         $customer = $order->getCustomer();
         $customer->setData('customer_group_id', $selectedgroup)->save();

    }
}


texts: Magento - Difference between validator and validator.validate()

texts:
In the login.phtml, what is the difference between validator and validate - Could someone explain what is the meaning of each of the lines below.

function onepageLogin(button)
        {
            if(loginForm.validator && loginForm.validator.validate()){
                button.disabled = true;
                loginForm.submit();
            }
        }

Thanks.


texts: PHP Version Check Error in Magento 2.1.2

texts:
I am trying to install Magento 2 on my server. My Server configuration are:

6gb Ram
Mysql Version 5.6
Php Version 5.6.26
VPS server
ISPconfig 3 admin panel

Everything is okay according to the Magento requirement, but I'm not able to install Magento 2 there. Every time I get the following error:

  One thing I have same PHP version but in PHP configuration loaded PHP path and Php CLI loaded PHP configuration path is different.

Can anybody help me to get out this issue?

The Error Show me is:

  PHP Version Check
  Your PHP version is . The required PHP version is . Hide detail
  Download and install PHP from www.php.net using this PHP Documentation.
  For additional assistance, contact your hosting provider.

  PHP Extensions Check
  missing PHP extensions. Hide detail
  The best way to resolve this is to install the correct missing extensions. >The exact fix depends on our server, your host, and other system variables.
  Our PHP extension help can get you started.
  For additional assistance, contact your hosting provider.


texts: Magento2 - How can I display a product attribute value in Order Summary block?

texts:
I am trying to display a product attribute value instead of the product name.

I have found the tempplate where it is displayed: vendor/magento/module-checkout/view/frontend/web/template/summary/item/details.html, on line 15.

e.g. Changing $parent.name to $parent.[any-attribute-code] outputs an empty string.

How can I get the value for an attribute to display ?


texts:
While reindex we are getting issue like duplicate entry as below :

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0-82-1-9.0000' for key 'PRIMARY', query was: INSERT INTO `catalog_product_index_eav_decimal_idx` SELECT `cpe`.`entity_id`, `pdd`.`attribute_id`, `cs`.`store_id`, IF(pds.value_id > 0, pds.value, pdd.value) AS `value` FROM `catalog_product_entity_decimal` AS `pdd`
CROSS JOIN `store` AS `cs`
LEFT JOIN `catalog_product_entity_decimal` AS `pds` ON pds.entity_id = pdd.entity_id AND pds.attribute_id = pdd.attribute_id AND pds.store_id=cs.store_id
LEFT JOIN `catalog_product_entity` AS `cpe` ON cpe.entity_id = pdd.entity_id
INNER JOIN `catalog_product_entity_int` AS `tad_status` ON tad_status.entity_id = pdd.entity_id AND tad_status.attribute_id = 97 AND tad_status.store_id = 0
LEFT JOIN `catalog_product_entity_int` AS `tas_status` ON tas_status.entity_id = pdd.entity_id AND tas_status.attribute_id = 97 AND tas_status.store_id = cs.store_id WHERE (pdd.store_id=0) AND (cs.store_id!=0) AND (pdd.attribute_id IN('82')) AND (IF(pds.value_id > 0, pds.value, pdd.value) IS NOT NULL) AND (IF(IFNULL(tas_status.value_id, -1) > 0, tas_status.value, tad_status.value)=1)

Catalog Rule Product ind

please do the needful


texts: Attribute not shown in layer navigation after Migration

texts:
I migrated from Magento 1.9.3.3 to Magento 2.1.7 EE. I have one issue, that is some of the attributes(multiple select) not shown in layer navigation.

Create new category called test,
Assign two products to test category, that two products have multiple select attributes.

Multiple select attribute have the below properties

but it is not rendering in layer navigation.

If anyone faces this issue before, please post the solution.

Note: Migrated attributes only have this issues, If I create a new attribute with similar fashion, it works!


texts: Product Custom Option "File Upload" not working

texts:
Have strange issue with uploading files at fronted with the custom option "file" of a product:

When I specify the file upload as a required field I always get a
Please specify the product required option(s)
as a message

Magento 1.9.1
Permissons to media folder are set to 777
file upload in the backend works fine
fiddler says: HTTP 200 /ajax/index/add/uenc/aHR0cDovL20xOS5iYW5uZXJ0ZXVmZWwubmV0L2ZhaG5lbnN0b2ZmLWJhbm5lci1oaXNzZmxhZ2dlLXRleHRpbGJhbm5lci1mYWhuZW5tYXN0/product/46/form_key/FDumHtEmtk7w6ZuU/ HTTP/1.1
according to fiddler there's no http POST (or PUT) for the file upload.. it themes that he doesn't even try

all other custom options work fine - clicking the "add to cart" button makes a POST to an URL like /ajax/index/add/uenc/aHR0cDovL20xOS5iY - which adds the item to the cart.

I checked other posts before but non of the solutions helped.

Thanks for help.


texts:
I want to insert new field for database table in my custom extension using upgrade schema by following this post,but i got an error saying :

  [Zend_Db_Statement_Exception]
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Category Depth.l
  ime_eleveniacategory' doesn't exist, query was: DESCRIBE `Category Depth`.`
  lime_eleveniacategory`

here's my code:

namespace Test\TestAgain\Setup;

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

class UpgradeSchema implements UpgradeSchemaInterface
{

    /**
     * {@inheritdoc}
     */
    public function upgrade(
        SchemaSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $setup->startSetup();
        if (version_compare($context->getVersion(), "1.0.0", "<")) {
        //Your upgrade script
        }
        if (version_compare($context->getVersion(), '1.0.1', '<')) {
          $tableName = $setup->getTable('lime_eleveniacategory');
          if ($setup->getConnection()->isTableExists($tableName) == true) {
                $connection = $setup->getConnection();
                $connection->addColumn(
                    $tableName,
                    'category_depth',
                    ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,'nullable' => false, 'afters' => 'category_name'],
                    'Category Depth'
                );
            }
        }
        $setup->endSetup();
    }
}


texts: magento 1.9 save password both md5 and salt

texts:
I have 2 web site, one is Magento and other is a web APP, the second system uses md5 , therefore we need to save the md5 password and export to web App(unfortunately we can not change the web app to use salt) , I have tried to save the password in md5 but in some cases is not generated, here is my code:

in app/code/local/MAE/config.xml

        <customer_save_before>
            <observers>
                <md5password>
                    <class>membership/observer</class>
                    <method>storeMD5Password</method>
                </md5password>
            </observers>
        </customer_save_before>

in app/code/local/MAE/membership/Observer.php

public function storeMD5Password($observer)
{
    $event = $observer->getEvent();
    $customer = $event->getCustomer();
    $postData = Mage::app()->getRequest()->getPost();

    if ($customer instanceof Mage_Customer_Model_Customer) {
        if (isset($postData['password'])) {
            $customer->setData('md5_password', md5($postData['password']));
        }
    }
}

but in some strange cases, it is not saving the password,

here are the cases which i tested and it works:

registration page
change password in my account
buying products and register(but looks like there are some failure in this part

probably it better to force to save by every login like if user successfully log in with user name and password (salt), the system update the md5 password. please let me know how to do that! or if you have any better idea.


texts:
Magento 2.3.3 and Magnifier not working correctly.

This is what you see on my website

<var name="magnifier">
     <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
     <var name="top"></var> <!-- Top position of magnifier -->
     <var name="left"></var> <!-- Left position of magnifier -->
     <var name="width">400</var> <!-- Width of magnifier block -->
     <var name="height">400</var> <!-- Height of magnifier block -->
     <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
     <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
</var>

In https://github.com/magento/magento2/issues/25027 add proprierties

max-height:inherit;

object-fit: cover;

.magnifier-preview img {
    left: 0;
    max-width: inherit;
    max-height: inherit;
    position: absolute;
    top: 0;
    object-fit: cover;
}

But zoom position not working


texts: How to pass value from controller to /resourceModel/Collection.php class

texts:
There are two table t1 and t2

t1
id, name
1, abc
2, pqr

t2
id, t1_id, phone
1 ,  1   , 7894561230
2, 1 , 7894645125
3, 2, 7445582145

I am having two grids, grid 1 showing the first table. Now if i clicked on 1st item. I should see the second grid with only t1_id == clicked item.

Both are UI grid

When i am clicking on an item it call the controller with parameter id. Now how can i filter the other grid with this id?


texts:
I want to export order report in csv.

With following content

Order Date
Order Day
Order Id
Ip Address
Customer Name
Customer Group
Billing Name
Billing Address
Billing City
Billing Postcode
Billing State
Billing Country
Billing Country Code
Billing Email Address
Billing Phone No
Billing Mobile No
Shipping Name
Shipping Address
Shipping City
Shipping Postal Code
Shipping State
Shipping Country
Shipping Country Code
Shipping Email Address
Shipping Telephone No
Shipping Mobile No
Tracking Company Name
Tracking No
Tracking Url
Marketplace Type
Payment Type
Payment Transaction Id
Marketplace ID
Product Title
Category Name
Brand Name
Weight
Quantity
Product Price
Gross Total
Discount Amount
Gross Amount After Discount
Shipping Cost
Tax Amount
Tax Name
Net Amount
Order Status
Last Activities

I tried this code for Ip address in Mage_Adminhtml_Block_Widget_Grid and function _prepareCollection()

$this->addColumn('remote_ip', array(
        'header'=> Mage::helper('sales')->__('Ip address'),
        'width' => '80px',
        'type'  => 'text',
        'index' => 'remote_ip',
    ));

But it is not showing anything in Ip address field.

Any help?


texts: How to disable/reduce cache time from a notification block?

texts:
I created a module a few minutes ago to pull information from a RSS feed and display it in the admin panels notification inbox and toolbar that's right below the admin menu.

This works perfect, but unfortunately it doesn't load new messages when i refresh. I have to flush magento's cache and then refresh for it to load the new messages.

I would like to disable cache for the notifications module/block, so all new messages can be loaded each time the page is loaded.

i tired this line of code but it didnt seem to work:

<reference name="notification_toolbar">
<action method="setCacheLifetime"><s>0</s></action>
</reference>

I didnt expect this to work, since its not the one that generates the information, only displays it.

Can someone please advise me on how to disable the cache from this module/block.

thanks.


texts: in CheckOut form have states show as abbreviations not full state name

texts:
I'm running Magento 1.9 and I have Googled and researched for a simple answer to this but no luck. I tried this option but does not work. > https://somoza.be/magento/checkout-state-abbreviations-in-magento/

Other options I've found do not explain where the files are located that I need to alter. I'm 3 moths into Magento.

Thank you


texts: Magento 2 how to add email in billing address form?


texts: Magento 2.3.5 This identifier is reserved for "CMS No Cookies Page"

texts:
I have 4 stores: Each store have the same enable-cookies I would like that each cookie cms url key have a different url so that is relevant to that store E.G:
French store URL Key: activer-les-cookies as all it's contents are in french so it make sense to have the url in french too.
I' know the exception is coming from here: https://github.com/magento/magento2/blob/2.3/app/code/Magento/Cms/Model/Page.php
But I'm looking to find a way to update the url as this wouldn't let me to it via the admin.
Any ideas?


texts:
I'm trying my best to understand more about the local.xml file.  If I may, could some kind soul answer a couple of questions I have?

As I understand it, Magento will only read one local.xml file when rendering the page?  I think this is true, because I just created a blank local.xml file in my child theme and the site was completely broken as a result.
I use the Ultimo theme and I can see in the file directory that it uses it's own local.xml file, located at: app/design/frontend/ultimo/default/layout.  If I was to modify this local.xml file, will the changes get overwritten when I update the theme?  Updates for Ultimo are common and presumably this file gets modified now and again by the developers?

Thanks for taking the time to read this.  Magento is fascinating to use but also very complicated for us beginners.


texts:
Customers starting to contact us for their missing orders.

Somehow, they reached the success page and got a proper order increment_id.

Those increment ids are skipped from the sales_order table. Nowhere to be found.

No exception thrown in magento logs either.

We found entries like this in the mysql log: [ERROR] InnoDB: (Duplicate key) writing word node to FTS auxiliary index table.

Happens randomly and of course, it's impossible to reproduce.

Going crazy here, Please help me.


texts: Will Magento include any *.xml file I put in app/etc/?

texts:
I was disabling the log_% tables when I realized it would be convenient to put the configuration in its own xml file. So I started looking for how the xml files in app/etc/ are included. When I couldn't find direct references to anything other than local.xml, and I know enterprise.xml is included, I tried an experiment: I added a properly formatted config file called 'nolog.xml' (below) and restarted Apache.

<?xml version="1.0"?>
<config>
  <frontend>
    <events>
      <controller_action_predispatch>
        <observers>
          <log>
            <type>disabled</type>
          </log>
        </observers>
      </controller_action_predispatch>
      <controller_action_postdispatch>
        <observers>
          <log>
            <type>disabled</type>
          </log>
        </observers>
      </controller_action_postdispatch>
      <customer_login>
        <observers>
          <log>
            <type>disabled</type>
          </log>
        </observers>
      </customer_login>
      <customer_logout>
        <observers>
          <log>
            <type>disabled</type>
          </log>
        </observers>
      </customer_logout>
      <sales_quote_save_after>
        <observers>
          <log>
            <type>disabled</type>
          </log>
        </observers>
      </sales_quote_save_after>
      <checkout_quote_destroy>
        <observers>
          <log>
            <type>disabled</type>
          </log>
        </observers>
      </checkout_quote_destroy>
    </events>
  </frontend>
</config>

Sure enough, my logs are still not getting written to. I'm just looking for a sanity check here: Can I put any *.xml file in app/etc and expect Magento to include it?


texts:
I am having an issue upgrading to 2.2.2 from 2.1.9. The following occurs when I load the frontend:

1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ).
Line: 56

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ).
Line: 56

#0 /var/www/magento/vendor/magento/framework/Config/Dom.php(116): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
#1 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('<layout xmlns:x...', Object(Magento\Framework\App\Arguments\ValidationState), Array, NULL, '/var/www/magent...', '%message%\nLine:...')
#2 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#3 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#4 /var/www/magento/vendor/magento/framework/Config/DomFactory.php(42): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)...

Looks like the layout xml is not valid but cannot tell where to look. I logged out the xml, but there is tons and dont know where this might be. I looked for where this exception is thrown, however could not find this message anywhere.


texts: I need to refresh a link every 5 minutes, how to schedule cron for refreshing the url


texts: Magento 1 Custom form validation is not working

texts:
I try to validate my form but it doesn't work and i don't know why. Please help me to find problem. Thanks

<form action="<?php echo $this->getUrl('vendor/addproduct/new') ?>" method="post" autocomplete="off" id="form-validate" name="form-validate"
  class="scaffold-form" enctype="multipart/form-data">

        <label for="<?php echo $login->getData("name"); ?>"
               class="required">*<?php echo $this->__('Name') ?>

            <input type="text" id="<?php echo $this->getFieldId('name') ?>"
                   name="name"
                   value="<?php echo $login->getData("name"); ?>"
                   title="<?php echo $this->__('Name') ?>" maxlength="255"
                   class="input-text required-entry"/>

    ...
</form>


texts: Magento 2 how to use RepositoryInterface getList and why

texts:
I keep reading about the use of [interface]::getList within Magento 2 and how it's the preferred method for fetching records.  For example:

namespace Magento\Customer\Api;

interface CustomerRepositoryInterface
{
    /**
     * Retrieve customers which match a specified criteria.
     *
     * This call returns an array of objects, but detailed information about each object’s attributes might not be
     * included. See https://devdocs.magento.com/codelinks/attributes.html#CustomerRepositoryInterface to determine
     * which call to use to get detailed information about all attributes for an object.
     *
     * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
     * @return \Magento\Customer\Api\Data\CustomerSearchResultsInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
}

Can anyone explain the how to use it and why it's the preferred method?


texts:
I try to get customer infos on success.phtml. I try it as guest and as logged in user.

First of all I get an order object.

$orderId = $this->getOrderId();
$order = Mage::getModel('sales/order')->load($orderId);

Or for debugging on a separate page, with an order ID:

$order = Mage::getModel('sales/order')->load('300000040');

Then I try to get the name:

echo $order->getCustomerName();

that gives me: Gast (guest in englisch). No matter if I am logged in or not.

Then I try to get the email:

$billingAdress = $order->getBillingAddress();
echo "!!".print_r($billingAdress, 1); //nothing! empty
$customerEmail = $billingAdress->getEmail(); //Fatal error: Call to a member function getEmail() on a non-object....

It seems like the order object is wrong, I can't get the total:

echo $order->getGrandTotal(); //empty

Magento Version 1.7.0.2

Does anyone see my mistake?


texts: How to reindex the magento2 site from a remote system.Please help me to find this.Thanks in advance


texts: Magento 1.9.3.1 30 second TTFB Caused by BLOCK ACTION: top.links -> addLink

texts:
I've a site that's been up for the previous year without issue, however recently it has an extremely long TTFB of over 30 seconds when loading anything.

I've installed AOE profiler which tells me its being caused by BLOCK ACTION:

  top.links -> addLink

Would anyone know how I might go about fixing this?

Many thanks.


texts: Magento 2 - Which is faster - load product by ID via ProductRepositoryInterface, ProductFactory or object manager

texts:
Approaching loading products from performance point of view.  Assuming you want to echo out standard attribute values such as SKU, name, etc. and you are dealing with a large number of products and you are loading them within a loop (assume not a product collection). Anyone know which is the fastest method?

ObjectManager (Yes I know you're not supposed to use this method)

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id);

ProductRepositoryInterface

protected $productRepository;
    ...
    public function __construct(
    ...
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
    ) {
        ...
        $this->productRepository= $productRepository;
        ...
    }

    $product = $this->productRepository->getById($id);

ProductFactory

protected $productFactory;
    ...
    public function __construct(
        ...
        \Magento\Catalog\Model\ProductFactory $productFactory
    ) {
        ...
        $this->productFactory = $productFactory;
        ...
    }

$product = $this->productFactory->create()->load($id);


texts:
Is Displaying Reviews  tabs in product view page is default magento 1.9 feature ?

if so,  it is hidden in our site. I want to display it again.

what code is reason to hide the Review tab in view page.

This question is not duplicate because i am not asking how to display reviews in product-view page, i want to display reviews as tabs in product view page as below image....


texts:
For the event name

  cataloginventory_stock_revert_products_sale event

in Magento 1, what is the equivalent event in magento2?

Thanks


texts:
I'm a just little bit curious.... I really want to know it is possible
  to create a travel agency website with Magento platform So that people
  can buy flights tickets online.


texts: Updating stock causing foreign key constraint fail

texts:
So, I'm trying to update product quantities programmatically. On a standard magento install, it works flawlessly, but on the actual magento shop I'm developing it for, it fails with a SQLSTATE[23000]: Integrity constraint violation.
It happens when I save the alterations I made on the product. The relevant bit of code,
// Check if the product exists
$id = Mage::getModel('catalog/product')->getIdBySku($sku);
if ($id) {
    $product = Mage::getModel('catalog/product')->load($sku, 'sku');
    $stockItem = $product->getStockItem();
    $totalStock = $stockItem->getData('qty') + $qty;

    $stockItem->setData('qty', $totalStock)
              ->setData('is_in_stock', $totalStock > 0 ? 1 : 0);
    try {
      $stockItem->save();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}

which returns the exception,
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a
child row: a foreign key constraint fails
(`staging_shop`.`cataloginventory_stock_item`, CONSTRAINT
`FK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`)
REFERENCES `catalog_product_entity` (`entity_id`) O)

I'm a bit at a loss here, and googling hasn't really helped at all. Might this be some extension or something that is messing with me, or is the database corrupt? Any help, even the smallest, is appreciated!
UPDATE: Solution below
Thanks to @boomer, I managed to get it working. Just for future reference (and fellow googlers), the following code is what works (at least with magento 1.8.x),
// Check if the product exists
if (Mage::getModel('catalog/product')->getIdBySku($sku)) {
    // Load the product stock object
    $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct(
        Mage::getModel('catalog/product')->loadByAttribute('sku', $sku)
    );
    // Add to the existing quantity of the product
    $stockItem->addQty($qty)->save();
}


texts: Magento 2: CSS is not loading only in admin menu

texts:
I am having some strange issues. Css is not loading only for the menu in admin side. Apart from that, everything is working fine.
All js and css are unmerged

Page source

I've tried these commands

rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/*
php bin/magento setup:static-content:deploy -f
chmod -R 777 var/ pub/ generated/


texts: Magento 1: when is the email added to the quote?

texts:
I noticed something interesting today.

I was working on a module that deals with the sales_flat_quote table.

I'm using this table to notify abandoned carts.

However, one of the email in this table does not match any customer nor is present in any order.

I never deleted any order nor customer so I'm wondering at which point the email is added to the sales_flat_quote and how can I reproduce this behavior ?


texts: Magento 2.4.2 Customer Login Not Working

texts: When a customer tries to login to the front end website, they enter their user name and password and then when they click to login, it appears to be successful but they were not logged in. This is a fairly recent issue and I'm not sure what caused it. One possibility is that it's related to an update to my theme.


texts: I am using magento 1.9.3 version. I  tried to develop the custom widget for displayed the simple text content. I tried various development Tutorials to completes that processes. But end of that process created widget name doesn't shown on CMS->Widget->New Widget options. So please recommend so tutorial for this development.  And also there is any rules for "every widget related extensions are placed on app->code->Community file. Please give the suitable solution for this problem


texts:
I want to make 2 url for same subcategory to point on same think example:
/cat1/cat2/cat3 - this on is made when i add category
/cat1/cat3 - i want to make this one as well. At the moment it's returing 404 page

I add cat3 in subcategory cat2. At the moment link to cat3 is cat1/cat2/cat3. I just want to remove cat2 from link or create new link cat1/cat3 who will show same think as cat1/cat2/cat3. Right now cat1/cat3 returns 404.


texts: Magento 2.x default setup with custom extension

texts:
I have custom extension in my magento2.x, and i have start installation and its working but at some point installation is stop for an hour or may be more.

When i install with default setup before adding custom extension its working fine.

but when i install magento2.x with including custom extension then it not working.

Why we can not install with custom extension?


texts: magento , the qty of products goes into minus on backorder

texts:
I'm trying to put qty to 0 if qty < 0, but it's not working for me
i all time have qty on minus

my code don't working for me

public function salesOrderSaveAfter($event)
    {
 $order = $event->getOrder();
            $orderIncrementId = $order->getIncrementId();

            foreach ($order->getAllVisibleItems() as $item) {
                $oldQty = (int)$item->getProduct()->getStockItem()->getQty();
                $qtyOrdered = (int)$item->getQtyOrdered();

                $differenceQty = $oldQty - $qtyOrdered;
            }

            //increase the price by 25% AND check for fires twice
            if ($differenceQty < 0) {
                $product_model = Mage::getModel('catalog/product')->load($item->getProductId());
                $price = $product_model->getPrice();
                $newPrice = $price + (($price * 25) / 100);
                $product_model->setPrice($newPrice);
                if ($product_model->getStockItem()->getBackorders() == "2") {
                    $product_model->setStockData(array(
                            'use_config_manage_stock' => 1,
                            'manage_stock' => 1,
                            'is_in_stock' => 1,
                            //'qty' => 0 don't working too
                        )
                    );
                    $product_model->setQty(0);
                }

                $product_model->save();
            }
}

I need when the quantity is less 0, for example -3, set quantity to 0


texts: M1: Magento 1 backup wants to run install / throws error. How to fix backup?

texts:
I tried to move an existing Magento 1 instance to our development server.

Moved .zip to FTP
Extracted files on FTP
Imported database (SQL)
Changed DB credentials in app/etc/local.xml
Changed Base URL's in database
etc...

--> I used this site as a reference. <--

But when I visit the site through the web browser Magento tries to reinstall and throws an error:

  Error in file:
  "/public_html/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php"
  - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'core_resource' already exists, query was: CREATE TABLE
  core_resource

I expected to see the backed up website. How can I make sure the install doesn't run and the website displays without Magento trying to re-create every DB?


texts: Magento 2 CE for official site vs Magento 2 CE from github

texts:
Is there a difference between Magento 2 CE from official site and Magento 2 CE from github

Because I could not find many folders and files, and the file and folder structure is different.
What is better for beginners?
I want to customize the blank theme, but when I follow the tutorial many folders and files are missing form Magento 2.0 from the official site


texts: Magento 2.3 prefix admin not displayed as dropdown

texts:
We use the default customer Show Prefix method. This works fine on the frontend.
But in the admin panel, the prefix in the customer is displayed as a input open text field, not as a dropdown with the options displayed.
For some reason the prefix in the admin panel is not displayed well.
How can we solve this?


texts: How to retrieve Custom Category Attribute (Magento2 )

texts: I have created a custom category attribute .The attribute is  showing in category section and the data is saved in database .I want to retrieve the value of the category attribute i need it in menu. (Magento 2).


texts: class magento\framework\serialize\serializer\json does not exist

texts:
I am trying to update my CleverSoft theme and I receive this in command line when I run this:

php bin/magento setup:di:compile


texts: How to add 2% extra in total when some one select amazon payment as payment method!

texts:
I have installed CS extension for Amazon payment, but I want to add a surcharge when someone selects this method.

I have tried few scripts but it does not work, installed few extension but it does not seem to work either.

any idea how to apply this extra 2% only when someone selects this method? (not other methods)


texts: Permissions not being picked up by setup wizard

texts:
In reference to this guide:

  http://devdocs.magento.com/guides/v2.1/install-gde/prereq/file-system-perms.html

I have followed the guide to install Magento2 into a RHEL 7.2 server word-for-word, however, have not managed to get past the permissions check within the setup wizard.

As per the screenshot below, the permissions as far as I can see, are set correctly and the directories are writable by the Apache user, however, the check just fails.

I have run a further test by temporarily changing the permissions on one folder to 777, however, this also has no effect and still shows up as failed, so I can't help thinking there's something I've missed. I've spent 2-3 hours on this already so have finally given up.

Please see the below screenshot as a reference to my setup:


texts: Change the Default Value of Is_active for customer in Magento 2

texts:
I am using Magento 2.1.0, and when any customer register , by default is_active value is 1. even there is no way to change it manually from admin panel.

 )->addColumn(
        'is_active',
        \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
        null,
        ['unsigned' => true, 'nullable' => false, 'default' => '1'],
        'Is Active'

This the is the quary is used in default customer module.

My question is , how will i enable in admin panel in customer form and in customer grid for manual change, and put the default value is 0.


texts: Is it possible to change category names or create new category if category is available programmatically magento 2?

texts:
Actually i am trying to change category names with a bunch of data(csv data) or create a new category
  if the category is not available programmatically Magento 2


texts: Magento 2: How to add cart summary after Update shopping cart button?

texts:
how can i get cart summary button after "update shopping cart" button ??

This is mobile view, don't worry about desktop view.


texts: Group product import csv issue in magento 2.2.6

texts:
I am using magento 2.2.6

I am importing group product with associate product via csv (added all product in db)

but issue is simple product string sku not assigning in to group product
(simple product with numeric sku is working but not working string sku)

can you please guide me what i do for that