texts: Magento 2 - undefined property _pageResult on admin page

texts:
I created route and admin menu item linked to this route, but I am getting the error message in the browser when I try to access it:

1 exception(s):
Exception #0 (Exception): Notice: Undefined property: Namespace\Mymodule\Controller\Adminhtml\Griglia\Index\Interceptor::$_resultPage in /Applications/MAMP/htdocs/magento2/app/code/Namespace/Mymodule/Controller/Adminhtml/Griglia/Index.php on line 34 ...... ............(MORE ERROR TEXT IS HERE) ....

I can see the content of the page on this route, if I cut the processing by outputting something in execute method and return;, but I want the template to load too, using the layout and template for this admin page.

Code in Controller/Adminhtmk/Griglia/Index.php is:

<?php

namespace Namespace\Mymodule\Controller\Adminhtml\Griglia;

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

    public function execute()
    {

        //Call page factory to render layout and page content
        $this->_setPageData();
        return $this->getResultPage();
    }

    /*
     * Check permission via ACL resource
     */
    protected function _isAllowed()
    {
        return $this->_authorization->isAllowed('Namespace_Mymodule::griglia');
    }

    public function getResultPage()
    {
        if (is_null($this->_resultPage)) {
            $this->_resultPage = $this->_resultPageFactory->create();
        }
        return $this->_resultPage;
    }

    protected function _setPageData()
    {
        $resultPage = $this->getResultPage();
        $resultPage->setActiveMenu('Namespace_Mymodule::griglia');
        $resultPage->getConfig()->getTitle()->prepend((__('Posts')));

        return $this;
    }

}


texts: Fetch all specific customer's order using Customer token in magento 2 REST API?

texts:
I am aware about method using admin token

  Request type :: GET

URL

http://<host>/rest/V1/orders
?searchCriteria[filterGroups][][filters][][field]=customer_email
&searchCriteria[filterGroups][0][filters][0][value]=someone@test.com

Authentication Bearer <Admin token>

But how to Fetch all specific customer's order using Customer token in magento 2 REST API ?


texts: How to implement logic for the copy an attribute value to another attribute based on the attribute sets?

texts:
We have some attribute sets like BCDs, Polespears ...etc and respected attributes like bcds_color,    polespears_color ..etc would like to copy the value from attribute set based to "ca_color" attribute when admin save the product. Can you please guide me how to implement logic for this.
I have written code for copy an attribute while saving a product at admin end

  app/code/Demo/Copyattribute/etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_save_after">
        <observer name="Product Save After" instance="Demo\Copyattribute\Observer\Productsaveafter" />
    </event>
</config>

  app/code/Demo/Copyattribute/Observer/Productsaveafter.php

<?php

namespace Demo\Copyattribute\Observer;

use Magento\Framework\Event\ObserverInterface;

class Productsaveafter implements ObserverInterface
{
     protected $_action;
     private $logger;
     /** @var \Magento\Eav\Api\AttributeSetRepositoryInterface $attributeSet **/
     protected $attributeSet;

     public function __construct(
        \Magento\Catalog\Model\ResourceModel\Product\Action $action,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Eav\Api\AttributeSetRepositoryInterface $attributeSet

         ){
            $this->_action=$action;
            $this->logger = $logger;
            $this->attributeSet = $attributeSet;
         }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
     try{

           $writer = new \Zend\Log\Writer\Stream(BP.'/var/log/magento2.log');
           $logger = new \Zend\Log\Logger();
           $logger->addWriter($writer);

           $productColorValue='';
           $store   = $observer->getStoreId();
           $product = $observer->getProduct();//product object
           $productId = $product->getId();
           $attributeSetRepository = $this->attributeSet->get($product->getAttributeSetId());
           //return $attributeSetRepository->getAttributeSetName();
           $logger->info("Attribute Set Name".$attributeSetRepository->getAttributeSetName());
            //
             //Here Logic (or) code?
            //

            $productColorValue=$product->getResource()->getAttribute('bcds_color')->getFrontend()->getValue($product);

            if($productColorValue == 'No')
            {
               $productColorValue='';
            }
            $this->_action->updateAttributes(array($productId), array('ca_color'=>$productColorValue),$store);

        } catch (\Exception $e) {
             $this->logger->critical($e->getMessage());
        }

    }
}


texts: How to restrict access to user for particular store in Magento 2?

texts:
I have a requirement where multiple stores are created under one website.

Now, I want to create role so that role has access only to the particular store.

For e.g. If there is role Dell Manager so role should have access to Dell Store only.

In System > User Roles > Add new role > Role Resource. I can see store option. But on expanding it I am not able to see list of store in Magento that I have configured.

I have explored on it and found a plugin which is supporting it. LINK

Is there any other way I can do this functionality without third party plugin/extension?


texts: magento2 how to add product grid in ui form using ui component

texts:
Magento 2 : How to add a product grid in custom module using ui component?

this refreance is not work me it is display look like layout grid


texts:
I try to get list category with load(), but I got the error messages on code editor.

phpcs: Ecg.Performance.Loop.ModelLSD: Model LSD method load() detected in loop

This is my code :

public function getCategory()
{
    $product = $this->getCurrentProduct();
    $categories = $product->getCategoryIds();

    foreach ($categories as $category) {
        /** @noinspection PhpDeprecationInspection */
        $cat = $this->category->load($category);
        $catTree = $cat->getName();
    }
    if (!empty($catTree)) {
        return $catTree;
    }
    return true;
}

How to fix this error messages? should I change the method to get category list?


texts: Magento 2: Modify HTML of field for customer create/edit

texts:
I'm trying to add an additional option to the country selection dropdown for a customer in the admin panel.
Having bad luck finding an entry point to modify that.
Here's the picture showing the thing I need.
I would like to add as the first option - "Select country" and make it disabled.
This attribute is a custom attribute.


texts: To fetch product id from product grid under custom module tab

texts:
I have created one custom module for slider. I want to add product to the slider manually. so i have decided to show product grid under select products tab. I got product grid. But i can't get product id value.

I got following value,when i use var_dump()

array(14) { ["form_key"]=> string(16) "mdfqCbKxuebW87wT" ["title"]=> string(4) "TEST"
["status"]=> string(0) "" ["c_id"]=> string(2) "12" ["store"]=> string(1) "5"
["page"]=> string(1) "1" ["limit"]=> string(3) "100" ["in_category"]=> string(0) ""
["entity_id"]=> string(1) "," ["name"]=> string(0) "" ["type"]=> string(0) "" ["sku"]=>
string(0) "" ["websites"]=> string(0) "" ["links"]=> string(0) "" }

product grid returns an empty value

its describe, product grid under select products tab.

https://docs.google.com/file/d/0B9pmknBzwZOuQ3k2M1BLQmhzMFE/edit

Here is my complete code

I can't understand where is problem arise! If you found any thing wrong here, please save me guys!

Thank you


texts: How to Send a Copy of Order Confirmation Emails to Dynamic EmailId in Magento 2

texts:
I have a made custom module of the sales rep. They can create an order for a customer. When sales rep place order at that time order confirmation email copy sent to assign sales reps in order.
I have store sales rep email id in Quote & order both tables. If any query please let me know. Please any can help me
Note: The code is working on the local server. But In an enterprise, it's not working.

create an event for a set variable. create event.xml

 <event name="email_order_set_template_vars_before">
     <observer name="set_email_po_order" instance="Vendor\Modulename\Observer\EmailOrderSetTemplateVarsBefore" />
 </event>

set variable dynamic from the get order table
 <?php
 namespace Vendor\Modulename\Observer;

 use Magento\Framework\Event\Observer;
 use Magento\Framework\Event\ObserverInterface;

 class EmailOrderSetTemplateVarsBefore implements ObserverInterface {

 private $orderEmail;
 protected $scopeConfig;

 public function __construct(
     \Vendor\Modulename\Model\OrderEmail $orderEmail,
     \Vendor\Modulename\Model\SalesrepFactory $salesrepData,
     \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
 ){
     $this->orderEmail = $orderEmail;
     $this->_salesrepData = $salesrepData;
     $this->scopeConfig = $scopeConfig;
 }

 public function execute(Observer $observer)
 {
     $transportObject = $observer->getData('transportObject');
     if($transportObject->getData('order')){
         try {
             if($order->getSalesrepId()){
                 $getSalesrepData = $this->_salesrepData->create()->load($order->getSalesrepId());
                 if($getSalesrepData->getEmail()){
                     $notiEmails = $getSalesrepData->getEmail();
                     $this->orderEmail->setSalesrepEmails($notiEmails);
                     $logger->debug("Order email copy send to salesrep sucessfully....");
                 }
             }

         } catch (\Exception $e) {
             $logger->error('Error while send design customer Email', ['exception' => $e]);
             echo $e->getMessage();
         }
     }
 }

}
?>

create a model for set private
 <?php
 namespace \Vendor\Modulename\Model;
 class OrderEmail {
 private $extraOrderEmailId;

 public function setSalesrepEmails($email){
     $this->extraOrderEmailId = $email;
 }
 public function getSalesrepEmails()
 {
     return $this->extraOrderEmailId;
 }

}

Add plugin di.xml

 <type name="Magento\Sales\Model\Order\Email\Container\OrderIdentity">
         <plugin name="add_email_to_order_copy" type="Vendor\Modulename\Plugin\Order\Email\Container\OrderIdentity" sortOrder="1" disabled="false" />
 </type>

Create a plugin file
 <?php
  namespace Vendor\Modulename\Plugin\Order\Email\Container;
  class OrderIdentity{
      public function __construct(
         \Vendor\Modulename\Model\OrderEmail $orderEmail
      ){
          $this->orderEmail = $orderEmail;
      }
       public function afterGetEmailCopyTo(
       \Magento\Sales\Model\Order\Email\Container\OrderIdentity $subject,
       $result
       ){
 $additionalEmailId =  $this->orderEmail->getSalesrepEmails();
 if(($additionalEmailId === null) || (!$additionalEmailId) || empty($additionalEmailId)){
     return $result;
 }
 else{
     $additionalEmailId =  explode(",",$this->orderEmail->getSalesrepEmails());
     if(count($additionalEmailId)==0 || empty($additionalEmailId)){
         return $result;
     }
     else{
         if (!empty($result) && is_array($result)){
             foreach($additionalEmailId as $additionalEmail):
                 $result[] = (string) $additionalEmail;
             endforeach;
             return $result;
         }else{
             return $additionalEmailId;
         }
     }
 }
 }
  }


texts: Magento 2: Add custom filter to existent GraphQL products query

texts:
I'm developing a headless solution using Magento as a product catalogue and i'm facing a small challenge (i'm pretty sure that is not challenging at all, for people that have experience with Magento framework, that is not my case). I'm using the 2.3.3 version of Magento btw.

I have to add a custom filter to the existent GraphQL products query (store_id, that represents the website id in Magento) and i'm a bit lost on how to implement that.

Basically i will have multiple stores created (e.g Portugal, United Kingdom) in Magento and i want to retrieve for example only the products that belongs to the Portugal Store (that is given by this new store_id filter). Can anyone help me?

I have seen this solution somewhere: http://www.mujahidh.com/how-to-filter-product-collection-with-default-graphql-products-query/

But it doesn't work at all for me, the products query is returning an Internal error and after some debugging i have found this error: Warning: Invalid argument supplied for foreach() in magento2\lib\internal\Magento\Framework\GraphQl\Query\Resolver\Argument\AstConverter.php

Any ideas on how to overcome that? What am i missing?

Thanks in advance.


texts: Paypal orders go to complete instead of processing

texts:
I have written to Paypal, but they won't answer me.

So the problem is that when we receive an order paid with Paypal, some of those go straight to complete, but they used to go to processing.

Magento 1.9.3.9.
Somebody suggested to change the Paypal settings so that Payment Action would be not "Sale" like we have,

but "Authorize", but that would mean we would have to do handwork and
 log in to Paypal every morning and capture the amounts ourselves.

That's not a solution though. Has anyone else experienced it?


texts: magento simple popup when create order from admin

texts:
I just want to show a simple popup in admin when create order if the customer has VAT

please help me on this

thanks


texts: Updating minimum order quantity (Front End View)

texts:
I am trying to change the 'Minimum order quantity' on the front end because it currently displays '0'.

All simple and configurable products currently display 0. I have gone into the attributes of each product in the admin dashboard and tried changing it that way. What i changed was:

Catalogue -> Manage Products -> (Product 1 - Edit Attribute) -> Inventory > Changing 'Minimum Qty Allowed in Shopping Basket' to 1.

However this does not solve the problem and update the minimum order quantity on the front end.

How can i fix this so it displays '1' on the front end.


texts: Magento Catalog : How to add button or link bellow any field in product add/edit page

texts:
Like attached screenshot, I want to add Get Next Sku link how to do same does anyone have an idea ? on the same link I want to perform some ajax operation and get some formated SKU but I don't know how to add link bellow SKU textbox.

any help appreciate .. thanks


texts: Enable memcached, inside which tag local.xml

texts:
first of all I beg your pardon for my lack of knowledge about this argument, everything I have done is from some merged tutorial.
I'm trying to enable memcache:

<cache>
        <slow_backend>File</slow_backend>
        <slow_backend_store_data>0</slow_backend_store_data>
        <fast_backend>memcached</fast_backend>
        <fast_backend_options>
            <servers>
                <server>
                    <host><![CDATA[127.0.0.1]]></host>
                    <port><![CDATA[20012]]></port>
                    <persistent><![CDATA[1]]></persistent>
                </server>
            </servers>
        </fast_backend_options>

        <backend>memcached</backend>
        <memcached>
            <servers>
                <server>
                    <host><![CDATA[127.0.0.1]]></host>
                    <port><![CDATA[20012]]></port>
                    <persistent><![CDATA[1]]></persistent>
                </server>
            </servers>
            <compression><![CDATA[0]]></compression>
            <cache_dir><![CDATA[]]></cache_dir>
            <hashed_directory_level><![CDATA[]]></hashed_directory_level>
            <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
            <file_name_prefix><![CDATA[]]></file_name_prefix>
        </memcached>
    </cache>

The problem is that Siteground says to place this code just before the closing </config> tag, but almost every other tutrial says to place it inside the <global> tag, plus my full page cache plugin detects memcached only if it's placed inside the <global> tag.
How do I know which one is correct?


texts: magento 2 cloudfront xhr html template files not loading

texts:
I have created an Amazon CloudFront distribution and updated CloudFront URL to pub/static and pub/media URLs to be fetched from CloudFront.
JS, CSS and Images are working fine with CloudFront but xhr HTML template files not loading through CloudFront URL. It is showing 403 forbidden in the console but when I open the same URL in browser it works fine.
I checked request header and it contains following two headers.

Access-Control-Request-Method: GET
Access-Control-Request-Headers:x-requested-with

I think this is something that is responsible for my problem.
Anyone has any suggestions how do I resolve this. I am running my M2 website on Apache server.

Thanks


texts: Add product to wishlist programmatically not working

texts:
I am trying to add products from the admin create order screen straight into the users wishlist programmatically however it doesn't seem to be working.

$quote = Mage::getSingleton('adminhtml/session_quote');
$currentQuote = $quote->getQuote();
$customer = $currentQuote->getCustomer();

$items = $currentQuote->getAllVisibleItems();

$wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer->getId(), true);
Mage::register('wishlist', $wishlist);

foreach ($items as $item)
{
    $productId = $item->getProductId();
    $product = Mage::getModel('catalog/product')->load($productId);
        $buyRequest = $item->getBuyRequest();
        $result = $wishlist->addNewItem($product, $buyRequest);

    if(is_string($result))
    {
        Mage::throwException($result);
    }
    $wishlist->save();

    Mage::dispatchEvent(
            'wishlist_add_product',
            array(
                'wishlist' => $wishlist,
                'product' => $product,
                'item' => $result
            )
        );

        Mage::helper('wishlist')->calculate();
}

Mage::getSingleton('core/session')->addSuccess("Quote sent successfully to customer!");

Mage::app()->getResponse()->setRedirect(Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/index'));

I'm not to sure what is going on. I am getting no errors in the log or exceptions being thrown however no products end up in the customer's wishlist.


texts: How to add 2 button in magento's admin - System, Configuration?

texts:
I have already added button in System, Configuration. I want one more button in that tool but not able to do so.

Now two button is displayed but problem is both is calling same function. Both button have same id. Can anyone please suggest?

In config.xml

            0.0.1

                Product_Price_Helper

                Product_Price_Block

                        Product_Price

                        Lowest_Quality_Price

                    Allow Everything

                                            Product Price Settings

                                            Lowest Price Settings

In system.xml

                            Update Price
                            button
                            productprice/adminhtml_system_config_form_button
                            21
                            1
                            1
                            1

                            Update Lowest Quality Price
                            button
                            productprice/adminhtml_system_config_form_button
                            22
                            1
                            1
                            1

            Manage Product Price
            99999

            Update Price
            product
            text
            99999
            1
            1
            1

                    Tools
                    3
                    1
                    1
                    1

                    <button translate="label">
                        Update Price
                        <frontend_type>button</frontend_type>
                        <frontend_model>productprice/adminhtml_system_config_form_button</frontend_model>
                        <sort_order>21</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </button>
                    <lowest_button translate="label">
                        Update Lowest Quality Price
                        <frontend_type>button</frontend_type>
                        <frontend_model>productprice/adminhtml_system_config_form_button</frontend_model>
                        <sort_order>22</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </lowest_button>
                </fields>
            </tools>
        </groups>
    </productprice>
</sections>


texts: Custom block on product view page is not rendered

texts:
I have to add a panel into the frontend's product view page. Originally, I will find the full action name of the product page, which is catalog_product_view in this case, and add a handler which reference to the panel's block later. However, something really strange is happening, as Magento only look for configurable products to add the panel:

Not with the simple products:

Here's the code for that:

$fullActionName = $observer->getEvent()->getFullActionName();
$layout = $observer->getEvent()->getLayout();
$option_wrapper = $layout->getBlock('product.info.options.wrapper');
$handler = '';
if ( $fullActionName == 'catalog_product_view') {
    $handler = 'catalog_product_view_handler';
}
if ($handler)  $layout->getUpdate()->addHandle($handler);

I'm pretty sure my solution is right. How could this happen?


texts: how to find class or interface which plugin will work on

texts:
hie, i am very very new to Magento development.
I am trying to make a plugin for a check out process. One of the steps is to create a di.xml file which indicates the class or interface to be observed. I am lost as to where i can actualy find this information (observed type). Where is the class of interface that does the checkout(example), how do i find it?. Do l search through all the modules in the magento vendor folder until i find something?
config
type name="{ObservedType}">
plugin name="{pluginName}" type="{PluginClassName}" sortOrder="1" disabled="false" />

your assistance would be greatly appreciated


texts: Category active product count on category list

texts:
I am trying to display number of products in in each category..
and using this code to display all subcategory of category id:3
It is showing but it is counting not visible and disable product also,

<?php
    $cats = Mage::getModel('catalog/category')->load(3)->getChildrenCategories();
?>

    <?php foreach($cats as $category): ?>

         <a href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?>(<?php echo $category->getProductCount(); ?>)

    <?php endforeach; ?>

Is there any good solution so that i can get exact count thats are visible-catalog search and active.

thanks


texts: Adding AMP JS library to Magento using XML

texts:
Requirements:
Add

<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>

to the head of the page

Problem:
JS library needs to be loaded on specific pages only, so we can't just load it to the head.phtml

Method tried to solve: Using XML to load it into the layout:

<reference name="head">
    <action method="addJs">
        <script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
    </action>
</reference>

Error: Invalid XML

Any idea of how to add the tag and keep custom-element="amp-carousel" using XML?


texts: Add customer groups in Magento 2 programically

texts:
Change customer group based on how many orders they've done.
Silver 1-4 orders
Gold 5-6 orders
Emerald >10 orders
You need to add those groups to Magento(programmatically) and ensure that every placed by customer checks if he meets conditions to go into another group. Bear in min that only completed
orders are taken into consideration here, so any customer can be downgraded to the correct tier if it is possible.
This should be created using a patch.


texts: how to place custom text in customer form adminhtml

texts:
I want to place custom text in 'adminhtml_customer_edit' before the 'personal Information' section.

For this i have wrote
etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <VLC_DynamicsNAV>
            <version>0.0.1</version>
        </VLC_DynamicsNAV>
    </modules>
    <global>
        <blocks>
            <dynamicsnav>
                <class>VLC_DynamicsNAV_Block</class>
            </dynamicsnav>
        </blocks>
    </global>
    <adminhtml>
        <layout>
            <updates>
                <dynamicsnav>
                    <file>dynamicsnav.xml</file>
                </dynamicsnav>
            </updates>
        </layout>
    </adminhtml>
</config>

VLC_DynamicsNAV.xml

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

adminhtml\default\default\layout\dynamicsnav.xml

<?xml version="1.0" ?>
<layout>
        <adminhtml_customer_edit>
            <reference name="customer_edit_tabs">
                <block type="dynamicsnav/customerbtn" name="customer.nav.button"
                       template="dynamicsnav/customer.phtml"
                       before="customer_edit_tab_view"/>
            </reference>
        </adminhtml_customer_edit>
</layout>

and VLC\DynamicsNAV\Block\adminhtml\customerbtn.php

<?php
class VLC_DynamicsNAV_Block_adminhtml_customerbtn extends Mage_Adminhtml_Block_Template
{
}

app\design\adminhtml\default\default\template\dynamicsnav\customer.phtml

WELCOME TO THE NEW WORLD

How to place custom text in customer edit card form in the customer view section before the Personal Information group


texts: Magento 2 : Add category filter in producy grid

texts:
In admin, I want to add column of category and also add category filter in product grid.

How to do this?

Please help me.

Thanks.


texts: A-Z Category Listing Magento 2 Static Block

texts:
I am attempting to create a A-Z category listing within a static block, something like the attached image.

The static block will be on the parent category, and the listing will show the parent categories children.

Can anyone please suggest how I can achieve this in Magento 2?


texts: \Magento\Backend\Model\Session Clear: Magento 2

texts:
In Magento, we could use as $this->_getSession()->clear();

However, in
magento 2 if we use the same thing it throws exception as

  Invalid method Magento\Backend\Model\Session\Interceptor::clear

Is there any way to do this in Magento 2?

I tried to search about this but could not find anything relevant.

Please, can anyone help?


texts: How to delete all products from a large catalog?

texts:
I'm working on importing ~40k products into Magento.  I need an easy way to remove all products in between tests, but trying to do this from the admin errors out before making it very far.

If I try to truncate the table's directly, I encounter a lot of dependencies that prevent the actions.

Is it possible to erase all products without using the admin?


texts: Magento best practices: try / catch in templates

texts:
I have a question about best practices in templates.

Let's assume I am editing the product details template file. I would like to call a method in the product model which can raise an exception.

What is the best way to proceed :

to put the call in a verbose try / catch in the template, displaying the appropriate result in case of success/failure ;

try {
    echo $product->getSomething()->getName();
} catch (NoSuchEntityException $ex) {
    echo "No related Something";
} catch (\Exception $ex)) {
    echo "An error occured while extracting the related Something";
}

or creating an intermediate method (in the block ?), handling the try catch and returning and array with the result (if success) and a possible message, to make the template cleaner?

$result = $block->getSomething();
if($result['message'] === "") { // Everything went well
    echo $result['Something']->getName();
} else { // Something went wrong
    echo $result['message'];
}


texts: Why doesn't the cart contain any items when called from REST?

texts:
According to the rest api, calling /V1/carts/mine should return json with

{
  "id": 11,
  "created_at": "2016-04-05 12:02:58",
  ...
  "items": [
    {
      "itemId": 0,
      "sku": "string",
   ...

That is, items should be an array with products. But when I call this endpoint, that attribute is missing. Instead, I get this back:

{
  "id": 11,
  "created_at": "2016-04-05 12:02:58",
  "items_count": 1,
  "items_qty": 58,
  "customer": {
  ...

So, instead of the array, it just gives me items_qty and items_count. Is the docs incorrect, or am I doing something wrong?


texts: Magento admin and customer email notification not sending

texts:
i am getting this error in cron job.

exception 'Mage_Core_Exception' with message 'Too late for the schedule.' in /home/magento FOLDER/public_html/app/Mage.php:595
Stack trace:
#0 /home/melmatcb/public_html/app/code/community/Aoe/Scheduler/Model/Observer.php(47): Mage::throwException('Too late for th...')
#1 /home/melmatcb/public_html/app/code/core/Mage/Core/Model/App.php(1338): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#2 /home/melmatcb/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#3 /home/melmatcb/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#4 /home/melmatcb/public_html/cron.php(76): Mage::dispatchEvent('default')
#5 {main}


texts: magento 2.2.3 Unable to save shipping information. Please check input data

texts:
"Unable to save shipping information. Please check input data"

I am fetching above error on the checkout page in Magento version 2.2.3,
Anyone know what is the solution?


texts:
What is the mistake in my parameter?

protected function _construct()
{
     $this->_init("sync/queue", "id");
}

My sync/queue ->
I get

  Warning: array_values() expects parameter 1 to be array, object given
  in
  C:\xampp\htdocs\magento2x_2\lib\internal\Magento\Framework\Interception\Interceptor.php
  on line 146


texts: How to Override 3rd party module requirejs-config.js film in my custom module?

texts:
The above one is the 3rd party module's require-config.js. It contains the js file inside the adminhtml/web/js. I want to override that.

So I created a custom module and made changes in the require-config.js like below.

But it is not overriding the original js file of that 3rd party module. I also put the module as a sequence like below.

<module name="Override_Barcode" schema_version="1.0.1" setup_version="1.0.1" >
    <sequence>

        <module name="BoostMyShop_BarcodeInventory"/>

    </sequence>
</module>

Please help me with this.


texts:
I have a german store, therefore we must calculate 19% tax on every product. I've setup every settings to ensure that would happen, but for any reason only 15.97% are calculated. Please take a look at the images below, maybe you guys find something i havent seen...
Product price is 100€, so the calculated tax should be 19€, but 15.97€ are displayed as tax on the order summary.
Stores -> Configuration -> Sales -> Tax

Stores -> Tax Rules

Stores -> Tax Zones and Rates

EDIT
After taking a closer look at the tax rate of 15.97 I saw a pattern there, if you substract 19% of 19 you will get 15.966 which gehts rounded by magento to 15.97, so my tax rate gets taxed for some reason, anyone know how to fix it?


texts: Magento 2 - Category List Sort by Position with Sub Category Not Working

texts:
A little background, I'm trying to do a custom Category listing, but at the moment it seems the Category not being sort as I seen on Admin.
Here's the code that I've done so far
        $current_store = $this->_storeManager->getStore();

        $root_category_id = $this->_storeManager->getStore()->getRootCategoryId();

        $collection = $this->_categoryCollectionFactory->create()
                    ->addAttributeToSelect('*')
                    ->addAttributeToFilter('is_active', 1)
                    ->setStore($current_store);

        return $collection->addAttributeToFilter('entity_id', array('nin' => $root_category_id))
                            ->setOrder('position','ASC');

And the result, when I tried to echo its ID is like below
3
10
4
11
5
7
12
8
15
9
13
14
16
6

But, from the Admin, it doesn't reflect the order correctly, below is the figure

The problem that I realize is, that, I have sub category, I tried to echo the query from above code, and then copy-paste it into sql GUI, and I realize, the position is kinda weird but, it does make-sense, because it's a sub category.
Here's the result when I execute the query on sql GUI

So, what I tried to achieve is to sort above result, to reflecting what I set on Admin.
Is there anything that I missed? I'm not sure where to look, since I've been stuck around 1-2 days, not sure what's the proper keyword, almost all keyword I did will arrive to product sort or kind of that, not category sort
Thanks in Advance!


texts:
I want to overwrite related product design,I need to show greed except of related
product below product detail page here is related product image but I need to show greed there so  what should I do ?

I have used core layout in my custom module layout and edited it like.

--> catalog_product_view.xml

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="mage/gallery/gallery.css"/>
</head>
<body>
    <referenceContainer name="content.aside">
        <block class="Ktpl\Relatedprod\Block\Relatedprod" name="catalog.product.relatedadd" template="Ktpl_Relatedprod::items.phtml">
            <arguments>
                <argument name="typeadd" xsi:type="string">related</argument>
            </arguments>
        </block>
    </referenceContainer>
</body>

But the problem is I am unable to overwrite it.


texts:
My Magento 1.9 store use 2 kinds of bundle items.

Some items use dynamic pricing which mean the pricing is adding up based on the clients selection.

I also have fixed price bundle, where there is a special pricing for a selection of item ( required items) with possibility to add fixed price add-on (not required options.)

Everything was working perfectly until I started using Onesaas to import transactions into Quickbooks.

Onesaas is only able to import either fixed or dynamic pricing but not both. It will import only options or only fixed price but will not calculate a mix of both correctly.

I could change my fixed price bundles into dynamic  with a %discount but i don't want the customer to see the option price on that specific option.  But option I need to be able to still see the price to the "not required" option on the same listing.

Long story short is there any way to hide the option pricing on required options while keeping it visible for non-required options within the same listing.


texts: magento 2 add static block on category page left sidebar only

texts:
I have override Module-Catalog into my theme's folder.

I want to add custom blocks in category sidebar. so in catalog_category_View.xml file i have added following code which works if i put it in default.xml file but it doesn't work for catalog_category_view.xml file.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="sidebar.additional">
            <block class="Magento\Cms\Block\Block" name="top_left_sidebar">
                <arguments>
                    <argument name="block_id" xsi:type="string">top_left_sidebar</argument>
                </arguments>
            </block>
        </referenceContainer>
    </body>
</page>

I want to show that block for category page left column only.   How can i do that?


texts: "Enter" from keyboard on "Log-in" button doesn't work

texts:
During the check-out logging-in procedure, pressing "Enter" from keyboard (after entering account details) does not log-in while it works if clicking with the mouse on the button.

What could be the problem?

Here the phtml :

Login

    <form id="login-form" action="/customer/account/loginPost/" method="post">
        <fieldset>
            <input name="form_key" type="hidden" value="" />

Already registered?

Please log in below:

                        Email Address*

                        <input name="login[username]" value="" id="email" class="input-text required-entry-email validate-email" title="Email Address" type="text">

                        Password*

                        <input name="login[password]" class="input-text required-entry-password validate-password" id="pass" title="Password" type="password">

            <input name="context" type="hidden" value="checkout" />
        </fieldset>
    </form>

* Required Fields

        <button type="submit" class="button login" onclick="onepageLogin(this)">Login</button>
        Forgot your password?

And here the JavaScript :

var loginForm = new VarienForm('login-form', true);
$('login-email').observe('keypress', bindLoginPost);
$('login-password').observe('keypress', bindLoginPost);
function bindLoginPost(evt){
    if (evt.keyCode == Event.KEY_RETURN) {
        loginForm.submit();
    }
}
function onepageLogin(button)
{
    if(loginForm.validator && loginForm.validator.validate()){
        button.disabled = true;
        loginForm.submit();
    }
}


texts: When Magento reserve stock in Paypal payment?

texts:
It's a bit of imaginary situation and I think it's not that common  but can happens and today someone asked me about that and I got curious but I have no easy way atm to test this so I thought in asking might someone already have tested.
But the situation, imagine that you add a product that has 1 stock to the cart, you go to checkout and open the paypal window, in this point your order don't exist but you're already in paypal ready to pay, bu as far as I know the product is only reserved if the order exists and is in pending payment, thing that does not happens in paypal, so imagine that someone in the mean time that you are in paypal preparing your payment, bought that last stock that is not reserved because you didn't finished the order, you pay but the stock it's at 0 when the payment goes in, what happens in this case?
it might be confuse so in topics:
1- add a 1 stock product to cart
2- go to checkout and go to the paypal page to pay
3- other person bought that last stock and now that product has 0 stock
4- finish the payment
5- what happens? order created with a 0 stock product?
Thanks, hope it's understandable the situation :D


texts: add new extension attribute to the response of quote item (/V1/carts/:cartId)

texts:
I am trying to add some custom extension_extributes (For example: is_free_product & unit_price) to item node response of Magento\Quote\Model\QuoteRepository::get($cartId)

Here is what I tried so far

1. Added extension_attributes
File app/code/MagePsycho/WebService/etc/extension_attributes.xml

<extension_attributes for="Magento\Quote\Api\Data\CartItemInterface">
        <attribute code="is_free_product" type="int" />
        <attribute code="unit_price" type="float" />
    </extension_attributes>

2. Added plugin configuration
File app/code/MagePsycho/WebService/etc/di.xml

...
<type name="Magento\Quote\Model\QuoteRepository">
        <plugin name="CtvPluginQuoteRepository" type="Ctv\WebService\Plugin\Webapi\QuoteRepository"/>
    </type>
...

3. Added plugin class
File app/code/MagePsycho/WebService/Plugin/QuoteRepository.php

<?php

namespace MagePsycho\WebService\Plugin;

use Magento\Quote\Model\Quote;

/**
 * @category   MagePsycho
 * @package    MagePsycho_WebService
 * @author     Raj KB <magepsycho@gmail.com>
 * @website    http://www.magepsycho.com
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
class QuoteRepository
{
    /**
     * Update quote with custom fields
     *
     * @param \Magento\Quote\Model\QuoteRepository $subject
     * @param callable $proceed
     * @param int $cartId
     * @return \Magento\Quote\Model\Quote
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function aroundGet(
        \Magento\Quote\Model\QuoteRepository $subject,
        \Closure $proceed,
        $cartId
    ) {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $proceed($cartId);

        if ($quote && $quoteItems = $quote->getItems()) {
            $baseToQuoteRate = $quote->getBaseToQuoteRate();
            $quoteItemObjects = [];
            foreach ($quoteItems as $quoteItem) {
                $extensionAttributes = $quoteItem->getExtensionAttributes();

                if ($extensionAttributes === null) {
                    $extensionAttributes = $this->getQuoteItemExtensionDependency();
                }

                // is_free_product
                $isFreeProduct = (int) $quoteItem->getIsFreeProduct();
                $extensionAttributes->setIsFreeProduct($isFreeProduct);

                // unit_price
                $unitPrice  = (float) number_format($baseToQuoteRate * $quoteItem->getPrice(), 4, '.', '');
                $extensionAttributes->setUnitPrice($unitPrice);

                $quoteItem->setExtensionAttributes($extensionAttributes);
                $quoteItemObjects[] = $quoteItem;
            }
            $quote->setItems($quoteItemObjects);
        }

        return $quote;
    }

    private function getQuoteItemExtensionDependency()
    {
        $quoteItemExtension = \Magento\Framework\App\ObjectManager::getInstance()->get(
            '\Magento\Quote\Api\Data\CartItemExtension'
        );
        return $quoteItemExtension;
    }
}

But in the response, Always get as 0 value for both unitPrice & isFreeProduct.


texts: Magento 2 - Set flat shipping price independent of currency

texts:
USD is the base currency in my store. However, I'm in need of setting a flat shipping rate in a different currency.

And, if I do a conversion of shipping rate to work in USD, every time I set a different conversion rate it'll vary, which is not what I intend to do.

How can I set a "hardcoded" shipping rate that doesn't take into account base currency and calculates shipping rate in different currency, making checkout calculation correct?

Thanks!


texts: Want to add checkbox field in checkout page

texts: I want to add checkbox field on checkout page when i click on it an extra fee is added.


texts: Magento 2.1.9 upgrade to 2.2.0 - Error on setup:upgrade with Magento_Sales table

texts:
Upgrading magento from 2.1.9 to 2.2.0 and during the automatic bin/magento setup:upgrade process it runs all upgrades fine until it reaches the magento_sales table where it produces this error.

There are around another 500 id's within the error but I have removed them for the purpose of keeping the post short.

I had migrated sales, customer, product data from our Magento Enterprise existing live site to magento 2.1 but not had this issue when doing subsequent updates.

Module Magento_Widget:

Module Magento_Sales:

  Upgrading data.. Error converting field product_options in table sales_order_item where item_id= 2, 3, 5, 7, 10, 13, 17, 21, 26, 43, 46, 48, 69, 70, 71, 76, 81, 82, 91, 98, 101, 105, 108, 111, 116, 117, 122, 123, 127, 131, 135, 139, 141, 144, 145, 154, 164, 166, 171, 172, 173, 7659, 7660, 7671, 7672, 7681 using Magento\Sales\Setup\SerializedDataConverter.
  Fix data or replace with a valid value.

Failure reason: 'Unable to unserialize value.'

Any information on how to resolve would be much appreciated


texts: include/require php file within phtml template file

texts:
In one of my magento template phtml files I am trying to include a seperate php file.
When I include it I get nothing outputted and when i use require instead I get the following error

Fatal error: require(): Failed opening required 'http://www.site.co.uk/dir/test.php'
(include_path='/home/usr/public_html/app/code/local:/home/usr/public_html/app/code/community:/home/usr/public_html/app/code/core:/home/usr/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/usr/public_html/app/design/frontend/theme/edits/template/review/product/view/list.phtml on line 30

The first line of the error shows the correct url path and when i go to it directly it works - it just doesn't like being included/required from the phtml template page.

I've tried the following in the phtml file (using magento's BaseURL, absolute path and the relative path):

<?php
$root = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
require/include ($root.'dir/test.php');
?>

<?php
require/include ('http://www.site.co.uk/dir/test.php');
?>

<?php
require/include ('../../../../../../../../../dir/test.php');
?>


texts: How to add breadcrumbs on cart page in magento2?

texts:
I want to add breadcrumbs to the shopping cart page before the page title like this:

How can I achieve this.?

Thanks..!


texts: PageFactory Error with Hello World, Interceptor.php

texts:
Working on the Hello World example here:
alanstorm.com/magento_2_mvvm_mvc

I'm on the "Passing off to the View" step but I get an error with the World.php file when I refresh the page as instructed:

My world.php file is cut & pasted from the example.

The error mentions a "Interceptor.php" but there is no file by that name in the folder the error mentions.

Please advise and thanks.


texts: URL Rewrite Management showing thousands of auto generated re-directs

texts:
I've just started a new job with a company who are using Magento for their ecommerce store (ver. 1.8.1.0)

I've noticed in their Google Analytics account that they have traffic hitting what looks like a ton of duplicate product pages. The urls look like this:

  /productA-name.html
  /productA-name-218.html
  /productA-name-214.html
  /sub-category/productA-name-214.html
  etc

For just one of our product pages, there are 50 of these pages being reported in Google Analytics over a 8 month period.

Now I'm only just getting to grips with Magento, but I decided to look in there to see if I could find anything that looked out of place.

Under Catalog > URL Rewrite management there are a total of 40986 records found.
Most of these seem to be autogenerated and are product pages with these sequential numbers redirecting to each other.

i.e.

  /productA-name-218.html to /productA-name-219.html
  /productA-name-217.html to /productA-name-218.html

The site was launched in October of last year and we have just under 400 product lines.

I'm guessing this is not supposed to be happening.
Also would these 40k redirects have a negative impact on the speed performance of our website?

Could really do with knowing if this is a big issue for us and if possible is there an easy fix for this.


texts: Product name and order shippment method, on the order grid

texts:
I'm trying to add the Product Name, Product SKU, and Order shipment method, to the Sales Order Grid.

this is how my function looks:

protected function _prepareCollection()
{
    echo $collection = Mage::getResourceModel($this->_getCollectionClass())
    ->join(
            'sales/order_item',
            '`sales/order_item`.order_id=`main_table`.entity_id',
            array(
                    'skus'  => new Zend_Db_Expr('group_concat(`sales/order_item`.sku SEPARATOR ",")'),
                    'names' => new Zend_Db_Expr('group_concat(`sales/order_item`.name SEPARATOR ",")'),
            )
    )
    ->join(
            'sales/order',
            '`sales/order`.entity_id=`main_table`.entity_id',
            array(
                    'shipping_description' => 'shipping_description'
            )
    );
    echo $collection->getSelect();
    $collection->getSelect()->group('entity_id');
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

but this gives this error:

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'entity_id' in-group statement is ambiguous

Probably because there are two entitity_ids in the main_table.

Is there a way to fix this?


texts: wrong tracking code for Google Analytics?

texts:
I use Magento 1.9.1.0. I enabled the Google API under System - Configuration - SALES - Google API by entering the Account Number. I have 2 stores (2 different domains selling different products).

Now - I get the following in my Google Analytics:

In Google Analytics under Reporting it says:

  ! Destination URLs Not Tagged

  Tracking Code Mismatch Destination URL www.thedomain.com/ is tagged
  with tracking code for the wrong property.

I use the same Google Account number for both stores (domains). Is this the problem or what needs to be done to resolve this? Thanks for any suggestions! ;-)


texts:
i want change category and subcategory url level instead of slash change hyphen. please help me

current url:

books/books/philosophy.html

want to change like

books-books-philosophy.html


texts:
Magento 2 Categorty page blank with following error
Fatal error: Uncaught Error: Cannot instantiate interface Magento\InventorySalesApi\Api\StockResolverInterface in /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50 Stack trace: #0 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Invento...')
#1 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Invento...')
#2 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Invento...', NULL, 'stockResolver', 'Amasty\\Shopby\\P...')
#3 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\Facto in /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50


texts: How can I properly trigger shipment emails via the SOAP API?

texts: The shipment functions seem to be flawed such that shipment.create can trigger an email, but the shipment template includes values that cannot be filled in because tracking numbers cannot be added until after the shipment is created. The workaround seems to be using shipment.addcomment and adjusting that template to include the track fields.


texts:
How do i get the amount (sales since the beginning) displayed in  when we go to the customer edit page in the admin section?

I tried getting the amount using :

$total = 0;
$collectionOrders = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('customer_email',$email)
    ->addFieldToFilter('status', array('in'=>array('complete','on hold')));

foreach($collectionOrders as $order){
    $total += $order->getGrandTotal();
}
echo $total."\n";

But the total I get is lower.


texts:
I'm using the contacts module to output different contactforms in different stores in a multishop environment.

I insert my contact form like this:

{{block type="core/template" name="contactForm" template="contacts/form.phtml" form_action="/mycontacts/index/post"}}

I created some transactional email templates, one per store.

In backend I choose different email-templates, one per store.

This all works. And I receive E-Mails.

But here is my problem:

The email I receive has proper subject: the subject I entered in System->transactional emails-> template XY

But the mail body seems to be some other

This is my system email template:

Name:       {{var data.vorname}} {{var data.name}}
Firma:      {{var data.company}

Straße:     {{var data.street}}
Ort:       {{var data.city}}
Land:     {{var data.land}}

E-Mail:     {{var data.email}}
Telefon:    {{var data.telephone}}
Kommentar:  {{var data.comment}}

This is what I receive:

Name:        MyName
Firma:
Ort:       MyCity
Land:

E-Mail:     MyEmail
Telefon:    MyTelephone
Kommentar:  MyComment

How can this be?


texts: I want to create observer in magento1.9. I have a optional attribute for customer in option block cod and block list customer for place order.if get in option block cod then customer could not order cod and option block list then customer couldn't any order. I'm new in Magento


texts: Error during accessed localhost site access by another system

texts:
I can't accessed my developing localhost site by another system.

I get error like,

php error :

  [08-Jul-2016 04:51:03 UTC] PHP Warning:  Module 'ionCube Loader'
   already loaded in Unknown on line 0

Apache error :

  [Fri Jul 08 09:55:47.696504 2016] [core:warn] [pid 3920:tid 264]
   AH00098: pid file C:/wamp/bin/apache/apache2.4.9/logs/httpd.pid
   overwritten -- Unclean shutdown of previous Apache run? [Fri Jul 08
   09:55:47 2016] [warn-ioncube] The ionCube PHP Loader is disabled
   because of startup problems. (pid 3920 th 3352) [Fri Jul 08
   09:55:47.756504 2016] [mpm_winnt:notice] [pid 3920:tid 264] AH00455:
   Apache/2.4.9 (Win32)


texts: Create custom shipping method for creating order programatically

texts:
i've successfully created an order programatically, the problem is i can only use shipping method which already exist like 'flatrate_flatrate' and 'freeshipping_freeshipping' like this:

$this->_shippingMethod = 'flatrate_flatrate';
//or
$this->_shippingMethod = 'freeshipping_freeshipping';

$order->setShippingAddress($shippingAddressModel)
          ->setShippingMethod($this->_shippingMethod);

i want to add shipping with custom shipping price,title, and carrier method title for my order.


texts: Grid view export csv sequence column is empty

texts:
I am using magento 2 and I create sequence row number in grid view by add this column in xml

<column name="no" class="Webkul\Marketplace\Ui\Component\Listing\Column\SequenceNumber">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortable" xsi:type="boolean">false</item>
                <item name="label" xsi:type="string" translate="true">No</item>
                <item name="sortOrder" xsi:type="number">1</item>
            </item>
        </argument>
    </column>

And create class SequenceNumber

public function prepareDataSource(array $dataSource)
{
    if (isset($dataSource['data']['items'])) {
        $count = 1;
        foreach ($dataSource['data']['items'] as & $item) {
            $item[$this->getData('name')] = $count;
            $count += 1;
        }
    }
    return $dataSource;
}

This column can display on grid view but when I export to csv the column (no) is empty. Is there any way to fix that issue or how can export the data with sequence row number?


texts:
I can see below code in file
use Magento\Backend\App\Action;

/**
 * Abstract assignment controller
 */
abstract class Assignment extends Action
{
    /**
     * Authorization level of a basic admin session
     *
     * @see _isAllowed()
     */
    const ADMIN_RESOURCE = 'Vendor_Catalog::import_product_category_assignment';
}

This class is extended by controller
class Index extends Assignment
I am not sure what's the use of "const ADMIN_RESOURCE = 'Vendor_Catalog::import_product_category_assignment';" there


texts: Migrating from Magento 2.0x to 2.1 using Data Migration Tool 2?

texts:
I wanted to setup a fresh Magento 2.1 install on our test / dev server. Can I use the data migration tool 2 to migrate customer / orders / etc ..?

Thanks


texts:
Can anyone tell me the exact meaning of EnvironmentEmulation?

One usecase can be found in Mage_ProductAlert_Model_Email

$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

if ($this->_type == 'price') {
    $this->_getPriceBlock()
        ->setStore($store)
        ->reset();
    foreach ($this->_priceProducts as $product) {
        $product->setCustomerGroupId($this->_customer->getGroupId());
        $this->_getPriceBlock()->addProduct($product);
    }
    $block = $this->_getPriceBlock()->toHtml();
    $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_PRICE_TEMPLATE, $storeId);
} else {
    $this->_getStockBlock()
        ->setStore($store)
        ->reset();
    foreach ($this->_stockProducts as $product) {
        $product->setCustomerGroupId($this->_customer->getGroupId());
        $this->_getStockBlock()->addProduct($product);
    }
    $block = $this->_getStockBlock()->toHtml();
    $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_STOCK_TEMPLATE, $storeId);
}

$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);

My understanding is that everything betweenstartEnvironmentEmulation and stopEnvironmentEmulation is treated as under the storeId that was given as an argument.

But when I look at the example, the templateId takes the storeId directly as an argument. So there would be no need for en emulation here.
Am I right?

So far my only guess is, that there is a function deeper down in one of the methods that get the current store with something like getCurrentStore?

Thanks in advance :)


texts:
I know this is not right question to ask here but still want to discuss here.
Anyone know how to request DB backup of olddays from magento cloud support team. They are saying that magento cloud starter plan has no service that they provide old DB backup. What if I Mistakenly delete some records or cron run by mistakenly?


texts: Magento 2 not able to load phtml file in email template .html file

texts:
I am trying to send an email with dynamic data which is array format.

I have an email template:
NameSpace/modulename/view/adminhtml/email/email_template.html

And the phtml file path is: NameSpace/modulename/view/adminhtml/templates/email/template.phtml

Using this {{block type='core/template' area='adminhtml' template='email/replenish.phtml' }}, I am calling phtml file in the email template.


texts: Magento 2: compile - Class Not_Existing_Class does not exist

texts:
I have below error while I am compiling the Magento Store. it took very long time and finally gave this error.

  php bin/magento setup:di:compile


texts: How getting key of url of backend in frontend?

texts:
I need a blank page to receive a post of ajax and return json.

If I run the code below any page of backend, the link opens a blank page, that set up on my controller and router.

<?php echo Mage::helper('adminhtml')->getUrl('installments/adminhtml_ajax/'); ?>

But if I run into any page of the frontend, the key of the url is not the same and I am directed to the dashboard.

I do not know how to get the correct URL for the frontend, someone would have an idea that works?

Examples:

Backend  = installments/adminhtml_ajax/index/key/000085c50c4882df8a9cae52c8392227/
Frontend = installments/adminhtml_ajax/index/key/99edadac5bc5bb1e2421d3be38db525e/

Routers

<frontend>
    <routers>
        <installments>
            <use>admin</use>
            <args>
                <module>Dexxtz_Installments</module>
                <frontName>installments</frontName>
            </args>
        </installments>
    </routers>
</frontend>
<admin>
    <routers>
        <installments>
            <use>admin</use>
            <args>
                <module>Dexxtz_Installments</module>
                <frontName>installments</frontName>
            </args>
        </installments>
    </routers>
</admin>

Already changed the frontend for standard and nothing has changed.


texts:
XML:

<item name="option">Vendor/Module/Source........</item>
(checkboxset)

  Vendor/Module/Source.........php

toOptionArray()
{
return [
     [
        'value' => 'value', 'label' => 'label'
 ]
]
}

**How I can disabled field checkbox set if value and label == null ?

Or how I can return:**

  return  [    [
      'value' => 'empty',    ] ]
  without this input type='checkbox'

ty


texts: How to remove default magento header from my custom tab - Adminhtml

texts:
I have created two tabs on my own module.

when i try to add content it shows with header, i want to remove this header.

hope anyone suggest some ideas

here i have attached screenshot.

in my Tabs.php i have this function

  protected function _beforeToHtml() {

    $this->addTab('update_bulkpriceupdate', array(
        'label'     => Mage::helper('bulkpriceupdate')->__('Bulk Price Update'),
        'title'     => Mage::helper('bulkpriceupdate')->__('Bulk Price Update'),
        'content'   => $this->getLayout()->createBlock('bulkpriceupdate/adminhtml_form')->toHtml(),
        'active'    => true
    ));

    $this->addTab('select_bulkupdateprice', array(
        'label'     => Mage::helper('bulkpriceupdate')->__('Select Products to Update Price'),
        'title'     => Mage::helper('bulkpriceupdate')->__('Select Products to Update Price'),
        //'content'   => $this->getLayout()->createBlock('bulkpriceupdate/adminhtml_select_grid')->toHtml(),
        'url'       => $this->getUrl('bulkpriceupdate/adminhtml_select/index', array('_current' => true)),
        'class'     => 'ajax'
    ));

    return parent::_beforeToHtml();
}

Updated Question :
i am trying to create a tab with grid.
when click this tab it continues loading with ajax loader an also displaying header like attached screenshot.

anyone already fixed the issue like this.,please suggest me why this header displaying.


texts:
I need to add some elements in the admin menu based on some conditions (custom logic) so I cannot use adminhtml/menu.xml for that. (or can I?)

For example, I need to add inside the products main menu the next structure

Accessories

Accessories type 1
Accessories type 2.
...
Accessories type N.

Numbers 1 to N are dynamic and may come from different extensions that link to the same class.
Is there an event I can hook on? Or some class I can pluginize?


texts:
I want to use CSS from .less file of one theme into another theme phtml file. There are two theme in my Magento 2.3 site.
How can i do this?


texts: Adding custom options, to custom attribute ( Magento 1.9)

texts:
1> I have created a custom attribute with dropdown as "product_brand" from Admin end

2> I want to add values for this option box, from my other module which in named as "brand"

 For e.g. Currently my Brand Module has three values "Reebok", "Armani", "Adidas"

Now when I will add  a new product, I want these values to come in my custom attribute "Product_Brand"

3> I have tried following Upgrade script, by overloading Mage/Catalog in local.

4> This is the code for upgrade script

<?php
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();

$attributeCode = 'product_brand';
$attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $attributeCode);
$count=0;
$_brand = Mage::getModel('brand/brand')->getCollection();
        $brandNames =array();

        foreach ($_brand as $brand) {

            $brandNames[] = $brand->getName();
        }

if($attribute->getId() && $attribute->getFrontendInput()=='select') {
    foreach($_brand as $brand){
        $option['value']['option'.$count][0] = $brand->getName();
        $count++;
    }

    $option['attribute_id'] = $attribute->getId();
    $option['value']        =  $brandNames;
    $installer->addAttributeOption($option);
}

//OR
/*
if($attribute->getId() && $attribute->getFrontendInput()=='select') {
    $option['attribute_id'] = $attribute->getId();
    $option['value']['r'][0] = 'Red';
    $option['value']['b'][1] = 'Black';
    $option['value']['y'][2] = 'Yellow';
    $installer->addAttributeOption($option);
}*/

$installer->endSetup();
?>


texts:
I checked value available in db or not but it's not working

    <?php $id = $this->getRequest()->getParam('id'); ?>
    <?php $mpAssignProductModel=Mage::getModel("mpassignproduct/mpassignproduct")->load($id); ?>
    <?php $_product=Mage::getModel("catalog/product")->load($mpAssignProductModel->getProductId()); ?>

    <?php $sku = $mpAssignProductModel->getsku();?>

*<?php echo $helper->__('Sku')?>

<input type="text" name="sku" id="sku" class="required-entry input-text" value="
<?php
$result = mysql_query("SELECT * FROM marketplace_assignproduct WHERE sku ='$sku'");
if(mysql_num_rows($result) == 1)
{
echo "User exist";
}

else{
echo $mpAssignProductModel->getsku();
}
?>"/>

What is the problem on this


texts: Is there an API to work with CartaSì, in order to make a Magento module to work with CartaSi?

texts:
I need to somehow develop and install CartaSi module for payment, integrated with Magento, so a module that collaborates with CartaSi. Any suggestions on how to do this? I have found only couple of expensive Modules on the internet:
https://www.magentocommerce.com/magento-connect/payment-module-x-pay-cartasi.html and
https://www.magentocommerce.com/magento-connect/modulo-di-pagamento-modulo-key-client-cartasi.html
And those are probably good, but we need to be able to modify and prefereably, develop modules for CartaSi on my own.


texts:
How to delete specific
column in sales order grid in magento2?
I have set enable_comment yes/no configuration in store->configuration.

How to remove the admin grid comment column if i have select enable_comment no
option.

How to do this based on Module configuration setting.

Thanks


texts: I am not getting any interface to add values in attribute properties of while adding new attribute

texts: When adding new attribute to the product and select the option 'multiple select' for the Catalog input type for the store owner. In image, the values section is showing nothing to add new values.


texts: Has anyone implemented Google Pagespeed Module into Magento?

texts: Has anyone installed Google Pagespeed Module into Magento? Is the implementation too hard to do it?


texts: Get current store name in observer method

texts:
I have created Two stores under two websites in my Magento installation

I have tried following code in my observer method,

$store = Mage::app()->getStore();
$name = $store->getName();

but it is not giving me correct store name. It always show first store name while I am on the second store.

I am using checkout_controller_onepage_save_shipping_method event


texts: Magento 2: Send different email templates for Ship, based on Shipping Method chosen

texts:
I am having a dilemma on how to send a different email content when an order is Shipped based on the Shipping Method chosen.

For example:
If there is Delivery / Pick Up / Shipping as shipping methods then:

If Delivery:

"Your order is on the road!"

If Pickup:

"Your order is ready for Pickup!"

If Shipping:

(Default email template with tracking code)

More details:
I am using the FlatRate shipping method for Pickup orders and the Table Rates as Delivery.

Thanks!


texts:
I am having difficulties with wishlist collections, i want them to be more like regular collections of filter like regular collections but this does not seem to be the case. Methods like getSku do not work and therefor my existing templates are not working very will with these collections.

I want to basically convert this (and some other collections) to get wishlist items by category:

public function _getProductCollectionCat($category)
{
    /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
    $collectioncat = $this->_productCollectionFactory->create();

    $collectioncat = $this->_addProductAttributesAndPrices(
        $collectioncat
    )->setPageSize(
        $this->getProductsCount()
    )->setCurPage(
        1
    );

    $collectioncat->getSelect()->join('catalog_product_entity_tier_price as tier', 'price_index.entity_id = tier.entity_id');

    $collectioncat->addCategoryFilter($this->categoryRepository->get($category));

    $collectioncat->addFinalPrice()
          ->addMinimalPrice()
          ->getSelect()
          ->where('tier.all_groups = 0')
          ->where('tier.value < price_index.price');

    return $collectioncat;
}

This however filters by products with a group price i just want to filter by if the product is in the users wishlist. Can i just join a table and filter similarly to how tier prices were filtered above?

Something Like Below:

public function getWishlistProducts() {
    /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */

    $customerId = $this->_customerSession->getCustomer()->getId();
    $wishlistId = $this->_wishlistRepository->create()->loadByCustomerId($customerId, true)->getId();

    $collectioncat = $this->_productCollectionFactory->create();

    $collectioncat = $this->_addProductAttributesAndPrices(
        $collectioncat
    )->setPageSize(
        $this->getProductsCount()
    )->setCurPage(
        1
    );

    $collectioncat->getSelect()->join('wishlist_item as wishlist', 'price_index.entity_id = wishlist.product_id');

    $collectioncat->addCategoryFilter($this->categoryRepository->get($category));

    $collectioncat->addFinalPrice()
          ->addMinimalPrice()
          ->getSelect()
          ->where('wishlist.wishlist_id = ' . $wishlistId);

    return $collectioncat;
}


texts:
We are launching a Magento 2 Website which is taking its inventory from Lightspeed Retail POS in real-time. Many M2 connectors we found (which are new versions of the ones we used on other Magento 1 sites before) seem to be removed from the market or simply do not work.

Anyone has linked the 2 platforms yet? Any tips? Or should we just convert our site to M1 for a few months?


texts: Generate product description from 2 different storeviews

texts:
We use magento 1.8.1

I already have 3 different storeviews in 3 different languages.

Now I would like to have a 4th storeview, but with the product description of storeview 1 and 2 combined together.

This new storeview is going to be used for displaying items in a app.
And I can't change the code of that.

We have over 13000 sku in our store, so manually doing this isn't an option.

Is there a way to automatically do this? This could also be done on the items which are visible and Searchable. (Around 2000sku)

Resumé
What i would like to have, in magento backend (not front end)

Description storeview 1 (Code: nl) (also standard scope)
and
description storeview 2 (Code: en)
copied and merged to the new storeview 4 (dutch + english combined, Code: mobile)

Does anyone have a solution for this? Can i do this in sql? Or has anyone an other solution?

EDIT 28-05-2016:
The script blow works great, but now i want to only do this with products with an product id of 25000 and newer.
How to do that?


texts:
Is it a bug in Magento 1.9.3.2 ?

I found this function in downloader\lib\Mage\HTTP\Client\Curl.php

/**
 * Set curl options array directly
 * @param array $array
 */
protected function curlOptions($array)
{
    curl_setopt_array($this->_ch, $arr);
}

Guessing $arr is undefined and should be $array


texts: Add animation to product tabs (or any jquery widget)

texts:
How would you add animation to product tabs in magento2?

i tried following the guide here:
http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/widgets/widget_tabs.html#fedg_tabs_options-animate
, but it doesn't include any examples.

The product/view/details.phtml looks like this:

    <?php foreach ($detailedInfoGroup as $name):?>
        <?php
            $html = $layout->renderElement($name);
            if (!trim($html)) {
                continue;
            }
            $alias = $layout->getElementAlias($name);
            $label = $block->getChildData($alias, 'title');
        ?>
        <div class="data item title"
             aria-labeledby="tab-label-<?php /* @escapeNotVerified */ echo $alias;?>-title"
             data-role="collapsible" id="tab-label-<?php /* @escapeNotVerified */ echo $alias;?>">
            <a class="data switch"
               tabindex="-1"
               data-toggle="switch"
               href="#<?php /* @escapeNotVerified */ echo $alias; ?>"
               id="tab-label-<?php /* @escapeNotVerified */ echo $alias;?>-title">
                <?php /* @escapeNotVerified */ echo $label; ?>

        <div class="data item content" id="<?php /* @escapeNotVerified */ echo $alias; ?>" data-role="content">
            <?php /* @escapeNotVerified */ echo $html; ?>

    <?php endforeach;?>

I tried adding data-mage-init='{"collapsible":{ "active": false, "animate": {"easing": "easeInOutElastic"}, "collapsible": true}}' but it didn't work (all elements were visible at the same time).

The html is like this:

                        Description

And also is it possible to change the animation depending window size? For mobile you would want it to slide up/down, but for desktop you want a fade in/out effect because the tabs are next to each other.


texts: How to create duplicate Product programmatically in magento2?

texts:
I want to duplicate product using product id programmatically. I have checked it but not found any useful solution for it.

Basically, in product details page one button near by "Add to cart" button and when I click it then current product duplicate in store. If product is configure that selected attributes associate product duplicate.

I got associate product Id when I click on button. Also I create simple product using Product id But problem is i can't Add some static attribute. I got only selected attributes value.

I want to clone product of selected associate product. Also after clone I want to change quantity as well as sku.

How to do it?


texts: What is Extension Attribute in Magento2? Why use this.


texts: Connect manager not working at all - Magento 1

texts:
I have a very serious issue with Magento Connect Manager.

I can able to login in my connect manager. It's not giving me any kind of error, even if I use wrong username and password. It's just simply redirecting me here:

https://www.domain.com/downloader/index.php?A=#

I tried to check the system.log but nothing over there. I also tried to place a fresh copy of the downloader, but it didn't work.

Please someone suggest me something.


texts: How to deploy DB changes from dev to production in Magento

texts:
I am aware that modules have install and data setup scripts to make the DB portable from dev to production.

But in our case we have UI developers who add attributes and products through the admin interface which gets stored in the development DB.

On release day, we can't repeat all the steps we made in the dev environment, since it will be too tedious and time consuming.

Is there a way to handle such DB changes when deploying.

For now we are performing a diff between the dev DB and prod DB and generating a SQL which gets run on release day. But this is little dangerous since the dev DB might contain test transactional data and we can end up locking transactional tables in prod if our SQL has any statements modifying transactional tables.

Is there best practice around this? Thanks for the help in advance


texts: Call custom block on Success Page Magento

texts:
I need to call a custom block on success page

I have tried by layout as mention below

   <checkout_onepage_success translate="label">
        <reference name="content">
            <block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml" >
                <block type="core/template" name="birthday" template="checkout/message/birthday.phtml"/>
            </block>
        </reference>
    </checkout_onepage_success>

In success page

echo $this->getChildHtml('birthday');

I am getting birthday block twice on the page.

Please let me know how we can call custom block on success page.

I don't want to use dynamic block i.e.

echo $this->getLayout()->createBlock('core/template')
->setTemplate('checkout/message/birthday.phtml')->toHtml();


texts: set shipping cost by heaviest product @ CE 1.9.2.1

texts:
we use a product-configurator for some products. There you can set the height  and weight of pvc-banners. Now is the problem to calculate the shipping cost by the length. The configurator set the "short site" from the pvc-banners at row-weight @ sales_flat_quote_item. thats fine!

now its the problem for me to set the shippingcost by the "heaviest" or better by the longest product.

if i have one product in the cart the shipping cost corect. if i edit the quantity - it`s fine - i modified some files for this.

If i have more than 1 product in the cart the weight1 is add to weight2.

for this i have add a module - but since last update it dosn`t work.

more details:

../app/code/local/Mage/Bannership/etc/config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mage_Bannership>
            <version>0.2.0</version>
        </Mage_Bannership>
    </modules>
    <global>
        <models>
            <bannership>
                <class>Mage_Bannership_Model</class>
            </bannership>
            <core>
                <rewrite>
                    <shipping>
                        Mage_Bannership_Model_Shipping
                    </shipping>
                </rewrite>
            </core>
        </models>
    </global>
</config>

../app/code/local/Mage/Bannership/Model/Shipping.php:

class Mage_Bannership_Model_Shipping extends Mage_Shipping_Model_Shipping {

    public function collectRates(Mage_Shipping_Model_Rate_Request $request) {
        $maxWeight = 0;
        foreach($request->getAllItems() as $item) {
            $maxWeight = max($maxWeight, $item->getRowWeight());
        }
        $request->setPackageWeight($maxWeight);

        return parent::collectRates($request);
    }
}

How can I fix that?


texts: Transparency resizing Magento 1 Configurable Swatches

texts:
Trying to make swatches transperant. Right now when swatches get resized, they get a black background. I found this file app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php with the following code inside:

if (!is_null($image)) {
    $filename = $image->getFile();
    $swatchImage = $this->_resizeSwatchImage($filename, 'product', $width, $height);
    $swatchType = 'product';
    $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . $swatchImage;
}

return $url;

Is it possible to change this code to keep the transperancy? Thanks. (using Magento 1.9.3.3)

Note: This isn't the same issue as the app/code/core/Mage/Core/Model/File/Validator/Image.php file, where product images were getting black backgrounds discussed at Watermark get black background when transparent.


texts: I have tried some free testimonial from marketplace.magento.com but none of them are working properly. Also searched in other places like github. Could you please let us know a good free magento 2 testimonial with good review?


texts: Mage 2 Headless w/ Angular - Architecture Questions

texts:
building a new site using Angular front-end and Mage 2 headless in back-end. Idea is to get all needed data via AJAX calls from Angular to Mage 2 using the REST API...

First time doing this, trying to wrap my head around the architecture...

Questions:

(1) is there a specific setting to put Magento into "headless" mode ?

(2) should I remove all default front-end themes and controllers to not trigger them by accident and since they are not being used anyways... ?

(3) how would I merge Angular and Mage 2 in prod ?

Angular after built will be a .html file with a bunch of .js files and .css files... should I simply put Mage 2 in a separate folder and simply target that folder for all API calls ?


texts: How to downgrade Magento 2.3.3 to Magento 2.3.1 or 2.3.2

texts: I have upgraded my Magento from 2.2.7 to 2.3.3. But now, my Magento has so many issues. Is there any way to downgrade Magento 2.3.3 to 2.3.1 or 2.3.2?


texts: What are the non-obvious maintenance tasks that need to be done on a Magento site?

texts:
There are a few things that need to be done to keep a Mage install clean:

error log checking
log rotation
var/report rotation
clearing out no-longer-used images
applying security patches
component updates

I'm sure there are other things that are a good idea, what else is there?


texts: How to disable attach file email in magento 1.x

texts: i want disable attach file email, after checkout, there will be email sent to customers, and attached pdf invoice file. Is there any way to turn it off? Please help me how to find it, i can't find it


texts: override in cart page in the custom module in the magento 2 is not work?

texts:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance dc" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="checkout.cart">
        <action method="setTemplate">
           <argument name="template" xsi:type="string">Ocodewire_Designtool::cart.phtml</argument>
        </action>
    </referenceBlock>
</page>


texts: Adding top.links to new header container magento 2

texts:
I've added a new reference container inside of:

  Magento_Theme/layout/default.xml

Here is my code for adding the new container:

<referenceContainer name="header.container">
    <!-- remove the header panel wrapper -->
    <container name="header.panel.wrapper" remove="true" />
    <!-- Add new container -->
    <container name="header.inner" as="header_inner" label="Page Header Inner" htmlTag="div" htmlClass="page-header__inner" before="-">
         <container name="header.top" as="header_top" label="Page Header Top " htmlTag="div" htmlClass="page-header__top" before="-">
                <container name="header.top.actions" as="header_top_actions" label="Page Header Top actions" htmlTag="div" htmlClass="page-header__actions" />
         </container>
    </container>
</referenceContainer>

I've then moved the minicart into this container like so:

<move element="minicart" destination="header.top.actions"/>

Which works fine, however when i try to move:

  element="top.links"

Into this container like so:

<move element="top.links" destination="header.top.actions" before="-" />

The top.links don't want to move into my new reference container, and i can't understand why that one doesn't want to move there.

Any help would be great.


texts: How to call my custom countries dropdown list in magento2

texts:
I need to call my custom countries dropdown list in magento2 checkout page. how to replace the default to my custom dropdown.

thanks in advance..


texts: Some product sales not showing up on Product Ordered Report 1.9.1

texts:
When I use the Reports > Products > Products ordered, I have some products in there which are reporting sales of 0 over the last 3 months when I know that we have sales for most of these products and in one instance, the sales have been over 50.
This doesn't happen on all products, just a handful, most are simple products.

Any ideas please?


texts: Image import gets stuck in Magento on live server

texts:
I have successfully imported 3374 products in Magento without images in my local system through a product CSV-file (this CSV-file has all information of product corresponding to each sku except images).

Then I have tried the same procedure successfully in my live server.

But when I am trying to import 3374 images of product (each product has one image) in live server using image CSV-file (this CSV-file has image information corresponding to each sku) only some images get imported, i.e. around 300 images get imported.

Though, in my local system, I have successfully imported all 3374 images using same image CSV-file.

I don't know what happened to the Magento setup on the live server. Did anyone face the same problem?
Got stuck, please help.


texts: Magento 2 jsonParse() does not receive data, Unexpected token '

texts:
I'm creating a js template in Magento 2. When I call js, I get an Uncaught SyntaxError: Unexpected token 'in JSON at position 96. Why jsonParse () does not get the value? Can somebody help me?

file .phtml

<?php
$productData = [
    ["sku"=>"Tshirt-Red",
        "name"=>"Tshirt Red Armani",
        "price"=>"5000"],
    ["sku"=>"Tshirt-Blue",
            "name"=>"Tshirt Blue Armani",
            "price"=>"6000"],
    ["sku"=>"Tshirt-Yellow",
            "name"=>"Tshirt Yellow Armani",
            "price"=>"7000"]
        ];
$jsonProductData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($productData);
?>

<button id="getInfo">Get  Info</button>

file jstemplate.js

define([
    "jquery",
    "mage/template"
], function ($, template) {
    "use strict";
     return function (config, element) {
        var product;
        $.each($.parseJSON(config.Data), function () {
            var productTemplate = template('#product-template');
            product = productTemplate({
                data: {
                    sku: this['sku'],
                    name: this['name'],
                    price: this['price']
                }
            });
            $('#product').append(product);
        });
        $("#getInfo").click(function () {
            $("#product").toggle();
        });
    };
});

error :


texts: how to remove street address country city from billing information in magento

texts: how to remove street address country city from billing information in checkout page.i want to remove these above compulsory  fields at the time of checkout page.as i tried it in abstract page but it not


texts:
we are providing an option for customer to upload an image from frontend here

1.Once customer upload image from product view page and click on "Add to cart",

we are saving custom image in this path : media/custom_options/quote like below :

media/custom_options/quote/2/4/image_name1.png
media/custom_options/quote/6/7/image_name2.png

in DB we are saving image path in table : sales_flat_quote_item_option& in column : value

2.if customer place an order, we are saving custom image in this path : media/custom_options/order

media/custom_options/order/2/4/image_name1.png
media/custom_options/order/6/7/image_name2.png

in DB we are saving image path in table : sales_flat_order_item& in column : product_options

Also we are saving random url in same column :

s:170:"custom_product_preview.png 300 x 500 px.";

we are displaying Custom image in order email with help of above url.

Now, we want to save same url once customer upload custom image & click on Add to cart in table : sales_flat_quote_item_option& in column : value , so that we can send custom image in Abandoned cart email

Edit

we are saving like this link in DB, I need add  below in DB.

s:170:"custom_product_preview.png 300 x

500 px.";

edit3

we are using below download url code after placing an order, full code : http://pastebin.com/V2zVv0bJ

protected function _getOptionHtml($optionValue)
    {
        if ($this->_isCreateOrderRequest())
        {
            return parent::_getOptionHtml($optionValue);
        }

        try {
            $option = $this->getOption();
        } catch (Exception $e) {
            $option = $this->_getOptionByValue($optionValue);
        }

        $value = $this->_getValueOption($optionValue);

        $isTempData = false;
        $data = array();
        if( Mage::helper('aitcg/options')->checkAitOption( $option ) &&  $option->getData("image_template_id") > 0)
        {

            $model = Mage::getModel('aitcg/image');

            $data = $this->_getImageData($model, $value);
            $data = $this->_getAreaData($option, $model, $data);

            $isTempData = true;

        }
        return $this->_sprintOption($value, $optionValue, $option, $data, $isTempData);
    }

    protected function _sprintOption($value, $optionValue, $option, $data, $isTempData)
        {

            $js = "";
            if($isTempData)
            {
                $sBlockName = $this->_getBlockName();
                $js =  Mage::app()->getLayout()
                    ->createBlock($sBlockName, null, $data)
                    ->setProduct( $option->getProduct() )
                    ->setOption( $option )
                    ->toHtml();

                return $js;
            }
            else
            {
                return $js . sprintf('%s %s',
                    $this->_getOptionDownloadUrl($value['url']['route'], $value['url']['params']),
                    Mage::helper('core')->htmlEscape($value['title']),
                    $this->_getSizes($optionValue)
                );
            }

we are using above code to get image download url in DB, but its not saving that url in DB. full file : http://pastebin.com/MLPxi4E0


texts:
Given a collection obtained by (this is Magento 1.4):

$collection = Mage::getModel('catalog/product_option')
    ->getProductOptionCollection($_product);

This returns the collection of options associated with a single product. I would like to filter this down to only give me options that have a price_type of percent, so naturally, I try:

$collection = Mage::getModel('catalog/product_option')
    ->getProductOptionCollection($_product)
    ->addFieldToFilter('price_type', array('eq' => 'percent'));

This still returns the entire option collection, as if the filter did nothing at all. Is this an old issue with v.1.4?


texts: Cache refreshes have caused product display errors

texts: I refreshed both the Layout & Blocks HTML Output caches as they were showing as invalidated. I then added a new product in exactly the same manner as my other products. But, on the front end whilst the new product is present when I click on it to go into that product I just get a box with the product's file path instead of the product's details. Does anyone know how to fix this please ?


texts:
I need to cycle products collection for each store. But the method $collection->addStoreFilter($store) seems to not work properly. I also tried to $collection->setStore and setStoreId.

The problem is: at first cycle everything is ok and the collection has results. But on all the next cycles i get 0 results.

Debugging i saw that the query is wrong:

First cycle query: SELECT `e`.*, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e`\n INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(3, 2, 4) AND cat_index.category_id=2 WHERE (e.created_in <= \'1580479620\') AND (e.updated_in > \'1580479620\')

Second cycle query SELECT `e`.*, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e`\n INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=2 AND cat_index.visibility IN(3, 2, 4) AND cat_index.category_id=2 WHERE (e.created_in <= \'1580479620\') AND (e.updated_in > \'1580479620\')

Third cycle query: SELECT `e`.*, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e`\n INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=3 AND cat_index.visibility IN(3, 2, 4) AND cat_index.category_id=2 WHERE (e.created_in <= \'1580479620\') AND (e.updated_in > \'1580479620\')

As you can see the condition AND cat_index.store_id= changes. But the inner join is always on catalog_category_product_index_store1. Should change with store2 and 3.

This join is generated here: \Magento\Catalog\Model\ResourceModel\Product\Collection::_applyProductLimitations line 2033:

$this->getSelect()->join(
      ['cat_index' => $this->tableMaintainer->getMainTable($this->getStoreId())],
      $joinCond,
      ['cat_index_position' => 'position']
);

$this->getStoreId() returns always 1

My code is:

        foreach ($this->storeManager->getStores() as $store) {
            $collection = $this->productCollectionFactory->create();
            $collection->addAttributeToSelect('*');
            $collection->setVisibility($this->productVisibility->getVisibleInSiteIds());
            $collection->addStoreFilter($store->getId());
           // $collection->setStoreId($store->getId());
            $collection->load();

            $products = $collection->getItems();
        }

Before using collection i tried with productRepository and searchCriteria but the result is the same. Also tried store emulation and clear collection. Any ideas?

PS: i am using MSI on Magento 2.3.3 EE


texts:
I have necessity to search sales with SKU in REST API in magento 2.1.

Example: return all orders that have products with sku equals AAA.

Use REST API and PHP

Thank you


texts:
I installed a new template and it contain a link contact Us . I want to delete it from top header how to proceed . this is the content of my default.xml of the theme

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="head.additional">
        <block class="Smartwave\Porto\Block\Template" name="porto_custom_head" template="html/head.phtml" before="-"/>
    </referenceContainer>
    <referenceContainer name="after.body.start">
        <block class="Magento\Newsletter\Block\Subscribe" name="porto_newsletter_popup" template="subscribe_popup.phtml" before="-"/>
        <block class="Smartwave\Porto\Block\Template" name="porto_custom_notice" template="html/custom_notice.phtml" after="-"/>
        <block class="Smartwave\Porto\Block\Template" name="porto_sidebar_sticky" template="html/sidebar_sticky.phtml" after="-"/>
    </referenceContainer>
    <referenceContainer name="page.wrapper">
        <block class="Smartwave\Porto\Block\Template" name="porto_header" template="html/header.phtml" before="main.content">
            <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
                <arguments>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
            </block>
            <block class="Smartwave\Porto\Block\Form\Login" name="header_customer_form_login" ifconfig="porto_settings/header/login_popup" template="Smartwave_Porto::html/login.phtml"/>
            <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/>
            <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" />
            <block class="Smartwave\Porto\Block\Template" name="custom_block" template="html/header_custom_block.phtml" ifconfig="porto_settings/header/static_block" after="-"/>
        </block>
    </referenceContainer>
    <move element="navigation.sections" destination="porto_header"/>
    <move element="top.search" destination="porto_header"/>
    <move element="minicart" destination="porto_header"/>
    <move element="currency" destination="porto_header"/>
    <move element="logo" destination="porto_header"/>
    <move element="skip_to_content" destination="porto_header"/>

    <move element="page.top" destination="page.wrapper" after="porto_header"/>

    <referenceContainer name="header.container" remove="1"/>
    <referenceContainer name="header.panel" remove="1"/>
    <referenceContainer name="header-wrapper" remove="1"/>

    <referenceContainer name="footer-container">
        <block class="Smartwave\Porto\Block\Template" name="footer_block" template="html/footer.phtml">
            <block class="Magento\Store\Block\Switcher" name="footer.store_switcher" template="switch/stores.phtml"/>
            <block class="Magento\Newsletter\Block\Subscribe" name="footer.newsletter" template="subscribe_footer.phtml"/>
        </block>
    </referenceContainer>

    <referenceBlock name="header.links">
        <block class="Smartwave\Porto\Block\Template" name="custom_link" before="authorization-link-login" template="html/custom_link.phtml" />
    </referenceBlock>
</body>

so how to delete it and thanks in advance


texts: How to override module-newsletter in magento 2?

texts: How to override the subscribe.phtml form which is in vendor / magento / module-newsletter to add my input data and save it in my database table ?


texts: How to Add and show Product Unique code(label) in Listing Page

texts:
I want to customize product listing page with unqiue code (label) same like shown in below picture. add filter by that code of product.
Note  : if Product is assigning to multiple category then code will be different for both category. How can we implement this?
Thanks in Advance


texts:
If i change the sort order for cagegory - the page is reloaded and displayed in the address bar: ?dir=asc&order=name and order sorting attribute - How i can get the attributes order=name?

Thanks


texts: Logged-in/Guest customers are failing to log-in or shop after patch SUPEE7405

texts:
I am using magento 1.9.2.1.

I was installing the patch SUPEE-7405 to my store in production manually, but I noted that after installing the patch, none of the customers are able to login nor any guest customer were able to shop.

Already a customer when trying to login, redirecting to the same login page without any error.

Also, as a guest customer, unable to move to cart page instead moving to a page with login link.

Also, admin section section "Invalid Form Key. Please refresh the page".

So, I reverted the patch SUPEE-7405. Reverting this allowed admin to login but already logged-in customer faced the same issue.
If I cleared the browser cache, then I was able to login.

My concern is that many customers who had opened my store and if do not clear browser cache will not be able to shop.

Can anyone please help me to get out of this issue?