texts: How to create company programmatically magento 2 b2b?

texts:
I want to create a company programmatically from a standalone script. Can someone please help me out with this. how can I create it.
Here is the code I am using to create company.
$companyRepo = $obj->create('Magento\Company\Api\CompanyRepositoryInterface');

$companyObj = $obj->create('\Magento\Company\Api\Data\CompanyInterface');

$dataObj = $obj->create('\Magento\Framework\Api\DataObjectHelper');

$data = [
    'company_name' => [
        'Test Company'
    ],
    'company_email' => 'testcompany@yopmail.com',
    'status' => '1',
    'street' => ['test','test2'],
    'city' => 'test city',
    'postcode' => '12345',
    'country_id' => 'US',
    'firstname' => 'test f',
    'lastname' => 'test l',
    'email' => 'testcompany@yopmail.com',
    'customer_group_id' => 1,
    'website_id' => 1
];

$dataObj->populateWithArray(
        $companyObj,
        $data,
        \Magento\Company\Api\Data\CompanyInterface::class
    );

$companyRepo->save($companyObj);

But it is throwing below error.
EXCEPTION::#0 /var/www/html/project/vendor/magento/module-company/Model/Company/Save.php(79): Magento\Company\Model\SaveValidatorPool->execute(Object(Magento\Company\Model\Company\Interceptor), Object(Magento\Company\Model\Company\Interceptor))

Thanks in advance!


texts: Magento 2 : coding standards correct way to throw exceptions

texts:
When using coding standard checks my attention is often drawn to the use of exceptions. Generally when I'm putting something together I use standard exceptions and later code something more specific.

The general consensus from code quality checks is that \Exception should not be used but instead more specific types of exception. I understand that part.

Some of the exceptions are obvious what the correct usage is. For example an entity not found exception NoSuchEntityException.

I'm unsure on LocalizedException. What is the difference between this and standard Exception. And generally when should it be used?


texts: Magento 2.5: Unable to open the customer grid in backend

texts:
I need to modify query of orders/items.I get error when opening customer grid in backend

I get the following error:

  Item (Magento\Framework\View\Element\UiComponent\DataProvider\Document) with the same ID "269151" already exists.

Does anybody have any idea what would the issue be and where to solve it? Thanks.


texts: How to remove minicart from sticky header

texts: In my project minicart comes under both header & sticky header. But I want to remove it from sticky header. Is there any setting from backend or which file I need to edit to hide checkout from sticky header. Please help.


texts:
In Magento 1.9, when we created multiple storviews and enable all of them, then in the top navigation part of the page on frontend, there will be a dropdown  to let customers to switch between different storeviews.

It looks like this feature is gone in Magento 2? or at least it's not showing in default Luma theme. Can we get this storeview switcher on the frontend?

I'm using Magento 2.3.1


texts: Magento 2: Override for product custom option value Interface and model file

texts:
I have added custom product option value to below interface ProductCustomOptionValuesInterface.php and Value.php model file.

  File path: magento2/vendor/magento/module-catalog/Api/Data/ProductCustomOptionValuesInterface.php

  File path:
  magento2/vendor/magento/module-catalog/Model/Product/Option/Value.php

But how to override above vendor file code to custom module.

Any help would be appreciated. Thanks!


texts:
I have a problem and I hope you can help me. I want to work with Magento, but there is a message that I can not solve. The massage is:

  SSL certificate problem: unable to get local issuer certificate.


texts: convert widget block codes to phtml and xml layout

texts:
Sorry I am new to Magento and please bear with me if I am not using the proper terms. So I got an extension and it can be integrated anywhere on my CMS or any pages with the following codes:

{{block type="dailydeal/list_sidedeals" slim="true" name="dailydeal_sidedeals_block" template="dailydeal/list/featured_deal.phtml" }}

But for some reason I need to have this widget block written inside the relative phtml file instead of the backend so I found this earlier post:Magento include phtml file within another phtml file

So came up with the following for my phtml file:

<?php echo $this->getLayout()->createBlock('dailydeal/list_sidedeals')->setTemplate('dailydeal/list/featured_deal.phtml')->toHtml(); ?>

It works only half way. Notice there is some additional attributes(sorry if I did not name this correctly) in my first widget block such as slim="true" and name="dailydeal_sidedeals_block". Are they something I need to add into my relative xml layout file? How does it work?


texts: I'm having an issue with Magento 1.9.2.0.  My categories on the left margin are lined up correctly, but not on the main page.  Take a look at this URL - http://tinyurl.com/huz6rnq and notice how the menu on the right is the preferred order, but on the main page its based on when I first set them up.  So all new items go to the bottom of the page.


texts: Magento 2: Get qty of added product in cart

texts:
I want to get total quantity of product added in cart by product ID.
I use \Magento\Checkout\Model\Cart class to get all items in cart.

$items = $cart->getQuote()->getAllItems();

foreach ($items as $item) {
    if ($item->getProductId() == '101') {
        return $item->getQty(); //Get product qty
    }
}

This will get product qty added in cart. But if I have 30 products in cart it will loop 30 times.

Is there any way to get qty of single product without looping all products from cart?

Any help appreciated!


texts: How to calculate product price based on custom action in Catalog Price Rules

texts:
I have added new action in catalog price rule.

I have added this action through overriding below file.

  module-catalog-rule/Model/Rule/Action/SimpleActionOptionsProvider.php

When this action is applied then how to calculate product price based on this action.

In magento module-catalog-rule which file/function is used to calculate product price when other action is applied.

Anyone knows then please help.


texts:
I'm getting same problem as mentioned below link.
https://stackoverflow.com/questions/25280095/magento-catalog-price-rule-disappears-at-night

I applied the solution provided by Alexei Yerofeyev, but now it will giving me an error as 'unable to apply rules'.

thanks


texts: I am trying to build a simple code to send Google AMP Emails using Magento 2. Can someone lead me in the right direction?  There is no manual online even for PHP on how to do this. Thanks!


texts:
I've been working on a batch interface for clients to be able to create products programatically on Magento, which is working well. I've got images uploading into the media/import folder and then being imported into Magento with the following code;

<?php $product = Mage::getModel('catalog/product')->load($entity);?>
  <?php if(file_exists($path."/".$filename)):?>
    <?php $product->addImageToMediaGallery($path."/".$filename, array('image', 'small_image', 'thumbnail'), false, false);?>
    <?php $gallery = $product->getData('media_gallery');?>
    <?php $lastImage = array_pop($gallery['images']);?>
    <?php $lastImage['label'] = $name;?>
    <?php array_push($gallery['images'], $lastImage);?>
    <?php $product->setData('media_gallery', $gallery);?>
    <?php $product->setData('has_images','1');?>
    <?php $product->getResource()->saveAttribute($product,'has_images');?>
    <?php $product->save();?>
  <?php endif;?>

This was based on a mixture of solutions from a few users, and seems to correctly import the files into the storage system with automatic appending of numerics on duplicate filenames.

The only problem I get is that by then calling the images back using the following code, images added via the script are ignored and I'm really not sure why!

<?php foreach($product->getMediaGalleryImages() as $image):?>
  <img src="<?php echo Mage::helper('catalog/image')->init($product, 'image', $image->getFile())->resize(100, 100); ?>"/>
<?php endforeach;?>


texts: Magento 2 : How to add inline CSS from admin Layout Update XML?

texts:
In Magento 1 we can add inline CSS from admin Layout Update XML like this :

<reference name="head">
 <block type="core/text" name="custom_css">
  <action method="setText">
      <text><![CDATA[
         <style  type="text/css">
            .my-class  {
                color: red;
            }
         </style> ]]>
    </text>
  </action>
 </block>
</reference>

how can this be implemented in Magento 2 admin Layout Update XML?

I've tried it in Magento 2.2 but it did not work


texts: Change the URL of save button in the admin grid

texts:
In Magento 2.2.5, How to change the URL of save button in the admin grid.

Note: I am not creating grid through ui_component, I am creating grid using layout.

Reference: Ref 1 Ref 2


texts: Move getCmsBlockHtml() from category view to sidebar

texts:
I'm trying to move the static CMS block from the category view into the sidebar. In my themename/template/catalog/category/view.phtml it is called with

$this->getCmsBlockHtml()

Since it's defined as

 /**
   * Retrieve current category model object
   *
   * @return Mage_Catalog_Model_Category
   */
  public function getCurrentCategory()
  {
      if (!$this->hasData('current_category')) {
          $this->setData('current_category', Mage::registry('current_category'));
      }
      return $this->getData('current_category');
  }

  public function getCmsBlockHtml()
  {
      if (!$this->getData('cms_block_html')) {
          $html = $this->getLayout()->createBlock('cms/block')
              ->setBlockId($this->getCurrentCategory()->getLandingPage())
              ->toHtml();
          $this->setData('cms_block_html', $html);
      }
      return $this->getData('cms_block_html');
  }

I've tried adding this:

echo $this->getLayout()->createBlock('cms/block')->setBlockId(   $this->getCurrentCategory()->getLandingPage()    )->toHtml()

into my themename/template/callout/left-col.phtml file, but this throws errors.

How do I make it work?


texts: How to export upsell and cross-sell products through programmatically in magento1?

texts:
I want to export up-sell and cross-sell products through programmatically.

How it is possible to export up-sell and cross-sell products?

I don't know how to implement this task.

Can you please help me?


texts: Magento 2 Images Not Showing on Product Detail page Please Advice

texts:
I have installed Magento 2.1.6 and had lot's of products over it. then i download fresh copy of magento 2.1.7 from magento market place and extracted and used my previous database that was had lot's of products and order histories etc.

the website start working fine .
now i migrate Media folder from old website directory to new website directory same in pub folder

now images start working fine. but when i see on product detail page images not showing else all images showing any help?


texts: Want to show text message for specific shipping method on checkout in magento2

texts: I have a custom shipping method. If I select that custom shipping method, I need to render the custom message below shipping method list. How can I do this?


texts:
We plan to install SSL certificate in Magento store and I was wondering if there are any SEO implications to take into consideration? We mean to use the HTTPS on all pages of the site.

Does Magento automatically 301 redirect the non-secured url's to secured ones or do we need to make some server side redirection of all pages?

EDIT:

Also please note that this question is not about how to set the https in use in Magento, but how to make the change as safely as possible considering SEO.

EDIT 2:

I added this to my .htaccess file to make sure that all HTTP pages are 301 redirected to the HTTPS version of the same pages:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]


texts: Set attribute value from other attribute

texts:
I have custom attribute 'brand'. I should set its value in attribute 'manufacturer'. How can i do this? For now, all that i cat do ->
shell file

require_once dirname(__FILE__) . '/../app/Mage.php';
Mage::app('admin');

$product = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('manufacturer', Null);
$avid = $product->getResource()->getAttribute('brand');
$product->setData('manufacturer', $avid)->save();

There the mistake or maybe it is fundamentally wrong?
And it must be replaced in all products


texts: Given a product in Magento, how can I get a list of all the catalog price rules that apply to it? I know that I can use getFinalPrice() to get the price after all rules were applied; however, I am more interested in the catalog price rule objects themselves that apply to a given object.


texts: PayPal Checkout - Double Privacy Policy & Terms

texts:
When I want to checkout with Paypal there are double Privacy Policy & Terms.
I only need 2 but they´re 4.

See here: https://www.dropbox.com/s/oq1ppr3tzekf3iy/tset.jpg?dl=0

Without Paypal everything ist right. Where can I edit this Site?


texts: Magento 2 : how to add product images jpg or png using rest api

texts: Any options to add product jpg or png using rest api in magento 2.


texts:
I am adding some extra html to some input attributes in the category edit area by creating a new attribute input renderer type in my modules mysql install script:

$installer->addAttribute(
    'catalog_category',
    'mymodule_category_popularity',
    array(
        'label' => 'My Label',
        'group' => 'My Group',
        'type'  => 'int',
        'class' => 'validate-number',
        'required' => false,
        'default' => 50,
        'input_renderer' => 'mymodule/adminhtml_catalog_category_widget_slider',
    )
);

And the renderer:

class Mynamespace_Mymodule_Block_Adminhtml_Catalog_Category_Widget_Slider extends Varien_Data_Form_Element_Text
{
    public function getAfterElementHtml()
    {

        $html = parent::getAfterElementHtml();
        return $html."

";
    }
}

And the javascript:

var $j = jQuery.noConflict();

$j(document).ready(function(){

     $j( "#slider" ).slider();

});

This works fine, the plugins get loaded correctly and so does jQeuery (as I have loaded it using my layout xml for the module). I see a slider. However, after the page has completely finished (the Magento ajax has re-loaded the category edit tabs) my slider dissapears. This, I assume, is because the javascript code is not getting ran again.

I have tried adding my javascript to the core edit.phtml (as there is other Magento JS there) however I just get an error: $j('#slider).slider() is not a function. This is because the content is getting loaded via ajax.

So, how do I make sure that I can use $j('#slider).slider() in the category edit area? Confusing I know.


texts: Adding a button in sales order. Old vs New Approach

texts:
Okay, I am a very new magento developer. Here is what I am facing.

Module one -> is adding a button to sales order page by rewriting sales_order_view
Module two -> is adding a button to sales order page by Observer (the new approach)

This ends up only showing Module one buttons.

How can this be fixed in a way where buttons from both modules show up ?

Module1-Buttons are being added via this pastebin.com/U8ujJpV5

Module2-Buttons are being added via this pastebin.com/j6VxwfF5 .

If I should post something more than this please let me know but I believe this would explain the problem.

Thank you


texts: Create a Empty Wish-list Button in magento 1.9

texts: i want to create a empty wishlist button in wishlist page, so that when user click the button all the items from the wishlist are removed. how can i do that please help.


texts: Magento2: How can search products for specific category via search box?

texts:
I want to search products for specific categories though search box.
Anyone have an idea for that?


texts: Have any way to get product gallery image full path from image name in magento2?

texts:
I have product gallery image  /d/i/digitalnumber_0209_text.jpg

Using this image i want
http://www.stm2local.com/pub/media/catalog/product\cache\5774940f9400924b0454113a9911cfd5/d/i/digitalnumber_0209_text.jpg

Have any idea about misc params?


texts: How to get customer and company data in a CSV file from MySQL?

texts:
I'm running a Magento Commerce Cloud B2B, and I need to get a list of these data below.

Customer ID
Customer Name
Company Name
Company User Agreement

As I can't export a file with these pieces of information above via the admin panel, how could I do it via a MySQL query?


texts: Pull custom customer attribute and send in email? Magento 2.2

texts:
I am working in Magento 2.2 and I am using an extension that allows the site admin to confirm new accounts before they are active.
The extension can be found here:
https://github.com/enrico69/magento2-customer-activation
When a new user registers the admin is sent an email that shows the email address of the new user.
This code sends the email:
 public function send($customer)
{
    $siteOwnerEmail = $this->scopeConfigInterface->getValue(
        'trans_email/ident_sales/email',
        ScopeInterface::SCOPE_STORE,
        $customer->getStoreId()
    );

    $this->transportBuilder->setTemplateIdentifier('enrico69_activation_email_notification')
        ->setTemplateOptions(
            [
                'area' => Area::AREA_FRONTEND,
                'store' => $customer->getStoreId(),
            ]
        )
        ->setTemplateVars(['email' => $customer->getEmail()]);

    $this->transportBuilder->addTo($siteOwnerEmail);
    $this->transportBuilder->setFrom(
        [
            'name'=> $this->storeManagerInterface->getStore($customer->getStoreId())->getName(),
            'email' => $siteOwnerEmail
        ]
    );

    $this->transportBuilder->getTransport()->sendMessage();
}

That file that emails the code to the admin is at:
https://github.com/enrico69/magento2-customer-activation/blob/master/Model/AdminNotification.php
And I believe line 70 below controls pulling the customers email:
 ->setTemplateVars(['email' => $customer->getEmail()]);

I also found the line below in https://github.com/enrico69/magento2-customer-activation/blob/master/Observer/UserActivation.php that prepares the code.
$newCustomer = $this->customerRepository->get($customer->getEmail());

I am trying to pull custom Customer attributes values added to my eav_attribute table. The attribute is "company_name" and is already created.
I found the following code which I modified here:
http://www.w3solver.com/magento2-addcreate-and-get-custom-customer-attribute-value/
So I created the line below in https://github.com/enrico69/magento2-customer-activation/blob/master/Observer/UserActivation.php
$newCustomer = $this->customerRepository->get($customer->getCustomAttribute('company_name')->getValue());

And added the line below in https://github.com/enrico69/magento2-customer-activation/blob/master/Model/AdminNotification.php
  ->setTemplateVars(['companyname' =>  $customer->getCustomAttribute('company_name')->getValue()]);

But this still isn't working.
Can anyone offer some clues to get me on the correct path? Thanks!
EDIT: Figured this out and the answer is below.


texts: how to divide sub-categories in rows of 3 columns in dropdown menu

texts:
I have long dropdown list its displaying in one column....but i want it to display in 3 columns , can anybody help me to do that....

reference:

http://gotofunction.com/question/3309/how-to-divide-categories-in-rows-of-three-columns


texts: Magento 2 Create order even if product Qty is Zero

texts:
I want to create an order programmatically where a product qty is zero. I am unable to do so at I get a message as

{"0":"The requested qty is not available","1":"#1
Magento\Quote\Model\Quote\Interceptor->addProduct(&Magento\Catalog\Model\Product\Interceptor#0000000077f6b2d40000000016a081f7#,
1)

Is there a way to create this types of orders?


texts:
After I upgraded Magento to 2.2.6, if I go to my account, this shows me the nodes with this class:

This makes it look really bad:

Inspector:

This comes from:

  Magento\Customer\Block\Account\Delimiter

<?php

namespace Magento\Customer\Block\Account;

/**
 * Class for delimiter.
 *
 * @api
 * @since 100.2.0
 */
class Delimiter extends \Magento\Framework\View\Element\Template implements SortLinkInterface
{
    /**
     * {@inheritdoc}
     * @since 100.2.0
     */
    public function getSortOrder()
    {
        return $this->getData(self::SORT_ORDER);
    }
}

And the phtml is:

  magento\module-customer\view\frontend\templates\account\navigation-delimiter.phtml

My solution is to overwrite, but I do not know if it is the correct solution.


texts: Does the Australia Post plugin calculate weight in shipping costs?

texts:
I am trying to find out if the Australia Post plugin takes into consideration the weight of the product(s) when calculating a shipping fee.

I have called AP but they have no idea. On example Magento site they have none of the products have a weight and its just a flat fee for shipping.

Has anyone used this plugin before? Does it calculate shipping rates taking into account weight?


texts:
I am saving products fetched from an XML document. I am using $product->save() but I need to do an update after the first save. But the $product->save() method is too much slow for update. I also tried updateAttribute to update product like:

public function productUpdate($productSkus=array(), $data, $storeId = 1){
            $ids=array();
            foreach($productSkus as $sku){
                $id = $this->_getid($sku);
                $attributesData = array("price" => $data['price']);
                array_push($ids,$id);
            }
             Mage::getSingleton('catalog/product_action')
                    ->updateAttributes($ids, $attributesData, $storeId);
        }

        public function _getid($sku){
        $product=Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
        if (!$product){
            return false;
        }
            return $product->getId();
    }

What should I do? How can I update products faster? Imagine there is an XML document that is keeping data of 8000 products (including custom attributes), and it is dynamic, which means it can change anytime. So I need to update products fast, but $product->save() and the above code are not suitable for this situation.


texts: Some invoices not showing on grid and email not sent, but row are created in DB

texts:
We have been having this occasional issue, for some orders, the payment is processed (by any of our methods), the sales_flat_invoice_* records are created for the invoice, the items and the grid. But we can't see the invoice in the grid for that order, or on the invoices grid and the invoice was not sent to the customer. I can't invoice the order.

We started to see this issue when we added ShipperHQ. But there not seems to be a certain shipping condition that triggers the issue.

I haven't found any pattern except that orders are 2x or 3x our average order total, but other than that, from customers in different groups, different payment methods, different shipping conditions and in no particular frequency.

If the entry for the grid and for the invoice exists, what may be blocking it from showing up? What could I check on the workflow that is blocking this from showing up and email invoice?

Thanks for any ideas.


texts: Magento 2 Invoice PDF date is showing wrong

texts:
Magento 2 order date showing wrong in Invoice PDF,the order date is showing correct in admin order page but it is not showing correct when generate invoice PDF.

Magento 2 admin order page(looks good) please check screenshot

When generate invoice PDF then in PDF date is showing wrong please check screenshot


texts: Get order id and product id while order placed using Observer | Magento 2

texts:
Hi i need to get the order id and product id while order is generated in magento2

<?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="sales_order_save_after">
    <observer name="sales_order_save" instance="Learning\Learn\Observer\GetOrderData" />
</event>
</config>

in my GetOrderData

 public function execute(\Magento\Framework\Event\Observer $observer)
 {
    try {
            //~ $order = $observer->getEvent()->getOrder();
            $orderIds = $observer->getEvent()->getOrder();
            $lastorderId = $orderIds[0]; // **returns empty**

         $ordercollection = $this->_orderCollectionFactory->create()->addFieldToSelect(array('*'))->addFieldToFilter('entity_id', ['eq' => $lastorderId]);
            $ordercollection->setPageSize(1);

          foreach($ordercollection as $order)
          {
            foreach($order->getAllItems() as $orderItem)
            {
               $orderItem->getId();  // **returns empty**
            }
          }
        }
 }


texts: How to remove the payment method in magento2

texts: I want to remove the selected Payment Method on page reload (or) load in checkout page(FrontEnd).


texts: Created date is wrong in customer grid tried the available solution but not solved

texts:
I have tried the solution like Customer created_at Date off by months

when I use it it gives me error like

    Call to undefined method
    Mage_Eav_Model_Entity_Attribute_Backend_Time_Created::_getFormat(
    )

even I have override by placing the created.php file in app/code/local/Mage/Eav/Model/Entity/Attribute/Backend/Time


texts: Update script won't save values (prices) in database

texts:
I found basically an easy script here to update my prices in all store views.
Just tried to test it, it echos correctly, runs without error but doesn't save the new prices - tried with and without setStoreId.

    require_once MAGENTO . '/app/Mage.php';
    Mage::app();

$sku = '123';
$newPrice = '1.64';

updateProductPrices ( $sku, $newPrice );

function updateProductPrices ($sku, $newPrice) {
    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

    $websites = Mage::app()->getWebsites();

    $product = Mage::getModel('catalog/product');
    $productId = $product->getIdBySku($sku);

    foreach ($websites as $_eachWebsite) {
        $_websiteId = $_eachWebsite->getWebsiteId();

        $websiteObj = new Mage_Core_Model_Website();
        $websiteObj->load($_websiteId);

        $storeIds = $websiteObj->getStoreIds();

        if (count($storeIds)) {
            foreach ($storeIds as $_eachStoreId) {
                $product->setStoreId($_eachStoreId)
                        ->load($productId);

                $oldPrice = $product->getPrice();

                if ($oldPrice != $newPrice) {
                    $product->setPrice($newPrice);
                    $product->save();

                    $product->setStoreId($_eachStoreId) -> setPrice($newPrice) ->save() ;

echo "
Store ID: " . $_eachStoreId;
echo "
Alt: " . $oldPrice;
echo "
Neu: " . $newPrice;
                }
            }
        }

        unset($storeIds, $websiteObj, $_websiteId);
    }

    unset($product);
}

Does anyone see a problem there?


texts: Is Magento based on 3 tier architecture?

texts:
I want to know few things:

Is magento based on 3 tier architecture?
Is it free from SQL-Injection, cross-site-scripting, CRLF injection
attacks and SSI attacks?


texts: How do I make the Phone Number mandatory on the Contact Us form: Solved

texts:
how do I make the Phone Number mandatory on the Contact Us form in Magento 2.3?

I was expecting it to be an option in the Admin section but I cannot find it.


texts: Products don't showed in manage products

texts:
I have a problem with this code:

$website = Mage::app()->getWebsite($website->getId());
            $store_id = $website->getDefaultStore()->getId();
            $_grouped_products = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToFilter('type_id', Mage_Catalog_Model_Product_Type::TYPE_GROUPED)
            ->addStoreFilter($store_id)
            ->addWebsiteFilter($website->getId())
            ->setStore($storeId);

The function ->getCollection() return a product with the SKU "EHSXB16P50A / ERLQ014CW1" and in the backend of magento:

I go to database to search this product and exist:

Any idea?


texts:
in reference to this old post (Running Magento in an AWS Environment) by @Alan Storm, I see a lot of you mentioning using DynamoDB for magento sessions.

I have searched high and low, but I cannot find how to actually use it from Magento, just mentions of using it. As far as I know, it is not directly supported by Magento, or am I wrong?

I was going to experiment integrating it, but I am still stuck trying to create a DynamoDB table in AWS to the exact specifications required for the sessions table, I found this link with some specifications for the table (http://www.sitepoint.com/amazon-dynamodb-store-php-sessions-with-load-balancer/). Still, considering more than one person has mentioned it, I cannot believe there is no single document describing how to do it with Magento.

Is there anywhere documented how to easily integrate Magento with AWS DynamoDB? Or it's time to market a new module?

thanks!

NOTE - sdk for dynamodb sessions - http://docs.aws.amazon.com/aws-sdk-php/v2/guide/feature-dynamodb-session-handler.html


texts: Overwriting existing extension's controller in community

texts:
I'm trying to overwrite existing extension's controller into my custom extension. As per my understanding I've followed all the steps to do so properly but still I guess I'm missing something. Following are the core references I'm using.

app\code\community\Mycompany\Mymodule\etc\config.xml

<?xml version="1.0" encoding="utf-8" ?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <version>0.1.0</version>
        </Mycompany_Mymodule>
    </modules>
    <frontend>
        <routers>
            <thirdpartymodule>
                <args>
                    <modules>
                        <mycompany_mymodule before="Thirdpartycompany_Thirdpartymodule">Mycompany_Mymodule</mycompany_mymodule>
                    </modules>
                </args>
            </thirdpartymodule>
         </routers>
    </frontend>
</config>

app\code\community\Mycompany\Mymodule\controllers\FulfillController.php

require_once 'Thirdpartycompany/Thirdpartymodule/controllers/FulfillController.php';

class Mycompany_Mymodule_FulfillController extends Thirdpartycompany_Thirdpartymodule_FulfillController {

    protected function _isAllowed()
    {
        return true;
    }

}

app\code\community\Thirdpartycompany\Thirdpartymodule\controllers\FulfillController.php

class Thirdpartycompany_Thirdpartymodule_FulfillController extends Mage_Adminhtml_Controller_Action {

}


texts: How to use || or && in Email Template or PDF Template Magento 1.x

texts:
I want to use || in {{if}}

I tryed like this but it not work, please help me

{{if helper.eq(order.shipping_description, "abcd") || helper.eq(order.shipping_description, "dede") }}

abcd & dede

{{else}}

Not abcd & dede

{{/if}}

It only work with helper.eq(order.shipping_description, "abcd"), not work with helper.eq(order.shipping_description, "dede")


texts: How to get customer data from a table before logging in? magento2

texts: I need to check the status of the client (user data), if it is not active then ignore the login to the system


texts: Magento2: How to create Configurable products with associate simple products pragmatically by CSV data with root script

texts: How to create Configurable products with associate simple products pragmatically by CSV data by root file.


texts:
I want to override this class

  vendor/magento/module-sales/view/adminhtml/ui_component/sales_order_grid.xml

Actually I want to make customize the Grand Total Column in sales order grid

<column name="base_grand_total" class="Magento\Sales\Ui\Component\Listing\Column\Price">
    <settings>
        <filter>textRange</filter>
        <label translate="true">Grand Total (Base)</label>
    </settings>
</column>

I want to give a custom class for this column value

which directory can I make to override this class ?

Can anyone help me?


texts:
I have a block which basically serves 3 sections of a page. I want to cache the respective block but one of the section doesn't need to be cached.
I am new to Magento and even newer to the caching part of it.
I've overwrote the getCacheKey() and getCacheTags()to have some custom functionality.
Is there a way to partially cache a block?


texts: Current base_url (secure/unsecure?) in block

texts:
I want to make some links in a CMS static block. I use one of the base_url variables... for example:

Account

I can make it either secure or unsecure... however I don't know if there's a way (I haven't found one, however searching is proving difficult) to have the "current" base_url: if the user is on https then use the secure, if the user is on http then use the unsecure.

Is that possible at all on CMS static blocks?


texts:
SELECT main_table.sku, main_table.order_id, main_table.parent_item_id, main_table.name, main_table.product_id FROM sales_order_item AS main_table
WHERE (order_id = '3')
AND (parent_item_id IS NULL)
AND
(
(sku LIKE 'WSH06%') OR (sku LIKE 'MS10%') OR (sku LIKE 'MT08%')
)
$sku = ['WSH06','MS10','MT08'];
$this->itemF ->create()->getCollection()
                       ->addAttributeToSelect('sku')
                       ->addAttributeToSelect('order_id')
                       ->addAttributeToSelect('parent_item_id')
                       ->addAttributeToSelect('name')
                       ->addAttributeToSelect('product_id')
                       ->addAttributeToFilter('order_id', array('eq' => $order_id))
                      ->addAttributeToFilter('parent_item_id', array('null' => true));
foreach ($sku as $key => $value) {
    $collectionData->addFieldToFilter('sku',array('like' => $value.'%'));
}


texts: CMS Home Page does not retain saved hrml

texts:
After saving html to the home page (under CMS > Pages > Home), Magento 1.9.1.1 does not retain all of what was saved!

I have tried this many times.  I write the code and save.  When I go back to modify or add other changes to the layout, what I had saved is no longer their.

What it's even more strange it retains some html but deletes others. It has a mind of it's own.

ps. I am using the rwd theme, but have changed the theme to default also, but it behaves the same way.

Any ideas why this is happening?


texts: Initiating OAuth Integration From An Extension

texts:
Reading the Magento guides only leaves a bit clueless how to easily to setup a OAuth access with an Extension.

The confusion is mostly is these 3 vague statements:

"You can register Integration through Magento Connect"
"Magento Connect generates a configuration file"
"you can manually create the configuration file and make it available to merchants"

I would like my extension to initiate the OAuth authentication process without having for the Administrator to manually add a new integration.  Preferably, using this "configuration file" (whatever that might be) and starting the OAuth "activate" process (from the Integrations section).

How is this possible?


texts: Magento 1.9 add product to cart only if product is not in the cart

texts:
I'm adding product to the cart but I want to add the product ONLY if the product quantity of this product is 0.  In other words, only add if this product hasn't been added before.  I added this && $qty equal to 0 but that's not working.

Can someone help?

if ($item->getData('product_id') == $productId) && $qty == 0) {

     $cart     = Mage::getSingleton('checkout/cart');
     $addprod  = 121212;
     $qty      = 1;

     $quote  =  Mage::getSingleton('checkout/session')->getQuote()
         ->addProduct( Mage::getModel('catalog/product')
         ->load($addprod), $qty)->save();
     cart->save();
}


texts: Magento 1.8 Some orders did not generate an invoice (flat tables were not disabled)

texts:
Culprit: Human mistake: Flat Tables Were Enabled when order was set to 'process': Invoice is not generated.

    I need to retrieve all processed orders with no invoice. An SQL query could do that. Has anyone experienced that issue and has suggestions ?


texts: How to get product Tax details in cart without customer login

texts:
I am using magento 1.8.
I have some issue when customer say checkout.

I have listed all the items with details QTY, PRICE, DISCOUNT TAX TOTAL PRICE etc.
I am unable to show the TAX

$products = Mage::getSingleton('checkout/session');
foreach($products->getQuote()->getAllItems() as $item)
{
  $productWeight = $item->getWeight();
  $productExPrice  = $item->getPrice(); // price excluding tax
  $productIncPrice = $item->getPriceInclTax();
}

used this code but I am not getting price include tax

I checked system->configuration->tax config. I have set Quebec as my default tax state,
I am unable display the tax price of cart product

Any suggestion.
Thanks.


texts: Best way to display category description on first page only

texts:
What is the best way to only show the category description on the first page of a category?

I found the following way but not sure if it is the best:

 <?php $currentPage = (int) Mage::App()->getRequest()->getParam('p');
    if($currentPage <= 1): ?>

            <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>                 <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>

    <?php endif; ?>


texts:
I am creating a module that will add a custom field for bundle product. For that I came to a situation in which, I have to overwrite the core block Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option. However my overwriting seems to be not working.

More specific to the problem, I need to overwrite

__construct() - This method is using to set the template that is need to render for options (When we click on Add Options under tab Bundle Items in bundle product edit page, this template is going to render). Currently it is set to template app/desig/frontend/<package>/<theme>/bundle/product/edit/bundle/option.phtml. I need to set it to a custom option.phtml file so that I can add my custom field without altering any code in core files.
getOptions()  - need to edit this function also. This is also essential, since I need to set details of my custom field along with details of existing fields in this function.

What I have tried

etc/config.xml

 <config>
     ----
     <global>
         ------
         <blocks>
             <bundle>
                 <rewrite>
                     <adminhtml_catalog_product_edit_tab_bundle_option>
                           Programmerrkt_Customfieldinbundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option
                    </adminhtml_catalog_product_edit_tab_bundle_option>
                </rewrite>
             </bundle>
     </global>
 </config>

Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php

 <?php
Programmerrkt_Customfieldinbundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option extends Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option
{

    /**
     * Bundle option renderer class constructor
     *
     * Sets block template and necessary data
     */
    public function __construct()
    {

        $this->setTemplate('programmerrkt/customfieldinbundle/bundle/product/edit/bundle/option.phtml');
        $this->setCanReadPrice(true);
        $this->setCanEditPrice(true);
    }
}

However this overwriting seems to be not working.After including this code in my module, when I click on Add Options, the button is not working at all.

So my question is,

what should I do if I want to alter this default class ?

Whether I am in right direction ?

Is it even possible to do this ?

Eagerly waiting for responses. Thanks.


texts:
After sign in to account, page redirect to my account page and click on some other page and again click on my account link not working.
 My code:

    <?php if ($block->isLoggedIn()): ?>
        <a href="<?php echo $block->getAccountUrl() ?>">
            <?php echo __('My Account') ?>

   <?php endif; ?>


texts:
Is there somewhere or somehow a list with the things you can define in your transactional e-mails from magento.

For example, you can get the total price with:{{var order.getGrandTotal()}} and the name with {{var order.getCustomerName()}}.

I want to redesign all the e-mails that are send through Magento 1.9 and want to know which how and which values i can load in the e-mails.

Another question besides this: how can i get the prices with a decimal number, now i have 199 but i want 199,00. This is how i get the value: {{var order.getGrandTotal()}}

Regards,
Robert


texts: What is the restriction on flat catalog if my store has more than 500K SKUs?

texts:
I have a customer with more than 5 million products and 2500 attributes. They are using
an external system to push products to specific ecommerce sites. They would like to push 500,000
product to their Magento and these products include 900 attributes. 200 of which are text fields.
In additional to enabling flat catalog, which solution can to meet their requirement?
A. Convert the text field attributes to dropdowns or combine to description
fields
B. Use Magento websites w aired traffic to specific stores
C. Ask the client to only use 250,000 SKUs along with new attribute sets
D. Convert attributes types to use a custom extension


texts: How can i get "Sort By" method in this page, $productListToolbar doesnt include sort by position method.


texts: File not found. After adding 301 redirect - Magento 2

texts:
I've added a permanent 301 redirect to my Magento 2 store to remove .html
from my category and product urls by adding the following code to my website .conf file - I'm using Apache

redirectMatch 301 ^(.*)\.html $1

The redirect works fine as I don't get any 404 errors for existing products and categories that have .html in the url but now I have another problem.

I am now getting 404 errors for static content even though I have deployed them on the frontend and backend/admin

If I remove the 301 everything loads a normal. Does anyone know what I've done wrong?


texts: Find all Simple Products without category. Assign Cat to simple Product who is child of configurable

texts:
We have many Simple Products without an assigned category.
Now i need to find all Simple Products by scripts which don´t have a category.

My idea was:

Find all configurable products who have simple products. Read the categoryid of the configurable and assign it to the childs simple products.

How can I get all configurables with childs?
How can I assign the categorys to simple products by script?

Andre


texts: Newb question - Mageplaza SMTP installed but still regular php mail being used. Where to change default? - Magento 2

texts: Hi all I installed the MagePlaza SMTP plugin, but the emails are still going through php mail and NOT my new SMTP settings through the plugin? Where do I change those settings? Is there a php file I need to update?


texts: Magento 2 Translate message im adminhtml auth login

texts: i want to translate two messages in the logging panel to CMS (The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later. and Incorrect CAPTCHA.). Before updating to magento 2.4.2, the translations worked. I'm using the design/adminhtml/theme/i18n/lang.csv file to translate the cms panel.


texts:
I am using Magento 1.9.2.4 and my Magento Connect is not working. Whenever I click check for updates, everything from the bottom disappears, please check the image below:

When I try to update Magento via SSH I get the following error:

  ./mage mage-setup
  Running initial setup...
  Success
  Success
  PHP Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /xxxxxxxx/downloader/lib/Mage/HTTP/Client/Curl.php on line 446

When I open the file, this is the code on that line:

  public function isAuthorizationRequired()
      {
          if (isset($_SESSION['auth']['username']) && isset($_SESSION['auth']['password'])
              && !empty($_SESSION['auth']['username']))
          {
              return true;
          }
          return false;
      }

I tried commenting out the line but then it gives an error for the next function and so on. I have already tried the unknown cipher in list fix as well but no success. Please guide me about this issue.


texts: Magento 2 data migration error ConfigurablePrices step mismatch of entities:catalog_product_entity_decimal

texts:
I'm migrating data from M1 v1.8.0.0 to M2 v2.2.0, and receiving this error at the volume check for ConfigurablePrices:

  [2018-01-08 05:56:59][INFO][mode: data][stage: data migration][step: ConfigurablePrices step]: started
  100% [============================] Remaining Time: < 1 sec
  [2018-01-08 05:57:00][INFO][mode: data][stage: volume check][step: ConfigurablePrices step]: started
  100% [============================] Remaining Time: < 1 sec
  [2018-01-08 05:57:00][ERROR]: Mismatch of entities in the document: catalog_product_entity_decimal

The mismatch is due to 23 records being added to the M2 catalog_product_entity_decimal table that isn't in the M1 table.

I don't understand where this is coming from. I've done more migrations process but every time I get this ERROR.

Anyone has idea about this error?


texts: Serve resources from a consistent URL - 2 images URL for single product, same image

texts:
I have one image for all three small, base and thumnail.

However, when I am uploading a product , and selecting three options, magento automatically takes this as 2 image URLS in 2 different folder for a single product upload.

Can anyone advise how to assign single image URL in magento for a product.

Below is the URLs for single product upload
For ex: http://www.akkoda.com/media/catalog/product/cache/1/small_image/300x/17f82f742ffe127f42dca9de82fb58b1/A/K/xAK102.jpg.pagespeed.ic.a5_c7F3nFd.jpg

http://www.akkoda.com/media/catalog/product/cache/1/thumbnail/300x/17f82f742ffe127f42dca9de82fb58b1/A/K/xAK102.jpg.pagespeed.ic.a5_c7F3nFd.jpg


texts:
I want to add a line below my subcategory link like in this website:

In the menu go to soin du visage and you can see black line like below in par type de soin.

How can I do ?

Thanks


texts: Prices do not work with Layout Type Controller for Products

texts:
I am trying to create a controller than I am using to load products into a page via ajax. However when i set the controller to just be of type layout the pricing no longer shows. However when using a standard page the prices show fine:

<?php

namespace Harrigo\ContractPricing\Controller\ContractProducts;

use Magento\Framework\Controller\ResultFactory;

class AjaxProducts extends \Magento\Framework\App\Action\Action
{

    protected $resultPageFactory;

    /**
     * Constructor
     *
     * @param \Magento\Framework\App\Action\Context  $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        $this->_resultFactory = $context->getResultFactory();
        parent::__construct($context);
    }
    /**
     * Execute view action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
            $resultLayout = $this->_resultFactory->create(ResultFactory::TYPE_LAYOUT);
            return $resultLayout;

    }
}

  This however shows pricing fine:

<?php
namespace Harrigo\ContractPricing\Controller\ContractProducts;

use Magento\Framework\Controller\ResultFactory;

class AjaxCategory extends \Magento\Framework\App\Action\Action
{

    protected $resultPageFactory;
    /**
     * Constructor
     *
     * @param \Magento\Framework\App\Action\Context  $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    /**
     * Execute view action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        return $this->resultPageFactory->create();
    }
}

Both use the same block level code and templates.

Have also attempted to use controller like so:

<?php
namespace Harrigo\ContractPricing\Controller\ContractProducts;

class AjaxProducts extends \Magento\Framework\App\Action\Action
{
    protected $resultLayoutFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\LayoutFactory $layoutFactory,
        \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory
    ) {
        $this->layoutFactory = $layoutFactory;
        $this->jsonResultFactory = $jsonResultFactory;
        parent::__construct($context);
    }

    /**
     * Execute view action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $productsBlockHtml = $this->layoutFactory->create()->createBlock('Harrigo\ContractPricing\Block\Index\Pricing')->setTemplate('Harrigo_ContractPricing::index/ajaxproducts.phtml')->toHtml();
        return $this->jsonResultFactory->create()->setData(['html' => [
            'products_list' => $productsBlockHtml
        ]]);
    }
}

However pricing just stops showing still.


texts: How can I add custom js file and js file in magento 2 using requirejs

texts:
How can I add custom js file and compile using requirejs file in magento 2 ?

please give me details for this process.


texts: How to override Virtual Type class in Magento 2

texts:
How to override VirtualType block in Magento 2, I want to override following virtual type block with my own block,

<virtualType name="Magento\CatalogSearch\Block\SearchResult\ListProduct" type="Magento\Catalog\Block\Product\ListProduct">
   <arguments>
       <argument name="catalogLayer" xsi:type="object">Magento\Catalog\Model\Layer\Search</argument>
   </arguments>
</virtualType>

So I tried to override it from my custom module di.xml like this,

<preference for="Magento\Catalog\Block\Product\ListProduct" type="My\Vendor\Block\Product\ListProductSearch" />

But it does not work.

So, what is the proper way of overriding a virtual type class in Magento 2?


texts: Magento 2 : How to Display Cart Price Rule on Product Page?

texts:
I started in Magento 2 a week ago and don't know much about it, I created a Cart Price Rule named "10% billet discount" that is applied in a few items, with specific attributes.

I want to display this Rule on specific products page that the rule is applied. There is a way that I can do that?


texts: Magento2 Checkout page Not Working After Installing New theme

texts:
Highly appreciate any help
I have installed Porto thee to my existing magento store that was built in Luma Theme

I successfully installed Porto Theme and it's modules but my checkout page not working after installing theme even when i click on add to cart button of any product it shows product added in cart . also cart page work fine. but when i click checkout button it go to blank page. Please advice thanks alot in advance.


texts: SQLSTATE[23000]: Integrity constraint violation when searching on frontend

texts:
On my frontend when I type anything in the search box I get the following error:

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'position' in order clause is ambiguous, query was: SELECT `main_table`.`entity_type_id`, `main_table`.`attribute_code`, `main_table`.`attribute_model`, `main_table`.`backend_model`, `main_table`.`backend_type`, `main_table`.`backend_table`, `main_table`.`frontend_model`, `main_table`.`frontend_input`, `main_table`.`frontend_input_renderer`, `main_table`.`frontend_label`, `main_table`.`frontend_class`, `main_table`.`source_model`, `main_table`.`is_global`, `main_table`.`is_visible`, `main_table`.`is_required`, `main_table`.`is_user_defined`, `main_table`.`default_value`, `main_table`.`is_searchable`, `main_table`.`is_filterable`, `main_table`.`is_comparable`, `main_table`.`is_visible_on_front`, `main_table`.`is_html_allowed_on_front`, `main_table`.`is_unique`, `main_table`.`is_configurable`, `main_table`.`apply_to`, `main_table`.`position`, `main_table`.`note`, `main_table`.`is_visible_in_advanced_search`, `main_table`.`is_used_for_price_rules`, `main_table`.`is_filterable_in_search`, `main_table`.`used_in_product_listing`, `main_table`.`used_for_sort_by`, `additional_table`.*, `entity_attribute`.`attribute_id`, IFNULL(al.value, main_table.frontend_label) AS `store_label` FROM `eav_attribute` AS `main_table`
 INNER JOIN `catalog_eav_attribute` AS `additional_table` ON additional_table.attribute_id = main_table.attribute_id
 INNER JOIN `eav_entity_attribute` AS `entity_attribute` ON entity_attribute.attribute_id = main_table.attribute_id
 LEFT JOIN `eav_attribute_label` AS `al` ON al.attribute_id = main_table.attribute_id AND al.store_id = 1 WHERE (main_table.entity_type_id = 4) AND (`entity_attribute`.`attribute_set_id` IN('4')) AND (`additional_table`.`is_filterable` > 0) GROUP BY `entity_attribute`.`attribute_id` ORDER BY position ASC

Now, to overcome this I have amended the getFilterableAttributes() function found in ~/app/code/core/Mage/Catalog/Model/Layer.php to:

     public function getFilterableAttributes()
    {
//        $entity = Mage::getSingleton('eav/config')
//            ->getEntityType('catalog_product');

        $setIds = $this->_getSetIds();
        if (!$setIds) {
            return array();
        }
        /** @var $collection Mage_Catalog_Model_Resource_Product_Attribute_Collection */
        $collection = Mage::getResourceModel('catalog/product_attribute_collection');
        $collection
            ->setItemObjectClass('catalog/resource_eav_attribute')
            ->setAttributeSetFilter($setIds)
            ->addStoreLabel(Mage::app()->getStore()->getId())
            ->setOrder('main_table.position', 'ASC');
        $collection = $this->_prepareAttributeCollection($collection);
        $collection->load();

        return $collection;
    }

This fixes the issue, but now I want to correct the actual problem, I get the error is in laymen terms saying that the position column is present more than once in the query so doesn't know which once to select. But, I cannot see why this is happening. Running the query direct on the database I am able to see position is in the result twice. Would this indicate my database has the position as a duplicate?

Investigating further I found an anomaly, the eav_attribute table seems incorrect, as on a new install I have 17 fields and on my current db I have 33:

New install eav_attribute structure:

Normal installs eav_attribute structure:


texts: How to add files for custom module under system configuration?

texts:
I have my own module in System->Configuration and want to add js and css files for it. Now it is so:

<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
            <action method="addCss"><name>mymodule.css</name></action>
        </reference>
    </default>
</layout>

This way files added to all Admin pages. What to do to add this files just to one page, so write not default, but mymodule_admin or smth like that?


texts: Set a form element in error in case Save Form Failed

texts:
I am validating my Custom Admin form on the server side.
In the model, on _beforeSave() I throw an exception if there is something wrong with a specific field.

Now, the point is that the error from the exception is catched in the save of the controller :

    try {
    ...
        } catch (Exception $e) {
                                    Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                                    Mage::getSingleton('adminhtml/session')->setFormData($data);

$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
                                    return;
                                }

and will be displayed on the top of the page (addError), how can I put some kind of focus on the field that should be fixed?
Anything that can be done without using Javascript?

Thanks


texts: Will quote be removed after order created?

texts: Currently when I look in database, the quote of order still exist after order successfully created. Will the order quote be removed later under some conditions? What happens to order if associated quote removed and vice versa?


texts: Why is the file permissions check failing?

texts:
The File Permissions Check fails during the Readiness Check for Magento 2.1.0 Setup. I am consulting Set pre-installation file system ownership and permissions but to no avail.

I am running Fedora on an Amazon EC2 instance. The web server user and group is apache, command line user is fedora and currently the owner and group of the Magento install directory and its contents is root.

I have tried setting the group and owner of the Magento install directory and its contents to several combinations including apache:apache, root:root (current), fedora:apache and fedora:fedora. I have also recursively set the permissions to 664 and 644 for files and 755 for directories yet,

/var/www/html/app/etc
/var/www/html/var
/var/www/html/pub/media ; and
/var/www/html/pub/static

are apparently not writable.

Can anyone share some insight? This is my first time setting up Magento not using a quick start or quick install option and using an AWS VPC.

EDIT: I have performed a clean install, the Magento install dir is owned by a seperate user (magento_user) that belongs to the web server group apache. All files and directories are owned by magento_user:apache and permissions for var, pub etc. updated to 0664 and 2755 for files and directories respectively. The bin/magento to 0744.


texts: Magento 2.2.5 - Backups User Roles Permission

texts:
I'm using Magento 2.2.5.

Steps to reproduce:

System -> Permission -> User Roles
Backups

  Sorry, you need permissions to view this content

How to fix it?


texts:
I'm currently running Magento 2.2.1 and want to create links to a specific store view.

Each store view is translated to a certain language, and I'd like that links placed on blogs written in that language go directly to the respective store view.

I've tried adding the __store=pt query parameter but in Magento 2 this doesn't seem to work. Apparently the store switcher uses a POST call, which I can't do if I'm linking from another site.

Is there something else I can do?


texts: Magento 2 : How to Override /vendor/magento/module-quote/Model/Quote/Address/Total/Grand.php

texts: Not able to override grand.php file can anyone help me out.


texts: what is meaning of '&' combined with when expression in magento2 less file?

texts:
& when (@media-common = true) {

what is the meaning of '&' here?
it was Parent Selectors?


texts: Group products are not showing after import

texts: I have imported group products.It works fine in admin but products are not showing in frontend.Is there any solution for it?


texts: Magento2 remove All Previous addresses on checkout page when selecting shipping address

texts: When i checkout as a logged in user, and if i have added my address in an earlier purchase, i am presented with previous addresses which i have entered on checkout page. I want to add fresh address each time even i am logged in and i have already default addresses.


texts: So I was wondering how I go about back-ending this, im a fairly good developer just not sure how to tell Magento todo I guess CMS the data. So the products I have are 8 juices, you cannot buy the juices on their own, you have to purchase them as part of a pack of a configuration of 6 juices to make a pack. Each pack has its own price. Each one of these packs exist as part of a large product. So at a top down solution, there are 3 packs, standard, standard x, standard xl, each one of those packs contain, 3 packs of their own, 1 day, 3 day, and 5 day, and each one of those packs contain, 6 juices. Only the Day packs have prices associated to it. How do i go about doing this??


texts:
I am using Magento 2.2 for my store. I have created a custom attribute. I have modified list.phtml and catalog_product_view.xml and I have created a myatrribute.phtml. I have also enabled visible in storefront to yes for the attribute.

I have done re-indexing and flushed the cache.

My attribute is showing in product view and category view. The attribute is not showing in the Homepage category list.

Any idea how I can enable the attribute in homepage category list.

My custom attribute phtml file:

<?php
echo $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getMunit(), 'munit');
?>


texts: Magento2 error while updating product URL keys

texts:
Getting this error while importing produdct for updating product URLs

  SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
  update a child row: a foreign key constraint fails
  (catalog_category_product, CONSTRAINT
  CAT_CTGR_PRD_CTGR_ID_SEQUENCE_CAT_CTGR_SEQUENCE_VAL FOREIGN KEY
  (category_id) REFERENCES sequence_catalog_category (sequenc),
  query was: INSERT INTOcatalog_category_product
  (product_id,category_id,position) VALUES (?, ?, ?), (?, ?, ?),
  (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?,
  ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?,
  ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?),
  (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)
  ON DUPLICATE KEY UPDATEproduct_id= VALUES(product_id),
  category_id= VALUES(category_id`)


texts: magento 2 - downloadable file link is not working

texts:
I am facing issues about downloadable link. The download able link from email after purchase documents is taking to login page.

It is not downloading the product.

I have tried many solution but nothing work.

can any one suggest me any solution to fix this problem?


texts: Magento 2 : 403 Forbidden Error on Checkout Through PayPal Express Checkout

texts:
I getting this error while checkout through PayPal Express checkout. I don't know what is wrong. Anyone tell me if its PayPal configuration Error or something else along with Step by Step solution.

Also When i Tried to checkout through PayPal Sandbox buyer account i am getting this all time :


texts: Magento setup:upgrade fails with "Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'."

texts:
We recently purchased software that runs as an extension for Magento 2. We purchased a brand new VPS setup, and turned it over to them for installation. They completed the installation and got their product working, and turned the site/server back over to us, and everything seemed to be working fine.

I've been attempting to install some additional extensions through Magento's web component wizard, and kept getting the following error at the Cron readiness check:

Cron script readiness check failed.

Error from Updater Application Cron Script:
Cron job has not been configured yet

We configured the Cron Tasks and attempted to run them with bin/magento cron:run but then recieve the following error:

[Magento\Framework\Exception\LocalizedException]
Invalid Document
Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'

The same error is also generated when attempting to run magento setup:upgrade

I'm fairly new to the Magento platform, and am in the dark as to exactly how everything was configured during installation since a third party installed it, so my question is how do I go about tracking down the source of this error? I've looked through just about every log I can find and can't seem to find it.

XML that has been modified/added:

<?xml version="1.0"?>
<config_detail>
<url_detail>
   <appname></appname>
   <base_url></base_url>
</url_detail>
<Integration_detail>
    <accessToken></accessToken>
</Integration_detail>
<designer_tool_dbconnection>
    <host></host>
    <dbuser></dbuser>
    <dbpass></dbpass>
    <dbname></dbname>
</designer_tool_dbconnection>
</config_detail>


texts: PHP version error while run composer in magento 2

texts:
I am using Magento 2.2.6, i am trying to run composer. but its shows php version error.

where as my php version is set correctly. please check the attached screenshot.

please help me to fix this.


texts: Passing multiselect via form with getRequest()->getParam in admin module

texts:
I have an admin module and cannot get the multiselect to pass properly to the observer

        $fieldset->addField('hidden_field', 'hidden', array(
            'name' => 'hidden_field',
            'value' => '1',
        ));

      $fieldset->addField('tester', 'multiselect', array(
        'label' => 'label',
        'class' => 'required-entry',
        'required' => true,
        'name' => 'tester',
        'onclick' => "return false;",
        'onchange' => "return false;",
        'value' => '4',
        'values' => array( '-1'=> array( 'label' => 'Please Select..', 'value' => '-1'),'1' => array( 'value'=> array(array('value'=>'2' ,'label' => 'Option2') , array('value'=>'3' ,'label' =>'Option3') ), 'label' => 'Size'  )),
        'disabled' => false,
        'readonly' => false,
        'after_element_html' => '<small>Comments</small>', 'tabindex' => 1
      ));

Now when i save these,

The following is passed ok to the observer

Mage::app()->getRequest()->getParam('hidden_field'); //returns 1

The following multiselect however returns nothing

Mage::app()->getRequest()->getParam('tester'); //returns nothing

if i check the url of the request it looks to me malformed

   [_requestUri:protected] => /index.php/ecms/customer_group/save/key/df52e912e14b962bc721d111729a4e7a?tax_class=3&id=0&hidden_field=1&tester%255B%255D=2&tester%255B%255D=3&tester%255B%255D=4&tester%255B%255D=5&thetitle=mytitle

What part of the process am i getting wrong with this?


texts:
I am using Magento 1.6. Here I want to use UPS shipping method. But in the backend I have not seen userid, pass, access key in UPS settings.

But I have all seen these options in magento 1.9.

So please guide how to set up UPS for magento 1.6


texts: `MySQL server has gone away` during long running cron

texts:
I have a series of stock importers, all of which run of mostly the same code, each with a few tweaks, with regards to how they fetch their stock data from different suppliers.

These all run off cron, however, I'm running into issues with one of them - it fetches its data by API which is rate limited to 1 req/s, because of this the data fetching takes about 15 minutes.  After this, it attempts to get the size of a previously fetched product collection, for logging purposes.  At this point the process crashes out with a 2006 MySQL server has gone away error.

I've tried increasing various timeouts and changing some MySQL settings to no avail, e.g.

        ini_set('mysql.connect_timeout', 14400);
        ini_set('default_socket_timeout', 14400);
        ini_set('mysql.allow_persistent', 1);

I've been talking to the server hosting company who insist it's a code issue, but it still feels like some form of timeout.

What settings should I be looking into?  It always crashes out at the same point if data is fully fetched - if I modify the script to test, e.g. by using dummy data instead of taking the time to fetch it from the supplier, no SQL error occurs.


texts:
In Magento 1. I have the following code:

$form =  $this->getLayout()->createBlock("core/template")->setTemplate("contacts/form.phtml")->toHtml();

Need Help something similar for Magento 2


texts:
I am using magento v1.9.2 facing a issue, and also looking for idea how to achieve this.

I have product which say 'shirt' in 4 colors and each color have some variation images. I sucessfully done the configure products but facing two issues.

  When I select the color let suppose green and then I select size, the big/main image change to default image(i.e black), but if I select
  size first and then color, then the main images show the selected
  one(i.e Green)
  after click buy now, the cart shows black color instead of which I selected.   but its shows selected sku in order tab in admin section.

Also I am looking for some reference, if I have some variation of each product like say green. then how can I show the images only related to green.

Should I create group product?

Any suggestions always welcome..


texts: how to override adminhtml block for a function?

texts:
Urapidflow has an issue which casued by a security patch and even their new version does not resolve the issue,
the path for module file that I want to write an override is:

app\code\community\Unirgy\RapidFlow\Block\Adminhtml\Profile\Edit\Tab\Upload.php

anyways I have to rewrite the following:

  $this->getUploader()->getConfig()

this should be

 $this->getUploader()->getUploaderConfig()

to work fine. here is the module path:
Unirgy_RapidFlow_Block_Adminhtml_Profile_Edit_Tab_Upload

I am creating a module to rewrite the functions inside it, here is what I did:

app\code\local\Scosche\Unirgy\etc\config.xml

<config>
    <modules>
        <Scosche_Unirgy>
            <version>0.0.1</version>
        </Scosche_Unirgy>
    </modules>
    <global>
        <blocks>
            <scosche_unirgy>
                <class>Scosche_Unirgy_Block</class>
            </scosche_unirgy>
             <unirgy_rapidFlow>
                <rewrite>
                    <adminhtml_profile_edit_tab_upload>Scosche_Unirgy_Block_Adminhtml_Profile_Edit_Tab_Upload</adminhtml_profile_edit_tab_upload>
                </rewrite>
             </unirgy_rapidFlow>
        </blocks>
    </global>
</config>

This is wrong for some reason I created the same folders and path on scosche module but although I can see module is active in Advanced configuration, it is not working,
app\code\community\Unirgy\RapidFlow\etc\config.xml:

<blocks>
    <urapidflow><class>Unirgy_RapidFlow_Block</class></urapidflow>
</blocks>

please let me know what's wrong.


texts: Magento 2: "All in Column" does not work if actions column is not present in the grid

texts:
I have built a custom grid where I have only 3 columns, i.e. Category and Priority, and the Mass Action column.

Since the priority field is the only field which can be changed, so I don't want Edit action in the grid.

Now the problem is that if the Actions column is not present in the grid, the field "All in Column" does not work in the mass edit action.

This functionality does not work, because the Apply button becomes hidden if the Actions column is not visible in the grid.

Is there any way to make it work?


texts: Middle name in billing/shipping name (backend + mail)

texts:
I have enabled the middle name feature of Magento and it works perfectly for the complete shipping/invoice address fields, however, in the Admin interface, things like the "Bill To Name", "Ship to name", invoice names, etc are all without the middle name. I'd like to have the middle name in it, mostly because in the (default) mailtemplates the references are to that name.

For instance, when I sent out the confirmation e-mail, the shipping address has the correct name "Hendrik van Dijk", but the mail starts with "Dear Hendrik Dijk". I may be able to fix this by changing the templates, but I think it's cleaner and better to correct it so it also shows correctly in the backend.

Someone knows how to do this?


texts:
I am trying to display my top navigation like this:

 _________________
 | Main Category |
 |_______________|
        |
    (on hover)
        |     _________________________________________________
        |     |                                               |
        |-->  |  Category 1.1   Category 1.2    Category 1.3  |
              |  _____________  _____________   _____________ |
              |  Subcat. 1.1.1  Subcat. 1.2.1   Subcat. 1.3.1 |
              |  Subcat. 1.1.2  Subcat. 1.2.2   Subcat. 1.3.2 |
              |  Subcat. 1.1.3  Subcat. 1.2.3   Subcat. 1.3.3 |
              |_______________________________________________|

So my goal is to list the subcategories below the parent category, directly in the ul.level0 dropdown, instead of having them inside of another ul (ul.level1).

I know there are several extensions that would allow me to do this, but it seems they all offer too much functionality and therefore have a huge impact on store performance while I could probably achieve the same result with a simple template change adding no extra page load.


texts: How to remove the empty borders when there is no loaded image in admin grid

texts:
In my custom admin module I have the uploader image column grid, so when I have an image everything is fine, but when I haven't there are empty borders that is displayed and area is also cliquable.

Does someone know how to remove these empty borders and also the click image popup when there is no image. I don't want to do it bad with some js.

vendor_name_listing.xml

<column name="storefinder_image" sortOrder="21" class="Vendor\name\Ui\Component\Listing\Column\Thumbnail">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/thumbnail</item>
            <item name="sortable" xsi:type="boolean">false</item>
            <item name="has_preview" xsi:type="string">1</item>
            <item name="label" xsi:type="string" translate="true">Image</item>
        </item>
    </argument>
</column>

Thumbnail.php

<?php
namespace Vendor\Name\Ui\Component\Listing\Column;

use Magento\Catalog\Helper\Image;
use Magento\Framework\UrlInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Ui\Component\Listing\Columns\Column;

class Thumbnail extends Column
{
    /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    protected $storeManager;

    /**
     * @param ContextInterface $context
     * @param UiComponentFactory $uiComponentFactory
     * @param Image $imageHelper
     * @param UrlInterface $urlBuilder
     * @param StoreManagerInterface $storeManager
     * @param array $components
     * @param array $data
     */
    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        Image $imageHelper,
        UrlInterface $urlBuilder,
        StoreManagerInterface $storeManager,
        array $components = [],
        array $data = []
    ) {
        $this->storeManager = $storeManager;
        $this->imageHelper = $imageHelper;
        $this->urlBuilder = $urlBuilder;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

    /**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
    public function prepareDataSource(array $dataSource)
    {
        if(isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach($dataSource['data']['items'] as & $item) {
                $url = '';
                if($item[$fieldName] != '') {
                    $url = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . $item[$fieldName];
                    $item[$fieldName . '_src'] = $url;
                    $item[$fieldName . '_orig_src'] = $url;
                    $item[$fieldName . '_link'] = $this->urlBuilder->getUrl(
                    'name/store/edit',
                    ['id' => $item['entity_id']]
                );
                }
            }
        }

        return $dataSource;
    }
}


texts: Show Admin value of an attribute in Magento 2

texts:
In Magento 1.x I could show the Admin value of an Attribute like this:

_product->getAdminAttributeText('bleach')

But it doesn't work in Magento 2. How can I show the Admin value of a dropdown list in Magento 2?


texts: Db engine support for M2 other than mysql

texts:
TL;DR: Why does M2 not support other db types other than mysql?

Long version:

This is not a philosophical question or an opinion based one. I'm asking why does M2 not support other db engine from the technical point of view.

What are the specific pieces of code that are only mysql compatible and that would require too much work to make it db agnostic?

I don't need a full list, but a few examples like "In this class / file insert class name and/or github link this piece of code is used insert code here that only works on mysql".


texts:
I got a suspicious email which looked pretty legit today and wanted to share with the community and maybe people who are more security savvy than me can tell me more about this Phishing attempt.

Basically it's an email from a 'customer' who says they have put in the wrong address and add a link to the email to what looks like your own website that looks like:

[yourwebsite]/order/view/order_id/key/1ee0a069b22ac438e25ad3acbc4a3bcb/

It contains a link to :

https://www.magepanel.info/[yourwebsite]/admin?next=https://[yourwebsite]/order/view/order_id/key/02c9bfb2a970ab62ef8643a47e646064

Does anyone know what type of exploit this is and what it does if you click it?

Thanks!


texts: Can't using plugin for checkQty in StockStateProvider Magento 2

texts:
I am trying to using plugin to return checkQty() to true to skip validate this but I can't. I don't know why?

public function aroundCheckQty($subject, callable $proceed, StockItemInterface $stockItem, $qty) {
      return true;
}

di.xml:

<type name="Magento\CatalogInventory\Model\StockStateProvider">
        <plugin name="QtyCheck" type="Bss\PreOrder\Plugin\QtyCheck" />
    </type>

Looking for help on this.


texts: Catalog Price Rules Ignored On Quote Conversion

texts:
I have a catalog price rule that has been running for more than a month.  We haven't had any issue with customers getting their savings.  However, 2 orders came through recently in which the catalog price rule was not applied to the order after it was converted from the quote.  Customers claimed the savings were visible during checkout, but they were charged full amount and no discount is shown in the order overview.  The products they ordered were definitely on sale at the time of the problem.

Orders have come through since and between the two incidents with no issues.

While trying to debug the issue, my credit card was rejected, after which the catalog price rules were ignored and I saw full price items in the cart.

Payment method is Auth.net if that's any help.

Magento version 1.7.0.2

Is there any condition in which a quote would ignore catalog price rules?


texts: Magento 2.3.x: How can change the position of STORE-SWITCHER on product details page

texts:
I create two store US  and IN.
 I want to  move this store swither on product details page just in the place of US-tax rule check below images.
any help will be appreciated.


texts: how can i get products which are sorted in recently added manner?

texts: I need to display products sorted based on the recently added function in products list page.


texts:
I've added 'p' tags to a textarea in a custom widget, but it seems like it breaks the edit functionality. In other words, after adding html tags the widget no longer shows up as a clickable element in the WYSIWIG, it renders out as text.

It looks like I can edit the attributes directly, but I'm setting this up for a client so need this to be as simple as possible. Is there any way I can add html tags and still retaing the clickable functionality to edit the widget values?


texts:
I am trying to get at Category Images from within Magento_Catalog\template\navigation\left.phtml.  This file shows a list of sub-categories.

This is that file:

<?php if (!$block->getCategory()) {
    return;
} ?>
<?php $_categories = $block->getCurrentChildCategories(); ?>
<?php $_count = is_array($_categories) ? count($_categories) : $_categories->count(); ?>
<?php if ($_count): ?>

            <?php /* @escapeNotVerified */ echo __('Shop By') ?>

            <?php /* @escapeNotVerified */ echo __('Shopping Options') ?>

<?php /* @escapeNotVerified */ echo __('Category') ?>

                        <?php foreach ($_categories as $_category): ?>
                            <?php if ($_category->getIsActive()): ?>

                                    <a href="<?php /* @escapeNotVerified */ echo $block->getCategoryUrl($_category) ?>"<?php if ($block->isCategoryActive($_category)): ?> class="current"<?php endif; ?>>
                                        <img src="<?php echo $block->getCategory($_category)->getImageUrl(); ?>">

<?php echo $block->escapeHtml($_category->getName()) ?>

                                    <?php /* @escapeNotVerified */ echo $_category->getProductCount() ?>

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

<?php endif; ?>

The line I was hoping would work is:

$block->getCategory($_category)->getImageUrl();

However this is returning the image for the current category, not the sub-categories.


texts: Magento 2.3.1 - Cant Save Edits to Product. Nothing Happens

texts:
I am on Magento 2.3.1, with php 7.1

When I edit an existing product, and then click save. Nothing happens when I push save. Its like its not registering. I clicked the other save option (Save & Close), (Save & New), and still nothing happens!

This is happening on two seperate versions of Magento 2.3.1

Any ideas?


texts:
I want to import my CSV. How to import CSV?

My CSV have three column SKU,Product name,Qty When i m import CSV that time i want to update product quantity and Stock Availability. I want to just update product quantity.How to do this?


texts: Magento2 : Any up-to-date Multi-Vendor Marketplaces?

texts:
I'm trying to use Apptha Marketplace for Magento 2 but it doesn't seem to be compatible with PHP 7.2 because of the use of 'Object' in many of the php files.

  Example:  Fatal error: Cannot use Zend\Form\Annotation\Object as
  Object because 'Object' is a special class name in
  public_html/app/code/Apptha/Marketplace/Block/Product/Manage.php on
  line 35

Any recommendations would be greatly appreciated!!


texts: Two checkbox filed column for admin form grid

texts:
I would like to make more then one checkbox for grid in custom form. and grid checkbox value should be passed through form.I have implement it in form grid but it has problem when i click on first checkbox it also trigger for second column checkbox.Check this

My code for this is as below

Layout file.

<warranty_mail_data>
    <block type="core/text_list" name="root" output="toHtml">
        <block type="warranty/adminhtml_warranty_edit_tab_formcustomer" name="warranty.edit.tab.formcustomer" />
        <block type="adminhtml/widget_grid_serializer" name="customer_grid_serializer" >
                <action method="initSerializerBlock">
                    <grid_block_name>shippinggroup.edit.tab.formcustomer</grid_block_name>
                    <data_callback>_getSelectedCustomers</data_callback>
                    <hidden_input_name>links[customer_ids]</hidden_input_name>
                    <reload_param_name>customer</reload_param_name>
                </action>
                <action method="addColumnInputName">
                   <input_name>shouldsentmail</input_name>
               </action>

        </block>
    </block>
</warranty_mail_data>

Form Grid file

$this->addColumn('customer_ids', array(
        'header_css_class'  => 'a-center',
        'type'              => 'checkbox',
        'name'              => 'customer_ids',
        'values'            => $this->_getSelectedCustomers(),
        'align'             => 'center',
        'index'             => 'entity_id'
    ));
   $this->addColumn('shouldsentmail', array(
        'name'              => 'shouldsentmail',
        'type'              => 'checkbox',
        'index'             => 'shouldsentmail',
        'values'            => '',

    ));

Please help me on this.

Edited Debug

Debug Here you can see both have same onclick event object due to this when it post field it has long string and when  try to parse it using magento it gives me long array with contain some script in array element.


texts: Create Add Products input form like in Create new order for Magento 2 using Generic Form

texts:
I have a custom extension that need product grid input form like in create new order like this:

my custom extension have database structure to connect with the product id, so if i want to edit the selected product will be shown like when editing the customer order:

listings
-------
entity_id
listing_name

listedproducts
---------------
entity_id
product_id
listing_id

I want to create this input products form using Generic Form style not UiComponent(xml), is there anyway i can achieve this?


texts: Recent view Product block in Product page from Extention

texts:
I'm new user of magento, I'm developing a ecommerse website www.zinzzy.com, I want to show recent viewed product for same user visited these product in product page as Myntra.com. i have installed atwix recent view product bar extension,that are showing at bottom bar after visiting product page on website.

I want to show these recent view products block in product page only. Have any option to show recent view block in product page.

Please help me any one. Thanks in Advance


texts: How to make plugin not cacheable in magento 2

texts:
I write a plugin for check IP address and make a function aroundDispatch().

Let me clear more this is given below function.
This given one is cached.
    $this->remoteAddress->getRemoteAddress()

public function aroundDispatch(
    \Magento\Framework\App\FrontControllerInterface $subject,
    \Closure $proceed,
    \Magento\Framework\App\RequestInterface $request
) {
    $scopeStores    = ScopeInterface::SCOPE_STORES;
    $currentStoreId = $this->storeManager->getStore()->getId();
    if (!$this->scopeConfig->isSetFlag('amgeoipredirect/general/enable', $scopeStores, $currentStoreId)
        || $this->isNeedToProceed($request)
    ) {
        return $proceed($request);
    }

    $this->applyLogic($request);

    /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
    $resultRedirect = $this->resultRedirectFactory->create();

    $currentStoreId = $this->storeManager->getStore()->getId();

    if ($this->scopeConfig->getValue('amgeoipredirect/general/enable', $scopeStores, $currentStoreId)
        && $this->redirectAllowed
    ) {
        $location = $this->geolocation->locate($this->remoteAddress->getRemoteAddress());
        $country  = $location->getCountry();
        $session = $this->customerSession;
        $countRedirectStore    = 0;
        $countRedirectCurrency = 0;
        $countRedirectUrl      = 0;

Problem is IP is not changing, it is only changed when cache is fllush out.

How to stop caching this plugin file
Anyone have any idea about this.

Thanks


texts: Cardinality violation: 1241 Operand should contain 1 column(s) Magento2

texts:
I get error SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s).
My code is
orderId = $connection->fetchAll('SELECT sales_order.entity_id FROM sales_order INNER JOIN quote_id_mask ON sales_order.quote_id=quote_id_mask.quote_id AND quote_id_mask.masked_id='.$connection->quote($quoteId));


texts: Which function is called when customer is deleted

texts:
I want to know location of function when customer is deleted from:

Multiple customer selected and select delete action on "Manage Customer" page.
Delete single customer from "Edit Customer" page.


texts: Save product attribute where value contains umlaut

texts:
I have an issue where I have multiple values in German containing umlauts and other special characters - Portionsgröße: 30g (ein großer Portionslöffel).

$var = Portionsgröße: 30g (ein großer Portionslöffel);

If I do $product->setData('attribute_name', $var); it only saves part of the text. So in this case it would return - echo $product->getData('attribute_name') - Portionsgr

htmlspecialchars and htmlentities doesn't fix the issue. Any advice


texts: How to add mail subjetct in custom mail on Magento 2

texts:
I try to add mail subject in my custom mail, but i can't find anything  about this.

My code for sending emails looks like this:

$from = array('email' => "info@info.nl", 'name' => 'info');
$this->inlineTranslation->suspend();
$transport = $this->_transportBuilder->setTemplateIdentifier('medipoint_template_lend')
    ->setTemplateVars(['data' => $postObject])
    ->setFrom($from)
     ->addTo($to)
    ->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();

Does anyone know how to add subject to maill?


texts:
I have a slideshow at the top of my product description.

This slideshow uses photos from the images list of the product. I still have a photo gallery. To do the differentiation, the previous programmer uses the following rule : if a photo is excluded from gallery, then it is in slideshow.

This solution was good till now, as now, I want as well to have a photo for my category listing (i.e. small photo) and that photo should be neither in the slideshow nor in the gallery.

For the images, Is there a way to add a column (in backend), similar to the "Exclude" one, so that I can have a column "Slideshow" and restore the Exclude functionality to its original.

While I'm at it, how should I do then to fetch this so defined Slideshow list?


texts:
I have a simple uiCOmponent that I added to the checkout Layout to display in the jsLayout.
The code looks like this.
component.html

component.js
define([
    'uiElement'
], function(Component) {
    'use strict';
    return Component.extend({
        initialize: function () {
            this._super();
            // component initialization logic
            this.cart = [
                {'sku': '123456', 'delivery_status': 'available'},
                {'sku': '223456', 'delivery_status': 'available'},
                {'sku': '323456', 'delivery_status': 'unavailable'}
            ];
            //Testcode
            this.estimate(this.cart);
            this.estimation = `Test: ${this.cart[0].sku}`;
            return this;
        },

        estimate: function (cartData) {
            console.log(cartData);
        }
    });
});

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

        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="component" xsi:type="array">
                                     <item name="sortOrder" xsi:type="string">0</item>
                                     <item name="component" xsi:type="string">Vendor_Module/js/view/component</item>
                                     <item name="template" xsi:type="string">Vendor_Module/component</item>
                                     <item name="displayArea" xsi:type="string">componentDisplayArea</item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>

</page>

onepage.html

This works completely fine so far.
Now what I need but can't figure out is how to pass data from the server to my script.
To be more specific, I need an array of all items in the cart and their delivery status, as well as the current server time.
I know how I could pass parameters to the js when I am calling the js from a .phtml template since that's not the case here, how can I get the data in this scenario?
Update:
I need information on which products are in the cart and whether they are available or not.
We have products that we don't keep in stock, so thats what the estimated delivery time depends on.
Which is the goal of the uiComponent -> estimating delivery time.
Also I need some pre formatted and calculated timestamps, because I already have the logic working in php for another section of the page and figured, if I already have to pass server parameters to my uiComponent I might as well just transfer those as well so I dont have to rebuild the logic in js
 (I've read somewhere that processing Dates and timezones in js might be messy because browsers handle it differently?! but i don't know how much of an issue that is actually)


texts: How to add a recaptcha to magento 1 newsletter form

texts:
I'm trying to add recaptcha to the default magento 1.9 subscribe.phtml file. I've added the JS via the misc scripts in the administration, and I've added the site key to the form, however it's not picking it up.

Is this because of the VarianForm validation?

How would I get recaptcha to work with the newsletter subscription form?

<form action="/newsletter/subscriber/new/" method="post">

                <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" />

            <button type="submit" title="<?php echo $this->__('Join') ?>" class="button btn-inline"><?php echo $this->__('Join') ?></button>

</form>


texts:
How to access subcategory without having url-key of the parent category in the url?
for example

aboutus---parent category
  about vc---sub category
  about gurkha---sub category

Now I have to redirect sub category to page named about-vc and about-gurkha without going through parent category.link should open like this

magento.com/index.php/about-vc
magento.com/index.php/about-gurkha

not like

magento.com/index.php/about-us/about-vc

Thank You


texts:
I've been searching for a few days now for a solution to this.
Lets say I have a block on the front page, and click on it. It should then take me to a page with a group of specifically selected products, shown just like a category page (the products can be selected from the list of all products).

Is it possible to find an extension that does this? Or do I have to code it myself?

Regards, Adam.


texts: What is the best way to determine if a script is being run by cron in Magento2?

texts:
I need a piece of code to execute differently if it's being run by cron, what is the best way to check programmatically that cron is the execution source?
I know that it can be done by checking for website or session being unavailable, but I'm concerned these seem a bit hacky.  I'm wondering if there's some clean isRunningFromCron kind of function that abstracts this to dependency-inject, or if the aforementioned hacks would be robust enough that I'm being over-cautious.
Thanks!
EDIT:
It may actually not be possible to use the current store ID check in my circumstance, as the script is otherwise being run from adminhtml, which I think would also have a store_id of 0


texts: Magento Attribute (Display Name and actual passed variable)

texts:
We need to be able to define an attribute for an internal use reference name but pass an alternative variable elsewhere.

For Example:

Item Condition (Displayed Internally when creating product):

New
Refurbished
Used

Alternate Variable Passed

1000
2000
3000

The marketplace that we feed some of our inventory down requires this field but in the numeric format. Don't want to leave room for mistakes when selecting this.

We will create this attribute field separately and only for this inventory type in the attribute set.

Kudos for an extension that's available that makes this very easy rather than coding specifically each time we have the need.

Thanks in advance for time and responses. It's much appreciated!

** Using Magento 1.8.1


texts: when i run magento using xampp it shows Fatal error: Uncaught Exception: Deprecated Functionality:

texts:
Fatal error:
 Uncaught Exception: Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in

  C:\xampp\htdocs\magento\vendor\colinmollenhour\cache-backend-file\File.php on line 81 in C:\xampp\htdocs\magento\vendor\magento\framework\App\ErrorHandler.php:61 Stack trace: #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(8192, 'The each() func...', 'C:\xampp\htdocs...', 81, Array) #1 C:\xampp\htdocs\magento\vendor\colinmollenhour\cache-backend-file\File.php(81): each(Array) #2 C:\xampp\htdocs\magento\vendor\magento\zendframework1\library\Zend\Cache.php(153): Cm_Cache_Backend_File->__construct(Array) #3 C:\xampp\htdocs\magento\vendor\magento\zendframework1\library\Zend\Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true) #4 C:\xampp\htdocs\magento\vendor\magento\framework\App\Cache\Frontend\Factory.php(156): Zend_Cache::factory('Magento\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, true, true) #5 C:\xampp\htdocs\magent in C:\xampp\htdocs\magento\vendor\magento\framework\App\ErrorHandler.php on line 61


texts: PayPal Orders Not Triggering New Order Emails, Magento 1.14.3.10

texts: When receiving orders via PayPal Express checkout the customers are not receiving a new order email. The new order emails work correctly when orders are paid via Sagepay. Currently having to go into each PayPal order and click the "Send Email" button, otherwise the customer won't receive the new order email. Any idea what I could check or change to correct this issue?