texts: assign a downloadable product to a customer magento 2

texts:
I have created a plugin that allows customers to buy downloadable
  products as a customer and creates a user for them. It assigns the
  order to the customer, they receive an invoice. On the admin side I
  can see the order assigned to them ( it has a status of complete ) and
  on their account, they can see the order. When they check their
  account under my products it is not there. This is in Magento 2. How
  do I assign the product to the customer so they can download it?


texts:
i has file di.xml i my module

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Theme\Block\Html\Topmenu" type="Xanka\MyMenu\Block\Html\Topmenu" />
</config>

how to check if my config before overwrite Magento\Theme\Block\Html\Topmenu


texts: can i add sql query to OnepageController

texts:
i want to add new field on OnepageController page , the field is when to ship your order and i want to store it as value on Database
whats the mysql code to do this ?
since my database name : mage_2015
table name : shipping date
column name is : dateofShip

and the value of the is $dateship
regards


texts: Splitting of entity (products, categories etc.) collections into some equal parts?

texts:
does anyone have an idea, how can I split one collection of entities in Magento into three equal independent collections?

Following example:

$_category = Mage::getModel('catalog/category')->load(129);
$_category_children = $_category->getChildrenCategories();

In $_category_children I have a collection of subcategories of the category with ID=129. Let's say, there are 30 subcategories there. Now I want to get three collections of it:

$_category_children_1 -> independent collection with items 1-10 of $_category_children
$_category_children_2 -> independent collection with items 11-20 of $_category_children
$_category_children_3 -> independent collection with items 21-30 of $_category_children

I already tried http://php.net/manual/function.array-chunk.php, but it doesn't help, but only returns NULL.

Thanks a lot in advance for the help!


texts: How get default ReCaptcha key programmatically on Frontend?

texts:
I want to used this key in my Custom Module so how to get this this key using block.

I create a form on frontend which has a Recaptcha V2. How to used default keys for this Form.

And I also need to check is enable for Frontend (Backend) or not.

Thanks


texts: Magento 2 - What should be happen if customer fails the payment?

texts:
I have been creating a plug-in to integrate Magento 2 to payU latam web checkout gateway.

The order is created before the customer is redirected to the gateway and the state is pending payment. Then the store receives a notification about the process with the results.

What should I do if the process fails? What state and status I have to assign (on hold, cancel ...)? What about retrying thepayment?


texts: recreating block structure getChild calls for templates on widget

texts:
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
    <block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>

The above represents the pagination of a product collection.  It displays page size, products per page, current (and next, previous, etc) page, sort action, etc.  Normally i'd call this with a getChild( ) call.

Now, how can I recreate the above function call in something like a widget?  Where I must use other methods than the layout.xml and getChild calls to generate blocks.

For example:

$this->_pager = $this->getLayout()
    ->createBlock('catalog/product_list_toolbar')->setTemplate('catalog/product/list/toolbar.phtml');

This accomplishes the first part of the block/template call.

and:

$this->_pager = $this->getLayout()
    ->createBlock('page/html_pager', 'product_list_toolbar_pager');

This accomplishes the second part of the block/template call.

How can I combine these two related pieces of functionality?   I need to return them with a toHtml( ) function call.


texts: Magento 2.3.5 - Outdated version of composer

texts:
When I run the command composer outdated I see that our latest Magento 2.3.5 install runs on old versions of colinmollenhour/cache-backend-redis and colinmollenhour/credis.
Magento 2.3.5 uses version 1.10 and the latest version available is 1.14.
Can we safely update this to the latest version?


texts: Find the table for custom attribute values

texts: I’ve installed magento edition version 1.9.2.0 and added a custom attribute catalog_special_name (text field) and i want to know which table stores the custom attribute values for each product.


texts: Magento 2.1.x Payflow Pro sale processes but checkout doesn't advance

texts:
CentOS 7

PHP 7.0.17

Magento 2.1.5

Theme: SMMarket / Magentech

Problem

When attempting to complete a checkout transaction the card is being correctly processed by Payflow Pro but once the transaction through Payflow Pro completes there is no confirmation or furthering of the order process.  In effect, the card is authorized or charged, but the store stalls out at this point, so the order isn't placed or finalized.  The cart continues to show "1 item" and I can click on "place order" again -- which will then re-authorize or re-charge the card, again with nothing else occuring.

No error is presented on the screen and the page looks the same as before clicking on "place order."

When I go into the payflow manager, the transactions are there and match the returned authorization codes and reference numbers -- and the Magento 2 debug log indicates approval:

'result' =>
 array (
'result' => '0',
'pnref' => 'AT0*******',
'respmsg' => 'Approved',
'authcode' => '024*****',
'avsaddr' => 'Y',
'avszip' => 'Y',
'hostcode' => '00',
'resptext' => 'APPROVAL',
'procavs' => 'Y',
'visacardlevel' => 'G3',
'iavs' => 'N',
'result_code' => '0'

We've tried changing between Authorization and Sale in payflow settings, we've also alternated between live and test mode.  It looks like everything on the payflow side is now working as expected, but the approval result isn't triggering the correct action.

Is there another setting we're missing somewhere that is preventing the page from advancing?

Back Information

Just getting payflow pro working has been a bit of a pain, apparently our payflow account is an older account that didn't have "Hosted Pages" integrated.  Magento2 is now using transparent transactions via hosted pages to process payflow pro payments.  I'm including it here so that if someone else runs into this issue it may point them in the direction of contacting payflow support and requesting this piece.

IE: If you get a token result like below, but then the page doesn't show an error and doesn't do anything else; you likely need to reach out to payflow pro support, or activate hosted pages in the payflow manager:

      'result' =>
      array (
      'result' => '0',
      'securetoken' => 'T8M5pzdM0d0WcWWTrfAz7GwUb',
      'securetokenid' => '6ce763c1b6a5e565b924bc1316c31329',
      'respmsg' => 'Approved',
      'result_code' => '0',
      ),

To confirm this, you can use firebug or another console with net traffic view to watch the post to paypal, then view the response.  In my case I was getting a "Merchant Identification Failed" error, which finally led me to call Payflow Pro and get it all sorted out. (Our other platforms that are direct posting to Payflow Pro are not effected, which further stalled us on debugging this issue).


texts: Cannot filter new column calculated in custom customer grid

texts:
I've just added 2 new columns to my grid that calculated total order & total price of them for customer grid:

Here is my _prepareCollection function:

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel('customer/customer_collection')
            ->addNameToSelect()
            ->addAttributeToSelect('email')
            ->addAttributeToSelect('created_at')
            ->addAttributeToSelect('group_id');

        // zend_debug::dump($collection->getData());die;
        $total_pricesql ='SELECT sum(o.base_grand_total)'
            . ' FROM ' . Mage::getSingleton('core/resource')->getTableName('sales/order') . ' AS o'
            . ' WHERE o.customer_id = e.entity_id ';
        $expr = new Zend_Db_Expr('(' . $total_pricesql . ')');

        $collection->getSelect()->from(null, array('total_price'=>$expr));

        $totalsql ='SELECT COUNT(*)'
            . ' FROM ' . Mage::getSingleton('core/resource')->getTableName('sales/order') . ' AS o'
            . ' WHERE o.customer_id = e.entity_id ';
        $totalsqlexpr = new Zend_Db_Expr('(' . $totalsql . ')');

        $collection->getSelect()->from(null, array('orders_count'=>$totalsqlexpr));
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

Here is my code to add 2 column to grid:

$this->addColumn('orders_count', array(
            'header'    => Mage::helper('customer')->__('Total Orders'),
            'index'     => 'orders_count',
            // 'filter_condition_callback' => array($this, '_roleFilter'),
        ));

        $this->addColumn('total_price', array(
            'header' => Mage::helper('sales')->__('Total Sales'),
            'index' => 'total_price',
            'type'  => 'price',
            'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),
        ));

But when I tried to filter them, I got the following error:

Fatal error: Call to a member function getBackend() on a non-object in /home/devmb/public_html/sites/dipacommerce/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 816

Can anyone help me please ?


texts: Why does my module getting warrning "Mysql4 classes are obsolete "

texts:
Hello i have create custom module and getting warning Mysql4 classes are obsolete

class Mymodule_Custom_Model_Mysql4_Stores extends Mage_Core_Model_Mysql4_Abstract
{
    public function _construct()
    {
        $this->_init('custom/stores', 'entity_id');
    }
}

getting warning on line number 2


texts:
When I am adding column of TYPE_DECIMAL like this

->addColumn(
    'credit',
    Table::TYPE_DECIMAL,
    null,
    ['nullable' => false, 'default' => '0.00', 'length' => '10,2'],
    'Decimal'
)

Not giving decimal length in 10,2 it makes 10,0 Why? Any idea?


texts: How to get all products and its attributes?

texts:
I want to fetch all products in my ecommerce and all its attributes. How can I do that?
For example, I want to be able to call a function that gets all products, an then one by one fetch all the attributes of that product.


texts: Excluding Products from Coupon by Category

texts:
If a product is in categories 14 and 156 and I exclude category 14 (see settings below) from the coupon will that product still be able to be purchased using the coupon if the customer shopped it from category 156?
My confusion is due to what's being said within the "Actions" tab:

"Apply the rule only to cart items matching the following conditions"
If ALL  of these conditions are TRUE:
Category is not 14


texts: Bypass shipment steps in checkout when customer already have a default shipment address?

texts:
All customers have a settled default shipping address so right now the shipment step is a bit redundant, how can I jump this step in Magento 2?

I managed to alter vendor\magento\module-checkout\view\frontend\templates\onepage\link.phtml (For test only) to then add:

<?php if ($block->isPossibleOnepageCheckout()):?>
    <button type="button"
            data-role="proceed-to-checkout"
            title="<?php /* @escapeNotVerified */ echo __('Proceed to Checkout') ?>"
            data-mage-init='{"Magento_Checkout/js/proceed-to-checkout":{"checkoutUrl":"<?php /* @escapeNotVerified */ echo $block->getCheckoutUrl().'#payment'; ?>"}}'
            class="action primary checkout<?php echo($block->isDisabled()) ? ' disabled' : ''; ?>"
            <?php if ($block->isDisabled()):?>disabled="disabled"<?php endif; ?>>
        <?php /* @escapeNotVerified */ echo __('Proceed to Checkout') ?>
    </button>
<?php endif?>

Notice the #payment anchor in:

data-mage-init='{"Magento_Checkout/js/proceed-to-checkout":{"checkoutUrl":"<?php /* @escapeNotVerified */ echo $block->getCheckoutUrl().'#payment'; ?>"}}'

The checkout goes through, it takes me directly to review and payment (final step) step but when click on the checkout button to finalize the order an error message appears saying that a shipment method has not been established

If a go back 1 step I can see the shipment address loaded

Magento is 2.1.1


texts:
I am trying to overwrite the addAction in CartController, but can not get it to work. This is my custom extension:

app\etc\modules\Vendor_Namespace.xml

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

app\etc\code\local\Vendor\Namespace\etc\config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Vendor_Namespace>
            <version>0.1.0</version>
        </Vendor_Namespace>
    </modules>
    <frontend>
        <routers>
            <checkout>
                <args>
                    <modules>
                        <Vendor_Namespace before="Mage_Checkout">Vendor_Namespace_CartController</Vendor_Namespace>
                    </modules>
                </args>
            </checkout>
        </routers>
    </frontend>
</config>

app\etc\code\local\Vendor\Namespace\controllers\CartController.php

<?php
require_once 'Mage/Checkout/controllers/CartController.php';
class Vendor_Namespace_CartController extends Mage_Checkout_CartController
{
    public function addAction()
    {
        $value = Mage::helper('checkout/url')->getCheckoutUrl();
        $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()), $value);
        $this->_getSession()->addSuccess($message);
        parent::addAction();
    }
    public function updateItemOptionsAction()
    {
        $value = Mage::helper('checkout/url')->getCheckoutUrl();
        $message = $this->__('%s was updated in your shopping cart.', Mage::helper('core')->escapeHtml($item->getProduct()->getName()), $value);
        $this->_getSession()->addSuccess($message);
        parent::updateItemOptionsAction();
        }
    }
}
?>

Why isn't this working?


texts: Magento 1.9.2.4 not showing downloader console

texts: I have installed fresh copy of Magento 1.9.2.4 on a custom configured Ubuntu 14.04 LAMP server. While everything is working perfectly, the only error is no status console in downloader. The downloader installs the extension successfully but black status console is not shown and a white space is shown instead of it. Secondly maintenance.flag is not deleted automatically when I click Back to Admin link. I delete it manually. Please guide me what is missing in my server's configuration that causes this error?


texts: How to create a custom email template and show it in store configuration dropdown?

texts:
I want to provide another option for email template without creating the etc/config.xml or etc/system.xml, because i just need to add the new email option to the dropdown without creating new input field in store configuration. I tried it like this, but no luck:
etc/email_templates.xml
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="test_email_template" label="Test" file="test.html" type="html" module="Test_Test" area="frontend"/>
</config>


texts: Send Attachment within a template mail Magento 1.9

texts:
I got this error "Invalid method Mage_Core_Model_Email_Template_Mailer::createAttachment(Array
(
[0] => my content
)
)"
while trying to send an attachment within an email an here is my code :
protected function _sendEmailTemplateDocument($template, $sender, $templateParams = array(), $storeId = null, $customer, $fillename)
{
$customerName = $customer->getFirstname() . ' ' . $customer->getLastname();
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');
$fileContents = file_get_contents($fillename);
// $content = file_get_contents($fillename); // e.g. ("attachment/abc.pdf")
// $attachment = new Zend_Mime_Part($fileContents);
// $attachment->type = 'application/pdf';
// $attachment->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
// $attachment->encoding = Zend_Mime::ENCODING_BASE64;
// $attachment->filename = 'label Eticket.pdf'; // name of file
// $mailer->createAttachment(
//   $fileContents
// );
$attachment = $mailer->createAttachment($fileContents);

//$mailer->addAttachment($attachment);
$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo($customer->getEmail(), $customerName);
$mailer->addEmailInfo($emailInfo);
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig($sender, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId(Mage::getStoreConfig($template));
$mailer->setTemplateParams($templateParams);
$mailer->send();
return $this;

}
I need help to add this attachment correctly to my template email. Any help please and thanks in advance


texts: Custom option to be multiplied with the base price

texts:
I need to multiply the custom option value into the product base price.  In which file i need to add my function to change this.

I've added one additional field into the option table with value "yes" or "No". If the option is to be "no" the options value is added and if it is "yes" the option value will be multiplied.

Example:
Product Price: $50
Option 1 Value in Textbox: 5
Option 2 Value Selected: $50

Total Product Price: $500

Thanks in advance.


texts: Magento 2: total order amount on the administrator screen does not match with the actual total order amount

texts:
The total amount "$2.79" displayed in the order list on the backend customer page does not match the actual total amount "$305.29".

That is, the total amount displayed in the list is not equal to the total amount displayed on the order.

No solution found for this problem.
Could you help me?

Below is a list of customer orders.
The price is wrong.

The diagram below shows what the customer ordered.
The price is right.

The following image shows the values in the grand _ total and base _ grand _ total columns of the sales _ order table that have display problems.


texts: How to call a js function explicitly from phtml file in magento 2

texts:
I have the following file

  Vendor/Catalog/view/templates/product/view/type/options/configurable.phtml

Content of that file as follows

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>

<?php
/** @var $block \Vendor\Catalog\Block\Product\Renderer\Configurable*/
$_product    = $block->getProduct();
$_attributes = $block->decorateArray($block->getAllowAttributes());
?>
<?php //var_dump($block->getJsonConfig())?>
<?php if ($_product->isSaleable() && count($_attributes)):?>
    <?php foreach ($_attributes as $_attribute): ?>

            <label class="label" for="attribute<?php /* @escapeNotVerified */ echo $_attribute->getAttributeId() ?>">
                <?php echo $block->escapeHtml($_attribute->getProductAttribute()->getStoreLabel()) ?>

                <select name="super_attribute[<?php /* @escapeNotVerified */ echo $_attribute->getAttributeId() ?>]"
                        data-selector="super_attribute[<?php /* @escapeNotVerified */ echo $_attribute->getAttributeId() ?>]"
                        data-validate="{required:true}"
                        id="attribute<?php /* @escapeNotVerified */ echo $_attribute->getAttributeId() ?>"
                        class="super-attribute-select">
                    <option value=""><?php /* @escapeNotVerified */ echo __('Choose an Option...') ?></option>
                </select>

    <?php endforeach; ?>

<?php endif;?>

I'm trying to call a function of following js file

  vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js

I added following code in above phtml file

I'm just trying to call a function to see if its possible to make a call.
I even added a following require.js file

  app/code/Vendor/Catalog/view/frontend/requirejs-config.js

with following content

var config = {
    map: {
        '*': {
            configurableJs: 'Magento_ConfigurableProduct/js/configurable'
        }
    }
};

But I'm getting this error in console.

Is there a way to call configurable.js functions?


texts: How to Send Image with Product order as custom option in SOAP API Magento

texts:
While Ordering A Product [who have a custom option as file (image) required], through SOAP API , what will the value of KEY and VALUE pair, as per I know, key will the option id but what will be the value ??

For E.g.

           <options>
              <!--Zero or more repetitions:-->
              <complexObjectArray>
                 <key>1</key>
                 <value>??????????????????</value>
              </complexObjectArray>
           </options>


texts:
Want to run a function that placed in helper(Data.php) with cronjob every minute in my extension, is this possible?

function will update status of custom shipping that come from webservice


texts: Magento 2 : Two same products in cart but one must be FREE

texts:
I need to implement a functionality that do this :

After an api call, I get some SKU of product. This product needs to be added to the cart, but as a free product.

By doing this, this could cause a conflict issue with a possible existing product not free already in the cart

How to achieve this ?

1) Add a free product to cart

2) Avoid conflicts with existing product

Any help would be appreciated. Thanks.


texts: How to display magento best sell and promotion product in home page page?

texts:
I am using Magento 1.7.0.2 and I want to display best selling and promotion products on the home page.
I tried below code but it didn't work.

$storeId    = Mage::app()->getStore()->getId();
$products = Mage::getResourceModel('reports/product_collection')
    ->addAttributeToSelect('*')
    ->setStoreId($storeId)
    ->addStoreFilter($storeId)
    ->setOrder('ordered_qty', 'desc');
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
$products->setPageSize(6)->setCurPage(1);
$this->setProductCollection($products);
}

Please help me.


texts:
What are /shell folder permissions for Magento 1.x? Are they 755 or 644?

In any case, if you open /shell folder and try to click on any of the files the all show the message "This script cannot be run from Browser. This is the shell script."
I assume it doesnt really matter what permissions are, 700 is fine. Correct if I am wrong.


texts: Django authentication against Magento user base

texts:
I'm running a Magento store and also have another site that is based on Django that also needs an authentication.

Magento is currently authenticated against its own internal user base.

Is it possible to have Django authenticate against Magento's user base?


texts: How to Add Link with custom template in Magento 2.1?

texts:
I want to make a custom navigation for my theme, I'm overriding navigation.phtml template from Magento_Customer but I realized the links are made it by layout and they always return the link wrapped inside one li element. I'm calling my custom template but I don't know how to get only the link. This is how I'm creating the link:

<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-account-link" template="Magento_Customer::account/menulink.phtml">
   <arguments>
     <argument name="label" xsi:type="string" translate="true">Account Dashboard</argument>
     <argument name="path" xsi:type="string">customer/account</argument>
   </arguments>
</block>

How magento return link

Account Information

How I want to have it

Account Information

Any idea of how to do it?

Thanks!


texts: Products not showing on a multi store view magento site

texts:
I am creating a magento site with multiple store views. I have one website and two stores. One for the UK & one for the US. Both sites were showing products but now the US site store view 2 is not showing any.

I have updated indexes a load of times, checked the flushed cache, deleted everything from var/cache folder etc. Nothing seems to bring back the products to the US site.

I have also checked that it's enabled for all websites but as i only have one it is always on.

Hopefully this is something simple.


texts:
How to prevent bots creating fake subscibers to newsletter list ?
They are making direct GET / POST requests to /customer/account/create/ and /newsletter/subscriber/new/

"GET /customer/account/create/ HTTP/1.1" 200 82432 "-" "-"
"POST /newsletter/subscriber/new/ HTTP/1.1" 302 3874 "-" "-"

If i try to subscribe with curl it does not work, but somehow bots can still create subscribers

curl 'https://shop.com/newsletter/subscriber/new/'  --data 'email=example@example.com'

Login page has working recaptcha!


texts: Fatal error: Uncaught Error: Call to a member function setPid() on boolean magento 2

texts:
I have created a custom module.
In controller i am setting variable as

$resultPage->getLayout()->getBlock('custom_block')->setPid($pId);

In production mode I am getting above error, although its working well in developer mode. Any suggestion?


texts: Magento tracking code for affiliate programs

texts: I registered for ShareASale affiliate marketing program and was asked to put a tracking code on my site. Does anyone know where that taking code goes? I have Magento ver. 1.7.0.2 if that helps. I can't seem to find the answer anywhere on google or youtube.


texts: How to create a custom system field in magento 1?

texts:
Magento 1.9

I want to create a new tab in System > Configuration.
In this tab, I need a group tab and in this group tab i want a textarea which is connected to a field of my database. If i edit my textarea, it will modify my database field too.

Look at this: https://prnt.sc/orwph1

I don't know how to connect my textarea with my db.. Create a new tab with a new group it's easy but connect it to the db..

Thanks!


texts: Add a product to the cart via query string without form_key parameter in magento2

texts:
I need to help for add form key to cart url. can you anyone help.

$urlValue="";
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $urlValue = $product->getStatus();

        $cartUrl = $objectManager->get('\Magento\Catalog\Block\Product\ListProduct');
        $urlValue =  $cartUrl->getAddToCartUrl($product);
        $urlValue=str_replace(",,",",",$urlValue);
        if ($product->getConfigOptions() && 0) {
        $urlValue .= strpos($urlValue, '?') !== false ? '&' : '?';
        $urlValue .= $product->getConfigOptions();
        }

        $getParams = [];

        $feed = $this->getFeed();

        if ($feed && $feed->getReportEnabled()) {
            $getParams['ff'] = $feed->getId();
            $getParams['fp'] = $product->getId();
        }

        $utmMap = [
            'utm_source'   => 'ga_source',
            'utm_medium'   => 'ga_medium',
            'utm_campaign' => 'ga_name',
            'utm_term'     => 'ga_term',
            'utm_content'  => 'ga_content',
        ];

        foreach ($utmMap as $key => $value) {
            if ($feed && $feed->getData($value)) {
                $getParams[$key] = $this->getFeed()->getData($value);
                if (preg_match('/{{product.*?}}/is', $getParams[$key])) {
                    $getParams[$key] = $this->dynamicAttribute->getLiquidValue(
                        $this,
                        $getParams[$key],
                        ['product' => $product]
                    );
                }
            }
        }

        if (count($getParams)>= 0) {
            $urlValue .= strpos($urlValue, '?') !== false ? '&' : '?';
            $urlValue .= http_build_query($getParams);

        }

        return $urlValue;


texts:
I am trying to add custom headers to the checkout process to break the forms up into sensible sections.

I have already modified checkout_index_index.xml to alter the sort order of my form. It now looks like this

<?xml version="1.0"?>
<body>
    <referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="shipping-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shippingAddress" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="shipping-address-fieldset" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="telephone" xsi:type="array">
                                                                <item name="sortOrder" xsi:type="string">40</item>
                                                            </item>
                                                            <item name="company" xsi:type="array">
                                                                <item name="sortOrder" xsi:type="string">45</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

How do you go about adding headers in to break the form up in the following way

In the attached image I have converted the labels to placeholders within the fields.


texts:
I'm trying to retrieve the current product's attributes in a block in Magento 2.

I can get a product, like ID 1:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager
               ->create('\Magento\Catalog\Model\ProductRepository')
               ->getById(1);

I don't know how to get the ID of the current product though.

How could I do that?


texts: is google search return "Not Visible Individually" product?

texts:
I'm just looking confirmation here! For example, the simple product of configurable product are set to Not Visible Individually.

When I load simple product, it goes to 404 page.

My Doubt

if the search keywords perfectly match with simple product, is google return that simple product url?


texts: Magento 2: Can't update redirect URL – strange behaviour

texts:
I have created a new page (step) on my checkout which I'd like my users to be able to login in via. All works well when the user enters valid information (they're logged in successfully), but if they enter the wrong email / password, they are redirected to the /customer/account/login/ page. I'd like to change this URL to the /checkout/ (basically, just refreshing the page).

I have located the class (Magento\Customer\Model\Url) / method (getLoginUrl()) which sets the redirect URL. I've extended the class in a new module to overwrite the method to add an IF statement to it. I've added a check to see whether the user is on the /checkout/, and if so, return the /checkout/ as the loginUrl. If the user isn't on the checkout page (for example, just the usual customer/account/login page) then return the orginal URL set in the class as a constant. All looks like it should work well, right? Please see below for my extending class and my problem:

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Mitch\Customer\Model;

use Magento\Customer\Model\Session;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Url\EncoderInterface;
use Magento\Framework\UrlInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\StoreManagerInterface;

/**
 * Customer url model
 */
class Url extends \Magento\Customer\Model\Url
{
    /**
     * Route for customer account login page
     */
    const ROUTE_ACCOUNT_LOGIN = 'customer/account/login';

    /**
     * @var UrlInterface
     */
    public $storeId;
    /**
     * @var UrlInterface
     */
    public $currentUrl;
    /**
     * @var StoreManagerInterface
     */
    public $storeManager;

    /**
     * @param Session $customerSession
     * @param ScopeConfigInterface $scopeConfig
     * @param RequestInterface $request
     * @param UrlInterface $urlBuilder
     * @param EncoderInterface $urlEncoder
     */
    public function __construct(
        Session $customerSession,
        ScopeConfigInterface $scopeConfig,
        RequestInterface $request,
        UrlInterface $urlBuilder,
        EncoderInterface $urlEncoder,
        StoreManagerInterface $storeManager
    ) {
        $this->storeManager = $storeManager;
        parent::__construct($customerSession, $scopeConfig, $request, $urlBuilder, $urlEncoder);
    }

    public function getBaseUrl()
    {
        $this->storeId = 1;
        return $this->storeManager->getStore($this->storeId)->getBaseUrl();
    }

    /**
     * Retrieve customer login url
     *
     * @return string
     */
    public function getLoginUrl()
    {
        $this->baseUrl = $this->getBaseUrl();
        $this->currentUrl = $this->urlBuilder->getCurrentUrl();
        $this->checkoutUrl = $this->baseUrl.'checkout/';

        if ( $this->currentUrl == $this->checkoutUrl ) {
            echo "Yes, the user is on the checkout page";
            return $this->urlBuilder->getUrl('checkout/', $this->getLoginUrlParams());
        }

        return $this->urlBuilder->getUrl(self::ROUTE_ACCOUNT_LOGIN, $this->getLoginUrlParams());
    }

}

Unfortunately, even though the IF statement rings True (my echo statement is echoed), the new URL (checkout/) doesn't work.

Bizarrely, if I delete my updates and just hard code in the new URL, it works..! Obviously, I can't do this, as it'll redirect the user to the checkout no matter what page they're using to login.

public function getLoginUrl()
{
    // This would work
    return $this->urlBuilder->getUrl('checkout/', $this->getLoginUrlParams());
}

Any ideas why the URL won't change if I set it dynamically?


texts: Add to cart function doesnt work on product pages

texts:
Since activating the Porto theme on my magento site the add to cart function hasnt worked on the product pages, but still works on the catalogue views.

Does anyone have suggestions?

http://dev.tec-id.net

Many Thanks,

Luke


texts:
I am using two payment methods

Credit Card (Authorize.net CIM)
Paypal (Standard)

And currently, I am invoicing new orders manually but I would like to set-up an auto invoice method because now we have some Gift Card products, so if it's possible to invoice automatically then purchasing GiftCard turn to active status during the place order and my users could use gift card codes right away otherwise my users should wait for me to invoice and to use Gift Codes.

For credit card, I am using Payment action as "Authorize and Capture".

For PayPal, I am using Payment action as "Sale".


texts: Magento automatically round up product price based on applied VAT

texts:
I need to rounds up the including vat sell price to closest £0.99 ie. if sell price for an item including vat is £10.52 it rounds up the sell price inc vat to £10.99 . In other words, so sell price always ends with £.99 at the end.

And the website automatically will need to change the excluding vat price to exactly 20% less that the rounded up price.

I believe there is some event where I can hook a function to apply this round up logic?


texts: Upgrade to 2.3.2 - unable to change the slider to No to unselect components

texts: During upgrade 2.3.1 to 2.3.2 I'm unable to unselect components using sliders. See screenshot. They just do not move


texts:
/index.php/admin/urlrewrite/save/key/9ea46b0d697..../ ID Path for Specified Store, Request Path for Specified Store already exist.

how can I resolve above error.

Magento ver. 1.9.1.0


texts: Custom Option type file data not showing in Sales/Order Admin

texts:
I created a simple product with custom option type file like this :

when i try to order this product at front end, there is input type file and i insert the file and click add to cart button, and last step i did checkout and there's no problem at all in those steps, but when i see the sales/order for this product i don't see the custom option with the file that i already chose before

after i inspect it further,when adding the product to the cart using ajax, is not sending the custom option value :


texts: Magento2 : Remove fields from Ui Component grid conditionally

texts:
I want to remove actionsColumn, massaction and status fields of product grid if my custom configuration set to yes.

In magento 2 product grid is generated by \vendor\magento\module-catalog\view\adminhtml\ui_component\product_listing.xml how can I achieve this.


texts:
From the list of email templates, when I click on the Preview link for an HTML email template the pop-up appears but only an iframe shows with "Please click here if you are not redirected within a few seconds." On my original browser window, the admin backend redirects to the same thing (away from the normal admin backend interface).
When I'm editing a template and click the 'Preview Template' button, I get the same thing on a new tab of my browser.
The browser console shows errors that look like this:

"Blocked script execution in ... because the document's frame is
sandboxed and the 'allow-scripts' permission is not set.

and also

Refused to execute the redirect specified via ''. The document is sandboxed, and
the 'allow-scripts' keyword is not set.

We are in Developer mode, but it also does this in Production mode. It does this with all templates, not just html templates. Is this a known issue and is there a fix?


texts:
I want to transmit a token as URL-Parameter.

Is it safe to just encrypt the token like in Version 1?
Or needs the token to be encoded like in Version 2 because of unsafe characters?

$token = Mage::helper('core')->encrypt('123');

//1) encrypted token
$url = Mage::getUrl('product/index/link', array('key' => $token));

//2) url encoded token
$encoded = Mage::helper('core')->urlEncode($token);
$url = Mage::getUrl('product/index/link', array('key' => $encoded));


texts: Import options for simple products CSV - pros vs cons (Magento 2.2.8)

texts:
Currently I'm using magento 2.2.8 and so far I know about 3 main options to import simple products (using csv file).

a) csv import (Magento seems quite slow on this end) and only allows batches of about 400 products locally (on live server, only 100). This is the option I've already tried.

b) Using rest. Have to do some coding to get it working, as well as get acquainted with it.

c) Magento API. Have to do some coding to get it working, as well as get acquainted with it.

My prefered way would be to use direct sql queries + some php, but seems that database structure is a little bit convoluted.

On speed: Which method is faster? Would have a go on coding if it proves worthy on b or c
On batch size: Which method allows more products "per batch"?
Are there other methods I've not considered?

I don't want to reinvent the wheel, but don't have the budget (0 budget) for something like fire and bear (which according to their site works wonders, but is out of question here).

Thanks.


texts: Configure product custom options for different store views

texts:
i want to use the product Custom option in admin panel
but i have 2 stores view and i want it should show only in Store 1 and Not store 2
now is it set for global and not for website or store
for example when i create a drop down menu it showing on both stores even if i chooise only 1 store in the Choose Store View:


texts: how to stop order confirmation email in magento 2.0

texts: I want email will be sent only one time when payment will be successful, don't want to stop the sending process of order confirmation email


texts: How to get programmatically only enable CMS pages in Magento 2?

texts:
I want to get only enable CMS pages I merge my custom array and CMS pages as shown below:

<?php

namespace Vender\Module\Model\Config\Source;

use Magento\Cms\Model\Config\Source\Page;

/**
 * Store Options for Cms Pages and Blocks
 */

class Link implements \Magento\Framework\Option\ArrayInterface
{
    public $dataa = array();
    public function __construct(
        Page $page
    )
    {
        $this->_page = $page;
    }
    public function toOptionArray()
        {
            $this->dataa = [['value' => ' ', 'label' => __('Empty')],['value' => 'customer/account/login', 'label' => __('Login')],
            ['value' => 'customer/account/create', 'label' => __('SignUp')], ['value' => 'contact', 'label' => __('Contact Us')]];
            $marge = array();
            $marge =  array_merge($this->dataa,$this->_page->toOptionArray());
            return $marge;
        }

It returns me all the CMS pages and my custom array as well.
Now I want to get only those pages which are enabled from the admin side.


texts: Get child products of configurable product via Service Contract / API

texts:
In Magento 2, is it possible to get the associated simple products of a configurable product, via Service Contracts?

The only reference to the product type that I can find is ProductInterface::getTypeId(), but nothing that gives access to the underlying product type instance.


texts:
I want to check Braintree transaction status. I am calling

$gateway->transaction()->search([
  Braintree_TransactionSearch::status()->is(Braintree_Transaction::SETTLED)
]);

in my helper but unable to do so it is giving error

  "Missing required argument $merchantId of
  Magento\Braintree\Model\Adapter\BraintreeAdapter"

How can I call that?


texts: Composer invalid Argument exception PHP requirement (7.2.10)

texts:
I'm trying to install a custom Magento2 module using composer.

The module version is 2.4.0, here below my composer.json file:

{
  "name": "fattura24/app-fatturazione",
  "description": "Module to add Fattura24 to Magento2",
  "require": {
    "php": "~5.5.22|~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0|~7.2.10"
  },
  "type": "magento2-module",
  "version": "2.4.0",
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Fattura24\\AppFatturazione\\": ""
    }
  }
}

I open the terminal and I type:

composer require Fattura24/app-fatturazione

as a result I get this error message:

[InvalidArgumentException]
  Package Fattura24/app-fatturazione at version  has a PHP re
  quirement incompatible with your PHP version (7.2.10)

then I checked my php version by php -v command, and I got this result:

PHP 7.2.10 (cli) (built: Oct  9 2018 14:56:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Any suggestions? thanks to all

P.S.: by using the command composer require Fattura24/app-fatturazione --ignore-platform-reqs I succeeded in installing a previous version of the plugin, but I want to get the latest.


texts: Magento 2 add Custom CSS and JS file in admin panel

texts:
How can add CSS and JS File in admin panel of specific page.too many pages in admin panel e.g product,sales->order ,order view ,invoice,ship etc . . .

I want to load 1 CSS or JS file in New Invoice page.

Or other solution will be work for me if add CSS or JS code in .phtml file?

how can add this ?


texts: Magento - Create observer that sends email

texts:
How can I write an observer that sends email which tracks an eav_attribute yes or no value?
The email get's sent, if value is set to yes.
I already created the attribute and the email template.
I only need help with the observer that sends email if the attribute is set to yes on the admin page for a particular user.
Thanks.


texts: Magento2 Hiding static-block in checkout pages

texts:
I edited this file [vendor]/[theme name]/Magento_Checkout/layout/checkout_index_index.xml and use this code to hide the static block:

<referenceContainer>
<block name="custom.block.header" remove="true"/>
</referenceContainer>

The error output was something along the lines :

  Element with ID'custom.block.header' already exists

What am I doing wrong here?

this is the full code

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="empty" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<move element="logo" destination="porto_header" />
<referenceBlock name="custom.block.header" remove="true"/>
</body>
</page>


texts: Change order total programmatically in magento 2


texts: i want some changes in total price of grouped products in magento

texts:
i'm working on grouped products price now total price is calculated as

Total price = product(a) price x product(a) quantity + product(b) price x product() quantity

i want some change in that calculation like this

Total price = product(a) price x product(a) quantity x product(a) Carton + product(b) price x product(b) quantity x product(b) Carton

anyone can tell me where is code or how to do it


texts:
I got following query

SELECT
            CONCAT(address.firstname,' ',
            address.lastname) AS Name,
            address.email AS Email,
            items.created_at AS Date,
            items.name AS Description,
            items.store_id AS Logon,
            items.name AS Category,
            items.store_id AS FeedbackDate,
            items.sku AS ProductSearchcode,
            items.order_id AS Orderref

   FROM sales_flat_order AS orders
      JOIN sales_flat_order_item AS items
      ON items.order_id = orders.entity_id
      LEFT JOIN sales_flat_order_address AS address
      ON orders.entity_id = address.parent_id

  WHERE
  items .created_at BETWEEN  '2014-04-15 00:00:00' AND '2014-07-30 00:00:00'

This work fine for me, but I  want to output only completed orders not created(items .created_at).

How to achieve this ?

Thx


texts: Can't install new Magento theme (using wamp loaclhost)

texts:
I am using a localhost wamp server and have downloaded a theme, I have copied the zip file to my root folder and extracted as per the guide at https://zemez.io/magento/support/knowledge-base/step-3-upload-app-folder/
A bit unsure how to run commands using a wamp server

I need to do the following

bin/magento setup:upgrade
bin/magento index:reindex
bin/magento cache:clean

Bit of a novice sure not sure what to do, am I correct in thinking the path would be.

c:\wamp64\www\Magento\bin/magento setup:upgrade

or

C:\Users\mark>wamp64\www\Magento\bin/magento setup:upgrade

Any help would be appreciated.


texts: How can I integrate DHL web services. I need to integrate DHL for my shipping Rates.


texts:
I want to add the search bar in my 404 cms page. So I've written in the content of it :

{{block type="Magento\Framework\View\Element\Template" template="Magento_Search::form.mini.phtml"}}

But it doesn't shows anything. I've showed the templates hints and I I know that the location of the search bar template is in this location :

  vendor/magento/module-search/view/frontend/templates/form.mini.phtml

So I don't know why my solution doesn't work. Can you help me please ?


texts: getElementsByName doesn't work after admin grid ajax request

texts:
Im trying to get the selected checkboxs in invoice grid, which is working fine if I don't filter the grid or you can say before ajax request. After ajax request grid refreshes and also I can't get the selected/unselected checkboxs.

I can capture the click event on checkboxs but I want to get all of them to check which are checked & which aren't.

Here is my code

function getCheckedBoxes(chkboxName) {
    var checkboxes = document.getElementsByName(chkboxName);
}

Event.observe(window, 'load', function() {
    $(document).on('click', 'input[type="checkbox"]', function(event) {

          var chkStatus = getCheckedBoxes("invoice_ids");
          var checkboxesChecked = [];

          for (var i=0; i<checkboxes.length; i++) {
               if (checkboxes[i].checked) {
                    checkboxesChecked.push(checkboxes[i]);
               }
          }

          // Do other stuff after that
    });
});


texts: Magento 2: how to create api to send the Hashkey value to Mobile Apps?

texts: I want to create PAYU API for Checksum generation at the Magento backend and send the Hash key value to Mobile Apps.


texts: how can i get all fields of an order in magento?


texts: I am integrating vuestorefront with magento 2. While running yarn installer it's throw below error. if anyone has come this error, Please reply.


texts: How to modify magnifier small lens and bigger preview

texts:
I have modified as follows

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

It's working fine as expected. But I want smaller lens and bigger preview.

I tried to modify .magnify-lens class and .magnifier-preview class but could not come up with fine tuning.


texts: Programatically get subcategories of several root categories with collection

texts:
I am working on a collection query of categories:

$categories_check = Mage::getModel('catalog/category')
    ->getCollection()
    ->setStoreId($storeId)
    ->addFieldToFilter('is_active', 1)
    ->addAttributeToFilter('path', array('like' => "1/{$rootCategoryId}/%"))
    ->setProductStoreId($storeId)
    ->setLoadProductCount(1)
    ->addAttributeToSelect('*');

It returns the categories below root category $rootCategoryId. My requirement is to change this query, that it works for an array of root categories.

Like when I pass the array $rootcat = array('15,20,25,35'); it provides me categories below these root categories.


texts: Load out-of-stock products after the in-stock products in the category listing

texts:
I want to show first all in-stock products and then out-of-stock products respectively and sort by price in the ascending order.

Following is my code. In my local.xml I wrote the following code for the price from low to high

<catalog_category_layered>
        <reference name="product_list">
            <action method="setDefaultDirection"><dir>asc</dir></action>
        </reference>
    </catalog_category_layered>

and I wrote an observer to show all out-of-stock products last, i.e., after loading all in-stock products. For this I had used the catalog_product_collection_load_before event

$collection = $observer->getCollection();
        $collection->getSelect()->joinLeft(
            array('_inventory_table'=>$collection->getTable('cataloginventory/stock_item')),
            "_inventory_table.product_id = e.entity_id",
            array('is_in_stock', 'manage_stock')
        );
        $collection->addExpressionAttributeToSelect(
            'on_top',
            '(CASE WHEN (((_inventory_table.use_config_manage_stock = 1) AND (_inventory_table.is_in_stock = 1)) OR  ((_inventory_table.use_config_manage_stock = 0) AND (1 - _inventory_table.manage_stock + _inventory_table.is_in_stock >= 1))) THEN 1 ELSE 0 END)',
            array()
        );
        $collection->getSelect()->order('on_top DESC');
        $order = $collection->getSelect()->getPart('order');
        array_unshift($order, array_pop($order));
        $collection->getSelect()->setPart('order', $order);

Now what is happening is I can see the products from low to high but not out-of-stock products last.


texts: In Magento 1.9 home page shows the product in disorder

texts: Hey I added some products to display in home page. Products are showing but in disorder that I attached photo. I did not get how to display the product in same row,


texts: Magento 2 product image in new order email

texts:
I want to add an image of the product in the mail send after a successful checkout.

I am so far that I made a module that overrides

vendor/magento/module-sales/view/frontend/templates/email/items.phtml

But how to insert an image thumbnail?

items.phtml

<?php
/**
* Copyright Â© 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

?>
<?php $_order = $block->getOrder() ?>
<?php if ($_order): ?>
<?php $_items = $_order->getAllItems(); ?>

                <?= /* @escapeNotVerified */  __('Items'); ?>

                <?= /* @escapeNotVerified */  __('Qty'); ?>

                <?= /* @escapeNotVerified */  __('Price'); ?>

    <?php foreach ($_items as $_item): ?>
        <?php
            if ($_item->getParentItem()) {
                continue;
            }
        ?>

            <?= $block->getItemHtml($_item) ?>

    <?php endforeach; ?>

        <?= $block->getChildHtml('order_totals') ?>

<?php if ($this->helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order', $_order, $_order->getStore()) && $_order->getGiftMessageId()): ?>
    <?php $_giftMessage = $this->helper('Magento\GiftMessage\Helper\Message')->getGiftMessage($_order->getGiftMessageId()); ?>
    <?php if ($_giftMessage): ?>

<?= /* @escapeNotVerified */  __('Gift Message for this Order') ?>

                    <?= /* @escapeNotVerified */  __('From:'); ?> <?= $block->escapeHtml($_giftMessage->getSender()) ?>

<?= /* @escapeNotVerified */  __('To:'); ?> <?= $block->escapeHtml($_giftMessage->getRecipient()) ?>

<?= /* @escapeNotVerified */  __('Message:'); ?>

<?= $block->escapeHtml($_giftMessage->getMessage()) ?>

    <?php endif; ?>
<?php endif; ?>


texts: Magento2 Product / Category URL not showing SEO Friendly

texts:
I am facing issue with product URL. Please open link below http://new1.nufoot.com/catalogsearch/result/?q=GREEN+BAROQUE+BETSY+LOU+NUFOOT

So when you click on 1st product - GREEN BAROQUE BETSY LOU NUFOOT , it will take you to URL:- http://new1.nufoot.com/catalog/product/view/id/765/s/green-baroque-betsy-lou-nufoot-women/ , but when you click on 2nd product it will take you to seo friendly url - http://new1.nufoot.com/green-baroque-ballet-flats-nufoot.html

I have done, reindex, cache clean & flush. Also, I have updated the category from admin. but nothing makes it work.

Can anyone help me with this, please!

Thanks


texts: Magento 2 Add column in customer grid with name approve_account

texts:
I want to add a column in the customer grid with the name approve_account, it is not displaying in the gird. when I change the name (approve_account) to different names like approve_accounts it displays in heading with no column data. But I already created a customer attribute with name approve_account so I to add this in the customer grid.
My customer_listing.xml file

<columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
<column name="approve_account">
    <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">select</item>
             <item name="filter" xsi:type="string">select</item>
             <item name="editor" xsi:type="string">select</item>
             <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
             <item name="label" xsi:type="string" translate="true">Is Approved</item>
             <item name="sortOrder" xsi:type="number">51</item>
             <item name="sortable" xsi:type="boolean">true</item>
             <item name="visible" xsi:type="boolean">true</item>
             <item name="componentDisabled" xsi:type="boolean">false</item>

            </item>
        </argument>
</column>

Note : Its worked in local server. Issue in production (Both having same code)


texts: Array to string conversion in Error in magento 2 category app image upload in magento 2?

texts:
This is my code, I'm getting that error on line number 62

if, you faced this kind of error,please help me to resolve it
this is my code
if (!empty($category->getAppImage())) {
                unset($result[$category->getId()]['app_image']);
                $result[$category->getId()]['app_image'][0]['name'] = $category->getData('app_image');
                $appimg = false;
                if ($category->getAppImage()!='NULL' && $category->getAppImage()!='') {

                    $appimg = $mediaurl.'catalog/category/'.$category->getAppImage();
                    $result[$category->getId()]['app_image'][0]['url'] =$appimg;
                } else {
                         $result[$category->getId()]['app_image'][0]['url'] =$appimg;
                }

            }

Print Array Result

[{"name":"imgpsh_fullsize_anim_14.png","type":"image\/png","tmp_name":"\/tmp\/phpkARH8r","error":"0","size":"34171","path":"\/var\/www\/html\/stagingapp.nejree.com\/pub\/media\/catalog\/tmp\/category","file":"imgpsh_fullsize_anim_14.png","url":"https:\/\/\/media\/catalog\/tmp\/category\/imgpsh_fullsize_anim_14.png","cookie":{"name":"admin","value":"s3jbpiubqq13tsrase0d4e6cma","lifetime":"900000","path":"\/nback","domain":"stagingappadmin.nejree.com"},"previewType":"image"}]


texts: Custom template error after update magento from 1.9.0.1 to 1.9.2.3

texts:
Warning: Missing argument 1 for Mage_Core_Block_Template::setTemplate()  in /var/www/magento/app/code/core/Mage/Core/Block/Template.php on line 111

0 /var/www/magento/app/code/core/Mage/Core/Block/Template.php(111): mageCoreErrorHandler(2, 'Missing argumen...', '/var/www/magent...', 111, Array)
1 [internal function]: Mage_Core_Block_Template->setTemplate()
2 /var/www/magento/app/code/core/Mage/Core/Model/Layout.php(348): call_user_func_array(Array, Array)
3 /var/www/magento/app/code/core/Mage/Core/Model/Layout.php(214): Mage_Core_Model_Layout->_generateAction(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
4 /var/www/magento/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
5 /var/www/magento/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
6 /var/www/magento/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
7 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
8 /var/www/magento/app/code/core/Mage/Cms/Helper/Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
9 /var/www/magento/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
10 /var/www/magento/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
11 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
12 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
13 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
14 /var/www/magento/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
15 /var/www/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
16 /var/www/magento/index.php(83): Mage::run('', 'store')
17 {main}

I got this error after updated my magento. I have no idea why its happened. Need some help here.


texts: remove 'pub/' folder for URLs from command line

texts:
For increased security, we configured the DocumentRoot for our Magento application to be in the pub/ directory of the Magento installation, as described in the official documentation.

However, there is now a problem when executing commands on the command line - or when Magento's own cron is run: whenever a URL is generated for the front end context, e.g. via

$this->appEmulation->startEnvironmentEmulation(
    $store->getId(), \Magento\Framework\App\Area::AREA_FRONTEND, true
);

// …

$this->appEmulation->stopEnvironmentEmulation();

any generated front end URL - like for product images, will still contain the pub/ part of the URL.

The pub/index.php overrides the folder paths like this:

$params = $_SERVER;
$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [
    DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
    DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
    DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
    DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
];
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

i.e., it simply removes the pub/ part from all these folder paths.

However, how can the same be done for the command line environment? (But only for the front end context.)

Magento version: 2.2.6


texts: How to change the sort order for shipping in admin?

texts: I would like the default to be UPS and not Custom Value.  Is there a way I can do this in Magento 1.9.2.4?


texts: convert datatype varchar to in magento collection

texts:
i have magento collection

Mage::getResourceModel('customizebundles/customizebundles_collection')
                            ->distinct(true)->addFieldToSelect('validity')
                            ->setOrder('validity', 'asc');

how can i convert validity column varchar to unsigned like

SELECT DISTINCT validity FROM customize_bundles AS main_table order by cast(validity as unsigned)


texts:
As I'm fairly new to the Magento ecosystem, I'm wondering what the best practice is for writing extensions. Is it better to write an extension for each major release (2.0, 2.1, 2.2), or can one extension work on all releases?

I've written an extension for 2.1, and I'm trying to port it to 2.0, but I'm running into several problems, i. e. classes like \Magento\Framework\App\Request\DataPersistorInterface are missing and XML tags like listingToolbar aren't recognized. The translate attribute is not allowed in menu.xml


texts: The attempt to post data to consumer failed due to an unexpected error. Please try again later. Search Reset Filter

texts:
Сannot activates an integration of Magento 2.4 with my application on the localhost. I want to activate Magento integration for testing OAuth-based authentication, but I get the message:
"The attempt to post data to consumer failed due to an unexpected error. Please try again later."


texts: Magento 2 : Add "Guest" Product to Cart Programmatically

texts:
How to add a product to cart, like a guest customer, without the need to have a registered product?

I created a module that have some informations about products that will be added to the shopping cart by api:

{
  "products" : [
    {
      "name" : "product1",
      "price" : 30.20,
      "qty" : 1
    },
    {
      "name" : "product2",
      "price" : 20.30,
      "qty" : 2
    }
  ]
}

But this products is not registered in Magento database. And I don't have the interest to register it. I only need to use the informations about these products to finish the checkout.

I need to know if someone knows how to add a "not registered" product to cart to magento make the collection with this "mocked" product and not search a product in the database.


texts:
I am looking for a way to update order status with rest api (php) based on order ID.

I tried several things from the doc (well at least, I have found below code Without success)

    $data = array(
        "entity" => array(
            'entity_id'=>'000000159',
            'status'=>'pending2'
        )
    );

$retour = $this->api->put("orders",$data );

How can I accomplish this.


texts: magento 2.0 How to get associated products of a grouped product in product list page

texts:
I want to show all associated products of a grouped product in product list page.

I have made a category Brand in that I assigned all grouped products. In listing page, I displayed all brands as a list view.

Now I want to show all associated products of each group product on this listing page. I can get associated products of a grouped product in view page for an individual product.

How can I use grouped product module in list page as I could use it in product view page?


texts: How to resolve Uncaught TypeError: Cannot read property 'version' of undefined?

texts:
Here I am using  below jquery include in register.phtml

<script src="https://code.jquery.com/jquery-1.12.4.min.js" /></script>

so that is why coming to that issue.

So I need to solve it.


texts: MAGENTO 2 :- Fetch image from directory and display it on table

texts:
right now only image Name is displaying from database table not images

<?php
      foreach ($_gridrecords as $_gridrecord): ?>

        <?php $employeeId=$_gridrecord->getEmployeeId() ?>
        <?php $profile=$_gridrecord->getProfile()?>
        <?php $name=$_gridrecord->getName() ?>
        <?php $email=$_gridrecord->getEmail()?>
       <?php $address=$_gridrecord->getAddress() ?>

    <?php echo $employeeId ?>
   <?php echo $profile ?>
   <?php echo $name ?>
    <?php echo $email ?>
    <?php echo $address ?>


texts: “We can't save the customer” Alert on Magento 2

texts:
In Magento 2, on registration.phtml file, I have enabled the address fields.
But when I try to create or register a new customer, it shows "We can't save the customer".

Can anyone tell me where I am lacking?

It will be very helpful for me.


texts: how re install site from a backup into a new Magento installation 1.9

texts:
I recently had to reset my hosting and re-install magento 1.9 to run my site
I've uploaded my site from an offline back up but it's not showing up
my best guess is that it's about the new installation's database
Can anyone give me advice how to get it back up and running without having to do a total rebuild


texts: Different less compilation results between grunt and server side compilation

texts:
I got the following theme inheritance setup:
Vendor/Retail inherits from Vendor/Default which inherits from Magento/blank

When compiling the styles with grunt I get no issues. When compiling with server-side compilation some of the blank theme's styles are missing.

I.e. vendor/magento/theme-frontend-blank/Magento_CatalogSearch/web/css/source/_module.less
or
vendor/magento/theme-frontend-blank/web/css/source/_layout.less

Will be included when compiled with grunt but dropped when compiled with server-side compilation.

I'm drawing a bit of a blank here. Does anyone have an idea what's going on here?

Edit:

I dug into it more and found that it actually only drops the styles that are wrapped in media queries. The common styles are applied. So styles wrapped in:

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m)

will be dropped and not show up in styles-l.css. While styles wrapped in:

& when (@media-common = true) {

will show up in styles-m.css.

This only applies to styles from the blank theme. Styles wrapped in media queries from the child theme are not affected by this issue.


texts: How to display a title over the multiselect attribute value?

texts:
I created a multiselect attribute and displayed an image at frontend for that attribute value.I want to display a title for each value when the customer hovers over the feature image.

How can this be done?

Below is the sample like which I wish to keep:


texts: What is required to make $this->renderLayout(); work?

texts:
I am aware that

  $this->renderLayout();

calls the layout. How does this work and what files do i need?

I am receiving no php errors but nothing is produced by the above statement.

Thanks.


texts: Custom rest API for magento 2 contact form with react venia storefront

texts:
I'm currently setting up a contact form in venia storefront and trying to get it to link to my rest api in magento 2.
On button click the forms linking to the actions file and then throwing a not route found error when searching for the API, I've done the same method for other parts in the site such as the newsletter subscriptions and the add to cart functions etc.

Just hoping someone could point out where I've gone wrong this time as I've probably just overlooked something obvious.

My current API file:

<?php
namespace File\Custom\Api;

use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository;
use Magento\Customer\Api\Data\CustomerInterface;
use Magento\Customer\Api\Data\CustomerExtensionInterface;
use Magento\Customer\Api\Data\CustomerExtensionFactory;

class ContactManagement implements \File\Custom\Api\ContactManagementInterface
{

  protected $_storeManager;
  protected $_transportBuilder;
  protected $_request;
  protected $storeManager;
  protected $customerRepository;

  public function __construct(\Magento\Store\Model\StoreManagerInterface $storeManager,
                              \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
                              \Magento\Framework\App\RequestInterface $request,
                              CustomerRepository $customerRepository
  )
  {
    $this->_request = $request;
    $this->storeManager = $storeManager;
    $this->customerRepository = $customerRepository;
    $this->_transportBuilder = $transportBuilder;
  }

  public function postContact(CustomerInterface $result, RequestInterface $request)
  {

    $store = $this->_storeManager->getStore()->getId();
    $transport = $this->_transportBuilder->setTemplateIdentifier('suttonsilver_custom_customer_admin_reseller_email')
      ->setTemplateOptions(['area' => 'frontend', 'store' => $store])
      ->setTemplateVars(
        [
          'name' => $result->getFirstname().' '.$result->getLastname(),
          'email' => $result->getEmail(),
          'phone' => $result->getPhone(),
          'interest' => $result->getInterest(),
          'message' => $result->getMessage()
        ]
      )
      ->setFrom('general')
      // you can config general email address in Store -> Configuration -> General -> Store Email Addresses
      ->addTo('email@test.com', 'Name')
      ->getTransport();

    $transport->sendMessage();

    return $result;

  }
}

My action setup in venia storefront

export const contactForm = payload =>
  async function thunk(...args) {
    const [dispatch, getState] = args;

    dispatch(actions.resetContactFormError.receive());
    dispatch(actions.resetContactFormSuccess.receive());

    try {
      const response = await request(
        '/rest/V1/contact',
        {
          method: 'POST',
          body: JSON.stringify(payload)
        }
      );

      await dispatch(getUserDetails())
      await dispatch(actions.contactFormSuccess.receive({message: response}));
    } catch (error) {
      dispatch(actions.contactFormError.receive({message: response}));
    }
  };

Webapi.xml link file

<route url="/V1/contact" method="POST">
    <service class="File\Custom\Api\ContactManagementInterface" method="postContact"/>
    <resources>
        <resource ref="self" />
    </resources>
    <data>
        <parameter name="customerId" force="true">%customer_id%</parameter>
    </data>
</route>


texts: extend "private method" in a define module via mixin

texts:
Let's say we have a class that returns a Magento uiComponent, that I want to extend (original.js)

/* file name: original.js */
define(['uiComponent'],function(Component){
    'use strict';
    //here's the internal method
    function private() {
        return 'private';
    }

    return Component.extend({
        initialize: function () {
            private();
        }
    });
})

Here's the mixin declaration (requirejs-config.js)

var config = {
    config: {
        mixins: {
            'original': {
                'original-mixin': true
            }
        }
    }
};

Then, the mixin (original-mixin.js)

/* file name: original-mixin.js */
define([], function () {
    'use strict';

    return function (original) {
        return original.extend({
            initialize: function () {
                console.log(this.private); //obviously not working
            }
        });
    }
});

I hope the above is self-explanatory of what I'm trying to achieve. Basically I wanted to override the internal "private" function with a mixin. Thanks for your kind help.


texts: Delete rows with multiple where condition

texts:
I need to delete one or multiple rows from my table with where condition.

Eg: 1. Delete from search where id=1 and customerid=2

EG: 2. Delete from search where customerid=2

After some browsing found this code and added to my model

public function deleteByCondition($id,$uid)
{
  $table = $this->getMainTable();
  $result = $this->_getWriteAdapter->delete($table,array('id'=>$id,'customerid'=>$uid));
}

But it didn't help. Then got another code which didn't help either.

public function deleteByCondition($id,$uid)
{
  $table = $this->getMainTable();
  $where =  $this->_getWriteAdapter()->quoteInto('id = ?  AND',$id).$this->_getWriteAdapter()->quoteInto("$customerid = ? ", $uid);
  $result = $this->_getWriteAdapter->delete($table,array('id'=>$id,'customerid'=>$uid),$where);
}

I know we can execute the raw sql query but am thinking there must be other way to do coz i think its not the proper way to open the write connection any where and update DB.

Now i need to delete with where condition. can someone help ?


texts: All customer forms failing after upgrade to Magento 1.9.3.5

texts:
I've just upgraded a Magento site from 1.5.x to 1.9.3.5. Now, all my customer-related forms are failing form validation. For example, I can fully fill out my one-page-checkout Billing Address form, but I get the following error message:

Please enter the first name.
Please enter the last name.
Please enter the street.
Please enter the city.
Please enter the telephone number.
Please enter the zip/postal code.
Please enter the country.

I've added a bunch of log statements to the core Magento code so I can see what the hell is going on. I've ruled out the common form_key issue-- it's passing that validation test-- and everything seems to work until saveBilling() in Onepage.php. I can see that the POST request to the server contains the address information, but I can't see much beyond that as the Magento function documentation is terrible and dumping the $address object to log results in a 10,000+ line dump that I have no hope of successfully searching through.

I know it's failing on line ~325 in Onepage.php, specifically these lines of code:

// validate billing address
if (($validateRes = $address->validate()) !== true) {
    return array('error' => 1, 'message' => $validateRes);
}

It is always returning the error message. Help!


texts:
I'm trying create one simple page with form without grid on Admin of Magento2, just one page with some fields.

I'm working with Model, ResourceModel, Collection and DataProvider and form ui_component.

I tested the connection of my model with database and all is ok.

My problem is when i load the form page my fields don't pull the database content.
On DataProvider Class in getdata method, the collection ($this->collection->getItems()) show a empty array.

Someone can help me ?


texts: Magento 2. How to upload images to pub/media

texts:
Problem

I have a $fieldset. What arguments should I give to ->addField method to create an input field, that loads image to $_FILES?

What was done

For now I have an input field.

Created by

 $fieldset->addField('image',
            'image',
            [
                'title' => __('Image'),
                'label' => __('Image'),
                'name' => 'image',
                'note' => 'Allow image type: jpg, jpeg, gif, png',
            ]
        );

But the $_FILES is empty, when I checking it in controller execute() method.

Additional information

$fieldset arguments was taken from this example.


texts: Magento 2: Custom Module Listing MassDelete Not working [SOLVED]

texts:
When i'm trying to delete all records from Listing, By selecting all. Not able to delete.

app\code\Custom\Module\Controller\Adminhtml\Messages\MassDelete.php

namespace Custom\Module\Controller\Adminhtml\Messages;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Custom\Module\Model\ResourceModel\Messages\CollectionFactory;
use Magento\Framework\Controller\ResultFactory;

class MassDelete extends \Magento\Backend\App\Action {

/**
 * @var Filter
 */
protected $filter;

/**
 * @var CollectionFactory
 */
protected $collectionFactory;

/**
 * @param Context $context
 * @param Filter $filter
 * @param CollectionFactory $collectionFactory
 */
public function __construct(Context $context, Filter $filter, CollectionFactory $collectionFactory) {
    $this->filter = $filter;
    $this->collectionFactory = $collectionFactory;
    parent::__construct($context);
}

/**
 * Execute action
 *
 * @return \Magento\Backend\Model\View\Result\Redirect
 * @throws \Magento\Framework\Exception\LocalizedException|\Exception
 */
public function execute() {

     $collection = $this->filter->getCollection($this->collectionFactory->create());
      $collectionSize = $collection->getSize();

      foreach ($collection as $item) {
      $item->delete();
      }

    $this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', $collectionSize));

    /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
    $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
    return $resultRedirect->setPath('*/*/');
}
}

It always give blank, when i'm trying to print $collection

[Solution]

Thanks to this post Magento 2 massaction delete not working

Only missing

Check if you have following line in your Model\ResourceModel\Module\Collection.php file:

protected $_idFieldName = 'module_id';


texts: I created some simple products programatically. I need to create nearly 70k products programmatically only. Now it is taking so much time(nearly about 40 hours). So please give some solution to reduce the time. Thank you in advance.


texts: Magento 2.3.2: $this->getChildBlock()->setData()->toHtml(); not working in loop

texts:
return $this->getChildBlock("child block name")->setField("data")->toHtml();

This add code in Block file and rendor this function in phtml but code doesn't work, Is there any solution ?


texts: Factory Class vs. Proxy Class in magento2

texts:
I read here, there are two types of classes available in Magento 2.  Injectible and Non-injectible.

To inject a non-injectible object as dependency, we use Factory Class.

  For example

Magento\Catalog\Model\Product  is non-injectible.  That’s because it is a model that relies on data from the database.  In order to be able to inject this as a dependency, we will use Factory Class.

But what is the purpose of Proxy Class and in which scenario, we need to use Proxy Class

What is the difference between them?


texts: I am trying to add a custom header in Magento 2. I am creating my custom theme and add custom header page customeheader.phtml but header is not show.


texts: Magento 2: How to Set Max Length on Billing Address at Checkout Page?

texts:
I have achieved for Shipping Address Magento 2: How to set Max Length for Street Address?

Struggling with Billing Address on domain.com/checkout/#payment

My Payment Method is Bank Transfer. I have tried below code, but seems not working.

magento\app\code\Custom\Checkout\Block\LayoutProcessor.php

    $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
            ['payments-list']['children']['banktransfer-form']['children']['form-fields']['children']['street'] = [
        'component' => 'Magento_Ui/js/form/components/group',
        'label' => __('Street Address'),
        'required' => true,
        'dataScope' => 'banktransfer-form.street',
        //'displayArea' => 'billing-address-form-banktransfer',
        //'deps' => 'checkoutProvider',
        //'dataScopePrefix' => 'billingAddressbanktransfer',
        'provider' => 'checkoutProvider',
        'sortOrder' => 60,
        'type' => 'group',
        'children' => [
                [
                'component' => 'Magento_Ui/js/form/element/abstract',
                'config' => [
                    'customScope' => 'banktransfer-form',
                    'template' => 'ui/form/field',
                    'elementTmpl' => 'ui/form/element/input'
                ],
                'dataScope' => '0',
                'provider' => 'checkoutProvider',
                'validation' => ['required-entry' => true, "min_text_length" => 1, "max_text_length" => 50],
            ],
                [
                'component' => 'Magento_Ui/js/form/element/abstract',
                'config' => [
                    'customScope' => 'banktransfer-form',
                    'template' => 'ui/form/field',
                    'elementTmpl' => 'ui/form/element/input'
                ],
                'dataScope' => '1',
                'provider' => 'checkoutProvider',
                'validation' => ['required-entry' => false, "min_text_length" => 1, "max_text_length" => 50],
            ]
        ]
    ];

//        echo "<pre>";
//        print_r($jsLayout);
//        exit;


texts:
We use mageplaza extension products grid. Impossible open products --> catalog
Notice: Undefined index: position in /home/user/domains/domain.com/public_html/app/code/Mageplaza/ProductGrid/Ui/Component/Listing/Columns/Thumbnail.php on line 183

on line 183 code:
/**
 * @param Product $product
 *
 * @return string
 * @throws LocalizedException
 */
public function prepareFileData($product)
{
    $data     = [];
    $position = [];
    $images   = $product->getMediaGalleryImages();
    foreach ($images as $image) {
        $image->setFileSize($this->_helperData->fileSizeFormat($this->_file->getFileSize($image->getPath())));
        $data[$image->getValueId()] = $image->getData();
    }
    $imageEntities = $product->getMediaGalleryEntries();
    foreach ($imageEntities as $imageEntity) {
        $data[$imageEntity->getId()]['types'] = [
            'image'        => 0,
            'small_image'  => 0,
            'thumbnail'    => 0,
            'swatch_image' => 0,
        ];
        foreach ($imageEntity->getTypes() as $type) {
            $data[$imageEntity->getId()]['types'][$type] = 1;
        }
    }
    foreach ($data as $key => $item) {
        $position[$key] = $item['position'];
    }
    array_multisort($position, SORT_ASC, $data);

    return HelperData::jsonEncode($data);
}

/**

Any solution?


texts: exclude products with duplicate attribute value in product collection in magento 2

texts:
have a product with 1 attributes(Styleno);
I need to exclude products with duplicate attribute value in Product Collection. For example
product1 values: mfs1
product2 values :mfs2
product3 vaules:mfs3
product4 vaules:mfs1
So I need to display product product1, product2 & product3 from collection.


texts: Website is loading properly on a specific product

texts:
When we go to this product on this website the loading gif never goes away and lock the page:
https://www.rodin.no/catalog/product/view/id/178106/s/thule-7206-7215b-7214b-186046/category/1695/
This is the same product on another website, but no issue there.
https://takrails.no/thule-7206-7215b-7214b-186046.html
Anyone that know why this is happening?
Any help is appreciated
cheer!


texts: Storewise product url save programatically in Magento 2

texts: I have 2 different website in my Magento. I want to store different url key for each website. How to store it programatically ?


texts: Magento2 import products attribute and attribute sets

texts:
I'm using Magento 2.1.3.

Is it possible to import product attributes and attribute sets or do I have to create them manually before importing products with specific attributes?


texts:
I'm trying to add extra configuration options to all widget configuration/edit screens, not just cms_static_block for example, but all available widget types.

I've managed to add an additional tab (under 'widget options') by looking at how magento itself does it, but how the forms/fields themselves are added is beyond me at this point.

There is an _addField($parameter) function in the class that adds the extra tab(which extends \Magento\Widget\Block\Adminhtml\Widget\Options and implements \Magento\Backend\Block\Widget\Tab\TabInterface), and shorting it (return false;) gives me an empty form (instead of the form of the previous tab) but I'm pretty sure I shouldn't mess with that. Instead I'm pretty sure I should be creating templates and overriding classes somewhere else.

Maybe someone can point me in the right direction?

Thanks in advance.


texts: In Magento 2,I can't Open Categories With New URL

texts:
If I add new URL then it's showing 404 error when it open frontend side.If it open with old URL it's working.

For Ex. I have added new URL "business-card-gift-card-holders123" for category.It's showing the error When It open. Other Side it category is open with old URL. "business-card-gift-card-holders".

I have select "No" from below Path

  Store -> configuration->catalog->catalog->Search Engine Optimization
  ->Create Permanent Redirect for URLs if URL Key Changed


texts: site is super slow GET customer/section/load/?sections=cart&force_new_section_timestamp=false&_=xxxxxx

texts:
My site became super slow since yesterday. I can not find out which extension causes this. I thought it might because of the weltpixel Google Tag Manager, i disabled it.
Run

setup:upgrade;
setup di:compile;
s:s:d

but the site is still very slow.

  this is the request that makes the site so slow

  https://www.example.com/customer/section/load/?sections=cart&force_new_section_timestamp=false&_=xxxxxxxx

response
    {"cart":{"summary_count":0,"subtotalAmount":null,"subtotal":"$0.00<\/span>","possible_onepage_checkout":true,"items":[],"extra_actions":"
<\/a><\/div>
<input type=\"image\" data-action=\"checkout-form-submit\" data-checkout-url=\"https:\/\/www.gofanco.com\/paypal\/bml\/start\/button\/1\/\" src=\"https:\/\/www.paypalobjects.com\/webstatic\/en_US\/i\/buttons\/ppcredit-logo-medium.png\" alt=\"Checkout with PayPal\" title=\"Checkout with PayPal\"\/>  <\/a> <\/div>

<\/div><\/div>

<\/span>
Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.<\/div><\/div><\/div><\/div><\/div>","isGuestCheckoutAllowed":true,"website_id":"1","storeId":"1","amazon_quote_has_excluded_item":false,"subtotal_incl_tax":"$0.00<\/span>","subtotal_excl_tax":"$0.00<\/span>","data_id":1571424976}}


texts: Can we create individual admin section for individual store

texts: I have created multiple store like store1,store2 in magento.Can we Create individual admin section for each store, so that store1 can operate(add product,view sales record) only with own store admin section?


texts:
I am creating all of my footer links in the static block already provided from the magento install. I have managed to delete the links to sitemap advanced search etc below, because i wanted those links to be with the rest of the links in the static block.

I have found a way around to link the contact form from the static block by creating a new contact us cms page and a new template file to hold the form info.

But i am having trouble finding out how i can link to the sitemap page from a static block.

Any ideas?

Thanks


texts: Magento 2 : get full file path of full size image currently assigned to product

texts: I want to get the full file path of the full-size image currently assigned to a product so as to rename and upload it again, any help would be appreciated.


texts: How to create custom table in magento 2.3(via XML) by module?

texts:
After reading change log for Magento2.3, I come to know now onward in Magento we can add custom table via xml.

so there would be no PHP way to create a table.

So can any one tell me how can I add a custom table in via my custom module.


texts: How to import products very fast into my site from csv file

texts:
I am beginner of Magento..

I have a CSV data sheet file that contains a lot of products. When I try to run using Dataflow, it takes too much time to import products from CSV into my store..

Do you have any idea on how to increase the speed of Dataflow or any good extension that does this job?

Please, kindly tell me!


texts: How to move specific section of the element not entire element

texts:
I want to move the selected specific section of the element not the entire element,
<block class="Magefan\Blog\Block\Post\View" name="blog.post" template="post/view.phtml"/>

Common moving element
<move element="blog.post" destination="page.wrapper" before="main.content" />

I want to move only the image section not entire element,  Blog post contains image, title, description, etc. How to move only the specific scestion from element.


texts: Getting Subcategories even if product count for each is 0

texts:
In my module, I am getting the current ID and then using the category repository and the "getChildren" method. This works great, except it doesn't return child categories with product counts of 0.

How would I get around this?

"getAllChildren" seemed promising, but returned all descendants, whereas I'm just looking for the immediate children, regardless of product counts.

Edit: For testing purposes, I've added products to these categories that aren't showing up. Their ID's still aren't being returned via the GetChildren method.


texts: Include SKU within Product Drop-Down (Bundle Options)

texts:
When dealing with a bundled product, the associated bundle items when in the drop-down option, will display the product title along with the additional price. I have been tinkering yet unable to figure out how to include the SKU of the product as well. I believe the correct file would be the select.phtml within

  /base/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml

However through my feeble attempts, I have not been able to include the SKU. Any ideas? Below is the file for ease of access:

<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select */ ?>
<?php $_option      = $this->getOption(); ?>
<?php $_selections  = $_option->getSelections(); ?>
<?php $_default     = $_option->getDefaultSelection(); ?>
<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
<?php $tierPriceHtml = ''; ?>

<label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->escapeHtml($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '*' ?>

<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>

<?php /** @var $_selection Mage_Catalog_Model_Product*/ ?>
<?php if ($this->_showSingle()): ?>
    <?php echo $this->getSelectionTitlePrice($_selections[0]); ?>
    <?php if ($_selections[0]->getSelectionCanChangeQty()): ?>
        <?php $tierPriceHtml = $this->getTierPriceHtml($_selections[0]); ?>
    <?php endif; ?>
    <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
<?php else:?>
    <select onchange="bundle.changeSelection(this)" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname">
        <option value=""><?php echo $this->__('Choose a selection...') ?></option>
    <?php foreach ($_selections as $_selection): ?>
        <?php if ($_selection->getSelectionCanChangeQty() && $this->_isSelected($_selection)): ?>

            <?php $tierPriceHtml = $this->getTierPriceHtml($_selection); ?>
        <?php endif; ?>
        <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option>
    <?php endforeach; ?>
    </select>
<?php endif; ?>

<span id="bundle-option-<?php echo $_option->getId() ?>-tier-prices"> <?php echo $tierPriceHtml; ?>

    <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?>&nbsp;<input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>


texts: Old attributes persist after attribute set is changed in Magento 2

texts:
There's an issue we're struggling with the products EAV. Here's an explanation:

There's a shop with attributes and attribute sets created from them.
A product is assigned an attribute set, and a value is given for a particular attribute from the set.
Then, it turns out that the attribute set was wrong for the product, so it's assigned to a different attribute set.

Here's where the problem happens - Once you change the attribute set, the attributes from the old attribute sets which have a value previously assigned for the products, stay.

And if the attribute is filterable, it appears on the filters of the category, which is the main reason I'm writing this.

What's the best way to handle removing attribute values from old attribute sets/ attribute sets that were wrongly assigned? Should they be manually deleted from the db?

We tried reindexing, but it didn't work.


texts: How to add  tag to the product tabs in Prodcut detail page in magento 2

texts:
I have 4 custom tabs on the product detail page.

How to add the  tag to the tab heading.

catalog_product_view.xml

<block class="Magento\Catalog\Block\Product\View" name="magneticBallastTable.tab" template="VENDOR_Dvpage::tabs/content.phtml" group="detailed_info" >
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Product Versions Comparison</argument>
                    <argument name="sort_order" xsi:type="string">70</argument>
                </arguments>
            </block>


texts: Magento - how to extend login session time on php.ini or htacess

texts:
I'm user of Magento and out website is supported by web hosting company, simplehelix.

I want to extend our website session time because the remaining time of login is too short.
I already set the time on Magento back-end server but it didn't work.
I saw this phase like

  Magento will rely on session.gc_maxlifetime, despite what you've set in the store admin area.

So i tried to update php.ini or htacess file but htacess file doesn't have gc_maxlifetime value. I found the php.ini file but it was an back-up file. So i create own php.ini file and modify the gc_maxlifetime to 10800(about 3 hrs).However, i'm facing on the same situation.

By searching on Google, lots of programmers said that when setting on php.ini is changed, The restart of server is needed. So could i ask the web hosting company or is there any other way to apply this new set up? Thank you so much.


texts: How to call Web API call inside custom module Magento 2

texts:
How can we call Web API in a custom module?

I have a third party module, in which they are sending a request with API calls. I have custom functionality where I have to redirect my page to that Web API link, so everything works smoothly

Can anyone here tell, how we can do that in Magento2? Some step by step guide?

Thanks!


texts: How can i remove the postal code from the address book? Magento 2.3

texts: I've been trying to locate the module responsible for adding new addresses in the address book in order to remove the "postal code". That way when the customer wishes to add a new address then the "postal code" will not show up in the new address form. But, i cant seem to find the .XML file responsible for that operation. Can someone lead guide me in the right direction?


texts:
I cannot insert blocks in the CMS editor in the form

{{block type="isfeatured/isfeatured" template="isfeatured/featureblock.phtml"}}

The Magento version is 1.9.0.1 patched. The patched were applied through FTP as I have no SSH access.

Now, I know the issue is related to the SUPEE 6788 patch and the block permissions, but I can't understand how. There's an issue on the admin page (even though the patch is applied), as in System > Permissions I have only the Users and Roles options (and not Blocks). Anyway, the table permission_blocks in the database has the row with the fields (block_name, is_allowed) set to ('isfeatured/isfeatured', 1).

The exception.log shows this:

exception 'Mage_Core_Exception' with message 'Can't retrieve entity config: admin/permission_block' in C:\xampp\htdocs\devsite\app\Mage.php:595

Any idea?


texts:
Good morning I have a problem with my store.

activating the Italian translation I report this problem: in the "Checkout" button the text has disappeared. How can I do?
Thanks.