texts: Magento - language of some parts of admin section seems to be changed?

texts:
I have also posted on Stackoverflow but didn't get any help as this is bit odd and tricky..

I am having little problem but not so serious yet weird. And I'm checking with my hosting company if there's any security breach was made.

Some parts in admin page, like date on the top section, and options in some places, have what appears to be Filipino language.

Been setup for English user and nobody changed language setting ever since, and I may have some idea if the entire language was changed but not this?

Look at the date, it's obviously not an English.

And this is the "Locale Options" - "General" in the Admin

Time zone is set to Australia, but in these drop down and selectable option show different language.

I have mirroring site for test extension and stuff and it shows all English.

I have checked header.phtml in page-template-default-default-adminhtml-design-app and doesn't seem to be edited or nothing indicate about language.

I also checked every places in admin section but I didn't think anything in the backend can allow us to do this weird change.

Wonder if anyone has encountered the same problem before and know how to resolve this?

Any help would be very appreciated. Thanks in advance.


texts: Import currency rate does not work on Magento 2

texts:
I'm setting up a website with multiple currencies.

When I tried to import currency rate from the back-end,

  back-end -> Store -> Currency Rate

It didn't work as I expected.

All the service can't return the rate.

I searched this issue on the internet and found out this is the Magento issue.
Does anyone have any ideal to fix it?


texts: no image on home page of magento sample data

texts:
I managed to install magento with sample data with "all set" message, when i tried to open the sample data on localhost it does not display images on home page only

Please find http://postimg.org/image/tr3k0rpjl/ (image here)

On rest of the pages, images are coming correctly..

Any kind of attention to this question will be highly appreciable.

Thankyou


texts: How to get discount details by coupon code in magento 2 programatily

texts:
I need to get the details of an already created discount rule in magento 2.

I am using this code but don't work

public function __construct(
    \Magento\SalesRule\Model\Coupon $coupon
)
{
    $this->coupon = $coupon;
    parent::__construct($context);
}

...

public function getDiscount($couponCode)
{
    $ruleId =   $this->coupon->loadByCode($couponCode)->getRuleId();
    return $ruleId;

}


texts:
I have created a custom controller/action (cart/update_cart). Although some clients are making concurrent requests to the API.

I would like to know if Magento has any way of preventing requests from being executed concurrently ? And force them to execute in a queue.

Or would there be any other suggestion to have them run in a queue ?


texts: Filter Product Collection By Another Attribute In Product Collection eg 'attribX', array('gt' => 'attrib-Y')

texts:
When using product collections like so:

$_productCollection= Mage::getModel('catalog/product')->getCollection()
                    ->addAttributeToSelect('*')
                    ->addAttributeToFilter('special_price', array('neq'=>''));

Is it possible to use addAttributeToFilter on an attribute relative to another attribute? e.g. Can I filter special_price greater than price with something like

$_productCollection= Mage::getModel('catalog/product')->getCollection()
                    ->addAttributeToSelect('*')
                    ->addAttributeToFilter('special_price', array('gt'=>'price'));


texts: Table rate (Weight vs Destionation with a message if weight above 5 kg)

texts:
i have tried to show some message like contact the provider if the weight greater then 5 kg using the table rate in magento.

If i give the message in excel it's not uploading

Anyone help me with it


texts: Magento 1: admin product grid column value disappear on name search

texts:
I'm facing an interesting problem regarding a custom modification to the backend Catalog Product grid.

NB: I'm currently using a module adding columns to this grid via an observer.

Nevertheless, the problem is also happening if I create a copy of app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php under app/code/local.

Here are the modifications I have made, I've changed the attribute I'm using with the native tax_class_id attribute so anyone can replicate the issue:

Modified the _prepareCollection method:

Before:

$collection = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToSelect('sku')
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('attribute_set_id')
            ->addAttributeToSelect('type_id');

After:

$collection = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToSelect('sku')
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('attribute_set_id')
            ->addAttributeToSelect('tax_class_id')
            ->addAttributeToSelect('type_id');

Modified the _prepareColumns method by adding:

// Get the attribute corresponding to my custom attribute
$attribute = Mage::getResourceModel('eav/entity_attribute_collection')
        ->setCodeFilter("tax_class_id")
        ->getFirstItem();

// Get the attribute options
$attrOptions = $attribute->getSource()->getAllOptions(false);

// Convert the options to an array that can be used as the 'options' parameter for the addColumn method
$optionsArr = array();
foreach ($attrOptions as $option)
{
    $optionsArr[$option['value']] = $option['label'];
}

$this->addColumn('tax_class_id',
    array(
        'header'=> Mage::helper('catalog')->__('Tax'),
        'width' => '60px',
        'index' => 'tax_class_id',
        'type'  => 'options',
        'filter_index' => 'tax_class_id',
        'options' => $optionsArr
));

That works perfectly fine in the following cases:

Access Catalog > Product grid
Filter by product type, attribute set, sku, price, quantity, visibility, status as well as the new custom column.
Sort by product type, attribute set, sku, price, quantity, visibility, status as well as the new custom column.
Browse via pager
Change page size

However as soon as I start dealing with the name column, every cell of my custom column become empty/the product value is not displayed anymore, so when I:

Filter by name
Sort by name

How is that specific name column affecting my current custom column and how can I fix the issue ?


texts:
I want to display static block in html login popup during checkout, but there is a problem.

This is the html template which is called from js, this js is called from phtml, and this phtml template called from xml
 layout.
( xml -> phtml -> js -> html)

So the question is how to send custom content block from the phtml or xml throught js to html template

  vendor/magento/module-catalog/view/frontend/layout/default.xml

This file is calling pthml template with

 <block class="Magento\Customer\Block\Account\AuthenticationPopup" name="authentication-popup" as="authentication-popup" template="Magento_Customer::account/authentication-popup.phtml">

  vendor/magento/module-customer/view/frontend/templates/account/authentication-popup.phtml

This file is calling js layout with code:

     <script type="text/x-magento-init">
        {
            "#authenticationPopup": {
                "Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
            }
        }
    </script>

  vendor/magento/module-customer/view/frontend/web/js/view/authentication-popup.js

this file is called the last html template where should be a static block from admin panel, with code:

    define([
    'jquery',
    'ko',
    // ......... //
], function ($, ko, /* ... ... ... .... ... */) {
    'use strict';

    return Component.extend({
        registerUrl: window.authenticationPopup.customerRegisterUrl,
        forgotPasswordUrl: window.authenticationPopup.customerForgotPasswordUrl,
        autocomplete: window.authenticationPopup.autocomplete,
        modalWindow: null,
        isLoading: ko.observable(false),

        defaults: {
            template: 'Magento_Customer/authentication-popup'
        },
    });
});

this is how i get this block in php

<?php echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('reset_password_notice')->toHtml(); ?>

  I tried to paste it to phtml, it doesn't work !!!


texts:
I have multiple products that have many different custom options for the customer to choose from.  One of these products must have a different custom option naming implementation than the rest of them (one that doesn't correspond to the naming in the backend).  Therefore, I have created an attribute that only this product possesses.

I plan to check the products with custom options for this attribute.  If this attribute is found I plan to have alternate naming functionality.

However, I can't seem to find where exactly custom option dropdown names are generated.


texts:
I had to create a static menu link in menu.html. which is linked to a static pages content (with # tag
Shop
).

when I click on that menu, it goes to that content. (URL changes to-- www.domain.com/#sc) then, when I click on another menu, it goes to that. but, when I again want to go back to  that (# tagged) menu, it doesnt go (URL changes to-- www.domain.com/contacts#sc).

I think, the static menu link should be in php code. but, I cant write
the code. any one please will me writing the code?


texts: Magento change quote currency programmatically

texts:
I am sending my magento store data to mobile application through soap request.
I am having issue with multi currency.  To mange the multi currency  in android manging conversion through javascript.

My store support GBP ,  USD and Euro. Base currency is USD. Now when i switch currency to GBP in mobile it will convert the price correctly and send response to magento with my currency code and quote id for cart.

in request i am getting Quote Id and Currency code.

How can i set the GBP  instead of the USD in quote?

i did try to set the currency  using following code BUT it gets overwritten to USD not processing with GBP.

   $code=isset($_REQUEST['code'])?$_REQUEST['code']:'GBP';

   $write_connection = Mage::getSingleton('core/resource')->getConnection('core_write');

   $fields_arr = array();

   $fields_arr['quote_currency_code'] = $code;

   $where = $write_connection ->quoteInto('entity_id =?', $shoppingcartid);
  $write_connection->update('sales_flat_quote', $fields_arr, $where);

Above code will set quote_currency_code currency in db for that quote id.

Need help to set the currency for quote programmatically.


texts: how to deploy magento pwa studio in Cloud

texts:
I want to know how to deploy Magento PWA studio in Cloud

  what are technologies required to deploy the Magento PWA studio

  aws and digital ocean - both

  and what about firebase and aws amplify


texts: magento2 product import error : Call to a member function getData() on nul

texts:
I tried implement import by Msquare answer from here  import custom csv to custom table- magento 2

But I getting this error:

Fatal error: Uncaught Error: Call to a member function getData() on null in (...) app/code/PetTheme/Module/Block/Adminhtml/Dataimport/Edit/Form.php:82 Stack trace: #0

this is this line:

$form->setValues($model->getData());

Any ideas what was wrong?

Thanks!


texts: join table product and product option in external script

texts:
i'm trying to join the products and product_option table by using this script

<?php

ini_set('memory_limit',"1000M");
ini_set('display_errors', '1');
set_time_limit(0);
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';

Mage::app();

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

    $_productCollection->getSelect()->join(array('mep' => "catalog_product_option"), "e.entity_id = mep.product_id", array('mep.*'));

    echo count($_productCollection);

?>

but it got errors:

Fatal error: Uncaught exception 'Exception' with message 'Item (Mage_Catalog_Model_Product) with the same id "29" already exist' in /home/m1/public_html/lib/Varien/Data/Collection.php:373 Stack trace: #0 /home/m1/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(265): Varien_Data_Collection->addItem(Object(Mage_Catalog_Model_Product)) #1 /home/m1/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1055): Mage_Eav_Model_Entity_Collection_Abstract->addItem(Object(Mage_Catalog_Model_Product)) #2 /home/m1/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(871): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false) #3 /home/m1/public_html/lib/Varien/Data/Collection.php(752): Mage_Eav_Model_Entity_Collection_Abstract->load() #4 [internal function]: Varien_Data_Collection->count() #5 /home/m1/public_html/product_options.php(24): count(Object(Mage_Catalog_Model_Resource_Product_Collection)) #6 {main} thrown in /home/m1/public_html/lib/Varien/Data/Collection.php on line 373

anyone knows what's the problem?


texts: Magento 2 : How to change the cross sell text in product Edit page

texts:
i have overwritten the Related.php file but nothing happen
app/code/Vendor/Module/etc/di.xml

<preference for="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related" type="Vendor\Module\Ui\DataProvider\Product\Form\Modifier\Related" />

app/code/Vendor/Module/Ui/DataProvider/Product/Form/Modifier/Related.php
namespace Vendor\Module\Ui\DataProvider\Product\Form\Modifier;

class Related extends \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related
    {

     public function modifyMeta(array $meta)
     {
       echo "test"; die;
     }
  }
?>

Please help  this issue.


texts: Hide toggle link for logout in header magento2

texts:
Once logged in customer name will be shown with arrow beside it.

After clicking arrow a logout link appears.

My requirement is to remove that click action.

Directly can we show Logout link in header when customer is logged in?

Can anybody help me on this.

Thanks


texts: Magento 2 - Can't Change Page Layout Columns With An Override Layout File

texts:
I am able to change the layout columns if I extend a page's layout file, but it won't work if I use an override layout file. What do you have to do to change a page's layout columns with an override?

The code that works with a layout extension, eg., in \app\design\frontend\MyVendor\Theme\Magento_Catalog\layout\catalog_product_view.xml is:

<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
</page>

But then if I add the layout="2columns-left part to an override file at \app\design\frontend\MyVendor\Theme\Magento_Catalog\layout\override\base\catalog_product_view.xml then the layout columns don't change. Is that not possible?


texts: How to get customer group id by giving customer group name in magento 2

texts:
I need some functionality based on the response given by ERP.
I need to get the customer group id by using the customer group code?
How do I get customer group id by group name ?


texts: Magento 2: Newsletter Queue Take Different Queue Start Time

texts:
I'm using Magento 2 CE Version 2.1.2

My locale is Asia/Singapore. When i queue my newsletter, it's taking different start time (or timezone).

If i put now, then also it's taking 8+ hours & in database cron_schedule table it also saves same time.

Everytime i need to run

php bin/magento cron:run

every time Or just once? Because both are dependent i think.

It always take UTC timezone although it set as Asia/Singapore

https://github.com/magento/magento2/issues/7560

How to solve in general timezone issue, so it will work as per set on Admin Locale Timezone.


texts: Magento 2.3 - Login Authentication not working for validating customer email and password

texts:
Hi I have created Rest API for customer login with custom module for my Magento 2.3 store.

I am entering parameters email and password for customer login. But it throws InvalidEmailOrPasswordException while firing api request.

Below is my code:

<?php
use Magento\Customer\Api\AccountManagementInterface;

class CustomerManagement
{

    /**
     * @var Magento\Customer\Api\AccountManagementInterface
     */
    protected $accountManagementInterface;
    protected $customer;
    protected $_customerSession;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        AccountManagementInterface $accountManagementInterface,
        \Magento\Customer\Model\Customer $customer,
        \Magento\Customer\Model\Session $customerSession
    ) {

        $this->objectManager = $context->getObjectManager();
        $this->resultPageFactory = $resultPageFactory;
        $this->accountManagementInterface = $accountManagementInterface;
        $this->customer = $customer;
        $this->_customerSession = $customerSession;
        parent::__construct($context);
    }

public function getLogin()
{
    $email = $this->request->getParam('email');
    $password = $this->request->getParam('password');

    try {
        /* @var $customer \Magento\Customer\Api\Data\CustomerInterface */
        $customer = $this->accountManagementInterface->authenticate($email, $password);
        $websiteId = $customer->getWebsiteId();

        /* @var $_customer \Magento\Customer\Model\Customer */
        $_customer = $this->customer->setWebsiteId($websiteId);

        $this->_customerSession->setCustomerAsLoggedIn($_customer->loadByEmail($email));

    } catch(\Magento\Framework\Exception\InvalidEmailOrPasswordException $ex) {
        $errorData[0]['code'] = 7;
        $errorData[0]['message'] = 'Invalid Params!';
        $errorData[0]['exception'] = $ex;
        return $errorData;
    }
    .....
}

Here my code throws catch exception even if I use valid email and password for customer login API.


texts: Magento 2 : How to Create Custom Header and Footer

texts:
I am creating new header.phtml and footer.phtml and store into app/design/frontend/<vendor_theme>/mytheme_name/theme_layout/template/html.

so how to add new header and footer in magento/blank theme.


texts:
I have started working on Magento 2.1.2 and require to update few modules and files but I am not able to update .phtml files.

I have create theme with the name of theme and doing all by in theme folder:

vendor-name : Abc  (NameSpace)
theme-name : developer (theme_name)

ie: I tried with another .phtml override. Here its:

Copy from /vendor/magento/module-wishlist/view/frontend/templates/link.phtml to /app/design/frontend/Abc/developer/module-wishlist/view/frontend/templates/link.phtml (there is no other file in module-wishlist directory in my theme)
php bin/magento setup:static-content:deploy
php bin/magento cache:flush
Also manually deleted cache from PUB(except .htaccess) and VAR/view_preprocessed

But in debug mode this .phtml file still diplaying from /vendor/magento/module-wishlist/view/frontend/templates/link.phtml

It may be duplicate for few question but i didnt get my answer by following below links:

Override Magento 2 phtml Files?
Magento 2 Override minicart.phtml template? (My Comments are here)
http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-inherit.html
How to override .phtml files in Magento 2
Override PHTML files in Magento 2.1.0

It should be very simple to override .phtml files, modules as well but I am not able to do this. It may be issue of Magento version 2.1.2? I apologies again if it's duplicate but I left with no option. I must be missing something very important.


texts: 1.9.3. At checkout, when client clicks on 'Place Order', (Sorry, no quotes are available for this order at this time.) and it reloads the page

texts:
magento 1.9.3 using DHL Getting this Error

  Sorry, no quotes are available for this order at this time.

checkout/onepage/

How to resolve this ?


texts: Cannot upgrade from 2.2.6 to 2.3 via composer

texts:
I have a clean Magento 2.2.6 with sample data that I installed using composer.

I am trying to update it to Magento 2.3 so following the steps outlined here by the Magento team.

After running composer update I get the following:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - magento/module-wishlist-sample-data 100.2.0 requires magento/module-wishlist 101.0.* -> satisfiable by magento/module-wishlist[101.0.4, 101.0.0, 101.0.1, 101.0.2, 101.0.3, 101.0.5].
    - magento/module-wishlist-sample-data 100.2.0 requires magento/module-wishlist 101.0.* -> satisfiable by magento/module-wishlist[101.0.4, 101.0.0, 101.0.1, 101.0.2, 101.0.3, 101.0.5].
    - Can only install one of: magento/module-wishlist[101.1.0, 101.0.4].
    - Can only install one of: magento/module-wishlist[101.1.0, 101.0.0].
    - Can only install one of: magento/module-wishlist[101.1.0, 101.0.1].
    - Can only install one of: magento/module-wishlist[101.1.0, 101.0.2].
    - Can only install one of: magento/module-wishlist[101.1.0, 101.0.3].
    - Can only install one of: magento/module-wishlist[101.1.0, 101.0.4].
    - Can only install one of: magento/module-wishlist[101.1.0, 101.0.5].
    - magento/product-community-edition 2.3.0 requires magento/module-wishlist 101.1.0 -> satisfiable by magento/module-wishlist[101.1.0].
    - Installation request for magento/product-community-edition 2.3.0 -> satisfiable by magento/product-community-edition[2.3.0].
    - Installation request for magento/module-wishlist-sample-data 100.2.* -> satisfiable by magento/module-wishlist-sample-data[100.2.0].


texts: Magento 2 Add css class to  tag in customer account navigation

texts:
I try to assign a CSS class to navigation ( tag) under customer account page.

I found this file customer_account.xml, and I added                                 <argument name="css_class" xsi:type="string">sidebar-navigation__item-link</argument>
 to the block, as following

                    <block class="Magento\Customer\Block\Account\SortLinkInterface"
                           name="customer-account-navigation-address-link">
                        <arguments>
                            <argument name="css_class" xsi:type="string">sidebar-navigation__item-link</argument>
                            <argument name="label" xsi:type="string" translate="true">Address Book</argument>
                            <argument name="path" xsi:type="string">customer/addresss</argument>
                            <argument name="sortOrder" xsi:type="number">190</argument>
                        </arguments>
                    </block>

But this doesn't give any effect on the frontpage. I have cleared the cache.

Did I miss anything?


texts:
I have magento version 1.9.2.1, and I have greater than 30000 products in my store. My magento databse size raise to 3GB approximate.

For database optimization What I already did :

1) clean log tables

2) follow https://magento.stackexchange.com/a/18690/14039

But still database size is 2.7 GB.

When I checked products tables, these have multiple entry for one product corresponding to store and customer group.
For Example : I have 4 store and 6 customer groups then there are total 24 rows for one product in table catalog_product_index_price.

Is there any way to set global scope for all customer groups so that there will be only 4 rows in catalog_product_index_price tables?

Or any other way to optimize products tables like catalog_product_index_price, catalog_product_entity_varchar, catalog_category_product_index, catalog_product_index_eav_idx, catalog_product_index_eav, catalog_product_index_price_idx, catalog_product_entity_text etc.?


texts: Magento 2 : How to Disable/Enable Custom Shipping Method Based on selected index of address

texts:
I want to show/hide custom shipping method like "My custom shipp" radio button if customer selects the first address.
If Customer insert/selects the second address on shipping page  "My custom shipp" will be disabled/hidden.

I have my custom module and there i have  the  code :

    public class MyShippp extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements
        \Magento\Shipping\Model\Carrier\CarrierInterface
    {

//heres  the  constructor injection  etc

        /**
         * @param RateRequest $request
         * @return \Magento\Shipping\Model\Rate\Result|bool
         */
        public function collectRates(RateRequest $request)
        {

// here  i have to put some code  to
// verify which is the  index  of selected shipping  address.
// if  i select the  first address  i do something.
//else  i do something else;

            /** @var \Magento\Shipping\Model\Rate\Result $result */
            $result = $this->_rateResultFactory->create();
            $shippingPrice = $this->getConfigData('price');
            $method = $this->_rateMethodFactory->create();
            $method->setCarrier($this->_code);
            $method->setCarrierTitle($this->getConfigData('title'));
            $method->setMethod($this->_code);
            $method->setMethodTitle($this->getConfigData('name'));
            $method->setPrice(0);
            $method->setCost(0);
            $result->append($method);

            return $result;
        }

    }

How can i identify which is the index of selected address in this controller?


texts: Magento 2 How to add custom attribute to Quote Item Rest API

texts:
I want to add custom attribute to >http://{{magento2}}/rest/V1/carts/mine/totals

API response.

I have done follwing way but it not working.

>extension_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Quote\Api\Data\CartItemInterface">
        <attribute code="product_option" type="float" />
    </extension_attributes>
</config>

>di.xml

<type name="Magento\Quote\Model\Quote\Item">
    <plugin name="cs_product_opt" type="Namespace\Product\Plugin\Model\Cart\CartTotalRepositoryPlugin" />
</type>

>Plugin file

<?php
/**
* Copyright 2016 aheadWorks. All rights reserved.
* See LICENSE.txt for license details.
*/

namespace Namespace\Product\Plugin\Model\Cart;

use Magento\Quote\Api\Data\TotalsExtensionInterface;
use Magento\Quote\Api\Data\TotalsExtensionFactory;
use Magento\Quote\Api\Data\CartItemExtensionFactory;
use Magento\Quote\Api\Data\TotalsInterface;
use Magento\Quote\Api\CartRepositoryInterface;
use Magento\Quote\Model\Cart\CartTotalRepository as TotalRepository;
use Magento\Quote\Model\Quote;

/**
 * Class Aheadworks\StoreCredit\Plugin\Model\Cart\CartTotalRepositoryPlugin
 */
class CartTotalRepositoryPlugin
{
    /**
     * @var CartRepositoryInterface
     */
    private $quoteRepository;

    /**
     * @var CartItemExtensionFactory
     */
    private $totalsExtensionFactory;

    /**
     * @param CartRepositoryInterface $quoteRepository
     * @param CartItemExtensionFactory $totalsExtensionFactory
     */
    public function __construct(
        CartRepositoryInterface $quoteRepository,
        CartItemExtensionFactory $totalsExtensionFactory
    ) {
        $this->quoteRepository = $quoteRepository;
        $this->totalsExtensionFactory = $totalsExtensionFactory;
    }

    /**
     * Apply extension attributes to totals
     *
     * @param TotalRepository $subject
     * @param \Closure $proceed
     * @param int $cartId
     * @return TotalsInterface
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function aroundGet(TotalRepository $subject, \Closure $proceed, $cartId)
    {
         /** @var TotalsInterface $totals */
        $totals = $proceed($cartId);

        /** @var \Magento\Quote\Api\Data\TotalsExtensionInterface $extensionAttributes */
        $extensionAttributes = $totals->getExtensionAttributes()
            ? $totals->getExtensionAttributes()
            : $this->totalsExtensionFactory->create();

        /** @var Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);

        $extensionAttributes->setProductOption(1.11);
        $totals->setExtensionAttributes($extensionAttributes);
        return $totals;
    }
}

anyone have idea how to add custom attribute to Quote Item Rest API.


texts: How can I add fields on the registration form?

texts:
I'm using Magento 2.1.9 and I don't know how to add new fields,
can you help me?

Thank you!


texts: Must update every page on Magento 2.2.2 before it shows correctly

texts:
I freshly installed Magento 2.2.2.

Before a page works, I have to load it once and then refresh it. This is the case for both the admin panel and CMS pages.

Does anyone know what could cause this?


texts: how to remove commas from search result in magento 2

texts: i want to remove the search result commas see the image when magento returns sprite it in the commas and i want to remove this commas. how to achieve this am not sure if it possible with custom module or custom theme please guide me


texts: Magento 2 observer for sales_order_place_after

texts:
I observe the event sales_order_place_after
If I buy like guest or new user custumer name, lastname is NULL if I buy logged name, lastname is normal

$observer->getOrder()->getCustomerFirstname();

I use Magento 2.1.11

How fix it ?


texts: trying to create attribute only for ONE type of product

texts:
I have one problem, my code generates in every type of product my new attribute, why?
code for sql-install:

<?php
/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;

// Add attribute
$allowedProductTypes = array(
    Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL
);

$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
    'group'             => 'General',
    'label'             => 'Terms of use',
    'apply_to'          => implode(',', $allowedProductTypes),
    'type'              => 'text',
    'sort_order'        => 4,
    'input'             => 'textarea',
    'default'           => '',
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'user_defined'      => true,
    'visible'           => true,
    'required'          => true,
    'wysiwyg_enabled'   => true,
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'unique'            => false,
    'is_configurable'   => false
));

i dont understand when i have wrong code for what i need.... how i can create the attribute for a only ONE single type of product in code? thanks


texts: Added block to whitelist, but blocks still not showing (6788)

texts:
I also have a problem with custom blocks on my home page CMS after 6788. The CMS page uses a slider, which is on the backwards incompatible list because of the old router config. I used supee-6788-toolbox:

I can see the custom block in the permission_block table.

| block_id | block_name           | is_allowed |
+----------+----------------------+------------+
|        1 | core/template        |          1 |
|        2 | catalog/product_new  |          1 |
|        3 | customslider/default |          1 |

The config.xml uses the

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <customslideradmin before="Mage_Adminhtml">Custom_Customslider_Adminhtml</customslideradmin>
                </modules>
            </args>
        </adminhtml>
    </routers>

Now the home page is blank. When I remove the custom slider the other blocks load ok. There is only one telltale sign for the blank screen, in var/log/exception.log

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax

SELECT `main_table`.* FROM `m_customslider_banner` AS `main_table`
LEFT JOIN `m_customslider_value` AS `status`
ON main_table.banner_id = status.banner_id
AND status.store_id = 2 AND status.attribute_code = 'status'
WHERE (`customslider_id` = '2')
AND (`IF(status`.`value IS NULL, main_table`.`status, status`.`value)` = '0')
AND (`start_time` <= '2015-10-28') AND (`end_time` >= '2015-10-28')

Is there another reason that the patch would have caused this?


texts: Magento 2 product list widget image on mouse over issues

texts:
I am using a LUMA based custom theme and I've added some sample product which do not belong to the magento 2 sample data.

I have created a few products and added these images which are 518px X 518px.

After that I have added a Product List widget to the homepage which shows these products.

My problem is have when I hover on the products the div expands and it's not smooth, it's all very jumpy.

Do these images need to be a specify height and width?


texts: is it possible to import csv in Magento 2 from ssh command?


texts: Removing apache@localhost from my email header?

texts:
I hope someone might have an idea on this.  I'm running a Magento website on an Amazon Linux server (basically CentOS) with an Apache webserver.  I also use Google Apps for managing mydomain.com's mail.

I was able to successfully set up the MX, SPF and DKIM records for the server and got them working, so that I receive a "Pass" for both SPF and DKIM when I send emails.  However, I've run into a strange problem I can't seem to get past --- part of the headers for the emails I send always says:

Received: (from apache@localhost) by mydomain.com

I've searched high and low for a way to change this to use "mail@mydomain.com" instead, but I just can't seem to figure it out.

Among things I've tried:

Changing the php.ini to say: /usr/sbin/sendmail -t -i -f mail@mydomain.com
Adding to mydomain.conf's virtualhost the line: ServerAdmin mail@mydomain.com
Setting the Return-Path to "Yes" in the Magento backend (System -> Configuration -> Advanced -> System -> Mail Sending Settings.

I'm not sure if there's anything else that might be affecting the mail sends.  If anyone has an idea it would be much appreciated, thank you!

Edit: The contents of my /etc/hosts file are as follows:

127.0.0.1   www.mydomain.com
127.0.0.1   mydomain.com
127.0.0.1   localhost localhost.localdomain

Edit 2:  I thought it might help if I added the headers of the email, in case that might give some clues to what might be going on (I've changed a lot of values to keep it generalized).

Delivered-To: zerowing@email.com
Received: by 123.123.123.123 with SMTP id abcdefg123456790;
        Fri, 3 Apr 2015 08:35:04 -0700 (PDT)
X-Received: by 456.456.456.456 with SMTP id asdfqwerhjkl234hjkl.789.78909876789;
        Fri, 03 Apr 2015 08:35:03 -0700 (PDT)
Return-Path: <mail@mydomain.com>
Received: from mydomain.com (ec2-11-11-111-11.amazonaws.com. [66.66.777.77])
        by mx.google.com with ESMTPS id asdkfjhkjdfha839383.105.2015.04.03.08.35.02
        for <zerowing@email.com>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 03 Apr 2015 08:35:03 -0700 (PDT)
Received-SPF: pass (google.com: domain of mail@mydomain.com designates 66.66.777.77 as permitted sender) client-ip=66.66.777.77;
Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of mail@mydomain.com designates 66.66.777.77 as permitted sender) smtp.mail=mail@mydomain.com;
       dkim=pass header.i=@mydomain.com
Received: from mydomain.com (www.mydomain.com [127.0.0.1])
    by mydomain.com (8.14.4/8.14.4) with ESMTP id t33FZ29p004251
    for <zerowing@email.com>; Fri, 3 Apr 2015 15:35:02 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mydomain.com;
    s=default; t=fjIFDJF9049;
    bh=fjO4J4f09j409JF04J909f4j904JF940F9/Y=;
    h=To:Subject:From:Date;
    b=F4J90FJ490j09j490FJ094J0j94f90j409j490Jf90j904JF09j490fj904jf094J
     f09J40F9J904fj049J099j49J049J0FJijffjdlfjldkDLFJKLdjflEJFOIJFOEIEO
     JF9JF049j409j0F094J09FJ049jf049j=
Received: (from apache@localhost) <----------- THIS IS WHAT I'M TRYING TO CHANGE
    by mydomain.com (8.14.4/8.14.4/Submit) id fkdjfljlfsra39393;
    Fri, 3 Apr 2015 15:35:01 GMT
Message-Id: <201504031535.fkdjfljlfsra39393@mydomain.com>
To: =?utf-8?B?Sm9lIEdhcmNpYQ==?= <zerowing@email.com>
Subject: =?utf-8?B?VGVzdCBOZXdzbGV0dGVyLCBwbGVhc2UgaWdub3Jl?=
X-PHP-Originating-Script: 48:Sendmail.php
From: "mydomain.com" <mail@mydomain.com>
Date: Fri, 03 Apr 2015 15:35:01 +0000
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
MIME-Version: 1.0


texts:
I am working on Magento 2.4. I need some customisation in that I need to reset previous sorting and I need to set new 'Order By' column. I am using $collection->getSelect()->reset(Zend_Db_Select::ORDER); but it is not working and I am getting following error :

main.CRITICAL: Error: Class
'Vendor\Module\Plugin\Zend_Db_Select' not found in /app/code/Vendor/Module/Plugin/Layer.php:174

How to use reset sort column ? Any solution ?
UPDATE
I got the solution for above question and used the following
$result_main->getSelect()->reset(\Magento\Framework\DB\Select::ORDER);
$result_main->getSelect()->order(new \Zend_Db_Expr("FIELD(e.entity_id, " . implode(",", $id_order) . ")"));

But it is not sorting based on given ids.
I also print the query :

SELECT e.*, price_index.price, price_index.tax_class_id,
price_index.final_price, IF(price_index.tier_price IS NOT NULL,
LEAST(price_index.min_price, price_index.tier_price),
price_index.min_price) AS minimal_price, price_index.min_price,
price_index.max_price, price_index.tier_price FROM
catalog_product_entity AS e  INNER JOIN
catalog_product_index_price AS price_index ON
price_index.entity_id = e.entity_id AND price_index.customer_group_id
= 0 AND price_index.website_id = '1'  INNER JOIN catalog_product_website AS product_website ON
product_website.product_id = e.entity_id AND
product_website.website_id = 1 ORDER BY FIELD(e.entity_id, 2521, 10,
4444, 1286, 4396, 4397, 656, 4445, 4307, 3110, 1276, 9, 4446, 1280,
1611, 155, 286, 5319, 4395, 4392, 4399, 4401, 6424, 1445, 2967, 1281,
1278, 6188, 4398, 4389, 4393, 3167, 4944, 4571, 4388, 4390, 4391,
4394, 4950, 4945, 1529, 4400, 1526, 1525, 1523, 4948, 4947, 1527,
4306, 4943, 1709, 4372, 4447, 6189, 1444, 3539, 4566, 3534, 3538,
3535, 3536, 3537, 5507, 4402, 1524, 1123, 4760, 5777, 5384, 1792,
4512, 3374, 4552, 4882, 4538, 4885, 5775, 1578, 6567, 5332, 4368,
1561, 1559, 4522, 5968, 6377, 5776, 5778, 1577, 6379, 6466, 6384,
5965, 6381, 4508, 4570, 4886, 1793, 4507, 3375, 4521, 4506, 5782,
3540, 4880, 1446, 5785, 4540, 4884, 4539, 4883, 5784, 5783, 4547,
6398, 6200, 4879, 4881, 4548, 4546, 1809, 5779, 5780, 5786, 4467,
5781, 6136, 3508, 3507, 3844, 4858, 4857, 6382, 5034, 4437, 6378,
4473, 6383, 6380, 5616, 5619, 5620, 5621, 4468, 6572, 6394, 4365,
6479, 4370, 4303, 4511, 4935, 4574, 4517, 4524, 4525, 1565, 1566,
1567, 4373, 4513, 4510, 4369, 6140, 4509, 309, 3509, 4471, 4577, 4472,
3468, 3469, 4573, 4470, 4366, 1770, 3412, 4526, 4531, 6267, 6471,
4533, 4532, 4535, 4534, 6026, 4958, 4939, 4940, 4527, 4720, 4528,
4523, 5189, 6559, 1482, 1483, 6201, 6482, 6596, 4519, 1336, 6387,
6585, 4576, 4500, 1568, 4520, 4010, 4367, 4376, 4371, 1105, 4374,
4572, 3492, 1560, 1562, 6472, 6369, 5573, 4575, 198, 199, 200, 201,
1564, 4375, 5265, 6397, 1768, 6598, 4567, 6628, 1810, 1257, 1811,
4329, 4514, 4469, 4518, 1000, 3506, 4012, 1253, 1254, 1255, 1256,
1258, 1252, 1259, 1260, 1261, 1262, 1263, 1265, 1266, 1267, 1268,
1269, 1270, 1558, 6345)


texts: Customer order attribute not saving on one server

texts:
So, I have a checkout module which has a boolean custom order attribute which is defined like this (attribute name replaced):

<?php

$installer = Mage::getResourceModel('sales/setup', 'sales_setup');

$installer->startSetup();

$installer->addAttribute(
    'order',
    'success_accessed',
    array(
        'type' => 'boolean',
        'required' => 0,
        'comment' => "success view has been accessed"
    )
);

$installer->endSetup();

And in a controller (IndexController) it is handled as follows:

if ($order->getSuccessAccessed()) {
    $this->_redirect('checkout/cart');
    return;
} else {
    $order->setSuccessAccessed(true);
    $order->save();
}

Now, when testing this on two different dev servers and one other production server this works as intended. After the first time a user accesses the success view they get redirected to the cart if they attempt to access the success view again (the reason for why we need this logic is long-winded and involves peculiarities of the payment processing API that this checkout module is tied to so alternative solutions would most likely involve rewriting and restructuring not just our own code but also a 3rd party API, just sayin').

However, on this particular production server I'm dealing with right now the above code in the controller does absolutely nothing. The attribute value isn't set nor is updated_at on the order being changed.

There are no errors in any log files and putting log statements before and after every line (no xdebug on production servers) shows that execution is not halted anywhere and code that runs after these lines is also getting executed.

Does anyone have any clues what might be causing this one server to ignore the $order->save(); call?


texts: Change Welcome message for logged in user

texts:
I would like to have the same welcome message for all users which you type in at the backend Configuration > Design > Header.

The only difference should be that the logged in users should have their name out front.

For example: the not logged in users should see

  "Hello welcome to our store!"

and the ones who are logged in should see

  "Mr Brown. Hello welcome to our store!"

So I guess I have to change the code on the following file:
code > local > Mage > Page > Block > Html > Header.php

I tried the following but it didn't work:

/**
 * Retrieve page welcome message
 *
 * @deprecated after 1.7.0.2
 * @see Mage_Page_Block_Html_Welcome
 * @return mixed
 */
public function getWelcome()
{
    if (empty($this->_data['welcome'])) {
        if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
            $this->_data['welcome'] = Mage::getStoreConfig('design/header/welcome') & $this->__('%s!', $this->escapeHtml(Mage::getSingleton('customer/session')->getCustomer()->getName()));
        } else {
            $this->_data['welcome'] = Mage::getStoreConfig('design/header/welcome');
        }
    }

    return $this->_data['welcome'];
}

}

I'm not good at coding so it would be great if someone could help me on this.
Thanks.


texts: How to overwrite tier_price.phtml in Magento 2

texts:
I want to change something in file

  vendor/magento/module-catalog/view/frontend/templates/product/tier_prices.phtml

but I do not know where to save copy of file in my own theme?


texts: Magento 1: What is the Best way to apply Patch in version 1.9.0.1?

texts:
I am using Magento 1.9.0.1 and when I checked in magereport.com, It is showing that I need to apply below patches in my Magento.

Patches: SUPEE- 5994, SUPEE - 6285(XSS,RSS), SUPEE - 6482, SUPEE - 6788, SUPEE - 7405, SUPEE -8788.

When I applied these patches by downloading there files from command line then some of them are not applied and because of that some magento functionality stoped working.

Can anyone tell me what is the Best way to apply these patches in Magento 1.9.0.1 ?


texts: Product that affects a vehicles performance

texts:
I'll start off by stating the nature of the problem.

Background

My client has a pre-existing website that allows a user to select a vehicle from a number of drop down lists that tunnel down until they display a list of different types of a certain vehicle model.

i.e.

    Alfa Romeo (brand)
    |
    -> 145 (model)
        |
         -> 145 1.9 JTD 8V
         -> 145 1.9 JTD 12V (not real but an example)

Once the user has select a vehicle and the "sub variant" (for lack of a better word) of that vehicle they are directed to a page that displays a list of products that a compatible with it.

On top of this, the products that a shown that a compatible with it directly affect the vehicles performance and the gains in power and possible gains in MPG performance are displayed alongside a product.

Their existing website uses a very old system that isn't worth salvaging

The Problem

So in Magento I am not tasked with creating a near enough identical vehicle selector system that displays compatible products with that vehicle and how it affects the performance of that vehicle.

I have tried to use just categories but could see no way of showing the unique product to vehicle performance improvements, there are different products that affect a vehicle, simple idea is that the more expensive products do better than the others (no surprise there).

I have also looked in to create a custom module that adds a few database tables that hold information about Manufacturer, Model and Subvariant to be queried by a front-end block/widget but with one hurdle; that a new custom attribute would need to be created that could be easily edited similarly but not necessarily identically to how categories are managed (with the tree view that is very user friendly compared to a very long multi select).

Any advice or pointers would be greatly appreciated, I've started out with Magento with what I would have to say is a very hard project for a first timer with the system, I have spent a few weeks reading up and learning modules development.


texts: loop too many redirects when checkout in magento 1.9.3

texts:
I have a newly installed magento 1.9.3.2 on MacOS 10.11 server. Also installed a certificate to run the site via https.

Everything works fine except for when I go to the cart and click on checkout. The page won't load and displays an too many redirections error.
No plugins have been installed, yet. Please see picture for my settings

Can anyone help me get dis sorted, please?


texts:
How to update bulk price and quantity using rest api.
Can u give us process to update price and quantity using rest api.


texts: Difference between Enable category and include in menu

texts:
What is the exact difference between Enable Category and Include in Menu. As both do the same thing hiding the category/sub category from front end menu.

Only difference When I make "Enable category" off?


texts: Cannot read property 'click' of undefined In magento 2 phtml file

texts:
Script in  filename.phtml

      <script>
       require(['jquery', 'jquery/ui'], function($){

                //   $('.swatch-option')[0].css('color','red');
                  $('.swatch-option').get(0).click();
                  alert('123');

        });
</script>

Error in Console

  filename.html:1028 Uncaught TypeError: Cannot read property 'click' of
  undefined


texts: Disable future dates in magento datepicker

texts:
I am using magento datepicker. i have an array dates which i want to disable that days in the magento datepicked.

for example 08/29/14 is holiday. so i want to make the date as disable so the user cannot select that.

Many Thanks


texts: How to solve Magento 2.1.2 There has been an error processing your request error?

texts:
I just installed Magento 2.1.2 and after login into the admin I immediately got this error:

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 202497054639

I read on many forums how to solve it but I think most of them are for Magento 1 and not 2.

How can I solve this and what information do I need to post here?


texts: Adding product to cart cause error 'The stock item for Product is not valid.'?

texts:
I'm adding a nominal product programically to the shopping cart. But it throws an exception as 'The stock item for Product is not valid.'. How can I resolve this?

NOTE : $product is getting passed to this function correctly.

My code is as follows.

    /**
     * Add air product to the cart.
     */
    public function addSubscriptionToCart($product)
    {
        try {
            // Create cart instance.
            $cart = Mage::getModel('checkout/cart');

            // Initialize the cart.
            $cart->init();
            $cart->addProduct($product, array('product_id' => $product->getId(), 'qty' => 1)); // This line causes the error.
            $cart->save();

            return true;

        } catch(Exception $e) {
            Mage::log($e->getMessage());
            return false;
        }
    }


texts: Mage::getSingleton('catalog/product_action')->updateAttributes() does not update "updated_at"

texts:
I have the following code:

$storeId = 1;
$attributesData = array("price" => $data['price'], 'updated_at' => date('Y-m-d H:i:s'));
Mage::getSingleton('catalog/product_action')
    ->updateAttributes(array($data['product_id']), $attributesData, $storeId);

When I run this code, the price is updated but the updated_at column in catalog_product_entity is not (it does this regardless of update_at being in $attributesData).

I know I could just hammer in a quick little update query to update the date myself (and I will if I have to), but that is not the "Magento" way of doing things. I also do not want to load up the entire model just to save it. That would defeat the entire purpose of using what I call the "fast way" of updating products.

Any ideas?


texts: Warning: Cannot modify header information - headers already sent after Move Magento 2

texts:
I have created a copy of my Magento 2.2.4 in another domain to use as a development server. I have changed the env.php pointing to the new database, I have also modified the urls in the database but when entering the new domain it gives me this error.

  1 exception(s): Exception #0 (Exception): Warning: Cannot modify
  header information - headers already sent by (output started at
  /home/wwwdos9/public_html/vendetucasaenchina.com/app/bootstrap.php:1)
  in
  /home/wwwdos9/public_html/vendetucasaenchina.com/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php
  on line 148

Could you help me?


texts: Magento 2: When use Flat Catalog Product it gives SQL error

texts:
When I am changed setting for Flat Catalog Product to Yes, it gives SQL error in magento 2.

Stores >> Configuration >> Catalog >> Catalog

Is this known bug in magento 2.2.6?

I have done re-indexing after setting changed to Yes.

Please provide the guidance on this.

SQL Error as below:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'at_featured.value' in 'where clause', query was:

SELECT DISTINCT  COUNT(DISTINCT e.entity_id) FROM `catalog_product_flat_1` AS `e`
INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND
cat_index.visibility IN(2, 4) AND cat_index.category_id='2'
INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND
price_index.customer_group_id = 0 WHERE (((IFNULL(`at_featured`.`value`, 0) = '1') ))


texts: Magento 2.3.1 JSON.parse: unterminated string at line 2 column 1009

texts:
I am unable to set payment method in Magento 2.3.1.

As soon as I click on the payment method button all JavaScript functions are killed.

open error log nothing to show, but browser console point me to the  on line 51 to 60

Please see image below for further explanation:

My question is which file is generating the array in Core files. Or any idea of how to fix this.


texts: Do I need a separate Magento 1 Enterprise license for each IP address if I host multiple Magento websites on the same server?

texts:
My client requires to have two Magento websites that are completely separate. They need to be hosted on separate domains with separate IP addresses so that users cannot easily tell they are run by the same business. They also require some of the Magento Enterprise features.

Instead of configuring and hosting a separate web server and purchasing and additional Magento license we are considering assigning two IP addresses to the same server and using virtual hosts to the same Magento installation. We may need to copy some directories and use symlinks for others to completely separate things like the media folder. Does this kind of setup require an additional license?


texts: Magento2, Customized quote subtotal in cart page

texts:
Through observing the event checkout_cart_product_add_after, I was able to customize the price of the item in the cart, now I need to have an observer for customizing its subtotal calculation. What event/events need to be observed?

Is it possible to customize the calculation like $cart->setQuote()->getSubtotal() in observer and save the quote?

And basically, can it be done through observer or plugin is the solution?

Edit:

Here is my current event:

<event name="sales_quote_collect_totals_before">
        <observer name="customuitemprice" instance="vendor\code\Observer\BindUpdateItem"/>
    </event>

Observer:

class BindUpdateItem implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $quote = $observer->getQuote();
        foreach ($quote->getAllItems() as $item)
        {
            $product = $item->getProduct();
            ?How change the subtotal?

        }
        return $this;
    }
}


texts: Getting error " Type Error occurred when creating object "

texts:
When i edit in constructor file of my custom module it give me this error " Type Error occurred when creating object " i don't know what i am doing wrong i use same code for creating a Block and its working.
My Controller code is :
<?php
namespace Dealers\Validation\Controller\Valuation;

use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\App\Action\Context;

class Index extends \Magento\Framework\App\Action\Action
{
protected $_customerSession;

public function __construct(
    \Magento\Customer\Model\SessionFactory $customerSession,
    array $userdata = []
) {
    $this->_customerSession = $customerSession->create();
    parent::__construct($context, $userdata);
}

public function execute()
{
    /*if(!$this->_customerSession->isLoggedIn()) {
        $this->redirect->redirect($controller->getResponse(), 'customer/account/login');
    }*/
    $this->_view->loadLayout();
    $this->_view->renderLayout();
}
}

I want to redirect it to login page if user is not logged in.


texts: How to set a discounted price for a Downloadable product type?

texts:
Im new to Magento and I'm developing a large scale Mp3 music shop. I created an album with 13 songs(Mp3) as a downloadable product, each Mp3 costs $1 but I want the album to be $10 if the user buys the whole album. How may I achieve this?

Thanks


texts: How to add an extra custom validation and field while registration in magento 1.9

texts:
I would like to add a new custom validation and a custom field in the checkout process. When user registers he should be able to add his username along with other fields.

The validation for username is that it should be contain min 6 characters.

(In that is should have atleast 1 alphabet, 1 number & 1 special character) .

Thanks in advance


texts:
I realize my answer may be here but I thought I'd post the question just in case anyone knows. I have a very dense category structure and I want to avoid duplication. Ex:

Category A
 +-- Category C (unique)
 +-- Category D (contains 90 products)
Category B
 +-- Category E (unique)
 +-- Category F (same 90 products as D)

In this way I might have 10 more categories with the exact same content as D and F. How can I get categories D and F to originate from the same place in the admin panel? i.e. if I make a change to D, I want that change reflected in F too.


texts: Exporting products description (HTML) and short description (HTML)

texts:
I need to export these 2 products columns: description (HTML) and short description (HTML) to a CSV.

So far I've been using the dataflow profile system with a personal columns mapping but I cannot get those 2 columns (I'm using v1.9).

Please can anyone help me?

Thanks in advance.


texts: Some old customers can't log in with some browsers to customer account of magento 1.9.4

texts:
We have strange problem in our magento 1.9.4 web-site. Some customers cant log in to their customer account but most can. Seems that in some cases clearing browser cache helped but some customers said that it does not.

Most customer that had this problem used Chrome, but not all.

All customers that had this problem can log in to another browser they newer used to visit our site.

So seems like cache problem but it is very difficult to repair since we haven’t been able to reproduce it at our site. We have tested with macos / win / iphone / android and all the browsers without any problem.

Any idea how to solve this? We have cleared all magento caches many times and re-index etc. Seems not to help at all. Our cache settings:
Cookie Lifetime 86400
Cookie Path /
Cookie Domain .ourdomain.com
Use HTTP Only YES
Cookie Restriction Mode NO

Most strange thing is that we haven’t change anything before this problems started.

Many thanks!


texts: How to remove class `page-header` of tag `header` in Magento2?

texts:
How to remove name css page-header in tag header ?
How to remove tag
 or
in Magento 2?


texts: How to load JavaScript after Ajax has loaded?

texts:
I have a custom payment module and I am trying to show a message on the payment page using jQuery.  My JS file is being called on the shipping page but not when the user clicks on the next step and the payment page is loaded.   I am assuming that since it is already loaded it isn't looking for the div.  If I shift-refresh on the payment page my JS loads but I cannot target a div ID.  I am assuming because my JS runs before the page is loaded.

Here is my js:

define(
[
    'jquery'
],
  function($) {
    'use strict';

    $('document').ready(function(){
       if ( $('#payroll-form').attr('id') )  {
        alert("payment-form loaded");
       }
       alert("disabled loaded");
    });
});

The alert won't run in the if statement, but does outside of the if statement.  How can I get this to load on the payment step and target the div after it gets rendered?

UPDATE

I am using this code:

define(
[
    'jquery'
],
  function($) {
    'use strict';

    jQuery('document').ready(function(){
        jQuery("#shipping-method-buttons-container button").click(function() {
           if ( jQuery('#checkout-payment-method-load').length && !jQuery('#payroll-form').length)  {
            jQuery('#checkout-payment-method-load').prepend('
This is test message
');
           }
           alert("Clicked");
        });

        alert("new disabled");
    });
});

The alert "new disabled" loads on the shipping page.  The alert "Clicked" does not show on the payment page when clicking on the Next button.  Even if I remove the IF statement and leave in the alert "Click" does not show.  All the ID's listed above are on the page.  I can see the source file in the console.  For some reason, it still doesn't work.


texts:
I'd like to setup different domains like department1.domain.com, department2.domain.com, ecc. The store can share customers data, currency, billing settings etc, but should have different root categories. So, I think I can use one website and different stores, but I'm not sure about the URL configuration because it is at Store View level. In this case, have I to use different websites to configure different third level domains?
thanks


texts:
I am writing a frontend that lists some custom data. It calls an endpoint /rest/v1/custom/get that hooks into my CustomListInterface defined in the webapi.xml, this then returns a list of records in a custom database.

+-------------+----------+-------------+
|  entity_id  |   title  |    order_id |
+-------------+----------+-------------+
|       1     |   Test   |       2     |
+-------------+----------+-------------+

So when I call the endpoint, it outputs the json to represent the data structure of the table.

{
    entity_id: 1,
    title : "Test",
    order_id : 2
}

What I want is for the result to JOIN the order table and return a more complex structure such as.

    {
    entity_id: 1,
    title : "Test",
    order_id : 2,
    order : {
         entity_id : 2,
         base_total: 125.0000,
         qty : 4,
         increment_id : "M8036863"
    }
}

Can anyone point me in the right direction or suggest some examples in the codebase of how best to implement this.


texts: Magento 2 problem with multiple websites and multiple stores exist side by side

texts:
My Magento version is 2.2.6. In our shop, we need multiple websites and stores both. The store level is working fine, but there is a problem when visiting website level link. It gets always redirect to the default website. Can anyone help me? Thanks!

Below is my nginx/vhost conf:

When visiting store level domain "thirdview.magento2.com", it is working fine, but when visiting the website level domain "test4website.magento2.com", it always redirects to "my.magento.com"--the default domain.

In addition, all domain were worked properly when I set the "test4website.magento2.com" as the default website，why is that? Can anyone please help me out?


texts: I've been having problems with product attributes in Magento 2 showing N/A and No instead of being hidden, all solutions refer you to locate the attributes.phtml file. However I cannot trace that file, is there another solution?


texts: How to handle if curl request throws error in magento 2

texts:
I am receiving a response from using a curl request. But how do I check whether my curl request throws an error or not? because it takes 15 minutes to give a response from API.(but it works fine while testing in postman)
Can anyone guide me to solve this?
public function getDynamicPriceFromErp($sku, $priceCode)
    {

        $url = "https://v3.test.com/v1/test/44gggttfff234";
        $this->curlClient->setOption(CURLOPT_HEADER, 0);
        $this->curlClient->setOption(CURLOPT_TIMEOUT, 2000);
        $this->curlClient->setOption(CURLOPT_RETURNTRANSFER, true);
        //set curl header
        $this->curlClient->addHeader("Content-Type", "application/json");
        $this->curlClient->addHeader("Authorization", "Bearer fhY0eXAigoY");
        //post request with url and data
        $this->curlClient->post($url);
        //read response
        $response = $this->curlClient->getBody();
        return $response;
    }


texts:
I am adding a widget to a CMS page.  Within this widget will be some ajax calls -- however, i'm unsure what / how I should call this layout block in the controller to update the frontend code.

The widget is located here:

  magento/app/design/frontend/enterprise/default/template/catalog/product/widget/new/content/new_grid.phtml

In the CMS page I can calling the widget as such:

  {widget type="catalog/product_widget_new" display_type="new_products"
  show_pager="1" products_per_page="20" products_count="1000"
  template="catalog/product/widget/new/content/new_grid.phtml"}

The ajax calling function will look something like:

newPerPage = function (value) {
    try {
        jQuery.ajax({
            url: url,
            dataType: 'json',
            type: 'post',
            data: value,
            success: function (data) {
                jQuery('#product-grid-category').html(data.field);
            }
        });
    } catch (e) {
    }
};

The ajax conotroller function will look something like:

public function newPagerAction(){
    $this->setData('products_per_page', param);
    $response = array();
    $response['field'] = $this->getLayout()->createBlock('....')->setTemplate('....')->toHtml();
    $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
}


texts:
One of my client have requirement to change product price on frontend as per date selection. On product page, one date picker will be there and on date selection that product price should be changed.

Is there any module available in free/paid? Or any links or suggestions to achieve this?


texts: how to add a custom button on Category Page frontend


texts: Rewrite catalog_blocks_layer_view does nothing

texts:
I've tried rewriting catalog_blocks_layer_view with this config in a module (the module is turned on and works.) but my rewrite isn't rewriting and I'm not getting any errors. Does anyone know what could be up? Thank you!

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Mods>
            <version>0.1.0</version>
        </Company_Mods>
    </modules>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <layer_view>Company_Mods_Block_Catalog_Layer_View</layer_view>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

rewrite:

<?php
class Company_Mods_Block_Catalog_Layer_View extends Mage_Catalog_Block_Layer_View {
    public function getFilters()
    {
        $filters = array();

        $filterableAttributes = $this->_getFilterableAttributes();
        foreach ($filterableAttributes as $attribute) {
            $filters[] = $this->getChild($attribute->getAttributeCode() . '_filter');
        }

        return $filters;
    }
}


texts: How to add return form in my Magento 2.3. I added "MAGEWORX" for shipping service ?


texts: Duplicate CACHE and PRODUCT folders in /media

texts:
My /media folder size is getting a little out of hand. We have 8379 product records in the catalog. About 1000 of them are related to a customizer extension that we have, but the rest are Configurable products with a few Simple product attached. The catalog supports 5 stores across 5 domains and one shared cart.

I only upload images to the Catalog/Search products which are mostly Configurables. While trying to reduce the size of my /media folder, I found the ImaClean extension a while ago and have toyed around with it. Enabling it again, I can see that there are 10,218 photos in the /media folder structure that aren't in the database.

With a little more digging, I saw that inside of my /media/catalog/product folder, there's another /product folder at nearly 5.5gb with it's own Cache (with a last modified date from 2 years ago). Is this normal, or should I delete it? Obviously a backup is ideal, but that's 5gb to backup somewhere else on my server - or and offline download. I don't remember creating this backup of images and it's content definitely looks reduced from what I'm seeing in the main /product folder.

How often should I be using the Flush Catalog Images Cache and Flush Swatch Images Cache buttons in the Cache Management page? Is there a good cronjob I can setup to do this?

We use CloudFlare so nearly all of our images are cached there and I have unlimited space with them.

I've debated decentralizing the /media folder onto an EC2 instance with AWS, but haven't found a clean way to do so, and the cost is worrysome with this many GB in just the /media alone.

This question is kind of ambiguous and open ended, but I'm looking for a real solution or suggestions on how to handle this situation.


texts: Onchange event in while country change in magento 2

texts:
I need to change city field as a select field while change country name as India. otherwise, it shows text field.

I follow  this link use @Idham Choudry answer, but its throw Uncaught TypeError: mixing is not a function

what I did:

Create requirejs-config.js in your Namespace/Module/view/frontend

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/action/set-shipping-information': {
                'Namespace_Module/js/action/set-shipping-information-mixin': true
            }
        }
    }
};

then create set-shipping-information-mixin.js in Namespace/Module/view/frontend/web/js/action/

        define([
        'jquery',
        'mage/utils/wrapper',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/shipping-service',
        'Magento_Checkout/js/model/shipping-rate-registry',
        'Magento_Checkout/js/model/shipping-rate-processor/customer-address',
        'Magento_Checkout/js/model/shipping-rate-processor/new-address',
    ], function ($, wrapper, quote, shippingService, rateRegistry, customerAddressProcessor, newAddressProcessor) {

        $(document).on('change',"[name='country_id']",function(){
           //for country
           alert("country Changed");
           console.log("country Changed");
        });

        $(document).on('change',"[name='region_id']",function(){
           //for province or region
           alert("state Changed");
           console.log("state Changed");
        });
    });

Suggest me,

How Magento 2 did, while country change, then That Country related State is there in directory_country_region table means, its change select field, otherwise, its show text filed and which file handle this functionality, I need to do same thing to in my case.
what's error in my code and how to fix this.

Note: I am using Magento 2.1.7


texts: Filter cms collection by store id before the store is saved

texts:
I have a custom module where an item (slider) has to be linked with a cms page. The website is multistore.

So when the user inserts an item in my module I show a collection of cms pages where he can choose the page to link to.

The issue is with a new item where he didn't yet save the store view so I don't have yet the store id in the database.

How do you get around it? Filter by store view but don't get the store view from the database, but from what the user has clicked in the previous field?

I know about php being ended on server side, but is there some magento magic that can be done or should the user always have to save the storeview first? Or another approach?

$cms_collection = Mage::getModel('cms/page')->getCollection()
    ->addFieldToFilter('is_active',1)
    ->addStoreFilter($model->getData('store_id'));
$options = array();
foreach($cms_collection as $cms_page){
    $options[$cms_page->getId()] = $cms_page->getIdentifier();
}

$fieldset->addField('cms_id', 'select', array(
    'name'      => 'cms_id',
    'label'     => Mage::helper('cms')->__('Cms page'),
    'title'     => Mage::helper('cms')->__('Cms page'),
    'required'  => false,
    'options'   => $options,
));


texts: Magento 2.1 redirects in Observer after payment

texts:
I'm creating a payment method gateway, that requires after place order in the frontend, redirects to the custom controller that I've created.

I created an observer sales_order_payment_place_end to catch payment order and redirect to my controller, but this doesn't work and redirect to success page.

Edit:

I'm trying to build a payment gateway like PayPal (place order and redirect to its page, login and pay, and finally redirect to store to sucess page)


texts: Magento2 on changing particular config value from system config (yes/no) call a custom script to update product category

texts:
Magento2. I need to update some of the products category via custom script when a particular system config value is enabled or disabled
For e.g. I kept yes/no dropdown under system config. When I click on yes & save config value a script should run to update the product category & same goes for no.
How can I achieve this?


texts: How to get value of a variable when variable has been sending through layout handle in Magento 2

texts:
Layout handle in email_template.phtml

{{layout handle="email_product_list" order=$order product=$product check=$check area="frontend"}}

I need to know how can i get the value of $check variable in phtml file.


texts: Show PHTML-file in CMS page is not working

texts:
I'm trying to call a phtml file in a CMS Page and I know that there are several question for exactly that question already on Stackexchange. The problem is: its not working. I can't get it to running so obviously I'm doing something wrong right now.

This is my theme structure:
app/design/fronend/MX/base/

The desired phtml file is here:
app/design/fronend/MX/base/MX_Slider/template/carousel.phtml

In my CMS Page I use the following: {{block class="Magento\Framework\View\Element\Template" name="MX" template="MX_base::MX_Slider/template/carousel.phtml"}}

However, the phtml is not showing on the page.

Any ideas why? What am I missing?


texts:
My code...

 <a class="head01" href="#">
    ITEM(S):<?php echo Mage::helper('checkout/cart')->getCart()->getItemsCount(); ?>
    TOTAL:<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>
        <?php echo Mage::helper('checkout/cart')->getQuote()->getSubtotal(); ?>
</a>


texts: Implications of increasing MAX_NUM_COOKIES

texts:
Magento 2 allows 50 cookies per domain.
This limit is enforced by Magento\Framework\Stdlib\Cookie\PhpCookieManager::MAX_NUM_COOKIES.
What are the implications of increasing that value?
I've read how to change constants of class in Magento\Framwork? and the accepted answer states

  ... incompatibility with several more or less outdated browsers, depending on much you increase it.
  Especially IE 11 and lower have the 50 Cookie per domain limit and still a relevant market share.

But I don't exactly understand what would happen on IE11 and lower.
Does this mean that the website will not function properly or the cookies that come in from 50 upwards don't get set? Or anything else?
If I don't care how the website behaves on IE, is it safe to increase this number?


texts:
Please refer this url http://www.trendycollections.in/women-collections/salwar-kameez-1/party-salwar-kameez.html?dir=desc&order=id

In the above url, sorting direction is descending order. if i change the sorting order manually to that url i.e)http://www.trendycollections.in/women-collections/salwar-kameez-1/party-salwar-kameez.html?dir=asc&order=id, It also display the same result with same order. i can't find how to resolve it. If anybody Know, Please save me guys


texts: Still getting issue with right permission can't create directory "generation"*

texts:
I have already tried several solutions to solve my problem but it still does not work.
The "var / generation" folder is already under "777". "chmod -R -v 777"
I am under centOS7 and I use nginx and php-fpm 5.6
Thank you in advance for those who will help me

2018/09/30 00:46:31 [error] 19396#0: *132 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Can't create directory /usr/share/nginx/html//var/generation/Magento/Framework/App/ResourceConnection/.' in /usr/share/nginx/html//vendor/magento/framework/Code/Generator.php:115


texts: Custom Cart Price Rule Actions in Magento 2.2 (Trigger somewhen when a coupon code is redeemd)

texts:
Is it possible to add custom actions for coupon codes?

e.g You're on the cart page and have been provided with a coupon code, when you enter the coupon code it adds x1 Burger to your basket.

or You enter a coupon code which hits an external API triggering a webhook to start a process.

Basically we'd like to trigger a custom class/method when this type of coupon is redeemed, rather than the default ones.

Is this supported and/or possible?

note - NOT a custom rule, a custom action :)

Thanks


texts: Magento 2 static content deploy error less

texts:
I Got this error in compilation

[Magento\Framework\View\Asset\ContentProcessorException]

Warning: Division by zero in /var/www/html/saaf/vendor/oyejorge/less.php/li
  b/Less/Functions.php on line 28

Don't know how to resolve this error.


texts:
Throughout my Magento website, where there are products, I made it so that a customer can see the price of the products, with and without Tax.

However, how can I rename the word 'Tax' to 'GST' whenever a product is viewed within the website. I believe I have to go to the back-end and change some script around, I just don't know where?


texts: How to show the po_number in sales order grid and My order Table at frontend - Magento 2.3

texts:
How the show po_number from sales_order_payment_table to Sales order grid in admin html and My order tabel at frontend after customer login.

Thanks in Advance :)


texts: upsell.phtml in static block = Fatal error: Call to a member function getItems() on a non-object

texts:
I'll show my category list in a static block

{{block type="catalog/product_list" category_id="488" template="catalog/product/list.phtml"}}

No problem. But now I'm try to use the upsell.phtml- Template with

{{block type="catalog/product_list" category_id="488" template="catalog/product/list/upsell.phtml"}}

and I'll get these PHP Error. I'm not a PHP-developer, can you help me?

Fatal error: Call to a member function getItems() on a non-object in /var/www/.../catalog/product/list/upsell.phtml on line 1

and there's the standard Magento Code (upsell.phtml)

<?php if(count($this->getItemCollection()->getItems())): ?>

I have no idea what's wrong?!


texts: How to get child product image in Magento Cart

texts:
I am trying to get the child product image of a configurable product that was added to cart by the customer.

For example, if the customer added a pair of red shoes to the cart I would like to show that color in the shopping cart.

I have set "Show product Thumbnail Itself"

The problem is this function from a colour swatch extension

public function findColorImage($value, $arr, $key, $type)
{
    $found = '';
    if(isset($arr[$key])) {
        $total = count($arr[$key]);
        if($total>0)
        {
            for($i=0; $i<$total;$i++)
            {
                if($value == ucwords($arr[$key][$i]))//if it matches the color listed in the attribute
                {
                    $found = $arr[$type][$i];//return the image src
                }
            }
        }
    }
    if ($found == '') {
        if (isset($arr['image'])){
            $found = $arr['image'][0];
        }
    }
    return $found;
}

in the template colorselectorplus/cart/item/default.phtml

findColorImage($_item->getProductId(),$product_base,'color', 'image'); ?>

Which is being called from Helper/Data.php for some reason it only returns the Base image for the product and ignores the correct image for the colour.

I've tried changing image to use thumbnail but I'm not having any joy...

Has any other developer come across this issue with this extension and managed to fix it?

I'd don't mind even a hot fix right now...


texts: Magento 2 Decrease Stock When Order is Placed when Manage Stock is NO

texts:
Currently I have stock management software running

Is it possible to have the Quantity Of Stock decrease when an order is placed whilst having the option to Manage Stock OFF.

Currently I have the Decrease Stock When Order is Placed set to YES and the MANAGE STOCK set to NO however when an order is placed the Quantity of the item does not decrease, it remains the same.

Any ideas?

Thanks


texts: 500 (Internal Server Error) received after opening category - Magento 2.3.2

texts:
Today I have updated to Magento 2.3.2, everything works correctly except the categories. When I try to access a category I receive a 500 error in the browser console and a blank page with a single phrase:

Any idea why this happens and how to solve it? Execute the following orders without success:

rm -rf var/di var/generation
php bin/magento cache:clean && php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex && php bin/magento cache:clean && php bin/magento cache:flush

UPDATE 1

UPDATE 2


texts: Magento APIs mapping to Mobile Per Screen API Request

texts:
I'm leading an API team on Magento 2.2 in supporting a mobile development team.

The mobile team is asking for APIs to be developed that support an "API per Page" type of architecture where they are saying this is a standard pattern.

The Magento APIs do not support this type of architecture pattern; obviously as this unique to the app.

I'm trying to determine if the mobile team is correct in their approach or if the Magento APIs were specifically built to support Mobile App architecture pattern.  Any thoughts?

Are other mobile apps using Magento building out custom APIs and generally ignoring the OOTB APIs?


texts: Magento search not returning results when keywords dont have space

texts:
I am using Magento 1.7.0.2, i have some issues with the search results.

I searched for keyword table skirt its returning results, but when i search for tableskirt its not returning result.

I have changed the following code in app/code/core/Mage/catalogsearch/model/Resource/Fulltext.php file

$likeCond = '(' . join(' OR', $like) . ')';

to

$likeCond = '(' . join(' AND ', $like) . ')';

But no change happens with results.Anybody knows how to fix the issue.Please Suggest!


texts: GET V1/guest-carts/{cartId}/items not working?

texts:
1-Create cart with POST /rest/default/V1/carts/. It returns cartId = 13

2-Invoked GET V1/guest-carts/13/items

3-Get error
rest/default/V1/guest-carts/13/itemsresulted in a404 Not Found` response: {"message":"No such entity with %fieldName = %fieldValue","parameters":{"fieldName":"cartId","fieldValue":null}}

Magento 2.1.1
Please help.


texts: In the creditmemo all prices are shows as positive amounts, to make the difference between an invoice and a creditmemo more clear I would like to display the prices as negative values. Is there a way to show negative prices for creditmemos?


texts: products id in export sheet does not match with magento back end ids against their products name

texts:
i want to export my products from magento back end with products ids as when we export csv of products ids should be matched in csv and back end against their products name but when i export sheet and search with id in sheet different product get as save in magento back end

my magento back end products id

my export sheet products sheet in which on same id product name does not match


texts:
Could any1 please tell on how to achieve custom csv product import.

I need to save the product ids on import to my custom table.

Custom table should have only product_id column.

i followed this link: http://www.ibnab.com/en/blog/magento-2/magento-2-programming-implement-import-with-import-xml

But i face issue in getEntityTypeCode()

I need a full working example.


texts:
I'm new to Magento and I'm trying to figure out how to change the product position save logic when you save a category. I would like it to auto increment by ten for each product so that when you're finished the first product has a position of 10, second 20, third 30 and so on. This would make it easy to place products between the first product (10) and second product (20) by setting the product position to 15.

Any pointers on where to start would be very helpful.


texts: custom "sales_order_item" attribute to API response

texts:
I followed this guide to add a custom product attribute to quote and sales order item throughout the order process and this works fine.

My custom attribute is added to the sales_order_item table correctly but will not return in the order api call: /rest/V1/orders/X . The item in the order are present but the custom added attribute seems to be missing.

How do I add this sales_order_item attribute to the API output?

I tried it by adding a "extension_attributes.xml" to my custom module (that included the custom attribute: see earlier mentioned link) but that seems to have no effect:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Sales\Api\Data\OrderItemInterface">
        <attribute code="deliverycode" type="string" />
    </extension_attributes>
</config>

Thanks for the help!

Update

Still haven't resolved the issues after trying some minor things. I ran into this topic, which is closely related to my issue. I am trying to adjust the code to suit my needs but I haven't found the answer yet after a few hours of trying to switch the code the be suitable for "sales_order_item". If anyone has any solutions or tips to push me in the right direction they are very much appreciated!


texts: How to display multiple shipping address in dropdown rather than boxes in Magento 2.1 C E?

texts:
Please check the attached screenshot.

http://i.stack.imgur.com/uydzU.png

and help me solve this please.


texts: Configurable Attribute selection based on previous configurable attribute value in Magento 2

texts:
I have a configurable product with 4 configurable attribute, and this configurable product has 1000 of values in each configurable attribute.
So my simple products of above configurable product ranges from 50k to 100k.
The problem is when product view page loads, it loads all the values of the 4 configurable attributes dropdown which slows down the page load.
Following code gets all the data.

<script type="text/x-magento-init">
            {
                "#product_addtocart_form": {
                    "configurable": {
                        "spConfig": <?php /* @escapeNotVerified */ echo $block->getJsonConfig() ?>,
                        "gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
                            'Magento_ConfigurableProduct') ?: 'replace'; ?>"
                    }
                }
            }
</script>

I have created another function getJsonConfigCustom($attributeId, $attributeValue) to get values of configurable attributes which works perfectly fine.
Based on the value selected from the first drop-down I want to query above code with new values.
The function getJsonConfigCustom is passed with two parameters. On page load $attributeId will be the first configurable attribute Id and $attributeValue will be null indicating to get all the value of $attributeId related to the product. When first configurable attribute is selected from the dropdown, the function will be passed with attributeId of the selected dropdown and with the value in second parameter and the output will contain details of first and second attributes value and product options. I have written the above code and works perfectly on manual calls. But I want to automate this on dropdown selections which I think will be achievable when I try to run above code again and again with new sets of value for spConfig.

Is it possible to run above script tag again and again?


texts: Magento 2: Purpose of \Magento\Framework\Module\ModuleListInterface

texts:
I have seen \Magento\Framework\Module\ModuleListInterface  $moduleList implemented in a custom module like that

$this->_moduleList = $moduleList;
public function getExtensionVersion()
{
    $moduleCode = 'My_Module';
    $moduleInfo = $this->_moduleList->getOne($moduleCode);
    return $moduleInfo['setup_version'];
}

My question is, What is the purpose of this interface and which methods we can invoke using this interface?


texts: Redirect Magento2 404 page to the register page

texts:
I'm using Magento 2 to create my site. I want to dynamically assign a sponsor to the register of a new customer. I had create a customer custom field named nickname on the database. In practice I want to provide a link such as http://mywebsite.net/John1 where John1 is the nickname of the sponsor. The system will give an error not finding the requested page. I want to edit 404 page and redirect for the registering page with the sponsored nickname on it.
I create a link:

http://mywebsite.net/John1

The 404 page will process the URL and catch the string John1 and assign to the field nickname in a way that the registering page should be such as:

Sponsor: John1
Name:__________________
E-mail: _______________
Etc.

Could someone help me on this hard task? At least some guidelines how to start would be much appreciated.


texts: Varnish - Error 503 Backend fetch failed

texts:
I getting this error how can i do? i try to editing many time but still not work.

  Error 503 Backend fetch failed
  Backend fetch failed

  Guru Meditation:
  XID: 35

Varnish cache server

My CentOS 7: /etc/varnish/varnish.params

  # Varnish environment configuration description. This was derived from
  # the old style sysconfig/defaults settings

  # Set this to 1 to make systemd reload try to switch VCL without restart. RELOAD_VCL=1

  # Main configuration file. You probably want to change it. VARNISH_VCL_CONF=/etc/varnish/default.vcl

  # Default address and port to bind to. Blank address means all IPv4
  # and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
  # quad, or an IPv6 address in brackets.
  # VARNISH_LISTEN_ADDRESS=192.168.1.5 VARNISH_LISTEN_PORT=80

  # Admin interface listen address and port VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1 VARNISH_ADMIN_LISTEN_PORT=6082

  # Shared secret file for admin interface VARNISH_SECRET_FILE=/etc/varnish/secret

  # Backend storage specification, see Storage Types in the varnishd(5)
  # man page for details. VARNISH_STORAGE="malloc,1024M"

  # User and group for the varnishd worker processes VARNISH_USER=varnish VARNISH_GROUP=varnish

  # Other options, see the man page varnishd(1) DAEMON_OPTS="-a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s
  malloc,1024m -p thread_pool_min=5 -p thread_pool_max=500 -p
  thread_pool_timeout=300 -p http_resp_hdr_len=65536 -p
  http_resp_size=98304 -p workspace_backend=98304"

update:

1) Yes, the vcl file generated by Magento.

2)

  tcp        0      0 0.0.0.0:80              0.0.0.0:*             LISTEN      4338/varnishd

  tcp        0      0 127.0.0.1:6082          0.0.0.0:*             LISTEN      4337/varnishd

  tcp6       0      0 :::80                   :::*                 LISTEN      4338/varnishd

  tcp6       0      0 :::8080                 :::*                  LISTEN      3905/httpd

3) i in vcl edited added http:// beacuse when i only /pub/health_check.php will be 503, but added http:// the theme look like something wrong no css.

  .probe = {.
  url = "http://example.com/pub/health_check.php";

4) i used this command

  curl -I -v --location-trusted 'http://example.com'

show this, but i dont know working or not working, beacuse the var/page_cache/ directory is not empty. the mage-tags file still here.

  < X-Magento-Cache-Control: max-age=0, must-revalidate, no-cache,no-store

  X-Magento-Cache-Control: max-age=0, must-revalidate,no-cache, no-store < Age: 0 Age: 0 <

  X-Magento-Cache-Debug: MISS

  X-Magento-Cache-Debug: MISS


texts: Magento 2 with only build in cache (no varnish)

texts:
I want to switch to magento 2 but my current web hoster doesn't have varnish and implements redis in q4 of this year.

When i upgrade to some more resources, only with the default build in cache (no varnish), do i get a least the same performance like my 1.9.3.2 installation?

And is redis better than varnish? Or do i really need varnish for optimal performance?


texts: How to set & write the magento_umask file in the directory file system?

texts:
I'm sorry I am a beginner. I installed the last release Magento 2.2.1 on a shared hosting platform called OVH.

All the installation has been a 100% success. But now, I am facing permission & write files issues, which, on the backend don't allow me to click on the sidebar menu icons.

I created a magento_umask.txt but I don't understand exactly how to create, what format, and what to write inside it.

Can someone know?

Thank you a lot


texts: what is the strategy to find an problem in our layout file?

texts:
I am not able to figure out the problem as to why my layout page is not getting displayed.

my current status is that:-

controller is worrking, it gives output on the screen, so then i called layout
layout is not being displayed,

i had tried to invalidate my layout.xml file but then Magento loads the default layout, so i am not sure if my layout.xml file is being caleed or not or is there some problem with my blocks.....

So, i wanted to what is the standard approach when trying to debug this kind of problems?

For reference, below is my Controller, Config.xml, layout.xml and template.phtml files

url that i am calling is bhupenShop/index.php/customer/adminhtml_index/index/key/133b7f564dd974c7f29baf622648711b/

*controller file *

public function indexAction()
      {
            //echo "testing admin panel output .. ";
              $this->loadLayout();
              $this->renderLayout();
              //echo "testing admin";
      }

config.xml

<adminhtml>
          <layout>
              <updates>
                  <psl_customer>
                      <file>psl_customer.xml</file>
                   </psl_customer>
              </updates>
           </layout>

layout.xml stored in adminhtml/default/default/layout/psl_customer.xml

<?xml version="1.0" ?>
<layout version="0.1.0">
  <customer_adminhtml_index_index>
     <reference name="content">

             <block type="core/template" name="testing" template="Pfay/UserForm/FormInput.phtml" />

      </reference>
   </customer_adminhtml_index_index>
</layout>

and template stored inside adminhtml\default\default\template\Pfay\UserForm\FormInput.phtml

<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>"  />

    <form action="<?php echo Mage::getUrl('userform/adminhtml/index/saveform') ?>" method="post">
        <fieldset>
        <legend>Enter the following details:</legend>

            Name: <input type="test" name="name" required/>
*

            email_id: <input type="email" name="email" required/>
*

            MobileNumber : <input  type="tel" name="mobile" required/>
*

            Landline Number: <input  type="tel" name="landline" required/>
*

            SkypeId : <input type="text" name="skype"/>

        </fieldset>

        <input type="submit">Enter</submit>
    </form>


texts: How to Perform MFTF test to Custom Module before submit to Marketplace in Magento 2

texts:
I have go through the MFTF documentation to create and test the custom module before submitting the extension to Magento Marketplace. But this is difficult to understand to work on it.
Can some one share the simple example?
Thanks,


texts: How to set multiple stores and display in frontend?

texts:
I have created multiple websites, stores and store views in the admin panel as shown in the screenshot. I want to create multiple stores with the folder structure as:

www.abc.com/india
www.abc.com/uk
www.abc.com/australia

and so on.

How do I display the stores on the front end and get the stores select option so that users can select the stores.

I am using Magento CE 2.1


texts: Invalid block type: Mageplaza\HelloWorld\Block\HelloWorld Magento 2

texts:
I am trying to get up-sell product, but getting issue with invalid block type: Mageplaza\HelloWorld\Block\HelloWorld  in Magento 2.

<?php
namespace Mageplaza\HelloWorld\Block;
class Upsell extends \Magento\Framework\View\Element\Template
{
    protected $_registry;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Registry $registry,
        array $data = []
    )
    {
        $this->_registry = $registry;
        parent::__construct($context, $data);
    }

    public function _prepareLayout()
    {
        return parent::_prepareLayout();
    }

    public function getCurrentProduct()
    {
        return $this->_registry->registry('current_product');
    }

}
?>

Here is .phtml code

<?php
$myBlock = \Magento\Framework\App\ObjectManager::getInstance()->get('Mageplaza\HelloWorld\Block\Upsell');
$currentProduct = $myBlock->getCurrentProduct();

if ($currentProduct = $myBlock->getCurrentProduct()) {
    $upSellProducts = $currentProduct->getUpSellProducts();

    if (!empty($upSellProducts)) {
        echo '
UpSell Products
';
        foreach ($upSellProducts as $upSellProduct) {
            echo $upSellProduct->getSku() . '
';
        }
    }

}

?>


texts: Magento2 update layout according to attribute set

texts:
I have to create new layout on product view page using xml on the bases of product attribute set......

Trying this but no luck: layout/catalog_product_view_attribute_set_id_10.xml

Any idea to achieve this?


texts: Export products from Amazon onto Magento?

texts:
I was hoping someone could clue me in on how to import products into Magento from Amazon.

I understand you can download an csv from your Amazon seller account, has name, description, quantity, ASIN...

There are other plugins for Magento that if you enter the ASIN it will get everything, image, description, ect.

My question is, if I first import my CSV from Amazon (ASIN would then be in Magento), can I then use one of these extensions to pull in the rest of the info, and Magento match it both ASINs?


texts: Invalid login & problem registration password AccountController.php

texts:
i have magento 1.9.1

I have some problem with registration and customer login.
In registration page i had some errors with the password field.

--ERROR

Cannot save the customer.
Invalid method Mage_Customer_Model_Customer::cleanPasswordsValidationData(Array ( ) )

So i have modified /httpdocs/app/code/core/Mage/Customer/controllers/AccountController.php

if (empty($errors)) {
  // i have commented this line $customer->cleanPasswordsValidationData();

The registration of customer works but when i try to login it doesn't work.
I have the error that LOGIN AND PASSWORD ARE INVALID

I have this error message with new accounts that i created, old accounts works.

How can i solve the problem?
It is a problem with magento eav attribute in database?


texts:
Okay, I'm a dufus. I am trying to override the "Out of Stock" message displayed on the product page to "Sold Out". Currently using Magento 2.3.

Create an i18n folder in my custom theme folder, en_Us.csv file and put in the following in the file
"Out Of Stock","Sold Out!"

Cleared the cache but it's still displaying that dreaded Out Of Stock instead of Sold Out!

I have tried searching on Google and here but it seems that simple tasks like these are not documented. Can anyone enlighten me?

Thanks.


texts: How to add custom field in checkout page and save them in db and backend in magento2.2.5?

texts:
I want to add a custom field in the checkout

"Birthday" and "Anniversary" and save them in table quote, sales_order, and sales_order_address and to save them in Backend in sales view order below the shipping address.

Refer screenshot.

Any help would be appreciated.